Tuesday, March 31, 2009

Install flashplayer 10 with SvOlli's patch for EeePC 4G

After installing "firefox-upgrade" from Asus update the day before, I have been trying to re-install vlc, but in vain. Even trying to compile from source, there are so many unmet dependencies that I finally decided it does not worth the effort.

And besides vlc, we already know that this libc upgrade with "firefox-upgrade" is also causing problem with installation of build-essential (although a solution has already been found), and perhaps problem with even more other programs. So I came to the conclusion that it's not worth the hassle running into so many problem for this flashplayer 10.

Then I began to investigate on the other possible solution: SvOlli's flash10patcher which patches the libflashplayer10.so plugin to cheat that it only requires GLIBC 2.3. But does this patch cripples any functionality of flashplayer 10? After digging in Google for a while, I've found the answer in this adobe forum:

The Flash Player 10 Linux version is now compiled using -fstack-protector for security reasons. This feature requires glibc-2.4 or newer. You have no choice but to upgrade your system or stick with Flash Player 9 on that system.

More information on this feature: http://en.wikipedia.org/wiki/Stack-smashing_protection

We all know that buffer overflow is often used by hackers to hack servers. But for a netbook like EeePC, I don't think this is of any importance (unless you want to run a server with your EeePC!). So apparently we are not sacrificing any functional feature with this dependent library downgrade. Thus, to my opinion, this is the best solution for people having difficulty in watching youtube.com videos.

Patching flashplayer 10 with SvOlli's flash10patcher

Installation is very easy.

1) Download install_flash_player_10_linux.tar.gz
and flash10patcher-0.2.tar.bz2, and save them to /home/user.

2) Unpack the 2 packages and copy libflashplayer.so to the recently unpacked flash10patcher-0.2/ folder. You can do this either in File Manager or in a terminal:
tar zxvf install_flash_player_10_linux.tar.gz
tar jxvf flash10patcher-0.2.tar.bz2
cp install_flash_player_10_linux/libflashplayer.so flash10patcher-0.2/
To extract files in File Manager, just right click on the file and select "Extract All".

3) Open a terminal, change directory into flash10patcher-0.2/ and run the flash10patcher by entering the command "sudo ./flash10patcher" as below.
[NB. "sudo" is required as this has to be done with "root" privilege, i.e. with Administrator rights.]
/home/user>cd flash10patcher-0.2/
/home/user/flash10patcher-0.2> sudo ./flash10patcher
flash10patcher 0.2
reading libflashplayer.so
libflashplayer.so size: 10131640
replacing magic code 0x0d696914 with 0x0d696913
replaced at 0x00004e1c
replacing id string "GLIBC_2.4" with "GLIBC_2.3"
replaced at 0x000048b5
writing patched.libflashplayer.so
A patched library flashplayer 10 with the name "patched.libflashplayer.so" is generated.

EDIT 2009/9/12: Above is the screenshot I captured while doing this. To work in terminals, it is important to avoid typos, so the easiest way is to copy and paste the command to the terminal. Some people have sent me screenshots and I saw that they made typos while typing the commands, so I have added the commands only below. You just need to copy them with [Ctrl]-[C], then paste to the terminal of your EeePC with [Shift]-[Insert], then press [Enter].
cd /home/user/flash10patcher-0.2
sudo ./flash10patcher
Then do the same for the command in step 4 below.

4) Copy this new library flashplayer 10 to your firefox plugin folder (and rename it).
sudo cp patched.libflashplayer.so /usr/lib/mozilla/plugins/libflashplayer.so
You can copy and paste this command into the terminal - [Shift]+[Insert] to paste. Or you can use the [Tab] key to help auto-complete file/folder names. This will help to avoid typos. Also this command has to be run from the folder "/home/user/flash10patcher-0.2".

You can also copy this patched library to the destination with a root File Manager by entering this command in a terminal:
sudo XandrosFileManager
This is how I did it. Very simple!

Sunday, March 29, 2009

Install Firefox 3 with flashplayer 10 on my EeePC 4G

With the release of flashplayer 10, many EeePC users complain that they cannot watch video from youtube.com. The reason is because flashplayer 10 for Linux require a libc version of 2.4 but EeePC comes with version 2.3.6.

For new models that run EeePC Linux version 1.6, Asus has provided a "firefox-upgrade" package that upgrades the libc version to 2.7-13 and install firefox3 and flashplayer 10. This is however not enabled by default in old EeePC models. The only hack available now is the Patching Flash 10 for usage with glibc below 2.4 by SvOlli.

Today, before I proceed to USB restore my 4G, I took this opportunity to test installing this "firefox-upgrade" package on my 4G. The result is: It works! but with minor glitches:

- If you want to install build-essential for compiling software from source, you better do it before you install this glibc upgrade, otherwise you will have great difficulty doing so after (although there is a possible hack here.

- This upgrade is incompatible with vlc and libwxgtk2.6-0. They will be removed during the installation process and cannot be re-installed (broken package). Please note that without libwxgtk2.6-0, you won't be able to install some softwares including xchm, amule, etc.

- 35 MB disk space will be used up by these packages.

For those who are interested, here is how I did this. I guess the terminal output and the screenshots are self descriptive:

sudo bash
echo "deb http://update.eeepc.asus.com/1.6/ common main" >> /etc/apt/sources.list
apt-get update
apt-get install firefox-upgrade

Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
adobe-flash-player firefox firefox-extension-default gtk2-engines libc6
libcairo2 libdatrie0 libglib2.0-0 libgtk2.0-0 libgtk2.0-bin libgtk2.0-common
libpango1.0-0 libpango1.0-common librsvg2-2 librsvg2-common libthai-data
libthai0 locales tzdata
Suggested packages:
glibc-doc libc6-i686 ttf-kochi-gothic ttf-kochi-mincho ttf-thryomanes
ttf-baekmuk ttf-arphic-gbsn00lp ttf-arphic-bsmi00lp ttf-arphic-gkai00mp
ttf-arphic-bkai00mp librsvg2-bin
Recommended packages:
libglib2.0-data x-ttcidfont-conf
The following packages will be REMOVED:
libwxgtk2.6-0 vlc
The following NEW packages will be installed:
firefox-upgrade libdatrie0 libthai-data libthai0
The following packages will be upgraded:
adobe-flash-player firefox firefox-extension-default gtk2-engines libc6
libcairo2 libglib2.0-0 libgtk2.0-0 libgtk2.0-bin libgtk2.0-common
libpango1.0-0 libpango1.0-common librsvg2-2 librsvg2-common locales tzdata
16 upgraded, 4 newly installed, 2 to remove and 175 not upgraded.
Need to get 32.7MB of archives.
After unpacking 4211kB disk space will be freed.
Do you want to continue [Y/n]?
Note here that vlc and libwxgtk2.6-0 are going to be removed
WARNING: The following packages cannot be authenticated!
tzdata locales libc6 libgtk2.0-0 libgtk2.0-common libcairo2 libglib2.0-0
libpango1.0-common libdatrie0 libthai-data libthai0 libpango1.0-0
adobe-flash-player firefox gtk2-engines libgtk2.0-bin librsvg2-common
librsvg2-2 firefox-extension-default firefox-upgrade
Install these packages without verification [y/N]? y
Get:1 http://update.eeepc.asus.com common/main tzdata 2008e-3 [755kB]
Get:2 http://update.eeepc.asus.com common/main locales 2.7-13 [4499kB]
Get:3 http://update.eeepc.asus.com common/main libc6 2.7-13 [4437kB]
Get:4 http://update.eeepc.asus.com common/main libgtk2.0-0 2.12.1-1xandros2~1.6 [1943kB]
Get:5 http://update.eeepc.asus.com common/main libgtk2.0-common 2.12.1-1xandros2~1.6 [5059kB]
Get:6 http://update.eeepc.asus.com common/main libcairo2 1.4.10-1+lenny2xandros1 [521kB]
Get:7 http://update.eeepc.asus.com common/main libglib2.0-0 2.14.3-1xandros1 [541kB]
Get:8 http://update.eeepc.asus.com common/main libpango1.0-common 1.18.3-1xandros1 [62.1kB]
Get:9 http://update.eeepc.asus.com common/main libdatrie0 0.1.2-2xandros1 [17.6kB]
Get:10 http://update.eeepc.asus.com common/main libthai-data 0.1.9-1xandros1 [164kB]
Get:11 http://update.eeepc.asus.com common/main libthai0 0.1.9-1xandros1 [32.5kB]
Get:12 http://update.eeepc.asus.com common/main libpango1.0-0 1.18.3-1xandros1 [291kB]
Get:13 http://update.eeepc.asus.com common/main adobe-flash-player [3925kB]
Get:14 http://update.eeepc.asus.com common/main firefox 3.0.4-1asus1 [9674kB]
Get:15 http://update.eeepc.asus.com common/main gtk2-engines 1:2.10.2-2xandros1 [488kB]
Get:16 http://update.eeepc.asus.com common/main libgtk2.0-bin 2.12.1-1xandros2~1.6 [8038B]
Get:17 http://update.eeepc.asus.com common/main librsvg2-common 2.18.2-1xandros1 [62.4kB]
Get:18 http://update.eeepc.asus.com common/main librsvg2-2 2.18.2-1xandros1 [138kB]
Get:19 http://update.eeepc.asus.com common/main firefox-extension-default 2.0-2 [83.9kB]
Get:20 http://update.eeepc.asus.com common/main firefox-upgrade 2.0-1 [1014B]
Fetched 32.7MB in 52s (623kB/s)
Preconfiguring packages ...
(Reading database ... 70838 files and directories currently installed.)
Removing vlc ...
Removing libwxgtk2.6-0 ...
(Reading database ... 70760 files and directories currently installed.)
Preparing to replace tzdata 2007b-1 (using .../tzdata_2008e-3_all.deb) ...
Unpacking replacement tzdata ...
Replacing files in old package libc6 ...
Setting up tzdata (2008e-3) ...

Current default timezone: 'Asia/Hong_Kong'
Local time is now: Mon Mar 30 03:29:45 HKT 2009.
Universal Time is now: Sun Mar 29 19:29:45 UTC 2009.
Run 'dpkg-reconfigure tzdata' if you wish to change it.

Use [TAB] to select OK and press [Enter] to continue.

(Reading database ... 70787 files and directories currently installed.)
Preparing to replace locales 2.3.6.ds1-13 (using .../locales_2.7-13_all.deb) ...
Unpacking replacement locales ...
Preparing to replace libc6 2.3.6.ds1-13 (using .../archives/libc6_2.7-13_i386.deb) ...
Checking for services that may need to be restarted...
Checking init scripts...
Unpacking replacement libc6 ...
Setting up libc6 (2.7-13) ...
Installing new version of config file /etc/init.d/glibc.sh ...
Checking for services that may need to be restarted...
Checking init scripts...

Restarting services possibly affected by the upgrade:
samba: stopping...starting...done.
openbsd-inetd: stopping...starting...done.
cupsys: stopping...starting...done.
cron: stopping...starting...done.
autofs: stopping...starting...done.

Services restarted successfully.
init: timeout opening/writing control channel /dev/initctl

(Reading database ... 70830 files and directories currently installed.)
Preparing to replace libgtk2.0-0 2.10.13-2~bpo.1 (using .../libgtk2.0-0_2.12.1-1xandros2~1.6_i386.deb) ...
Unpacking replacement libgtk2.0-0 ...
Preparing to replace libgtk2.0-common 2.10.13-2~bpo.1 (using .../libgtk2.0-common_2.12.1-1xandros2~1.6_all.deb) ...
Unpacking replacement libgtk2.0-common ...
Preparing to replace libcairo2 1.2.4-4 (using .../libcairo2_1.4.10-1+lenny2xandros1_i386.deb) ...
Unpacking replacement libcairo2 ...
Preparing to replace libglib2.0-0 2.12.4-2 (using .../libglib2.0-0_2.14.3-1xandros1_i386.deb) ...
Unpacking replacement libglib2.0-0 ...
Preparing to replace libpango1.0-common 1.14.8-5 (using .../libpango1.0-common_1.18.3-1xandros1_all.deb) ...
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = "en_US.UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Cleaning up font configuration of pango...
Cleaning up category xfont..
Unpacking replacement libpango1.0-common ...
Selecting previously deselected package libdatrie0.
Unpacking libdatrie0 (from .../libdatrie0_0.1.2-2xandros1_i386.deb) ...
Selecting previously deselected package libthai-data.
Unpacking libthai-data (from .../libthai-data_0.1.9-1xandros1_all.deb) ...
Selecting previously deselected package libthai0.
Unpacking libthai0 (from .../libthai0_0.1.9-1xandros1_i386.deb) ...
Preparing to replace libpango1.0-0 1.14.8-5 (using .../libpango1.0-0_1.18.3-1xandros1_i386.deb) ...
Unpacking replacement libpango1.0-0 ...
Preparing to replace adobe-flash-player (using .../adobe-flash-player_10.0.12.36_i386.deb) ...
Unpacking replacement adobe-flash-player ...
Preparing to replace firefox 3.0.1-asus1 (using .../firefox_3.0.4-1asus1_i386.deb) ...
Unpacking replacement firefox ...
Preparing to replace gtk2-engines 1:2.10.2-2~bpo.1 (using .../gtk2-engines_1%3a2.10.2-2xandros1_i386.deb) ...
Unpacking replacement gtk2-engines ...
Preparing to replace libgtk2.0-bin 2.10.13-2~bpo.1 (using .../libgtk2.0-bin_2.12.1-1xandros2~1.6_all.deb) ...
Unpacking replacement libgtk2.0-bin ...
Preparing to replace librsvg2-common 2.18.0-1~bpo.1 (using .../librsvg2-common_2.18.2-1xandros1_i386.deb) ...
Unpacking replacement librsvg2-common ...
Preparing to replace librsvg2-2 2.18.0-1~bpo.1 (using .../librsvg2-2_2.18.2-1xandros1_i386.deb) ...
Unpacking replacement librsvg2-2 ...
Preparing to replace firefox-extension-default 1.0-3 (using .../firefox-extension-default_2.0-2_all.deb) ...
Unpacking replacement firefox-extension-default ...
Selecting previously deselected package firefox-upgrade.
Unpacking firefox-upgrade (from .../firefox-upgrade_2.0-1_all.deb) ...
Setting up locales (2.7-13) ...
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = "en_US.UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_ALL to default locale: No such file or directory
Generating locales (this might take a while)...
en_US.UTF-8... done
zh_CN.UTF-8... done
zh_TW.UTF-8... done
Generation complete.
Here locale is reported missing for zh_TW. But actually, Asus has also provided the firefox-locale packages for firefox3 in http://update.eeepc.asus.com/1.6/pool/common/firefox3/, you can choose to install the locales you want yourself later.
Setting up libgtk2.0-common (2.12.1-1xandros2~1.6) ...
Setting up libcairo2 (1.4.10-1+lenny2xandros1) ...

Setting up libglib2.0-0 (2.14.3-1xandros1) ...

Setting up libpango1.0-common (1.18.3-1xandros1) ...
Cleaning up font configuration of pango...
Cleaning up category xfont..
Updating font configuration of pango...
Cleaning up category xfont..
Updating category xfont..

Setting up libdatrie0 (0.1.2-2xandros1) ...

Setting up libthai-data (0.1.9-1xandros1) ...
Setting up libthai0 (0.1.9-1xandros1) ...

Setting up libpango1.0-0 (1.18.3-1xandros1) ...

Setting up libgtk2.0-0 (2.12.1-1xandros2~1.6) ...

Setting up adobe-flash-player ( ...
Setting up firefox (3.0.4-1asus1) ...

Setting up gtk2-engines (2.10.2-2xandros1) ...
Setting up libgtk2.0-bin (2.12.1-1xandros2~1.6) ...
Setting up librsvg2-2 (2.18.2-1xandros1) ...

Setting up librsvg2-common (2.18.2-1xandros1) ...
Setting up firefox-extension-default (2.0-2) ...
Setting up firefox-upgrade (2.0-1) ...

Installation complete.

First running Firefox 3

See flashplayer version 10 plugin

youtube.com video now playing! But no more vlc!

Friday, March 27, 2009

Installing IEs4Linux and additional language support

I am using the English version of EeePC Linux on my 4G, but I need to browse Traditional Chinese websites very often. And since some websites (e.g. HSBC e-banking and the Hong Kong Jockey Club) only support IE (Internet Explorer), I have to install IEs4Linux for these websites.

It is very easy to install IEs4Linux but very difficult to customize the installation, especially because MSIE is language specific. In Linux, this is never a problem. It is just a matter of choosing the correct font and input method. But for IE it is complicated.

If I use English locale for my EeePC Linux, I can only run IE of English language version. On the contrary, if I use Traditional Chinese locale for my EeePC Linux, I can install and run IE of both English and Traditional Chinese language version. The latter, however, is slow and prone to hang up. So I decided to go for the English version, and instead install Microsoft Global IME later.

Installation is straight forward, you can refer to the General Instructions on the Installation page of IEs4Linux. In a summary, it is:

1) Set up xepc.org repository for your package manager. Add this line to /etc/apt/sources.list and update cache (or add repositories via the Synaptic GUI):
deb http://updates.xepc.org/ p701 main dev
sudo kwrite /etc/apt/sources.list
sudo apt-get update
2) Install wine and cabextract
sudo apt-get install wine cabextract
[NB. If you have Debian lenny or some repo with a higher version of wine or required libraries, it may prevent you from installing from xepc.org repos.]

3) Download IEs 4 Linux to "My Home"

4) Extract and run the install script "ies4linux"
tar zxvf ies4linux-2.99.0.tar.gz
cd ies4linux-
[NB. The GUI installation tool is not very responsive. So be patient because depending on your network, it may take some time to download the cabs from Microsoft. You can check if installation is complete by running /home/user/bin/ie6.]

Installing Chinese Language Support for IEs4Linux

It took me a while to figure out how to do this. In the beginning, I just download and install tcmondo.exe with WINE but the Chinese language support never show up in IE.

After checking through the ies4linux install scripts, I found that IEs4Linux install IE and its own WINE version of Win98 to a different folder: /home/user/.ies4linux/ie6/. So, if I just click on a Windows program and install with WINE, it will end up installed to the default folder of WINE (/home/user/.wine/) and will not show up in IE. So, I need to change $WINEPREFIX and also the WINE Windows version to win98 before I can proceed to install tcmondo.exe. In summary, the steps are:

1) Download tcmondo.exe (or the language pack you want from Microsoft Global IME)

2) Run winecfg to change Windows version to "Windows 98"

3) Set WINE environmental variable $WINEPREFIX to /home/user/.ies4linux/ie6/:
export WINEPREFIX="/home/user/.ies4linux/ie6/"
4) Install tcmondo.exe
wine tcmondo.exe
Now I have Traditional Chinese language support for my IEs4Linux. You will also need to select your language preference in IE, but I suppose everyone knows how to do this.

Thursday, March 26, 2009

VGA Utility for EeePC

Asus has recently provided a VGA Utility (vga-utility) for EeePC 701 models which allows a virtual desktop of 1024x768 with panning. This is especially useful to users of EeePC 4G with the small 7" screen which only supports 800x480 screen resolution.

This utility is now available as update from "Add/Remove Software" for 701 models, but in fact it will work for all EeePC models (and perhaps all Linux distros). Here are the steps how to install this utility for other EeePC models:

1) Edit /etc/apt/sources.list and add this line:
sudo kwrite /etc/apt/sources.list
deb http://update.eeepc.asus.com/p701/en/ p701 main

2) Update apt cache
sudo apt-get update
3) Install vga-utility
sudo apt-get install vga-utility
[NB. An alternative to the first 3 steps is to download the package vga-utility_1.0.2_i386.deb and install by right click on it and select "Install DEB file"]

4) For EeePC models that do not use the user simpleui.rc in /home/user/.AsusLauncher/ (i.e. 900 and later models), you will need to manually add the "Easy Mode" desktop icon shortcut to run this program. You can either edit your user simpleui.rc in /var/lib/AsusLauncher/ or the system default simpleui.rc in /opt/xandros/share/AsusLauncher/ and add these lines:

<parcel simplecat="Settings" extraargs="/opt/VGA_Utility/VGA_Utility" icon="desktop_mode_norm.png" selected_icon="desktop_mode_hi.png" packages="vga-utility">
<name lang="en">VGA Utility Update
<desc lang="en">Ver.1.0.1 2008-10-27 VGA Utility Update。 Please Press"Install",for installing。
<name lang="zh_CN">VGA 程序更新</name>
<desc lang="zh_CN">Ver.1.0.1 2008-10-27 VGA 程序更新。 请按"安装"以执行安装。</desc>
<include>en zh_CN</include>
For detailed instruction, please refer to this wiki: Adding icons to Easy Mode.

5) Edit /etc/X11/xorg.conf to change the default virtual display from 1024x768 to 1680x1680:

sudo kwrite /etc/X11/xorg.conf
Section "Screen"
Identifier "Screen1"
Device "Device1"
DefaultDepth 24
SubSection "Display"
Virtual 1024 768 <--- 1680 1680
Depth 8
SubSection "Display"
Virtual 1024 768 <--- 1680 1680
Depth 15
SubSection "Display"
Virtual 1024 768 <--- 1680 1680
Depth 16
SubSection "Display"
Virtual 1024 768 <--- 1680 1680
Depth 24

6) Restart X

Changing Virtual Display Size

By default, VGA Utility set virtual display to 1024x768. But actually the display card of the EeePC can support a virtual display up to 1680x1680. This can be easily changed by editing the script /opt/VGA_Utility/script/startpan.sh

The following modelines are known to be supported by the EeePC display card:
"800x480" 29.6 800 816 896 992 480 481 484 497 -hsync +vsync
"800x600" 38.22 800 832 912 1024 600 601 604 622
"1024x600" 49.0 1024 1064 1168 1312 600 601 604 622 -hsync +vsync
"1024x768" 64.56 1024 1056 1296 1328 768 783 791 807
"1280x1024" 135.00 1280 1296 1440 1688 1024 1025 1028 1066 +HSync +VSync
"1680x1050" 147.14 1680 1784 1968 2256 1050 1051 1054 1087
To avoid the trouble editing them every time, I have written separate startpan.sh scripts for different resolutions 800x600, 1024x768, 1280x1024 and 1680x1050, together with a shell script change_startpan.sh which offers a menu to choose desired virtual screen size (and copy it to overwrite the original startpan.sh).

You can download my package change_startpan.tgz, unpack it and run the install.sh script, which will then move the startpan.sh scripts to /opt/VGA_Utility/script/ and the script change_startpan.sh to /home/user/bin.

Edit 2009/5/29: I have modified the "change_startpan.sh" script, now displaying a nice GUI dialog for the user to select virtual display resolution and a warning when VGA_Utility is found running.

Beware that you will need to return display from "Pan Mode" to "Normal Mode", and close VGA_Utility before you change startpan.sh because startpan.sh will be running until VGA_Utility is closed.

Wednesday, March 25, 2009

Testing read/write union filesystem in my EeePC 4G

These 2 days, I have been testing on mounting the union filesystem (aufs) with both partitions sda1 and sda2 as read/write to install, upgrade and remove programs with my EeePC 4G.

What I want is to uninstall Open Office 2 from sda1 and install updates from Asus without wasting the precious disk space of my 4 GB SSD. With the read/write initramfs image I have modified, both sda1 and sda2 are mounted read/write in the union filesystem. So, when I uninstall Open Office 2, all files originally residing from sda1 will be deleted. And while upgrading programs with Asus Updates, the new version will be installed to sda2 while the old version in sda1 will be deleted. I intend to install Open Office 3 for docx support, and as I expect a possibility to upgrade in the future, I intend to keep it in sda2.

The original plan was to shrink sda1 after all the updates to recover the disk space there. This is because with the union filesystem mounting sda1 as read only, there is no way to make use of the free disk space I have gained removing so many programs in sda1. However, an second thought told me that working like this, I won't be able to F9 restore to factory default any more because many important system files will now be residing in sda2. So instead, I merged changes from sda2 to sda1 following this wiki instructions: merging the first two partitions.

Unfortunately something went wrong and I ended up with a broken system. I am not sure where I've made the mistake. May be the wiki instruction is only for unionfs but not entirely correct for aufs. Or may be it is just some typing mistake. Anyway, I will need to restore from USB and try it all over again. But next time, I will probably use my old approach: Boot without unionfs to install the updates.

For those who are interested to test this, here is how I made the read/write initramfs image. [NB. You can also download the read-write initramfs image I have compiled here: initramfs-rw-eeepc.img]

1) Modify the initramfs image as per this wiki instruction: Rebuilding initramfs, make the following changes to the init script:
#change this line from ro to rw
mount -t ext2 -o rw $ROOT /mnt-system

#Add mount options=rw to this line
mount -t aufs -o br:/mnt-user=rw:/mnt-system=rw+nolwh none /mnt
2) Re-pack the initramfs
find | cpio -H newc -o | gzip -9 > ../initramfs-rw-eeepc.img
3) Edit /boot/grub/menu.lst and add this entry:
title Boot with rw aufs
root (0x80,0)
kernel /boot/vmlinuz- quiet rw vga=785 irqpoll root=/dev/sda1
initrd /boot/initramfs-rw-eeepc.img
4) Boot into rescue mode and copy the modified initramfs image and grub menu.lst to sda1.

Like this, I press F9 at reboot, and select the new entry to boot into the read/write union filesystem. I verified this with the "mount" command:
rootfs on / type rootfs (rw)
/dev/sda1 on / type ext2 (rw)
none on / type aufs (rw,xino=/.aufs.xino,br:/=rw:/=rw+nolwh)
Then I uninstalled openoffice2 with apt-get, removing 17 packages and free up 300 MB disk space:
sudo apt-get remove openoffice*
After installing all those Asus updates, and merging the change to sda1, I ended up with 275MB free space in sda1 (original should be something like 75 MB).
/dev/sda1             2.3G  1.9G  275M  88% /home/user/sda1
/dev/sda2 1.4G 444M 905M 33% /home/user/sda2
Please note that you cannot see this from within the union filesystem. I have to boot from USB and mount the 2 partitions to verify their disk usage.

Sunday, March 22, 2009

Setting up repositories for my EeePC 4G

Now that I have my EeePC restored and unionfs converted to aufs, the first thing to do is of course setting up network and do some updates. For this, I need to set up apt repositories. I've done this many times already for different EeePC models. Here is the /etc/apt/sources.list file for my EeePC 4G:

##Asus update
deb http://update.eeepc.asus.com/p701 p701 main
deb http://update.eeepc.asus.com/p701/en p701 main

deb-src http://cle.linux.org.tw/EeePC/1.0.6 v106 main contrib non-free
deb-src http://asusxntest.xandros.com/asus-source/p7xx/1.0.4/ v104 main contrib non-free
deb-src http://asusxntest.xandros.com/asus-source/p7xx/1.0.6/ v106 main contrib non-free

#XEPC.org repository
##NB. dev are kde development packages
#wget http://updates.xepc.org/dists/p701/xepc-pubkey.txt
#sudo apt-key add xepc-pubkey.txt
deb http://updates.xepc.org/ p701 main dev

##Community repository for EeePC
#wget http://download.tuxfamily.org/eeepcrepos/key.asc
#sudo apt-key add key.asc
deb http://download.tuxfamily.org/eeepcrepos/ p701 main etch

##Special ASUS EEE/Xandros repository by kost
deb http://ftp.linux.hr/asuseee/xandros/ binary/
deb-src http://ftp.linux.hr/asuseee/xandros/ source/

##Xandros4 repos (not fully compatible)
deb http://dccamirror.xandros.com/dccri/ dccri-3.0 main
deb http://www.geekconnection.org/ xandros4 main

##Xandros server 2.0 repository (same base as EeePC but lower KDE version)
#wget http://xnv4.xandros.com/xs2.0/pkg/pool/main/xandros/xandros-archive-keyring_1.0-3_all.deb
#sudo dpkg -i xandros-archive-keyring_1.0-3_all.deb
deb http://xnv4.xandros.com/xs2.0/upkg-srv2 etch main contrib non-free

##Debian etch repositories (not fully compatible)
deb http://ftp.debian.org/debian/ etch main non-free contrib
deb http://ftp.us.debian.org/debian/ etch main non-free contrib
deb http://security.debian.org/ etch/updates main contrib non-free
deb-src http://security.debian.org/ etch/updates main contrib non-free

Please note that some repositories require a PGP key and I have also put the instructions to download and install the PGP key together in this file as comments.

The problem with installing softwares in an EeePC is that the official repositories have only limited softwares, and there are only a few community repositories dedicated for the EeePC. Fortunately, EeePC Linux is based on Xandros 4, which in turn is based on Debian etch and they are lots of software packages available in these 2 distributions.

However, one has to be careful using these other distributions because EeePC Linux versions have their own customized KDE libraries which is incompatible with neither Xandros 4 nor Debian etch. So you won't be able to install any program that requires an updated version of kde libraries or you may break your system. The only exception is the community xepc.org repositories where lazyfai has compiled those updated KDE libraries from sources in an EeePC.

Because of this confusion, apt pinning is a must installing software packages from other distributions, and here is my /etc/apt/preferences file:

Package: *
Pin: origin update.eeepc.asus.com
Pin-Priority: 950

Package: *
Pin: release a=p701
Pin-Priority: 950

Package: *
Pin: release a=v104
Pin-Priority: 950

Package: *
Pin: release a=v106
Pin-Priority: 950

Package: *
Pin: origin updates.xepc.org
Pin-Priority: 850

Package: *
Pin: origin ftp.linux.hr
Pin-Priority: 840

Package: *
Pin: origin ""
Pin-Priority: 800

Package: *
Pin: release a=xandros4
Pin-Priority: 700

Package: *
Pin: origin www.geekconnection.org
Pin-Priority: 700

Package: *
Pin: origin dccamirror.xandros.com
Pin-Priority: 690

Package: *
Pin: release a=etch
Pin-Priority: 550

Please note that even with pinning, one has to be very careful working with apt-get or synaptic installing software packages. If you happen to install some software package and apt-get or synaptic is telling you that it want to upgrade a long long list of programs, then you better stop.

To apply these settings, remember to run "sudo apt-get update" before you actually install any programs.

The next thing I am going to do is to install updates from Asus. But since my EeePC only comes with a 4 GB SSD, and out of which the 1st partition of 2.37 GB is readonly, with only 1.45 GB free disk space available in the 2nd partition, I don't want to waste my precious disk space with 2 copies of the same program (different version) one in the 1st partition and one in the 2nd partition.

Last time when I configured my EeePC, I installed all these Asus updates to the readonly 1st partition with the help of the xepc.org upgrade disc set up as a local repository (and running the system temporarily without unionfs). But this time I want to try something new: a read/write union filesystem. This will be tomorrow's work.

EDIT 2009/6/7: See also this blog for how to obtain and install the PGP key for Debian etch repositories.

Saturday, March 21, 2009

Restore from USB and change unionfs to aufs

Restoring from USB, what I want to do extra this time is to convert unionfs into aufs (another union filesystem) because aufs is known to be more stable, less buggy than unionfs, and has already become the standard in later EeePC models. Since I am not sure if aufs is compatible with unionfs, I decided to restore from USB and do it from the very beginning.

To convert unionfs to aufs, what I need is:
1) A kernel with aufs support (Download: linux-image-
2) A initramfs image from 900 or later models
3) an Asus EeePC System Recovery USB disk

The first step, of course, is to restore from USB. Since this is already covered in ch 6-9 of your Eee PC 701 User's Manual, I won't go into detail here (Update: You can read my blog of 2009/6/3 for screenshots and detailed steps).

Actually before I do the USB restore, first I edit the file /boot/grub/menu.lst in the Asus EeePC System Recovery USB disk to allow it to show the boot menu, with a choice to boot into debug mode.

1) Edit /boot/grub/menu.lst with your favourite editor. [NB. Do not use Windows notepad to edit this file. If you edit it in Windows, do not save it in MS-DOS style (CR+LF). It has to be saved in Unix style (LF).]
2) Comment the line #hiddenmenu (to show the boot menu)
3) Change boot delay time to "timeout=3" or more
4) Duplicate the boot entry and add a kernel parameter XANDROSCDDEBUG=y to the end of the kernel line as below:

title Asus Eee PC (debug mode)
root (0x80,0)
kernel /boot/vmlinuz quiet rw vga=normal irqpoll root=/dev/ram0 XANDROSCDBOOTDEBUG=y
initrd /boot/initrd.gz

Then, after the USB restore is completed, instead of booting into default xandros and run the First Run Wizard, I reboot again with the Asus EeePC System Recovery USB disk and this time select "debug mode".

Now I mount and chroot to sda1 to install linux-image- I have downloaded earlier. This package includes the kernel and modules for EeePC 900 model which has support for aufs.

mount /dev/sda1 /mnt
chroot /mnt
cat /proc/partitions

The last command will show you the device name of your Asus EeePC System Recovery USB disk. For example, in my case, it is /dev/sdc1. Now I need to mount it and install linux-image-

mkdir /mnt/sdc1
mount -t vfat /dev/sdc1 /mnt/sdc1
dpkg -i /mnt/sdc1/linux-image-

You will see some warning messages about updating kernel, etc. Use the [TAB] key to select and [Enter] to continue. When you are done, then we copy the initramfs image from 900 or later models to /boot of sda1, backup the original:

cd /boot
mv initramfs-eeepc.img initramfs-eeepc.img.orig
cp /mnt/sdc1/initramfs-eeepc.img /boot

[NB. Alternately, if you don't have access to an initramfs image from 900 or later models, you can modify the original initramfs image of the 701 4G yourself following this wiki: Rebuilding initramfs, edit the init script to replace the line with the word "unionfs" to:]
mount -t aufs -o br:/mnt-user:/mnt-system none /mnt

Finally, exit from chroot mode, umount drives and reboot.

cd /
umount -a

Now, you have a brand new system with the less buggy aufs.


Reinstall my EeePC from scratch

This week, I decided to reinstall my EeePC from scratch. So I have started this blog to keep a record of what I will be doing and post all the steps here how I am going to customize my EeePC to perfection.

Currently I have another copy of default Xandros booting from USB, so I will take my time to do this re-installation. And in the following days, I will experiment on some new hacks customizing my EeePC and I will post the steps here, also updating this page with links to the individual pages.

Setting up repositories for my EeePC 4G
VGA Utility for EeePC
Installing IEs4Linux and additional language support
Install flashplayer 10 with SvOlli's patch for EeePC 4G
Watch DVD on EeePC
Record TV programs with Asus U3100 Mini in my EeePC
Auto Shutdown my EeePC
Play gp5 files with tuxguitar in EeePC Linux
Play MIDI with fluidsynth in my EeePC
Upgrade my EeePC to Openoffice 3.1
Fix File Manager problem after Asus update