Variations for boot Xandros from USB on Eeepc (without Union filesystem)

Update: Now there is an easy solution to build this making use of the Asus EeePC USB Recovery Disk. Please refer to the page Boot Xandros on USB for Dummies.

These are variations of the steps for to built Xandros on USB (without union filesystem) from your desktop with Puppy Linux live CD for advanced Linux users. For building Xandros on USB exactly the same as the stock distro on eeepc, please refer to the original steps here.

Also, I assume you have enough knowledge on Linux so I have skipped explanation of some Linux basics. If you want more detailed information, please refer to the section Explanation of Linux terminology and Puppy Linux Specific Instructions on the webpage of the original steps.

What You Will Need
Downloads
Easy Steps
Advanced - Build Init RAM Filesystem Image from scratch


 WHAT YOU WILL NEED

1) A desktop PC that supports booting from CD.
2) A DVD ROM on your desktop PC.
3) The Asus P701L.gz image file of the stock distro (from the rescue DVD that comes with your eeepc).  [Update: Now it is possible to download the Eeepc 701 iso image for 4G model from SourceForge.net.  For other models, you can download the iso from http://downloads.k0k0.de/index.php?dir=EeePC%2F]
4) A Puppy Linux live CD ISO image which you can download from here: pupeee.iso and burn into a bootable CD. The md5sum is 8642c0b6a62817ea3cf38812d398f380.
5) A target USB device where you want to install your Xandros on USB. It can be any SD, or SD or CF card in a card reader, USB flash disk or USB hard disk partitions of at least 4G size.
[NB. Be sure to buy a good quality SDHC / USB flash disk. If you find many filesystem errors during the final step of filesystem checking, it would mean you will probably also end up with many errors running Xandros from USB that will make the system unstable.]

Without the union filesystem, you only need to built 1 partition: the SYSTEM partition (min 2.5G). At startup, the system will loop scan for the USB device of the root partition, identifying it with a volume label as specified in the kernel parameters specified in the menu.lst config file of GRUB (the default boot loader). Here I have used the volume label USBSYSTEM. Feel free to change to whatever you like.


DOWNLOADS

For the lazy, I have hosted a package containing the initramfs image and grub menu.lst available for download: eeepc-bootusb-nounionfs.tgz. You can just extract and copy the file initramfs-usb-nounionfs-eeepc.img to the folder /boot of your Xandros on USB, i.e. /mnt/sdx1/boot as mounted by Pmount (the Puppy Mount Monitor) of Puppy Linux, and the file menu.lst to the folder /boot/grub (Backup the original /boot/grub/menu.lst if required).


EASY STEPS

[NB. In the steps here, I have used /dev/sdx for the target device where you want to install your Xandros on USB. Check the correct device name in Pmount and substitute them in the commands accordingly.]

1) Copy the Asus P701L.gz image file of the stock distro from the rescue DVD and put it somewhere on the hard disk of your desktop PC.

2) Put the Puppy Linux live CD into your CDROM and boot your desktop with it. You may need to enter BIOS to change the boot sequence. During the boot process, you will have to answer a few questions:
   (i) Options - just [Enter]
   (ii) Keyboard - choose your national keyboard
   (iii) Display Driver (Xorg or Xvesa) - Any will do
   (iv) Display resolution - 1024x768 should do for most modern desktop PC

3) Click on the "drives" icon on the desktop of Puppy Linux to launch Pmount. Mount the device where you have copied the P701L.gz image file.

4) In Pmount, open File Manager by clicking on the icon for the device where you have copied the P701L.gz file. Navigate into the folder with the image file.

5) Open a terminal and run this command to extract the P701L.gz image to the target device. Replace sdx with the correct device name as you can see in Pmount. [Caution: Umount the target device first]

Code:

gunzip -c P701L.gz | dd of=/dev/sdx

This will copy the MBR and the SYSTEM partition (/dev/sdx1) to the target drive (/dev/sdx).

6) Open a terminal and run this command to change the volume label of the SYSTEM partition (USBSYSTEM for me or any for your choice). Also convert the it to ext3 journal filesystem:

Code:

e2label /dev/sdx1 USBSYSTEM
tune2fs -j /dev/sdx1

7) Start GParted Partition Manager to resize the SYSTEM partition to use remaining space of the USB device or any size you prefer.

Menu > System > GParted Partition Manager
[NB. Umount the partitions with Pmount before running GParted.]

- Select /dev/sdx on the top right (Maximize the window if you can't see it)
- Highlight the line /dev/sdx1
- Partition > Resize/Move

- Drag and expand the partition to your preferred size 

- Edit > Apply all operations

8) Click in Pmount and mount /dev/sdx1 (click the rightmost  icon). Then open file manager for that drive (click the leftmost  icon). Navigate into the folder /mnt/sdx1/boot.

9) Mount the device where you have downloaded the file eeepc-bootusb-nounionfs.tgz. Open file manager for that drive and navigate to the folder where you have put them. Double click on it to extract it, then drag and drop the file "initramfs-usb-nounionfs-eeepc.img" to the other window of /mnt/sdx1/boot.

10) Navigate into the folder /mnt/sdx1/boot/grub, backup the file "menu.lst
", rename it as "menu.lst.orig". Then back to the other window with the extracted downloaded file, drag and drop the file "menu.lst" here.

13) Run a filesystem check on your partitions before you reboot. For me, the easy way is to do it on the command line. Open a terminal and run these commands:

Code:

umount /dev/sdx1
e2fsck -c /dev/sdx1

Or you can do it with GParted partition manager:

- Menu > System > GParted partition manager
- Select /dev/sdx on the top right (Maximize the window if you can't see it)
- Highlight the line /dev/sdx1
- Partition > Check
- Edit > Apply all operations
[NB. Umount the partitions with Pmount before running filesystem check.]

14) Now your Xandros on USB is ready for use. Plug it into your EeePC, press [Esc] at startup and select USB: USB2.0 Card Reader SD0 or USB: Generic Storage Device as first boot device.


 ADVANCED - Build Init RAM Filesystem Image from scratch

For those who would like to build the init RAM filesystem image from scratch. Here are the steps modified:

9) Create a new directory "temp" in /mnt/sdx1/boot. This is where you will extract the original initramfs iimage.

10) Navigate into the new folder /mnt/sdx1/boot/temp, open a terminal and extract the original initramfs image with this command:

Code:

gunzip < ../initramfs-eeepc.img | cpio -i

11) Edit the file "init". Replace its content with this init.

13) Navigate into the folder /mnt/sdx1/boot/temp/modules. Open another file manager window of the same drive and navigate into the folder /mnt/sdx1/lib/modules/2.6.21.4-eeepc/kernel/drivers/usb. Look for the files usbcore.ko, ehci-hcd.ko, uhci-hcd.ko, libusual.ko and usb-storage.ko in the different sub-folders. These are the kernel modules you will need to boot from USB device. Drag and copy them here.

14) [NB. With devices dynamically created by mdev in the new "init", this step is no longer needed.] Navigate into the folder /mnt/sdx1/boot/temp/dev. Open a terminal and create the necessary devices for mounting the root filesystem during startup with the mknod command:

Code:

mknod -m 644 sdb1 b 8 17
mknod -m 660 sdb2 b 8 18
mknod -m 660 sdb3 b 8 19
mknod -m 644 sdc1 b 8 33
mknod -m 660 sdc2 b 8 34
mknod -m 660 sdc3 b 8 35
mknod -m 644 sdd1 b 8 49
mknod -m 660 sdd2 b 8 50
mknod -m 660 sdd3 b 8 51
mknod -m 644 sde1 b 8 65
mknod -m 660 sde2 b 8 66
mknod -m 660 sde3 b 8 67
mknod -m 644 sdf1 b 8 81
mknod -m 660 sdf2 b 8 82
mknod -m 660 sdf3 b 8 83
mknod -m 644 sdg1 b 8 97
mknod -m 660 sdg2 b 8 98
mknod -m 660 sdg3 b 8 99
mknod -m 644 sdh1 b 8 113
mknod -m 660 sdh2 b 8 114
mknod -m 660 sdh3 b 8 115

Instead of running those commands one by one, you can also download a package sdxx.tar.gz of the device files I have created and extract it to the folder /mnt/sdx1/boot/temp/dev.

15) Now you can pack the initramfs image. Navigate into the folder /mnt/sdx1/boot/temp, open a terminal and run this command:

Code:

 find | cpio -H newc -o | gzip -9 > ../initramfs-usb-nounionfs-eeepc.img

16) Continue as per step 10 above.