maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   Custom image for flashing - how to? (https://talk.maemo.org/showthread.php?t=90647)

pichlo 2013-07-04 21:59

Custom image for flashing - how to?
 
Rather than always flashing a 4 years old Nokia stock, update, upgrade to CSSU, remove dross and install extra apps, is there a way to prepare a custom image I can flash directly?

panjgoori 2013-07-04 22:03

Re: Custom image for flashing - how to?
 
also agree. there should be something with latest CSSU, patches and fixes. if we can create our own device custom image then it will be amazing.

anthonie 2013-07-04 23:09

Re: Custom image for flashing - how to?
 
I am pretty sure one could adapt the information below to fit the projects' needs. I used it to create a custom image for Easy Debian, which worked really well. Dd is magic. ;)

https://help.ubuntu.com/community/LiveCDCustomization

reinob 2013-07-05 01:20

Re: Custom image for flashing - how to?
 
@pichlo,

I once started doing this, but ended up somewhere else :)

Here my notes:
Code:

* extract
mkdir parts
cd parts
../flasher-3.5 -F ../RX-51...COMBINED.bin --unpack
cp rootfs.jffs2 ../rootfs.ubi # it is really a ubi image
cd ..
# rm -rf parts

* mount rootfs
su -
modprobe nandsim first_id_byte=0x20 second_id_byte=0xaa \
                third_id_byte=0x00 fourth_id_byte=0x15
#/dev/mtd0 should be present, if not run "mknod /dev/mtd0 c 90 0"
dd if=rootfs.ubi of=/dev/mtd0 bs=2048
modprobe ubi mtd=0
mkdir mount
mount -t ubifs /dev/ubi0_0 mount

* make a copy
mkdir rootme
rsync -a mount/. rootme/.

* modify stuff -- either manually or using chroot?
...

* generate new image
su -
mkfs.ubifs -m 2048 -e 129024 -c 2047 -r rootme rootme.ubifs

* ubinize the file
cat > ubi.cfg <<EOF
[rootfs]
mode=ubi
image=rootme.ubifs
vol_id=0
vol_size=200MiB
vol_type=dynamic
vol_name=rootfs
vol_flags=autoresize
vol_alignment=1
EOF
./ubinize -o rootme.ubi -p 128KiB -m 2048 -s 512 ubi.cfg

* flash the image
su -
./flasher-3.5 -F RX-51_2009SE_10.2010.19-1.002_PR_COMBINED_002_ARM.bin -f
./flasher-3.5 --rootfs rootme.ubi -f
./flasher-3.5 -F RX-51_2009SE_10.2010.13-2.VANILLA_PR_EMMC_MR0_ARM.bin -f

Didn't test any of this. It was more like a gedankenexperiment.

reinob 2013-07-05 01:26

Re: Custom image for flashing - how to?
 
Just came across this:
http://mg.pov.lt/maemo-irclog/%23mae...11-21.log.html
(by master Pali)

and this thread here:
http://talk.maemo.org/showthread.php?t=35554

someday I'll read it (I think I should go to bed now).

michaaa62 2013-07-05 05:56

Re: Custom image for flashing - how to?
 
Did you read the 'backupmenu' thread opening post http://talk.maemo.org/showpost.php?p=844029&postcount=1 ???

pichlo 2013-07-05 09:30

Re: Custom image for flashing - how to?
 
Dang, I have read the post and am using BackupMenu quite extensively, but somehow I missed the flashable rootfs image!

Good work, it is half way there!

The next step would be an image with CSSU, both fiasco and vanilla, preferably NOT nuking MyDocs.

vi_ 2013-07-05 16:52

Re: Custom image for flashing - how to?
 
Yes and no.

Yes is mostly possible. No, when I was last looking at this I was told that if I roll my own image and made it available via the forums there would be 'consequences'.

I then thought, f*'it. I will keep it to myself then.

It is simple enough to generate a rootfs image from a file system image. This in turn can be turned into a flashable image by using fiasco-gen.

As of yet, NO ONE has been able to generate a flashable eMMC image with fiasco-gen. The 'layout' descriptor file format needed for fiasco-gen is unknown and lost to the mists of time. It might be possible that 0xFFFF has the ability to generate eMMC images but I never tried.

What you may consider though is there is actually NOTHING in the eMMC image of any importance. Just the n900 advert, '9' movie trailer and those crap mp3s. So with a bit of hacking it would probably be easy enough to modify the run-once-after-first-boot-script to erase the eMMC and set up the appropriate partitions etc. That way you would only need to flash the rootfs image. There is plenty of space on the rootfs image once you start stripping out all of the BS.

vi_ 2013-07-05 16:53

Re: Custom image for flashing - how to?
 
Quote:

Originally Posted by pichlo (Post 1356996)
Dang, I have read the post and am using BackupMenu quite extensively, but somehow I missed the flashable rootfs image!

Good work, it is half way there!

The next step would be an image with CSSU, both fiasco and vanilla, preferably NOT nuking MyDocs.

The notes on the BM page describe a flashable rootfs filesystem. It is just the FS before it is rolled into a NAND image with kernel, CMT firmware, etc.

pichlo 2013-07-05 22:34

Re: Custom image for flashing - how to?
 
Quote:

Originally Posted by vi_ (Post 1357084)
What you may consider though is there is actually NOTHING in the eMMC image of any importance.

Are you sure? I now have two (TWO!) phones that failed to flash the eMMC and both look very much like this after the boot. It looks like all the fonts, icons and other GUI stuff is in the eMMC.

Edit: Actually, scrap that. I had flashed Combined and had indeed failed to flash Vanilla but I then flashed the supposedly root-with-backupmenu image mentioned above and that did not end up very well. Flashing Combined again, even with still failed Vanilla, booted OK.


All times are GMT. The time now is 18:48.

vBulletin® Version 3.8.8