On 10/20/2018 01:19 PM, Stefan Baur wrote:
Hi List, I would like to add two files (the same in two locations, actually) to the initrd of the image I am creating. Manually, I can do that by unpacking the initrd, adding them, and packing it up again. Maybe concatenating another cpio archive with my additions would work, too. However, I was wondering if there is a way to get these files included during "lb build"? I need to place files in /lib/live/boot/ and /bin/boot/ of the initrd, since I have a piece of particularly stubborn hardware that needs some prodding early on to get it to work. Could anyone tell me what the proper way to add these files would be? Kind Regards & Thanks in Advance Stefan Baur
I'm not sure about those specific locations but the offical way to modify the initramfs image is using initramfs-tools hook and boot scripts. Hook scripts are ran during build time to modify contents of the image and boot scripts are ran in boot time at specific stages. You can decide which one is appropriate for your use case and place the script you write in the relevant subdirectory of /etc/initramfs-tools/. You can find the detailed documentation at initramfs-tools(8) man page.
To do the same thing in live-build you need to place your scripts inside includes.chroot/etc/initramfs-tools, because initramfs image is generated by the initramfs-tools inside the chroot. Otherwise it will proceed the same.