OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

2 Pages V   1 2 >  
Reply to this topicStart new topic
> Kexec From Debian To Sharprom, Really Working How-to!, you have to compile a kernel - easy
matthis
post Jul 15 2008, 05:22 PM
Post #1





Group: Members
Posts: 218
Joined: 12-February 06
From: Tokyo
Member No.: 9,124



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!
Go to the top of the page
 
+Quote Post
xamindar
post Jul 16 2008, 10:11 PM
Post #2





Group: Members
Posts: 803
Joined: 30-March 04
From: California
Member No.: 2,368



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.

This post has been edited by xamindar: Jul 16 2008, 11:51 PM
Attached File(s)
Attached File  zImage.tar ( 1.1MB ) Number of downloads: 43
 
Go to the top of the page
 
+Quote Post
maemorandum
post Nov 13 2008, 01:34 AM
Post #3





Group: Members
Posts: 57
Joined: 12-March 08
From: North Pole
Member No.: 21,496



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)?
Go to the top of the page
 
+Quote Post
xamindar
post Nov 13 2008, 02:41 PM
Post #4





Group: Members
Posts: 803
Joined: 30-March 04
From: California
Member No.: 2,368



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.
Go to the top of the page
 
+Quote Post
maemorandum
post Nov 14 2008, 02:28 AM
Post #5





Group: Members
Posts: 57
Joined: 12-March 08
From: North Pole
Member No.: 21,496



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.
Go to the top of the page
 
+Quote Post
xamindar
post Nov 17 2008, 01:15 AM
Post #6





Group: Members
Posts: 803
Joined: 30-March 04
From: California
Member No.: 2,368



Did you recheck your step 3 after flashing cacko? It might be different so you would need to recompile a new kernel.
Go to the top of the page
 
+Quote Post
maemorandum
post Nov 18 2008, 05:12 AM
Post #7





Group: Members
Posts: 57
Joined: 12-March 08
From: North Pole
Member No.: 21,496



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
Go to the top of the page
 
+Quote Post
gojira
post Dec 10 2008, 05:58 AM
Post #8





Group: Members
Posts: 124
Joined: 16-January 05
Member No.: 6,248



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?
Go to the top of the page
 
+Quote Post
pelrun
post Dec 10 2008, 06:10 AM
Post #9





Group: Members
Posts: 369
Joined: 6-September 04
From: Brisbane, Australia
Member No.: 4,488



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.
Go to the top of the page
 
+Quote Post
gojira
post Dec 10 2008, 07:40 AM
Post #10





Group: Members
Posts: 124
Joined: 16-January 05
Member No.: 6,248



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!
Go to the top of the page
 
+Quote Post
ant
post Dec 10 2008, 07:46 AM
Post #11





Group: Members
Posts: 163
Joined: 11-March 04
From: IT
Member No.: 2,270



>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
Go to the top of the page
 
+Quote Post
gojira
post Dec 10 2008, 08:19 AM
Post #12





Group: Members
Posts: 124
Joined: 16-January 05
Member No.: 6,248



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:Attached File  zimage_3200_bootargs.tar ( 1.1MB ) Number of downloads: 9


Go to the top of the page
 
+Quote Post
gojira
post Dec 13 2008, 12:15 AM
Post #13





Group: Members
Posts: 124
Joined: 16-January 05
Member No.: 6,248



QUOTE(gojira @ Dec 11 2008, 03:19 AM) *
I just built a 3200 kernel, here it is:Attached File  zimage_3200_bootargs.tar ( 1.1MB ) Number of downloads: 9


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?
Go to the top of the page
 
+Quote Post
Jon_J
post Dec 28 2008, 05:42 PM
Post #14





Group: Members
Posts: 1,843
Joined: 31-December 05
From: Illinois USA
Member No.: 8,821



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
Go to the top of the page
 
+Quote Post
ant
post Dec 29 2008, 05:59 AM
Post #15





Group: Members
Posts: 163
Joined: 11-March 04
From: IT
Member No.: 2,270



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
Go to the top of the page
 
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 28th November 2014 - 06:44 AM