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

Ashley

  • Newbie
  • *
  • Posts: 46
    • View Profile
New pdaXrom installer (to have just Root partition)
« on: April 15, 2004, 03:15:44 pm »
Hi everybody!!

At last! And seems to work!...

I\'ve written a modification of pdaxrom installer which allows to easily resize nand to have JUST THE ROOT PARTITION, WITH NO HOME.

No fragmentation. Full space to install everything you what (100 MB free after install rom on a Cx60!!). Of course, /home now is on Root partition.

This is mainly thanks to ikm, who is the author of the trick.

It has been designed to be very careful before patching your Nand, but you must consider this as a beta version. Please backup your data before doing anything (maintenance menu backup is recommended). Also, for the moment, it was just tested with my 760. Take even more cares if you have another model.

You can find it in http://ciberia.ya.com/ashley_s/

Contents of new.tar:
   - updater.sh: to substitute pdaxrom updater.sh
   - updater.decoded: decoded version of the last
   - updater.decoded.cacko: decoded version of pdaxrom updater.sh
   - mtdtweak & mtdparts: you must put these together with updater.sh and tools.tar and initrd.bin from pdaXrom
   - encdesc: utility to encode and decode updater.sh files

Please try it with care and tell me bugs and succeeds in this topic :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

eviLjazz

  • Full Member
  • ***
  • Posts: 116
    • View Profile
    • http://katastrophos.net/andre/blog
New pdaXrom installer (to have just Root partition)
« Reply #1 on: April 16, 2004, 11:04:31 am »
Sorry, can\'t download the file with links or wget.
I\'ve tried downloading the file with mozilla, but the file is corrupted. At least tar doesn\'t recognize it as valid tar archive...
Sharp Zaurus SL-C3200/36GB running Cacko : Fujitsu LifeBook U2010/64GB SSD running Win7 : Nokia N900 (yes, flame me.) Blog : Twitter : Trac
Quasar Media Player : QScrobbler : Enhanced audio driver and mixer for C1000/C3x00 : Unified Sharp/Tetsu/Cacko/pdaXrom Kernel 2.4.20 branch : My packages : Sources

ScottYelich

  • Hero Member
  • *****
  • Posts: 992
    • View Profile
    • http://www.zaurususergroup.com/modules.php?opmodload&namephpWiki&filei
New pdaXrom installer (to have just Root partition)
« Reply #2 on: April 16, 2004, 11:07:29 am »
I get 404

Code: [Select]
[779]> wget http://ciberia.ya.com/ashley_s/new.tar

--09:06:29--  http://ciberia.ya.com/ashley_s/new.tar

           => `new.tar\'

Connecting to ciberia.ya.com:80... connected!

HTTP request sent, awaiting response... 404 Not Found

09:06:30 ERROR 404: Not Found.

                                                                                

eviLjazz

  • Full Member
  • ***
  • Posts: 116
    • View Profile
    • http://katastrophos.net/andre/blog
New pdaXrom installer (to have just Root partition)
« Reply #3 on: April 16, 2004, 11:45:16 am »
Okay, try downloading with referer.

wget --referer=http://ciberia.ya.com/ashley_s/index.html http://ciberia.ya.com/ashley_s/new.tar

This will work.
I hate referer rewrites........
Sharp Zaurus SL-C3200/36GB running Cacko : Fujitsu LifeBook U2010/64GB SSD running Win7 : Nokia N900 (yes, flame me.) Blog : Twitter : Trac
Quasar Media Player : QScrobbler : Enhanced audio driver and mixer for C1000/C3x00 : Unified Sharp/Tetsu/Cacko/pdaXrom Kernel 2.4.20 branch : My packages : Sources

zxerx

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
    • http://
New pdaXrom installer (to have just Root partition)
« Reply #4 on: April 16, 2004, 11:31:42 pm »
Success - I think this is a more preferable setup! Maybe I should\'ve asked before trying it, but what\'s the worst that could happen if something went wrong?
[span style=\'font-size:7pt;line-height:100%\']Zaurus SL-C760 :: pdaXrom 1.0.5 :: Toshiba 512Mb SD :: Hagiwara 256Mb 10Mbit/s SD :: PQI 256Mb 40x CF :: Socket Low Power 10Mb/s Ethernet CF :: Seano WiFi CF :: Xircom 56k Modem CF[/span]

dvdrw

  • Newbie
  • *
  • Posts: 32
    • View Profile
    • http://
New pdaXrom installer (to have just Root partition)
« Reply #5 on: April 17, 2004, 12:35:43 am »
I have a SL-C750 (64MB).  The mtdtweaks/mtdparts address in mtd1 is different, it is 0x20AA4 on my device.  If I reflash \"mtdtweaks\" into /dev/mtd1 using nandlogical, it works OK.  When I reboot, /proc/mtd shows mtd2 as \"root\" with a size of 0x3900000, and no mtd3 and \"home\" partition, which is correct.

I can eraseall -j /dev/mtd2 just fine, however no matter what I do the system refuses to mount the partition.  If I use a smaller partition size (35MB for example) then I can eraseall -j /dev/mtd2 and mount it just fine.  Something refuses to allow mounting of such a large jffs2 partition (57MB) on the C750.  I\'ve even manually created a jffs2 partition image using mkfs.jffs2 and dd\'ed it into /dev/mtd2.  But mount simply refuses to work.  Perhaps there is some other limit in the C750\'s kernel that won\'t allow this to work?  Do you have any suggestions as to anything to try?  I would love to get rid of the \"/home\" partition!

sashz

  • Sr. Member
  • ****
  • Posts: 388
    • View Profile
    • http://
New pdaXrom installer (to have just Root partition)
« Reply #6 on: April 17, 2004, 01:53:39 am »
Hallo Ashley,
here correct fix for maximal size for root partition in SL-C kernel loader: http://www.pdaxrom.org/downloads/misc/slc-...artsize-fix.zip
unzip and copy updater.sh and mainte_fix.bin to CF and do flash update. It will rewrite kernel loader with new fixed version.

How it was hacked:
Bootloader was disassembled in ASM source source,
looking inside, we will see:

seg000:00020838                 ADR     R1, aConsoleTtys0Ro ; \"console=ttyS0 root=/dev/mtdblock2\"
seg000:0002083C                 MOV     R2, #0x22 ; \'\"\'
seg000:00020840                 BL      sub_313AC
seg000:00020844                 CMP     R7, #0x4000000
seg000:00020848                 BCS     loc_30888
seg000:0002084C                 MOV     R0, R7,LSR#14
seg000:00020850                 MOV     R7, R0,LSL#4
seg000:00020854                 MOV     R2, R7
seg000:00020858                 ADD     R0, SP, #0xF0
seg000:0002085C                 ADR     R1, off_309F4
seg000:00020860                 BL      sub_30FFC
seg000:00020864                 MOV     R0, R6
seg000:00020868                 ADR     R1, aMtdpartsSharps ; \" mtdparts=sharpsl-nand:7168k@0k(smf),
\"
seg000:0002086C                 BL      sub_30FC8
seg000:00020870                 MOV     R0, R6
seg000:00020874                 ADD     R1, SP, #0xF0
seg000:00020878                 BL      sub_30FC8
seg000:0002087C                 MOV     R0, R6
seg000:00020880                 ADR     R1, aK7168kRootHome ; \"k@7168k(root),-(home)\"
seg000:00020884                 BL      sub_30FC8
seg000:00020888
seg000:00020888 loc_30888                               ; CODE XREF: sub_30768+E0?j


also the same code from address 0x20b7c

seg000:00020B7C                 ADR     R1, aConsoleTtys0_0 ; \"console=ttyS0 root=/dev/ram0\"
seg000:00020B80                 MOV     R2, #0x1D
seg000:00020B84                 BL      sub_313AC
seg000:00020B88                 CMP     R6, #0x4000000
seg000:00020B8C                 BCS     loc_30BCC


checking for max root size there:

seg000:00020844                 CMP     R6, #0x4000000
and
seg000:00020B88                 CMP     R6, #0x4000000

as we already know, 0x4000000 is max size for 64MB, multiple it to 2 for 128,
it will:
seg000:00020844                 CMP     R6, #0x8000000
and
seg000:00020B88                 CMP     R6, #0x8000000

fix new value from hexedit in extracted mainte.bin, and write it back to Z.
Now run pdaXrom installer and increase root partition to 80 MB and reflash pdaXrom. Rebooting... login as root,
df -h /
root size now 80.0M ! :-)

Ashley

  • Newbie
  • *
  • Posts: 46
    • View Profile
New pdaXrom installer (to have just Root partition)
« Reply #7 on: April 17, 2004, 06:59:04 am »
Uuf!!  I haven\'t been looking this for several hours and now it\'s plenty! (my first impression was nobody was interested!)

First thing: I\'m so sorry for the downloading problems! When I putted it seemed me it worked, but that nasty server dislikes any non-html file. Very sad. I just made a quick account just for this.
Then, a first solution: if you want i can send it by mail; for this PM me or write me (vicra dot 3111 at cajarural dot com). A better solution: Kirk to Enterprise, Kirk to Enterprise... Scotty, can you help me?  :wink:  No more experiments, as your site is the best resource for z stuff, it would honor me if you wish to make a little room for me  

Quote
Success - I think this is a more preferable setup! Maybe I should\'ve asked before trying it, but what\'s the worst that could happen if something went wrong?

Thanks. The worse: installation fails always and then have to restore a maintenance menu backup.

Quote
I have a SL-C750 (64MB).  The mtdtweaks/mtdparts address in mtd1 is different, it is 0x20AA4 on my device.  If I reflash \"mtdtweaks\" into /dev/mtd1 using nandlogical, it works OK.  When I reboot, /proc/mtd shows mtd2 as \"root\" with a size of 0x3900000, and no mtd3 and \"home\" partition, which is correct.

Nice. That sort of thing is what i expected when the model is diferent. Both ikm and me have a 760. Can any other 750 user confirm this? If so, we can do a simple mod to installer to do things right.

Quote
I can eraseall -j /dev/mtd2 just fine, however no matter what I do the system refuses to mount the partition.  If I use a smaller partition size (35MB for example) then I can eraseall -j /dev/mtd2 and mount it just fine.  Something refuses to allow mounting of such a large jffs2 partition (57MB) on the C750.  I\'ve even manually created a jffs2 partition image using mkfs.jffs2 and dd\'ed it into /dev/mtd2.  But mount simply refuses to work.  Perhaps there is some other limit in the C750\'s kernel that won\'t allow this to work?  Do you have any suggestions as to anything to try?  I would love to get rid of the \"/home\" partition!

I dislike very much hearing that. I think this tweak is even more needed by 700/750 users. You have tried the same things I would, so I can\'t give you a solution. I would like to see dmesg command line output and a nand dump of tweaked mtdparts, can you post them? May be this surpasses me, then sashz could be your only hope...


And sashz,

You found it!! You are a genius!! Boot loader disassebly!
It seems to be an old code from 700/750 that Sharp did not updated for 760. Things that happen. If we have had source code...

This is more useful for x60 users than having just 50 or 63 megs root partition, but the thing is that I prefer not to have any home partition, but mount /home to Root one. I like to install as many things as possible. I use my z for my daily work    (I mainly use gnumeric) but I don\'t use /home to keep any work file, I store they on my CF card always (too many reflashes). Then, home space is useless for me. I think it maked much more sense in qtopia since root was ro. I have many linux boxes installed on my home computers, but no home partition, it is something i don\'t like for a desktop computer. And there is another drawback: as /home is used many times as a temp dir (installing, for exaple; you can change this, but sometimes you don\'t realize) you can\'t shorten too much it. The more you fragment, the more space you loose.

Well, enough.

Sashz, I hope you rewrite installer to automate your fix in next releases, but i think many people agree with me and would be more happy if the installer also gives the chance to have just one partition  :wink:

I\'m afraid when i post this there will be dozens of new posts... let\'s see...
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

zxerx

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
    • http://
New pdaXrom installer (to have just Root partition)
« Reply #8 on: April 17, 2004, 07:19:22 am »
After using Ashley\'s modified update.sh, I went to reflash cacko 1.21. Problem - /dev/mtdblock3 no longer exists, hence no /home partition - but the installers are assuming it is there. I don\'t posess the skills to modify the partition table yet and was just about to do a nand restore when Sashz posted his partition size fix. Great timing for me!
[span style=\'font-size:7pt;line-height:100%\']Zaurus SL-C760 :: pdaXrom 1.0.5 :: Toshiba 512Mb SD :: Hagiwara 256Mb 10Mbit/s SD :: PQI 256Mb 40x CF :: Socket Low Power 10Mb/s Ethernet CF :: Seano WiFi CF :: Xircom 56k Modem CF[/span]

Ashley

  • Newbie
  • *
  • Posts: 46
    • View Profile
New pdaXrom installer (to have just Root partition)
« Reply #9 on: April 17, 2004, 07:30:22 am »
Quote
After using Ashley\'s modified update.sh, I went to reflash cacko 1.21. Problem - /dev/mtdblock3 no longer exists, hence no /home partition - but the installers are assuming it is there. I don\'t posess the skills to modify the partition table yet and was just about to do a nand restore when Sashz posted his partition size fix. Great timing for me!

I wrote an option to restore original partition scheme in my installer. Isn\'t it working? After that restoration you should be able to install pdaxrom with its original installer or any other rom.

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

Ashley

  • Newbie
  • *
  • Posts: 46
    • View Profile
New pdaXrom installer (to have just Root partition)
« Reply #10 on: April 17, 2004, 07:34:08 am »
I\'m sending installer as an attachment. Tell me if it works.
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

zxerx

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
    • http://
New pdaXrom installer (to have just Root partition)
« Reply #11 on: April 17, 2004, 11:02:42 am »
Quote
I wrote an option to restore original partition scheme in my installer

You certainly did! I should pay more attention ;-) Thanks, it works well and is slightly cleaner than having a zero size mtdblock3 partition.
[span style=\'font-size:7pt;line-height:100%\']Zaurus SL-C760 :: pdaXrom 1.0.5 :: Toshiba 512Mb SD :: Hagiwara 256Mb 10Mbit/s SD :: PQI 256Mb 40x CF :: Socket Low Power 10Mb/s Ethernet CF :: Seano WiFi CF :: Xircom 56k Modem CF[/span]

dvdrw

  • Newbie
  • *
  • Posts: 32
    • View Profile
    • http://
New pdaXrom installer (to have just Root partition)
« Reply #12 on: April 17, 2004, 11:40:30 am »
Quote
I dislike very much hearing that. I think this tweak is even more needed by 700/750 users. You have tried the same things I would, so I can\'t give you a solution. I would like to see dmesg command line output and a nand dump of tweaked mtdparts, can you post them? May be this surpasses me, then sashz could be your only hope...

I reverted my work all late last night but I will try to get a chance to try this again today. I do remember dmesg looked fine. An interesting thing is that if I formatted the 57MB partition as ext2 it would mount just fine - no errors and full 57MB partition available. So it appears to be just a problem with jffs2 (!?).  I verified the eraseall worked, however, so the partition was getting formatted properly.

When I reverted everything back to original pdaXrom 1.0.5, I tried another test - simply making root partition 55MB (leaving the rest for the home partition.) Cacko installer properly did this, but the partition was no longer mountable then. I then tried 50MB and it also failed; when I tried 45MB root size it worked OK (?! i.e., 45MB root, 12MB home.)

I have two SL-C750\'s and will replace Qtopia on the other one and see if it behaves the same.

Thanks!

Ashley

  • Newbie
  • *
  • Posts: 46
    • View Profile
New pdaXrom installer (to have just Root partition)
« Reply #13 on: April 17, 2004, 12:19:13 pm »
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.
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?
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 #14 on: April 17, 2004, 12:20:37 pm »
Quote
I have two SL-C750\'s and will replace Qtopia on the other one and see if it behaves the same.

I just tried a simple test on my second SL-C750, I tried installing normal unmodified pdaXrom 1.0.5 and resized NAND with 56MB for the root partition size (leaving 1MB for home), and the same problem occurs.

Here are the relevant entries from dmesg:

  [span style=\'font-size:16pt;line-height:100%\']Linux version 2.4.18-rmk7-pxa3-embedix-021129 (zaurus@sharplinux) (gcc version 2.95.2 19991024 (release)) #1 Sat, 10 May 2003 14:51:36 +0900
  CPU: Intel XScale-PXA255 revision 6
  Machine: SHARP Shepherd
  Converting old-style param struct to taglist
  Memory clock: 99.53MHz (*27)
  Run Mode clock: 199.07MHz (*2)
  Turbo Mode clock: 398.13MHz (*2.0, active)
  Security risk: creating user accessible mapping for 0x08000000 at 0xf1000000
  On node 0 totalpages: 16384
  zone(0): 16384 pages.
  zone(1): 0 pages.
  zone(2): 0 pages.
  Kernel command line: console=ttyS0 root=/dev/ram0 mtdparts=sharpsl-nand:7168k@0k(smf),57344k@7168k(root),-(home) ZAURUS_UPDATE=/etc/update/update_sd
  Console: colour dummy device 80x30
  Calibrating delay loop... 397.31 BogoMIPS
  Memory: 64MB = 64MB total
  Memory: 53820KB available (1824K code, 520K data, 108K init)
    ...
  Starting kswapd
  JFFS2 version 2.1. © 2001, 2002 Red Hat, Inc., designed by Axis Communications AB.
  reset resolution unkown =] 480x640
    ...
  Corgi audio driver initialize
  Sharp SL series flash device: 1000000 at 0
  Using static partision definition
  Creating 1 MTD partitions on \"sharpsl-flash\":
  0x00120000-0x007f0000 : \"Filesystem\"
  NAND device: Manufacture ID: 0x98, Chip ID: 0x76 (Toshiba TH58512FT)
  Creating 3 MTD partitions on \"Toshiba TH58512FT\":
  0x00000000-0x00700000 : \"smf\"
  0x00700000-0x03f00000 : \"root\"
  0x03f00000-0x04000000 : \"home\"
  Linux Kernel Card Services 3.1.22
    options:  [pm]
     ...[/span]

And here\'s /proc/mtd:

  [span style=\'font-size:16pt;line-height:100%\']# cat /proc/mtd
  dev:    size   erasesize  name
  mtd0: 006d0000 00020000 \"Filesystem\"
  mtd1: 00700000 00004000 \"smf\"
  mtd2: 03800000 00004000 \"root\"
  mtd3: 00100000 00004000 \"home\"
  #[/span]

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]

If I reduce the size of mtd2 to 46MB then it mounts fine - at 47MB and above it fails.  Here\'s /proc/mtd for the largest mtd2 I can create and still have it mount OK:

  [span style=\'font-size:16pt;line-height:100%\']# cat /proc/mtd
  dev:    size   erasesize  name
  mtd0: 006d0000 00020000 \"Filesystem\"
  mtd1: 00700000 00004000 \"smf\"
  mtd2: 02e00000 00004000 \"root\"
  mtd3: 00b00000 00004000 \"home\"
  #[/span]

Sashz, do you have any ideas as to what might be going on?  This is certainly strange!

Thanks!!