Ubuntu Intrepid Ibex on eeePC 900

I have been using the new Ubuntu Intrepid Ibex beta on my eeePC 900 for a few days, and it has been great. Overall, the new version of Ubuntu was easier than ever to install. Most of the eeePC 900 hardware now worked out-of-the-box. There was no more custom compile needed, and less configurations to tweak.

Background

I have an eeePC 900, which has been running standard Ubuntu Hardy. As soon as Intrepid Ibex reached beta, I decided it’s time to try it out on the eeePC. However, I was not sure how much effort and hacking was required to bring all hardware to be functional. To maintain a quick recovery time, I decided to install into an external USB hard disk (HD) first.

As with the previously Hardy install, I used the alternate disc. I figured, there was really not much point in using the desktop LiveCD version.

Reference

I couldn’t find a definite guide to installing Intrepid Ibex beta on the eeePC, so I referred back to this page for guidance, as well as the eeeuser.com forum.

Pre-installation

  1. Connect wired ethernet to my home network.
  2. Connect USB CDROM drive.
  3. Connect external USB HD (I used a 160GB hard disk, since I have one lying around).

Installation

  1. Set BIOS to boot to CDROM.
  2. Boot up and check CD for defects.
  3. Install Ubuntu (took more than 1 hour, be patient).

In the final installation step, I instructed the installer to put the GRUB into the MBR of the external HD. This was strictly not necessary, but I wanted to be sure the internal HD MBR was not overwritten, to preserve the possibility of a fast recovery if things didn’t work out.

Post-installation

  1. Unplug CDROM drive.
  2. Change BIOS boot to USB HD (note: the USB HD appeared as HD in eeePC BIOS, and not as a removable storage).

First boot

I encountered GRUB error (can’t find Linux image) on first boot. This was easily fixed by pressing ESC to enter the GRUB menu, then press “e” to edit the menu item. Change the entry from (hd2,0) to (hd0,0). It’s too complicated to explain why this was needed. But once first boot into the desktop was successful, I edited /boot/grub/menu.lst and changed every (hd2,0) entries to (hd0,0).

The first thing I customised was to set the fonts to 80dpi. If you calculate the actual dpi of the eeePC 900 screen, you get a value of 133. However, at that setting, everything would be too big. By setting the dpi in the opposite direction, you get tiny fonts. But at least, most windows and dialogboxes would now fit into the small eeePC screen.



Shutdown properly

I still found the problem in shutting down the eeePC properly. To fix this, edit the file /etc/default/halt (with root privilege).

gksudo gedit /etc/default/halt

Add this line to the end of the file:

rmmod snd-hda-intel


Fixing Compiz

With the small eeePC screen, a large window could extend below the screen. By default, Compiz is set to disallow moving window above the top of the screen. This preventing you from moving the window upwards to access the controls below the screen. To change this behaviour, run this command in a terminal:

gconftool-2 --set \
/apps/compiz/plugins/move/allscreens/options/constrain_y \
--type bool 0


Now, you can use ALT+leftmouse to move up the window.



Prevent mail client from launching when AC power mode is enabled

The mail client would launch each time you enable the AC power mode (plugged in the AC power). To stop this behaviour, edit /etc/acpi/events/asus-mail with root privilege:

gksudo gedit /etc/acpi/events/asus-mail

Comment out all lines in the file (by prepending a #).

Hardware

As mentioned, most hardware already worked out-of-the-box. The WIFI was detected and able to connect to my home’s WPA2 network. Manually compile the madwifi.org driver is not needed anymore.

Previously the LCD backlight control by the gnome-power-manager was working in Hardy, but was slightly wonky. Now, it seemed to work properly in Intrepid.

The webcam also worked out-of-the-box. Install cheese to verify:

sudo apt-get install cheese


All standard ports, including the SD card reader also worked without any additional effort. One thing though, I didn’t test the headphone or the microphone jack.

Finally, audio is no longer broken after suspend and resume.

Processor scaling

This section described setting the CPU governor to “performance” when in AC power mode, and to “ondemand” when in battery power mode. You should change the steps (where appropriate) if you would like a different configuration.

To enable processor scaling:

sudo apt-get remove powernowd
sudo apt-get install cpufrequtils sysfsutils
sudo modprobe p4_clockmod


Edit /etc/modules with root privilege:

gksudo gedit /etc/modules

Add these lines to the end of the file:

p4_clockmod
cpufreq_ondemand


Edit /etc/sysfs.conf with root privilege:

gksudo gedit /etc/sysfs.conf

Add these lines to the end of the file:

devices/system/cpu/cpu0/cpufreq/scaling_governor = ondemand
devices/system/cpu/cpu0/cpufreq/scaling_min_freq = 337000


The first line above set the cpu frequency scaling governor to “ondemand” upon boot up. If you prefer, you may change this to “performance”. A better solution would be to set the cpu governor to “performance” if booting with AC power, and “ondemand” if booting with with battery power. However, I have yet to find a working fix for this.

The second line set the minimum frequency to 337MHz. The minimum frequency is 112MHz without the second line, which is too low and caused the eeePC to run sluggishly.

Note that gnome-power-manager no longer controls the CPU frequency in Intrepid. The previous gnome-power-manager section of gonf related to the cpu governors have been removed. Unfortunately, this meant the cpu frequency control has to be performed via scripts.

Create script file /etc/acpi/ac.d/90-cpufreq.sh with root privilege, to set the CPU governor in AC power mode:

gksudo gedit /etc/acpi/ac.d/90-cpufreq.sh

Add these lines to the file:

#!/bin/sh
/usr/bin/cpufreq-selector -g performance


Next, create script file /etc/acpi/battery.d/90-cpufreq.sh with root privilege, to set the CPU governor in battery power mode:

gksudo gedit /etc/acpi/battery.d/90-cpufreq.sh

Add these lines to the file:

#!/bin/sh
/usr/bin/cpufreq-selector -g ondemand


Make these two script files executable:

sudo chmod +x /etc/acpi/ac.d/90-cpufreq.sh
sudo chmod +x /etc/acpi/battery.d/90-cpufreq.sh


Finally, you could add the “CPU Frequency Scaling Monitor” applet to the panel. Using this applet, you would be able to manually adjust the CPU frequency scaling or governor manually.

Fn keys

The Fn+F3 and Fn+F4 (brightness adjustment), and Fn+F1 (suspend) keys worked out-of-the-box.

For the rest, first enable the module “eeepc-acpi”. Run these command in terminal:

sudo apt-get install module-assistant eeepc-acpi-source
sudo m-a a-i eeepc-acpi


Edit /etc/modules with root privilege:

gksudo gedit /etc/modules

Add this line to the end of the file:

eeepc-acpi


Correcting key codes for Fn+F7, Fn+F8 and Fn+F9

The Fn+F7 (volume mute), Fn+F8 (volume down) and Fn+F9 (volume up) were assigned to the wrong key codes in the eeePC. This section fix that.

Edit file /etc/acpi/events/asus-volume-mute with root privilege:

gksudo gedit /etc/acpi/events/asus-volume-mute

Change:

event=hotkey (ATKD|HOTK) 00000030

To:

event=hotkey (ATKD|HOTK) 00000013


Edit file /etc/acpi/events/asus-volume-down with root privilege:

gksudo gedit /etc/acpi/events/asus-volume-down

Change:

event=hotkey (ATKD|HOTK) 00000031

To:

event=hotkey (ATKD|HOTK) 00000014


Edit file /etc/acpi/events/asus-volume-up with root privilege:

gksudo gedit /etc/acpi/events/asus-volume-up

Change:

event=hotkey (ATKD|HOTK) 00000032

To:

event=hotkey (ATKD|HOTK) 00000015


Main script to handle Fn+F2, Fn+F5 and Fn+F6

Fn+F2 (WIFI toggle) and Fn+F5 (display toogle) required a main script to launch the specific toggling action scripts.

I was not sure what Fn+F6 was meant for, but I ended up assigning it to the script which enable internal LCD only. This is useful when you are toggling internal and external screens. If you got stuck with only blank screens and unable to run xrandr (since you can’t see the desktop) this one button will return your desktop to the internal LCD.

Create script file /etc/acpi/eeepc-hotkeys.sh with root privilege:

gksudo gedit /etc/acpi/eeepc-hotkeys.sh

Add these lines to the file:

#!/bin/sh

code=$3

case $code in
	# Fn+F2 -- enable/disable wifi
	0000001[01])
		/etc/acpi/actions/wireless-toggle.sh
	;;
	# Fn+F5 -- Use external monitor as LCD clone
	00000030)
		/etc/acpi/actions/monitor-both.sh
	;;
	# Fn+F5 -- Switch to external monitor
	00000031)
		/etc/acpi/actions/monitor-external.sh
	;;
	# Fn+F5 -- Switch to internal monitor
	00000032)
		/etc/acpi/actions/monitor-lcd.sh
	;;
	# Fn+F6 -- Switch to internal monitor
	00000012)
		/etc/acpi/actions/monitor-lcd.sh
	;;
esac


Make the script file executable:

sudo chmod +x /etc/acpi/eeepc-hotkeys.sh


Edit file /etc/acpi/events/hotkey with root privilege:

gksudo gedit /etc/acpi/events/hotkey

Add these lines to the file:

event=hotkey ATKD
action=/etc/acpi/eeepc-hotkeys.sh %e


Action script for WIFI toggle (Fn+F2) key

I am not sure if this is necessary, but it was mentioned in the reference wiki:
Edit /etc/modules with root privilege:

gksudo gedit /etc/modules

Add this line to the end of the file:

pciehp pciehp_force=1


I got the script below from here. I made a few modifications / simplify the script because there wasn’t any need to have separate functions for each action.

Create directory /etc/acpi/actions:

sudo mkdir /etc/acpi/actions


Create script file /etc/acpi/actions/wireless-toggle.sh with root privilege:

gksudo gedit /etc/acpi/actions/wireless-toggle.sh

Add these lines to the file:

#!/bin/sh

wlan_control=/sys/devices/platform/eeepc/wlan
WLANSTATE=$(cat $wlan_control)

case $WLANSTATE in
	1)
		# The sequence here *is* important.
		modprobe -r -q ath_pci
		modprobe -r -q ath_rate_sample
		modprobe -r -q ath_hal
		modprobe -r -q wlan_ccmp
		modprobe -r -q wlan_tkip
		modprobe -r -q wlan_wep
		modprobe -r -q wlan_acl
		modprobe -r -q wlan_scan_sta
		modprobe -r -q wlan
		echo 0 >/sys/devices/platform/eeepc/wlan
	;;
	0)
		# Force PCI Express Hotplug to reinit
		modprobe -r -q pciehp
		sleep 1
		# pciehp_force may be unnecessary; Xandros did it.
		modprobe pciehp pciehp_force=1
		sleep 1
		# Switch on the hardware
		echo 1 >/sys/devices/platform/eeepc/wlan
		sleep 1
		modprobe ath_pci
		sleep 1
		/etc/init.d/networking restart
	;;
esac


Make the script file executable:

sudo chmod +x /etc/acpi/actions/wireless-toggle.sh


Action scripts for display toggle (Fn+F5) key

These action scripts used xrandr “auto” option when enabling the displays. This might not always work correctly if xrandr chose the wrong resolution. Furthermore, the screens’ positions and alignment are not specified. Unfortunately, I haven’t the opportunity to test for the best xrandr options to use.

Create script file /etc/acpi/actions/monitor-external.sh with root privilege:

gksudo gedit /etc/acpi/actions/monitor-external.sh

Add these lines to the file:

#!/bin/sh
export DISPLAY=:0
export XAUTHORITY=/home/undefined/.Xauthority
xrandr --output VGA --auto --output LVDS --off


Create script file /etc/acpi/actions/monitor-both.sh with root privilege:

gksudo gedit /etc/acpi/actions/monitor-both.sh

Add these lines to the file:

#!/bin/sh
export DISPLAY=:0
export XAUTHORITY=/home/undefined/.Xauthority
xrandr --output VGA --auto --output LVDS --auto


Create script file /etc/acpi/actions/monitor-lcd.sh with root privilege:

gksudo gedit /etc/acpi/actions/monitor-lcd.sh

Add these lines to the file:

#!/bin/sh
export DISPLAY=:0
export XAUTHORITY=/home/undefined/.Xauthority
xrandr --output VGA --off --output LVDS --auto


Make the script file executable:

sudo chmod +x sudo chmod +x /etc/acpi/actions/monitor-*.sh


Final work

These were the main things I did to get my eeePC 900 working perfectly in Ubuntu Intrepid Ibex beta. I am still tweaking a coupling of things, which I might mention in the future posts, if the opportunity arises.

Please leave a comment if you find any error.

Comments 2

  1. Onno wrote:

    I don’t have a “eeePC 900″ but the insights on how you did a few things really helped. Thanks.

    Posted 16 Jul 2009 at 10:24 pm
  2. chewearn wrote:

    hi Onno
    Thanks for reading. Glad it’s helpful. :)

    Posted 18 Jul 2009 at 1:45 am

Post a Comment

Your email is never published nor shared. Required fields are marked *