To add to #14 comment, a file in /var/lib/initramfs-tools also gets generated if the host kernel differs from the chroot environments kernel.
In my case I'm running a Debian system with the 4.9.0-6-amd64 kernel and a Ubuntu (Xenial) chroot environment with the 4.4.0-127-generic kernel. When installing the nvidia-384 package inside the chroot environment the /var/lib/initramfs-tools/4.9.0-6-amd64 file gets generated. # ls -l /initrd.img lrwxrwxrwx 1 root root 29 Apr 5 11:31 /initrd.img -> boot/initrd.img-4.9.0-6-amd64 # ls -l /target/initrd.img lrwxrwxrwx 1 root root 33 Jun 8 23:03 /target/initrd.img -> boot/initrd.img-4.4.0-127-generic # ls -l /target/var/lib/initramfs-tools/ total 8 -rw-r--r-- 1 root root 77 Jun 8 23:06 4.4.0-127-generic -rw-r--r-- 1 root root 73 Jun 8 23:08 4.9.0-6-amd64 (/target is the chroot environment) The /var/lib/initramfs-tools/4.9.0-6-amd64 file is dangerous since update-initramfs will think that it's a valid existing kernel and produce errors as the following that will prevent updating the initrd in the future. # chroot /target sh-4.3# update-initramfs -u update-initramfs: Generating /boot/initrd.img-4.9.0-6-amd64 WARNING: missing /lib/modules/4.9.0-6-amd64 Ensure all necessary drivers are built into the linux image! depmod: ERROR: could not open directory /lib/modules/4.9.0-6-amd64: No such file or directory depmod: FATAL: could not search modules: No such file or directory depmod: WARNING: could not open /var/tmp/mkinitramfs_s6nF9f/lib/modules/4.9.0-6-amd64/modules.order: No such file or directory depmod: WARNING: could not open /var/tmp/mkinitramfs_s6nF9f/lib/modules/4.9.0-6-amd64/modules.builtin: No such file or directory -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to nvidia-graphics-drivers in Ubuntu. https://bugs.launchpad.net/bugs/556653 Title: build fails in chrooted system Status in fglrx-installer package in Ubuntu: Fix Released Status in nvidia-graphics-drivers package in Ubuntu: Fix Released Status in nvidia-graphics-drivers-173 package in Ubuntu: Fix Released Status in nvidia-graphics-drivers-96 package in Ubuntu: Fix Released Bug description: When installing nvidia-96 on a chrooted lucid system, update-initramfs is called with host kernel version instead of chroot kernel version. Current chroot kernel version is correctly identified, but an error in a variable name prevents the configuration to be successful: if [ -n "$NEWEST_KERNEL" ] && [ ${CURRENT_KERNEL} != ${NEWEST_KERNEL} ]; then update-initramfs -u -k $CURRENT_KERNEL fi should read: if [ -n "$NEWEST_KERNEL" ] && [ ${CURRENT_KERNEL} != ${NEWEST_KERNEL} ]; then update-initramfs -u -k $NEWEST_KERNEL fi To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/fglrx-installer/+bug/556653/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : [email protected] Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp

