Author Topic: New pdaXrom installer (to have just Root partition)  (Read 31338 times)

dvdrw

  • Newbie
  • *
  • Posts: 32
    • View Profile
    • http://
New pdaXrom installer (to have just Root partition)
« Reply #15 on: April 17, 2004, 12:26:01 pm »
Quote
dvdrw, that sounds disconcerting. As your test show, the problem is not concerned with tweaking mtdparts. I think some people reported problems to this forum when tried to make big root partitions on 700/760 with early pdaxrom versions, just like happens to you. I didn\'t pay attention since it is a different problem from the x60 one, as sashz in his wisdom has showed. May be you should search that.

Interesting, I didn\'t know this!  I will search now.

Quote
If it mounts ext2 but not jffs2, it sounds like a 750\'s kernel bug. But I understand you can\'t mount with either maintenance or pdaxrom kernel (am I wrong?). If so, don\'t know, maybe the bug is present in both kernels?! Or you just tried to mount with maintenance?

This is exactly what I am thinking...I hope I can figure out a workaround for this.  Note that I have only been trying the mount with the maintenance kernel.  Could you tell me how I could boot with the pdaXrom kernel and try this?

ikm

  • Full Member
  • ***
  • Posts: 172
    • View Profile
    • http://
New pdaXrom installer (to have just Root partition)
« Reply #16 on: April 17, 2004, 01:06:26 pm »
Quote
So mtd2 formats fine with \"eraseall -j\", but when I try mounting it I get this error:

  [span style=\'font-size:16pt;line-height:100%\']# cd /tmp1
  # mkdir foo
  # mount -t jffs2 /dev/mtdblock2 /tmp1/foo
  mount: Mounting /dev/mtdblock2 on /tmp1/foo failed: Invalid argument
  #[/span]

Is anything additional showing up in \'dmesg\' after you issued a failing mount command? How long does it take for the mount command to fail?

From my experience, there were two problems with jffs2 I stumbled upon. First, when the flash is dirty, you have to have at least one valid inode for the mount to succeed. Second, when the partition size is quite big, jffs2 fails to allocate enough memory, because it uses kmalloc, and the required allocation size is bigger than 128k (the maximum that kmalloc can allocate). The latter problem is fixed by changing the code to use vmalloc instead of kalloc, but anyway, it shows up only with bigger partitions (say, 256M or 512M with the appropriate erasesize). It doesn\'t show up even on 128M with the 16k erasesize, as in SL-C760. So I do not really know what to suggest at the moment, further investigation is needed. Wells, inserting tons of printk\'s to the kernel always helps, but there may be a more simple solution

dvdrw

  • Newbie
  • *
  • Posts: 32
    • View Profile
    • http://
New pdaXrom installer (to have just Root partition)
« Reply #17 on: April 17, 2004, 01:13:22 pm »
Quote
Is anything additional showing up in \'dmesg\' after you issued a failing mount command? How long does it take for the mount command to fail?

It fails instantly and there are no entries added to dmesg after issuing the mount command.

Quote
So I do not really know what to suggest at the moment, further investigation is needed. Wells, inserting tons of printk\'s to the kernel always helps, but there may be a more simple solution

Are the sources to the Zaurus maintenance kernel available somewhere?  Do you know if anyone has done an alternative, RAM-based distro that I could boot from and work w/the mtd partitions?

Ashley

  • Newbie
  • *
  • Posts: 46
    • View Profile
New pdaXrom installer (to have just Root partition)
« Reply #18 on: April 17, 2004, 01:17:26 pm »
Quote
This is exactly what I am thinking...I hope I can figure out a workaround for this. Note that I have only been trying the mount with the maintenance kernel. Could you tell me how I could boot with the pdaXrom kernel and try this?

You can try to make a big jffs2 file system on a sd or cf with a running pdaxrom. You must have one, since you are reflashing :wink:

If this works, you may try the only solution I find: update maintenance kernel. This, of course, is very risky and you can brick your z :? , but you seem to know what you do very well :wink:

I\'ll update to a maintenance 760 kernel. I can mail you a nandlogical READ of mine.
With some cares, you could even restore your mainte kernel with a running pdaxrom, if it goes wrong:
- Before doing any thing, leave pdaxrom in a useful state.
- Make a nandlogical READ of your maintenance kernel. Put it on sd or cf.
- Copy nandlogical tool from maintenance to sd or cf.
- nandlogical WRITE 760 kernel image. Reboot.
- Try maintenance. If everything works, fine, if not:
- Reboot and run pdaxrom (it should, no matter how mainte kernel is).
- Use nandlogical to WRITE back your kernel.

I think this is doable, but it\'s your chance.

Tell me if you dare :wink:
c760 pdaXrom & zdebian (on SD)
256MB SD, 16MB CF, Prism 2.5 Wifi CF
Athlon XP
Debian sarge, Gentoo 1.4, RedHat 9, FreeBSD 5.1, xp

ikm

  • Full Member
  • ***
  • Posts: 172
    • View Profile
    • http://
New pdaXrom installer (to have just Root partition)
« Reply #19 on: April 17, 2004, 03:04:12 pm »
Ok, now I know what\'s happening with SL-C750. Just look at Sharp\'s kernel source:

$ cd linux/fs/jffs2/

(Note that SL-C760 is codenamed \'husky\')
$ grep -r HUSKY *

build.c:#ifdef CONFIG_ARCH_PXA_HUSKY
build.c:#ifdef CONFIG_ARCH_PXA_HUSKY
fs.c:#ifdef CONFIG_ARCH_PXA_HUSKY
nodelist.h:#ifdef CONFIG_ARCH_PXA_HUSKY
super.c:#ifdef CONFIG_ARCH_PXA_HUSKY
super-v24.c:#ifdef CONFIG_ARCH_PXA_HUSKY

All these #ifdefs (except one) say that for C760 we should use consistent_alloc, for all other models kmalloc should be used instead. Now it becomes apparent: only C760 has two large (64Mb) partitions, so large that kmalloc can\'t live with them.

The remaining one #ifdef says to increase reserved bad blocks from 24 to 80 for husky. The larger partitions, the bigger possible amount of bad blocks. Or maybe C760 flashes are worse than on other models

The outcome: you can\'t use standard maintenance kernel on C750 to create one big root partition. You will have to reflash it.

How to fix the kernel: remove the aforementioned conditional statements there, leaving only the C760 code. This way it will most probably work

Ashley

  • Newbie
  • *
  • Posts: 46
    • View Profile
New pdaXrom installer (to have just Root partition)
« Reply #20 on: April 17, 2004, 03:21:10 pm »
ikm, you are THE root!

Quote
The outcome: you can\'t use standard maintenance kernel on C750 to create one big root partition. You will have to reflash it.

Ok, now we are sure: it is the only way.

Quote
How to fix the kernel: remove the aforementioned conditional statements there, leaving only the C760 code. This way it will most probably work

Or just try to flash a unflashed 760 kernel, as I told. Seems to be a quicker solution :wink:

Ash
c760 pdaXrom & zdebian (on SD)
256MB SD, 16MB CF, Prism 2.5 Wifi CF
Athlon XP
Debian sarge, Gentoo 1.4, RedHat 9, FreeBSD 5.1, xp

Mickeyl

  • Hero Member
  • *****
  • Posts: 1495
    • View Profile
    • http://www.Vanille.de
New pdaXrom installer (to have just Root partition)
« Reply #21 on: April 17, 2004, 06:40:04 pm »
Quote
Are the sources to the Zaurus maintenance kernel available somewhere?
I think this is just a copy of the same kernel with a slightly modified CMDLINE and a ramdisk. The OK-Menu will probably save where to look for the updater.sh in a dedicated area on flash (RAM is cleared during reboot) and then reboot.
Cheers,

Michael 'Mickey' Lauer | Embedded Linux Freelancer | www.Vanille-Media.de
Consider donating, if you like the software I contribute to.

dvdrw

  • Newbie
  • *
  • Posts: 32
    • View Profile
    • http://
New pdaXrom installer (to have just Root partition)
« Reply #22 on: April 17, 2004, 08:26:35 pm »
Quote
... The outcome: you can\'t use standard maintenance kernel on C750 to create one big root partition. You will have to reflash it.

How to fix the kernel: remove the aforementioned conditional statements there, leaving only the C760 code. This way it will most probably work

yes this makes sense.  I\'ve rebuilt the \"shepherd\" kernel but have defined the HUSKY config define for the jffs2 code.  everything built fine, but I am not sure where to flash zImage in the updater.  I tried flashing over the second kernel image location at 0x00220000 but that killed the device (even the \"d+m\" reset appears dead.)  I\'m trying a \"c+d\" CF recover now to un-brick it...

dvdrw

  • Newbie
  • *
  • Posts: 32
    • View Profile
    • http://
New pdaXrom installer (to have just Root partition)
« Reply #23 on: April 17, 2004, 09:12:05 pm »
success at last!!!1  I now have pdaXrom running with a single 57MB root partition on my C750!  many thanks to ikm and ashley who made this possible for this happy user  

Ashley

  • Newbie
  • *
  • Posts: 46
    • View Profile
New pdaXrom installer (to have just Root partition)
« Reply #24 on: April 18, 2004, 05:22:40 am »
Congratulations dvdrw!

Quote
many thanks to ikm and ashley who made this possible for this happy user

You are welcome, but you are the main cause of your succeed.

Now, I want some feedback, in order to update installer to work with 750s  :wink:

Quote
I\'ve rebuilt the \"shepherd\" kernel but have defined the HUSKY config define for the jffs2 code. everything built fine, but I am not sure where to flash zImage in the updater.

Can you mail me zImage? The one you built works, and not sure if i can compile it correctly. I can\'t ever test it.

Quote
I tried flashing over the second kernel image location at 0x00220000 but that killed the device (even the \"d+m\" reset appears dead.)

What extrange. Did you reflash to a different location later? Or what did you do to make it work?

Quote
I\'m trying a \"c+d\" CF recover now to un-brick it...

Did you succeed doing this too? Fabulous! Maybe you can post a howto for Foxdie to this topic: http://www.zaurususergroup.com/index.php?n...iewtopic&t=2897 he seems desperate.

And finally, i\'ll need that you confirm the offset of mtdparts in a 750. I think it\'s all what i need to make a 2nd version of installer suitable for that model. Now i need a 700 voluntarious user :wink:

Oh man, i look like your boss!
c760 pdaXrom & zdebian (on SD)
256MB SD, 16MB CF, Prism 2.5 Wifi CF
Athlon XP
Debian sarge, Gentoo 1.4, RedHat 9, FreeBSD 5.1, xp

dvdrw

  • Newbie
  • *
  • Posts: 32
    • View Profile
    • http://
New pdaXrom installer (to have just Root partition)
« Reply #25 on: April 18, 2004, 01:20:44 pm »
Quote
Now, I want some feedback, in order to update installer to work with 750s  :wink:

OK, so I found afterwards that I actually didn\'t need to fix and rebuild the Zaurus kernel.  I originally hit a problem with actually booting the final installed pdaXrom kernel after doing the install, so Cacko\'s C750 kernel has the same issue that the stock Zaurus C750 kernel does (probably because it is based on the \"Sheperd\" device config).  So rather than try to rebuild the pdaXrom kernel, I simply tried flashing the pdaXrom C760 kernel onto the C750 and voila, it worked!

So as a test, I tried flashing the pdaXrom *C760* kernel into my SL-C750 in the maintenance kernel location (0x220000), and it worked - I was able to create and mount a full 57MB jffs2 partition.

So, to get a SL-C750 to work with a single root partition, an extra step needs to be done - the maintenance kernel needs to be upgraded with the pdaXrom kernel *first* - then do a reboot, then do the mainte.bin patch to repartition the MTDs for single root, then reboot, then install the pdaXrom *C760* kernel (NOT the C750 kernel), and finally nandcp the filesystem to mtd2 and final reboot.

The offset for the mtdtweak/mtdparts patch in the C750 is 0x20aa4, so if you change the MTDCMD= assignment in your script to to \"MTDCMD=0x20aa4\" then the mtdparms= patch will work.

It is important to note that I\'m not sure if there are any issues with using the pdaXrom C760 kernel for both maintenance and main kernels on the SL-C750 - however the device appears to work fine with it.

If you update your version of the updater.sh script to do all of this, and then post it then I can test it for you!

Quote
Quote
I\'m trying a \"c+d\" CF recover now to un-brick it...

Did you succeed doing this too? Fabulous! Maybe you can post a howto for Foxdie to this topic: http://www.zaurususergroup.com/index.php?n...iewtopic&t=2897 he seems desperate.

Actually everything you need to do the C+D trick is at http://pocketworkstation.org/files/recover/.  It is very handy, you can completely recover your device with this process.

Ashley

  • Newbie
  • *
  • Posts: 46
    • View Profile
New pdaXrom installer (to have just Root partition)
« Reply #26 on: April 19, 2004, 02:07:14 pm »
Hi everybody!

I\'ve just rebuit my installer to work properly with 750s, thanks to dvdrw\'s headaches. :wink:

To use it, just substitute installer.sh from pdaxrom, and add mtdparts & mtdtweak to your flash card, like prior version.

Zaurus sl-c750 need to update their maintenance kernel, as we have discussed in this topic, in order to be able to mount *big* jffs2 partitions. So, the first option you must select from the installer menu is \"4 Update SL-C750 Maintenance Kernel\". Don\'t worry, it makes a backup copy of you original maintenance kernel into your flash card (named mkern750.bak); if you want to get back, option \"5 Restore SL-C750 Maintenance Kernel\" restores it when ever you want. The rest steps are as prior version: resize to only root and install, which can also be reversed as you now. I try to write the most careful code I can, \'cause we are playing with fire :wink:

Reply for bugs, congratulations, insults...

The new installer is only available in the following attachment.

PS: Thank you again ikm and dvdrw, this won\'t be possible without you
c760 pdaXrom & zdebian (on SD)
256MB SD, 16MB CF, Prism 2.5 Wifi CF
Athlon XP
Debian sarge, Gentoo 1.4, RedHat 9, FreeBSD 5.1, xp

dvdrw

  • Newbie
  • *
  • Posts: 32
    • View Profile
    • http://
New pdaXrom installer (to have just Root partition)
« Reply #27 on: April 19, 2004, 09:01:09 pm »
Quote
Reply for bugs, congratulations, insults...

Hi Ashley,

Thank you very much for putting this together!  I haven\'t had a chance to try it yet, but in checking the update script source I think there is a little problem - on the 750 you have to run the \"main\" kernel with the Cacko 760 kernel as well (!), as their 750 kernel has the same jffs2 allocation problem as the default Zaurus 750 kernel.

So at around line 437 in your current updater.decoded, you should change this line:

Code: [Select]
for TARGETFILE in /tmp1/tools/kernel-$MODEL/zImage.bin initrd.bin INITRD.BIN

to perhaps something like this sequence:

Code: [Select]
if [ "$MODEL" == "SL-C750" ]; then

 KERNEL_IMAGE=kernel-SL-C760

else

 KERNEL_IMAGE=kernel-$MODEL

fi

for TARGETFILE in /tmp1/tools/$KERNEL_IMAGE/zImage.bin initrd.bin INITRD.BIN


Again I haven\'t had a chance to try this yet, but will do this tonight.

BTW, it would be nice if Cacko could fix their 750 kernel to include the jffs2 fix directly.  Is there any way to let them know about this?

Thanks again!

dvdrw

  • Newbie
  • *
  • Posts: 32
    • View Profile
    • http://
New pdaXrom installer (to have just Root partition)
« Reply #28 on: April 20, 2004, 01:45:01 am »
hi Ashley,

I\'ve made some necessary changes in your new installer for the C750 single-root install (as well as a few small cosmetic changes).  I have attached the updated version.  I have tested this version on my C750 by NAND restoring back to the factory Zaurus ROM, then doing a clean install using this updater with the Cacko 1.0.5 initrd.bin and tools.tar.  I\'ve also tested your maintenance ROM backup/restore operations and they work great.  so many many thanks again for your work on this!!!!

p.s. as there is no longer any mtd3 it is possible to eliminate the bootup warnings about mtdblock and mtdblock3 not found by commenting out the relevant statements from /etc/rc.d/rc.rofilesys (e.g., RW_MTD_LINE references, etc)

Ashley

  • Newbie
  • *
  • Posts: 46
    • View Profile
New pdaXrom installer (to have just Root partition)
« Reply #29 on: April 21, 2004, 01:00:53 pm »
Hi dvdrw!!

Sorry for the delay in posting, now my job keeps me much more busy :?

Thank you very very much for testing and making necessary mods for me!!

It\'s true, I forgot to make the changes about non-maintenance 750 kernel

Quote
p.s. as there is no longer any mtd3 it is possible to eliminate the bootup warnings about mtdblock and mtdblock3 not found by commenting out the relevant statements from /etc/rc.d/rc.rofilesys (e.g., RW_MTD_LINE references, etc)

Also, you should remove mtdblock3 line from /etc/fstab :wink:

I\'m very happy it works, and that you tested and corrected it!

And, people, DARE trying it! There could be still bugs (surely for 700, not yet tested), but for 860/760/750s seems to work perfectly. So don\'t be afraid. The installer is very careful before anything is done. And the beneficts for me are obvious: I have many many apps installed just in my nand and have still a lot of free space!

Maybe, I should remember that after installing pdaXrom with this installer you\'ll get 100MB free nand space on a x60, which can be much more thanks to jffs2 zlib transparent compression. As an example: in my z, df is saying I have 60MB used, 60MB free (!!) and \"du /\" says I have 105MB used !!!!! (no cards in)  Should I say anything else...?
c760 pdaXrom & zdebian (on SD)
256MB SD, 16MB CF, Prism 2.5 Wifi CF
Athlon XP
Debian sarge, Gentoo 1.4, RedHat 9, FreeBSD 5.1, xp