This isn't about writing software, but it's a snippet, so...
I have a fresh new desktop based on the Intel DH57JG board on which I've happily installed Ubuntu 10.04 LTS desktop. Aside from a video mode detection issue, things are great, but I had an odd symptom: Ubuntu could successfully shut down and power off, but it would crash if I asked it to reboot. Just an annoyance, but surprisingly...annoying.
So naturally I consulted a Major Search Engine(tm)(r), and while I found several threads related to this problem, I never found one where the original questioner actually said their had been solved. I did find one where someone chimed in with "When I had that problem, adding reboot=bios to the kernel options fixed it." So I tried that, but no go. I also found a thread where someone said "I've tried the reboot b, c, and h options but..." So I figured there had to be more options for this reboot thing than just "bios" or none.
Well, it took some digging and installing the linux source (which is nicely packaged, so not like that's hard), and my machine now happily reboots when I ask it to. Because the options for reboot are a bit hard to find, here they are (for the x86 architecture) as of the Linux kernel 2.6.32-24:
|warm||Don't set the cold reboot flag|
|cold||Set the cold reboot flag|
|bios||Reboot by jumping through the BIOS (only for X86_32)|
|smp||Reboot by executing reset on BSP or other CPU (only for X86_32)|
|triple||Force a triple fault (init)|
|kbd||Use the keyboard controller. cold reset (default)|
|acpi||Use the RESET_REG in the FADT|
|efi||Use efi reset_system runtime service|
|pci||Use the so-called "PCI reset register", CF9|
|force||Avoid anything that could hang.|
If you need a more up-to-date list, or a list for a different architecture, here's how I got that:
- I installed the linux-source package, which dumps a bzip2'd source tarball in /usr/src
- Uncompressed and untarred the tarball
- Looked at the arch/[architecture]/kernel/reboot.c file. Since I'm on an x86 processor on the 2.6.32 kernel, the full path in my case was /usr/src/linux-source-2.6.32/arch/x86/kernel/reboot.c but of course YMMV.
I applied the change by editing /etc/default/grub, adding that to the GRUB_CMDLINE_LINUX_DEFAULT variable, running update-grub, and rebooting (er, that is, shutting down and then starting up — rebooting would have crashed, of course).
Hope this saves someone else some time.
(If the title of this post seems oddly familiar but you can't place it, here.)