View Single Post
Old 12-18-2009, 01:39 AM   #23
tigran
Zealot
tigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austentigran has memorized the entire works of Homer, Shakespeare, and Jane Austen
 
Posts: 140
Karma: 23528
Join Date: Nov 2009
Location: London
Device: Kobo Aura One,HD,H2O,Touch,Mini,Kindle 3+DXG,Nook Simple Touch
Quote:
Originally Posted by jusmee View Post
How do you mount and edit the *.bin file?
Yes, you can do that easily. First split the V3update.bin into its constituents using dd:

file=$1
out_dir=$2

rm -rf $out_dir
mkdir -p $out_dir

dd if=$file of=$out_dir/zImage bs=1M count=1 skip=1
dd if=$file of=$out_dir/ro.fs bs=1M count=6 skip=2
dd if=$file of=$out_dir/root.fs bs=1M count=44 skip=8
dd if=$file of=$out_dir/logo bs=1 count=240000 skip=$[1024*1024*52]
dd if=$file of=$out_dir/jffs2.fs bs=1M count=2 skip=53

Then mount ro.fs and root.fs as usual. Then copy their content (only using rsync -AHPSXa rootfs/ myrootfs to preserve the hardlinks correctly). Then, just edit the files (or replace etc etc) and then remake the images like this:

# mkfs.cramfs -v myrootfs myroot.fs

Then remake the V3update.bin like this:

mkv3update --write-hanlin=My-V3update.bin +zImage +myro.fs +myroot.fs +logo +jffs2.fs

(the mkv3update command comes from OI or you can write one yourself as the firmware image layout is well documented on OI webpages)

Last edited by tigran; 12-18-2009 at 01:46 AM.
tigran is offline   Reply With Quote