Author Topic: Kexec From Debian To Sharprom, Really Working How-to!  (Read 13914 times)

matthis

  • Full Member
  • ***
  • Posts: 217
    • View Profile
    • http://badaboum.bidibom.free.fr/mat/
Kexec From Debian To Sharprom, Really Working How-to!
« on: July 15, 2008, 09:22:21 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!!"

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!
« Last Edit: December 12, 2008, 08:40:51 pm by matthis »

xamindar

  • Hero Member
  • *****
  • Posts: 803
    • View Profile
    • http://www.radnimax.com
Kexec From Debian To Sharprom, Really Working How-to!
« Reply #1 on: July 17, 2008, 02:11:20 am »
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: [Select]
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.
« Last Edit: July 17, 2008, 03:51:40 am by xamindar »
SL-C3100 happily Dualbooting Japanese Rom 1.02 and Debian Eabi
Replaced internal CF with 8gb seagate cf hard drive
Ambicom CF GPS
CyberPower battery powered USB hub
D-link DCF-650W (MAN THIS THING IS HUGE!!)

maemorandum

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
    • http://
Kexec From Debian To Sharprom, Really Working How-to!
« Reply #2 on: November 13, 2008, 04:34:45 am »
Quote from: matthis
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)?
« Last Edit: November 13, 2008, 10:26:11 am by maemorandum »
SL-C3200 with opened 2nd CF-Slot, Debian EABI 2.6.23.9-yonggun on 2 GB High-Speed-CF
SL-C1000, Cacko-ROM

ASUS WL-110, hacked with external SMA Antenna Jack
AmbiComWL 1100C-CF, Buffalo Airstation-CF

xamindar

  • Hero Member
  • *****
  • Posts: 803
    • View Profile
    • http://www.radnimax.com
Kexec From Debian To Sharprom, Really Working How-to!
« Reply #3 on: November 13, 2008, 05:41:28 pm »
Quote from: maemorandum
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.
SL-C3100 happily Dualbooting Japanese Rom 1.02 and Debian Eabi
Replaced internal CF with 8gb seagate cf hard drive
Ambicom CF GPS
CyberPower battery powered USB hub
D-link DCF-650W (MAN THIS THING IS HUGE!!)

maemorandum

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
    • http://
Kexec From Debian To Sharprom, Really Working How-to!
« Reply #4 on: November 14, 2008, 05:28:04 am »
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: [Select]
Kernel panic: Attempted to kill init! too.
« Last Edit: November 14, 2008, 06:37:14 am by maemorandum »
SL-C3200 with opened 2nd CF-Slot, Debian EABI 2.6.23.9-yonggun on 2 GB High-Speed-CF
SL-C1000, Cacko-ROM

ASUS WL-110, hacked with external SMA Antenna Jack
AmbiComWL 1100C-CF, Buffalo Airstation-CF

xamindar

  • Hero Member
  • *****
  • Posts: 803
    • View Profile
    • http://www.radnimax.com
Kexec From Debian To Sharprom, Really Working How-to!
« Reply #5 on: November 17, 2008, 04:15:12 am »
Did you recheck your step 3 after flashing cacko?  It might be different so you would need to recompile a new kernel.
SL-C3100 happily Dualbooting Japanese Rom 1.02 and Debian Eabi
Replaced internal CF with 8gb seagate cf hard drive
Ambicom CF GPS
CyberPower battery powered USB hub
D-link DCF-650W (MAN THIS THING IS HUGE!!)

maemorandum

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
    • http://
Kexec From Debian To Sharprom, Really Working How-to!
« Reply #6 on: November 18, 2008, 08:12:29 am »
Quote from: xamindar
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!
SL-C3200 with opened 2nd CF-Slot, Debian EABI 2.6.23.9-yonggun on 2 GB High-Speed-CF
SL-C1000, Cacko-ROM

ASUS WL-110, hacked with external SMA Antenna Jack
AmbiComWL 1100C-CF, Buffalo Airstation-CF

gojira

  • Full Member
  • ***
  • Posts: 122
    • View Profile
Kexec From Debian To Sharprom, Really Working How-to!
« Reply #7 on: December 10, 2008, 08:58:36 am »
Quote from: 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!!"

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

Quote from: matthis
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  
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?
Zaurus SL-C3200 Debian EABI / Sharp ROM (tetsu v18j), Socket CF Bluetooth (Rev E), BT747 GPS, Canon K30225 CF Wifi.  RIP: Zaurus SL-C860 Sharp ROM (1.40JP).

pelrun

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
    • http://
Kexec From Debian To Sharprom, Really Working How-to!
« Reply #8 on: December 10, 2008, 09:10:20 am »
Quote from: gojira
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.
SL-C3100 with usb power mod running debian eabi
pdaXii13 still on the NAND for dualbooting
16GB SDHC! (a new one, after I sat on the old one and it went kaput)
D-Link 660 wifi, Socket Bluetooth rev H
External 9800mAh LiIon battery and slimline dvd drive
Homebrew microphone and remote

gojira

  • Full Member
  • ***
  • Posts: 122
    • View Profile
Kexec From Debian To Sharprom, Really Working How-to!
« Reply #9 on: December 10, 2008, 10:40:12 am »
Quote from: pelrun
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!
Zaurus SL-C3200 Debian EABI / Sharp ROM (tetsu v18j), Socket CF Bluetooth (Rev E), BT747 GPS, Canon K30225 CF Wifi.  RIP: Zaurus SL-C860 Sharp ROM (1.40JP).

ant

  • Full Member
  • ***
  • Posts: 167
    • View Profile
    • http://
Kexec From Debian To Sharprom, Really Working How-to!
« Reply #10 on: December 10, 2008, 10:46:39 am »
>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  https://www.oesf.org/forum/index.php?showtopic=26388

Ant


Ref: http://projects.linuxtogo.org/pipermail/op...ber/018129.html

gojira

  • Full Member
  • ***
  • Posts: 122
    • View Profile
Kexec From Debian To Sharprom, Really Working How-to!
« Reply #11 on: December 10, 2008, 11:19:26 am »
Quote from: matthis
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: [ Invalid Attachment ]
Zaurus SL-C3200 Debian EABI / Sharp ROM (tetsu v18j), Socket CF Bluetooth (Rev E), BT747 GPS, Canon K30225 CF Wifi.  RIP: Zaurus SL-C860 Sharp ROM (1.40JP).

gojira

  • Full Member
  • ***
  • Posts: 122
    • View Profile
Kexec From Debian To Sharprom, Really Working How-to!
« Reply #12 on: December 13, 2008, 03:15:49 am »
Quote from: gojira
I just built a 3200 kernel, here it is: [ Invalid 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?
« Last Edit: December 13, 2008, 03:33:57 am by gojira »
Zaurus SL-C3200 Debian EABI / Sharp ROM (tetsu v18j), Socket CF Bluetooth (Rev E), BT747 GPS, Canon K30225 CF Wifi.  RIP: Zaurus SL-C860 Sharp ROM (1.40JP).

Jon_J

  • Hero Member
  • *****
  • Posts: 1853
    • View Profile
    • http://
Kexec From Debian To Sharprom, Really Working How-to!
« Reply #13 on: December 28, 2008, 08:42:20 pm »
Quote from: matthis
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: [Select]
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
« Last Edit: December 28, 2008, 09:52:34 pm by Jon_J »
C3100 Multiboot-->Angstrom 2007.12-r18 | Cacko 1.23 | ArchLinuxARM
C3200 pdaxii13v2-5.5-alpha4 Akita on NAND

Ambicom WL1100C-CF Wifi - Ambicom CF modem - Ambicom CF GPS - Belkin-F5D5050 USB LAN
Socket CF Bluetooth rev K - Iogear 4 port USB micro hub - pocket CF card reader
Targus mini USB optical mouse - 2 Targus SD card readers

ant

  • Full Member
  • ***
  • Posts: 167
    • View Profile
    • http://
Kexec From Debian To Sharprom, Really Working How-to!
« Reply #14 on: December 29, 2008, 08:59:11 am »
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