Help - Search - Members - Calendar
Full Version: Dualbooting/multiplebooting With Kexec!
OESF Forums > Distros, Development, and Model Specific Forums > Distro Support and Discussion > Debian
Pages: 1, 2
ZDevil
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:
CODE
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)
CODE
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 NAND

2.1 Sharp/Cacko rom

2.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


2.1.2 Remove the required disk partitioning setting (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;
cool.gif 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! smile.gif

And ... good news: now the whole Debian filesystem is visible in Cacko. The partition can be mounted just like any media.


2.1.3 Repartition the internal disk to restore the original setting (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: Click to view attachment
-- hda2: Click to view attachment
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: http://www.oesf.org/forum/index.php?showtopic=18523, http://www.oesf.org/forum/index.php?showtopic=20147
-- Japanese support: http://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 *exactly* 53MB 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
-- There will be *just enough* space left in the root partition in NAND (/dev/mtdblock2) to take the files in Meanie's upgrade package
-- 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)
CODE
zcat pdaXii13-custom.tgz | tar xvf - -C /ANYWHERE/YOU/LIKE

-- Change to the "custom" directory in the extracted path
CODE
/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:
CODE
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 environment

3.1 Flash (again) the yonggun kernel 2.6.24-3 for Sharp bootloader
-- Get the right kernel(s) here: http://yonggun.tistory.com/68
zImage.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 Click to view attachment or
for C1000 only Click to view attachment
-- 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.ipk
To install:
CODE
dpkg -i --force-architecture kexec-tools_1.101-r1_armv5te.ipk

OR
My .deb package
Click to view attachment
To install:
CODE
dpkg -i kexec-tools_20080227-1_armel.deb

3.3 Use kexec to boot up the subsystem in Debian

pdaXrom
-- 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 Click to view attachment (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 Click to view attachment (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:
CODE
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).


To return to the main system (Debian), just reboot. wink.gif


4. Access the Debian filesystem from the subsystem in NAND

Sharp/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 http://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 card
It'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).

========================================================

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!
rolleyes.gif

Have FUNTM! wink.gif
urkden
Thank you very much for this HowTo. It's very clear and usefull so we can play a little more with our little toys.
2or0
This is quite nice howto unlike mine. tongue.gif
pelrun
You're essentially doing a "kexec -f" when switching to pdaXrom, which isn't ideal as debian doesn't get properly shut down first. The correct method is to edit /etc/init.d/reboot and add kexec -e just before /sbin/reboot. Then the pdaXrom boot procedure changes to:

CODE
kexec -l PDAXROMIMAGE
reboot

Debian will shut down, and the system will restart into pdaXrom.


When I get a 2.4 kernel compilation toolchain set up I'll be building a pdaXrom kernel image without the 53MB /root limitation on kexec - I don't want to lose my original pdaXrom setup smile.gif
matthis
Thank you very much!

I tried this with Sharp rom on NAND, but it fails at boot with "unable to open initial console"
ZDevil
QUOTE(matthis @ Mar 2 2008, 01:49 AM) *
Thank you very much!
I tried this with Sharp rom on NAND, but it fails at boot with "unable to open initial console"

You seem to get farther than I. In my case Sharp rom stops booting complaining about HDD error (the whole internal disk is taken up by Debian rootfs).
How do you install that?
Does a reboot help? If not, can you do: cd /dev; MAKEDEV console, and then reboot?
matthis
Sharp rom expects hdc1 and hdc2 as ext3 and hdc3 has vfat (32), with specific files on hdc1 and hdc2 (the .sys folders and their files)
So I have
p1: ext3 big partition for debian + put back the necessary .sys in there. If your debian is somewhere else it can be small like the original.
p2: small ext3 partition for only the .sys folder
p3: vfat for sharp rom Documents files
p4: swap.

I have attached the files for hdc1 and hdc2 (they are also available on the net from the german company selling zaurus)

Once I get the unable to open initial console, there is nothing I can do at all. Maybe accessing ramfs from debian and makedeving from there would do some good?

I have heard someone got past the initial console problem by doing this with a FRESH cacko install on nand (ie first boot I suppose).

pasteur
does updater.sh attached work on c1000 too?
ZDevil
QUOTE(pasteur @ Mar 2 2008, 09:16 AM) *
does updater.sh attached work on c1000 too?

I am not absolutely sure, but you can always use the Angstrom updater.sh for Akita.
Another (bigger) question is whether the yonggun kernel works on C1000. You can take a look at the discussion of yonggun's blog here: http://yonggun.tistory.com/66
ZDevil
@matthis:
Thanks for your post to remind me of the internal disk partitioning matter for Sharp/Cacko rom (having left it for ages).
It would be a bit tricky now to set up Sharp/Cacko this way, because a repartitioning of the disk containing debian rootfs is required.
I remember Meanie has also come up with a very detailed discussion of restoring the HDD partitions.
Perhaps Gparted can do the job (cleanly/safely)?
If that's possible, the next challenge is to get pdaX or Angstrom installed on SD. This is really my ultimate dream state of my Z (NAND -> Cacko; Internal CF -> Debian; SD -> pdaX, Angstrom, OpenBSD...) !!
pasteur
QUOTE(ZDevil @ Mar 2 2008, 05:47 PM) *
QUOTE(pasteur @ Mar 2 2008, 09:16 AM) *
does updater.sh attached work on c1000 too?

I am not absolutely sure, but you can always use the Angstrom updater.sh for Akita.
Another (bigger) question is whether the yonggun kernel works on C1000. You can take a look at the discussion of yonggun's blog here: http://yonggun.tistory.com/66

Thank you for the advice. It WORKS PERFECT!!
ZDevil
QUOTE(pelrun @ Mar 2 2008, 12:47 AM) *
You're essentially doing a "kexec -f" when switching to pdaXrom, which isn't ideal as debian doesn't get properly shut down first. The correct method is to edit /etc/init.d/reboot and add kexec -e just before /sbin/reboot. Then the pdaXrom boot procedure changes to:
CODE
kexec -l PDAXROMIMAGE
reboot

Debian will shut down, and the system will restart into pdaXrom.


Thanks for the tip. I did some searching and found this useful script for booting with kexec in a cleaner way: http://forums.debian.net/viewtopic.php?p=6...4704fd8a7f46ca3

I have modified it and attached it to the howto. I have tested it and it works great.

Now I am heading to compile a standard armel .deb of kexec-tools and will upload it if it works.

QUOTE(pelrun @ Mar 2 2008, 12:47 AM) *
When I get a 2.4 kernel compilation toolchain set up I'll be building a pdaXrom kernel image without the 53MB /root limitation on kexec - I don't want to lose my original pdaXrom setup smile.gif

Looking forward to that! smile.gif
ZDevil
I have corrected something in the pdaX boot script and attached it again, together with my build of kexec-tools. They seem to work fine for me. Please test.
Snappy
QUOTE(pasteur @ Mar 2 2008, 05:05 PM) *
QUOTE(ZDevil @ Mar 2 2008, 05:47 PM) *
QUOTE(pasteur @ Mar 2 2008, 09:16 AM) *
does updater.sh attached work on c1000 too?

I am not absolutely sure, but you can always use the Angstrom updater.sh for Akita.
Another (bigger) question is whether the yonggun kernel works on C1000. You can take a look at the discussion of yonggun's blog here: http://yonggun.tistory.com/66

Thank you for the advice. It WORKS PEFECTLY!!!


So you got the whole setup working on your c1000? What are the distros on your akita? smile.gif
ZDevil
QUOTE(matthis @ Mar 2 2008, 06:19 AM) *
Sharp rom expects hdc1 and hdc2 as ext3 and hdc3 has vfat (32), with specific files on hdc1 and hdc2 (the .sys folders and their files)
So I have
p1: ext3 big partition for debian + put back the necessary .sys in there. If your debian is somewhere else it can be small like the original.
p2: small ext3 partition for only the .sys folder
p3: vfat for sharp rom Documents files
p4: swap.

I have attached the files for hdc1 and hdc2 (they are also available on the net from the german company selling zaurus)

Once I get the unable to open initial console, there is nothing I can do at all. Maybe accessing ramfs from debian and makedeving from there would do some good?

I have heard someone got past the initial console problem by doing this with a FRESH cacko install on nand (ie first boot I suppose).

Hmm. Do you think it is feasible to tweak Cacko/Sharp roms to ignore the HDDs thing?
I've started a topic here: http://www.oesf.org/forum/index.php?showtopic=25565
Any insight will be great!
pasteur
QUOTE(Snappy @ Mar 2 2008, 08:58 PM) *
QUOTE(pasteur @ Mar 2 2008, 05:05 PM) *
QUOTE(ZDevil @ Mar 2 2008, 05:47 PM) *
QUOTE(pasteur @ Mar 2 2008, 09:16 AM) *
does updater.sh attached work on c1000 too?

I am not absolutely sure, but you can always use the Angstrom updater.sh for Akita.
Another (bigger) question is whether the yonggun kernel works on C1000. You can take a look at the discussion of yonggun's blog here: http://yonggun.tistory.com/66

Thank you for the advice. It WORKS PEFECTLY!!!


So you got the whole setup working on your c1000? What are the distros on your akita? smile.gif



pdaXromb3 on Nand, debian 2.6.24 on 4GB SD partitioned into two partition (95% ext3 5% swap)
ZDevil
I ran into a strange problem:

In the beginning of testing dualbooting, my 3200 could load the yonggun sd kernel (mmcblk0p1) and boot up the Debian rootfs on SD. But after fiddling with flashing pdaXrom and Cacko for a few times, somehow the Z cannot boot off SD, both in the simple way (kexec -l & kexec -e) and with my boot script. The system freezes after kexec -e.

Has anyone run into the same case or succeeded in booting off SD?
matthis
I wanted to try to do the MAKEDEV console thing to be able to boot back into sharp rom, but how do I mount the ramfs?
ZDevil
Another question about using the yonggun kernel (sharp bootloader version): since they are made to boot the rootfs off /dev/hda1, /dev/mmcblk0p1 or /dev/mmcblk0p2, does it still work if I repartition the internal disk back into the Sharp/Cacko fashion? The rootfs would then live in /dev/hdd3, can the kernel for hda1 boot up the system from there?
2or0
QUOTE(ZDevil @ Mar 23 2008, 03:55 AM) *
Another question about using the yonggun kernel (sharp bootloader version): since they are made to boot the rootfs off /dev/hda1, /dev/mmcblk0p1 or /dev/mmcblk0p2, does it still work if I repartition the internal disk back into the Sharp/Cacko fashion? The rootfs would then live in /dev/hdd3, can the kernel for hda1 boot up the system from there?


I think it is possible to boot /dev/hda3 if the option is properly given before building the kernel. wink.gif
ZDevil
So will there be new yonggun kernels for this? tongue.gif
Both hda3 and hda4 will be good, as it may be nice if Sharp/Cacko users can install additional stuff on hdd3, while leaving hdd4 for Debian.
BTW I saw this japanese page hosting kernel 2.6.24 with fastfpe and cpufreq enabled:
http://www.bigbridgezau.sakura.ne.jp/wiki....2F2008%2D3%2D21


born2wonder
QUOTE(ZDevil @ Mar 23 2008, 07:36 AM) *
BTW I saw this japanese page hosting kernel 2.6.24 with fastfpe and cpufreq enabled:
http://www.bigbridgezau.sakura.ne.jp/wiki....2F2008%2D3%2D21



Thanks for the great find ZDevil. I tried it on my c1000 and it resulted, as expected, in a kernel panic as it tries to load from hda1 ( i have my rootfs on sd).I just wish now some1 can do the same for us c1000 users! (auto boot rootfs from mmcblkp1 and supporting fastfpe and cpufreq). I really want to be able to overclock in debian specifically for compiling and/or installing software.

jocasmi
It's an interesting site.

Thanks
ZDevil
Just updated the first post with instructions to setting up dualbooting Sharp/Cacko and Debian. Have fun!
matthis
Thanks for the update!

2 Comments:
- is there a way to avoid re-installing sharp/cacko for those already using it?
- in the last section your explanation seems to mix cacko and pdaXrom together wink.gif

I can't wait to dualboot!
ZDevil
QUOTE(matthis @ Mar 26 2008, 11:29 PM) *
2 Comments:
- is there a way to avoid re-installing sharp/cacko for those already using it?
- in the last section your explanation seems to mix cacko and pdaXrom together wink.gif

Actually you don't have to reinstall sharp/cacko in NAND if they are already working. Just make sure the Debian rootfs is placed properly on the internal disk, and then reflash a kexec-friendly kernel for Debian (yonggun, angstrom, poky). Reboot, and you have a dualbooting setup.
btw what is mixed up and where? There are two separate sample scripts for booting pdaX and sharp/cacko. I've only updated the notes up to section 3. I am still having issues with accessing the NAND space in Debian (simply put, the mtd modules seem to handle NAND differently than then roms -- a partitioning issue? Also in Sharp/Cacko /dev/hda1 is mounted as read-only. Any solution?)
QUOTE
I can't wait to dualboot!

Of course! With sharp bootloader and kexec, the Z is now capable of juggling different distros with great ease. smile.gif
adf
Does anyone have cacko/debian dualbooting smoothly?
Any chance you could add a gmail with qtmail howto?
Really nice thread btw:)
ZDevil
Here is taken from my old notes on Sharp rom (hope it still works):

Adding Gmail support in qtmail:

#1 Install the stunnel package

#2 Edit /etc/inetd.conf. Add these two lines:
CODE
pop3 stream tcp nowait root /usr/sbin/tcpd /usr/sbin/stunnel -r pop.gmail.com:995 -c
smtp stream tcp nowait root /usr/sbin/tcpd /usr/sbin/stunnel -r smtp.gmail.com:465 -c

#3 Reboot

Or here: http://www.oesf.org/forum/index.php?showtopic=14283

===========
Back to the topic:
Debian/Cacko dualboots very smoothly. The two systems exist side by side and do not interfere with each other. A good alternative to the Pocketworkstation solution.
Still there is an issue to resolve: the two filesystems cannot access of each other. In debian there is a problem with mounting the jffs2 mtdblocks, and in sharp/cacko /dev/hda1 (where my debian rootfs is) is mounted as a read-only partition.
adf
QUOTE(ZDevil @ Mar 26 2008, 09:19 PM) *
Here is taken from my old notes on Sharp rom (hope it still works):

Adding Gmail support in qtmail:

#1 Install the stunnel package

#2 Edit /etc/inetd.conf. Add these two lines:
CODE
pop3 stream tcp nowait root /usr/sbin/tcpd /usr/sbin/stunnel -r pop.gmail.com:995 -c
smtp stream tcp nowait root /usr/sbin/tcpd /usr/sbin/stunnel -r smtp.gmail.com:465 -c

#3 Reboot

Or here: http://www.oesf.org/forum/index.php?showtopic=14283

===========
Back to the topic:
Debian/Cacko dualboots very smoothly. The two systems exist side by side and do not interfere with each other. A good alternative to the Pocketworkstation solution.
Still there is an issue to resolve: the two filesystems cannot access of each other. In debian there is a problem with mounting the jffs2 mtdblocks, and in sharp/cacko /dev/hda1 (where my debian rootfs is) is mounted as a read-only partition.

keep all your data on some additional extended partition accesable by both?
ZDevil
Actually it is pretty flexible to set up dualbooting like this.
For example, if you already have a working Sharp/Cacko or pdaXrom or Angstrom and do not want to fiddle with the partitions on the internal disk, you can choose to run debian on SD instead of the internal disk.
Things are even simpler in this case: just flash the yonggun kernel for booting from SD to make the debian rootfs on the SD the main system. Then use kexec or the attached booting scripts to boot the subsystems in NAND and on the internal disk. That should be a clean and safe way.
matthis
Woops sorry ZDevil, you hadn't mixed up anything unsure.gif
ZDevil
No worry. I just fear the notes may make more toasted penguins. Happy dualbooting! wink.gif
matthis
Alas, following your instructions with Sharp rom already installed gives me the usual:
"Warning: unable to open an initial console". and nothing more.
ZDevil
In which system do you get the error? Sharp or Debian?

If you get this when booting sharp rom, how about reflashing the sharp rom kernel first and let it boot once smoothly (can't think of any reason how this would fail), and then flash the debian kernel (provided that you have a debian system ready on the media)?
ZDevil
Hey, I've found the way to boot Cacko without the need for hdd1, hdd2 and hdd3.
So no more need to repartition the internal disk just for restoring Cacko in NAND.
Also now the whole Debian rootfs can be freely mounted and is entirely visible in Cacko.
ATM working on a script for the Cacko hack and will post here later.
speculatrix
QUOTE(ZDevil @ Mar 27 2008, 07:45 PM) *
Hey, I've found the way to boot Cacko without the need for hdd1, hdd2 and hdd3.
So no more need to repartition the internal disk just for restoring Cacko in NAND.
Also now the whole Debian rootfs can be freely mounted and is entirely visible in Cacko.
ATM working on a script for the Cacko hack and will post here later.


am looking forward to hearing more, dual-booting cacko and debian is my next project!
pelrun
Heh - triplebooting cacko/pdaxii/debian is on my list smile.gif

Matthis - The kernel you kexec with needs the partition info hardcoded into the boot string (mtdparts=blah) to work properly, otherwise the system only sees a very truncated (and hence corrupted) filesystem. I recompiled the pdaXrom kernel to match my NAND layout; you can do the same thing with the sharprom. EvilJazz's kernel tarball has a nice script which completely automates building all the 2.4 kernel variants.
matthis
QUOTE(pelrun @ Mar 27 2008, 05:41 PM) *
The kernel you kexec with needs the partition info hardcoded into the boot string (mtdparts=blah) to work properly, otherwise the system only sees a very truncated (and hence corrupted) filesystem. I recompiled the pdaXrom kernel to match my NAND layout; you can do the same thing with the sharprom. EvilJazz's kernel tarball has a nice script which completely automates building all the 2.4 kernel variants.


Thanks for your help. I was indeed trying to boot into sharprom with kexec. I will either try to compile the kernel or wait for a guru to do it rolleyes.gif
ZDevil
Just uploaded a new "Cacko HDD Fix" scriptpack, which will remove the HDD restriction on the internal disk, i.e. Cacko will run happily without caring about the HDD. wink.gif Please check out the first post (2.2.1).

I have tested the scriptpack a few times in my Cacko setup (3200). No problem found so far.

Have fun!
malik
did i get it right? i can keep my cacko installation and my hd partition and install
debian on sd, kexecuting cacko kernel from debian? will try this soon...

another question: is there a 2.4 kernel which supports kexec so that i can use
cacko/sharp as my main distribution and kexec debian and so on for testing?

thanx...
ZDevil
QUOTE(malik @ Mar 28 2008, 11:10 PM) *
did i get it right? i can keep my cacko installation and my hd partition and install
debian on sd, kexecuting cacko kernel from debian?

I think so. Simply put, there is no special installation apart from setting up each system separately and then flashing a kexec-capable kernel. Just reboot and kexec from there. If at some point you don't like this setup anymore, say you want to go back and stick with Sharp/Cacko rom only, then simply reflash the Sharp/Cacko kernel and that's it (no more kexec).
QUOTE
another question: is there a 2.4 kernel which supports kexec so that i can use
cacko/sharp as my main distribution and kexec debian and so on for testing?

afaik kexec is supported in kernel 2.6 but not 2.4.

In reality it doesn't make a big difference if you simply do dualbooting (such as Debian/Cacko), as long as either of them can use kexec.
The "catch" here, if i am forced to say, is you must boot into the kexec-ready rootfs in the very first boot after setting everything up. And a simple reboot will boot into this rootfs first. But rebooting is not absolutely necessary (and not a very cool thing to do) if things are running well.

Then each time you want to load the other system it's a (warm) reboot. So it's like:

-- (first boot) --> Debian -- (reboot with kexec) --> Cacko -- (normal reboot again) -- > Debian -- (reboot with kexec again) --> Cacko -- ...... ad infinitum

(Hope this doesn't sound too confusing tongue.gif )

(The great thing about the Zaurus is we seldom shut it down totally because it is instant-on/off. wink.gif )

Of course triple/multiple booting is a different story. A full "juggling" mode is to make each system accessible from one another:
e.g. a "perfect" triple booting = a<-->b; b<-->c; c<-->a

Altboot and uboot are great solutions to this. But at this stage only Angstrom has altboot. uboot is not widely supported (esp. in upstream). There are also some kind of pivot booting (like the OpenBSD/Cacko dualbooting hack), but it doesn't apply to many systems.
matthis
I was interested in kexec from 2.4 as well, there is a thread in this forum which seems to show it is possible.

http://www.oesf.org/forum/index.php?showtopic=18104

What do you think?
ZDevil
QUOTE(matthis @ Mar 29 2008, 01:21 AM) *
I was interested in kexec from 2.4 as well, there is a thread in this forum which seems to show it is possible.
http://www.oesf.org/forum/index.php?showtopic=18104
What do you think?

Hmm... very interesting (and very tempting too!) ... The discussion mentions corruption of the content in flash by the mtd modules in 2.6, which may explain the "incidence" my setup ran into some time ago when I tried to mount the partitions in flash in Debian.
I'll go remove the sections in the howto about accessing flash content in Debian.
Thanks for the pointer!
matthis
OK I wanted to try 2.4 kexec backport so I compiled the kexec.c provided in the above thread, using eviljazz kernel sources.
(I attach the result to this post.)

Alas, when running the provided bootlinux script, the kexec module seems to be properly loaded, but nothing happens at all! blink.gif
(I get no error messages either).
ecc_hy
The updater.sh is not suitable for C1000. You may use attach file which come from angstrom.
After install and set nand access, it corrupted my pdaxii13 root file.

To ZDevil:
Could you paste the content include how to access NAND? I need this to remove those modules and package.

Really like kexec for pdaxrom, pdaxii13 is more suitable for daily use. Debian need more test and adjust now.
ZDevil
@ecc_hy:
This confirms my fear. I also got my flash content corrupted after mounting it in Debian.
Originally I used "mount -t jffs2 /dev/mtdblock3 /mnt/nand" (mounting point can be anything) to mount the flash partition. There were lots of "Empty flash content at blahblahblah" messages throwing out on the screen... The flash area can still be mounted, but doing so it may have been corrupted...
I've removed the relevant parts from the howto. Sorry for the fuss. sad.gif

How to remove the kernel modules:
The easiest way is to use the modconf program. So first apt-get install modconf.
Run "modconf" from the terminal.
Scroll down the list and look for "kernel/drivers/mtd" and also "kernel/drivers/mtd/SOMETHING". There are a few entries of these.
Enter each of them and select all the modules and uninstall them (i.e. if there is a "+" sign beside the name of the module, select it means to remove it, the same procedure as installing it). This will remove all the mtd-related modules.
Check /etc/modules and delete any mtd entry there too.

I suppose this is not an issue of Debian itself, but the problem of the mtd kernel modules in general in kernel 2.6 and how they work on flash content.

The problem can be avoided if pdaXrom or pdaXii is installed on the internal disk or a SD card. (Is there anyway to do install Alice (or friends) without reformatting the internal disk, or to install the whole rootfs to SD?)

pdaXii is usable because of tons of heavy tweaks and hacks. Many of the tricks can be applied to Debian as well. smile.gif
malik
@matthis> did you make any progresses on this subject? i am a little bit confused as kexec for 2.4
seems to be a kernel module and for 2.6 a binary?! for the binary version you specify the kernel to
boot by a parameter committed , for the module version kexec expects the corresponding kernel with a
special name in the same directory, is it right? or do you have to copy the kernel into the same
directory before compiling the module? what about the mtd modules?

did anyone has success with sharp -> debian via kexec module?
matthis
About kexec for 2.4: no progress. This is how it works: loading the module creates a special file in /proc/kexec. Then the instructions are to: cat kernelImage > /proc/kexec.
But nothing happens.


EDIT!!!!! Almost there! The reason why it did not work was that the kexec module only works with a vmlinux image, and I was using the yonggun kernel which is a bz image. I have tried with a vmlinux from angstrom, and it did something -- though I immediatly got a kernel panic: "unable to mount root fs on unknown-block(3,1)".
glac
Hello all,

I have a "dualboot" configuration with Angstrom+Cacko that works well (apart from the packages that don't work well or don't work at all on Angstrom).
As Zdevil tested and stated, it's possible to kexec a Debian on a SD, then we can have Angstrom "kexecuting" Cacko on flash or Debian in the SD and Debian "kexecuting" Cacko on Flash. The only one that will not be "kexecuted" is Angstrom by Debian (that's not needed, you simply have to reboot).
Tonight I'll post the results of this three systems boot options.

Bye,

glac
speculatrix
QUOTE(glac @ Apr 7 2008, 06:12 PM) *
I have a "dualboot" configuration with Angstrom+Cacko that works well (apart from the packages that don't work well or don't work at all on Angstrom).
As Zdevil tested and stated, it's possible to kexec a Debian on a SD, then we can have Angstrom "kexecuting" Cacko on flash or Debian in the SD and Debian "kexecuting" Cacko on Flash. The only one that will not be "kexecuted" is Angstrom by Debian (that's not needed, you simply have to reboot).
Tonight I'll post the results of this three systems boot options.


phew! hopefully it'll be worth it in the end!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.