20080416: Added updater.sh for C1000 and polished Cackohddfix installer script.
20080328: Updated with a Cacko HDD Fix scriptpack.
20080326: Updated with instructions for Sharp/Cacko.
========================================================
Setting up dualbooting Debian EABI & Sharp/Cacko/pdaXrom/Angstrom (internal disk/NAND)SUMMARY: The idea is to use the Debian rootfs on the internal disk/CF/SD as the
MAIN SYSTEM, from there booting quickly (bypassing the bootloader stage) into different distros/ROMs as the
SUB-SYSTEMS and loading the new kernels on the spot with
kexec.
The following is just a demonstration of how to set up a dualbooting environment in a fairly easily way. There are quite a few steps to do, but it is not difficult to understand if you are not an absolute *nix newbie.
This howto starts from a working debian rootfs and proceeds to setting up a subsystem in NAND. If you already have a working system in NAND, you just need to make sure that a debian rootfs is put in a proper partition on the disk and then flash a kexec-friendly kernel (yonggun/angstrom/poky). In this case you can skip section 2.
In principle you can do the same to set up a multibooting environment.
This howto is based on 2or0's blog (
http://yonggun.tistory.com/67 )
1. Prepare the main system (i.e. the Debian rootfs on internal disk/CF/SD)1.1 Make sure that you have a working Debian EABI rootfs (I assume you have already done so or can do so as you are reading this).
AND make sure that the rootfs is
ext3 formatted; if not, do this:
1.1.1 It is very easy to convert your Debian rootfs from ext2 to ext3. Just do this:
tune2fs -c 0 -i 30 -j /dev/hda1
(This simply adds journaling support to the rootfs, and it is safe to perform this step whether the Debian rootfs is mounted or not)
1.2 Extract the new 2.6.24.3-yonggun
kernel modules to the Debian rootfs.
-- Get it from:
http://yonggun.tistory.com/68-- Extract to the root of the Debian rootfs: (while running the Debian main system)
tar xzf 2.6.24.3-yonggun.cpufreq.fastfpe.tar.gz -C /.
1.3 Make you use
the kernel for Sharp Bootloader-- If your Debian rootfs boots with uboot, first you need to do a NAND Restore (in D+M mode) to make the flash area return to the factory state.
-- If you have already set up Debian using the Sharp bootloader kernel (yonggun/angstrom/poky), proceed to 2.
2. Set up the subsystem on NAND2.1 Sharp/Cacko rom2.1.1 Install the subsystem on NAND (skip this if you already have a working system)
Sharp rom:a. Get the NAND backup image from:
http://trisoft.de (English version) or
http://downloads.conics.net/pda/zaurus-sl-...iginal-backups/ ( original Japanse version)
b. Copy the NAND backup image to a SD/CF
c. Enter the D+M service menu (unplug AC and remove battery > wait 10 seconds > keep pressing [Fn] [D] [M] together > plug in AC)
d. Do a NAND Flash Restore (page 3)
e. Kernel update (highly recommended): after installation, reboot into the Flash Menu again.
tetsu kernel:
http://tetsu.homelinux.org/zaurus/kernel/ Remember to flash the new kernel with the appropriate updater.sh (can be found in the kernel download spots).
Cacko rom:a. Get ver. 1.23 here:
http://sharpromfeed.home.linuxtogo.org/dow.../cacko/rom1.23/b. Reboot the machine into the Flash Menu (press [OK] then power on)
c. Before flashing the rom, go to NAND flash utils to resize the root partition: 32MB (Cacko full) or 19MB (Cacko lite)
d. Kernel update (highly recommended): after installation, reboot into the Flash Menu again.
eviljazz kernel:
http://www.katastrophos.net/zaurus/kernels/current/ (recommended: fastfpe-cachedfb )
Remember to flash the new kernel with the appropriate updater.sh (can be found in the kernel download spots).
If you want to have Sharp/Cacko rom run WITHOUT the required partitioning on the internal disk (hdd1, hdd2, hdd3), please follow 2.1.2
If you want to have Sharp/Cacko rom run with the required partitioning on the internal disk (hdd1, hdd2, hdd3), please follow 2.1.3[size=]2.1.2 Remove the required disk partitioning setting[/size] (the
easy way) -- for C3100 & C3200 only (NEW & TESTED!)
Step 1 Download this
scriptpack v0.2 and extract it to a CF/SD. (Please read the "readme.txt" first)
Step 2 Boot the Zaurus into the "Linux Emergency" console.
a) Remove all power sources and flip the battery lock to the left, and then press the reset switch;
Wait about 10 seconds;
c) Press and don't release the "D" and "B" keys;
d) Put back the battery and flip the battery lock back to
the right;
e) Power on (with "D" and "B" still being pressed);
f) When the prompt shows up, login in as "root".
Step 3 Insert the card to the card slot and it will be mounted automatically.
Step 4 Type "cd /mnt/card/cackofix" (SD) or "cd /mnt/cf/cackofix" (CF) and hit [Enter].
Step 5 Type "./install.sh" and hit [Enter].
Step 6 Wait until the process finishes. Then reboot.
That's it!
And ... good news: now the whole Debian filesystem is visible in Cacko. The partition can be mounted just like any media.
[size=]2.1.3 Repartition the internal disk to restore the original setting[/size] (the
hard way)
The basic idea:
-- Sharp rom requires the internal disk have (at least) three primary partitions (hdd1, hdd2, hdd3)
-- Assuming that the root partition is /dev/hda1 and the swap partition is /dev/hda2, the most straightforward way is to add two additional partitions (hda2 and hda3) after hda1. Using gparted you can freely resize and manipulate the existing partitions safely.
Step 1 Boot into a
DIFFERENT system that can use
gparted, e.g. pdaXrom, Angstrom, another Debian rootfs on SD (I use this one)
(It may be necessary to reflash the kernel of the corresponding system.)
Step 2
IMPORTANT: umount ALL partitions on the internal disk (such as all /dev/hdaX and swap partition) before any partitioning operations!!
Step 3 Launch gparted
-- the GUI is of a very user-friendly WYSIWYG kind;
-- TIP: do use the "Edit > Undo Last Operation" function to avoid unnecessary operations as all operations will be recorded and applied together.
Step 4 First delete the swap partition to free /dev/hda2
Step 5 Next resize /dev/hda1. My suggestion: free least 525MB
Step 6 After resizing /dev/hda1, create
two new partitions following /dev/hda1
-- the 1st new partition (/dev/hda2): 16MB (NB: this is the smallest I can get in gparted, despite the fact that it only needs to be 9.5MB), ext3 format
-- the 2nd new partition (/dev/hda3): around 512MB would be quite enough, fat32 format
Step 7 Add a swap partition back (/dev/hda4) after the two new partitions using the remaining space (recommended: around 512MB if space allows)
[An alternative which is more complicated is to create an extended partition for more partitions]
[Yet another alternative is to move the Debian rootfs to some other partition. 2or0's latest yonggun kernel 2.6.24-3 comes in many flavors to boot from /dev/hda1~4 and mmcblk0p1~2 ! Just figure out how to allocate the partitions carefully.)
Step 8 Apply all operations (Edit > Apply All Operations). It may take a few hours to resize the giant root partition, especially when your internal disk is a huge one (e.g. 16GB CF).
DO NOT interrupt the process and just let gparted finish its job.
Step 9 If things run fine, you will have (at least) four partitions in /dev/hda. Exit gparted.
Step 10 Mount /dev/hda1 and /dev/hda2
Step 11 Create two directories "
lost+found" and "
.sys" on both partitions
Step 12 Unzip these factory disk system files to the "
.sys" directories
-- hda1:
-- hda2:
Now your internal disk is ready for Sharp/Cacko rom!
Issue: On C3000/C3100/C3200, if the Debian rootfs lives in either /dev/hda1 and /dev/hda2, then it will be mounted to read-only in Sharp/Cacko rom.
2.1.4 Other updates
-- Fixes for SD card capacity limits:
https://www.oesf.org/forum/index.php?showtopic=18523,
https://www.oesf.org/forum/index.php?showtopic=20147 -- Japanese support:
https://www.oesf.org/forum/index.php?showto...30&start=30-- Meanies has created a lot of cool packages here:
http://www.users.on.net/~hluc/myZaurus/2.2 pdaXrom (1.1.0 beta3, pdaXii) (skip this if you already have a working system)
Step 1 Reboot the Zaurus into the [OK] flash menu with the pdaXrom installer files ready on a SD/CF.
In the pdaXrom installation menu, choose "3" (NAND flash utils), resize the root partition to
121MB. You will have to reboot once (try pressing [OK] as soon as the system rebooting message shows up to come back to the pdaXrom installer quickly)
Step 2 Back in the pdaXrom installer, choose "1" to install.
Step 3 After successful installation, choose "6" to reboot.
Step 4 Log in as "root" (no password needed)
Do whatever you feel like doing here. After that reboot into the [OK] flash menu.
Step 5
Optional: Upgrade pdaXrom beta3 to Meanie's much improved and polished
pdaXii -- Get the upgrade package from:
http://www.tyrannozaurus.com/feed/pdaXii13...ii13-custom.tgz-- Extract the tarball (anywhere you like, EXCEPT the root partition in pdaXrom because of not enough space)
zcat pdaXii13-custom.tgz | tar xvf - -C /ANYWHERE/YOU/LIKE
-- Change to the "custom" directory in the extracted path
/etc/rc.d/init.d/sd stop
./install-fix-beta3.sh / upgrade
Issue: I bumped into an error related to the sd card module as the upgrade script doesn't seem to copy the kernel module (under /custom ) successfully. If this also happens to you, you will have to do it manually:
cp sharp_mmcsd.o /lib/module/2.4.20/kernel/drivers/block/
Step 6 Kernel update (recommended!)
-- Reboot the system to the [OK] flash menu.
-- Use
pelrun's modified version of evilJazz's improved kernel (for C3100/C3200) so that you can run pdaXii using the whole 121MB NAND flash space.
(Not sure how pelrun's kernel differ from evilJazz's in
http://www.katastrophos.net/zaurus/kernels/current/ , where you can also find new kernels for C1000 and C3000)
2.3: Angstrom, Poky (?)(To be added later.)
(Main question: Is it possible to install Angstrom and Poky to NAND on C3x00? If yes, then with altboot and kexec in Angstrom we can cycle between Angstrom and Debian easily and also runs Android off SD after booting into Angstrom! )
3. Set up the dualbooting environment3.1 Flash (again) the yonggun kernel 2.6.24-3 for Sharp bootloader
-- Get the right kernel(s) here:
http://yonggun.tistory.com/68zImage.bin.hda1~4 (Debian rootfs on the internal microdrive/CF)
zImage.bin.mmcblk0p1 (Debian rootfs on the first partition of SD, i.e. /dev/mmcblk0p1, which is the usual device node)
zImage.bin.mmcblk0p2 (
Question: I'm not sure when we need to boot from /dev/mmcblk0p2)
-- Flash the appropriate kernel with this Angstrom's flashing tool (remove the
.txt extension before use):
for C3000/3100/3200 only
or
for C1000 only
-- Upon successful flashing, the system will automatically reboot back into the Debian rootfs (the main system).
3.2 Install kexec-- kexec enables the Zaurus to multiboot different kernels (and so different distros or "ROMs")
-- You can use either:
The Angstrom package:
http://www.angstrom-distribution.org/unsta...-r1_armv5te.ipkTo install:
dpkg -i --force-architecture kexec-tools_1.101-r1_armv5te.ipk
OR
My .deb package
To install:
dpkg -i kexec-tools_20080227-1_armel.deb
3.3 Use kexec to boot up the subsystem in DebianpdaXrom-- Copy the kernel you use to flash in 2.2 to a desired path (the stock kernel can be find inside the "tools.tar" file)
-- Rename the kernel image to avoid confusing different kernels. Let's say we change it to "pdax_zImage.bin". Copy this kernel to your home ( ~/ ) directory.
-- Run
this script outside X (again, remove the .txt extension before use)
(This script will first stop (most of) the running services/processes, then unmount the filesystems and remount the current root partition as read-only, before actually loading and booting into the new kernel.)
Sharp/Cacko rom-- Copy the kernel you use to flash in 2.1 to a desired path
-- Rename the kernel image to avoid confusing different kernels. Let's say we change it to "sharp_zImage.bin". Copy this kernel to your home ( ~/ ) directory.
-- Run
this script outside X (again, remove the .txt extension before use)
(This script will first stop (most of) the running services/processes, then unmount the filesystems and remount the current root partition as read-only, before actually loading and booting into the new kernel.)
Note:A quick and dirty way is:
kexec -l /PATH/TO/KERNEL_FILENAME
kexec -e
(The catch here is kexec will start booting up the subsystem without first stopping the running services/processes and unmounting the filesystems, especially the root, which may cause filesystem issues and during later booting fsck may complain about this).
[size=]
To return to the main system (Debian), just reboot. [/size]
4. Access the Debian filesystem from the subsystem in NANDSharp/Cacko rom:-- The partitions on the internal disk may not be mounted automatically.
-- You can either mount them manually (mount /dev/hdaX /mnt/SOMETHING), or add new entries in /etc/fstab
pdaXrom:-- The internal disk (/dev/hda1) is mounted to /mnt/ide by default; so the Debian filesystem is totally accessible in pdaXrom!
-- Card in the CF slot: /dev/hdc1
-- SD: /dev/mmcda1
Note:How about accessing the content in flash?
According to
https://www.oesf.org/forum/index.php?showtopic=18104 using the kernel modules of 2.6 may destroy content in flash. I seem to run into this in my experiments. So I removed the section on this for safety. One workaround is to symlink/copy/move stuff, such as documents and even the whole home/ directory, from the flash area to some other media, such as a separate partition on the internal disk/SD. Then the things put there will be accessible from Debian.
5. Enable booting Debian on the SD cardIt's sometimes more convenient to play/experiment with the Debian rootf on a separate media (i.e. a kinda sandbox) without the risk of breaking the main system. In other words, now I have a tri-booting environment.5.1 Prepare a Debian rootfs on the SD card (just a simple matter of extracting a rootfs tarball!) (= 1.1)
5.2 Extract the kernel 2.6.24 modules (= 1.2)
5.3 Grab the kernel image file. It is either zImage.bin.mmcblk0p1 or zImage.bin.mmcblk0p2. (The first one seems more common.) Rename it to something like "debian_sd_zImage.bin" to avoid confusing different kernels (zImage.bin). (= 3.1). Put it at the root of the SD card.
5.4 Load the Debian rootfs on SD like the way described in 3.3. You need to edit that attached booting script to boot the debian kernel.
5.5 Just do the adjustments accordingly to suit your purposes, such as installing kexec, copy the kernels (zImage.bin) for the other rootfs, etc., in the Debian rootfs on the SD. That means you can practically cycle thru different distros/ROMs by using the same procedure (running kexec).
========================================================
[size=]
It would certainly be great if someone can provide the details of how to install other distros/ROMs (particularly Angstrom and Cacko) on SD. If successful, we can use our lovely Zaurus to boot up most (if not all) available systems.
It would be even better if OpenBSD can be installed on SD... (at one time there was a dirty pdaXii/OpenBSD dualbooting setup, modifying mathemajikian's Cacko/OpenBSD dualbooting solution. But There ought to be a more straightforward and cleaner way.)
One problem in 4.3: I cannot access several directories including /etc, /home, /mnt, /root, etc. Could this be a matter of mount options? Any input is much appreciated! [/size]
Have
FUNTM!