------- Comment From niklas.schne...@ibm.com 2021-04-27 09:16 EDT-------
I just tested the installkernel script on Ubuntu 20.04 + Focal Proposed
with linux-base 4.5ubuntu3.2.

I performed the following testing on a s390x z15 LPAR:

# 5.12.0-07600-g75079231a966.tar is a tar of the modules compiled on another 
system
% ls
5.12.0-07600-g75079231a966.tar  System.map  bzImage
% tar -xavf 5.12.0-07600-g75079231a966.tar -C /usr/
% installkernel 5.12.0-07600-g75079231a966 bzImage System.map /boot

After that with the previous linux-base version I see the following:
%  ls -la /boot
total 68556
drwxr-xr-x  2 root root     4096 Apr 27 12:56 .
drwxr-xr-x 20 root root     4096 Apr 27 08:33 ..
-rw-r--r--  1 root root  4475596 Apr 27 12:56 
System.map-5.12.0-07600-g75079231a966
-rw-------  1 root root  3099673 Apr 12 15:12 System.map-5.4.0-72-generic
-rw-------  1 root root    45056 Apr 27 12:56 bootmap
-rw-r--r--  1 root root    90468 Apr 12 15:12 config-5.4.0-72-generic
lrwxrwxrwx  1 root root       27 Apr 27 08:34 initrd.img -> 
initrd.img-5.4.0-72-generic
-rw-r--r--  1 root root 20356043 Apr 27 12:56 
initrd.img-5.12.0-07600-g75079231a966
-rw-r--r--  1 root root 24196892 Apr 27 12:46 initrd.img-5.4.0-72-generic
lrwxrwxrwx  1 root root       27 Apr 27 08:34 initrd.img.old -> 
initrd.img-5.4.0-72-generic
lrwxrwxrwx  1 root root       34 Apr 27 12:56 vmlinuz -> 
vmlinuz-5.12.0-07600-g75079231a966
-rw-r--r--  1 root root  9744384 Apr 27 12:56 vmlinuz-5.12.0-07600-g75079231a966
-rw-------  1 root root  8172088 Apr 12 16:56 vmlinuz-5.4.0-72-generic
lrwxrwxrwx  1 root root       24 Apr 27 08:34 vmlinuz.old -> 
vmlinuz-5.4.0-72-generic

Note the wrong initrd.img symlink still pointing at
initrd.img-5.4.0-72-generic

After the upate and performing the same steps again I get:

%  ls -la /boot
total 117188
drwxr-xr-x  2 root root     4096 Apr 27 13:13 .
drwxr-xr-x 20 root root     4096 Apr 27 08:33 ..
-rw-r--r--  1 root root  4475596 Apr 27 13:13 
System.map-5.12.0-07600-g75079231a966
-rw-r--r--  1 root root  4475596 Apr 27 12:56 
System.map-5.12.0-07600-g75079231a966.old
-rw-------  1 root root  3099673 Apr 12 15:12 System.map-5.4.0-72-generic
-rw-------  1 root root  3100152 Apr 14 16:35 System.map-5.4.0-73-generic
-rw-------  1 root root    45056 Apr 27 13:13 bootmap
-rw-r--r--  1 root root    90468 Apr 12 15:12 config-5.4.0-72-generic
-rw-r--r--  1 root root    90468 Apr 14 16:35 config-5.4.0-73-generic
lrwxrwxrwx  1 root root       27 Apr 27 13:03 initrd.img -> 
initrd.img-5.4.0-73-generic
-rw-r--r--  1 root root 20355627 Apr 27 13:13 
initrd.img-5.12.0-07600-g75079231a966
-rw-r--r--  1 root root 24196892 Apr 27 12:46 initrd.img-5.4.0-72-generic
-rw-r--r--  1 root root 24204650 Apr 27 13:04 initrd.img-5.4.0-73-generic
lrwxrwxrwx  1 root root       37 Apr 27 13:03 initrd.img.old -> 
initrd.img-5.12.0-07600-g75079231a966
lrwxrwxrwx  1 root root       34 Apr 27 13:13 vmlinuz -> 
vmlinuz-5.12.0-07600-g75079231a966
-rw-r--r--  1 root root  9744384 Apr 27 13:13 vmlinuz-5.12.0-07600-g75079231a966
-rw-r--r--  1 root root  9744384 Apr 27 12:56 
vmlinuz-5.12.0-07600-g75079231a966.old
-rw-------  1 root root  8172088 Apr 12 16:56 vmlinuz-5.4.0-72-generic
-rw-------  1 root root  8172088 Apr 14 16:37 vmlinuz-5.4.0-73-generic
lrwxrwxrwx  1 root root       24 Apr 27 13:03 vmlinuz.old -> 
vmlinuz-5.4.0-73-generic

So this does NOT seem to be fixed. Do note that during the dpkg based
kernel install the symlink is updated correctly as can be seen by the
symlink after installing Proposed updates now pointing to
initrd.img-5.4.0-73-generic.

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux-base in Ubuntu.
https://bugs.launchpad.net/bugs/1877088

Title:
  [UBUNTU 20.04] installkernel script does not symlink /boot/initrd.img
  which is required with the default zipl.conf

Status in Ubuntu on IBM z Systems:
  Fix Committed
Status in linux-base package in Ubuntu:
  Fix Released
Status in linux-base source package in Bionic:
  Fix Committed
Status in linux-base source package in Focal:
  Fix Committed
Status in linux-base source package in Hirsute:
  Fix Released

Bug description:
  [Impact]

  * initrd link is not updated when using installkernel or "make
  install" from kernel sources. This leads to boot failure after
  installing a new kernel with mentioned methods because the kernel does
  not match initrd.

  * It's a regression because for Focal it was working before.

  * Issue was reproduced also on Bionic.

  * The proposed fixed by Stefan Bader adds a hook in
  /etc/kernel/postinst.d/ so installkernel will relink the initrd. The
  kernel DEB packages should not be affected.

  * The solution from Stefan (first patch) was tested by the bug
  reporter (niklas.schne...@ibm.com).

  [Test Plan]

  * Build a kernel
  * sudo installkernel 5.7.0-rc4-06500-gb67ea026badd bzImage System.map /boot
  * Check if /boot/initrd or /initrd symlink to the new initrd

  [Where problems could occur]

  * Installing kernel via: installkernel or "make install", so mostly
  kernel developer environments

  [Other info from developer]

  When testing development kernels I usually rely on the installkernel
  script either through the "make install" target of the Kernel source
  or manually. This used to work great on Ubuntu on Z.

  On Ubuntu 20.04 (freshly installed up to date) this fails however because
  /boot/initrd.img is not updated (/boot/vmlinuz is) and thus zipl installs the
  wrong kernel/initrd combination rendering the system unbootable.

  (with the correct modules already copied to 
/usr/lib/modules/5.7.0-rc4-06500-gb67ea026badd/)
  # sudo installkernel 5.7.0-rc4-06500-gb67ea026badd bzImage System.map /boot
  run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 
5.7.0-rc4-06500-gb67ea026badd /boot/vmlinuz-5.7.0-rc4-06500-gb67ea026badd
  run-parts: executing /etc/kernel/postinst.d/initramfs-tools 
5.7.0-rc4-06500-gb67ea026badd /boot/vmlinuz-5.7.0-rc4-06500-gb67ea026badd
  update-initramfs: Generating /boot/initrd.img-5.7.0-rc4-06500-gb67ea026badd
  Using config file '/etc/zipl.conf'
  Building bootmap in '/boot'
  Building menu 'menu'
  Adding #1: IPL section 'ubuntu' (default)
  Adding #2: IPL section 'old'
  Preparing boot device: dasda (3844).
  Done.
  run-parts: executing /etc/kernel/postinst.d/zz-zipl 
5.7.0-rc4-06500-gb67ea026badd /boot/vmlinuz-5.7.0-rc4-06500-gb67ea026badd
  Using config file '/etc/zipl.conf'
  Building bootmap in '/boot'
  Building menu 'menu'
  Adding #1: IPL section 'ubuntu' (default)
  Adding #2: IPL section 'old'
  Preparing boot device: dasda (3844).
  Done.
  # ls -l /boot
  total 178364
  -rw------- 1 root root    135168 May  6 11:52 bootmap
  -rw-r--r-- 1 root root     90471 Apr 29 15:34 config-5.4.0-29-generic
  lrwxrwxrwx 1 root root        27 May  6 11:40 initrd.img -> 
initrd.img-5.4.0-29-generic   <====== should point to new version
  -rw-r--r-- 1 root root  19663996 May  6 11:42 initrd.img-5.4.0-29-generic
  -rw-r--r-- 1 root root 125339494 May  6 11:52 
initrd.img-5.7.0-rc4-06500-gb67ea026badd
  lrwxrwxrwx 1 root root        27 May  6 11:40 initrd.img.old -> 
initrd.img-5.4.0-29-generic
  -rw------- 1 root root   3087920 Apr 29 15:34 System.map-5.4.0-29-generic
  -rw-r--r-- 1 root root   4031691 May  6 11:52 
System.map-5.7.0-rc4-06500-gb67ea026badd
  -rw-r--r-- 1 root root   4031691 May  6 11:49 
System.map-5.7.0-rc4-06500-gb67ea026badd.old
  lrwxrwxrwx 1 root root        37 May  6 11:52 vmlinuz -> 
vmlinuz-5.7.0-rc4-06500-gb67ea026badd
  -rw------- 1 root root   8086072 Apr 29 15:54 vmlinuz-5.4.0-29-generic
  -rw-r--r-- 1 root root   9080832 May  6 11:52 
vmlinuz-5.7.0-rc4-06500-gb67ea026badd
  -rw-r--r-- 1 root root   9080832 May  6 11:49 
vmlinuz-5.7.0-rc4-06500-gb67ea026badd.old
  lrwxrwxrwx 1 root root        41 May  6 11:52 vmlinuz.old -> 
vmlinuz-5.7.0-rc4-06500-gb67ea026badd.old

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-z-systems/+bug/1877088/+subscriptions

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to