Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a fairly special setup, using Linux on a MacBook Laptop.

to switch off my secondary graphics card in it I'm required to add these lines to my grub

outb 0x728 1
outb 0x710 2
outb 0x740 2
outb 0x750 0

I do this by pressing 'e' for my selected grub menu option and adding the lines one by one . then finally booting . But as we know it's not permanent.

I cant really figure out where i need to add it for grub to always append it to my Linux boot options.

It's doesn't seem to belong in /etc/default/grub since here i can add stuff to the kernel boot line

Honestly i'm afraid to fiddle to much with grub on my computer since getting it to triple boot Linux/Mac/Windows was a very delicate and timely matter.

Does anyone have any idea of where to add it?

share|improve this question
I think you should read this manual -> – hhlp Jun 12 '12 at 14:33
When you add them after 'e' at grub where are you adding them? Might need to work it into one of the scripts grub reads. – 23 93 26 35 19 57 3 89 Jun 12 '12 at 15:02
up vote 2 down vote accepted

If you add this code to /boot/grub/custom.cfg (creating the file if it doesn't already exist) then it will be executed just before the grub menu is displayed.

I don't know what exactly those outb commands are doing so I have no idea if it is safe to run them at all, or if running them will interfere with display of the grub menu, so do this at your own risk.

share|improve this answer
It worked wonders, thnx for the help. an interesting note is that the commands are not appended to any of the grub menu alternatives. – tomodachi Aug 16 '12 at 15:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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