![]() |
How to extract rootfs.jffs2 directly to mmc card for dual-boot
There are plenty of threads here explaining how to clone the OS from internal memory to the MMC/SD-card.
What I want to do is a little different: I want to leave the running OS 2006 on my 770 untouched, use the boot-menu (already have this *g*) and get a working image of OS2007HE on my MMC card. (I have a crad reader on my desktop linux PC, so it's really easy for me to do all the steps there.) Unfortunately, I don't get very far. I had some more problems in the beginning (thread here) and benson helped me a lot during these ealry steps, but I'm still stuck on how to get a working setup on the MMC-partition: I can easily extract the contents of both rootfs.jffs2 and initfs.jffs2 on my desktop PC, but how do I combine them to get a running system? First I thought rootfs.jffs2 would be enough, but it isnt. Then I added the contents of initfs.jffs2 to /mnt/initfs in the root fs, but it still doesnt boot. Anybody done this before? What am I missing? And: Is there any place I can go for debugging information? I get the boot menu, select the entry, and after a few seconds I'm at the boot menu again... Not very helpful. Is there a way to read what happened afterwards? Like missing modules, wrong paths etc etc...? It would be so cool to just copy whatever version of ITOS to MMC without going through the "flash-copy to MMC-reflash original"-hassle. I'd even consider OS2005 just for the fun of it - I can't remeber what it looked like at all. ;) |
Re: How do i combine initfs and rootfs for a complete installation?
Quote:
Quote:
First I thought you need to combine them to make flashable FIASCO image. Quote:
Quote:
As for extracting rootfs from FIASCO image and then extracting jffs2 to MMC on the fly directly on the tablet, it is possible but complicated. You need 0xFFFF flasher for extraction FIASCO and block2mtd kernel driver (+dependencies) for mounting jffs2 image. Here is my simple (=it may not work for you) script for mounting jffs2 on linux PC Code:
if [ `id -u` != 0 ] ; then |
Re: How do i combine initfs and rootfs for a complete installation?
Answers from the master himself. Great! :)
Quote:
Quote:
Not knowing if rootfs.jffs2 would be enough or if somehow contents from initfs.jffs2 are required (like for additional kernel modules etc.) left me in empty space with too many possible combinations for trial and error. Quote:
|
Re: How do i combine initfs and rootfs for a complete installation?
Quote:
once jffs2 image is properly mounted, there is no catch, just straight tar clone (as root) directly to mounted mmc should do it. Mind the 131072 eraseblocks size constant in block2mtd insmod call, it is important. And watch kernel log for any errors about image size when mounting jffs2 and after tar copy. Also mount it in read only mode (-o ro) just to be safe, if you already mounted it once in rw mode, extract it from FIASCO again just to be sure you still have original data. |
Re: How do i combine initfs and rootfs for a complete installation?
Quote:
This was really very helpful, fanoush, thank you. I still don't know if it will work, but at least there's a lot of new information: I know it *should* work. I know only rootfs is necessary. And I know some things to pay attention to when copying the contents of the *.jffs2-file. - The future looks brighter now. :D |
Re: How do i combine initfs and rootfs for a complete installation?
Works!
Thank you so much. I have no idea what went wrong before, but I assume the problem was somehow related to extracting/copying the files from the jffs2-file: IIRC, it did this only once and used they resulting files for all my attempts. I was so sure that I needed to find the right parts from initfs to go with the rootfs that it never once occured to me the cause of the problem could be something completely different. |
Re: How do i combine initfs and rootfs for a complete installation?
I've been trying to do this for some time but I was unsuccessful.
benny1967 could you please post the the commands you use? I've tried what you mentioned earlier but the ITT fail to boot. Tanks |
Re: How do i combine initfs and rootfs for a complete installation?
@art:
I hope I can remember what I did... It's basically all in fanoush's post above, though (his script): First I unpack the fiasco image: Code:
flasher-3.0 -u -F SU-18_2007HACKER_4.2007.46-3_PR_F5_MR0_ARM.bin Then I find a free loop device (usually /dev/loop0) with "losetup -f" and attach the rootfs-file to it: Code:
losetup /dev/loop0 rootfs.jffs2 Code:
modprobe block2mtd block2mtd=/dev/loop0,131072 (I learned that you have to compile block2mtd as a module, though, otherwise you can't cleanly undo all of this.) Next you mount the device: Code:
mount -t jffs2 -o ro /dev/mtdblock0 /mnt/jffs2/ Copy the contents of the jffs2 to the card with: Code:
tar -cf - -C /mnt/jffs . | tar xvf - -C /media/disk Again, I did what I read on maemo.org. I'm not really sure why "cp -a" or something similar will not do, they say you need to use tar or rsync. That's how it works... Another thing that was strange: The unpacked rootfs has <200MB; the partition on my MMC was set to 256MB or so, IIRC. Still, very early in the copy-process, I got error messages about the target being full... "df" showed 70% free on the partition afterwards. I had no time to investigate, deleted a second partition and created a new one with 700MB - now it works. |
Re: How do i combine initfs and rootfs for a complete installation?
Hi Fanoush,
Thanks for the script. I was able to mount my jffs2 filesystem in Linux. I have a small issue. After mounting, if i remove a folder say X of size 12 MB and add another folder of 16 MB, the cp fails and says No free space left in device. How can I tackle this issue? If i check with df util, it says my mount folder is 100% used. Any idea? Thanks a lot, Ram |
Re: How do i combine initfs and rootfs for a complete installation?
Tar it up and extract to another location and use mkfs.jffs2 to make a new jffs2 image.
|
All times are GMT. The time now is 20:10. |
vBulletin® Version 3.8.8