This is a bug that affects shutdown on the Eee PC 901 running Linux. Instead of shutting down properly, the power LEDs stay on and the screen goes black with a flashing cursor in the top corner.
Shutdown problems have been reported on other Eee PC models. This page describes a fix for a sound module problem that causes similar symptoms, but the 901 seems to ship with a similar fix already applied. BIOS updates have also been recommended, but at the time of writing, an Eee PC 901 with the latest BIOS (1301) still has the shutdown problem.
On the 901, the shutdown problem is believed to be a problem with the wireless networking system. Turning off wireless, e.g. using Fn-F2, allows shutdown to occur properly. It is not enough to disconnect from the wireless network, it is necessary to turn off power to the wireless hardware, i.e., so that the blue wireless LED is off.
Unfortunately the Eee PC remembers the state of wireless power when the computer is shut down and restarted, so if you turn off wireless before shutdown you need to remember to turn it on again when you restart.
This page presents a workaround for the problem. Power is turned off automatically before shutdown, and the previous power state is restored when the system restarts. The solution is reported to work on machines running the default Xandros OS, in both simple and advanced desktop modes.
We need to edit two scripts, for which it is necessary to become the root user, e.g. using 'sudo'. The script /sbin/shutdown_helper.sh gets called at shutdown, and /usr/sbin/wlan_on_boot.sh gets called at boot. There is a script in /etc/acpi/ that is used to control wireless when Fn-F2 is called, so we can make use of that too.
First, to disable wireless at shutdown, edit /sbin/shutdown_helper.sh to add the lines shown:
#!/bin/sh
[ `id -u` = "0" ] || echo "Must be root."
synclient TouchpadOff=1
#save the user's ALSA settings and unload driver
/usr/sbin/alsactl store > /dev/null 2>&1
/sbin/modprobe -r snd_hda_intel
# Start of added lines
# sdm - Save wireless power state. We'll need to restore it
# when we boot.
cat /proc/acpi/asus/wlan > /boot/wireless_power_at_shutdown
# sdm - Turn off wireless to avoid hang at shutdown.
# Use the acpi script that normally handles wlan
# when Fn-F2 is pressed.
/etc/acpi/wlan.sh poweroff
# End of added lines
AZUREBT=`pidof AzureBT`
if [ -n "$AZUREBT" ]; then
killall AzureBT >/dev/null 2>&1
fi
...
The Eee remembers the wireless power situation across a reboot, but if we force it to turn off at shutdown then it'll only ever remember that it was off. We want to remember the state it was in before we forced it off, so first, we read the state of the wireless power from /proc/acpi/asus/wlan, and write it to a file. Files in /tmp won't survive the reboot, so I chose /boot/wireless_power_at_shutdown. Then we call a script in /etc/acpi/ to actually power down the wireless hardware.
Now we need to modify the startup script to recover the wireless power state. We'll do this by reading the /boot/wireless_power_at_shutdown file that we just created.
Edit /usr/sbin/wlan_on_boot.sh to add the lines shown:
#!/bin/sh
BOOT=""
FOUND_ESSID=""
WLAN_FOUND=""
IFACE="ra0"
# Start of added lines
# sdm - We might have forced the WLAN power off at shutdown, so
# we have to get it back to the state it was in before that.
if [ -f /boot/wireless_power_at_shutdown ] ; then
WPLS=`cat /boot/wireless_power_at_shutdown`
echo Wireless power at last shutdown was $WPLS
if [ "$WPLS" = "1" ]; then
echo Powering up wireless to match previous state.
echo 1 > /proc/acpi/asus/wlan
sleep 1
modprobe rt2860sta
fi
fi
echo -n "WLAN Power state is "
cat /proc/acpi/asus/wlan
# End of added lines.
#if interface specified on the command line - use it
if [ -n "$1" ]; then
IFACE="$1"
fi
...
This code looks for the /boot/wireless_power_at_shutdown file, and reads the desired power state from it. If the wireless power was on before shutdown then we turn it on again now. The code to do that is similar to the code for 'poweron' in /etc/acpi/wlan.sh, except that I omit the line to bring the interface up because the rest of the script is about to do that for us.
The file /tmp/wlan_on_boot.log captures the output from /usr/sbin/wlan_on_boot.sh. The script now adds a few more lines to that log to tell us what it's doing with the power.