[HOW-TO] Modify boot.img for LG Thrill/O3D - LG Thrill 4G

Im sure a good bit of you have already figured out that there is ZERO documentation on building a boot.img for our phones. Unfortunately it is not a generic process and every device is different. So basically this is a how-to on unpacking/repacking a boot.img for flashing to the device. This will allow you to make ramdisk modifications and create a boot.img from a kernel you compiled.
Directions
First youre going to need a few things. First and foremost, I have NO IDEA HOW TO DO THIS ON WINDOWS, so dont ask. If someone does then shoot me the directions and Ill put it up here and give you full credit.
You will need a Linux distribution such as Ubuntu (you can use a live CD or run it in a Virtual Machine as well, but again, dont ask me how to run it in Virtual Machine, Ive never done it).
-You will need to download the included boot-tools.zip which includes three things: unpack-bootimg.pl, mkbootimg, and a META-INF directory for flashing the boot.img in cwm recovery.
-You will also need the stock boot.img (or a custom one if you can find one at this point )
-Extract the boot-tools.zip to youre home folder. Make sure both files inside can be Executed as a program by checking 'Properties>Permissions'.
-Paste your boot.img in that folder as well.
-Open up a Terminal and:
Code:
cd ~/boot-tools
-Type:
Code:
./unpack-bootimg.pl boot.img
-This will create:
boot-img.ramdisk (this is the extracted ramdisk where you can make changes to your ramdisk)
boot-img.ramdisk.cpio.gz (this is the compressed ramdisk. You dont need to touch this.
boot.img-kernel.gz (this is the actual kernel)
-Rename "boot.img-kernel.gz" to "zImage" (OR, if you compiled your own just delete "boot.img-kernel.gz" and paste your compiled zImage here.
-Now you can make any changes you want inside boot-img.ramdisk.
-Now to repack the ramdisk so it can be packaged with the kernel you need to change directories in Terminal again:
Code:
cd ~/boot-tools/boot-img.ramdisk
-Now in the Terminal type:
Code:
find . | cpio -o -H newc | gzip > ../newramdisk.cpio.gz
(This part may require some package dependencies which you may need to install (gzip)
-This will produce a new package called "newramdisk.cpio.gz" This is the ramdisk you will package into the boot.img.
-So now finally we are going to bundle it all up into a boot.img
-So again we are going to change directories in the Terminal:
Code:
cd ~/boot-tools
-Now this next part needs to be exact or it will not work. In Terminal type:
Code:
mkbootimg --kernel zImage --ramdisk newramdisk.cpio.gz --cmdline "root=/dev/ram0 rw mem=128M console=ttyS2,115200n8 initrd=0x81600000,20M ramdisk_size=20480" --board omap4spd --base 0x756e0000 --ramdiskaddr 0x81600000 -o newboot.img
-This is very fast and it produces a new file called "newboot.img"
-You can now either delete or rename the original file called "boot.img"
-Now rename "newboot.img" to "boot.img"
-Now take "boot.img" and "Meta-INF" and zip those up together, naming the .zip whatever you want.
-Now you have a flashable boot.img update.zip you can put on your SD Card and flash from CWM recovery.
I suggest unpacking and then repacking a stock kernel without modification and then flashing it just to make sure it works before you make any changes.
Barring typo's, this process does work. Ive built a boot.img with it and the boot.img has been verified by other xda-ers to fully boot up and work. If I messed something up just let me know so I can fix it! Feedback is always welcome!
DOWNLOADS
boot-tools.zip

A breakdown of the boot.img bundling code:
Code:
mkbootimg --kernel zImage --ramdisk newramdisk.cpio.gz --cmdline "root=/dev/ram0 rw mem=128M console=ttyS2,115200n8 initrd=0x81600000,20M ramdisk_size=20480" --board omap4spd --base 0x756e0000 --ramdiskaddr 0x81600000 -o newboot.img
mkbootimg: This is just the command to use mkbootimg that packages the boot.img
--kernel zImage:This defines the file you want mkbootimg to use as your kernel.
--ramdisk newramdisk.cpio.gz: This defines the package you want to use as your ramdisk.
--cmdline "root=/dev/ram0 rw mem=128M console=ttyS2,115200n8 initrd=0x81600000,20M ramdisk_size=20480": This part is specific to our device and is taken from the kernel source. This is the part that was such a mystery
--board: This defines what board were installing our kernel too. This may or may not be needed. But I didnt test without this.
--base 0x756e0000: This defines the kernel base address. This is also device specific.
--ramdiskaddr 0x81600000: This defines the ramdisk base address. This is also device specific.
-o newboot.img: This tells mkbootimg what to name the output file, which in this case is "newboot.img" You can change this to whatever you want.

Thanks, good write up. I have a question. I'm on mac. I have mkbootimg from ICS sources, but I have no --ramdiskaddr option. Are you using a special mkbootimg?

You can install run it through cygwin on windows and i think on a mac too. Thats what i use for my kitchen and tools...
Or you cab just make a 10 gig partition and run dual boot ubuntu... i do that too but actually use 20 gigs... it is much easier than virtual. I use cygwin the most unless its a heavy duty project.
Sent from my LG-P925 using XDA App

Dont know what im doing wrong...
getting
"mkbootimg not found"
dont know what i did wrong...
its in the folder...
any ideas?

Cannot repack in cygwin. You must use virtual or real ubuntu install.
Sent from my LG-P925 using XDA App

Thank you eternally sir! This shall come in handy.
oh, and I'm going to be doing this on my HP 210 netbook with Linux on it. It's what I've compiled every kernel over in the Infuse forums and even Linuxbozo's CM7 Kang for myself before I moved to the Thrill.

Anyone try to complie the kernel with cm7 source? Didn't get the Tiap_drv.ko (wifi driver)
Sent from my Optimus 3D using Tapatalk

anyone?
im running ubuntu linux...
i tried adding ./mkbootimg... (says cannot execute binary file)
i tried adding sudo ./mkbootimg... (says syntax error)
i tried sudo mkbootimg... (says command not found)
i tried a space between . and /... (says no such file or directory)
i tried adding the full file path.
i have no idea what to do...
help please.

bzlmnop said:
im running ubuntu linux...
i tried adding ./mkbootimg... (says cannot execute binary file)
i tried adding sudo ./mkbootimg... (says syntax error)
i tried sudo mkbootimg... (says command not found)
i tried a space between . and /... (says no such file or directory)
i tried adding the full file path.
i have no idea what to do...
help please.
Click to expand...
Click to collapse
Did you give mkbootimg executable permissions?
Also you might try
Code:
sudo cp [I]path_to_[/I]/mkbootimg /usr/bin
Sent from my LG-P925 using Tapatalk

I did make sure it had the proper permissions...
Will cp path move mkbootimg to /usr/bin?
Because right now its just in my boot-tools folder...
Either way I will try it when I get home...
Thanks.
Sent from my LG-P925 using xda premium
Edit:
I tried copying it to /usr/bin.
Made sure permissions were correct.
Still nothing...
Edit #2:
Ok it might be working now...
how long should it take?
And will there be any result dialog?
Edit #3:
Nevermind, didnt work at all.
Have tried the entire process start to finish about 3 or 4 times now.
Still no success...
However i did find a typo in the OP "cd ~/boot-tools/boot-img.ramdisk" should be "boot.img-ramdisk"
Still everytime i try mkbootimg it says "bash: /usr/bin/mkbootimg: cannot execute binary file"
Any help would be greatly appreciated.
Thanks.

Aria check your PM

???
Alright,
nevermind i guess.
I have given up.
i have read everything there is out there to read about using mkbootimg.
the closest i have gotten is using a root account and it gave me a usage message:
"usage: mkbootimg
--kernel <filename>
--ramdisk <filename>
[ --second <2ndbootloader-filename> ]
[ --cmdline <kernel-commandline> ]
[ --board <boardname> ]
[ --board <address> ]
-o | --output <filename>"
Nothing i can find or no one i have asked seems to have an answer.
im so mad right now, bc trying to develop and stuff was fun up to this point. Now it just completely blows.

Mkbooimg doesn't work for O3D or thrill, you need too use U-boots mkimage also when unpacking the boot.img you just remove the first 76 bytes not the first 2048 as you do with mkbootimg files
Sent from my LG-P920 using Tapatalk

Thank you Echts!
Ok i will try that and report back...
So, the guide in the OP is wrong then?
b/c the included .zip has mkbootimg in it...

bzlmnop said:
Ok i will try that and report back...
So, the guide in the OP is wrong then?
b/c the included .zip has mkbootimg in it...
Click to expand...
Click to collapse
haven't followed his guide to test exactly but has anyone gotten his way to work? Looks like the old way which I don't know anyone who has gotten to work.
O3D/Thrill use U-boot images afaik and mkimage works, I repack that way, it's how I put the overclock module tekahuna did in to the boot.img
Sent from my LG-P920 using Tapatalk

ok, I think I see the problem... I use another mkbootimg and the "file mkbootimg" command produces:
mkbootimg: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, not stripped
Whereas using CallMeAria's produces:
mkbootimg: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, stripped
The first one works for me but does not have the ramdiskaddr option. Are you using a 64bit system Aria?
Edit: or visa versa, not sure what I'm using on my HP210 Netbook. Just know it's XCFE xubuntu. Asked for it preinstalled.

Multiupload is down can somebody reupload or send me the link
thank you

I also need the link to the boot tools zip

Related

Debian on LG P500 !!

NEW USER THEREFORE LINKS ARE IN ATTACHMENT ...
What i did ...
1. Download the debian installer from here
LINK#1 IN ATTACHMENT
uploaded with the updated installer script and bootdeb script ...
2. Download to replace the bootdeb file in debian with the bootdeb file below
LINK#2
3. Download to replace the installer.sh in debian directory with the installer
below
LINK#3
3. Unzipped the file on my computer. This created a directory called "debian".
4. Moved the whole debian folder in the root directory of memorycard (root)
using the data cable. After this I disconnected the cable.
4. Opened ConnectBot in p500, choosed local connection.
Download it here : LINK#4
5. Became root by typing: su -
6. Entered the debian directory in memory card:
cd /sdcard/debian
7. Launched the installer script:
sh installer.sh
8. Entered Debian console:
bootdeb
9. Launched the setup script: /scripts/onetime.sh
10. This should be the whole thing.....
but i got the error in executing installer.sh
the error for ext2.ko in /lib/modules
so i pushed the .ko file in the megatron ROM
and the final rom is here...
LINK#5
But it is still giving me error
I NEED HELP TO FIGURE OUT IN RUNNING DEBIAN TO THIS PHONE !!!
STEPS ARE HERE :
LINK # 6
What is debian?
Its another operating system for pc's...!!
SAME LIKE THE UBUNTU...
lekhwani said:
What is debian?
Click to expand...
Click to collapse
It's a Linux distribution where Ubuntu took it's code as its base.
@ashupulse: This one's easier: http://www.droidforums.net/forum/droid-hacks/58908-how-install-ubuntu-droid.html
Look's like booting Debian and controlling it with a VNC client. Will test this one. Wanna see how well X11 works (though I doubt I can get it starting in the first place)
Note: If you're using a custom ROM or kernel taken from this forum, you may have ext2 support already. If unsure, check again in the threads. If you're using apps2sd, you have ext2 support.
Where Ubuntu *takes it's base from, the experimental software repository in Debian.
Sent from my VM670 using XDA App
Installer.sh is working now !!!
Alrght i have got the installer working
but the problem is now with
bootdeb !!
Any help would be appreciated !!!
ashupulse said:
NEW USER THEREFORE LINKS ARE IN ATTACHMENT ...
What i did ...
1. Download the debian installer from here
LINK#1 IN ATTACHMENT
uploaded with the updated installer script and bootdeb script ...
2. Download to replace the bootdeb file in debian with the bootdeb file below
LINK#2
3. Download to replace the installer.sh in debian directory with the installer
below
LINK#3
3. Unzipped the file on my computer. This created a directory called "debian".
4. Moved the whole debian folder in the root directory of memorycard (root)
using the data cable. After this I disconnected the cable.
4. Opened ConnectBot in p500, choosed local connection.
Download it here : LINK#4
5. Became root by typing: su -
6. Entered the debian directory in memory card:
cd /sdcard/debian
7. Launched the installer script:
sh installer.sh
8. Entered Debian console:
bootdeb
9. Launched the setup script: /scripts/onetime.sh
10. This should be the whole thing.....
but i got the error in executing installer.sh
the error for ext2.ko in /lib/modules
so i pushed the .ko file in the megatron ROM
and the final rom is here...
LINK#5
But it is still giving me error
I NEED HELP TO FIGURE OUT IN RUNNING DEBIAN TO THIS PHONE !!!
STEPS ARE HERE :
LINK # 6
Click to expand...
Click to collapse
I just dont want to flash megatron again to use that kernel modules...Can u tell us how to integrate that kernel modules in our "existing ROMS"..i mean i dont want to flash again.. HElp i was looking into this and then luckily u came up with this..Thnx
seems like i m near to it , let u know if support could be added to the default O.S !!
Hi,
i was too wondering about using debian on our phone, and found this: http://www.saurik.com/id/10
It is basicaly just installing debian into image, which you can mount then and use its bash in chroot mode.
You can see some screenshots of htop, midnight commander or gcc-avr compiler (thats why I wanted debian).
PS: That thing with unionfs did not work for me yet, but i have notice I did something wrong, so I will give it one more try.
EDIT: yep, if you add unionfs patch to your kernel, it is working too.
Tasssadar said:
Hi,
i was too wondering about using debian on our phone, and found this: http://www.saurik.com/id/10
It is basicaly just installing debian into image, which you can mount then and use its bash in chroot mode.
You can see some screenshots of htop, midnight commander or gcc-avr compiler (thats why I wanted debian).
PS: That thing with unionfs did not work for me yet, but i have notice I did something wrong, so I will give it one more try.
EDIT: yep, if you add unionfs patch to your kernel, it is working too.
Click to expand...
Click to collapse
How do i patch the kernel n i m also using the blog u mentioned..It just doesnt boot
You do not need to patch kernel in any way if you dont wanna unionfs (which you dont). To be honest, I dont remember what exactly I had to do - I just followed the tutorial and tried to solve problems, there was something with loop devices I think.....
Well, I will try to install it one more time on clean rom tomorrow and write some tutorial.
We need a ROM that has bash, right?

[HOW-TO] Kernel Unpacking/Repacking

I am putting this here because CallMeAria's how-to doesn't seem to work. Also like he said there is no documentation on this so to improve the community as a whole this is a much needed guide.
LINUX IS REQUIRED FOR THIS, WINDOWS METHOD IS EITHER NOT POSSIBLE OR NOT FOUND YET I SUGGEST UBUNTU (of course)
1) Download the tools.zip file below
2) Extract the tools.zip to your home directory
3) Open a terminal Window, you will need uboot-mkimage, it should already be installed in your Linux distro, if it isn't you can install from repo using
Code:
sudo apt-get install uboot-mkimage
4) With uboot installed, cd to the tools directory
Code:
cd ~/WORK
5) I have included the stock boot.img
6) Back to the terminal. Use this command to unpack
Code:
./unpack-bootimg.pl boot.img
7) You will get a few files, rename "boot.img-kernel.gz" to zImage and delete the boot-img.ramdisk.cpio.gz file.
8) The boot.img-ramdisk folder is where you will do all of your tweaking. This tutorial does not cover that.
9) Back to the terminal. You need to cd inside of the ramdisk folder.
Code:
cd boot.img-ramdisk
10) Now use this command to compress the ramdisk.
Code:
find . | cpio -o -H newc | gzip > ../newramdisk.cpio.gz
11) You will get a new file called newramdisk.cpio.gz in your work folder, you're almost there.
12) Back to the terminal. CD back to your work folder
Code:
cd ~/WORK
13) You should now have zImage and newramdisk.cpio.gz ready to be combined into a boot.img
14) Back to the terminal. This command will repack it all together.
CHANGE "NAME YOUR IMAGE" to whatever you want nothing ridiculous. New Kernel, My Kernel.... Doom Kernel something like that will suffice
Code:
mkimage -A ARM -T multi -n NAME YOUR IMAGE -C None -a 0x80008000 -e 0x80008000 -d zImage:newramdisk.cpio.gz newboot.img
15) You should now have a newboot.img file, you need to rename this to boot.img and put it into the installer.zip, just drag and drop it and you're done.
16) Move installer.zip to the sdcard, as a safe gaurd also move "stock.zip" to sdcard if your boot.img doesn't work this will return you to stock.
17) Go to CWM and flash. If all goes well... you are now running your repacked kernel.
18) If it doesn't boot just go back into CWM, flash the "stock.zip" file and you will be just fine.
DOWNLOAD: http://www.multiupload.com/5U2OTM84X4
I really hope this is all correct, trying to deal with people around me, people texting and calling plus write this up is a pain. If there are any errors or problems just let me know I will correct whatever is needed.
looks like what you passed my way just before this. I've packaged this in a script as well in the Waggle kernel as I'm working on it.
Will find in my Git below. (working on compiling, then will upload scripts. )
test it out first... my head hurts now... i LOVE this stuff but I haaaate writing up tutorials... I always seem to either mix something up, forget something....
I went through it and all looks correct but then... I could just be delusional
Good lookin' out with the tutorial!
I have a favor to ask, my friend...
I'm on a MacBook Pro, with no working substitute for mkbootimg or mkimage, and I have neither the time or hard disk space to do a linux vm... Plus that vm would be running only one core, because smp vm's on this CoreDuo 2.16(Not Core2Duo, we runnin' 32bit!) don't play nice, and unicore vm's on this thing are so damn slow. This damn thing ain't much faster than our phones! LOL
Needless to say, I need someone to package this for me, so I can test it out.
This is cyanogen's kernel base, with a little tweak... If it works, I will release a patch.
Ah yeah,can you do me a favor? Upload the GB boot.img? Otherwise you're going to get a froyo ramdisk which wont work. I could always download a GB rom....
...fighting ninjas at night, talkin' about this and that.
Urabewe said:
Ah yeah,can you do me a favor? Upload the GB boot.img? Otherwise you're going to get a froyo ramdisk which wont work. I could always download a GB rom....
...fighting ninjas at night, talkin' about this and that.
Click to expand...
Click to collapse
I want a froyo ramdisk so I can test. I'm on a P925, froyo right now...
tekahuna said:
I want a froyo ramdisk so I can test. I'm on a P925, froyo right now...
Click to expand...
Click to collapse
Ahhh I see what you're doing OK will do have it up in a bit.
You want stock ramdisk I would assume?
...fighting ninjas at night, talkin' about this and that.
Urabewe said:
Ahhh I see what you're doing OK will do have it up in a bit.
You want stock ramdisk I would assume?
...fighting ninjas at night, talkin' about this and that.
Click to expand...
Click to collapse
With overclock would be nice... But maybe stock at first.
Bah too late, http://www.multiupload.com/X2D84732ZH
Test it out if it works, I'll throw together a OC for ya
LOL you probably wanted that in a flashable zip huh?
http://www.multiupload.com/L7WCV0OHZ6
Not working, I think it's on my end... Here is that patch.. see if you can get it to work against your kernel source.
Will do.
Also announcing that there is a new boot.img up. This one doesn't have the OC but still includes all the tweaks to speed and memory. Hoping that anyone that isn't even using the OC (setting the max speed down) or experiencing battery drain this should hopefully fix it and you can now run at full speed.
Get it here: http://forum.xda-developers.com/showthread.php?t=1357718
Err... could somebody re-upload the tools.zip? It seems since the Megaupload fiasco all the upload webs went berserk deleting 'suspicious' files.
hey urabewe, can you upload the tools.zip somewhere else, multiupload is not working apparently............in any of your links throughout the this thread
i use 4share they still work and free upload without paying
anyone know how to build the wifi module?
jznomoney said:
anyone know how to build the wifi module?
Click to expand...
Click to collapse
I haven't tried yet, but does the cyanogen wiki method not work?
http://wiki.cyanogenmod.com/wiki/Building_Kernel_from_source
Sent from my LG-P925 using XDA App

[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
Thanks i will try it next weekend
Gesendet von meinem HTC Desire mit Tapatalk 2
Quallenauge said:
Also make sure that following tools are installed on your system:
unsquash
unzip
tar
Click to expand...
Click to collapse
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
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?...
Quallenauge said:
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?...
Click to expand...
Click to collapse
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
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
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?
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... . :angel
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.
[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...
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)
I'm stopping my efford because I'm at a point, where I learned that just replacing the files between both sources (Panda Board CM9 builded binaries and Archos Stock ROM) is not a 100% solution.
I resolved my input devices setup, by copying the corresponding icd (and other) foles to the output folder. Then I had unresolved issues by getting WLAN to work. I found out, that in libandroid.so and libandroid_legacy.so are coded the modules which are needed for WIFI. Panda board is compiled w/o WIFI, so there are no
wifi modules loaded. (After I load wl12xx_sdio.ko manually by using insmod, the wlan was functional!).
The solution IMHO must be, to compile an adapted CM9 with all hardware specific settings. Maybe the customized files can also moved inside the device configuration directory so that the merge script is obsolete (my hope).
So I decided to either to wait until JackpotClavin is posting his CM9 configuration files
Code:
http://forum.xda-developers.com/showpost.php?p=28439197&postcount=80
or to learn how to make a new device on CM which maches our Archos device. (Maybe someone else can give me some archos specific instructions).
Update: Great! JackpoClavin has provided sources =)

(Tools) - unpack/repack boot.img/recovery.img + ramdisk

This is a tutorial I've decided to put together as I'm learning to compile kernels. It will cover unpacking and repacking a boot.img and/or recovery.img, and also touch on unpacking the ramdisk after we have unpacked the boot.img This tutorial will only focus on executing this on a android device using the terminal emulator app but of course you could use these tools on a PC in a adb shell.
This would not be possible without the hard work of xda member @Modding.MyMind. I am not responsible for anything you do to your device by using these tools.
What you will need
1. Android device
2. Have root
3. Have busybox installed (1.23.1 is recommended)
4. Terminal Emulator app
5. Root Explorer app
6. Your devices boot.img
7. mkbootimg_tools-master.zip (download below)
https://www.dropbox.com/s/fiat0zrf2f533uq/mkbootimg_tools-master.zip?dl=0
Directions;
1. Let's pull the boot.img we are going to work with using dd. Open your terminal and type su > press enter. Type dd if=/dev/block/platform/msm_sdcc.1/by-name/boot of=/sdcard/boot.img > press enter and now you should see a file on your sdcard called boot.img
2. Place the zip file on the root of your internal sdcard and extract it. You will see a folder called mkbootimg_tools-master and inside that folder you will see 2 folders. One called ARM and one called README.md Now we are going to copy the ARM folder to data/local/tmp and paste it inside of the tmp folder.
3. Now we need to go the ARM folder that you just copied inside tmp and set the permissions to 0777 (rwxrwxrwx) and also set the same permissions for each file inside the ARM folder.
4. Now go inside the ARM folder and copy the bash file to system/xbin and set the permission to chmod 0755 (rwxr-xr-x)
5. Ok now copy the boot.img file that we pulled onto your sdcard inside the ARM folder and leave the permissions for that file 0666 (rw-rw-rw-)
6. Now we are ready for the fun stuff! Open up your terminal emulator app and type su > press enter
7. Now we are going to change directories to the ARM folder which we want to be in by typing cd data/local/tmp/ARM > press enter
########################################
Now to unpack your boot.img
1. Type ./mkboot boot.img bootfolder > press enter and you will see the magic happen. It will automatically create a folder called bootfolder which is your project folder and you can name it whatever you like but I like to call it bootfolder and if I was unpacking a recovery.img I would call it recoveryfolder
2. So now you have your unpacked boot.img.
3. Now go to your terminal and type cd bootfolder > and press enter. We are going into your bootfolder now because that is where your ramdisk.gz is located and we are now going to decompress your ramdisk by typing gunzip -dc ramdisk.gz | cpio -i > and press enter and it will decompress your ramdisk for you.
4. So now you have unpacked a boot.img and also learned how to decompress your ramdisk.
#######################################
Now we are going to repack your boot.img
1. In your terminal type cd .. > and press enter so you will move back 1 directory into your ARM folder.
2. Now to repack you are going to type ./mkboot bootfolder boot.img > and press enter and that will repack your boot.img for you
*wherever you saw me type a > don't ever type that as I was just showing that you are done the command or syntax and your are ready to press enter.
Source code https://github.com/ModdingMyMind/mkbootimg_tools/commit/6c44267b4a8a43504c870678c68df6a31b8e2f18
Screenshot - https://www.dropbox.com/s/se171tzgnf6wp0q/Screenshot_2015-03-12-02-49-50.png?dl=0
Screenshot - https://www.dropbox.com/s/5bzt8p6l2ltosl6/Screenshot_2015-03-12-02-50-04.png?dl=0
Just in case..
1 more
Good looking on this. Its always good to see tutorials like this going up so others can profit
Tigerstown said:
Good looking on this. Its always good to see tutorials like this going up so others can profit
Click to expand...
Click to collapse
Thanks my dude
Thanks. I was working on getting my build environment up and running and learning how to do this. I'm sure this tutorial will help alot
Red_81 said:
Thanks. I was working on getting my build environment up and running and learning how to do this. I'm sure this tutorial will help alot
Click to expand...
Click to collapse
NP, that's what it's there for.. [emoji3]
Hello my friend! Nice to see you around here! Congratulations for your topic!!
leonardoafa said:
Hello my friend! Nice to see you around here! Congratulations for your topic!!
Click to expand...
Click to collapse
Appreciate it bro [emoji2]
cpio error
after gunzip -dc ramdisk.gz | cpio -i i got error cpio not found. I put cpio inside of bootfolder but still have same error.
artur0588 said:
cpio error
after gunzip -dc ramdisk.gz | cpio -i i got error cpio not found. I put cpio inside of bootfolder but still have same error.
Click to expand...
Click to collapse
Please inform me of what you are trying to do and with what ROM (stock or custom) are you using a custom kernel or recovery? Have you made any changes to the ramdisk. It's almost impossible to debug your situation without any info on what device your working on. cpio is statically compiled for our device and I posted screenshots of everything working flawlessly. Upload a screenshot of when you are getting the error because you should not have to cp cpio to any directory except for placing the ARM folder in data/local/tmp/ARM and make sure that you chmod 0755 on all subfolders and files but don't set execute on child files though.
Hello. I found that when I unpack and pack the boot.img, although I did nothing with the kernel, I still lose the baseband. The same thing happened when I use my PC and Linux. The size decreased by 2.5MB. I dont know why.
skulldreamz said:
Please inform me of what you are trying to do and with what ROM (stock or custom) are you using a custom kernel or recovery? Have you made any changes to the ramdisk. It's almost impossible to debug your situation without any info on what device your working on. cpio is statically compiled for our device and I posted screenshots of everything working flawlessly. Upload a screenshot of when you are getting the error because you should not have to cp cpio to any directory except for placing the ARM folder in data/local/tmp/ARM and make sure that you chmod 0755 on all subfolders and files but don't set execute on child files though.
Click to expand...
Click to collapse
Hello have you already try to change value in color température?!!!
Regards
JEZ69 said:
Hello have you already try to change value in color température?!!!
Regards
Click to expand...
Click to collapse
Were trying to get a solid base bug free and then we will start to implement extra features. We working smarter not harder with a kernel with features a-z to only come back and see people saying this doesn't work and this doesn't work. @RenderBroken has been blind deving and it's gonna be a couple days until he had his device in hand do please everyone be patient. Nothing ercks a Dev more than people rushing features when a foundation has not been set %100 solid yet. Thanks for your patience
Sent from my victara
skulldreamz said:
Were trying to get a solid base bug free and then we will start to implement extra features. We working smarter not harder with a kernel with features a-z to only come back and see people saying this doesn't work and this doesn't work. @RenderBroken has been blind deving and it's gonna be a couple days until he had his device in hand do please everyone be patient. Nothing ercks a Dev more than people rushing features when a foundation has not been set %100 solid yet. Thanks for your patience
Sent from my victara
Click to expand...
Click to collapse
Hello thank s for reply... I wait until you ready to give good work ...it s better way you re right...
@skulldreamz, just saw this thread. Not bad bro. Wanted to add that when you run the mkboot script alongside the binaries that it will automatically unpack the ramdisk as well just as long as the given image is properly supported of course. There is no need to unpack the ramdisk manually. In addition, the ramdisk will be repacked automatically when you use the mkboot script to rebuild the image also. Nice work.
Could you send source code to me?
Thanks for your great tutorial. But I have a problem on my phone. Could you send source code to me ? [email protected]
Not working on my Qualcomm Device....
Sent from my E using Tapatalk

compiling kernel for N920C. boot.img won't work

Hey guys,
I have been trying to compile the N920C 6.0.1 from the source. Just one time the kernel worked but only when I didn't change anything in menuconfig. If I change even a word in kernel it wont boot up. What am I doing wrong?
My source file : SM-N920C_SEA_MM_Opensource.zip
My firmware file : SM-N920C_N920CXXU2BPB6_CAM_HiepGia_Samsungviet.zip
I was using NDK for toolchain and Linaro. May there be something missing like a tool or may the toolchain be wrong??
"gcc-linaro-4.9-2015.02-3-x86_64_aarch64-linux-gnu.tar.xz" && "android-ndk-r11b-linux-x86_64.zip"
My Makefile setting was like:
Code:
ARCH ?= arm64
CROSS_COMPILE ?= /root/Desktop/ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-
After make cmd the output file comes non-compressed called "Image" which is in "arch/arm64/boot/" . Does it make any difference since its not compressed like zImages ?
What is the correct process for converting Image file to boot.img. I have tried both "mkbootimage" and "abootimage" any other way to make boot.img ? Which one is more suitable for my situation?
The process I'm doing is:
Code:
1-)Copy toolchain and source to Kali
2-)Extract kernel source and edit Makefile(for cross_compile)
3-)make ARCH=arm64 ******.defconfig
4-)make menuconfig && save && exit
5-)make ARCH=arm64
6-)Copy "arch/arm64/boot/Image" to another directory
7-)Extract original boot.img from firmware file and then "./split_boot boot.img" with mkbootimg tool
8-)Replace the old kernel file from the boot.img with the new one
9-)Edit /ramdisk/default.prop ====> ro.secure=0 and save
10-)compress ramdisk to gzip
11-) ./mkbootimg --kernel /boot.img-kernel --ramdisk /boot.img-ramdisk.cpio.gz --board SYSMAGIC000KU --base 0x10000000 --pagesize 2048 --ramdiskaddr 0x11000000 -o newboot.img
12-)Tar the newbootimg to flashable zip
13-)Flash it with odin.... Voilaaaa phone won't boot up. Stuck at Samsung Galaxy Note 5 screen:)
What is wrong here?
Please don't tell me to search in forum I have read all of the threads about building kernel. Each one is different from the other so I wanna know what is more suitable in my situation
I know I have asked to many questions but I would appreciate if someone could help me through IRC or some instant messaging service
noone knows ?
Come on guys I have still been waiting for an answer. There are already kernels made by other people in this forum so it must be possible
dewctr said:
Come on guys I have still been waiting for an answer. There are already kernels made by other people in this forum so it must be possible
Click to expand...
Click to collapse
in my opinion it s a problem related to the 'initrd' file..i m diving into chime for now and stucking ; let s converge our efforts to fix all issues with kernel compilation, if u r intressted just pm me.
for info:
initrd provides the capability to load a RAM disk by the boot loader.
This RAM disk can then be mounted as the root file system and programs
can be run from it. Afterwards, a new root file system can be mounted
from a different device. The previous root (from initrd) is then moved
to a directory and can be subsequently unmounted.
initrd is mainly designed to allow system startup to occur in two phases,
where the kernel comes up with a minimum set of compiled-in drivers, and
where additional modules are loaded from initrd.
This document gives a brief overview of the use of initrd. A more detailed
discussion of the boot process can be found in [1].
Operation
---------
When using initrd, the system typically boots as follows:
1) the boot loader loads the kernel and the initial RAM disk
2) the kernel converts initrd into a "normal" RAM disk and
frees the memory used by initrd
3) if the root device is not /dev/ram0, the old (deprecated)
change_root procedure is followed. see the "Obsolete root change
mechanism" section below.
4) root device is mounted. if it is /dev/ram0, the initrd image is
then mounted as root
5) /sbin/init is executed (this can be any valid executable, including
shell scripts; it is run with uid 0 and can do basically everything
init can do).
6) init mounts the "real" root file system
7) init places the root file system at the root directory using the
pivot_root system call
8) init execs the /sbin/init on the new root filesystem, performing
the usual boot sequence
9) the initrd file system is removed
Note that changing the root directory does not involve unmounting it.
It is therefore possible to leave processes running on initrd during that
procedure. Also note that file systems mounted under initrd continue to
be accessible.
---------- Post added at 12:26 PM ---------- Previous post was at 12:18 PM ----------
did u try with latest ubertc toolchain with latest gcc 5.3 compiler?
pm me for info
it is nice to see that someone has also been interested in this thing. Even though Im interested in it, unfortunately, my knowledge is not even a half of yours. I'm not sure how I can be helpful for you but if you ask me things to do, I am ready to apply them. I can try to be helpful with your assistance
Do you want me to try with the toolchain and GCC you mentioned above?
BTW I got it working once without doing any change in defconfig but I don't remember which toolchain I compiled it with. I don't get why it doesn't work when I do changes.

Categories

Resources