Is there a way to make it so that certain kernel modules, mount points, and boot-time services (in either Systemd or OpenRC) can be enabled or disabled based on boot-time parameters (and/or the type of kernel running)?
And taking it a step further, could init systems be swapped in a similar way? (I am aware of the init=...
kernel parameter, but can (for example) both systemd and OpenRC co-exist together in the same installation and swapped out at-will during boot-time)?
For some background (in case anyone is old enough to remember this), my line of thinking stems from the DOS technique of having multiple system profiles in config.sys/autoexec.bat which could be chosen based on a boot-time menu.
So if I (purely for the sake of example) wanted to have three menu entries in GRUB:
"Gaming": would load a custom kernel, load proprietary nvidia drivers & enable optimus (or vfio passthrough), and boot into X11;
"Work": would load another kernel, load intel video drivers, mount my encrypted work partition, and boot into Wayland;
"Server": would load a third (high-latency) kernel, start specific additional background services (i.e. web server, ssh host, vm host), and boot into the text console.
The above are just examples, but hopefully the point comes across.
Is something like this possible in Linux?