I am running the latest Kubuntu (14.10) and would like to add a grub2 menu entry that allows me to boot straight into a different runlevel? I would like to modify /etc/rc3.d
or /etc/rc4.d
to boot straight into the command line and not load X. I believe the custom menu entry should be placed in /etc/grub.d/40_custom
? I assume I can copy my/the default menu entry in /boot/grub/grub.cfg
? but then how do i make this entry boot at a different runlevel?
Can I add the command telinit 3
to the end of the custom menu entry?
any help would be appreciated 🙂
Best Answer
The problem with adding an entry using
40_custom
is that the entry is static - the contents are copied as-is togrub.cfg
, so a new kernel requires re-editing that file. With very slight tinkering of the10-linux
, you can getupdate-grub
to generate an additional entry for each of the installed kernels. Edit/etc/grub.d/10_linux
, and after the lines where it says:Add another call to
linux_entry
:(Selecting a runlevel is as simple as tacking on the number at the end of the options, IIRC.)
Effect:
Menu entry in the "Advanced options" sub menu:
The contents of that entry:
Of course, normally runlevels 2-5 are equivalent, so booting from it made no difference to me, except: