OESF Portables Forum

Everything Else => Zaurus Distro Support and Discussion => Distros, Development, and Model Specific Forums => Archived Forums => Debian => Topic started by: ZDevil on March 01, 2008, 11:51:20 am

Title: Dualbooting/multiplebooting With Kexec!
Post by: ZDevil on March 01, 2008, 11:51:20 am
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 (http://www.ibm.com/developerworks/linux/library/l-kexec.html).
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 (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: [Select]
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 (http://yonggun.tistory.com/68)
-- Extract to the root of the Debian rootfs: (while running the Debian main system)
Code: [Select]
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 (http://trisoft.de) (English version) or http://downloads.conics.net/pda/zaurus-sl-...iginal-backups/ (http://downloads.conics.net/pda/zaurus-sl-c700/service-menus/original-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/ (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/ (http://sharpromfeed.home.linuxtogo.org/download/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/ (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 (https://www.oesf.org/forum/index.php?act=attach&type=post&id=5405) 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:  [ You are not allowed to view attachments ]
-- hda2:  [ You are not allowed to view attachments ]
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=18523), https://www.oesf.org/forum/index.php?showtopic=20147 (https://www.oesf.org/forum/index.php?showtopic=20147)
-- Japanese support: https://www.oesf.org/forum/index.php?showto...30&start=30 (https://www.oesf.org/forum/index.php?showtopic=16808&st=30&start=30)
-- Meanies has created a lot of cool packages here: http://www.users.on.net/~hluc/myZaurus/ (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 (http://www.users.on.net/~hluc/myZaurus/pdaxii13.html)

-- Get the upgrade package from: http://www.tyrannozaurus.com/feed/pdaXii13...ii13-custom.tgz (http://www.tyrannozaurus.com/feed/pdaXii13/build/pdaXii13-custom.tgz)
-- Extract the tarball (anywhere you like, EXCEPT the root partition in pdaXrom because of not enough space)
Code: [Select]
zcat pdaXii13-custom.tgz | tar xvf - -C /ANYWHERE/YOU/LIKE-- Change to the "custom" directory in the extracted path
Code: [Select]
/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: [Select]
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) (https://www.oesf.org/forum/index.php?act=attach&type=post&id=5299) 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/ (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 (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  [ You are not allowed to view attachments ]  or
for C1000 only  [ You are not allowed to view attachments ]  
-- 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 (http://www.angstrom-distribution.org/unstable/armv5te/base/kexec-tools_1.101-r1_armv5te.ipk)
To install:
Code: [Select]
dpkg -i --force-architecture kexec-tools_1.101-r1_armv5te.ipkOR
My .deb package
 [ You are not allowed to view attachments ]
To install:
Code: [Select]
dpkg -i kexec-tools_20080227-1_armel.deb3.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  [ You are not allowed to view attachments ]  (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  [ You are not allowed to view attachments ]  (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: [Select]
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 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 https://www.oesf.org/forum/index.php?showtopic=18104 (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 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).

========================================================
[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 (https://www.oesf.org/forum/index.php?s=&showtopic=24550&view=findpost&p=166292), modifying mathemajikian's Cacko/OpenBSD dualbooting solution (https://www.oesf.org/forum/index.php?showtopic=21249#). 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!  
Title: Dualbooting/multiplebooting With Kexec!
Post by: urkden on March 01, 2008, 01:02:20 pm
Thank you very much for this HowTo. It's very clear and usefull so we can play a little more with our little toys.
Title: Dualbooting/multiplebooting With Kexec!
Post by: 2or0 on March 01, 2008, 05:22:48 pm
This is quite nice howto unlike mine.  
Title: Dualbooting/multiplebooting With Kexec!
Post by: pelrun on March 01, 2008, 06:47:54 pm
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: [Select]
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
Title: Dualbooting/multiplebooting With Kexec!
Post by: matthis on March 01, 2008, 07:49:05 pm
Thank you very much!

I tried this with Sharp rom on NAND, but it fails at boot with "unable to open initial console"
Title: Dualbooting/multiplebooting With Kexec!
Post by: ZDevil on March 01, 2008, 08:06:12 pm
Quote from: matthis
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?
Title: Dualbooting/multiplebooting With Kexec!
Post by: matthis on March 02, 2008, 12:19:49 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).
Title: Dualbooting/multiplebooting With Kexec!
Post by: pasteur on March 02, 2008, 03:16:13 am
does updater.sh attached work on c1000 too?
Title: Dualbooting/multiplebooting With Kexec!
Post by: ZDevil on March 02, 2008, 03:47:51 am
Quote from: pasteur
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 (http://yonggun.tistory.com/66)
Title: Dualbooting/multiplebooting With Kexec!
Post by: ZDevil on March 02, 2008, 04:05:34 am
@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...) !!
Title: Dualbooting/multiplebooting With Kexec!
Post by: pasteur on March 02, 2008, 04:05:54 am
Quote from: ZDevil
Quote from: pasteur
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 (http://yonggun.tistory.com/66)
Thank you for the advice. It WORKS PERFECT!!
Title: Dualbooting/multiplebooting With Kexec!
Post by: ZDevil on March 02, 2008, 05:31:35 am
Quote from: 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: [Select]
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 (http://forums.debian.net/viewtopic.php?p=64051&sid=9cec6711ed62d3ed34704fd8a7f46ca3)

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 from: pelrun
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
Looking forward to that!  
Title: Dualbooting/multiplebooting With Kexec!
Post by: ZDevil on March 02, 2008, 06:31:38 am
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.
Title: Dualbooting/multiplebooting With Kexec!
Post by: Snappy on March 02, 2008, 06:58:15 am
Quote from: pasteur
Quote from: ZDevil
Quote from: pasteur
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 (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?
Title: Dualbooting/multiplebooting With Kexec!
Post by: ZDevil on March 05, 2008, 04:32:28 am
Quote from: 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).
Hmm. Do you think it is feasible to tweak Cacko/Sharp roms to ignore the HDDs thing?
I've started a topic here: https://www.oesf.org/forum/index.php?showtopic=25565 (https://www.oesf.org/forum/index.php?showtopic=25565)
Any insight will be great!
Title: Dualbooting/multiplebooting With Kexec!
Post by: pasteur on March 05, 2008, 10:06:30 am
Quote from: Snappy
Quote from: pasteur
Quote from: ZDevil
Quote from: pasteur
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 (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?


pdaXromb3 on Nand, debian 2.6.24 on 4GB SD partitioned into two partition (95% ext3 5% swap)
Title: Dualbooting/multiplebooting With Kexec!
Post by: ZDevil on March 07, 2008, 05:49:47 pm
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?
Title: Dualbooting/multiplebooting With Kexec!
Post by: matthis on March 13, 2008, 08:05:39 am
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?
Title: Dualbooting/multiplebooting With Kexec!
Post by: ZDevil on March 23, 2008, 07:55:47 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?
Title: Dualbooting/multiplebooting With Kexec!
Post by: 2or0 on March 23, 2008, 11:06:38 am
Quote from: 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?

I think it is possible to boot /dev/hda3 if the option is properly given before building the kernel.  
Title: Dualbooting/multiplebooting With Kexec!
Post by: ZDevil on March 23, 2008, 11:36:12 am
So will there be new yonggun kernels for this?  
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 (http://www.bigbridgezau.sakura.ne.jp/wiki.cgi?page=%C6%FC%B5%AD%C9%BD%2F2008%2D3%2D21)
Title: Dualbooting/multiplebooting With Kexec!
Post by: born2wonder on March 23, 2008, 01:37:28 pm
Quote from: ZDevil
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 (http://www.bigbridgezau.sakura.ne.jp/wiki.cgi?page=%C6%FC%B5%AD%C9%BD%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.
Title: Dualbooting/multiplebooting With Kexec!
Post by: jocasmi on March 24, 2008, 05:57:19 pm
It's an interesting site.

Thanks
Title: Dualbooting/multiplebooting With Kexec!
Post by: ZDevil on March 26, 2008, 06:06:37 pm
Just updated the first post with instructions to setting up dualbooting Sharp/Cacko and Debian. Have fun!
Title: Dualbooting/multiplebooting With Kexec!
Post by: matthis on March 26, 2008, 06:29:03 pm
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  

I can't wait to dualboot!
Title: Dualbooting/multiplebooting With Kexec!
Post by: ZDevil on March 26, 2008, 06:57:58 pm
Quote from: matthis
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  
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.  
Title: Dualbooting/multiplebooting With Kexec!
Post by: adf on March 26, 2008, 10:01:33 pm
Does anyone have cacko/debian dualbooting smoothly?
Any chance you could add a gmail with qtmail howto?
Really nice thread btw:)
Title: Dualbooting/multiplebooting With Kexec!
Post by: ZDevil on March 27, 2008, 01:19:15 am
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: [Select]
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: https://www.oesf.org/forum/index.php?showtopic=14283 (https://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.
Title: Dualbooting/multiplebooting With Kexec!
Post by: adf on March 27, 2008, 02:40:01 am
Quote from: 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: [Select]
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: https://www.oesf.org/forum/index.php?showtopic=14283 (https://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?
Title: Dualbooting/multiplebooting With Kexec!
Post by: ZDevil on March 27, 2008, 04:50:05 am
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.
Title: Dualbooting/multiplebooting With Kexec!
Post by: matthis on March 27, 2008, 05:13:18 am
Woops sorry ZDevil, you hadn't mixed up anything  
Title: Dualbooting/multiplebooting With Kexec!
Post by: ZDevil on March 27, 2008, 05:42:22 am
No worry. I just fear the notes may make more toasted penguins. Happy dualbooting!
Title: Dualbooting/multiplebooting With Kexec!
Post by: matthis on March 27, 2008, 06:07:15 am
Alas, following your instructions with Sharp rom already installed gives me the usual:
"Warning: unable to open an initial console". and nothing more.
Title: Dualbooting/multiplebooting With Kexec!
Post by: ZDevil on March 27, 2008, 06:17:41 am
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)?
Title: Dualbooting/multiplebooting With Kexec!
Post by: ZDevil on March 27, 2008, 03:45:50 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.
Title: Dualbooting/multiplebooting With Kexec!
Post by: speculatrix on March 27, 2008, 07:49:20 pm
Quote from: 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.

am looking forward to hearing more, dual-booting cacko and debian is my next project!
Title: Dualbooting/multiplebooting With Kexec!
Post by: pelrun on March 27, 2008, 09:41:38 pm
Heh - triplebooting cacko/pdaxii/debian is on my list

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.
Title: Dualbooting/multiplebooting With Kexec!
Post by: matthis on March 28, 2008, 05:06:37 am
Quote from: pelrun
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  
Title: Dualbooting/multiplebooting With Kexec!
Post by: ZDevil on March 28, 2008, 12:26:48 pm
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.     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!
Title: Dualbooting/multiplebooting With Kexec!
Post by: malik on March 28, 2008, 06:10:12 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? 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...
Title: Dualbooting/multiplebooting With Kexec!
Post by: ZDevil on March 28, 2008, 06:39:59 pm
Quote from: 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?
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  )

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

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.
Title: Dualbooting/multiplebooting With Kexec!
Post by: matthis on March 28, 2008, 08:21:44 pm
I was interested in kexec from 2.4 as well, there is a thread in this forum which seems to show it is possible.

https://www.oesf.org/forum/index.php?showtopic=18104 (https://www.oesf.org/forum/index.php?showtopic=18104)

What do you think?
Title: Dualbooting/multiplebooting With Kexec!
Post by: ZDevil on March 28, 2008, 08:41:38 pm
Quote from: 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.
https://www.oesf.org/forum/index.php?showtopic=18104 (https://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!
Title: Dualbooting/multiplebooting With Kexec!
Post by: matthis on March 28, 2008, 10:07:27 pm
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!  
(I get no error messages either).
Title: Dualbooting/multiplebooting With Kexec!
Post by: ecc_hy on March 28, 2008, 11:32:17 pm
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.
Title: Dualbooting/multiplebooting With Kexec!
Post by: ZDevil on March 29, 2008, 02:34:47 am
@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.  

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.  
Title: Dualbooting/multiplebooting With Kexec!
Post by: malik on April 05, 2008, 05:24:19 am
@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?
Title: Dualbooting/multiplebooting With Kexec!
Post by: matthis on April 05, 2008, 10:05:06 am
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)".
Title: Dualbooting/multiplebooting With Kexec!
Post by: glac on April 07, 2008, 01:12:35 pm
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
Title: Dualbooting/multiplebooting With Kexec!
Post by: speculatrix on April 07, 2008, 04:00:10 pm
Quote from: glac
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!
Title: Dualbooting/multiplebooting With Kexec!
Post by: glac on April 07, 2008, 11:00:53 pm
Hello all,

No problems "kexecuting" Debian under Angstrom. Network and all worked fine (made an apt-get update to test it). Installed kexec-tools from Zdevil and made an "kexec -f zImage" (from the Cacko kernel) and it worked. How do I configure reboot on Debian to reboot in the clean way to Cacko?

Now we can have three working systems on the same Zaurus (mine is a SL-C3200)!!!

If someone wants the specs of the system to try, please ask.I can make a short tutorial for Zdevil to update the first post. What do you think?

Best regards,

glac

PS.: We could set the SD slot free for Debian if we use the youngun kernel for hda4 (to do so we would have to set the swap to an extended partition). Just an idea.
Title: Dualbooting/multiplebooting With Kexec!
Post by: ZDevil on April 08, 2008, 03:05:07 am
Quote from: glac
No problems "kexecuting" Debian under Angstrom. Network and all worked fine (made an apt-get update to test it). Installed kexec-tools from Zdevil and made an "kexec -f zImage" (from the Cacko kernel) and it worked. How do I configure reboot on Debian to reboot in the clean way to Cacko?
Congrats. I know dualbooting Debian/Angstrom works as it has been working on my C860.  
I have made a small hack to free Cacko from looking for hdd1/hdd2/hdd3 during booting. With this Cacko purely lives on NAND, and Debian and Cacko are independent of each other.   https://www.oesf.org/forum/index.php?showtopic=25565 (https://www.oesf.org/forum/index.php?showtopic=25565)
Quote
Now we can have three working systems on the same Zaurus (mine is a SL-C3200)!!!
Exactly. To me having the freedom and flexibility to switch to different working systems on the fly is the dream state of the Z.
Quote
If someone wants the specs of the system to try, please ask.I can make a short tutorial for Zdevil to update the first post. What do you think?
Yes, please do. I will add your section to the first post.  
Title: Dualbooting/multiplebooting With Kexec!
Post by: speculatrix on April 10, 2008, 06:51:30 pm
Quote from: matthis
Alas, following your instructions with Sharp rom already installed gives me the usual:
"Warning: unable to open an initial console". and nothing more.

I too have got this problem.
I started with a  totally clean cacko install, did the no-hd-require patch, installed the katastrophos kernel and modules and cacko worked fine.
I then repartitioned the HDD into 3 parts, 1 being a 3.25G partition ext3, 2 being 256MB swap, and 3 being 512MB of fat16 for compatibility/hacking. I unpacked into hdd1 the debian-eabi tarball, copied in the new yonggun kernel 2.6.24.3 modules, copied in under a different name the cacko/sharp katastrophos kernel. Everything looked cool. Then I flashed the yonggun 2.6.24 kernel using kat's updater.sh.

When the debian yonggun kernel boots, there's lot of text, I can't scroll back.  The last few lines are (abbreviated as I'm lazy):
kjournald starting, commit interval 5 seconds
EXT3 FS on hda1, internal journal
EXT3-fs: recovery complete
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem).
Freeing init memory: 76K
Warning: unable to open an initial console.

I can suspend and resume, but nothing else has any effect!

Any suggestions how to fix it? Meanwhile, I'm reflashing katastrophos's sharp-compat kernel.
--edit-- OK, I'm back with working cacko, so that's good!
--edit2-- just checked, I'm not mad, I did unpack the debian kernel modules, so I wonder what went wrong.
--edit3-- ok, I am mad, I just reflashed the debian kernel, booted, and got a prompt. maybe because I left the CF memory card in? BTW, I note that if I leave my 4GB sd card in when I do the reset-OK-4 to flash, the Z says bad CF card.
--edit4-- ok, so what's the root password.... hmmm... ah, it's "zaurus"!
--edit5-- kexec stuff seemed to work, cacko kernel starts, but then the kernel panics. hmm.
Title: Dualbooting/multiplebooting With Kexec!
Post by: matthis on April 12, 2008, 12:41:38 am
Just out of curiosity and complete lack of knowledge: couldn't the booting scripts used for OpenBSD/Cacko dualboot be used for debian/cacko ? I like the way you get to choose at boot.
Title: Dualbooting/multiplebooting With Kexec!
Post by: speculatrix on April 12, 2008, 03:48:43 pm
can any suggest anything I can try to stop cacko kernel panic when it starts up? Before I flashed yonggun's kernel (which works to boot debian) cacko was working just fine.
Title: Dualbooting/multiplebooting With Kexec!
Post by: ZDevil on April 13, 2008, 04:32:57 am
Quote from: speculatrix
can any suggest anything I can try to stop cacko kernel panic when it starts up? Before I flashed yonggun's kernel (which works to boot debian) cacko was working just fine.
Just wonder if you can:
1) Reflash cacko kernel, preferably eviljazz's smoothie one?  http://www.katastrophos.net/zaurus/kernels/current/ (http://www.katastrophos.net/zaurus/kernels/current/)
And then boot up the system once.
2) Reflash yonggun kernel for sharp bootloader (be careful about the different flavors)  http://yonggun.tistory.com/68 (http://yonggun.tistory.com/68)
3) Boot into Debian
4) Boot into Cacko using kexec

... And the last resort: NAND restore -> Steps 1-4.  This *should* work.

Can't help much here, because amazingly I've never run into any Cacko kernel panic scenario
Title: Dualbooting/multiplebooting With Kexec!
Post by: ZDevil on April 13, 2008, 04:34:33 am
I'm still trying to figure out why from time to time my setup fails to kexec into another Debian rootfs on SD.
But it doesn't really hurt. Actually a much easier way for me to test stuff in the sandbox is simply by chrooting into the rootfs on SD.... and it works.
Title: Dualbooting/multiplebooting With Kexec!
Post by: same on May 15, 2008, 06:45:34 am
the quick way to dual boot debian (SD) and pdaxrom (HD) WITHOUT losing pdaxrom installation and sharing the swap partition

0) pdaxrom already installed in hd
1) prepare a SD with one partition (no swap) for debian rootfs and all
2) edit fstab of /sd/etc/fstab and:
  use the root of SD for debian root /
  and swap of already existing partition from /dev/hd2 (pdaxrom swap)

Problem: I was using katastrophos kernel (fastfpe), but the dualbooting with kexec gives me "kernel panic: no init found" when booting pdaxrom

Solution: use the pdaxrom kernel specified in the first post.

loads of thanx, amazingly easy!

EDIT: it's a bit confusing when reading, here is the debian fstab
Code: [Select]
#Debian on SD with one partition
/dev/mmcblk0p1    /        ext3    rw        1  1

#We share the SWAP partition of pdaxrom in the internal HD
/dev/hda2    /none        swap    sw        0  0

#We mount pdaxrom fakeroot (mkdir /pdaxrom)
/dev/hda1    /pdaxrom        ext3    rw        1  1

#Mount the VFAT partition /data (mkdir /data)
/dev/hda3    /data        vfat    rw        1  1


## Other essential mount points. You don't need to touch them.
proc        /proc        proc    defaults    0  0    
sysfs        /sys        sysfs    defaults    0  0
Title: Dualbooting/multiplebooting With Kexec!
Post by: pasteur on May 23, 2008, 01:17:11 pm
In pdaxrom, Is it possible to allocate the whole 121MB of NAND space as / on C1000?

I've tried it with eviljazz's kernel but failed.
Title: Dualbooting/multiplebooting With Kexec!
Post by: Capn_Fish on May 23, 2008, 01:24:57 pm
Which version? You can use the beta 3 flasher to resize it, than install r198, if that's what you're trying to do.
Title: Dualbooting/multiplebooting With Kexec!
Post by: pasteur on May 24, 2008, 06:05:56 am
Quote from: Capn_Fish
Which version? You can use the beta 3 flasher to resize it, than install r198, if that's what you're trying to do.

BETA3.
(I just wanted to install apps at /)

Reading your quote I am interested in flashing r198.
Can I use both r198 and debian with kexec?
Title: Dualbooting/multiplebooting With Kexec!
Post by: matthis on May 24, 2008, 11:30:04 pm
I just tried cackofix0.2 and can't reboot sharprom anymore... looks bad!!

/root/.dev/_default.tar.gz: No such file or directory
mount: Could not find a spare loop device
mount: Mounting /dev/mtdblock3 on /home failed: No such file or directory
/etc/rc.d/rc.sysinit: /etc/ledmode: No such file or directory

and errors go on... what's the problem with loop device??

thanks

EDIT: I did the whole install.sh script backwards, putting back the original files and moving back the moved files etc... looks like I'm back to normal!!

I guess I'll do without the cackofix for now...
Title: Dualbooting/multiplebooting With Kexec!
Post by: linx on May 28, 2008, 06:16:45 pm
Hello there I just tried to get my dualbooting zaurus up and working with Debian on Internal Disk and Cacko in NAND. I got a full working Cacko system I applied the patch for the hdd requirement and everything seemed to be ok even after I flashed eviljazz's better kernel. ( I couldn't make my wireless card to work but that's another issue) Then I fdisked my internal drive to a 5.7GB hda1 partition and the rest of the microdrive as swap. I put on hda1 the debian eabi rootfs of the other topic installed everything and then flashed with yonggun's latest 2.6.24.4 kernel with the updater.sh on the post from ZDevil. When I rebooted I had a problem loading Debian something about not mounting root filesystem properly then I tried fdisking again untaring again the debian eabi and this time I flashed yonggun's kernel with the angstorm updater.sh and gnu-tar. Everything worked alright I logged into Debian. I couldnt get the wifi network card working there either (I insert it i see those messages but there is no light blinking or anything, it's like it doesn't want to try to connect) anyway. I installed kexec-tools.deb and it asked me if i wanted to kexec a particular kernel at boot and I chose "0" no (not sure if i did the right thing) then I run the script after i put it and the eviljazz's kernel renamed to "sharp_zImage.bin" in the home folder...everything seems to run alright but when it goes rebooting it starts loading Cacko but  says something like:

lnode #<random number> was a directory with children - removing those too...
.
.
<a bunch of those messages with different numbers each time>
.
VFS: Mounted root (jffs2 filesystem) readonly
Freeing init memory: 84K
Kernel panic: No init found. Try passing init= option to kernel.

and that's it just stays there. I don't remember if i got these messages when i only had cacko installed, i think not. Any ideas what that is or what it may mean or how to solve it?
Since my debian install seems to be working properly. what can i do with the NAND if there is no easy solution to that problem? Just leave it like that?
Thank you very much in advance and sorry for the length of the post.
PS: I had that problem with "initial console" so I did something like MAKEDEV console and everything was ok after that.
PS2: btw that tune2fs command for journalising ext2 didn't work on my zaurus it just complained that tune2fs was not found.
Title: Dualbooting/multiplebooting With Kexec!
Post by: AltairTK on June 12, 2008, 10:54:15 am
Hello, i have a little problem with this procedure on Zaurus C1000.
I have install the latest Cacko 1.23 and upgraded Kernel.
I have a Debian EABI customized (named Andromeda http://yonggun.tistory.com/77) (http://yonggun.tistory.com/77)) rootfs in the SD card which use a 2.6.24-4 yonggun Kernel and modules.
I follow the instructions for Cacko, sizing partition in NAND to 32Mb and, after flash, it's boot with any problems.
I flash yonggun Kernel 2.6.24-4 with your updater.sh (for C1000 only) and Debian boot...
The "Andromeda" have just included kexec. I have copy Cacko kernel into /boot directory, renamed cacko-zImage.bin and gave the commands:
kexec -u
kexec -l /boot/cacko-zImage.bin
kexec -e

Kernel start....but at the moment there are "2 milions"    of errors and terminate with a Kernel Panic: Attempted to kill init!
Where I wrong?
The procedure is not compatible with kernel 2.6.24-4?

I thank you for your help !
Title: Dualbooting/multiplebooting With Kexec!
Post by: xamindar on July 03, 2008, 08:06:43 am
Anyone still do this?

I tried following "2.1.2 Remove the required disk partitioning setting" and ended up with an unbootable system.  
I flashed the NAND of the japanese sharp rom
Then booted into the emergency D+B menu and ran the cackofix script.
Rebooted, and nothing.....just the startup screen staying there forever.

Does anyone know what I did wrong? I did this with a fresh nand of the japanese sharp rom so there shouldn't be anything wrong with it. Is this script really made for cacko and sharp rom?

I then flashed the tetsu kernel to see where it stops at and it gives a bunch of errors complaining about not finding a spare loop device, can't find /etc/ledmode, a bunch of /etc/rc.d/rc.sysinit missing files, and can't even find /etc/fstab! What in the world happened? Looks like that cackofix script erased a lot of important system files?
Title: Dualbooting/multiplebooting With Kexec!
Post by: nickk9 on July 13, 2008, 05:17:32 am
I have the same problem as linx has.  But i have C1000, installed andromeda rootfs on SD and younggun's SD booting kernel over the working cacko in NAND. And have 'Kernel panic: No init found. Try passing init= option to kernel.' and the end of CACKO booting with kexec -e.
Title: Dualbooting/multiplebooting With Kexec!
Post by: xamindar on July 14, 2008, 07:14:22 pm
Ok, I have a working debian system on my internal hard drive.
I also have a working sharp rom on NAND and I can boot to either one by flashing the apropriate kernel.

But I can NOT get kexec to work at all. When I launch the boot_sharp.sh  I get the initial sharp kernel starting to boot....then I get a lot of
"Child dir [random characters here] (ino #3374) of ino #3248 appears to be a hard link" with different ino numbers and then it spits out
"sh: can't access tty: job control turned off" and drops me to what looks like the emergency console of the sharp rom.

Anyone know what the issue is?  Has anyone even been successful booting the sharp rom with kexec? I don't see any success stories in here. Please help if you can, I am so close.
Title: Dualbooting/multiplebooting With Kexec!
Post by: pelrun on July 15, 2008, 02:44:19 am
The solution is exactly the same as for my pdaxrom kexec fix - you need to recompile the sharprom kernel with the correct NAND layout information hardcoded in it, otherwise it only sees a truncated filesystem.
Title: Dualbooting/multiplebooting With Kexec!
Post by: matthis on July 15, 2008, 03:36:54 am
@Pelrun

Could you explain this in more detail please?
I would be happy to build a kexec-ready sharprom kernel. I tried before but didn't know where/what to alter.

Thanks in advance.


Matthis
Title: Dualbooting/multiplebooting With Kexec!
Post by: xamindar on July 15, 2008, 03:56:54 am
Quote from: pelrun
The solution is exactly the same as for my pdaxrom kexec fix - you need to recompile the sharprom kernel with the correct NAND layout information hardcoded in it, otherwise it only sees a truncated filesystem.

Hmm, ok. Wonder why that info wasn't included in the howto. Seems like pretty important info. Thanks.
Anyone know if such a kernel exists? Or do I need to compile my own?
I was trying it with the tetsu kernel which I have really grown to love with all its nice tweeks. I wonder if the stock sharp kernel works - hence this issue not being mentioned in the howto.
Title: Dualbooting/multiplebooting With Kexec!
Post by: matthis on July 15, 2008, 09:25:58 pm
OK, I found the way to go! Thanks Pelrun for the hint!! Only the boot params needed to be changed, so it was rather easy.

Since this topic is rather long I started a new one. Feel free to move it back here if necessary:

Kexec how-to really working: : see https://www.oesf.org/forum/index.php?showtopic=25983 (https://www.oesf.org/forum/index.php?showtopic=25983)
Title: Dualbooting/multiplebooting With Kexec!
Post by: gojira on December 13, 2008, 02:55:05 am
Quote from: 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: [Select]
kexec -l PDAXROMIMAGE
reboot
Debian will shut down, and the system will restart into pdaXrom.

kexec-tools includes /etc/rc6.d/S85kexec, so now all you have to do is kexec -l then shutdown -r

Quote from: ZDevil
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 (http://forums.debian.net/viewtopic.php?p=64051&sid=9cec6711ed62d3ed34704fd8a7f46ca3)

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.

now you have kexec-tools you don't need that script at all (or just change it to "kexec -l /boot/zImage.whatever && shutdown -r now"