I do apologize for the long post. I have tried many things (detailed here) before asking help from this forum. At the moment (after 2 days of fiddling), there are many threads to the story. I will, however, try to make it short.
The zaurus wouldn't boot (with misc. kernel patnics) a few days ago. Figuring out I couldn't debug it, I tried getting into rescue mode with the updater.sh.rescue (an old-time friend).
That's where I had a surprise waiting. The CF card would not be recognized by the updater menu (Holding OK while powering on, then 4->1->Y). It would yell something about missing CF card and then rebooting.
Right. There's the D+B rescue boot console. Boots pretty well, except for one (not surprising by now) thing: the /sbin/cardmgr would output an error message (something like encountering an unexpected word or ")".).
Then, I could not access /dev/hdc, even for backup purpose. I'd get the error that block-major-3 is missing (as well as block-major-22 on /dev/hda). Great.
Obviously, something was wrong with the rescue boot rootfs. I could not flash a new kernel/distro, as the CF card would not be recognized by the updater (Which uses the emergency rootfs to boot when upgrading).
Using an SD card was an obvious solution along the way. However, when I use it, the updater is yelling misc messages about /var/lib/pcmcia/stab missing (which may be correct, since it's using the rescue rootfs, which is somewhat broken).
Booting again into the rescue rootfs and diagnosing things a bit, I found out that /sbin/cardmgr is broken! it's md5sum with an old version of cardmgr was different. Moreover, mounting /dev/mtdblock2 and copying cardmgr from there to /sbin/cardmgr on the rescue rootfs and then restarting pcmcia, works.
However, /dev/root on the rescue partition is /dev/ram0 -> the kernel is extracted dynamically from the rom (mtdblock1 maybe?) to the ram.
Right now, my ROM (cacko 1.23b) wouldn't boot, due to misc kernel panics, and I am unable to upgrade to any other distro (or even sharp's original rom) because the rootfs is fucked up.
What I'd like to know, is that:
1. Wouldn't a NAND restore will rewrite /dev/mtdblock1 ?
2. Is the rootfs actually taken from mtdblock1?
3. Fortunately, I have a backup of mtdblock1 I manually made after some previous restore. I would like to copy it (via dd) to /dev/mtdblock1 on my Z. However, I am unable to mount it (via loopback interface) to check what's inside and see if there I have a correct version of cardmgr. Does anyone know about the image structure of /dev/mtdblock1?
I will appreciate any help.