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

Re: Using initrd as livefs_root



On 05/18/2017 03:12 PM, Daniel Lindgren wrote:
Hi.

A couple of years ago I found a need for using initrd as livefs_root, I
sent a patch but it wasn't accepted (see
https://lists.debian.org/debian-live/2014/09/msg00080.html).

Since then I've used live-build in Debian 7 to build images, manually
unpacked initrd.img, added filesystem.squashfs and repacked initrd.img.

The kernel in Debian 7 is getting old and we have new hardware that the
kernel lacks network drivers for.

I installed Debian 8.8 and tried to use the same method as before, but
the initrd.img file seems to be a concatenation of several cpio archives
and I can't seem to repack it succesfully. I've googled for a solution,
haven't found one.

I've tried a new approach; build a live-build image, copy
filesystem.squashfs to a new build directory (under
conf/includes.binary) and build a new image, but it isn't included in
the initrd.img file. According to the manual it looks possible, section
12.3 states "Additional or replacement files and directories may be
included in the installer initrd as well, in a similar fashion to
Live/chroot local includes, by placing the material in
config/includes.installer/."

Is it possible to include filesystem.squashfs in initrd.img using
live-build?

Cheers,
Daniel


live-boot initramfs hooks check the /live/filesystem.squashfs file by default. And you can add files to initramfs simply by appending it to the existing file (no need to unpack & repack).

I already do this for quite some time and this is roughly the code I use:

echo live/filesystem.squashfs | cpio -o -H newc | gzip -1 > $live_initrd
        cat $org_initrd $live_initrd > $new_initrd

Replace the original initramfs image with the newly created one and there is no need for any other changes, it'll just work.


Reply to: