OcttKB/Wiki-OcttKB/tiddlers/Normal/_Kernel postinst issue on Linux Mint.tid

26 lines
1.6 KiB
Plaintext
Raw Normal View History

2023-08-17 01:09:22 +02:00
created: 20230816223835858
creator: Octt
2023-08-18 01:43:40 +02:00
modified: 20230817225824818
2023-08-17 01:09:22 +02:00
modifier: Octt
tags: Linux
title: Kernel postinst issue on Linux Mint
2023-08-18 01:43:40 +02:00
The other day I got my Linux Mint system not booting anymore. I suspected this was due to [[my custom script|$:/Linux/Scripts/UpdateEfiBoot]] I placed in `/etc/kernel/postinst.d/` that is needed to copy the latest kernel in my EFI partition after an APT update, to allow boot via efistub bypassing grub. Maybe an unattended upgrade of my kernel failed.
2023-08-17 01:09:22 +02:00
After manually fixing the EFI partition to boot again in the system, I tried manually to run `apt upgrade`, and saw that my postinst script threw an error due to not finding one of the files to copy from `/boot` to `/boot/efi`.
After a quick web search, I saw that files in `/etc/kernel/postinst.d` should be numbered as they get run in the proper order by run-parts. I did `ls` on the directory where I've put my script to be certain that it was the very last, and actually it wasn't.
```
$ ls
dkms
initramfs-tools
pm-utils
---> UpdateEfiBoot <--- My script
xx-update-initrd-links
zz-shim
zz-update-grub
```
2023-08-18 01:43:40 +02:00
This was ugly to fix since, as seen in this list, my distro's mantainers are geniuses and decided to get rid of numbers, and instead prefer to just use alphabetical ordered naming, falling back to ugly letter suffixes when that plan failed. I renamed my script from `UpdateEfiBoot` to `zzz-UpdateEfiBoot`, thus making it appear at the end of an alphabetical listing and sure enough that fixed the issue: running `apt upgrade` again completed the update without errors and my script did its job.