bluesdog
06-26-2009, 12:44 PM
Custom Debian (unstable) kernel kpkg installation may fail to create an initrd image if appropriate initramfs scripts are not present, even if the --initrd switch is included in the make-kpkg command string.
This results in a kernel panic if your system requires an initrd on startup.
According to man make-kpkg: --initrd
If make-kpkg is generating a kernel-image package, arrange to convey to the hook scripts run from the post installation maintainer scripts that this image requires an initrd, and that the initrd generation hook scripts should not short circuit early. Without this option, the example initramfs hook scripts bundled in with kernel-package will take no action on installation. The same effect can be achieved by setting the environment variable INITRD to any non empty value. Please note that unless there are hook scripts in /etc/kenel or added into the hook script parameter of /etc/kernel-img.conf. no initrd will be created (the bundled in example scripts are just examples -- user action is required before anything happens).There are appropriate 'example' scripts for most normal kernel build configurations, but they are not available to initramfs-tools by default.
This, (annoyingly), differs from previous initramfs-tools (stable) in which they apparently were.
To ensure automatic initrd generation, copy the provided example scripts to the appropriate locations as follows:
As root, or sudo --
cp /usr/share/kernel-package/examples/etc/kernel/postinst.d/ initramfs /etc/kernel/postinst.d/
cp /usr/share/kernel-package/examples/etc/kernel/postrm.d/ initramfs /etc/kernel/postrm.d/ Now you may proceed with kernel package build, include --initrd in the command, and dpkg will automatically generate an initrd for the new kernel upon installation.
This results in a kernel panic if your system requires an initrd on startup.
According to man make-kpkg: --initrd
If make-kpkg is generating a kernel-image package, arrange to convey to the hook scripts run from the post installation maintainer scripts that this image requires an initrd, and that the initrd generation hook scripts should not short circuit early. Without this option, the example initramfs hook scripts bundled in with kernel-package will take no action on installation. The same effect can be achieved by setting the environment variable INITRD to any non empty value. Please note that unless there are hook scripts in /etc/kenel or added into the hook script parameter of /etc/kernel-img.conf. no initrd will be created (the bundled in example scripts are just examples -- user action is required before anything happens).There are appropriate 'example' scripts for most normal kernel build configurations, but they are not available to initramfs-tools by default.
This, (annoyingly), differs from previous initramfs-tools (stable) in which they apparently were.
To ensure automatic initrd generation, copy the provided example scripts to the appropriate locations as follows:
As root, or sudo --
cp /usr/share/kernel-package/examples/etc/kernel/postinst.d/ initramfs /etc/kernel/postinst.d/
cp /usr/share/kernel-package/examples/etc/kernel/postrm.d/ initramfs /etc/kernel/postrm.d/ Now you may proceed with kernel package build, include --initrd in the command, and dpkg will automatically generate an initrd for the new kernel upon installation.