OpenSUSE on the EeePC

From openSUSE

Contents

Preface

In the following article you will find all the information about how to get openSUSE 10.3 running on an EeePC.
We are aware that there are several methods to do this but it would be quite a big howto if we describe all possible methods so we picked the fast way with a bootable USB drive and yast2-liveinstall, and the method with two USB drives, one to boot from and one as installation source.
If you want to try something different then have a look at the Installation Guides but keep in mind that the network installation does not work, as the 10.3 kernel does not include the atl2 ethernet driver.
Also keep in mind that nothing on this page is not officially supported, so make sure you know what you're doing...

Preparation

Hardware

  • EeePC 701 4G
  • USB flash drives depending on the method
  • a second machine to prepare the needed devices

Please note: the EeePC does not have a conventional hard drive, but a solid-state drive which has a finite number of write cycles. So far nobody seems to know how long the built-in SSD will last, but to be on the safe side you should take care to reduce unnecessary writes to the internal disk. This means:

  • no swap partition
  • mounting the partition(s) on the SSD with the option "noatime" set. Usually, whenever you read a file on disk, the time of last access (atime) is updated in the inode. With "noatime", this doesn't happen.
  • no journaling filesystem

Media

You will have to download the following:

For the installation from a single USB drive with YaST Live Installer
ftp://ftp.suse.com/pub/people/matz/eeeSUSE/eeeSUSE-liveusb.gz
For the installation from two USB drives
the openSUSE-10.3-GM-i386-mini.iso
either the openSUSE KDE or the openSUSE GNOME CD.
the "default" packages from (or at least the atl2 ones)
http://download.opensuse.org/repositories/home:/appleonkel:/EEE/openSUSE_10.3/i586/
http://download.opensuse.org/repositories/home:/appleonkel:/EEE/openSUSE_10.3_Update/i586/

Installation

Installation from bootable USB drive with YaST Live Installer

All your data on the EeePC will be gone after this procedure, do a backup.

The image for the usb stick can be found here. Unzip and dd to a 2GB stick.

1. Hit F2 on boot for the BIOS screen, arrow to the "Boot" tab. Under "Hard Disk Drives", select your USB stick as first drive, ESC. Go to "Boot Device Priority" and make sure your stick is the first. F10 to save + exit. If you boot next with no USB stick present, this setting will revert itself and the EeePC will boot from its internal disk.

2. If you see a "undefined mode number" warning during boot: this does not hurt, just hit SPACE. My hardware survived, scan doesn't help. I'll try and fix that in the next version.

3. I couldn't boot from usb stick while a SD card was in the slot. If during boot, a KIWI error message complains about "Couldn't determine file system type..." or similar, remove the card and try again.

4. The stick has user linux without password and with autologin configured, and user root also without a password (you might not want to leave your EeePC alone with it...).

5. The window manager you are logged in now is fvwm2. My idea was that this is the smallest graphical system I could create within a reasonable time, and that everyone can build their desired system from that and install all the packages they want.

6. In the fvwm2 button list, click the openSUSE icon and choose "Control Center". This will start yast2. (If you've never seen fvwm2 before: when a grid appears under the mouse pointer, you have to click somewhere for the new window to appear.)

7. In yast2, under "Miscellaneous", find the module "Live Installer". This will start a standard yast installation with the notable difference that you don't get to select any packages for installation. Instead, the installed system on the stick is copied over to your hard disk. We also use this for our LiveDVDs and it works (at least for me) like a charm, cheers to the YaST team!

8. I assume you are familiar with partitioning a hard disk. If not, please find someone who is to assist you, because you probably want to use Expert Mode ("Create Custom Partition Setup") in the yast partitioner. The partitions I have created are:

/boot 100MB
/     2.5GB
/home 1.2GB

But you can also use a single partition, that will prevent you from running out of free space too early. The /boot partition can be lowered to 50MB, usually only 10-15 MB are used.

In the partitioner you also see your USB stick, don't confuse it with your internal disk. (I am sorry, but I have to mention that.)

How many and which partitions you create is a matter of personal preference, a single partition will work just as well.

9. No, no swap. The default Xandros install also came without swap, and I am a bit paranoid about the limited (if large) number of write cycles to the SSD. Do as you wish. For the same reason, I use ext2 (and not a journaling file system) on all partitions and mount them with the option "noatime" set. (You can set this in the partitioner, or later modify /etc/fstab by hand.)

10. Grub. You have to make sure, and probably change the default setting, that grub is installed on your hard disk and not on the USB stick.

During install, my USB stick was /dev/sdb, and the internal hard disk was /dev/sdc. After rebooting without the USB stick, the internal numbering of disks will change: in my case, the internal disk is /dev/sda when I boot from it.

In Boot Loader Settings -> Boot Loader Installation, I chose "Boot from Boot partition", and yast2 used /boot as created above.

In the drop-down menu "Other" in the lower right corner, you can edit the configuration files directly if you really know what you're doing.

As grub uses /dev/disk/by-id/... links in the menu.lst, the reordering of disks should not matter. In my installation, however, it messed up the root (hd0,0) entry because it uses absolute numbering there. If this happens to you (you will notice on first boot that the EeePC doesn't. Boot, that is):

10a. Boot from the stick again, but do not start the installation. Find and mount the partition of your internal disk where you installed grub, find the file /boot/grub/menu.lst, and change the line

root (hd1,n)

to

root (hd0,n)

(where "n" is, of course, whatever number is there already, not a literal "n"). Change the first number, which denotes the disk from which to boot, and leave the second number as it is, it denotes the partition from which to boot. Here we count from zero -- sda1 would be 0,0, sda2 0,1 and so on. If your EeePC behaves the same as mine, your internal disk is sda when you boot from it.

11. On first boot (assuming that you have repaired grub, if necessary), remove the USB stick and finish the installation just as in a standard openSUSE installation. Congratulations, that's it!

12. Log in, start yast2, and install all the packages you want. If you want to use KDE or GNOME and know a little bit about them, you don't need to install them through the patterns. Select only the packages you want and let dependencies handle the rest. This takes more time and a bit of trial and error, but you have a fighting chance to keep your system a bit smaller that way.

Installation from two USB drives

  1. First you create the boot stick by following the steps from http://en.opensuse.org/SuSE_install_from_USB_drive
  2. Then you create the "fake" USB-CDROM by formatting the second drive similar to what is described in the article above, except that we don't try to make it bootable and only copy the contents of the CD to the stick.
  3. Create a new directory and name it e.g.: EeePC
  4. Within this directory create two directories e.g: GM and Update
  5. Copy the default packages from http://download.opensuse.org/repositories/home:/appleonkel:/EEE/openSUSE_10.3/i586/ to the GM directory
  6. Copy the default packages from http://download.opensuse.org/repositories/home:/appleonkel:/EEE/openSUSE_10.3_Update/i586/ to the Update directory
  7. Insert both sticks into the EeePC
  8. During the BIOS screen press ESC to get to the boot device menu and pick the boot stick.
  9. Now you see the normal installation menu and the only thing that you have to change is the source. Set it to "Hard Disk" by pressing F4 and using the cursor keys. It will scan all disks when you leave it empty - so leave it empty.
  10. The graphical installation program should start, on one of the question screens, deselect "Add Online Repositories Before Installation" (remember - we do not have network now)
  11. As it is no good idea to have a swap partition we have to change the partitioning - if you are not familiar with this topic try to get some help before you proceed.
  12. Pick "Create Custom Partition Setup" and then "Custom Partitioning (for experts)".
  13. Leave the first three partitions untouched and create one large partition (about 3.7 GB) for /.
  14. The rest of the installation is similar to a normal installation except that you will have to boot from the boot stick again and start the installation again (ie, not 'Boot from Hard Disk' at the first menu) but instead of choosing "New Installation" when the graphical installer starts up you pick "Other Options" and then "Boot Installed System". Now you can proceed with the second stage of the installation.
  15. After you are done with the installation become root and change to the GM directory on the second USB stick. Simply install all the packages with "rpm -Uvh *"
  16. Now you have to fix the grub issue by doing the same as described in step 10a from "Installation from bootable USB drive with YaST Live Installer".
  17. You can add all the "needed" online repositories now and do a update. If the network is not working anymore after the update then install the packages from the Update directory that you have created earlier.

This method also works for putting OpenSUSE onto a SD card to have a dual-boot OpenSUSE/Xandros system. To fix grub, instead of 'step 10a' you can simply umount (if required) and remove the USB sticks (so they definitely won't be probed), run yast and choose System - Boot Loader. Then use the 'Other' 'Propose New Configuration' option and it will produce a grub setup that will let the OpenSUSE install boot (by default it also finds the original Xandros grub configuration on the first partition of the SSD, and tries to incorporate that, but the result won't boot the Xandros properly, possibly because the Xandros setup assumes a different disk arrangement than you'll have if you booted from the SD card in the slot). You can then either manually add a correct Xandros entry, or simply delete the Xandros entry in the YaST proposal (to boot Xandros you just eject the SD card before booting or press ESC when booting and choose the internal SSD). If YaST reports it is going to write grub to floppy just say OK - it seems to end up on the SD card as it should - and on subsequent runs it doesn't seem to make the same announcement. Having done this, you can incorporate the Xandros partitions into /etc/fstab to have them available in OpenSUSE (/dev/sdb1 type ext2, probably prudent to mount it read-only; /dev/sdb2 type ext3 and if read-write you can use the files that have been saved from within Xandros - they will all be owned by the first user specified during the OpenSUSE install).

Improvements

The X Server will only work with a 640x480 resolution. Edit your /etc/X11/xorg.conf and replace the sections "Monitor", "Screen" and "Device" with the following code:

 Section "Monitor"
   Identifier   "Monitor[0]"
   VendorName   "ASUS"
   ModelName    "eeePC 701"
   ModeLine     "800x480" 29.58 800 816 896 992  480 481 484 497 # 60Hz
   Option       "DPMS"
 EndSection
 Section "Screen"
   DefaultDepth 24
   SubSection "Display"
     Depth      24
     Modes      "800x600"
   EndSubSection
   Device       "Device[0]"
   Identifier   "Screen[0]"
   Monitor      "Monitor[0]"
 EndSection
 Section "Device"
   BoardName    "Mobile 915 GM"
   BusID        "0:2:0"
   Driver       "intel"
   Identifier   "Device[0]"
   VendorName   "Intel"
 EndSection

Hotkeys

Method 1

The hotkeys are not working, too. You can download the RPM eeeEvents and install it to make the hotkeys Fn+F2 to Fn+F9 working. It will also add the asusosd binary and the below mentioned file 60eeepc. You have to start the binary by yourself to make the OSD working. Edit the following option to the shown value in /etc/powersave/events if the suspend (hibernation) mode is not working when you press Fn+F1:

 EVENT_BUTTON_SLEEP="suspend_to_ram"

Method 2

Another method to activate the most hotkey symbols is to add the following lines to the end of /usr/share/X11/xkb/symbols/de (example for German keyboard, the proper symbol section can be configured in xorg.conf):

partial alphanumeric_keys
xkb_symbols "eeepc" {

    include "de(basic)"

    name[Group1]="Germany - eeePC";

    key <AD12>  { [      plus,   asterisk,   asciitilde,  dead_macron ] };
};

The asus_acpi module must be loaded, see description below.

Then you need to define the hotkeys in /etc/acpi/hotkey.sh. The following example is derived from original Xandros and works (but not the WLAN key, LCD/CRT not tested):

#!/bin/sh

export DISPLAY=:0

case $3 in
        #Fn+F1
        00000080)
                # echo "Suspend2RAM" > /dev/console
                ;;
        #Fn+F2
        00000010)
                # echo "Wlan On" > /dev/console &
                /etc/acpi/wlan.sh poweron
                /etc/acpi/wlan.sh restore
                ;;
        00000011)
                # echo "Wlan Off" > /dev/console &
                /etc/acpi/wlan.sh poweroff
                ;;
        #Fn+F5
        00000030)
                # echo "LCD" > /dev/console &
                /usr/bin/xrandr --output LVDS --preferred --output VGA --off
                ;;
        00000031)
                # echo "CRT" > /dev/console &
                /usr/bin/xrandr --output VGA --mode 1280x1024 --output LVDS --off
                ;;
        00000032)
                # echo "LCD-CRT" > /dev/console &
                /usr/bin/xrandr --output VGA --mode 800x480 --output LVDS --mode 800x480
                ;;
        #Fn+F6
        00000012)
                # echo "Task Manage On" > /dev/console
                #DISPLAY=:0 /bin/su -c "/usr/bin/ksysguard --showprocesses" user &
                /opt/kde3/bin/ksysguard --showprocesses &
                ;;
        #Fn+F7
        00000013)
                # echo "Volume Mute" > /dev/pts/0 &
                amixer set Master toggle
                ;;
        #Fn+F8
        00000014)
                # echo "Volume Down" > /dev/console &
                amixer set Master 3.20dB-
                ;;
        #Fn+F9
        00000015)
                # echo "Volume Up" > /dev/console &
                amixer set Master 3.20dB+
                ;;
        #Fn+F3
        0000002x)
                #echo "Brightness Down" > /dev/pts/0
                ;;
        #Fn+F4
        0000002x)
                #echo "Brightness Up" > /dev/pts/0
                ;;
esac

Decreasing the disk IO:

Add the following line to /etc/sysctl.conf:

 vm.dirty_writeback_centisecs = 15000

That will prolong the life of the SSD by writing only every 150 seconds (2.5 minutes) to it, unless low memory or something else forces a write sooner. Beware that this risks losing any data written to disk within the last 150 seconds should the system crash - choose a bigger or smaller number to suit your relative SSD life v. system crash paranoia.

If you are running kpowersaved, however, that will over-ride the setting. In that case, edit /etc/powersave/events and find the lines with "EVENT_ACADAPTER_ONLINE" and "EVENT_ACADAPTER_OFFLINE". If they are set to "ignore", change the "ignore" to "set_dirty_writeback". If they are set to anything else, add set_dirty_writeback to the end of the list. Then create the file /usr/lib/powersave/scripts/set_dirty_writeback with the same permissions as the other files in that directory and containing something like this:

 #!/bin/bash
 #
 # load helper functions
 . ${0%/*}/helper_functions
 
 # set vm parameter to required value
 sleep 3
 $LOGGER "set dirty_writeback_centisecs to 15000"
 echo 15000 > /proc/sys/vm/dirty_writeback_centisecs
 
 # exit in the required manner
 $SCRIPT_RETURN $EV_ID 0 "set_dirty_writeback complete"
 EXIT 0


By mounting the tmp directories in a tmpfs the accesses to the SSD will be decreased. But you will lose all the data in the tmp directories if the PC shuts down. Add the following lines to /etc/fstab

 tmpfs      /tmp                    tmpfs        defaults      0 0
 tmpfs      /var/tmp                tmpfs        defaults      0 0
 tmpfs      /var/lock               tmpfs        defaults      0 0

If you do not use postfix as a real MTA then you can also add this line:

 tmpfs      /var/spool/postfix      tmpfs        defaults      0 0

You can also mount /var/log and /var/run as tmpfs, in this example with a maximum size of 128MB:

 tmpfs      /var/log                tmpfs        defaults,size=128m    0 0
 tmpfs      /var/run                tmpfs        defaults,size=128m    0 0

Notes:

  • To mount /var/run with tmpfs causes some problems with needed subdirectories, maybe you need to find a workaround.
  • Mouting /var/log with tmpfs can also cause problems. For instance, apache2 does not start, because /var/log/apache2 does not exist. Workaround: Change the apache2 init script to create that directory each time apache2 is started.
  • You should also create the /var/log/YaST2 directory, add test -d /var/log/YaST2 || mkdir -m 700 /var/log/YaST2 to your /etc/init.d/boot.local script.
  • Cups demands the directory /var/lock/subsys. Change the cups init script to create that directory each time cups is started.

ext2/ext3 file system tuning

For increasing the free space in your ext2 or ext3 file systems, you can reduce the reserved blocks to e.g. 2%:

tune2fs -m2 /dev/sda1

Configuration and additional repositories

Suspend

To get suspend to disk and RAM to work you just need to add

http://download.opensuse.org/repositories/home:/seife/openSUSE_10.3


to your repositories and install the "suspend" package.
A big thanks to seife!

Suspend to RAM works quite well (by using the hotkey and/or closing the cover), but you need to add some code to the power management in e.g. /etc/pm/sleep.d/60eeepc (script adapted from original Xandros):

#!/bin/bash
case $1 in
    hibernate)
        /etc/init.d/network stop
        /sbin/modprobe -r ath_pci
        #/sbin/modprobe -r ndiswrapper
        ;;
    suspend)
        /etc/init.d/network stop
        /sbin/modprobe -r ath_pci
        #/sbin/modprobe -r ndiswrapper
        ;;
    thaw)
        /sbin/modprobe ath_pci
        #/sbin/modprobe ndiswrapper
        /etc/init.d/network start
        /etc/init.d/acpid restart # hotkeys do not work after resume, /etc/acpi
        ;;
    resume)
        /sbin/modprobe ath_pci
        #/sbin/modprobe ndiswrapper
        /etc/init.d/network start
        /etc/init.d/acpid restart # hotkeys do not work after resume, /etc/acpi
        ;;
    *)  echo "EeePC power management script called incorrectly."
        ;;
esac

Problems:

  • Resume fails if the camera is in use (e.g. by Skype)
  • Device names from mounted SD card filesystems are changed after a resume, e.g. from sdb to sdc. This causes problems with mounted filesystems. Even though udev creates new symlinks in /dev/disks/by-id/, existing mounts do not work anymore. So, you have to umount the filesystem before suspend and mount it again after resume, or just add the umount and mount commands to the powermanagement script above. However, this doesn't help when umount is not possible due to open files. There seems to be a solution by using a USB_PERSIST kernel setting (see eeeuser.com forum sdb becomes sdc after hibernation and Building a kernel where USB_PERSIST actually works), but that parameter is not configured in the standard openSUSE kernel. Any other solutions are welcome.

WLAN, Alsa, Ethernet, ACPI

WLAN needs the madwifi package from this repository:

http://download.opensuse.org/repositories/home:/appleonkel:/EEE/openSUSE_10.3/

and to keep updates:

http://download.opensuse.org/repositories/home:/appleonkel:/EEE/openSUSE_10.3_Update/

However, the madwifi driver does not work very reliable (for me). Establishing connections is a pure luck. You can also use the ndiswrapper module, see schmolle1980 repositories below and Howto: Configure ndis wrapper. The ndiswrapper method is more reliable, but there is a problem with high system load causing from a process named ntos_wq.

The appleonkel repositories contain also packages for Alsa, Ethernet and ACPI drivers.

For starting the asus_acpi module at system startup, you should add it to the file /etc/sysconfig/kernel:

MODULES_LOADED_ON_BOOT="asus_acpi"


CPUFreq

The CPU in the eeePC supports CPUFreq via the p4-clockmod driver. For some reason, this is not probed for by default by haldaemon, so you'll need to edit part of /etc/rc.d/haldaemon to read:

function load_cpufreq_driver() {

   CPUFREQ_MODULES="p4_clockmod speedstep_centrino powernow_k8 powernow_k7 powernow_k6 longrun speedstep_ich acpi_cpufreq"
   CPUFREQ_MODULES_GREP="^p4_clockmod\|^speedstep_centrino\|^speedstep_ich\|^powernow_k8\|^powernow_k7\|^powernow_k6\|^longrun\|^longhaul\|^acpi_cpufreq"
   
   ###### load CPUFREQ modules############

Please note that some users on other distributions have reported instability using this driver. I, however, am using it right now on OpenSUSE 10.3 and have no issues. YMMV.

Camera

To activate the camera you first have to turn it on in the BIOS. Then add

http://download.opensuse.org/repositories/home:/schmolle1980/openSUSE_10.3/

and to keep updates

http://download.opensuse.org/repositories/home:/schmolle1980/openSUSE_10.3_update/

to you repositories and install the "uvcvideo-kmp-default" package. After a reboot the camera should work out of the box (tested with kopete). The camera works in Skype but not in ucview.