HOWTO Install Debian Sarge on an AOpen 1557 GLS

This article was first written in December 2004 for the BeezNest technical
website (http://glasnost.beeznest.org/articles/194).

Introduction

All in all, the basic Debian Sarge install (using Netinst CD) does a lot of work and the laptop is usable as is (network, graphical display, sound, …). However, some things need a bit of tuning to get the best of your laptop. This article is intended to help those people who want to get the best out of it or, so to speak, to make everything work. I can add that most information here is also applicable to many other laptops than this specific one. Here is a shortcut table with the status of every element likely not to be working by default and their current state for my installation:
Device or feature Status Comment
Wireless Network Card Intel 2200BG Working Sources on the Internet say that scanning is not allowed with this driver
ACPI Power Management Features Partially working The energy economy features are not handled, but it might be some flaw in my configuration. The battery status is handled perfectly. The CPU speed is not well handled, depending on the method used
Intel AC'97 Modem Working Install slmodem daemon and use module-assistant
TouchPad Working great
ATI Mobility Radeon 9700 - 3D Working The drivers seem not to be out for now for this card, but you can use standard RADEON drivers instead
ATI TV-Out Working (not tested)
Card reader SD-MMC-MS Not tested Should work fine, I guess...
Infrared Not tested Should work

At install time...

The only thing you need to know at install-time is that you must deactivate the framebuffer (I don't remember exactly how, but you need to press the F3 key or something similar at install screen to have more info about it). One says that its often necessary on laptops, so you probably know it already. I think it's something like the following, but please check this with the help screens provided.
install framebuffer=off

Install Wireless device and hotkeys - ipw2200

Short and quick: Go to http://www.cure.nom.fr/article.php?theme=Linux&id_fic=12 Read the page. Install module-assistant:
apt-get install module-assistant
Install the kernel headers:
apt-get install kernel-headers-2.6.8-1-686
for example.Install the ipw2200 package
apt-get install ipw2200-source
Read the doc:
more /usr/share/doc/ipw2200-source/README.Debian
It says to launch the command:
module-assistant a-i ipw2200
The command compiles the firmware. Now you need to download the firmware files on http://ipw2200.sourceforge.net/firmware.php, to extract the files and copy them in /usr/lib/hotplug/firmware/, then load the module:
tar zxvf ipw2200-fw-2.2.tgz
mv *.fw /usr/lib/hotplug/firmware/
modprobe ipw2200
iwconfig eth1
rfswitch.sf.net -> aopen -> module acerhk -> download and compile -> modprobe acerhk Compile:
cd acerhk-0.5.18
cat INSTALL |more
Change KERNELSRC in Makefile to the kernel build environment (/lib/modules/kernelversion/build):
vi Makefile
KERNELSRC=/lib/modules/2.6.8-1-686/build
Copy created acerhk.o to ...
cp acerhk.ko /lib/modules/2.6.8-1-686/kernel/drivers/char/
depmod -a
modprobe acerhk poll=1 autowlan=1
Just consider that the README file for acerhk indicates the files in /proc/driver/acerhk/ should be updated when you press the keys… this doesn't work here (so far). Now if you want this to be enabled at startup, just add this line in your /etc/modules file:
acerhk poll=1 autowlan=1
Your wireless hotkey should light the wireless led and activate the interface. Check if you have the right settings in /etc/network/interfaces and do something like this on the command-line to bring the interface up:
ifup eth1
Also, the airsnort package seems to be something to sniff for wireless connexion. If you find a way to make it work (it doesn't find the wireless device), just send me an e-mail (please). Same for the GNOME Wireless connexion monitor applet… When pressing the Wireless-activation key (first hotkey on the left of the keyboard) while booting, the GNOME Wireless connexion monitor applet seems to react sometimes Now that you set up the hotkeys system, you can also configure hotkeys in GNOME (Applications -> Desktop Preferences -> Keyboard Shortcuts), using the CD-player keys to play/pause/… and the mail key to start your mail agent, …

How to use power savings features

Warning Using the ATI proprietary driver for 3D rendering might well break the ACPI wake-up possibility, thus preventing you from getting your laptop to sleep properly. The CPU is an Intel chip, using SpeedStep technology for power savings. To enable using power savings features, you might want to try the following:
  • Have a kernel 2.6.5 or higher
  • Have sysfs installed (if your /sys is populated, you have it working)
  • Have udev installed (apt-get install udev)
  • Have powernowd [1] package installed (apt-get install powernowd)
  • Have the following modules loaded at boot time (/etc/modules):
    • proc_intf
    • speedstep-centrino (or you could try speedstep-ich if it doesn't work but I don't guarantee anything)
    • cpufreq_powersave
    • cpufreq_userspace
    • freq_table
  • Have the gnome-cpufreq-applet package (for GNOME 2.x) installed (apt-get install gnome-cpufreq-applet)
  • Reboot your computer to try it out
What is the result? ACPI detects everything alright, but I didn't get the sleep mode to work yet. The following is a work in development. This DOESN'T WORK. It will put your laptop to sleep, but probably not wake it up, so you'll have to hold the power button to shut it off completely and restart it. Anyway, ACPI on Debian is shipped only with the powerbutton handling. The place to look at is /etc/acpi. There you will find the powerbtn.sh script, which handles the powerbutton, and in /etc/acpi/events, you will find the powerbtn file, which tell ACPI which script to execute when the powerbutton is pressed. Now, those files look like this... /etc/acpi/events/powerbtn
# /etc/acpi/events/powerbtn
# This is called when the user presses the power button and calls
# /etc/acpi/powerbtn.sh for further processing.

# Optionally you can specify the placeholder %e. It will pass
# through the whole kernel event message to the program you've
# specified.

# We need to react on "button power.*" and "button/power.*" because
# of kernel changes.

event=button[ /]power
action=/etc/acpi/powerbtn.sh
/etc/acpi/powerbtn.sh
#!/bin/sh
# /etc/acpi/powerbtn.sh
# Initiates a shutdown when the power button has been
# pressed.

# Test if the computer is in suspended mode right now
if ps -Af | grep -q '[k]desktop' && test -f /usr/bin/dcop
then
    dcop --all-sessions --all-users ksmserver ksmserver logout 0 2 0 && exit 0
else
    /sbin/shutdown -h now "Power button pressed"
fi
What we'll need to do is use a lid file for when the screen panel is "clipped" down, and the sleepbtn for when the sleep button is pressed (Fn+F2). Let's do that: /etc/acpi/events/lid
# /etc/acpi/events/lid
# This is called when the user closes the lid.

# Optionally you can specify the placeholder %e. It will pass
# through the whole kernel event message to the program you've
# specified.

# We need to react on "button lid.*" and "button/lid.*" because
# of kernel changes.

event=button[ /]lid
action=/etc/acpi/sleep.sh
/etc/acpi/events/sleepbtn
# /etc/acpi/events/sleep
# This is called when the user presses the sleep button.

# Optionally you can specify the placeholder %e. It will pass
# through the whole kernel event message to the program you've
# specified.

# We need to react on "button sleep.*" and "button/sleep.*" because
# of kernel changes.

event=button[ /]sleep
action=/etc/acpi/sleep.sh
/etc/acpi/sleep.sh
#!/bin/sh
# /etc/acpi/sleep.sh
# Initiates a suspend to memory [when sleep button is pressed]

/etc/init.d/mysql stop     # somehow mysql causes problems if you don't shut it down manually
/etc/init.d/hotplug stop   # same thing. This seems to be gone for kernels >= 2.6.9
sync                       # flush buffers ('read that somewhere, not really useful)
hwclock --systohc          # saves the clock state ('read that somewhere, not really useful)
sleep 2                    # wait 'til past jobs are done
echo mem > /sys/power/state   # puts your laptop to sleep (this is the mandatory part)
sleep 2                    # wait a bit before waking up (when other event is triggered)
hwclock --hctosys          # get clock state back
/etc/init.d/hotplug start  # restart hotplug
/etc/init.d/mysql start    # restart mysql
The tricky thing here (as I found reading articles about the IBM T40 ACPI handling) is that putting your computer to sleep will probably prevent using the sleepbtn to get it back to the awaken state. So you will need to use the powerbtn to do that, because that one will probably work. But for the powerbtn to react another way if the computer is in sleep mode or if it's normal, it has to detect that somewhere. So we will use a file. In sleep.sh, we will trigger a file creation before going to sleep. Then if the file exist, the powerbtn will exit sleep mode. If it doesn't, the powerbtn will shut the computer down safely. /etc/acpi/sleep.sh
#!/bin/sh
# /etc/acpi/sleep.sh
# Initiates a suspend to memory [when sleep button is pressed]

/etc/init.d/mysql stop
/etc/init.d/hotplug stop
touch /tmp/suspended
sync
hwclock --systohc
sleep 2
echo mem > /sys/power/state
sleep 2
hwclock --hctosys
/etc/init.d/hotplug start
/etc/init.d/mysql start
/etc/acpi/powerbtn.sh
#!/bin/sh
# /etc/acpi/powerbtn.sh
# Initiates a shutdown when the power button has been
# pressed.

# Test if the computer is in suspended mode right now
if [ ! -f /tmp/suspended] ; then
        # Not in suspended mode -> shutdown
        if ps -Af | grep -q '[k]desktop' && test -f /usr/bin/dcop
        then
                dcop --all-sessions --all-users ksmserver ksmserver logout 0 2 0 && exit 0
        else
                /sbin/shutdown -h now "Power button pressed"
        fi
else
        # It is in suspended mode -> do nothing but come back from suspend
        # (handled by sleep.sh)
        rm -f /tmp/suspended
fi
I've been told that these settings (although I already knew they lost my network modules in the meantime) cause problems with other people. Don't hesitate to report if you want me to give some help (and thanks to Ineiti for his) in order to make this article better (and let anyone enjoy ACPI features).

Display size in X

Update /etc/X11/XF86Config-4 to add 1400x1050 display size
Section "Screen"
        Identifier      "Default Screen"
        Device          "ATI Mobility Radeon 9700"
        Monitor         "Écran générique"
        DefaultDepth    24
        SubSection "Display"
                Depth           1
                Modes           "1400x1050" "1280x1024" "1024x768" "800x600" "640x480"
        EndSubSection
        SubSection "Display"
                Depth           4
                Modes           "1400x1050" "1280x1024" "1024x768" "800x600" "640x480"
        EndSubSection
        SubSection "Display"
                Depth           8
                Modes           "1400x1050" "1280x1024" "1024x768" "800x600" "640x480"
        EndSubSection
        SubSection "Display"
                Depth           15
                Modes           "1400x1050" "1280x1024" "1024x768" "800x600" "640x480"
        EndSubSection
        SubSection "Display"
                Depth           16
                Modes           "1400x1050" "1280x1024" "1024x768" "800x600" "640x480"
        EndSubSection
        SubSection "Display"
                Depth           24
                Modes           "1400x1050" "1280x1024" "1024x768" "800x600" "640x480"
        EndSubSection
EndSection
If using GNOME, install the GNOME applet to change display size
apt-get install gnome-xrandr-applet
This should allow you to add the Display Geometry Switcher applet in the toolbar. Clicking on the applet allows to change to 1400x1050 mode.

Modem Intel AC'97

The modem is an Intel AC'97. Thanks to giupy on debian-laptop ML this section should help you install the modem. Install the sl-modem-daemon package
apt-get install sl-modem-daemon
In the first screen, you are asked where your modem is located. Answer truly. Now you should install the sl-modem kernel module. Use module-assistant for this in the following sequence:
  • launch module-assistant on the command line
  • go to "select"
  • select "sl-modem" with the space bar and press "OK"
  • select "Build" (at this stage, my module assistant hung up because of an impossibility to access slamr module or something similar. I just rebooted and restarted module assistant and did follow the same steps)
  • select "Install" (maybe module-assistant will do this automatically)
Now your modem should be accessible via /dev/modem (which points to /dev/ttySL0, which in turn points to /dev/pts/0). To configure your connexion, use pppconfig. Use default parameters if you don't know (but you should know phone number, login and password). Don't forget your modem is located at /dev/modem (likely), so do not accept the default /dev/ttyS0 If you want your modem to make some noise when connecting, and as it uses AC'97 soundcard features, you should be able to change the volume in the your GNOME sound controller (phone-out or phone-in).

TouchPad

The TouchPad needs to be setup as well to work properly. Please note it will work without this, but as a usual mouse, nothing more, while doing what follows here will bring you more features.
apt-get install xfree86-driver-synaptics
In /etc/X11/XF86Config-4, you should find (or write) a section like the following
Section "InputDevice"
        Identifier      "Touchpad"
        Driver          "synaptics"
        Option          "CorePointer"
        Option          "Protocol"              "auto-dev"
        Option          "Device"                "/dev/psaux"
        Option          "VertScrollDelta"       "100"
        Option          "AccelFactor"           "0.0025"
        Option          "RightEdge"             "5400"
        Option          "MaxTapTime"            "180"
        Option          "TopEdge"               "1900"
        Option          "SHMConfig"             "on"
        Option          "FingerLow"             "25"
        Option          "LeftEdge"              "1900"
        Option          "MaxTapMove"            "220"
        Option          "MinSpeed"              "0.03"
        Option          "FingerHigh"            "30"
        Option          "MaxSpeed"              "0.18"
        Option          "BottomEdge"            "4000"
        Option          "SendCoreEvents"        "true"
EndSection
In addition, the following section should include, together with the existing lines (ignore the dots):
...
Section "Module"
        ...
        Load "synaptics"
EndSection
...
Section "ServerLayout"
        ...
        InputDevice     "Touchpad"
EndSection
You can change all these values if needed. You might want to increase the MaxSpeed and AccelFactor options a bit if you find your cursor doesn't scroll the page faster enough

ATI Mobility Radeon 9700 DRI

Warning Using the ATI proprietary driver for 3D rendering might well break the ACPI wake-up possibility, thus preventing you from getting your laptop to sleep properly. The basic output of the card is alright, but there is apparently no open source DRI driver yet, so no 3D for now… but I hope I'll be getting the news as soon as it's out. Meanwhile, you can install the proprietary driver for common RADEON chipset from the ATI website (you should load the URL support.ati.com once to get a session cookie). Download the driver corresponding to your XFree version (in this case, most probably 4.3). Do the following (the first line is only if you haven't installed alien on your system)
sudo apt-get install alien
sudo alien -dc fglrx_4_3_0*.rpm
sudo dpkg -i --force-overwrite fglrx*.deb
sudo vi /etc/X11/XF86Config-4
in your /etc/X11/XF86Config-4, replace the current "Driver" line in the "Device" section for your graphic card by
  Driver    "fglrx"
You might still need to do some additional stuff if issuing a "modprobe fglrx" says it cannot find the module. Supposing you are using kernel 2.6.8...
sudo apt-get install kernel-headers-2.6.8-2-686
cd /lib/modules/fglrx/build_mod/
sh make.sh
cd ..
sh make_install.sh
modprobe fglrx
Now, relaunch XFree86 (by using CTRL+ALT+backspace or rebooting). Test your config with "glxgears". If you get something about 2000.00 fps, the driver works. Note As of 16/06/2005, a new ATI driver now supports kernels up to 2.6.11 ;-)

atitvout and display exports

The atitvout is a Debian package that makes it possible (you need the command line though) to export your display to another screen or a TV (with a TV-out cable, see back of the laptop).
apt-get install atitvout
Then you should be able (apparently only as root by default) to export your display to another screen with
atitvout lc
See man atitvout for more info. I have found that Xinerama is supposed to make this for X.org here

Notes for later extension of this article

  • cpufreqd - allow use of the cpufrequency applet in GNOME - worked before I did the work in power savings section. More to come later
  • card reader (MMC,SD,MS) works under Windows with the RICOH MediaCard Controller R5C590/R5C591/R5C593 driver.

Many thanks to...

Frédéric Peters, Jérôme Warnier and Guo-Rong Koh for helping me through all this information collection task. This article can be found on TuxMobil.org which also lists a lot of other Linux install on laptops. Feel free to go there and have a look if other articles suit you better.
[1] powernowd seems preferable to cpufreqd in this case, see paul.hahn.name/Articles/InstallRepDir/ACPI/view for more details