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

Re: Using initrd as livefs_root



Hi Daniel,

On Fri, 19 May 2017 11:50:35 +0200
Daniel Lindgren <bd.dali@gmail.com> wrote:
> 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?

Mostly, except that the path to filesystem.squashfs in the initrd will
not be correct.  Something like this should yield the correct path:

    (cd ~/lbinitrd/binary; echo live/filesystem.squashfs | cpio -o -H newc) | \
        gzip --fast > filesystem.cpio.gz

I would bother using a high compression here, it's just a waste of CPU
resources as the filesystem.squashfs is already compressed.

> 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.

If you still get that error after trying what I suggested above, you can
add »break« to the Linux command line parameters.  This will spawn a
shell during the early boot stage.  Once you get the shell check if
/live/filesystem.squashfs exists.

Regards
Lukas

Attachment: pgp4vqau227UY.pgp
Description: OpenPGP digital signature


Reply to: