I have an SSD with 4 partitions (EFI partition, 1st user's OS, 2nd user's OS, swap partition) and systemd-boot installed as bootloader (personal preference). Since systemd-boot can only boot kernel from the same filesystem, I changed /etc/fstab to mount my FAT32 partition to /boot instead of /boot/efi, so that package manager will install kernel on the same partition where systemd-boot is located. I have many similar files on that partition (several vmlinuz, but different versions, same with other files), like this:

ls -> EFI/ loader/ vmlinuz-1 vmlinuz-2 config-1 config-2 ...

So I separated them into different folders, now it looks like this:
ls -> EFI/ loader/ user1/ user2/

The only problem is that when apt tries to upgrade system, it fails miserably because it can't symlink files since they are on the FAT32 partition and even if they were able to symlink, they would still be in the main /boot folder, which I don't want them to be. Using same kernel is not an option.

So my question is: Is it possible to specify where to download new kernel file is, or I would have to move it manually every time kernel gets an update?


Solved by following this article: https://kernel-team.pages.debian.net/kernel-handbook/ch-update-hooks.html

I created /etc/kernel/postinst.d/zz-update-efi script which simply moves compiled kernel and init to user's directory.

mv "/boot/vmlinuz-$1" "/boot/$USER_NAME/vmlinuz-linux"
mv "/boot/initrd.img-$1" "/boot/$USER_NAME/initramfs-linux.img"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.