nerdstock.org

PROJECTS | MANUALS | OTHER
English   Nederlands
Asus Eee PC 900

Asus Eee PC 900 (Linux) hacks

Because I travel a lot by train, I really wanted a netbook (mini laptop), so I can continue working when I'm on a train. Of course I wanted it to run Linux, and I wanted Linux to be pre-installed.
The one I bought is an Asus Eee PC 900; a Linux device with an 8.9" screen (make sure they don't try to sell you one running Windows XP!).
The Linux distro used is Xandros, a commercial Debian variant.

The device is configured for Windows users to feel at ease (which means: simple), but obviously I won't let that confuse me. With a few tricks it becomes a device I can feel at ease with… ;)

But before I continue, as usual:

I accept no liability for any damage.
That the below works for me, is no guarantee it will also work for you.
Everything you do or don't do, is your own responsibility.

Also, remember that this manual is about the EeePC 900, which is not necessarily configured the same as other models of this same device.


Contents:


Terminal

One thing that took some searching, is a terminal. I'll save you the quest: Ctrl-Alt-T.
To 'become root', you do sudo su -
If you don't like the default console, do

> sudo su -
# cd /etc/alternatives
# rm x-terminal-emulator
# ln -s /usr/bin/konsole ./x-terminal-emulator
(That's correct: KDE is installed.)


Installing Apache, PHP and MySQL

Because I develop websites, a minimal requirement is being able to use Apache, PHP and MySQL. The netbook was a tool, not a toy, remember?
Because I wanted quick results, I chose the simple solution: Xampp (used to be Lampp). How about this:

Isn't that cool?

Xampp is a package containing the (almost) newest versions of Apache (including SSL support), PHP, MySQL, Perl, ProFTPD, PhpMyAdmin, PhpSqliteAdmin, Webmin, and probably a lot more I haven't discovered yet.
Keep in mind that the scripts in the package expect the package to be installed in /opt/lampp/, and you'll only make it harder on yourself if you install it somewhere else.

The default installation wasn't enough for me, of course…

The netbook's filesystem holds 2 partitions: /dev/sda1 for the system (/) and /dev/sdb1 for /home. Because /home has considerably more diskspace, I wanted the DocumentRoot to be in /home.
This is what I did to make that happen:

> cd /home/user/
> mkdir htdocs
> vim htdocs/index.php
> mkdir etc
> vim etc/httpd.conf
> sudo su -
# cd /opt
# tar xzf /home/user/My\ Documents/xampp-linux-<versie>.tar.gz
# chown -R nobody:nogroup lampp/
# echo -e "\n\n# local site\nInclude /home/user/etc/httpd.conf" >> lampp/etc/httpd.conf

Now, if I start Xampp (/opt/lampp/lampp start) and point my browser at http://localhost, I see the page I just created ('It works!').

In your httpd.conf you can use the ServerName and ServerAlias you like. During startup, Xampp calls /opt/lampp/share/lampp/diagnose to rewrite /etc/hosts; however, this doesn't always work as it should (because this script only checks the last few lines of the Apache error log). So if your newly created virtual host is unreachable, make sure to check /etc/hosts. Also, the 'rewriting' is limited to adding, so you'll have to manually edit /etc/hosts if you remove a virtual host.

Of course, it would be even cooler if Xampp would start when the computer is booted…

To reduce booting time, the netbook doesn't use standard SysV init, but it's own init, named fastinit; running strings /sbin/fastinit | less tells me fastinit, amongst other things, uses the shell script /usr/sbin/services.sh. Executing less /usr/sbin/services.sh then tells me that, apart from the default services, services defined in /etc/fastservices are also started; these services need to be configured to start in the current runlevel (services are started by invoking /usr/sbin/invoke-rc.d), which is 2. So:

> sudo su -
# ln -s /opt/lampp/lampp /etc/init.d/lampp
# /usr/sbin/update-rc.d lampp defaults
# echo "lampp" >> /etc/fastservices

fastinit is created to make the computer ready to be used as fast as possible. Amongst other things, this is realised by starting the X server before any additional services. Because of this it can happen that, if you boot the netbook, immediately log in and fire up the browser, you cannot reach http://localhost; this means Apache is still starting up.

To take away this irritation, I appended this next line to /usr/sbin/services.sh:

kdialog --display ':0' --passivepopup "Finished starting services." 3
This way I am alerted when the end of the script is reached.

Finally, to be able to use the manual pages that come with Xampp, I execute these 4 commands:

> sudo su -
# mkdir /var/cache/man/lampp
# chown man /var/cache/man/lampp
# chmod 2755 /var/cache/man/lampp
and add these 4 lines to /etc/manpath.config:
MANDATORY_MANPATH                       /opt/lampp/share/man
MANPATH_MAP     /opt/lampp/bin          /opt/lampp/share/man
MANPATH_MAP     /opt/lampp/sbin         /opt/lampp/share/man
MANDB_MAP       /opt/lampp/share/man    /var/cache/man/lampp
(Unfortunately, Apache man pages like 'apachectl' and 'httpd' are not in the Xampp package.)

And to be all complete, I append this line to /home/user/.bash_profile:

export PATH="$PATH:/opt/lampp/bin"
and this one to /root/.profile:
export PATH="$PATH:/opt/lampp/bin:/opt/lampp/sbin"

That was the entire webserver installation.

And if I ever want to install a new Xampp version, all I have to do is

> sudo su -
# cd /opt
# rm -rf lampp
# tar xzf /home/user/My\ Documents/xampp-linux-<versie>.tar.gz
# chown -R nobody:nogroup lampp
# echo -e "\n\n# local site\nInclude /home/user/etc/httpd.conf" >> lampp/etc/httpd.conf

Keep in mind that Xampp keeps several logs, but no rotation of the logs is installed or configured. This means that some day your disk could fill up because of those logfiles. To prevent this from happening, you could use the rotate script I wrote. If I ever think of it, I'll make the Xampp team aware of that script as well.


Installing other software

Because I don't always have internet access, but I do want to continue developing anywhere, I wanted to install Subversion, to simplify synchronisation with my development server.
Also, I thought it would be conveniant to have a search engine intalled so I can search all the manuals I downloaded (PHP, MySQL, CSS, etc.).
Unfortunately this software cannot be installed through the Eee download site, nor do any packages like Xampp exist for these programs.

> sudo su -
# echo "deb ftp://ftp.nl.debian.org/debian stable main contrib non-free" >> /etc/apt/sources.list

That's all I needed to do to be able to install software from the Debian site using aptitude (Xandros is Debian based).
See this page for a list of available mirrors.

# aptitude install subversion
# aptitude install htdig

To make sure my disk doesn't fill up to fast, I made 2 changes to /etc/htdig/htdig.conf:

database_dir:   /home/user/htdig
start_url:      http://localhost/docs/
(Where start_url should point to the directory where you collected the documentation, obviously.)


Your own desktop tab

The desktop of the EeePC is made up of a few tabs, a layout I really enjoy for a device as small as this.
If I want, I can add applications to the Favorites tab, but what I'd really like to have is a new tab where I can group Nerdstock.org stuff, for example.

The layout of the desktop is defined by the XML file /opt/xandros/share/AsusLauncher/simpleui.rc, which is overridden by /var/lib/AsusLauncher/simpleui.rc, if it exists.
I have not been able to find a DTD for this XML, but this is what it looks like to me:

* Is this true?

Items are displayed in the order in which they are defined, but folders come before parcels.

I've read somewhere that /opt/xandros/share/AsusLauncher/simpleui.rc is overwritten during updates, while /var/lib/AsusLauncher/simpleui.rc is not. So, if you'd like to make (permanent) changes to your desktop, you should change the latter.
If this file exists on your system, backup the original first:

> sudo cp /var/lib/AsusLauncher/simpleui.rc ~/simpleui.rc.orig

To edit this file, you need to be root. If vim is not your thing, you could use kwrite or kate to edit it:

> sudo kwrite /var/lib/AsusLauncher/simpleui.rc
> sudo kate /var/lib/AsusLauncher/simpleui.rc

Say I'd like to add a tab called 'Nerdstock.org' to the desktop, containing

Then this would be the XML I'd add at the end of simpleui.rc, right before the line </simpleui>:

<simplecat id="Nerdstock" icon="Nerdstock.png" background="nerdstock_wallpaper.jpg">
 <name lang="nl_NL">Nerdstock.org</name>
</simplecat>

<folder id="Pages" simplecat="Nerdstock" icon="dir_nerdstock_norm.png" selected_icon="dir_nerdstock_hi.png">
 <name lang="nl_NL">Pages</name>
</folder>

<parcel extraargs="/opt/firefox/firefox http://nerdstock.org" simplecat="Nerdstock" icon="nerdstock_norm.png" selected_icon="nerdstock_hi.png">
 <name lang="nl_NL">Home</name>
</parcel>

<parcel extraargs="/home/user/bin/search_nerdstock.sh" simplecat="Nerdstock" icon="nerdstock_search_norm.png" selected_icon="nerdstock_search_hi.png">
 <name lang="nl_NL">Search</name>
</parcel>

<parcel extraargs="/home/user/bin/ssh_nerdstock.sh" simplecat="Nerdstock" icon="nerdstock_ssh_norm.png" selected_icon="nerdstock_ssh_hi.png">
 <name lang="nl_NL">SSH</name>
</parcel>

<parcel extraargs="/opt/firefox/firefox http://nerdstock.org/rob" simplecat="Nerdstock/Pages" icon="nerdstock_rob_norm.png" selected_icon="nerdstock_rob_hi.png">
 <name lang="nl_NL">Rob</name>
</parcel>

<parcel extraargs="/opt/firefox/firefox http://www.google.nl/search?as_sitesearch=nerdstock.org" simplecat="Nerdstock/Pages" icon="nerdstock_google_norm.png" selected_icon="nerdstock_google_hi.png">
 <name lang="nl_NL">Google</name>
</parcel>

Apart from the images I'd have to add to /opt/xandros/share/AsusLauncher (or /var/lib/AsusLauncher), I'd also need 2 scripts:

#!/bin/sh
# /home/user/bin/search_nerdstock.sh
words=`kdialog --inputbox "Search Nerdstock.org for:" ""`
/opt/firefox/firefox "http://nerdstock.org/htdig/htsearch?words=${words}"

and

#!/bin/sh
# /home/user/bin/ssh_nerdstock.sh
konsole -T "SSH Nerdstock.org" -e ssh me@www.nerdstock.org

Logging

syslogd is not started by fastinit, so no logging is done (except for Xampp). But because I have 2 children around who think that everything with buttons is 'a nice toy', and I want to be careful with my company's tools, I want to at least be able to see when the netbook was switched on or off.

Oh well, just download this script, because I don't feel like writing a story around it…


'Real' Linux

I haven't tested this, but I think it should be really simple to turn this device into a 'real' Linux pc by:

> sudo su -
# cd /sbin
# mv fastinit fastinit.eee
# ln -s init fastinit

This way, when booting, the default init will be executed instead of the custom fastinit. Of course, you will need to be prepared for longer start up time and a disk that will fill up faster (because of logging). Additionally you may need to configure some extra services.

Responses are welcomed:
rob[at]nerdstock.org
Creative Commons License
http://creativecommons.org/licenses/by-nc-sa/3.0/nl/deed.en

 


-i *.nerdstock.org/*
Nerds don't google, they grep.

FaciliPro
http://facilipro.nl
HoudtVan.je
http://www.houdtvan.je
OhReally.nl
http://OhReally.nl
Setara
http://setara.org
Dannik
http://dannik.nl
Ads by Nerdstock.org

Link: Trademarks used at this site