First of all I enjoy using genkernel! I recommend adding a initrd_prepack script to genkernel.conf so that genkernel will execute this script with the mounted location of the initrd image just before it shrink and comporess it. I also recommend adding argument that forces genkernel to re-create its cache (Or check time stamp of cached files and compare them to source and config) Reproducible: Always Steps to Reproduce: Expected Results: If you will add prepack script to genkernel.conf users will be able to add files modify linkes to initrd in a simple way, as part of the kernel generate procedure. This without the need to remount the initrd copy its content, create a larger initrd, copy original initrd contents, modify contents and pack it again. I had needed it when I tried to create my custom initrd. I needed to use "stty -echo" in my initrd and add my own module to initrd and some file. genkernel default configuration for busybox does not have stty enabled... So I've enabled this (this was simple enough), but then discovered that the /bin/XXX linkes to busybox are hardcoded in genkernel scripts. I've also needed to copy a module and some files to the initrd and couldn't. All these issues can be solved using a script that can be configured to run before genkernel pack the initrd.
Look into genkernel-3.2.0_pre5 and --initramfs_overlay=<...> -- if that doesn't do what you need it to, please reopen this bug. Thanks!
Thank you for your reply. As I understand this replaces genkernel's initrd. I like the initrd that genkernel creates! It has all the basics... It saves me a lot of work. I just need to modify it (a little)... So if there was a script (callback or something) that allows me to add files, devices, links before it being packed it would be super! I guess the right place is to add parameter like --initrd-callback=xxx that runs a specific command before initrd is packed, it should get the file system where initrd files exists.
No, it doesn't replace, it concatenates onto the one genkernel builds :)
Hi! I've installed version 3.2.0_pre9, found that it always compiles initramfs... So it took me a while to convert my stuff to initramfs, and it working fine! I loved the new splash behavior. The new initramfs_overlay allows me to add new devices and files as you suggested. A few comments: 1. [Maybe it is silly question] I added a stty applet to busybox... How can I use initramfs_overlay in order to create hard link of busybox to stty? 2. Can you consider adding stty to default configuration of busybox? (It is handy when prompting the user for password). 3. There is newer busybox ebuild available, why do you use the old one in genkernel? (The new one support mount bind) 4. I see you added %%ARCH%% to kernel image name... I think you may consider adding it to initramfs image too, so both will have the same prefix. 5. Is it safe to remove /lib/modules/* from initramfs while modules that where loaded from there run? (This happens just before the end of the linuxrc script). Thanks!
Hi! I've installed version 3.2.0_pre9, found that it always compiles initramfs... So it took me a while to convert my stuff to initramfs, and it working fine! I loved the new splash behavior. The new initramfs_overlay allows me to add new devices and files as you suggested. A few comments: 1. [Maybe it is silly question] I added a stty applet to busybox... How can I use initramfs_overlay in order to create hard link of busybox to stty? This should link automatically. The new linuxrc should have taken care of it since your using an initramfs. 2. Can you consider adding stty to default configuration of busybox? (It is handy when prompting the user for password). We are trying to keep the size down for livecd's and machines with less ram. and you can override the busybox config so this probably wont change. 3. There is newer busybox ebuild available, why do you use the old one in genkernel? (The new one support mount bind) We have to test it. and there are a few patches that we need to make sure work with the new busybox or are fixed already. Basically we havent had time. if you want to try it go ahead and let us know how it worked. 4. I see you added %%ARCH%% to kernel image name... I think you may consider adding it to initramfs image too, so both will have the same prefix. It should be naming the initramfs image with arch as well. 5. Is it safe to remove /lib/modules/* from initramfs while modules that where loaded from there run? (This happens just before the end of the linuxrc script). Yes since these are loaded into memory and this is what other distros do as well. This reclaims some of the ramdisk used for the initramfs otherwise it would keep the ram in use and your machine would look like it had less. Thanks!
Thanks you for your comments! I am closing this request.
Closed.