[Home]How To Make The Board Poweroff Properly

Last edit: on December 23, 2007 17:57 (4581 days, 7 hours and 54 minutes ago) (diff)
I915gmm.Gratiswiki.Dk | RecentChanges | Preferences | GratisWiki

The board has some shutdown issues in linux, where it does not power off completely when asked to shutdown (eg. "shutdown -h now").

Some reports suggest that this only happens when a XV overlay has been used, so one solution might be to try and avoid using XV altogether, but that causes a pretty big performance hit.

Another solution is to use APM instead of ACPI as powermanager, but this would cause Speedstep to stop working.

Some kernels >2.6.13 has ACPI shutdown fixed, but it was later broken in following kernel releases.

Solution using GRUB

Since this issue will probably not be fixed, and since I've recently changed BIOS option to fixed speed fans, this issue is even more annoying than before, since the fans will keep spinning after shutdown. Thus inspired by Tom Wrights hack below, I decided to make a slightly less ugly, and slightly faster workaround using GRUB.

The idea is to keep ACPI support in the kernel and XV support in X, and just use GRUB to actually power off.

First make sure you have a recent version of GRUB installed:

 grub-install /dev/sda
(change /dev/sda to whereever your bootloader should be installed)

Make sure you're using "default saved" in your /boot/grub/menu.lst

Next add a new entry to /boot/grub/menu.lst above all other boot entries as follows:

 title       Shutdown
 root        (hd0,0)
 savedefault 1
 cat /grub/default
(If you don't have a seperat boot partition use "cat /boot/grub/default" instead) (Recent versions of grub have a bug which fails to flush buffers to disk before the halt command is executed. Reading the file grub uses to store the default data forces it to be flushed to disk)

Now the final thing to do is is change you shutdown script from calling shutdown -h now to instead read:

 grub-set-default 0 && shutdown -r now
(I use irexec from lirc to shutdown, but if you use an acpi event, you should probably change /etc/acpi/powerbtn.sh)

Previous discussion

[Tom Wright]: I have debian unstable, with a 2.6.16 kernel and the board doesn't power off properly. Any suggestions? It seems to power off easily if I do it soon after starting up, but not after I've done some things. I've a suspicion that it's playing a video through an XV overlay that causes problems but haven't proved this exhaustively.

Answer from original author (Daniel Siboska):
I've just checked, and I see the same behavior as you describe (running 2.6.18), though I keep my system running 24/7, so I rarely power down at all, which is why I haven't noticed that ACPI shutdown is broken again :/ To be able to see the last messages printed to the system console just before "power down", I've attached a seriel console to the board. Though I didn't find the result all that revealing, maybe someone else can get a clue from it:

 [4296916.989000] setitimer: hcid (pid = 2580) provided invalid timeval it_value: tv_sec = 0 tv_usec = 5000000
 [4296917.112000] setitimer: hcid (pid = 2580) provided invalid timeval it_interval: tv_sec = 0 tv_usec = 5000000
 [4296923.704000] printk: 8 messages suppressed.
 [4296934.910000] Synchronizing SCSI cache for disk sdd: 
 [4296934.977000] Synchronizing SCSI cache for disk sdc: 
 [4296935.045000] Synchronizing SCSI cache for disk sdb: 
 [4296935.112000] Synchronizing SCSI cache for disk sda: 
 [4296935.183000] Power down.
 [4296935.220000] acpi_power_off called
 [4296935.220000]  hwsleep-0283 [06] enter_sleep_state     : Entering sleep state [S5]

I'll try to get a log from a succesfull shutdown once I have a little more time on my hands to see if there is any difference.

[Tom Wright]: I've now upgraded to kernel 2.6.18 and it still won't shut down. That was without displaying an XV overlay too - I started it up, messed around with the sound modules (see other page!) and shut it down again. Any clues, anyone?

[Tom Wright]: Workaround found for shutdown issue

This is a *really* messy hack, but it does work.

In /etc/acpi/powerbtn.sh, put this (instead of '/sbin/shutdown -h now'):

  touch /etc/buggymotherboard/pleaseshutdown
  /sbin/shutdown -r now

In /etc/rc.local, put this (in addition to anything else you may have in there):

  touch --date="`date --date="3 minutes ago"`" $BMDIR/comparison
  if [[ "$BMDIR/pleaseshutdown" -nt "$BMDIR/comparison" ]] ; then
      rm -f $BMDIR/pleaseshutdown $BMDIR/comparison
      shutdown -h now
      rm -f $BMDIR/pleaseshutdown $BMDIR/comparison

See debian bug report for other posible workarounds: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=390547

Edit text of this page | View other revisions | Download I915gmm.gratiswiki.dk
GratisWiki hostes af HOW