I got it working and it is pretty slick, so I thought I will share.
My system is Ubuntu 10.04 with Dharma beta4. So Grub2 is being used as boot loader and Ubuntu 10.10 and Win7 are alternative OSes.
1) First you need to modify your /etc/default/grub file
Important part is first two lines (this is new with version 10.04 and higher as far as I am aware)
Code:
mp@nexus:~$ cat /etc/default/grub
GRUB_SAVEDEFAULT=true
GRUB_DEFAULT=saved
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=2
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
...
2) then you recreate your grub.cfg with:
Code:
sudo grub-mkconfig > /boot/grub/grub.cfg
3) tell grub which number is your default OS (in my case is first on the list so the number is 0)
4) to reboot to your alternative OS you do
where number 1 is Ubuntu 10.10 and number 2 will be Win7 in my case (so this need to be adjusted with your system)
And now after reboot grub will load OS number 1 from the list, after you restart again it goes back to your default OS.
All that is left is to create short script that will set number for new OS (sudo grub-reboot 1) and reboot and assign it to the remote control button.