[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Using initrd as livefs_root



Hi Lukas,


I suggest you create an additional cpio archive (newc format) which
just contains the filesystem.squashfs file (in the appropriate folder)
and nothing else.

Now you have multiple options:

1. Most bootloaders have an option of specifying more than one file as
   initramfs; just try adding your cpio archive as a second file (check
   your bootloader's documentation).

2. Alternatively you can compress the new archive and append that to
   the existing initrd, using something like

       gzip --fast -c YOURARCHIVE.cpio >> initrd.img

3. You can do the same as (2) without the compression (which makes
   more sense since the squashfs file is already compressed), but then
   you might have to add null bytes to initrd.img first so the archive
   is properly aligned (see [1])


Option 2 sounds like an elegant solution. I tried it but it didn't seem to work, I did this (after building images with live-build in ~/lbinitrd):

echo ~/lbinitrd/binary/live/filesystem.squashfs | cpio -o -H newc | gzip -9 > filesystem.cpio.gz
cat filesystem.cpio.gz >> initrd.img

That should be the same as option 2?

At boot I get an error message, "(initramfs) Unable to find a medium containing a live file system". I'm guessing that the contents of the appended cpio archive isn't added to the initramfs.
 
Cheers,
Daniel

Reply to: