Author Topic: Dualbooting/multiplebooting With Kexec!  (Read 73116 times)

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Dualbooting/multiplebooting With Kexec!
« Reply #45 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.  

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

malik

  • Full Member
  • ***
  • Posts: 149
    • View Profile
Dualbooting/multiplebooting With Kexec!
« Reply #46 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?
borzoi, cacko 1.23 lite, 1gb kingston cf, 512mb toshiba sd.. suse 10.0

matthis

  • Full Member
  • ***
  • Posts: 217
    • View Profile
    • http://badaboum.bidibom.free.fr/mat/
Dualbooting/multiplebooting With Kexec!
« Reply #47 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)".
« Last Edit: April 06, 2008, 08:26:00 am by matthis »

glac

  • Newbie
  • *
  • Posts: 17
    • View Profile
Dualbooting/multiplebooting With Kexec!
« Reply #48 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

speculatrix

  • Administrator
  • Hero Member
  • *****
  • Posts: 3706
    • View Profile
Dualbooting/multiplebooting With Kexec!
« Reply #49 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!
Gemini 4G/Wi-Fi owner, formerly zaurus C3100 and 860 owner; also owner of an HTC Doubleshot, a Zaurus-like phone.

glac

  • Newbie
  • *
  • Posts: 17
    • View Profile
Dualbooting/multiplebooting With Kexec!
« Reply #50 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.
« Last Edit: April 07, 2008, 11:04:24 pm by glac »

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Dualbooting/multiplebooting With Kexec!
« Reply #51 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
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.  

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

speculatrix

  • Administrator
  • Hero Member
  • *****
  • Posts: 3706
    • View Profile
Dualbooting/multiplebooting With Kexec!
« Reply #52 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.
« Last Edit: April 11, 2008, 03:15:14 am by speculatrix »
Gemini 4G/Wi-Fi owner, formerly zaurus C3100 and 860 owner; also owner of an HTC Doubleshot, a Zaurus-like phone.

matthis

  • Full Member
  • ***
  • Posts: 217
    • View Profile
    • http://badaboum.bidibom.free.fr/mat/
Dualbooting/multiplebooting With Kexec!
« Reply #53 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.

speculatrix

  • Administrator
  • Hero Member
  • *****
  • Posts: 3706
    • View Profile
Dualbooting/multiplebooting With Kexec!
« Reply #54 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.
Gemini 4G/Wi-Fi owner, formerly zaurus C3100 and 860 owner; also owner of an HTC Doubleshot, a Zaurus-like phone.

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Dualbooting/multiplebooting With Kexec!
« Reply #55 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/
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
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
« Last Edit: April 13, 2008, 02:13:49 pm by ZDevil »

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Dualbooting/multiplebooting With Kexec!
« Reply #56 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.
« Last Edit: April 13, 2008, 04:54:50 am by ZDevil »

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

same

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Dualbooting/multiplebooting With Kexec!
« Reply #57 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
« Last Edit: May 15, 2008, 06:55:52 am by same »
pdaXii13 5.4.9 (HD) Ubuntu Jaunty 9.04 + 2.6.24.4-yonggun (cpufreq with dvfm) (SDHC) 3200

pasteur

  • Newbie
  • *
  • Posts: 18
    • View Profile
Dualbooting/multiplebooting With Kexec!
« Reply #58 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.
c1000 with debian eabi

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
Dualbooting/multiplebooting With Kexec!
« Reply #59 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.
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo