Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
Quallenauge
Old
(Last edited by Quallenauge; 27th June 2012 at 11:20 AM.)
#1  
Senior Member - OP
Thanks Meter 125
Posts: 109
Join Date: May 2012
Database [Dev] Modify stock image script

In case someone would like to build an own image based on the stock firmware,
I wrote a script that performs the neccessary steps (which where mostly described at the xda-forums) automatically on a linux based system.
It is very raw, and is not well optimized. It also is using many sudo calls for creating and modifying the image. Maybe someone has another, better solution.

Usage:
Download and unpack the ExtractAOS archive:
Code:
tar xfj ExtractAOS.tar.bz2
At first you need to place a AOS update file (firmware_archos_it4.aos) into the "dl" folder.

Then copy a busybox.tar.bz2 file, which contains the statically linked binaries of busybox (no subdirectories) inside the archive:
Code:
ash
busybox
cat
chgrp
...
Also make sure that following tools are installed on your system:
  • unsquash
  • unzip
  • tar

Then start the main script:
Code:
./unpackAOS
You will see a menu like this:
Code:
---------- Unpack and Modify Archos image -----------

1       Cleanup: Umount all mounted devices and delete all created files.
2       Download needed packages
3       Setup build directory
4       Create new Ext4 loop image and mount it to MOUNT_DIR
5       Extract AOS image
6       Copy AOS image contens into /data/ExtractAOS/archos_update_folder
7       Modify image in /data/ExtractAOS/archos_update_folder
8       Finish image and unmount it
88      Perform step 3-8 automatically 
99 Exit
Then download needed tools via menu item "2".
If the download are successfully done, then you can enter "88"
to build your own archos.ext4.update image file.

Notes:
I'm on a 64 bit system. Letama seems to provide binaries also for 32 bit sytems. In that case, you can modify and set the correct binary within the script file.
This script is intended to provide a base for developers which want their own customisations

Special thanks to:
letama
surdu_petru
Attached Files
File Type: bz2 ExtractAOS.tar.bz2 - [Click for QR Code] (2.6 KB, 85 views)
The Following 4 Users Say Thank You to Quallenauge For This Useful Post: [ Click to Expand ]
 
2WildFirE
Old
#2  
2WildFirE's Avatar
Senior Member
Thanks Meter 78
Posts: 323
Join Date: Jan 2011
Location: Borken (Hessen)

 
DONATE TO ME
Thanks i will try it next weekend
Gesendet von meinem HTC Desire mit Tapatalk 2
HTC ONE X/OrDroid ROM
 
gen_scheisskopf
Old
#3  
gen_scheisskopf's Avatar
Senior Member
Thanks Meter 227
Posts: 1,047
Join Date: Feb 2009
Location: Poznań
Quote:
Originally Posted by Quallenauge View Post
Also make sure that following tools are installed on your system:
  • unsquash
  • unzip
  • tar
On which firmwares did you test this script?
There was an error in squashfs header in 4.0.5-4.0.6 FW (including test releases)- androidmerged.squashfs.secure could be mounted as loop but not extracted
Code:
setprop persist.world.domination 1
Twitter
 
Quallenauge
Old
#4  
Senior Member - OP
Thanks Meter 125
Posts: 109
Join Date: May 2012
Hi,

I builded my image based on the current 4.0.7 aos-update file.
I'm using archlinux 64 bit.

Which arch are you using? Can you please verify that the correct extractAOS binaries are downloaded within the script?

The script doesn't mount the androidmerged.squashfs.secure as loop device, but copies all the data from androidmerged.squashfs to a temporary folder named "output_folder".

Can you please provide a console output? Maybe there is some more information?...
 
gen_scheisskopf
Old
#5  
gen_scheisskopf's Avatar
Senior Member
Thanks Meter 227
Posts: 1,047
Join Date: Feb 2009
Location: Poznań
Quote:
Originally Posted by Quallenauge View Post
Hi,

I builded my image based on the current 4.0.7 aos-update file.
I'm using archlinux 64 bit.

Which arch are you using? Can you please verify that the correct extractAOS binaries are downloaded within the script?

The script doesn't mount the androidmerged.squashfs.secure as loop device, but copies all the data from androidmerged.squashfs to a temporary folder named "output_folder".

Can you please provide a console output? Maybe there is some more information?...
I didn't test the script (I stick to 3.2.80).
For modifying I use LeTamas' "manual" method- correct binaries are present (linux 32bit). Unpacking .aos file works fine but I had problems with unsquashfs (header error in =<4.0.6 fw) so the only option was mount -o loop.
If it works for 4.0.7= Archos corrected the error
Code:
setprop persist.world.domination 1
Twitter
 
Quallenauge
Old
#6  
Senior Member - OP
Thanks Meter 125
Posts: 109
Join Date: May 2012
Hi!

I've just downloaded the 4.0.6 version from archos servers.

Code:
h**p:// update.archos.com/9/gen9/gen9_4.0.6/firmware_archos_it4.aos
Unpacking of the squashfs still works here...

Maybe you missed the needed steps:
Code:
    cd $BASEPATH/firmware_archos_it4/root/data
    dd if=androidmerged.squashfs.secure of=androidmerged.squashfs bs=256 skip=1

    if [ -d output_folder ]; then
        rm -f output_folder
    fi
    unsquashfs -d output_folder androidmerged.squashfs
 
suddenStrike
Old
#7  
Junior Member
Thanks Meter 0
Posts: 2
Join Date: Jul 2012
Maybe stupid question but why we need this busybox ( this archive actually is missing)? I think there is busybox already from the archive is that archive is rooted or give us something more?
 
Quallenauge
Old
#8  
Senior Member - OP
Thanks Meter 125
Posts: 109
Join Date: May 2012
Hi,

I saw that another customized roms contains an updated busybox, which can provide more features.
(Honestly, I don't know which feature is it worth to replace the builtin busybox... . )
If you want to build an image without this step, just comment out the busybox call.

The busybox archive is missing, because I don't know If I have the permission to include a compiled (from other people) busybox by default.
 
Quallenauge
Old
(Last edited by Quallenauge; 6th July 2012 at 07:37 PM.) Reason: Spelling fixes...
#9  
Senior Member - OP
Thanks Meter 125
Posts: 109
Join Date: May 2012
Exclamation [Dev] CM9 Mod Extension

Help!

I can't wait to try out the final build from Anybody interested in testing a CM9 super-alpha build in a week or so?, so I decided to try out a modification of the stock rom with CM9 by myself. And yes, today zygote has startet and I got a screen =)

I would like to share with you, what I did and I hope that you can give some code extensions to build a better mod script.

So, let's go:

1) Compile cyanogen mod
Install prerequisites

(I used Ubuntu Precise 32bit in a chrooted environment)

Then perform like suggested a repo init/sync:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b ics
repo sync
Then perform a compile action:
Code:
. build/envsetup.sh
lunch full_panda-eng
mka
PS: I had to modify the cyanogen_root/external/webkit/Android.mk
because there where build errors:
Code:
# Build the performance command line tool.
#include $(WEBKIT_PATH)/android/benchmark/Android.mk
Get some coffee I full build will take about an hour (on my system).

2) Unpack Archos stock image
You can use my tool at #1 of this thread!
PS: I used 407 stock image...

3) Create a loop image and mount it into a folder
You can use my script for that.

4) Get my new archive and unpack it.
Go into that folder and modify the bash script Porting.sh to match the folder paths:
Code:
export CYANOGEN=/cynogen_mod/out/target/product/panda
export STOCK=/ExtractAOS/firmware_archos_it4/root/data/output_folder/
export OUT=/Android/Development/mount
Run the script as root!
Code:
sudo ./Porting.sh
You get a file system contents in $OUT. Unmount the loop directory and
load it into the media update path as usual:
Code:
adb push archos.ext4.update /data/media/ && adb reboot
That's it! You should get a CM9 desktop.
------------ ------------ ------------ ------------ ------------ ------------ ------------ ------------ ------------

That was the good news! The bad:
The current state is a proof of concept.
I'm really hope that you can contribute to the modding script: I'm not an android expert!

Dirty technical details:
I had to use the existing vendor libraries especially the graphics drivers (I tried to use the panda binaries, with no luck :-/ ).
I moved them into the /system/vendor/lib folder and symlinked the libraries to /system/lib. This way it seems to much cleaner.

I modify the init.rc script to mount the data directory into /data2 to not interfere with existing archos installation. Later we should be able to point to that directory again. (Hint: to update the development you must use a adapted adb update command:
Code:
adb push archos.ext4.update /data2/media/ && adb reboot
From the first test, I saw that I have no real touchscreen, it worked like a "mouse" controlled environment. Maybe because the panda board has an mouse as input device.

Thanks.

PS: I'm curious how JackpotCalvin has solved the CM9 integration, It sounds way better than my solution...
Attached Files
File Type: bz2 PortCyanogen.tar.bz2 - [Click for QR Code] (7.3 KB, 14 views)
The Following User Says Thank You to Quallenauge For This Useful Post: [ Click to Expand ]
 
gen_scheisskopf
Old
#10  
gen_scheisskopf's Avatar
Senior Member
Thanks Meter 227
Posts: 1,047
Join Date: Feb 2009
Location: Poznań
Nice one
Some thoughts:
-why do you copy $STOCK/usr/bin/[binary name] when later all $STOCK/usr dir is copied?
-there should be no need to place PowerVR in /system/vendor/lib/[...], /system/lib/[...] should work fine
-check prelinks for existing libs and adjust prelink map for [repo path]/device/ (this may not be necessary, last system I compiled was Froyo)
Code:
setprop persist.world.domination 1
Twitter

The Following User Says Thank You to gen_scheisskopf For This Useful Post: [ Click to Expand ]
 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

report this ad
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...

XDA PORTAL POSTS

What Happened at Google I/O 2013 – XDA Developer TV

Unless you just emerged from a deep, dark, dank cavern under the Earth, you know … more

Forums Added for the LG Optimus G Pro and Sony Xperia Tablet Z

Not too long ago, we talked about how Sony was continuing its AOSP efforts on … more

Permanent Screen Off for the Visually Impaired

Most of us take the simple act of waking up our devices and having a quick glance at the … more

App Analytics, or the Death of the Independent App Developer

This is entry number one in a series of articles about tools for app developers, … more