====== Debian Lenny on the EeePC ====== The main source of information is **[[http://debian-eeepc.alioth.debian.org/|Debian for the Asus Eee PC]]**, the following notes is my personal recipe. ===== Kernel 2.6.26 on the EeePC 900 ===== On the EeePC 900 with kernel 2.6.25 (see below) there is a **[[https://bugs.launchpad.net/ubuntu/+source/linux/+bug/232173|problem with internal microphone]]**, which cannot record any audio. I installed the Debian 2.6.26 kernel and some packages from the **[[http://wiki.debian.org/DebianEeePC/Repository|Debian EeePC repository]]**: deb http://eeepc.debian.net/debian lenny main contrib non-free deb-src http://eeepc.debian.net/debian lenny main contrib non-free Special EeePC packages fetched from the repository are: * **''eeepc-acpi-scripts''** * **''madwifi-modules-2.6-686''** * **''madwifi-modules-2.6.26-1-686''** Support for camera (**''uvcvideo''**), network card (**''atl2''**) and Asus ACPI (**''eeepc_laptop''**) is provided by modules of the stock **''linux-image-2.6.26-1-686''** kernel. ===== Audio with kernel 2.6.26 on the EeePC 900 ===== Kernel 2.6.26 provides **ALSA drivers 1.0.16**, which has some minor glitches on the EeePC 900: * **Muting** the front (internal) speaker **does not work**. * The **Front control** should control only the **internal speaker**, but it influences also the **headphone**. The interesting ALSA controls are (use **''alsamixer''** to set them): ^ Playback ^^ ^ Master | Adjust the volume of **headphone** and **internal speaker**. When this control is muted, toggling mute on the Headphone or on the Front control **is ignored**. Muting works only on the headphone. | ^ Headphone | Toggle the headphone output ON/OFF. | ^ PCM | Adjust the volume of PCM audio. | ^ Front | Adjust the volume of headphone and internal speaker. The mute does not work. | ^ Capture ^^ ^ Capture | Enable/disable capture and adjust gain. | ^ Digital | Gain boost: **keep below 60%**. | ^ Input Source | Select caputer source: **Front Mic** or **Mic** (external). | It is convenient to connect **''Fn+F8''** and **''Fn+F9''** keys to both the **Front** and the **Headphone** controls, see **''/etc/default/eeepc-acpi-scripts''**: VOLUME_LABEL='Front' HEADPHONE_LABEL='Headphone' In **''xfce4-mixer''** set the //wannabe master// control to **Front,0**, and enable only the **PCM**, **Front**, **Capture** and **Digital** controls. It seems that **Alsa 1.0.18** has a better support for the EeePC, see the [[http://wiki.debian.org/DebianEeePC/HowTo/Sound|Debian EeePC Sound HowTo]]. ===== Compiling a custom kernel and modules ===== **Note:** For the EeePC 700 I used the 2.6.22 kernel, but for the EeePC 900 I used the 2.6.25 from Debian Sid, because of the [[http://lists.alioth.debian.org/pipermail/debian-eeepc-devel/2008-May/000368.html|sound problem]]. I compiled a custom kernel on my desktop PC, because I don't want to install the development tools and kernel sources onto the EeePC, I also don't want to wait the time required to compile on the little Asus. It is also necessary to compile some modules which are not provided by the vanilla kernel, but have separated sources: * **atl2** for the Ethernet * **eeepc-acpi** for controlling integrated peripherials * **madwifi-eeepc** for the WiFi card * **linux-uvc** for the camera So the Debian packages required are: * **linux-source-2.6.25** (version 2.6.22 is OK for the EeePC 700) * **kernel-package** * **eeepc-acpi-source** * **atl2-source** * **linux-uvc-source** * **madwifi-eeepc-source** This is a **non-free** package, due [[http://wiki.debian.org/NonFreeTrackingSystem/SourcePackage/madwifi|some restrictions]] in redistribution and some binary-only files. I got it from **[[http://eeepc.debian.net/pool/non-free/m/madwifi-eeepc/|eeepc.debian.net]]**. If you use the old version I got from this [[http://people.debian.org/~synrg/debian-eeepc/|repository]], remember to put the Debian madwifi-source package **on-hold**, otherwise the patched package will be replaced by the Debian one at the first **apt-get ugrade**. I used the original Asus kernel configuration as a base for the new one: cd /usr/src tar jxf linux-source-2.6.22.tar.bz2 ln -s linux-source-2.6.22 linux cd linux make mrproper cp /boot/config-2.6.21.4-eeepc .config make oldconfig make-kpkg clean make-kpkg --revision=0.1 --initrd kernel_image To compile the extra modules (atl2, eeepc-acpi, linux-uvc, madwifi-eeepc) I used commands like that: cd /usr/src tar jxvf atl2.tar.bz2 cd linux make-kpkg --added-modules atl2 modules Then I installed with **''dpkg -i''** all the resulting packages: * {{.:eeepc:atl2-modules-2.6.25-eeepc_2.0.3-3_0.2_i386.deb}} * {{.:eeepc:eeepc-acpi-modules-2.6.25-eeepc_1.0-1_0.2_all.deb|}} * {{.:eeepc:linux-image-2.6.25-eeepc_0.2_i386.deb|}} * {{.:eeepc:linux-uvc-modules-2.6.25-eeepc_0.1.0.svn193-3_0.2_i386.deb|}} * {{.:eeepc:madwifi-eeepc-modules-2.6.25-eeepc_0.9.4_r3366-1_0.2_i386.deb|}} ===== The WiFi card ===== We need to load the following kernel modules: ^ ath_pci | Support for Atheros 802.11 wireless LAN cards | ^ ath_rate_atheros | Rate control support for Atheros devices | ^ ath_dfs | DFS Support for Atheros 802.11 wireless LAN cards | ^ ath_hal | Atheros Hardware Access Layer (HAL) | Like the Xandros setup, we load the **pciehp** module (PCI Express Hot Plug Controller Driver) with an entry into **''/etc/modules''**, then the **ath_pci** is loaded with a modprope rule contained in **''/etc/modprobe.d/pcie''**: options pciehp pciehp_force=1 install pciehp /sbin/modprobe --ignore-install pciehp pciehp_force=1; /sbin/modprobe ath_pci The Madwifi driver with the Atheros WiFi chip, supports multiple access point and station configurations on the same phisical device, the phisical device is named **wifi0**. Whenever the WiFi is turned on, want an interface configured in station mode (named **ath0**), for this we write an udev rule into **''/etc/udev/rules.d/50_eeepc.rules''** (borrowed from the original ''50-xandros-udev.rules''): KERNEL=="wifi0", ACTION=="add", RUN+="/sbin/wlanconfig ath0 create wlandev wifi0 wlanmode sta" We can turn-on (1) or turn-off (0) the WiFi card with the command line: echo 1 > /proc/acpi/asus/wlan ===== The webcam ===== Tried into the EeePC 900. Load the module **uvcvideo**, activate the camera with the command echo 1 > /proc/acpi/asus/camera then start the program **''luvcview''** from same name Debian package. It seems that **Ekiga** has some trouble using the camera via **V4L** (Viedeo for Linux) **version 1**. I installed the **''libpt-1.11.2-plugins-v4l2''** package to let Ekiga open the camera, solving the error message your video driver doesn't support the requested video format ===== Halt or poweroff problem ===== The EeePC does not halt (poweroff) when requested, the problem is with the audio kernel module **snd_hda_intel**. We must unload the module before poweroff. You can add a **''modprobe -r snd_hda_intel''** into ''/etc/init.d/halt'' or add a dedicated script linked as **''/etc/rc0.d/S89eeepc_local''**. ===== Hotkeys ===== This is a summary of what I succeded to make work: ^ Fn + F1 | Sleep does not work | ^ Fn + F2 | WiFi on/off works | ^ Fn + F3, F4 | Bright up/down work (but no OSD feedback) | ^ Fn + F5 | LCD/CRT not verified | ^ Fn + F6 | Task manager does not work | ^ Fn + F7 | Mute/Unmute works | ^ Fn + F8, F9 | Volume up/down works | To get working hotkeys (Fn + F1, F2, ...) we need some Debian packages installed: * **acpid** the ACPI daemon * **eeepc-acpi-scripts** some scripts which respond to ACPI events * **alsa-utils** amixer is used to control the audio * **madwifi-tools** not strictly needed The configuration files are: * /etc/default/eeepc-acpi-scripts ===== Changing the original GRUB menu ===== If you start the EeePC with the standard Xandros installation, you can modify the **''/boot/grub/menu.lst''**, but your changes will be ignored at the next reboot. This is why your changes are written onto **''/dev/sda2''**, which is mounted as unionfs on top of **''/dev/sda1''** after the boot. You can boot off a different installation (press ESC on boot and choose to boot from USB), mount /dev/sda1 and make the changes to GRUB menu. ===== Optimizing Konsole ===== - Font: Terminus (Debian package **xfonts-terminus**), Bold, size 11 - Settings, Configure Konsole..., General, Show frame (no) - Show Menubar - Tab: Dynamic Hide, Auto Resize Tabs ===== X.org required packages ===== You can reduce the number of xserver-xorg installed packages by removing the ones you not need. To support the EeePC hardware you need: * **xserver-xorg-video-intel** * **xserver-xorg-input-kbd** * **xserver-xorg-input-synaptics** * **xserver-xorg-input-mouse** ===== Optimizing Xfce ===== I choosed Xfce instead of KDE or Gnome because it is light. To have the battery status, a network widget, a calendar, a volume control in the Xfce panel, I installed some extra packages: * xfce4-battery-plugin * xfce4-mixer * network-manager-kde To let a standrd user to power-off the EeePC via the quit //Actions applet// you must partecipate the user into the **powerdev group** and write into **''/etc/xdg/xfce4-session/xfce4-session.rc''**: [xfce4-session] Shutdown=%powerdev To have the **compose key** help in typing characters that are not present on the keyboard, you can edit /etc/X11/xorg.conf following this example: [[doc:appunti:linux:tux:localizzazione#caratteri_non_presenti_sulla_tastiera_kde_e_non_solo]]. ===== Controllare la frequenza ===== **NOTA:** Pare che modificare (abbassare) la frequenza della CPU sia del tutto inutile ai fini della durata della batteria e del calore generato. * [[http://forum.eeeuser.com/viewtopic.php?pid=114384|EeePC Forum: cpufreq useless]] * [[http://forum.eeeuser.com/viewtopic.php?pid=22043|Dynamic frequency scaling doesnt work]] * [[http://polishlinux.org/linux/debian/green-pcs-cpu-frequency-scaling-in-linux/|Frequency scaling in Linux]] Si installa il modulo kernel **p4_clockmod**, grazie a questo i tool tipo **xfce4-cpufreq-plugin** possono mostrare la frequenza attuale della CPU. Si installa anche il pacchetto delle utility **cpufrequtils**. Il modo in cui viene amministrata la frequenza del clock è affidata ad un policy governor, si può scegliere tra diversi moduli kernel: * cpufreq_ondemand * cpufreq_powersave * cpufreq_conservative La configurazione avviene direttamente in **''/etc/init.d/cpufrequtils''**, ad esempio: ENABLE="true" GOVERNOR="ondemand" MAX_SPEED="900000" MIN_SPEED="112500" Per scoprire il range di funzionamento del processore si usa: cpufreq-info -l 112500 900000 Per vedere quale policy è attualmente in uso: cpufreq-info -p 112500 900000 ondemand I moduli kernel necessari si devono mettere in **''/etc/modules''**: p4_clockmod cpufreq_ondemand ===== Attacching an external VGA display ===== Install the **eeepc-acpi-scripts** package. You can attach an external display to the VGA port **after you have booted** the notebook: hit **Fn-F5** to switch between internal or external display. Indeed I have a **problem** if the external display is attacched **during XFCE login**: the KDM login is displayed correctly on both internal LCD and external monitor, but XFCE startup crashes. I see a lot of flikering, then X crashes and a new KDM login appears. The last few lines of ''**Xorg.log**'' are: (II) intel(0): [drm] removed 1 reserved context for kernel (II) intel(0): [drm] unmapping 8192 bytes of SAREA 0xf8c49000 at 0xb7f80000 (II) intel(0): [drm] Closed DRM master. A workaround is to keep the external display disconnected once the login is completed, then plug the VGA cable and hit Fn-F5. Check the following script and configuration files: * **''/etc/acpi/actions/vga-toggle.sh''** * **''/etc/default/eeepc-acpi-scripts''** You can set the following option: COMBINED_DISPLAY_SWITCHES="--auto --output LVDS --same-as VGA" #COMBINED_DISPLAY_SWITCHES="--auto --output LVDS --off" #COMBINED_DISPLAY_SWITCHES="--auto --output LVDS --below VGA" #COMBINED_DISPLAY_SWITCHES="--auto --output LVDS --right-of VGA" I also changed the ''case'' statement of **''/etc/acpi/actions/vga-toggle.sh''**: # handle return value # 0 = disconnected # 1 = connected and VGA enabled # 2 = connected and VGA disabled case $? in 0) xrandr --auto ;; 1) xrandr --auto sleep 3 xrandr --output VGA $COMBINED_DISPLAY_SWITCHES ;; 2) xrandr --output VGA --off --output LVDS --auto ;; esac ====== Debian Squeeze on the EeePC ====== ===== X.org ===== Default installation does not create an ''/etc/X11/xorg.conf'' file. We can merge some configuration snippet using the **''InputClass''** directive. The first is to activate the **touchpad tapping**, the second is to enable the **compose key** (using the menu key) and the **Euro sign** on the Alt-e combination. **''/etc/X11/xorg.conf.d/synaptics.conf''** Section "InputClass" Identifier "Touchpad" # required MatchIsTouchpad "yes" # required Driver "synaptics" # required Option "MinSpeed" "0.5" Option "MaxSpeed" "1.0" Option "AccelFactor" "0.075" Option "TapButton1" "1" Option "TapButton2" "2" # multitouch Option "TapButton3" "3" # multitouch Option "VertTwoFingerScroll" "1" # multitouch Option "HorizTwoFingerScroll" "1" # multitouch Option "VertEdgeScroll" "1" Option "CoastingSpeed" "8" Option "CornerCoasting" "1" Option "CircularScrolling" "1" Option "CircScrollTrigger" "7" Option "EdgeMotionUseAlways" "1" Option "LBCornerButton" "8" # browser "back" btn Option "RBCornerButton" "9" # browser "forward" btn EndSection **''/etc/X11/xorg.conf.d/compose.conf''** Section "InputClass" Identifier "keyboard-all" MatchIsKeyboard "yes" Driver "evdev" Option "XkbOptions" "lv3:ralt_switch, compose:menu, eurosign:e" EndSection Per vedere le ''XkbOptions'' attive usare il comando: setxkbmap -print xkb_keymap { xkb_keycodes { include "evdev+aliases(qwerty)" }; xkb_types { include "complete" }; xkb_compat { include "complete" }; xkb_symbols { include "pc+us+it:2+gr:3+inet(evdev)+level3(ralt_switch)+compose(menu)+eurosign(e)" }; xkb_geometry { include "pc(pc105)" }; }; Per impostare le opzioni //una tantum// da riga di comando: setxkbmap -option lv3:ralt_switch,compose:menu,eurosign:e ===== xfce ===== I stay with Xfce, also because I got some problem installing Lxde in a KVM virtual machine, where windows move down into the screen, falling out of the bottom border. Some useful Xfce plugins: * **''xfce4-xkb-plugin''** * **''xfce4-battery-plugin''** * **''xfce4-mount-plugin''** I installed the **network-manager-kde** package, which works into the Xfce systray. To let the Network Manager to start automatically at logon: - Xfce menu, //Settings//, //Session and Startup// - //Application Autostart//, //Add//: **''knetworkmanager''** The session management approach **does not work**. Once ''knetworkmanager'' is started, into the //Session// tab of //Session and Startup//, there is the //Save Session// button. Unfortunately the application is not restored at next logon. The KDE services approach **does not work** too: there is a //Launch KDE services on startup// into the //Advanced// tab of //Session and Startup//, but ''knetworkmanager'' is not started at logon. Adding the user into the **''powerdev''** and **''netdev''** groups, allows to configure the netowrk interface and power down the system. FIXME There is a problem if the Xfce panel has the **autohide** option enabled: the ''knetworkmanager'' and ''kwalletmanager'' icons don't get disaplayed correctly into the systray; they are truncated and almost invisible. ===== Web browser ===== To choose Mozilla Iceweasel instead of Konqueror: update-alternatives --config x-www-browser ===== Disk performances ===== Asus EeePC 900, disk performances measured with **''hdparm -t''** ^ /dev/sda | 33.00 MB/sec | First SSD, 4 Gb | ^ /dev/sdb | 25.46 MB/sec | Second SSD, 16 Gb | ^ /dev/sdc | 14.51 MB/sec | MiniSD card, 4 Gb | ==== TRIM command ==== Solid State Disks should support the [[wp>TRIM]] command, this is a command used by the operating system to inform a SSD that a particular sector is no longer used and can be internally wiped. It seems that EeePC 900 disks do not support TRIM. For on-line operation, Linux kernel supports TRIM starting from 2.6.33. For off-line operation **''hdparm''** supports TRIM starting from version 9.17. With ''hdparm'' sources there is the **''wiper.sh''** script, which can be run in this way: mount -o ro /dev/sda1 /media/sda1/ ./wiper.sh /dev/sda1 --commit --verbose wiper.sh: Linux SATA SSD TRIM utility, version 2.8, by Mark Lord. rootdev=/dev/sdc1 fsmode2: fsmode=read-only /dev/sda: DSM/TRIM command not supported, aborting. ==== Journal data writeback ==== To gain a little in disk performances, you can enable writeback for journal data. Here it is an example for the ''/dev/sdb1'' partition, formatted as ext3 and mounted under ''/home''. tune2fs -o journal_data_writeback /dev/sdb1 mount -o remount,data=writeback /dev/sdb1 To enable this option on bootstrap, you have to change **''/etc/fstab''**: /dev/sda1 /home ext3 defaults,noatime,data=writeback 0 1 For the root filesystem, it is required also to pass the option to the kernel, using a GRUB parameter. With Debian Squeeze the option is added into **''/etc/default/grub''**: GRUB_CMDLINE_LINUX_DEFAULT="rootflags=data=writeback quiet" GRUB_CMDLINE_LINUX="rootflags=data=writeback" Run **''update-grub''** to install that option into **''/boot/grub/grub.cfg''**. ===== WiFi interface ===== The WiFi interface is supported by the new **ath5k** kernel module. Once loaded, the **wlan0** interface is available. The new **''iw(8)''** command can be used to manipulate the device configuration, its purpose is similar to the ''wlanconfig'' command, used with the old ''ath_pci'' kernel module. Here it is an example on how to deconfigure/reconfigure the interface from scratch: iw dev wlan0 del iw phy phy1 interface add wlan0 type managed To use the WiFi interface with **''kismet''**, you need this in the **''/etc/kismet/kismet.conf''** configuration file: source=ath5k,wlan0,atheros After exiting ''kismet'', the ''wlan0'' interface must be reconfigured as explained above, and ''knetworkmanager'' should be restarted.