Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
letama
Old
(Last edited by letama; 29th December 2011 at 03:01 PM.)
#1  
Recognized Contributor - OP
Thanks Meter 1300
Posts: 1,363
Join Date: Feb 2008

 
DONATE TO ME
Default [HOWTO] Unpack and repack stock firmware, works also for gen8

Hello All,

Here is a log of what I did to unpack and repack 3.2.78 firmware if any cooker is interested. The interesting part that differs in gen8 and gen9 compared to previous generation is the way you extract kernel and initrd.

For the record, Archos changed again initrd compression in this one, this is now lzo, not lzma anymore. Gen8 extract is the same except that they still use .gz instead of lzma/lzo.

I also attached the tools (linux) I use, aos-unpack has gen8 and gen9 keys, aos-kernel-unpack is a tool I wrote to split zImage and initrd.

Log is a bit rough, but all should be there:

Code:
aos-unpack firmware_archos_it4.aos
cd firmware_archos_it4/raw
dd if=9_MMCF of=init_kernel bs=264 skip=1
aos-kernel-unpack init_kernel
mv unpacked-cpio.gz init-cpio.cpio.lzo
mv unpacked-header init-header
mv unpacked-kernel init-zImage
rm unpack-unknown
dd if=10_MMCF of=recovery_kernel bs=264 skip=1
aos-kernel-unpack recovery_kernel
mv unpacked-cpio.gz recovery-cpio.cpio.lzo
mv unpacked-header recovery-header
mv unpacked-kernel recovery-zImage
rm unpack-unknown
mkdir init_cpio
cd init_cpio
cat ../init-cpio.cpio.lzo | lzop -d | sudo cpio -i --make-directories
cd ..
mkdir recovery_cpio
cd recovery_cpio
cat ../recovery-cpio.cpio.lzo | lzop -d | sudo cpio -i --make-directories
sudo emacs init (comment secure part and change squashfs location:
#if [ $SQUASHFS_CHECK -eq 1 ] ; then
#       SQUASHFS_FULL_PATH=`get_mount_info p system`/$SECURE_SQUASHFS_FILENAME

#       $CRAMFSCHECKER $SQUASHFS_FULL_PATH
#       if [ $? -ne 0 ] ; then
#               $FLASH_PARTITION_ERASE init
#               log_and_reboot $FS_CHECK_ERROR "Secured fs check failed"
#       fi

#       $LOSETUP -o 256 `get_mount_info d rootfs` $SQUASHFS_FULL_PATH || log_and_die "Mounting system partition failed"
#else
mount_p data
$LOSETUP `get_mount_info d rootfs` /data/media/android_3.2.78.squashfs || log_and_die "Mounting system partition failed"
#fi
)
sudo su
rm init~
find . | cpio -o -H newc | lzop > ../new_initrd.lzo
cd ../../root/data/
dd if=androidmerged.squashfs.secure of=androidmerged.squashfs bs=256 skip=1
unsquashfs androidmerged.squashfs
cd squashfs-root
cp ../../../../3.2.69/root/data/squashfs-root/system/bin/su system/bin
chmod 6755 system/bin/su
cp ../../../../3.2.69/root/data/squashfs-root/system/app/Superuser.apk system/app
emacs default.prop
-> ro.secure=0
-> persist.service.adb.enable=1
emacs system/build.prop
-> ro.board.has_vibrator=yes
tar -cvzf ../rooted_stock_3.2.78.tgz *
cd ..
mksquashfs squashfs-root android_3.2.78.squashfs
Let me know if you need details or explanations. I didn't release 3.2.78 yet, my g9 battery is dead (or is it the whole tablet ? Crossing finger ) and I can't test right now. Hopefully it will go back to life and I will be able to test soon.

LeTama
Attached Files
File Type: zip firmware_tools.zip - [Click for QR Code] (25.2 KB, 536 views)
File Type: zip firmware_tools_32.zip - [Click for QR Code] (24.4 KB, 483 views)
Sony Xperia S (Boot Manager, JB AOSP 4.2.2)
Archos A70IT2 Honeycomb model (SDE and rooted firmware)
Archos A101 G9 (SDE enabling, SDE root firmware , G9 ICS Alpha 0 )
Want to buy me a beer? Here is my donation link.

"I herd you like updates so we put an update in yo update so you can update while u update" g.revaillot (Archos)
The Following 8 Users Say Thank You to letama For This Useful Post: [ Click to Expand ]
 
djnilse
Old
(Last edited by djnilse; 29th December 2011 at 01:24 PM.)
#2  
djnilse's Avatar
Senior Member
Thanks Meter 591
Posts: 176
Join Date: Aug 2011
Location: Frankfurt am Main

 
DONATE TO ME
i searched for some tool like this

but i cant execute the archos-tools(archos-unpack, archos-kernel-unpack)
im using ubuntu 10.10 and i get "cant execute binary file"

i writed "aos-unpack firmware_archos_it4.aos" in terminal in the directory i have the aos-unpack firmware_archos_it4.aos

any idea what i do wrong,
sorry if i m spaming this thread because i dont understand so much yet (i get my archos g9 on xmas)
Check out my holostyled ConvertItAll app, if you want to be amazed
Check out my Youtube-Channel HERE





My X8 Story
Xperia S (OpenSEMC CM10.1 built from sources)
Xperia X8 black 'n white (rooted, my version of alfs-kernel , GingerDX v030)
Archos Gen9Turbo
Nexus 7(cm10.1)


Check out my Github here
 
letama
Old
#3  
Recognized Contributor - OP
Thanks Meter 1300
Posts: 1,363
Join Date: Feb 2008

 
DONATE TO ME
Oups, yes, I believe I know... 64 bits Ubuntu here, I bet you are 32 ?
Sony Xperia S (Boot Manager, JB AOSP 4.2.2)
Archos A70IT2 Honeycomb model (SDE and rooted firmware)
Archos A101 G9 (SDE enabling, SDE root firmware , G9 ICS Alpha 0 )
Want to buy me a beer? Here is my donation link.

"I herd you like updates so we put an update in yo update so you can update while u update" g.revaillot (Archos)
 
djnilse
Old
#4  
djnilse's Avatar
Senior Member
Thanks Meter 591
Posts: 176
Join Date: Aug 2011
Location: Frankfurt am Main

 
DONATE TO ME
Quote:
Originally Posted by letama View Post
Oups, yes, I believe I know... 64 bits Ubuntu here, I bet you are 32 ?
i m on virual box and yes i have 32 bit
Check out my holostyled ConvertItAll app, if you want to be amazed
Check out my Youtube-Channel HERE





My X8 Story
Xperia S (OpenSEMC CM10.1 built from sources)
Xperia X8 black 'n white (rooted, my version of alfs-kernel , GingerDX v030)
Archos Gen9Turbo
Nexus 7(cm10.1)


Check out my Github here
 
letama
Old
#5  
Recognized Contributor - OP
Thanks Meter 1300
Posts: 1,363
Join Date: Feb 2008

 
DONATE TO ME
Quote:
Originally Posted by djnilse View Post
i m on virual box and yes i have 32 bit
Ok, that explains. I uploaded 32 bits version, can you try them and let me know if they work ?

Thanks!
Sony Xperia S (Boot Manager, JB AOSP 4.2.2)
Archos A70IT2 Honeycomb model (SDE and rooted firmware)
Archos A101 G9 (SDE enabling, SDE root firmware , G9 ICS Alpha 0 )
Want to buy me a beer? Here is my donation link.

"I herd you like updates so we put an update in yo update so you can update while u update" g.revaillot (Archos)
The Following User Says Thank You to letama For This Useful Post: [ Click to Expand ]
 
djnilse
Old
#6  
djnilse's Avatar
Senior Member
Thanks Meter 591
Posts: 176
Join Date: Aug 2011
Location: Frankfurt am Main

 
DONATE TO ME
Quote:
Originally Posted by letama View Post
Ok, that explains. I uploaded 32 bits version, can you try them and let me know if they work ?
ok i ll try it, i ll report back in a hour or so
Check out my holostyled ConvertItAll app, if you want to be amazed
Check out my Youtube-Channel HERE





My X8 Story
Xperia S (OpenSEMC CM10.1 built from sources)
Xperia X8 black 'n white (rooted, my version of alfs-kernel , GingerDX v030)
Archos Gen9Turbo
Nexus 7(cm10.1)


Check out my Github here
 
surdu_petru
Old
(Last edited by surdu_petru; 29th December 2011 at 06:53 PM.)
#7  
surdu_petru's Avatar
Recognized Contributor
Thanks Meter 3078
Posts: 2,131
Join Date: Feb 2010
Location: Paris

 
DONATE TO ME
Default HI!

Thanks @letama for your linux tools .
I repacked firmware.squashfs.secure but now I don't know which are the correct zImage and initramfs.cpio.gz ( into .../raw -directory ) for flash into Recovery. ( I used your tools for unpack-repack - 3.2.78 firmware) .

---------- Post added at 08:00 PM ---------- Previous post was at 07:50 PM ----------

Following your tutorial for version 3.2.69 I managed to root my device , but I returned to the official version 3.2.78 without root, because was not stable and had no root privileges for all apk instaled ( root_explorer , setcpu and ather like that without root privileage ) - for this I gave up...
 
Tha0lia
Old
#8  
Junior Member
Thanks Meter 8
Posts: 25
Join Date: Dec 2011
Thanks for your tools !

Now, I can update my rootfs to 3.2.78.

Have a nice day !

Thaolia
 
OneAn9ryN00b
Old
#9  
Member
Thanks Meter 74
Posts: 61
Join Date: Aug 2010
Thanks for this, might come in handy, might start cooking.... Never done it before. Does anyone know if anyone has started getting ClockworkMod running on this so we can get some CyanogenMod 9 love on this?

Sent from my Galaxy Nexus using XDA App
 
letama
Old
#10  
Recognized Contributor - OP
Thanks Meter 1300
Posts: 1,363
Join Date: Feb 2008

 
DONATE TO ME
Quote:
Originally Posted by surdu_petru View Post
Thanks @letama for your linux tools .
I repacked firmware.squashfs.secure but now I don't know which are the correct zImage and initramfs.cpio.gz ( into .../raw -directory ) for flash into Recovery. ( I used your tools for unpack-repack - 3.2.78 firmware) .
Kernel unpack is in the list of commands there, and you also have to modify the initrd...

Quote:
Originally Posted by surdu_petru View Post
Following your tutorial for version 3.2.69 I managed to root my device , but I returned to the official version 3.2.78 without root, because was not stable and had no root privileges for all apk instaled ( root_explorer , setcpu and ather like that without root privileage ) - for this I gave up...
3.2.78 rooted is coming soon, I'm uploading it currently, it should be ready in few minutes.
Sony Xperia S (Boot Manager, JB AOSP 4.2.2)
Archos A70IT2 Honeycomb model (SDE and rooted firmware)
Archos A101 G9 (SDE enabling, SDE root firmware , G9 ICS Alpha 0 )
Want to buy me a beer? Here is my donation link.

"I herd you like updates so we put an update in yo update so you can update while u update" g.revaillot (Archos)

 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...