I have several kernels in /boot. One of them, linux-cc, is for heavy computation, i.e., 100Hz, no preemption, no graphics. I've created a systemd target, named compute.target, that only brings the system up and then starts an ssh server. I'm using GRUB2, and I'd like to add the systemd.unit=compute parameter only to the mentioned kernel.I've read How do I add xen kernel boot parameters in grub2?, but it does not apply to my situation (I've tried adding GRUB_CMDLINE_LINUX_CC=systemd.unit=compute to /etc/default/grub, but it didn't work).Does anyone know how to do this? I'm using ArchLinux, and I would like to keep using grub-mkconfig if it is possible. P.S.: Maybe I could add this parameter as a hard-coded kernel option, but it does not seem very flexible.
How do I apply parameters to specific kernels with GRUB 2?
linux kernel;grub2
I find if you maintain multiple kernels with different options its easier to roll your own /boot/grub/grub.cfg rather than use grub2-mkconfig.An example entry is:menuentry 'Linux 3.10.17 (sde) kernel-3.10.17-g' {    root=hd0,1    linux /boot/kernel-3.10.17-g domdadm dolvm root=/dev/md3    initrd /boot/initrd-3.10.17-g}Where everything after the name of your kernel on the linux line are the boot options you want to pass to that specific kernel.  Obviously, your setup will differ than mine, but this is demonstrate that manual setup of grub2 really isnt much different than grub.  If you want to combine this method with the grub2 way, you can put custom entries into /etc/grub.d/XX_custom or the equivalent setup on your distro and the grub2-mkconfig script will pull them into the generated configuration file.