On Sun, Apr 17, 2022 at 3:00 PM Martin Vaeth <mar...@mvath.de> wrote: > > Yes, without a manually written grub.cfg you get none of these features - > the default grub.cfg is just horrible. > Well, the most powerful feature is probably still available: > The possibility to edit the kernel's command line, partition and path which > theoretically can cover everything else, though it is rather inconvenient.
The GRUB bootloader just parses its config file, which can be manually edited as you point out. You also have grub-mkconfig which outputs a config file for the bootloader to use, and it is typically used to scan /boot and find all the kernels/initramfs present and create menu items. grub-mkconfig just runs a bunch of shell scripts to generate everything, so you can have it autogenerate anything you want. It seems like a rough way to do it would be to just copy the regular linux once for each runlevel so that you end up with each kernel show up more than once, and then the individual runlevels can be tweaked accordingly. Obviously it would be more elegant to add a loop over a configuration variable. I'm not aware of anybody having actually done this, however, so you'd have to DIY. -- Rich