On Sat 29 Feb 2020 at 19:17:39 (+0100), Mikhail Morfikov wrote: > I have an encrypted (LUKSv2) LVM setup with a separate unencrypted /boot/ > partition. When I install a new kenrel in the system, the following symlinks > are > created in the root directory (/): > > # ls -al / > ... > lrwxrwxrwx 1 root root 29 2020-02-14 17:22:18 initrd.img > -> boot/initrd.img-5.4.0-4-amd64 > lrwxrwxrwx 1 root root 27 2020-02-24 00:37:53 > initrd.img.old -> boot/initrd.img-5.5.4-amd64 > ... > lrwxrwxrwx 1 root root 26 2020-02-14 17:22:18 vmlinuz -> > boot/vmlinuz-5.4.0-4-amd64 > lrwxrwxrwx 1 root root 24 2020-02-24 00:37:53 vmlinuz.old > -> boot/vmlinuz-5.5.4-amd64 > > So I have a question here: what's the purpose of the links?
They're a convenience. If you want them kept in /boot, then edit /etc/kernel-img.conf and linux-update-symlinks will recreate them there when the kernel is updated. Ditto if you want them removed. > Also, I'm trying to configure refind EFI boot manager, and basically I don't > want to change its config file with each kernel update (the numbers in the > file > names change). I'm not familiar with that, but one of the reasons there are links in root is for that very reason: their names don't change. The links are of no particular use to me, because I always boot linux with Grub, and /boot/grub/grub.cfg gets updated with the actual filenames (in /boot) whenever the kernel is upgraded. But if you boot using software that's *not* maintained by Debian and therefore isn't updated with the name of the new kernel, then the symlinks in root are more useful: any software can find them there, and with names that never change. > Wouldn't be better to create the links under /boot/ dir instead (or in > addition > to the already existing ones, if they serve any purpose)? It's up to you. Not having links at all means that you might, in the absence of filename completion, have to remember strings like boot/vmlinuz-4.19.0-8-amd64 if booting doesn't go smoothly. You don't say why *you* think it's better to create links in /boot, so I'm not sure why we're expected to think so too. But if you want them in both places, I think you have to maintain them in the other location yourself. Cheers, David.