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 Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/556653 Title: build fails in chrooted system To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/fglrx-installer/+bug/556653/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs