Logo

P50IJ Notebook Installation Guide

Wifee wanted a notebook computer in order to do her stuff in places other than at her desk. Naturally I wanted to keep the price low and stick with a system I am familiar with. In the end I chose a business notebook without Microsoft tax for under 400 Euro. But would my favourite Linux distribution go? Read on.

The Hardware

The mobility aspect required a surface that does not show every mark, a bright non-glare screen, low temperature operations and fairly good battery life. In the end I opted for an ASUS P50IJ-SO08. The data sheet includes:

No connectors are found at the back, which is another plus. For under 400 Eurons it doesn't sound all bad.

Basic Installation

The notebook is delivered with an installation of Red Flag Linux. Given Asus is a Taiwanese company, this might not be a surprising choice of distribution. However, the installation is minimal and can only be seen as a fig leaf. Even if you wanted to use Red Flag Linux, you'd be better off wiping the root sector and starting from scratch. I for my part went on to install Slackware Current (change log as of 2010-04-05), which at this stage must be fairly close to the next official release which might be called 13.1.

Update: by now, Slackware 13.1 has been released. As described in a later section, I now recommend to install the 64 bit version from the beginning.

I did the usual full installation, minus a few things, and did the usual customizing settings that I always tend to do with my Slackware installations. I could spend a lot of time writing about them, but since everybody have their own preferences I shall focus on the notebook specific stuff in this article.

Maybe a quick word on partitioning, because that is something beginners are often unsure about: over time I have developed the following partitioning scheme:

Device    Boot      Start         End      Blocks   Id  System      Mount point
-------------------------------------------------------------------------------
/dev/sda1               1           4       32098+  83  Linux       /boot
/dev/sda2   *           5        4182    33559785    7  HPFS/NTFS   
/dev/sda3            4183       30401   210604117+   5  Extended    
/dev/sda5            4183        5227     8393931   83  Linux       /
/dev/sda6            5228        5750     4200966   83  Linux       /var
/dev/sda7            5751        6273     4200966   83  Linux       /usr/local
/dev/sda8            6274       30401   193808128+  83  Linux       /home

As you can see, I still have this eccentricity about a small boot partition at the beginning of the drive. Strictly that is no longer required these days, but it gives me a feeling of safety. You can add a boot option with initrd to have a small emergency system in case anything goes wrong with the major partitions.

Partition /dev/sda2 is not in use at the moment. It just serves as a fallback for He-Who-Must-Not-Be-Named, should the need ever arise. Update: it has been pointed out that it is a good idea to reserve this space at the end of the hard drive in order to make better use of the outer cylinders' data rate.

Partition /dev/sda5 contains the root file system, nothing unusual here. Putting /var on a partition of its own protects from run-away log files. Having a separate partition for /home is also common practice. It allows you to carry home directories across upgrades more easily. The reason I put /usr/local on a separate partition is a mixture of the last two. I try and keep the prefix /usr completely untouched and under full control of Slackware package management. This means, for example, that I use /usr/local/src instead of /usr/src for compiling software from source, including kernel builds.

Something else that must be mentioned is KDE 4. On the P50IJ you start X without an Xorg.conf file, and provided the right kernel options are compiled in, KDE 4 runs stunningly well with desktop effects enabled. Unfortunately there are some features in KDE 4 that increase the home directory of every single user account by roughly 160 MB, and that also create additional disk activity. To fix that, do the following for every user:

  1. Go into KDE system settings, click on the tab "Advanced". Select "Desktop Search" and disable Nepomuk and Strigi. Go back and then into "Akonadi Configuration". Untick "use internal MySQL Server", and stop the Akonadi server.
  2. Delete any large files and directories within ~/.local/share/akonadi/ and ~/.kde/share/apps/nepomuk/repository/ .
  3. Stop the migration that will otherwise happen every time you log on. For system wide effect, modify the file /usr/share/config/kres-migratorrc. If you want to affect only specific users, create a file ~/.kde/share/config/kres-migratorrc in their respective home directories. The content should be (at least)
[Migration]
Enabled=false

Update: since it is the declared goal of the KDE PIM developers to move all KDE PIM applications to Akonadi, you will have to use alternative applications. In KDE 4.3 this affected only KAdressBook, but from KDE 4.4 onwards KMail is affected, and it appears it will include KNotes, KOrganizer and maybe other applications in the future. You can read about the migration strategy in this KDE TechBase article. For an alternativ approach to the bloat problem you can also try to lower the space requirements of the internal Akonadi database, as described in the FAQ section of the article.

Update 2:Unfortunately the method of switching off Akonadi changes with every KDE release. With 4.5.5 I found there is no option in the system settings any longer. Generally speaking you need to hunt down the switch using the "find" and "grep" commands in your home directory. At the time of writing the server start is controlled by the option StartServer in file ~/.config/akonadi/akonadiserverrc.

Next there is an issue with power meters: there are two power meters competing for supremacy right after installation. I suggest to remove the file /usr/share/autostart/guidance-power-manager.desktop . Alternatively you can remove the package guidance-power-manager. Afterwards only the KDE system power manager will be active. The settings probably need to be reviewed (via menu item "System Settings"). For instance, you might want to change the system response when you close the lid.

Update:It appars the Guidance Power Manager has been dropped in Slackware 13.37.

Do not forget to adjust the files in /etc, /etc/rc.d and /etc/profile.d as part of the usual Slackware installation process.

Note: if you are planning to upgrade an existing Slackware installation, have a look at my Slackware Upgrade Tools. They are a great help for me to get a grip on the installed packages and the changes coming in.

Custom Kernel

Initially a kernel delivered with Slackware was installed, namely kernel-huge-smp-2.6.33.1_smp. With that kernel the basic functioning of the system could be established and first clues about the required drivers could be obtained. I would then continue to build my own optimised kernel. The latest available kernel at the time was 2.6.33.2. As always, the kernel sources (and documentation) are available from Kernel.Org.

I wouldn't be me if I didn't try and improve the kernel, though. On my desktop machines I usually enhance responsiveness using the CK kernel patch by Con Kolivas, and I usually enhance the user experience with boot loader images and boot splash graphics.

Let me say straight away that I could not get the bootsplash mechanism to work due to framebuffer conflicts between bootsplash and the kernel mode setting required for Xorg. Also, due to the standard resolution being stretched on the wide screen display, the graphics modes do not look very appealing. It should be noted anyway that bootsplash is an outdated concept no longer maintained. These days there are other solutions operating in user space.

The aforementioned CK kernel patch by Con Kolivas is available from here. I have been using the autoiso-xorg patch as well which gives isochronous (almost real-time) scheduling priority to X. It helps a little to give the impression of responsiveness, particularly on slower and single core machines. On the other hand it is generally considered unwise to give so much privilege to one particular process, especially a complex one like X. But who cares, just go for it. 8)

Obviously the kernel configuration options have a great impact on the hardware support and the user experience with the system. In the following sections I will talk you through the kernel options that are working for me. For reference you can look at my .config file. It is the result of make menuconfig which seems to create some odd pre-selections of options, but hey.

We enable BFS (a simplified scheduler) which is the whole point of the CK patch.

Since we are making a custom kernel we don't need module support.

We choose the CFQ I/O scheduler.

We need to enable SMP (multi-processor) support. The number of CPUs can be set to two, and no CPU hotplugging is required. The CPUs do not offer SMT (hyper-threading), so we unselect that option. The processor family is Core 2.

We definitely want a tickless system, to reduce the number of interrupts and thus power consumption. We also enable high resolution timer. For the sake of system responsiveness we select 1500 Hz timer frequency and low-latency desktop. 1500 is a multiple of both 50 and 60, in case this makes any difference to multimedia applications.

Update:Nowadays I choose a timer frequency of 300 Hz. It seems not to have any impact on the user experience, and the hope is that it lowers the power consumption.

A very interesting topic is the memory settings since the CK patch gives us additional options. If you want to stay close to the standard for best software compatibility you select high memory support 4GB and default memory split (896 MB lowmem). I have chosen high memory support off and 2G/2G memory split. In the past I have encountered only one program that required the standard option which is Wine (an environment to run MS Windows applications). But your mileage may vary.

Update: if you follow my recommendation and install the 64 bit version of Linux, this step is neither required nor available.

We enable power management and all meaningful ACPI options. We also enable suspend-to-ram which is most useful for laptops. I did not enable hibernation (suspend-to-disk) since quite frankly I do not see the point of it. With 2 GB of RAM or more, you do not gain much compared to a proper shutdown & reboot, and it is an everlasting source of problems. As performance governors we enable performance, powersave and on-demand. The actual choice will be made via the KDE system settings later on.

Under networking we enable packet sockets, unix domain sockets and TCP/IP networking. Since we might want to implement a firewall later on (I haven't yet) we enable packet filtering. We also enable wireless support, in particular cfg80211, powersave-by-default and mac80211. In order for WLAN to work we need to select a few more options, as I found out the hard way: cfg80211 wireless extensions compatibility, wireless extensions sysfs files and common routines for IEEE802.11 drivers.

We are now entering the drivers section. It is neigh impossible to go through everything here. For instance, it goes without saying that we deselect all devices not present in the notebook (like the parallel port). Others are simply handy (like the loop device or the ram disk). In the following I will focus on the devices specific to the notebook.

It may sound surprising, but the SCSI subsystem must be enabled. It is used for SATA disks as well as USB memory devices, actually for almost everything these days. We include SCSI disk, CD ROM and generic support, but no low level SCSI driver. In the adjacent driver section we enable Serial ATA including ACPI and AHCI support. In the USB section much further down we enable host side USB, selective suspend/resume and wake-up, EHCI, UHCI, and ‒ depending on the type of of USB devices we are planning to use ‒ printer and mass storage support.

In the multiple device drivers section we enable the device mapper, not because we need it (we don't) but because in Slackware LILO is configured to complain if it doesn't find an active device mapper driver.

Under Network Support we need to choose drivers. First under 1000 Mbit/s Ethernet the driver Atheros L1E, which is marked experimental. And of course the Wireless driver, which is the Atheros 802.11n driver.

Regarding input devices, there are a number of things to observe. First of all, the letters HID stand for Human Interface Device and they are relevant here. We must enable input eventing because that is the key to all input devices working with HAL and consequently with X ‒ at least in Slackware. We select nothing under Keyboards, but we must select PS/2 mouse support if we want the touchpad to work!!!

The I2C bus should be enabled with the intel 82801 ICH as low level driver.

Under Multimedia we select Video for Linux (V4L) plus the compatibility layer for V4L API 1. In the drivers section we select helper functions, USB support, and therein USB Video Class (UVC). Unfortunately there is yet another problem: the image created by the camera is upside down. There are three possible ways to overcome this.

  1. Turn the notebook upside down.
  2. If you cannot work that way, you could try a kernel patch. The idea was first posted here. However, time has moved on and the patches no longer compile. I have adapted the patch to kernel 2.6.33. You can download it from my web space. If you prefer a mirrored image straight from the kernel, you can use this patch instead. Both have been tested, and I am currently using this method.
  3. The newer ‒ and some say: correct ‒ way to solve the issue involves pre-loading a library for all video applications. The source code of the library is available here. There is also an instructions page.

Regarding graphics support: we must enable agpgart for intel I8XX chipsets and direct rendering for the i915 driver. We must also enable kernel mode switching for the i915 driver. This should automatically enforce the framebuffer device. We do not need any framebuffer driver, because i915 and mode switching takes care of it. As far as I can see there is no way around it, and this is also the reason why the bootsplash patch won't work.

As far as sound is concerned, we need to enable ALSA with all sorts of OSS compatibility devices. We also need the PCI driver for Intel HD Audio. In the detailed settings we choose aggressive power save mode with 60 s timeout or so. We also need to choose at least one codec as far as I can see. In my case I chose the VIA HD-Audio codec support, but I am really unclear about this setting. Maybe you are better off with a different one, or enable them all. When trying different settings I found that some sound devices appeared and then disappeared again from the ALSA mixer (like PCM). At the moment I have no understanding of the mechanics behind all this.

Finally, under X86 platform specific devices, we need to enable the Asus laptop extras.

So much for the laptop related kernel options. Now there are two more subjects that deserve a closer look: DVD operation and wireless LAN.

DVD

Surprisingly the biggest headache with this notebook (so far) turned out to be the Matshita DVD drive. First of all the noise was unacceptable during playback. This issue can be solved by reducing the drive speed. I have found a utility named speedcontrol and compiled it from source (license: GPL). The source can be downloaded from here. The source is compiled and installed like this (your mileage may vary):

gcc -o speedcontrol speedcontrol.c
strip speedcontrol
chmod a+x speedcontrol
mv speedcontrol /usr/local/bin

I have then added a call to speedcontrol to my /etc/rc.d/rc.local:

echo -n "Forcing CD-ROM speed to 1x: "
/usr/local/bin/speedcontrol -x 1 /dev/cdrom

Obviously you must not forget to re-set the drive speed when you need it.

However, the noise was not the only problem. I found I could not play all of my DVDs. One reason is the content scrambling system, or CSS for short. In case you don't know, the CSS is a mechanism invented by the DVD industry to control the market. It is in fact not a copy protection system, at least not directly. Instead it eliminates the existence of DVD players unless they are sanctioned by the DVD consortium. Since this involves money and non-disclosure agreements, the whole concept is pretty incompatible with the ideas of Free Software and Open Source.

Luckily clever people have found a way around this impediment. If the laws in your country permit, simply install libdvdcss and you're ready to rumble. Only, in my case, I still couldn't read all DVDs. So next thing I was looking into was region codes. In case you don't know, region codes are a mechanism invented by the DVD industry to control the market. I found evidence on the internet that you need to set the region code at least once for a DVD drive to function (although other sources claim that libdvdcss overrules the region code). Note, however, that after 5 changes every modern DVD drive will be locked to the region last used ‒ no more changes possible.

I found a utility called dvd_region that can set the region code of a drive. According to the source it is by Jens Axboe, a Linux kernel developer, but there is no mention of the license. Judge for yourself. The file can be found here. The compilation is done just like speedcontrol above.

I also found the drive mentioned on rpc1.org, a web site dedicated to providing firmware for DVD drives that disables the whole region logic. Just to explain the terminology, the current standard for region processing is called RPC2. The older standard RPC1 allowed an infinte number of changes of region.

The description on rpc1.org can be found here. I tried to follow it through, I even created a Windows PE bootable CD-ROM just to run the tools posted on rpc1.org, but in the end the flash process did not work.

After making the changes described on this page ‒ successful or not ‒ I could play most DVDs. There are still some I cannot play, although they play on other computers in the house running identical software (Xine and Slackware). I can only assume that there is some hardware copy protection on those discs that confuses the Matshita drive.

With all these consumer-hostile restrictions, is it really surprising that the DVD standard took over 5 years to be accepted in the market?

WLAN

The notebook has the chipset Atheros AR 9285, which is supported by the ath9k driver according to wireless.kernel.org. The problem was to find the right kernel options and the right user space configuration to be able to connect to my wireless router. This turned out to be quite difficult, especially since I was in the process of configuring my new wireless router at the same time. My wireless router, btw, is a Linksys WRT54GL running the latest DD-WRT firmware.

The required kernel options were the easier part. I have listed them above in the kernel section. It was a much bigger challenge to find the right user space configuration. To be honest, despite there being a lot of hits when searching the internet, there is very little information that is actually useful. What I am presenting here I have worked out through trial and error. And yet, I am still experimenting, so the content presented here is for your inspiration only.

Before going any further, it might be a good idea to reflect what we actually expect of a portable desktop. At the very least we expect that a user can browse the available networks (wired or wireless), pick one and sit back for the system to configure itself automatically. If the system reacted automatically to changing network availability it would be a bonus. At any rate we cannot expect the average user to perform anything that requires technical knowledge.

Traditionally I have used the standard Slackware way of configuring the network via /etc/rc.d/rc.inet1. The breakthrough with this challenge has been to abandon that scheme and to go with the flow of wicd (aptly pronounced "wicked") and dhcpcd, the DHCP client daemon. We are still able to assign static IP addresses, only that we need to get dhcpcd to do it rather than /etc/rc.d/rc.inet1.

Wicd is not part of the standard full Slackware installation. It needs to be installed from the directory "extra" on the installation medium. In addition, the following settings need to be made.

The file /etc/rc.d/rc.wireless.conf contains settings for the whole card as identified by its MAC address. Since every setting can be overruled in /etc/rc.d/rc.inet1.conf there is not really a need for it. We simply delete or rename the file, which means it is no longer evaluated.

The file /etc/rc.d/rc.inet1.conf needs to be changed to manage every interface via DHCP. Assuming you have a wired interface eth0 and a wireless interface wlan0, this is the content you'd expect:

# Config information for eth0:
MTU[0]="1492"
USE_DHCP[0]="yes"

# Config information for wlan0:
IFNAME[4]="wlan0"
MTU[4]="1492"
USE_DHCP[4]="yes"
DHCP_TIMEOUT[4]="25"
WLAN_MODE[4]="Managed"
WLAN_RATE[4]="auto"
WLAN_CHANNEL[4]="auto"
WLAN_WPA[4]="wpa_supplicant"
WLAN_WPADRIVER[4]="wext"

Since we are using wpa_supplicant for connecting to a wireless network, we need to maintain its configuration file, /etc/wpa_supplicant.conf. The content is fairly standard:

# See /usr/doc/wpa_supplicant-0.6.10/wpa_supplicant.conf.sample
# for many more options that you can use in this file.

# This line enables the use of wpa_cli which is used by rc.wireless
# if possible (to check for successful association)
ctrl_interface=/var/run/wpa_supplicant
# By default, only root (group 0) may use wpa_cli
ctrl_interface_group=0
eapol_version=1
ap_scan=1
fast_reauth=1

# WPA protected network, supply your own ESSID and WPAPSK here:
network={
  scan_ssid=0
  ssid=<Your_SSID_here>
  proto=WPA RSN
  key_mgmt=WPA-PSK
  pairwise=CCMP TKIP
  group=CCMP TKIP WEP104 WEP40
  psk=<Your_PSK_here>
  priority=10
}

# Plaintext connection (no WPA, no IEEE 802.1X),
# nice for hotel/airport types of WiFi network.
network={
  key_mgmt=NONE
  priority=0
}

PSK stands for pre-shared key, a cryptographic mechanism based on a shared secret. In this case the PSK is a 64-character code that is generated from your SSID and the password you have chosen for your wireless network. If you want to know your PSK, simply open up a shell and type:

wpa_passphrase <Your_SSID> <Your_wireless_network_password>

What remains now is to configure dhcpcd. Not surprisingly this is done via the configuration file /etc/dhcpcd.conf:

hostname

timeout 15

noipv4ll

allowinterfaces eth0, wlan0

interface eth0
static ip_address=<Wired IP>/24
static routers=<Wired Gateway>
static domain_name_servers=<Wired DNS Server>

interface wlan0
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option interface_mtu
require dhcp_server_identifier

ssid <Your_SSID_here>
static ip_address=<Wireless IP>/24
static routers=<Wireless Gateway>
static domain_name_servers=<Wireless DNS Server>

nohook lookup-hostname

Note: this has been tested with the wired and the wireless connection I am running at home. In how far this will connect to public access points has yet to be tested.

Another remark: my router seems to implement a virtual local area network by default, ie. it implements a bridge between the wired and the wireless connections. In a case like this the wired IP and the wireless IP need to be chosen from the same network segment.

The Result

The result of all this is a slick modern desktop that operates in a smooth and creamy yet powerful way. Here's a screenshot showing off some of the KDE 4 desktop effects, while playing a DVD and monitoring the webcam. The windows are wobbly, of course. ;-)

P50IJ Desktop KDE 4
Translucency
Desktop Cube
DVD Player
Live Webcam

Hardware Upgrades

Since first putting up this article I have performed a couple of hardware upgrades. The first one involves the disk which I have changed for a solid state disk (SSD for short). Computer magazines and Youtube promise the most miraculous speed improvements when switching to an SSD. I will come to that in a minute. Apart from a potential speed improvement, a solid state disk is particularly useful in a notebook computer due to its shock resistance and the low power consumption. On the other hand, due to the high cost per gigabyte, SSDs tend to have less capacity than convential hard disks. In my case that wasn't an issue.

I left some unpartitioned space on the SSD in order to support the wear levelling algorithm inside the SSD. The new partitioning scheme looks like this:

Device    Boot      Start         End      Blocks   Id  System      Mount point
-------------------------------------------------------------------------------
/dev/sda1               1           5       32768   83  Linux       /boot
/dev/sda2               5        4866    39048888    5  Extended
/dev/sda5               5        1049     8388608   83  Linux       /
/dev/sda6            1049        1310     2097152   83  Linux       /var
/dev/sda7            1311        1572     2097152   83  Linux       /usr/local
/dev/sda8            1572        3660    16777216   83  Linux       /home

Further optimisations (that also make sense when using a conventional hard disk) include the mount option "relatime" and mounting temporary directories like /tmp and /var/tmp as tmpfs. I did not go as far as enforcing a read-only root file system.

Let us now talk about the actual gain in speed. Obviously a solid state disk outruns a hard disk whenever there is a large number of I/Os to non-adjacent blocks and cylinders. However, a modern operating system uses the available RAM as a block buffer and delays write I/Os into the background. So in reality the speed difference can only be felt when accessing blocks randomly for the first time in a session. Over the life-time of a session, the perceived speed is not really different from before.

When analyzing the aforementioned Youtube videos you find that they always use Windows, and that they always measure the boot up time or similar "first access" scenarios. The first one of these premises has already been fixed on my notebook, and the second one is not really relevant. However, as I said before, there are other good reasons for an SSD in a notebook.

Let's now turn towards the second hardware upgrade I have performed in the meantime: I added another 2 GB of RAM. This in itself is pretty uneventful. The advantages are clear: with a total of 4GB you have more reserves in case you need them, in particular when moving temporary directories into a tmpfs. Another advantage is the BIOS switching to dual channel operations, which might improve memory latencies (although the effect is probably hardly measurable). Power consumption should be negligible.

There is only one problem if you do the upgrade as an afterthought as I did: A 32 bit operating system will only see about 3 GB of the RAM due to the address space being shared with other devices. If you increase the address space by enabling PAE you can recover part of the lost memory, but for the full 4 GB you have to install a 64 bit operating system. This is the road I have taken. I managed to migrate the home directories to the new system, so that my wife didn't even notice the upheaval under the bonnet. However, such a migration is a very manual effort that I cannot recommend to anybody but the most adventurous. (NB: the main issue is that some but not all items referenced in configuration files move from directories called "lib" to directories called "lib64".) My clear recommendation is to install a 64 bit operating system from the beginning.

I hope you found the information useful. Feel free to send me an email if you have any questions or comments.

Martin