Sabayon / genkernel-next

An improved and modern remake of Gentoo genkernel (in: udev, plymouth; out: cross compiler support)
47 stars 45 forks source link

Request: Add post initramfs hooks/More hooks in general #61

Closed Dissonant-Tech closed 6 years ago

Dissonant-Tech commented 6 years ago

It would be really useful to have something I can hook into after the initramfs stage.

Currently CMD_CALLBACK allows some flexibility but not enough.

The use I have in mind for these hooks are for tasks like kernel signing or renaming the output files to more generic names. For example, I have a script that signs the kernel and saves it with the generic name kernel-signed, this way I do not have to edit the bootloader config to change the kernel. It also copies the kernel with the previous version to kernel-signed-fallback.

Unfortunately I cannot do the same with the initramfs since it is generate after CMD_CALLBACK is executed. This means I still have to edit my bootloader config anyway.

Also, it would be useful to have a directory to store hooks in rather than a single command, similar to what the kernel does with /etc/kernel/install.d and .../postinst.d

EDIT: Provided with some direction (i.e. proper location and a few implementation details) I would be willing to provide a pull request with some changes. The simplest solution might be to add a second CMD_CALLBACK like hook that is ran after initramfs generation but I feel that would just lead to more clutter in the code as adding a new hook would require adding a new parameter. I think the HOOK.d folder solution would work best.

Dissonant-Tech commented 6 years ago

Resolved with merge #62