Due to bugs in my laptop's BIOS (or some such thing), I use the boot flag nox2apic when I know I need to attach an external monitor. However, when this flag is enabled, pressing some multimedia hardware buttons cause the system to hang. Until I can correctly track down these bugs and do the responsible thing, I'd like Grub2 to generate two entries per installed kernel:

  • one with nox2apic enabled, to be used when I might attach a monitor
  • one with default flags, to be used when I'm on the go

Reviewing /etc/grub.d suggests I could modify one of the loops in 10_linux to emit the appropriate entries. Is this the best way? Since I'm worried that I'd have to grok most of this file, is there a quicker solution?


It depends from distro you currently use.

If it's Debian/Ubuntu/CentOS/RHEL, I recommend you to edit file.


And set there value of


Then do your favorite grub2-mkconfig as you usually.

Good luck!

|improve this answer|||||
  • 1
    Will this create two entries for each recognized kernel/what entries does this create? – Willi Ballenthin Jan 26 '15 at 18:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.