ASUS Eee PC 701

From ArchWiki
Revision as of 15:18, 29 December 2007 by Gilneas (Talk | contribs) (Power down with the power button: setuid halt option & pre tag fix)

Jump to: navigation, search


WARNING: THIS ARTICLE IS INCOMPLETE! Visit the Arch forum thread link below to get information on installing Arch Linux on the Asus EEE PC.

Most of this information is from the Arch Forum. You can also find a lot of helpful information from the EEEUser Forum.

Before You Begin

Avoiding Pitfalls

The install is pretty normal, except that you'll need to avoid the pitfalls of our alternative Linux install:

  1. Never choose to use a journaling file system on the SSD partitions
  2. Never use a swap partition on the SSD
  3. Always edit your new installation fstab to mount the SSD partitions "noatime"
  4. Never log messages or error log to the SSD

The rules ensure that we won't reach the maximum limit of writes on our SSD faster than we should.

Choosing Your Kernel

Because the hardware is not supported by the default Arch kernel, you'll need to get the hardware up and running through one of the following methods:

Arch Kernel and Ndiswrapper

Probably the easiest to implement. Install Arch as normal (with the minor kinks found in this article), then install the Windows XP wireless driver found on Asus' website and use Ndiswrapper to get wireless working:

  1. Go to Asus' website and download the driver (direct link).
  2. Unzip the file and save the contents of the 'ndis5x' folder for use after you install Arch Linux.

Compile the 'everything' Kernel

The 'everything' kernel has ath5k, which supports the Atheros chipset found on the EEE PC. Here are the instructions on compiling the 'everthing' kernel (thanks raymano!).

Using the EEE PC's Kernel

The EEE PC's kernel has all the hardware working through its modules, so why not use it? Grab a few debs from the EEE PC package source mirror to your Arch install to make your life easier. They include:

  • The Kernel (linux-image-2.6.21.4-eeepc_3_i386.deb)
  • Wireless driver (atheros-swan-modules-2.6.21.4-eeepc_20070713-2_i386.deb)
  • LAN driver (atl2-modules-2.6.21.4-eeepc_1.0.40.4-2_i386.deb)
  • Webcam driver (uvcvideo-modules-2.6.21.4-eeepc_20070706-2_i386.deb)
  • Modem driver (hsfmodem-modules-2.6.21.4-eeepc_7.60.00.04oem-4_i386.deb)
  • ACPI (asus-acpi_1.38-1xandros5_i386.deb)

Now just extract the deb files and save the data.tar.gz files. I also grabbed the xorg.conf, since it has all the Synaptic touchpad info in it.

To get the wireless to work using the Eee Pc modules, include ath_pci in MODULES. For wired internet using the internal nic, include atl2 in the MODULES list.

Insert this line in /etc/conf.d/wireless: wlanconfig ath0 create wlandev wifi0 wlanmode sta

Note[Trithemius 20071215]: In the case of Arch, this is probably not the one you want - there are dependencies in Arch that rely on newer kernels.

Choosing Your Installation Media

The EEE PC does not have an optical drive installed on the machine. This means you will need to install Arch Linux through one of the alternative methods:

  1. External USB CD-ROM drive
  2. USB pen drive

Unfortunately, the kernel does not include drivers for a LAN or Wireless install. If anyone knows how to do this, they're more than welcome to add this information in =D

And Always Remember...

And I shouldn't have to tell you this: always back up your data ;)

It's now time to install Arch Linux (hooray!).

Installing Arch Linux

Note: if you're using the USB pen drive as your media, don't forget to follow these instructions.

Prepare Hard Drive

The drive is split up into four partitions (here's some information about the partitioning):

  • I don't know how other people did it, but I ended up wiping the entire disk and using one partition for the install.
  • Choose "NONE" for swap (see #2 in Avoiding Pitfalls).
  • Select "ext2" as your filesystem (see #1 in Avoiding Pitfalls).

Select Packages

The only thing here is if you're using a USB pen drive as your media, select "SRC".

Install Packages

Nothing to see here.

Configure System

Make these edits to "/etc/fstab":

  • Add "noatime" to the options of your mounts (you can also add "nodirtime") (see #3 in Avoiding Pitfalls)
  • Add a new line: "tmpfs /var/log tmpfs size=1M 0 0" (WARNING: this will delete all your logs! See #4 in Avoiding Pitfalls)
    • To save your startup/shutdown logs, look at the pitfalls link above.

Install Bootloader

To decrease boot time, I set "timeout" to 0. It's all about boot up time ;)

Reboot

Hooray ;)

Getting Everything Working

By now, you should have Arch installed. When I get back, I'll show you how to make it usable.

Sound

Some people have reported sound working right out of the box with no troubles. However, others might need to add the following line to /etc/modprobe.conf.

options snd-hda-intel model=3stack-dig

Pm-utils

?

Webcam

?

Xorg

I got X running with the xorg.conf from the original Xandros install. After installing xorg, you will need two other packages (to get the touchpad and video card working:

pacman -S synaptics xf86-video-intel

Then, just drop in the original /etc/X11/xorg.conf (I made sure to comment out the last section, because I was getting errors):

Section "ServerLayout"
       Identifier     "archeee"
       Screen      0  "Screen1"
       InputDevice    "keyboard"
       InputDevice    "mouse"
       InputDevice    "synaptics"
EndSection

Section "Files"
       ModulePath   "/usr/lib/xorg/modules"
       FontPath     "/usr/share/fonts/X11/misc"
       FontPath     "/usr/share/fonts/X11/Type1"
       FontPath     "/usr/share/fonts/X11/75dpi"
       FontPath     "/usr/X11R6/lib/X11/fonts/Type1"
EndSection

Section "Module"
       Load  "glx"
       Load  "dri"
       Load  "extmod"
       Load  "synaptics"
EndSection

Section "ServerFlags"
       Option          "AllowMouseOpenFail"
       Option          "BlankTime" "5"
       Option          "DontVTSwitch"  "true"
       Option          "AIGLX"   "false"
EndSection

Section "InputDevice"
       Identifier  "keyboard"
       Driver      "kbd"
       Option      "CoreKeyboard"
       Option      "XkbRules" "xorg"
       Option      "XkbLayout" "us"
       Option      "XkbVariant" ""
EndSection

Section "InputDevice"
       Identifier  "mouse"
       Driver      "mouse"
       Option      "Device" "/dev/input/mice"
       Option      "Protocol" "IMPS/2"
       Option      "Emulate3Buttons" "yes"
       Option      "ZAxisMapping" "4 5"
       Option      "CorePointer"
EndSection

Section "InputDevice"
       Identifier  "synaptics"
       Driver      "synaptics"
       Option      "Device"           "/dev/psaux"
       Option      "Protocol"         "auto-dev"
       Option      "LeftEdge"         "1000"
       Option      "RightEdge"        "5400"
       Option      "TopEdge"          "1000"
       Option      "BottomEdge"       "4900"
       Option      "PalmDetect"       "0"
       Option      "SHMConfig"        "true"
       Option      "SendCoreEvents"   "yes"
       Option      "HorizScrollDelta" "0"
       Option      "RBCornerButton"   "0"
       Option      "RTCornerButtom"   "0"
       Option      "MaxSpeed"         "0.1"
EndSection

Section "Monitor"
       Identifier   "Monitor1"
       VendorName   "ASUS"
       ModelName    "eeePC P701"
       Modeline     "800x480"  29.58  800 816 896 992  480 481 484 497
-HSync +Vsync # 60 Hz
EndSection

Section "Device"
       Identifier  "Device1"
       Driver      "intel"
       VendorName  "Intel Corporation"
       BoardName   "Mobile 915GM/GMS/910GML Express Graphics Controller"
       BusID       "PCI:0:2:0"
EndSection

Section "Screen"
       Identifier "Screen1"
       Device     "Device1"
       Monitor    "Monitor1"
       DefaultDepth     24
       SubSection "Display"
               Depth     8
               Virtual  1680 1680
       EndSubSection
       SubSection "Display"
               Depth     15
               Virtual  1680 1680
       EndSubSection
       SubSection "Display"
               Depth     16
               Virtual  1680 1680
       EndSubSection
       SubSection "Display"
               Depth     24
               Virtual  1680 1680
       EndSubSection
EndSection

Section "DRI"
       Mode         0666
EndSection

#Section "Extensions"
#       Option      "Composite" "Disable"
#EndSection

Then just:

startx

Please update this with any missed steps.

Arch Kernel and madwifi

Instructions from http://wiki.eeeuser.com/ubuntu#wireless_internet_using_native_madwifi_drivers to patch madwifi. This replaces the Arch madwifi packages.

wget 'http://madwifi.org/attachment/ticket/1679/madwifi-ng-0933.ar2425.20071130.i386.patch?format=raw'
wget http://snapshots.madwifi.org/madwifi-ng/madwifi-ng-r2756-20071018.tar.gz
tar zxvf madwifi-ng-r2756-20071018.tar.gz
cd madwifi-ng-r2756-20071018
patch -p0 < ../madwifi-ng-0933.ar2425.20071130.i386.patch\?format\=raw
make clean
make
sudo make install

Working against stock 2.6.23-ARCH kernel.

Arch Kernel and atl2

There are a number of patches/&c. floating about for the atl2. More recent kernel changes (2.6.22 and above) introduce things that broke the original sources. After much hunting found the posting at http://forum.eeeuser.com/viewtopic.php?pid=54057 with a link to a debian package that happily enough includes working patches for 2.6.23. Extract the sources and use the provided makefile to build atl2.ko, then flip that to /lib/modules/`uname -r`/net and run depmod -a.

Arch Kernel and Ndiswrapper

First, make sure ndiswrapper and utils are installed:

pacman -S ndiswrapper ndiswrapper-utils

Now, blacklist the Atheros modules loaded by hal. Edit the /etc/rc.conf blacklist to look something like this:

MOD_BLACKLIST=(ath_pci ath_hal)

You will want to make sure that those modules are not loaded in the module list as well by adding a "!" before those modules (in /etc/rc.conf):

MODULES=(!ath_hal !ath_pci ...

Now, you will need the drivers. I got them from the DVD that came with the Eee. On the DVD, copy all of the files from:

/Drivers/Wireless/ndis5x/

Place them in a place that your Eee can access. Now go the location of the drivers and install them in ndiswrapper:

cd /driver/location/
ndiswrapper -i ./net5211.inf
ndiswrapper -l
ndiswrapper -m
depmod -a
modprobe ndiswrapper
iwconfig
ndiswrapper -ma && ndiswrapper -mi

I had to add the final step above to actually create wlan0. Please edit the above if there is anything unecessary there. Those are the steps I took, though.

Finally, add ndiswrapper to your modules (in /etc/rc.conf):

MODULES=(!ath_hal !ath_pci ndiswrapper ...

That should do it.

Compile the 'everything' Kernel

Using the EEE PC's Kernel

I have much better luck with a rebuild of the kernel sources instead of trying to overlay the provided binaries. (I am running an encrypted root, and 2GB of RAM.) Unpacked the 2.6.21.4-eeepc sources to a USB thumb drive, used the Asus kernel config and ran a normal kernel build. Followed that up with mkinitcpio to create the initial disk image, and the EeePC is happy.

Note that the /boot/config-2.6.21.4-eeepc file is from the original Asus firmware.

unrar e Linux_Kernel_071127.rar
ar x linux-source-2.6.21.4-eeepc_5_all.deb data.tar.gz
tar xOf data.tar.gz ./usr/src/linux-source-2.6.21.4-eeepc.tar.bz2 | tar xvjf -
rm data.tar.gz
cd linux-source-2.6.21.4-eeepc
cp /boot/config-2.6.21.4-eeepc .config
make oldconfig
make bzImage modules
make install 
make modules_install

Make an initial disk image to boot from:

/sbin/mkinitcpio -k 2.6.21.4-eeepc -c /etc/mkinitcpio.conf -g /boot/eeepc.img

Add an appropriate entry to /boot/grub/menu.lst, such as:

title  eee kernel
root   (hd0,0)
kernel /vmlinuz root=/dev/sda2 ro
initrd /eeepc.img

After running a bit, this is a bad idea. Arch has dependencies on the newer kernels (for example, rsync fails in weird ways) so this approach may work in the short term, but I'd consider deprecated in favor of a 'real' kernel tree.

Power down with the power button

The two alternatives here are described in Allow_users_to_shutdown.

If you don't already or don't plan to use sudo, it may be simpler to use the setuid /sbin/halt method, otherwise using sudo is preferred.

Below are all the steps required for the sudo method. If you want to use the setuid method, read the article linked above and perform the 'power' file step here, while omitting the 'sudo' in it.

pacman -S sudo

As root, do the following:

visudo

Add the following line to the file:

USER HOST = NOPASSWD: /sbin/poweroff

Where USER = the user you want to be able to power down with and HOST = your hostname (from /etc/rc.conf).

Now, create a file called /etc/acpi/events/power, containing:

# /etc/acpi/events/power
# This is called when the user presses the power button

event=button/power (PWR.||PBTN)
action=sudo /sbin/poweroff

Make sure that you execute

/etc/rc.d/acpid start

And/or add acpid to the daemons list in /etc/rc.conf:

DAEMONS=(hal, acpid ...