Help - Search - Members - Calendar
Full Version: Kexec From Debian To Sharprom, Really Working How-to!
OESF Forums > Distros, Development, and Model Specific Forums > Distro Support and Discussion > Debian
matthis
Hello, I was frustrated about not being able to kexec successfully into sharprom, but frustration is over!!
Following Pelrun's hint that the NAND partition layout had to be hardcoded, I recompiled eviljazz's kernel passing the necessary argument to the kernel, and now using this kernel for kexec the dreaded: "unable to open initial console" is GONE!!"

How-to


1. On your Z
Boot into the sharprom using your usual kernel, check the file /var/log/dmesg and find the line which contains this:
mtdparts=sharpsl-nand:7168k@0k(smf),44032k@7168k(root),-(home) jffs2_orphaned_inodes=delete EQUIPMENT=5 LOGOLAND=1 DEFYEAR=2008 LOGO=1 LAUNCH=q
(Your values for sharpsl-nand may vary, and this is why you need to build your own kernel)

2. On your linux Desktop:
- download eviljazz's toolchain http://katastrophos.net/zaurus/kernels/com...1.09.05.tar.bz2
- download eviljazz's kernel tarball http://katastrophos.net/zaurus/kernels/cur....20-v55.tar.bz2

- Follow the instructions in the kernel tarball's README, but after executing "make oldconfig", do "make menuconfig".
In there, go to General Setup, and scroll down until you find the place to edit kernel arguments. By default, they should be: "console=ttyS0 root=/dev/mtdblock2"
Select that, and add the line you have noted on your Z earlier, so that the boot param becomes:
console=ttyS0 root=/dev/mtdblock2 mtdparts=sharpsl-nand:7168k@0k(smf),44032k@7168k(root),-(home) jffs2_orphaned_inodes=delete EQUIPMENT=5 LOGOLAND=1 DEFYEAR=2008 LOGO=1 LAUNCH=q
(Again, with your values for sharpsl-nand)

Go on with "make dep" and "make zImage", the resulting zImage will work for kexecing to sharprom!
xamindar
Here is my kernel line from the sharp rom on my 3100. Just in case anyone wants to know. Looks like I will need to compile my own kernel too.

CODE
Kernel command line: console=ttyS0 root=/dev/mtdblock2 mtdparts=sharpsl-nand:7168k@0k(smf),32768k@7168k(root),-(home) jffs2_orphaned_inodes=delete EQUIPMENT=4 LOGOLANG=1 DEFYEAR=2006 LOGO=1 LAUNCH=q


wow, it did work! woohoo. In case someone wants to try (this c3100 kernel is probably the same on other c3100 I would imagine). Here is the kernel I compiled.
maemorandum
QUOTE(matthis @ Jul 16 2008, 02:22 AM) *
Following Pelrun's hint that the NAND partition layout had to be hardcoded, I recompiled eviljazz's kernel passing the necessary argument to the kernel, and now using this kernel for kexec the dreaded: "unable to open initial console" is GONE!!"


Thank you, matthis. Following your guide, i got a working sharp-rom zimage for dualbooting!
But, i need the cacko-rom one instead of the sharp one.

So, is there an instruction to get a "hardcoded" cacko-zImage (C1000/C3200)?
xamindar
QUOTE(maemorandum @ Nov 13 2008, 01:34 AM) *
But, i need the cacko-rom one instead of the sharp one.

So, is there an instruction to get a "hardcoded" cacko-zImage (C1000/C3200)?

I don't get it. Is there some special cacko kernel that you were using before? The kernel should work on both cacko and sharp rom as they use the same kernel anyway. Please explain why these instructions didn't work for you.
maemorandum
using a c1000:

1. I prepared a sd-card with the zaurus_eabi_rootfs_071201.tar.bz2 and the 2.6.24.3-yonggun kernel modules and checked fstab, depmod hwclock.

2. I made a trisoft sharp nand restore from cf-card

3. I started the sharp-rom and noticed the mtdparts=sharpsl-nand command

4. I installed the http://katastrophos.net/zaurus/kernels/com...1.09.05.tar.bz2 and the eviljazz's kernel tarball and compiled the kernel with the new noticed line

5. I copied the zImage.bin.sd1 and the updater.sh for the C1000 on a cf-card and did the yonggun kernel installation for the sharp bootloader

6. I booted into debian from the inserted sd-card without problems, installed the kexec package and placed the compiled zimage and sharp-bootloader-script into the /root directory.

7. I started the script and the C1000 perfectly boots into the sharp-rom. (Dualbooting eabi-sharprom)

-----------------------------------------------------------------------------------------------------------------

In order to boot into cacko i installed the cacko-light rom with 19 MB resize (flash-utility) and eviljazz kernel update fastfpe. Then i went on with number 5. Unfortunately the booting of the cacko started and failed with the old "initial console" error.

Did it once more with the original cacko-light rom with 19 MB resize without kernel update. This ended in a
CODE
Kernel panic: Attempted to kill init!
too.
xamindar
Did you recheck your step 3 after flashing cacko? It might be different so you would need to recompile a new kernel.
maemorandum
QUOTE(xamindar @ Nov 17 2008, 10:15 AM) *
Did you recheck your step 3 after flashing cacko? It might be different so you would need to recompile a new kernel.


Thank you, xamindar. I forgot to use the cacko-specific parameters. Now, finally, it works! smile.gif
gojira
QUOTE(matthis @ Jul 16 2008, 12:22 PM) *
Hello, I was frustrated about not being able to kexec successfully into sharprom, but frustration is over!!
Following Pelrun's hint that the NAND partition layout had to be hardcoded, I recompiled eviljazz's kernel passing the necessary argument to the kernel, and now using this kernel for kexec the dreaded: "unable to open initial console" is GONE!!"


couldn't this be done just by passing the options with 'kexec --append=' ?

QUOTE(matthis @ Jul 16 2008, 12:22 PM) *
PS: If you have exactly the same values for sharpsl-nand, then you may want to try the kernel image I have built., to save compiling time wink.gif
http://web.mita.keio.ac.jp/~mh070504/sharp-zImage.bin
I am using SL-C3200 and I doubt the values are the same for other models, so be careful. Other SL-C3200 may also be different, depending on whether they use sharp/cacko/trisoft-sharp roms, etc... so check sharpsl-nand values!


and if not, is that kernel still available somewhere?
pelrun
QUOTE(gojira @ Dec 10 2008, 11:58 PM) *
couldn't this be done just by passing the options with 'kexec --append=' ?


It would have been easier that way - pity it simply doesn't work.
gojira
QUOTE(pelrun @ Dec 11 2008, 01:10 AM) *
It would have been easier that way - pity it simply doesn't work.


bugger! I guess it's a deficiency in kexec on arm then, cos the args must be being passed by the usual bootloader if they're not already in the kernel? does anyone have a 3200 kernel available as the one above is gone now? thanks!
ant
>It would have been easier that way - pity it simply doesn't work.

FYI we almost have a solution for the mtdparts string: using the linux-kexecboot kernel as second stage bootloader we parse the mtdparts passed by the (broken) Zaurus bootloader reading /proc/cmdline.

And in case you use u-boot and custom partitioning sizes, well, these are the passed to the kexecbooted kernel.
This way you don't need to hardcode these in cmdline.

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

Ant


Ref: http://projects.linuxtogo.org/pipermail/op...ber/018129.html
gojira
QUOTE(matthis @ Jul 16 2008, 12:22 PM) *
Boot into the sharprom using your usual kernel, check the file /var/log/dmesg and find the line which contains this:
mtdparts=sharpsl-nand:7168k@0k(smf),44032k@7168k(root),-(home) jffs2_orphaned_inodes=delete EQUIPMENT=5 LOGOLAND=1 DEFYEAR=2008 LOGO=1 LAUNCH=q


that wasn't in my dmesg, but the best place to get it is /proc/cmdline anyway. also, that should be LOGOLANG not LOGOLAND... I just built a 3200 kernel, here it is:Click to view attachment

gojira
QUOTE(gojira @ Dec 11 2008, 03:19 AM) *
I just built a 3200 kernel, here it is:Click to view attachment


sorry, I couldn't test it before, it works if booted directly but gives a kernel panic when booted via kexec... does it work for anyone, or does anyone have a 3200 sharprom kernel that works from kexec?
Jon_J
QUOTE(matthis @ Jul 15 2008, 07:22 PM) *
1. On your Z
Boot into the sharprom using your usual kernel, check the file /var/log/dmesg and find the line which contains this:
mtdparts=sharpsl-nand:7168k@0k(smf),44032k@7168k(root),-(home) jffs2_orphaned_inodes=delete EQUIPMENT=5 LOGOLAND=1 DEFYEAR=2008 LOGO=1 LAUNCH=q
(Your values for sharpsl-nand may vary, and this is why you need to build your own kernel)


Does anyone have these values for a Cacko Full install on a SL-C3100?
QUOTE
mtdparts=sharpsl-nand:7168k@0k(smf),44032k@7168k(root),-(home)

I don't have this line, or anything close to it in my /var/log/dmesg
Here's what my /var/log/dmesg shows that is related to mtd partition locations: (note the spelling error on first line)
CODE
Using static partision definition
Creating 1 MTD partitions on "sharpsl-flash":
0x00140000-0x007f0000 : "Filesystem"
NAND device: Manufacture ID: 0xec, chip ID: 0xf1 (Samsung NAND 128MB 3,3V)
Creating 3 MTD partitions on "NAND 128MB 3,3V":
0x00000000-0x-00700000 : "smf"
0x00700000-0x-03c00000 : "root"
0x03c00000-0x-08000000 : "home"

I'm trying to put these values in /boot/kernel-cmd (Using the new multiboot kernel for zubuntu posted on cortez's site).
I can boot zubuntu and angstrom just fine from the multiboot menu, but cacko just will not appear on this menu.
I could use the default Sharp values, but I think they may be different from Cacko.
Or, How do I convert:
0x00000000-0x-00700000 : "smf"
0x00700000-0x-03c00000 : "root"
0x03c00000-0x-08000000 : "home"
to
xxxxk@0k(smf),xxxxxk@xxxxk(root),-(home)
Thank you,
Jon
ant
QUOTE
Or, How do I convert:
0x00000000-0x-00700000 : "smf"
0x00700000-0x-03c00000 : "root"
0x03c00000-0x-08000000 : "home"
to
xxxxk@0k(smf),xxxxxk@xxxxk(root),-(home)
Thank you,
Jon


03c00000 is hex format, convert it to dec:
7340032 - 62914560 bytes = 5574528 bytes /1024 = 54272 kb /1024 = 53 mb

You can find your actual mtdparts doing "cat /proc/mtd" and if they are in cmdline "cat /proc/cmdline".

The thing here is the 2.4 kernels (cacko) is not able to get mtdparts by atag, nor from Zaurus bootloader....so the solution found by kernel devs was to add a static compiled mtdparts string in cmdline. If this is missing, the kernel defaults to Sharp's standard sizes (in sharpsl.c).

At the moment, only u-boot bootloader is able to pass the mtdparts correctly to the kernel on Zaurus.
The kexecboot/multiboot kernel has a special patch for reading the mtdparts /from proc/cmdline and pass it to the new booted kernel.

Cheers

Ant
Jon_J
So you're saying I cannot boot cacko from NAND using the multiboot kernel that cortez posted with zubuntu?
I did cat/proc/mtd It still spits out some sort of hex number.
(I'm not a math genus or binary wizard, so these numbers don't resemble the numbers the sharp users have posted above)
CODE
cat /proc/mtd
dev     size   erasesize  name
mtd0: 006b0000 00020000 "Filesystem"
mtd1: 00700000 00020000 "smf"
mtd2: 03500000 00020000 "root"
mtd3: 04400000 00020000 "home"

after reading another post on NAND partitions: http://www.oesf.org/forum/index.php?showto...sharpsl\.c
I found my kernel command line in dmesg, but it is severally truncated:
CODE
kernel command line: console=ttyS0 root=/dev/mtdblock2
ant
QUOTE(Jon_J @ Dec 29 2008, 04:20 PM) *
So you're saying I cannot boot cacko from NAND using the multiboot kernel that cortez posted with zubuntu?
...
mtd2: 03500000 00020000 "root"


For 2.4 kernels (cacko) the kernel-cmdline should contain the mtdparts string, because the old kernels cannot process the cmdline passed by atags nor appended by the (broken) bootloader.


Btw 53mb rootfs is the standard for 760 / 860 (husky and boxer).
0x03c00000-
0x00700000=
0x03500000 (=53mb)


Ant
Jon_J
QUOTE(ant @ Dec 29 2008, 11:13 AM) *
QUOTE(Jon_J @ Dec 29 2008, 04:20 PM) *
So you're saying I cannot boot cacko from NAND using the multiboot kernel that cortez posted with zubuntu?
...
mtd2: 03500000 00020000 "root"


For 2.4 kernels (cacko) the kernel-cmdline should contain the mtdparts string, because the old kernels cannot process the cmdline passed by atags nor appended by the (broken) bootloader.


Btw 53mb rootfs is the standard for 760 / 860 (husky and boxer).
0x03c00000-
0x00700000=
0x03500000 (=53mb)


Ant

That goes back to my original question.
Where or how do I get the mtdparts string? It is NOT in /var/log/dmesg, like it is for the first several people in this thread.
Mine only shows: console=ttyS0 root=/dev/mtdblock2
The rest of it is missing.
When I originally flashed zubuntu, cortez said to use a copy of /boot/kernel-cmdline (from zubuntu) to boot "other" OS's
Could this be why my mtdparts string is truncated?

Thank you for your help on this. This kernel stuff and NAND stuff is all new to me.
Jon_J
I just booted back to cacko and removed /boot/kernel-cmdline
Then I rebooted back to angstrom and then back to cacko (using kexec -f ~/zimage.bin)
This confirmed that the "kernel-cmdline" in /boot (in cacko's filesystem),
has no effect on the "kernel command line" shown in /var/log/dmesg. It is still the same.
cortez
/boot/kernel-cmdline should contain something like: mtdparts=sharpsl-nand:7168k@0k(smf),44032k@7168k(root),-(home) jffs2_orphaned_inodes=delete. I haven't tested this, so I don't know what it should be exactly. I gladly leave this for others to find out wink.gif
Jon_J
QUOTE(cortez @ Dec 29 2008, 12:31 PM) *
/boot/kernel-cmdline should contain something like: mtdparts=sharpsl-nand:7168k@0k(smf),44032k@7168k(root),-(home) jffs2_orphaned_inodes=delete. I haven't tested this, so I don't know what it should be exactly. I gladly leave this for others to find out wink.gif

I tried this string, it's still a no go. No option shows on the menu for my cacko nand partition when booting.
I'll wait for your next release.
I noticed on the instructions page for installing zubuntu, that you have a picture of Zaurus with zubuntu on flash, on the boot menu. smile.gif

I found a thread in pdaxrom that has several "different" sets of numbers in this string, and a default set of numbers.
I would paste them in here, but I don't want to confuse anyone else with these widely varying sets of numbers.
You do know most people re-partition their flash in pdax beta3 to 121MB
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.