pop-os / pop

A project for managing all Pop!_OS sources
https://system76.com/pop
2.48k stars 87 forks source link

update-initramfs and kernelstub don't update the same initrd.img #872

Open hsieger opened 4 years ago

hsieger commented 4 years ago

Distribution (run cat /etc/os-release):

NAME="Pop!_OS" VERSION="19.10" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Pop!_OS 19.10" VERSION_ID="19.10" HOME_URL="https://system76.com/pop" SUPPORT_URL="http://support.system76.com" BUG_REPORT_URL="https://github.com/pop-os/pop/issues" PRIVACY_POLICY_URL="https://system76.com/privacy" VERSION_CODENAME=eoan UBUNTU_CODENAME=eoan LOGO=distributor-logo-pop-os

Related Application and/or Package Version (run apt policy $PACKAGE NAME):

kernelstub version 3.1.2~1578423034~19.10~9086739

Issue/Bug Description:

Issue no. 1:

update-initramfs updates only the image in /boot, but not the image in /boot/efi/EFI/Pop_OS-/

The result is that any changes done to the initramfs are not affecting the initramfs that is actually used for booting.

Issue no. 2:

kernelstub -a "whatever" does trigger the creation of a new initramfs, but this time ONLY inside /boot/efi/EFI/Pop_OS-/

The image in /boot is unaffected!

kernelstub installed files shows:

/etc/initramfs /etc/initramfs/post-update.d /etc/initramfs/post-update.d/zz-kernelstub

but they are missing!

On the other hand, the following do exist:

/etc/kernel /etc/kernel/postinst.d /etc/kernel/postinst.d/zz-kernelstub

Steps to reproduce (if you know):

Which files have been updated by kernelstub -a ???

kernelstub -a ... run on Mar 14, 14:13

root@pop-os:~ ls -l /boot/efi/EFI/Pop_OS-/ total 180572 -rwx------ 1 root root 167 Mar 14 14:13 cmdline -rwx------ 1 root root 81012433 Mar 14 14:13 initrd.img -rwx------ 1 root root 81085603 Mar 14 01:57 initrd.img-previous -rwx------ 1 root root 11398016 Mar 14 14:13 vmlinuz.efi -rwx------ 1 root root 11398016 Mar 14 01:57 vmlinuz-previous.efi root@pop-os:~ ls -l /boot/ total 190164 -rw-r--r-- 1 root root 235833 Dec 19 16:56 config-5.3.0-7625-generic -rw-r--r-- 1 root root 235833 Feb 13 21:20 config-5.3.0-7629-generic drwx------ 5 root root 4096 Jan 1 1970 efi lrwxrwxrwx 1 root root 29 Mar 14 11:36 initrd.img -> initrd.img-5.3.0-7629-generic -rw-r--r-- 1 root root 81012130 Mar 14 11:37 initrd.img-5.3.0-7625-generic -rw-r--r-- 1 root root 81012433 Mar 14 11:37 initrd.img-5.3.0-7629-generic lrwxrwxrwx 1 root root 29 Jan 31 20:31 initrd.img.old -> initrd.img-5.3.0-7625-generic -rw------- 1 root root 4707483 Dec 19 16:56 System.map-5.3.0-7625-generic -rw------- 1 root root 4707483 Feb 13 21:20 System.map-5.3.0-7629-generic lrwxrwxrwx 1 root root 26 Mar 14 11:36 vmlinuz -> vmlinuz-5.3.0-7629-generic -rw------- 1 root root 11398016 Dec 19 16:56 vmlinuz-5.3.0-7625-generic -rw------- 1 root root 11398016 Feb 13 21:20 vmlinuz-5.3.0-7629-generic lrwxrwxrwx 1 root root 26 Jan 31 20:31 vmlinuz.old -> vmlinuz-5.3.0-7625-generic

kernelstub_-a__updated files.txt

update-initramfs-c-k_all__updated files.txt

The following command updates the kernel and initrd.img in /boot/efi/EFI/Pop_OS-/ :

kernelstub -k /boot/vmlinuz -i /boot/initrd.img

Expected behavior:

  1. Both update-initramfs -u or update-initramfs -c -k all should also update /boot/efi/EFI/Pop_OS-/

  2. kernelstub should also update /boot/initrd.img-5.3.0-7629-generic

Other Notes:

Pop OS documentation for system repair uses update-initramfs, but this clearly doesn't work on my system.

kernelstub -k /boot/vmlinuz -i /boot/initrd.img

copies the initrd.img and vmlinuz from /boot to /boot/efi/EFI/Pop_OS-/

This last step should not be necessary.

miquella commented 4 years ago

For what it's worth, I believe this issue may have been behind a boot failure I experienced today after upgrading Nvidia drivers from 440.40 to 440.59.


Everything I tried (including update-initramfs -c -k all as well as purging, rebooting, and reinstalling the Nvidia packages) always resulted in the same issue:

$ nvidia-smi
NVML: Driver/library version mismatch

All the while the kernel was complaining about an API mismatch:

NVRM: API mismatch: the client has the version 440.59, but
NVRM: this kernel module has the version 440.44.  Please
NVRM: make sure that this kernel module and all NVIDIA driver
NVRM: components have the same version.

Curiously, if I removed the Nvidia kernel modules and re-installed them, everything would work fine (at least until I rebooted):

$ sudo rmmod nvidia_drm nvidia_uvm nvidia_modeset nvidia
$ sudo insmod /lib/modules/5.3.0-7642-generic/updates/dkms/nvidia.ko
$ nvidia-smi
+----------------------------------------------------------------------------+
| NVIDIA-SMI 440.59       Driver Version: 440.59      CUDA Version: 10.2     |
|----------------------------------------------------------------------------|
…

Finally, I ran across a thread suggesting to run kernelstub in addition to update-initramfs citing:

… It should run automatically as part of the regeneration process, but it's fast and won't hurt anything to run it again.

Low and behold, my initrd was properly updated with the new driver and the system booted cleanly!

Armed with this information, it only took me a minute or two to find this issue. So I figured I would add my details here in case it helps anyone else or helps to give color to this issue.


System Info: Dell XPS 15 7590 Pop!_OS 19.10 (Nvidia)