anatol / booster

Fast and secure initramfs generator
MIT License
501 stars 44 forks source link

Remove kernel from /boot when the booster-remove script is called #102

Open tam1m opened 3 years ago

tam1m commented 3 years ago

I think booster should remove the /boot/vmlinuz-$kernel when the remove hook is executed. Most kernel packages don't install the kernel to /boot themselves and instead, let the initramfs generators do the job.

Mkinitcpio does this, too (see https://github.com/archlinux/mkinitcpio/blob/master/libalpm/scripts/mkinitcpio-remove#L36)

anatol commented 3 years ago

I believe there was an activity to consolidate kernel management and make it generic for all the Arch's initamfs generators. СС @grazzolini for more comments on it.

tam1m commented 3 years ago

Yes, there is this https://github.com/archlinux/mkinitcpio/pull/7 (see the discussions and https://github.com/archlinux/mkinitcpio/commit/9c1e0f3dd01151b79e9b557ea8510605616c1369).

Basically, mkinitcpio only removes vmlinuz from /boot, if lib/modules/$kernel/pkgbase exists and otherwise bails. In those cases the responsibility is left to the kernel package.

anatol commented 3 years ago

We try to make multi-initramfs configuration possible. i.e. if both booster and initramfs are installed then booster should not delete files used by initramfs.

I think installing vmlinuz should really be done by linux package itself. initramfs should be responsible for image generation/removal only.

grazzolini commented 3 years ago

@anatol I'm all up for having generic hooks that copies vmlinuz to /boot and also handle initramfs generation, of any of the generators we have on the repository. And I started doing some work in that direction. However, the more I did that, the more I looked at kernel-install and the more using something like it made sense.

The reason for not having the kernel package copy vmlinuz to /boot anymore is that you can have setups that don't need /boot, many people today have to use their ESP as /boot or juggle files around.