New review comment by tornaria on void-packages repository https://github.com/void-linux/void-packages/pull/29780#discussion_r703902693 Comment: If not fixing the issue I described above, I would say at least leave the `efibootmgr -qo $bootorder` in place. Without it, the last kernel installed will take priority which is not very convenient (e.g. I have 4.19, 5.4, 5.10 and 5.13 installed, and I'm currently booting 5.4; I would hate that this changes every time one of the others is updated). A possible fix might be to do something like this: ``` [...] # get major version, e.g. "4.8" for "linux4.8" major_version=$(echo $PKGNAME | cut -c 6-) label="Void Linux with kernel ${major_version}" # look for previous entry for this major kernel version bootnum=$(efibootmgr | grep " $label$" | cut -c "5-8") # get the boot order # this is required because when in the next step the existing entry is removed, # it is also removed from the order so it needs to be restored later bootorder=$(efibootmgr | grep "^BootOrder: " |cut -c 12-) # if existing, remove it and reuse the same number if [ -n "$bootnum" ]; then args="$args -B -b $bootnum" fi # if there is a boot order, keep it as is if [ -n "$bootorder" ]; then args="$args -o $bootorder" fi # create the new entry efibootmgr -qc $args -L "$label" -l /vmlinuz-${VERSION} -u "${OPTIONS}" ``` Instead of calling the `post-remove/50-efibootmgr` hook, just tell efibootmgr to replace the entry. This also keeps the order in the same call to efibootmgr so you don't have to do that in a separate step anymore.