Saturday, June 13, 2009

Part IV: 2nd Test restoring to minimal EeePC Linux with 1.6.1 701 en iso

(cont'd from Part III: Re-installing Removed Packages ...)

My next test that follows is to build a minimal EeePC Linux system on my 4G with a 701 en-US iso.

Prepare the System Recovery USB Disk

With the downloaded iso, first I burn it into a DVD, then run BootTool to create the System Recovery USB disk. But the operation was not successful, "P701L.gz" and "user_start.dat" cannot be copied to the 1GB USB disk.

This is the first time I experience this error though I have heard about it for long time already. I tried it twice not successful, not even by manually copying the files from the DVD to the USB stick. So I ended up using another USB disk (the 2GB one I use to use for such testing).

Next I download the script package restore-minimal-701-4G.tgz I have uploaded to my website, and extract it to the USB disk with 7-zip File Manager.

Edit the Remove Package Lists

The next thing to do is to edit the remove*.list files for the packages I want to remove. But since I have no idea what packages are there in this EeePC Linux version, I first restore from USB with the original bootscript (select the 1st entry at the grub boot menu), then boot it up to see what is in it.

With the "dpkg -l" or "dpkg-query -W" command, I check what packages are installed and edit the remove*.list files accordingly. [Note: I have uploaded the dpkg -l list to this Wiki.] Basically, unlike in the previous test, there are no Chinese locale packages in this version, so no more "remove_zh_tw.list" and "remove_zh_cn.list". Also scim has been replaced by gcin. The resulted remove lists are slightly different to the 701 4G version. There are less packages to remove - only a total of 683 MB.
/media/D:/removes> ls
README remove_games.list remove_kids.list remove_settings.list
remove_acroread.list remove_gcin.list remove_ooo.list SUMMARY
remove_drivers.list remove_internet.list remove_play.list
I also take this opportunity to test the remove list one by one uninstalling them with apt-get to see if any error will occur during the process. [NB. Since I still have union filesystem, nothing will really get uninstalled this time.]
/media/D:/removes> sudo apt-get remove `cat remove_games.list`
Reading package lists... Done
Building dependency tree... Done
Note, selecting xandros-frozen-bubble-helper for regex 'frozen-bubble*'
Note, selecting frozen-bubble-lib for regex 'frozen-bubble*'
Note, selecting frozen-bubble-data for regex 'frozen-bubble*'
Note, selecting frozen-bubble for regex 'frozen-bubble*'
Note, selecting planetpenguin-racer-extras for regex 'planetpenguin-racer*'
Note, selecting planetpenguin-racer for regex 'planetpenguin-racer*'
Note, selecting planetpenguin-racer-data for regex 'planetpenguin-racer*'
The following packages will be REMOVED:
crack-attack fb-music-high frozen-bubble frozen-bubble-data gnome-sudoku kdegames-card-data
kpat ktuberling libkdegames1 ltris planetpenguin-racer planetpenguin-racer-data
xandros-frozen-bubble-helper xandros-gnome-sudoku-helper
0 upgraded, 0 newly installed, 14 to remove and 12 not upgraded.
Need to get 0B of archives.
After unpacking 59.3MB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 64338 files and directories currently installed.)
Removing crack-attack ...
Removing xandros-frozen-bubble-helper ...
Removing frozen-bubble ...
Removing fb-music-high ...
Removing frozen-bubble-data ...
Removing gnome-sudoku ...
Removing kpat ...
Removing kdegames-card-data ...
Removing ktuberling ...
Removing libkdegames1 ...
Removing ltris ...
Removing planetpenguin-racer ...
Removing planetpenguin-racer-data ...
Removing xandros-gnome-sudoku-helper ...
For those who are interested, here is the set of remove file lists I have ended up with: remove_files-701_en_US-

Before and After

Again, I have compared the the "df" and "fdisk -l" outputs before and after, showing the free disk space and the partition layout before and after the process:

1) Original 13% (!!?) free disk space in sda1, total filesystem size of 2371235k
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/sda1 2371235 2059136 312099 87% /mnt
2) Now 3% free disk space in sda1, Used = 1402473k, i.e. freed up 656 MB. Also filesystem size reduced to 1446438k, i.e. sda1 40% smaller
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/sda1 1446438 1402473 43965 97% /mnt
3) Original disk partition layout: Exactly the same as 701 4G, sda1 occupies 300 cylinders and sda2 occupies 184 cylinders. I guess Asus has changed the packages but have not resized the partition accordingly, so resulting in so much not usable free disk space in sda1.
Disk /dev/sda: 4001 MB, 4001292288 bytes
255 heads, 63 sectors/track, 486 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 300 2409718+ 83 Linux
/dev/sda2 301 484 1477980 83 Linux
/dev/sda3 485 485 8032+ c W95 FAT32 (LBA)
/dev/sda4 486 486 8032+ ef EFI (FAT-12/16/32)
4) After resizing: read-only sda1 only occupies 183 cylinders and read-write sda2 enlarged to 301 cylinders
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1 1 183 1469916 83 Linux
/dev/sda2 184 484 2417782+ 83 Linux
So much more usable disk space for you.

Moreover, with this hack you are free to delete and re-install packages as you like. Not like with union filesystem when you upgrade a package, the old files are still eating up your precious disk space in the read only partition. This is especially true if you plan to upgrade openoffice, Acrobat Reader, etc.

Re-installing Removed Packages

For the purpose of testing, I have re-installed all removed packages again.

Re-installing removed packages is more complicated for this version. I tend to believe that this is an alpha version, because most of the factory installed package version are not found in the 1.6 en respositories tree on Asus Update website. Instead, they scatter everywhere in the Asus Update website - some from 900, some from 1000H, ... everywhere! I have to use the Advanced search of Google to locate them within

Also, the original respositories tree is for EeePC Linux version 1.6.4 p701 en, but there are not many packages in that repos tree. Probably just an experimental version. If I just run an "sudo apt-get update" and run the synaptic package manager, there are hardly any packages available. So I have to edit /etc/apt/sources.list and add the 1.6 repos entries:
deb common main
deb p701 main
deb en main
Then when I fire up synaptic and re-install the packages running through the list in the "removed.log", it turned out that most packages can be installed easily - easier than with 701 4G iso.

Some tips to do it faster:
- Games can be ticked from the [Section] View > [Games and Amusement] of synaptic
- Same for those educational programs - in [Science] and [Mathematics] section

Also, if you plan to do it over and over, again and again, you may want to save or backup the *.deb in the folder /var/cache/apt/archives/ to somewhere else. Installing a program won't take much time, it take much longer to download it.

EDIT 2009/6/17: See my blog of Jun 15, 09 for how I build a local repository of Asus Update to speed up this re-installation process.

Packages of trouble

1) Installing smplayer popup with this error message because mplayer is not available in any of the 1.6 repo trees!

I have to manually download it from the 701 pool: mplayer_1.0~rc1-12etchxandros10_i386.deb
and install it in File Manager:

This installation will end up with an error message because mplayer depends on mplayer-skin but mplayer-skin has not yet been installed (because it also depends on mplayer!). When you run synaptic later, it will complain there is a broken package.

Now just install mplayer-skins, and the dependency will be resolved.

2) Firefox - need to force version to 2.0.x because 3.0.4 is also available on the 1.6 repo tree but requires libc6 and a lot of libraries upgrade and can only be done by running the firefox-upgrade meta package.

To force version, first highlight the package you want to install, then select from the pull down menu [Package] > [Force Version],

and select the 2.0.x versions.

3) adobe-flash-player - the infamous problem with flashplayer10 on EeePC Linux. Again we need to force version to 9.x instead of the higher 10.x versions. If you want the 10.x version, you have to install it as part of firefox-upgrade (to version 3.0.x) because it requires a higher libc6 version than the default one.

4) gcin (Chinese input Method) - This is the most troublesome. All versions available from the 1.6 repo trees require a libc6 upgrade which is of course undesirable (though possible). So I downloaded it from the p701 repos tree: gcin_1.3.4-2asus4_i386.deb and gcin-qt3-immodule_1.3.4-2asus4_i386.deb.

To install them, open a terminal and enter this command:
deb/home/user> ls
gcin_1.3.4-2asus4_i386.deb gcin-qt3-immodule_1.3.4-2asus4_i386.deb Trash/ My Documents/
/home/user> sudo dpkg -i *.deb
Selecting previously deselected package gcin.
(Reading database ... 71993 files and directories currently installed.)
Unpacking gcin (from gcin_1.3.4-2asus4_i386.deb) ...
Selecting previously deselected package gcin-qt3-immodule.
Unpacking gcin-qt3-immodule (from gcin-qt3-immodule_1.3.4-2asus4_i386.deb) ...
Setting up gcin (1.3.4-2asus4) ...

Setting up gcin-qt3-immodule (1.3.4-2asus4) ...
The installation went alright, but gcin is still not showing up in the taskbar. So I open synaptic again and install "xandros-gcin". And on re-starting X by pressing [Ctrl]-[Alt]-[BkSp], now I can input Chinese.

Final Comments

After these testings, I can now confirm that this restore to minimal script is working, though not perfect. There seems to be still some minor bugs, but basically it works. And since it take quite some time to run it once, I don't think I can run many test on this.

The % of free disk space in sda1 I ended up with varies with the different iso and what packages you want to remove, and is rather out of my control. With the 701 4G, I achieved 92%, and this one 97%. Compared with the disk space reclaimed shrinking down sda1, I think these figures are acceptable.

If I have time to further test on other iso, I will further post my remove file lists. But I think some Linux expert may be able to come up with a more comprehensive remove file list, knowing what libraries can be safely removed.

And so this concludes this project of mine.

P.S. With the 701 en-US iso, I do not end up with the hissing sound in the minimal system.

Part I: My 1st Trial
Part II: Success - Restoring my EeePC from USB to a Minimal System
Part III: Re-installing Removed Packages to my minimal EeePC Linux 701 4G
Part IV: 2nd Test restoring to minimal with a 1.6.1 701 en iso
Part V: Yet another test with 1.6 French iso
Conclusion: Restore from USB to minimal system

No comments:

Post a Comment