On a given system we can have the following symlinks

/vmlinuz.old -> boot/vmlinuz-4.15.0-144-lowlatency
/vmlinuz -> boot/vmlinuz-4.15.0-144-generic
/boot/vmlinuz.old -> vmlinuz-4.15.0-144-lowlatency
/boot/vmlinuz -> vmlinuz-4.15.0-144-generic

which is controlled by /etc/kernel-img.conf setting link_in_boot. The
compiled-in default, and the setting that installers set has changed.
Thus depending which release one installed either cases might be
present.

And they should all work.

Testing the proposed patch:

linknames() {
        tgt_kernel="$1"
        echo old "initrd.img${tgt_kernel#vmlinu?}"
        echo new "${tgt_kernel%/*}/initrd.img${tgt_kernel#*vmlinu?}"
}
linknames boot/vmlinuz-5.11
linknames vmlinuz-5.11

produces

old initrd.imgboot/vmlinuz-5.11
new boot/initrd.img-5.11
old initrd.img-5.11
new vmlinuz-5.11/initrd.img-5.11

meaning it fixes the case of link_in_boot = no; but regresses the
link_in_boot = yes case.

-- 
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/1929255

Title:
  update-initrd-links creates incorrect symlinks

Status in linux-base package in Ubuntu:
  Confirmed
Status in linux-base source package in Bionic:
  Confirmed

Bug description:
  ## Problem description

  Executing the `/etc/kernel/postinst.d/xx-update-initrd-links` script
  incorrectly detects symbolic links targets and then creates malformed
  (hence broken) ones instead:

  /initrd.img -> initrd.imgboot/vmlinuz-5.3.0-53-generic
  /initrd.img.old -> initrd.imgboot/vmlinuz-5.3.0-53-generic

  while it should actually be:

  /initrd.img -> boot/initrd.img-5.3.0-53-generic
  /initrd.img.old -> boot/initrd.img-5.3.0-53-generic

  The problem appeared with the release of the version 4.5ubuntu1.5 of
  the linux-base package, which made this script executable.

  ## Solution

  A solution is proposed through the attached patch file.

  ## System information

  Description:  Ubuntu 18.04.5 LTS
  Release:      18.04
  Uname: Linux 5.3.0-53-generic x86_64

  ## Package information

  Package: linux-base 4.5ubuntu1.5
  PackageArchitecture: all
  SourcePackage: linux-base
  Tags:  bionic package-from-proposed

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-base/+bug/1929255/+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