cnpbagwell

Linux‎ > ‎

Fedora 13 and ASUS Eee PC 1005PEB

I bought a new ASUS Eee PC 1005PEB in March of 2010.  Below are some notes I'm taking while install linux on it.  At this time only Fedora 13 Alpha is out but notes should apply mostly for final Fedora 13 as well.

Overview

What works with default install:
  • Intel N450 Pineview CPU with speed control
  • 1024x600 Display
  • Intel Pineview Graphics with 3D Support
  • Atheros Wireless 802.11b/g (no additional drivers needed!)
  • Touchpad
  • USB
  • Keyboard
  • Audio Speakers
  • Webcam
  • Suspend(Sleep)/Resume from Suspend
  • Hibernate/Resume from Hibernate
Not tested:
  • Headphones or mic
  • SD Card Reader
  • VGA Output
  • Ethernet Connector

Resizing Windows 7 Partition

Windows seems to prefer to place some system files (page file, hibernate file, and system restore files) above the half way point on a drive and defrag can not move them around.  Since I want to give half or more to Linux and other OS's, I used the following steps to move the files.

  • Delete crapware, install any new apps, and upgrade the system.
  • Download UltraDefrag and install it.  Run it and click on "Settings..." button.  Click check mark by "Enable" for Windows boot time scan".  Finally, click on "Script" button to modify script ran at startup.  Change line that says "ultrascan c:" to "ultrascan -o c:'.  Upon next bootup, this will run an optimized scan and moves all files towards front of drive.  This is not enough though because it can not move page files, hibernate files, or system restore files.  The following steps will get of those files before rebooting.
  • Disable System Protection by selection Start->Control Panel->System and Security->System->System Protection.  On System Protection tab, click Configuration and then disable option.  After future reboot, re-enable on same menu.
  • Disable Hibernation by selecting start menu and in search box type "cmd" but don't hit enter.  Using right button press, select Run As Administrator.  Run "powercfg /hibernate off".  On future reboot, use same sets but use "on".
  • Disable the virtual memory pagefile by selecting Start->Control Panel->System and Security->System->Advanced System Settings.  On Advanced tab, click on Performance Setting.  On Advanced tab, click Virtual Memory Change button. Click No Page Setting.  After future reboot, re-enable on same menu.
  • Reboot. This will run UltraDefrag during boot. After reboot, run UltraDefrag and Analyze drive to verify all was moved towards front.
  • Reuse above instructions to re-enable System Restore protection, virtual memory page file, and hibernation.  You will also want to disable running UltraDefrag or at least take out the '-o" option so its not so slow.
Once the drive has all the free space towards end, its time to shrink the drive.  Under start menu's "Search programs and files" input box, enter "diskmgmt.msc" and hit enter.  On screen will be  bar with graphical picture of hard drive space. Click on the first partition and then right click and select "Shrink Volume...".  Adjust size to your desired size.

Installing Fedora

Its easiest to install Fedora using a Live CD saved to a USB flash drive.  Fedora Project provides very good details on how to do this.  To use the USB drive, you may need to change the boot priority in BIOS settings menu.  Also, I think you can hit Escape and then TAB key during boot sequence and the BIOS will request which device to boot from.

After installing, it doesn't include all the applications that the more standard DVD install would give.  You can get the default set of applications by running following command line once logged in.
yum groupupdate "GNOME Desktop Environment" \
"Development Tools" "Server Configuration Tools" \
"Hardware Support" "Sound and Video" \
"Graphical Internet" "Fonts" \
"Games and Entertainment" "Printing Software" \
"Administration Tools" "Office/Productivity" "System Tools"

ACPI and eeepc-laptop

There is a kernel driver that supports a bunch of eeepc specific hardware features (their keys, SHE underclocking/overclockingt, etc).  This will not load with stock Fedora 13 because it reports itself as Windows 7 and this disables eeepc_laptop interface but enables eepc_wmi interface (which isn't in Fedora 13).  It seems you need to add acpi_osi="!Windows 2009" to your kernel line in /boot/grub/grub.conf.  Upon next bootup, the eeepc-laptop module will be loaded.  There will still be one remaining issue because backlight dimming will not work correctly (as of firmware 4/13/2010).  Add acpi_backlight=vendor and this will let eeepc_laptop control dimming as well.

Keyboard

The Fn keys that work:
  • Fn-F1 (Sleep)
  • Fn-F2 (Wireless disable) - Disables but doesn't notify NetworkManager and confuses things.
  • Fn-F5 and Fn-F6 (Dimmer)*
  • Fn-F8 (Switch Video Mode)
  • Fn-F10/Fn-F11/Fn-F12 (Mute/Volume Down/Volume Up)*
The Fn keys that do not do anything by default but can be mapped to something using Shortcuts:
  • Fn-F3 (Disable Mouse) - Reports as KEY_F13 key
  • Fn-F4 (Screen Resolution) - Reports as KEY_F14 key
  • Fn-F7 (Display Off) - Reports as KEY_DISPLAY_OFF
  • Fn-F9 (System Task Manager) - Reports as KEY_PROG1
For example, I mapped Fn-F9 to to run gnome-system-monitor by running System->Preferences->Keyboard Shortcuts.  Next, I click the Add button and add an item called "System Monitor" that runs "gnome-system-monitor".  Once created, I click on it and hit Fn-F9 to bind key to shortcut command.

*Volume keys only work after adding acpi_osi="!Windows 2009" to boot options.  Dimming requires that option as acpi_backlight=vendor as well.

For Fn-F4 (resolution), I do not have any need for smaller resolutions but I would like to use a higher resolution for apps that just don't work well with 1024x600.  xrandr supports an --scale option that will allow going higher; although rather ugly.  I make use of Keyboard Shortcuts and run the following script to toggle between 1024x600 and 1024x768 resolutions.  Save the following to a file and "chmod 755 restoggle.sh".

#!/bin/bash

find_res=`/usr/bin/xrandr | grep "1024x768"`

if [ $? == "0" ]; then
  xrandr --output LVDS1 --mode 1024x600 --scale 1.00x1.00
else
  xrandr --output LVDS1 --mode 1024x600 --scale 1.00x1.28
fi

Touchpad

The touchpad works pretty good with the synaptics X driver by default.  Select System->Preferences->Mouse to enable tap-to-click feature.

I noticed using that Mouse preferences that the 2 finger options were greyed out.  Using the gpointing-device-settings application, I also noticed that 2 and 3 finger support was not working.  Digging deeper, I noticed in dmesg output that it lists its capabilities as 0xd04731.  Digging in the kernel and in Synaptics documents I see that means the hardware says it can report finger widths but not multi-touch.  The windows drivers seems to be using the width of fingers to determine when 1, 2, or 3 finger gestures are being done.

The xf86-input-synaptics driver does have an xorg.conf value that can be used to emulate 2 finger multi-touch.  It is EmulateTwoFingerMinW since it needs to be based on W value.  I've not tried it yet.

Another major issue with the netbook is related to its size.  When you put your finger on the button to click, its very easy for that to also register as touching the lowest row of touchpad (they can sense things even when your not touching the pad).  If your other hand is moving the mouse cursor at same time, you can get unwanted mouse jumps once that other hand is lifted off the mouse pad.

Googling the issue turns up a few common complaints on this but no clean solutions yet.

Super Hybrid Engine

If you want to get the longest battery life then you need to enable the Power Savings mode of the Super Hybrid Enginer (SHE).  There are a few applications (eeepc-control) that will enable power savings mode but most do not work with Fedora 13 because of power management was changed to use UPower (was PowerKit) and the interface is different.  Also, most of these applications duplicate logic that is controlled elsewhere in Fedora and/or Gnome.

I wrote a very small tool that will monitor when going to battery power and will enable power savings mode.  When back on AC it will enable performance mode.  Three files need to be installed.

Save following as eeepc-monitor into /usr/local/bin.  Afterwards, run "chmod 755 /usr/local/bin/eeepc-monitor".

#!/usr/bin/python

import os
import dbus
from dbus.mainloop.glib import DBusGMainLoop
import gobject
import subprocess

# power_change - Called when ever UPower changes.  Since only interested
# in status change of onBattery, query that and compare to old value.
# On change, update SHE settings.
def power_change(*args):
  global old_onBattery
  onBattery = upower.Get("org.freedesktop.UPower", "OnBattery", dbus_interface='org.freedesktop.DBus.Properties')
  if onBattery != old_onBattery and onBattery == 0:
    os.system("/usr/bin/notify-send --urgency=low --expire-time=5000 \"Super Hybrid Engine\" \"Changing to Performance\"")
    os.system("sudo /usr/local/bin/eeepc-selector cpufv set performance")
  if onBattery != old_onBattery and onBattery == 1:
    os.system("/usr/bin/notify-send --urgency=low --expire-time=5000 \"Super Hybrid Engine\" \"Changing to Power-Savings\"")
    os.system("sudo /usr/local/bin/eeepc-selector cpufv set powersavings")
  old_onBattery = onBattery;

# Initialize the event loop
DBusGMainLoop(set_as_default=True)

# Connect to the Session DBUS
system_bus = dbus.SystemBus()

# Declare an interest in UPower signals
system_bus.add_signal_receiver(power_change, dbus_interface="org.freedesktop.UPower", signal_name="Changed")

# Store UPower object for use by signals
upower = system_bus.get_object('org.freedesktop.UPower', '/org/freedesktop/UPower')

# Store initial state so we can filter on only battery status changes
old_onBattery = upower.Get("org.freedesktop.UPower", "OnBattery", dbus_interface='org.freedesktop.DBus.Properties')

power_change()

# Wait for events
gobject.MainLoop().run()

NOTE: As of 2010-05-11, Fedora 13 Beta change UPower behavior so that there is no Changed signal on org.freedesktop.UPower when OnBattery changes.  Registering for Changed signal on org.freedesktop.UPower.Device makes script work again.  This UPower change seems to have also broken other Gnome tools such as dim while on battery.  I'm not sure if its a permanent change because of that so just marking it as a note for now.

Save the following to file eeepc-selector into /usr/local/bin. Afterwards, run "chmod 755 /usr/local/bin/eeepc-selector".

#!/bin/sh
#
# eeepc-selector cpufv get
# eeepc-selector cpufv set [powersavings|performace|superperformance]

eeepc_base_path="/sys/devices/platform/eeepc"
eeepc_cpufv="${eeepc_base_path}/cpufv"

let level=`cat ${eeepc_cpufv}`
let level="$level & 3"

if [ "$1x" == "cpufvx" ]; then
  case $2 in
    get)
      case $level in
        0)
        echo superperformance
        ;;
        1)
        echo performance
        ;;
        2)
        echo powersavings
        ;;
      esac
    ;;
    set)
    case $3 in
      powersavings)
      if [ $level != "2" ]; then
    echo "2" > $eeepc_cpufv
      fi
      ;;
      performance)
      if [ $level != "1" ]; then
    echo "1" > $eeepc_cpufv
      fi
      ;;
      superperformance)
      if [ $level != "0" ]; then
    echo "0" > $eeepc_cpufv
      fi
      ;;
    esac
  esac
else
  echo "Usage:"
  echo
  echo "$0 cpufv get"
  echo "$0 cpufv set [powersavings|performance|superperformance]"
fi

Save the following to file eepc in /etc/sudoers.d.  Afterwards, run "chmod 0440 /etc/sudoers.d/eeepc":

ALL    ALL=NOPASSWD:/usr/local/bin/eeepc-selector

Now add this to list of apps to run at logic.  System->Preferences->Startup Applications.  Click "Add" and and /usr/local/bin/eeepc-monitor.  Log out and back in and test it out.  When switching between battery power, you should see a message about changing Super Hybrid Engine settings.

Mounting Windows Partition

Since I am duel booting with Windows 7, I wanted to be able to share data between the two OS's.  Linux can read NTFS partitions but there is not really any support for reading EXT4 partitions.  So when data needs to be shared, it should always be stored on the NTFS partition.

To always have NTFS parition mounted on bootup, add the following line to your /etc/fstab file:

/dev/sda1       /media/Windows\0407     ntfs    defaults        1 2

Also, create this directory:

mkdir "/media/Windows 7"

To make sure file permissions are correctly translated to something Windows understands, run the following command while NTFS partition is not mounted.  Follow the prompts and inform it of linux users and groups for your main users under Windows.

ntfs-3g.usermap

Once thats done, you need to move the files created over to Windows partition.

mount "/media/Windows 7"
mkdir "/media/Windows 7/.NTFS-3G"
mv UserMapping "/media/Windows 7/.NTFS-3G"
umount "/media/Windows 7"
mount "/media/Windows 7"

My hopes are I can do things like share a single Dropbox directory on Windows partition and have it sync correctly regardless of which OS I'm running.