LINUX-UPDATE-SYMLINKS(1)

πŸ“¦
version 4.17ubuntu1 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

General Commands Manual 🌸

✨ NAME ✨

okay bestie, this one is linux-update-symlinks, and its whole job is maintaining symlinks to the default kernel and initramfs 🧚

πŸŽ€ SYNOPSIS πŸŽ€

linux-update-symlinks {install|upgrade|remove} KERNEL-VER IMAGE-PATH

πŸ“ DESCRIPTION πŸ“

okay so linux-update-symlinks is made to be called from the postinst and postrm maintainer scripts of Linux kernel packages πŸ”₯ the postinst script has to pass either install or upgrade as the first argument, depending on whether it's a fresh install or an upgrade.

The KERNEL-VER argument needs to be the kernel version string as shown by uname -r and used in filenames. It's not the package version, so don't mix them up, periodt πŸ™ˆ

The IMAGE-PATH argument must be the absolute filename of the kernel image. no relative paths, no cap πŸ’…

By default, this command maintains the symlinks in the root directory. you can change that with settings in /etc/kernel-img.conf πŸ¦‹

  • image_dest β€” picks the directory where the symlinks get maintained
  • link_in_boot β€” if set to a true value, the directory is /boot ✨
  • do_symlinks β€” if set to a false value, symlink maintenance is turned off πŸ’€

The symlinks for the primary default kernel are named vmlinuz or vmlinux, depending on whether the architecture normally uses compressed kernel images. If it uses an initramfs, there's also initrd.img. The secondary default gets the exact same names with the suffix .old tacked on 🌈

If symlink maintenance is disabled, linux-update-symlinks does nothing and still exits successfully, lowkey the most chill outcome ever 🫢 Otherwise, it builds a list of kernel versions in decreasing order of priority:

  • The given KERNEL-VER, if the first argument is install πŸ’œ
  • The current primary default version, if it exists and isn't already on the list ✨
  • The current secondary default version, if it exists and isn't already on the list πŸ“
  • All other versions whose files are installed, excluding the specified KERNEL-VER if the first argument is remove. these go in decreasing version order 🧚

The top two entries on that list become the new primary and secondary default versions, and the symlinks get updated to match πŸ‘‘ If there's only one entry, it's both the primary and secondary default. If there are no entries at all, there are no default versions, so it removes the default symlinks. iykyk 😭

🌸 ENVIRONMENT VARIABLES 🌸

  • INITRD β€” when the first argument is install or upgrade, linux-update-symlinks assumes the given KERNEL-VER will use an initramfs. the only exception is if this variable is set to No πŸ™ˆ

πŸ—‚οΈ FILES πŸ—‚οΈ

  • /boot/initrd.img-* β€” installed initramfs images 🧸
  • /boot/vmlinuz-* | /boot/vmlinux-* β€” installed kernel images 🌈
  • /etc/kernel-img.conf β€” config file that says whether and where to create symlinks ⭐
  • /initrd.img β€” symlink to the initramfs image for the primary default version πŸ’–
  • /initrd.img.old β€” symlink to the initramfs image for the secondary default version πŸŽ€
  • /vmlinuz | /vmlinux β€” symlink to the kernel image for the primary default version πŸ”₯
  • /vmlinuz.old | /vmlinux.old β€” symlink to the kernel image for the secondary default version πŸ¦‹

πŸ‘©β€πŸ’» AUTHOR πŸ‘©β€πŸ’»

linux-update-symlinks and this manual page were written by Ben Hutchings as part of the Debian linux-base package. he's literally iconic πŸ‘‘

πŸ”— SEE ALSO πŸ”—

kernel-img.conf(5), linux-version(1). go check those out next, you won't regret it 🫢


bestie, that's the whole page πŸ’… LINUX-UPDATE-SYMLINKS(1), last updated 5 June 2016, and you are officially kernel-symlink literate now 🌈✨

πŸ“¦ where this page comes from