Android Tablets Forum banner

Helpful Links to Get Started with Firmware Development

62174 Views 83 Replies 8 Participants Last post by  walishahid967
Helpful Links - Firmware Development / Tweaking / Hacking

As you can see, Geodex just created the "Firmware / Development" sub-forum for us. I'm going to compile some useful links for new amateur developers. I am not a developer and have just starting learning about these things. At the very least these links should give people like me a starting point to check out what's inside the files that make up our firmware.

Elf II Source Code:- Since Ainol hasn't released the Crystal Source Code yet and the Crystal is basically an Elf II with a different screen and different WiFi chip, these should be useful starting points.
Ainol Official Release
fards github
My Development Tools Folder on MediaFire

At the moment I am just working with the stock firmware. You can download the stock firmware and then extract the .zip file to get started. I've been told the real development work is done in the kernel though. I'd like to get into the kernel and touchscreen drivers after I've created a stable custom ROM.

RESOURCES AND SCRIPTS

DragonDev's Learning Center - Not a lot here but this is where I write up things that I've learned along the way and post it for other people to learn as well.

XDA-University - Lots of great starter information from the people behind XDA-Developers.

XDA Developers Forum - One of the best places to do your research.

Android Terms, Slang and Definitions - Super handy for understanding terms you may not have run into before.

Update.zip - Ainol Zip Signer - Thanks to Soulflier we can easily sign our update.zip files. You'll need this to be able to make a flashable .zip file.

Unpack and Repack Boot.img - Thanks to Christian Troy for these scripts. You need them to be able unpack and repack the boot.img. They will also unpack and repack the uImage which, as far as I know, is the same thing. Here are some alternative scripts.

Add Root to your ROM - Thanks to Soulflier on this one. I packaged this as the files you need and the folders you need to move those files into. Then open the add-to-updater-script file and add the lines in there to your updater-script.

Add Init.d Support - These are the files and folders you need to add init.d support to your ROM.

Kernel Governors, Modules, I/O Schedulers, CPU Tweaks, AIO App Configs - Giant reference guide.

Alternate ways to Sign packages and ROM's - SignAPK or AutoSign. You would need to re-work them though with the signing keys from the Ainol Signer.

Decompile/Recompile Android applications - This may or may not end up being useful for customized Flash/YouTube/Netflix.

Creating your own UPDATE.zip - For adding or deleting apps from an UPDATE.zip.

SOFTWARE

Android Developer Tools (ADT) Bundle - This is the official Android SDK developers package.

Cygwin - Limited Linux capabilities and terminal in Windows.

dsixda's Android Kitchen, v0.218 - ROM Kitchen that runs in Cygwin. A collection of scripts to help you build/extract, deodex, root, zip-align, sign APK and ZIP files, etc. The boot.img extraction does not work and neither does the update.zip signing. I haven't figured out how to build the working scripts for those options into the Kitchen, so I use the stand alone versions listed in the scripts section. You'll also have to manually fix issues when converting between update-script (Amend) and updater-script (Edify), so you'll have to know how to read that and what to be looking for. What this kitchen will do is deodex your apps/framework and zipalign.

ONDA Kitchen - ROM Kitchen that works in Cygwin. Mostly works fine with the Crystal but it's not as stable as dsixda's kitchen. It seems to work better with the Crystal because it uses the same CPU as the ONDA (I think), but I get a lot of freezes/crashes using it.

VirtualBox - Run a complete Linux operating system inside of Windows.

Ubuntu - This is one of the Linux operating systems I've used over the years. I've found it to be one of the easier ones to get used to if you've never used Linux before.

Linux Mint - Another Linux OS that looks pretty nice and seemed easy to get adjusted to but I ended up going back to Ubuntu.
See less See more
  • Like
Reactions: 5
41 - 60 of 84 Posts
Okay, let us figure out how this unpack and repack with boot.img/recovery.img work. I'm only a beginner in linux stuff, but all together we have a chance to find the solution.
These are the scripts for a start from the first page http://www.mediafire.com/?al8yy1v5f4v6jxr

I start with the unpacking tool. That seems to be always the same one in internet.

Code:
[email protected]:~/amlogic/boot_pack# ./unpack.sh boot.img<br />
Checking for uImage magic word...<br />
1+0 records in<br />
0+1 records out<br />
4 bytes (4 <img src='http://www.slatedroid.com/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' /> copied, 0.000414124 s, 9.7 kB/s<br />
uImage recognized.<br />
Extracting data...<br />
56251+1 records in<br />
7031+1 records out<br />
3600101 bytes (3.6 MB) copied, 0.437504 s, 8.2 MB/s<br />
Checking for ARM mach-type...<br />
3+0 records in<br />
0+1 records out<br />
3 bytes (3 <img src='http://www.slatedroid.com/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' /> copied, 0.000424253 s, 7.1 kB/s<br />
Checking for zImage...<br />
1+0 records in<br />
0+1 records out<br />
4 bytes (4 <img src='http://www.slatedroid.com/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' /> copied, 5.693e-05 s, 70.3 kB/s<br />
>>> boot.img extracted to Image<br />
>>> Image unlzma'd to Image-ext<br />
Extracting initramfs image (start = 154600, end = 2300000)<br />
2145400+0 records in<br />
2145400+0 records out<br />
2145400 bytes (2.1 MB) copied, 38.8765 s, 55.2 kB/s<br />
4191 blocks<br />
initramfs.cpio extracted<br />
[email protected]:~/amlogic/boot_pack# <br />
Any comments to that part?

Code:
[email protected]:~/amlogic/boot_pack# ./repack_boot.sh<br />
bash: ./repack_boot.sh: /bin/sh^M: bad interpreter: No such file or directory<br />
[email protected]:~/amlogic/boot_pack# ./repack_boot.sh boot.new<br />
bash: ./repack_boot.sh: /bin/sh^M: bad interpreter: No such file or directory<br />
[email protected]:~/amlogic/boot_pack# ./repack_boot.sh boot.img<br />
bash: ./repack_boot.sh: /bin/sh^M: bad interpreter: No such file or directory<br />
[email protected]:~/amlogic/boot_pack# ./repack_boot.sh ./boot_pack<br />
bash: ./repack_boot.sh: /bin/sh^M: bad interpreter: No such file or directory<br />
[email protected]:~/amlogic/boot_pack# <br />
This happens with the repack_boot from the fuser-invent link. Any suggestions? What means the bad interpreter? Do I need an extra package in the /bin?

Now I will use the repack script from here http://www.slatedroid.com/topic/41030-recovery-twrp-v2410/page__view__findpost__p__558354

Code:
[email protected]:~/amlogic/boot_pack# ./repack.sh<br />
.<br />
./init<br />
./init.factorytest.rc<br />
./ueventd.amlogic.rc<br />
./init.usb.rc<br />
./boot<br />
./boot/ump.ko<br />
./boot/mali.ko<br />
./ueventd.goldfish.rc<br />
./system<br />
./ueventd.rc<br />
./dev<br />
./initlogo.rle.bak<br />
./init.goldfish.rc<br />
./proc<br />
./sbin<br />
./sbin/adbd<br />
./sbin/ueventd<br />
./sys<br />
./data<br />
./default.prop<br />
./init.rc<br />
./init.trace.rc<br />
4191 blocks<br />
New initramfs is too big (2145792 vs 2145400)<br />
[email protected]:~/amlogic/boot_pack# <br />
I got this result, if I change nothing in the unpacked boot.img.

Now I will take out the initlogo.rle for example.
Code:
[email protected]:~/amlogic/boot_pack# ./repack.sh<br />
.<br />
./init<br />
./init.factorytest.rc<br />
./ueventd.amlogic.rc<br />
./init.usb.rc<br />
./boot<br />
./boot/ump.ko<br />
./boot/mali.ko<br />
./ueventd.goldfish.rc<br />
./system<br />
./ueventd.rc<br />
./dev<br />
./init.goldfish.rc<br />
./proc<br />
./sbin<br />
./sbin/adbd<br />
./sbin/ueventd<br />
./sys<br />
./data<br />
./default.prop<br />
./init.rc<br />
./init.trace.rc<br />
4163 blocks<br />
New initramfs is 2131456 bytes (13944 bytes spare)<br />
Adding padding to end of initramfs.new.cpio<br />
13944+0 records in<br />
13944+0 records out<br />
13944 bytes (14 kB) copied, 0.191176 s, 72.9 kB/s<br />
Adding initramfs.new.cpio to kernel (start = 154600, end = 2300000)<br />
154600+0 records in<br />
154600+0 records out<br />
154600 bytes (155 kB) copied, 2.89475 s, 53.4 kB/s<br />
7917508+0 records in<br />
7917508+0 records out<br />
7917508 bytes (7.9 MB) copied, 151.405 s, 52.3 kB/s<br />
Compressing kernel to LZMA<br />
Making uImage<br />
./repack.sh: line 36: mkimage: command not found<br />
[email protected]:~/amlogic/boot_pack# <br />
The result is no new image file repack in the last line of the script.
Thats enough for today. Hopefully someone has an idea for getting closer to an solution for crystal.

JDfense
See less See more
Okay, let us figure out how this unpack and repack with boot.img/recovery.img work. I'm only a beginner in linux stuff, but all together we have a chance to find the solution.
These are the scripts for a start from the first page http://www.mediafire.com/?al8yy1v5f4v6jxr

I start with the unpacking tool. That seems to be always the same one in internet.

Code:
[email protected]:~/amlogic/boot_pack# ./unpack.sh boot.img<br />
Checking for uImage magic word...<br />
1+0 records in<br />
0+1 records out<br />
4 bytes (4 <img src='http://www.slatedroid.com/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' /> copied, 0.000414124 s, 9.7 kB/s<br />
uImage recognized.<br />
Extracting data...<br />
56251+1 records in<br />
7031+1 records out<br />
3600101 bytes (3.6 MB) copied, 0.437504 s, 8.2 MB/s<br />
Checking for ARM mach-type...<br />
3+0 records in<br />
0+1 records out<br />
3 bytes (3 <img src='http://www.slatedroid.com/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' /> copied, 0.000424253 s, 7.1 kB/s<br />
Checking for zImage...<br />
1+0 records in<br />
0+1 records out<br />
4 bytes (4 <img src='http://www.slatedroid.com/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' /> copied, 5.693e-05 s, 70.3 kB/s<br />
>>> boot.img extracted to Image<br />
>>> Image unlzma'd to Image-ext<br />
Extracting initramfs image (start = 154600, end = 2300000)<br />
2145400+0 records in<br />
2145400+0 records out<br />
2145400 bytes (2.1 MB) copied, 38.8765 s, 55.2 kB/s<br />
4191 blocks<br />
initramfs.cpio extracted<br />
[email protected]:~/amlogic/boot_pack# <br />
Any comments to that part?

Code:
[email protected]:~/amlogic/boot_pack# ./repack_boot.sh<br />
bash: ./repack_boot.sh: /bin/sh^M: bad interpreter: No such file or directory<br />
[email protected]:~/amlogic/boot_pack# ./repack_boot.sh boot.new<br />
bash: ./repack_boot.sh: /bin/sh^M: bad interpreter: No such file or directory<br />
[email protected]:~/amlogic/boot_pack# ./repack_boot.sh boot.img<br />
bash: ./repack_boot.sh: /bin/sh^M: bad interpreter: No such file or directory<br />
[email protected]:~/amlogic/boot_pack# ./repack_boot.sh ./boot_pack<br />
bash: ./repack_boot.sh: /bin/sh^M: bad interpreter: No such file or directory<br />
[email protected]:~/amlogic/boot_pack# <br />
This happens with the repack_boot from the fuser-invent link. Any suggestions? What means the bad interpreter? Do I need an extra package in the /bin?

Now I will use the repack script from here http://www.slatedroid.com/topic/41030-recovery-twrp-v2410/page__view__findpost__p__558354

Code:
[email protected]:~/amlogic/boot_pack# ./repack.sh<br />
.<br />
./init<br />
./init.factorytest.rc<br />
./ueventd.amlogic.rc<br />
./init.usb.rc<br />
./boot<br />
./boot/ump.ko<br />
./boot/mali.ko<br />
./ueventd.goldfish.rc<br />
./system<br />
./ueventd.rc<br />
./dev<br />
./initlogo.rle.bak<br />
./init.goldfish.rc<br />
./proc<br />
./sbin<br />
./sbin/adbd<br />
./sbin/ueventd<br />
./sys<br />
./data<br />
./default.prop<br />
./init.rc<br />
./init.trace.rc<br />
4191 blocks<br />
New initramfs is too big (2145792 vs 2145400)<br />
[email protected]:~/amlogic/boot_pack# <br />
I got this result, if I change nothing in the unpacked boot.img.

Now I will take out the initlogo.rle for example.
Code:
[email protected]:~/amlogic/boot_pack# ./repack.sh<br />
.<br />
./init<br />
./init.factorytest.rc<br />
./ueventd.amlogic.rc<br />
./init.usb.rc<br />
./boot<br />
./boot/ump.ko<br />
./boot/mali.ko<br />
./ueventd.goldfish.rc<br />
./system<br />
./ueventd.rc<br />
./dev<br />
./init.goldfish.rc<br />
./proc<br />
./sbin<br />
./sbin/adbd<br />
./sbin/ueventd<br />
./sys<br />
./data<br />
./default.prop<br />
./init.rc<br />
./init.trace.rc<br />
4163 blocks<br />
New initramfs is 2131456 bytes (13944 bytes spare)<br />
Adding padding to end of initramfs.new.cpio<br />
13944+0 records in<br />
13944+0 records out<br />
13944 bytes (14 kB) copied, 0.191176 s, 72.9 kB/s<br />
Adding initramfs.new.cpio to kernel (start = 154600, end = 2300000)<br />
154600+0 records in<br />
154600+0 records out<br />
154600 bytes (155 kB) copied, 2.89475 s, 53.4 kB/s<br />
7917508+0 records in<br />
7917508+0 records out<br />
7917508 bytes (7.9 MB) copied, 151.405 s, 52.3 kB/s<br />
Compressing kernel to LZMA<br />
Making uImage<br />
./repack.sh: line 36: mkimage: command not found<br />
[email protected]:~/amlogic/boot_pack# <br />
The result is no new image file repack in the last line of the script.
Thats enough for today. Hopefully someone has an idea for getting closer to an solution for crystal.

JDfense
I'm facing a same problem, when i try to make unsecure boot img from aurora II stock ROM

Sent from my Aurora-II using Tapatalk HD
Thx cxz, that could be the cause. Need that extra command in the /bin directory for the final repack, I'll check this out later.

JDfense
Here is a tool I just put together. Hope it works alright... (it's almost 4 a.m. here... --->
)
It contains needed Cygwin files, modified sh scripts and a Windows batch file to run them.

http://yadi.sk/d/YJ9dYZUS2ux5v
Thanks for the tools gonna try as soon as posible


Sent from my Aurora-II using Tapatalk HD
See less See more
Here is a tool I just put together. Hope it works alright... (it's almost 4 a.m. here... --->
)
It contains needed Cygwin files, modified sh scripts and a Windows batch file to run them.

http://yadi.sk/d/YJ9dYZUS2ux5v
Thanks cxz.

Here comes the result of the test. The Christian Troy script failed with repack again with the message
Code:
New initramfs is too big (2145792 vs 2145400)
I have copied the mkimage file in the work directory and the Linux system /bin directory.
Anyway no choice with the repack script.

After that I tried your batch script in cygwin. Congratulations, it seem to look fine accept of one point. The original file is larger than the repacked file, but I had nothing changed in the unpacked boot.img.
3.600.165MB original boot.img
3.598.963MB original boot.img.new

Here comes the script run.
Code:
================================================<br />
uImage/_recovery unpack-repack batch file by cxz<br />
<br />
About to run unpacking-sh-script. Target file:<br />
C:\cygwin\home\crystalpack\boot.img<br />
<br />
Removes uImage-tmp and initramfs directories!<br />
(press Ctrl+C to cancel)<br />
================================================<br />
Drücken Sie eine beliebige Taste . . .<br />
<br />
Unpacking<br />
C:\cygwin\home\crystalpack\boot.img<br />
================================================<br />
<br />
Checking for uImage magic word...<br />
cygwin warning:<br />
  MS-DOS style path detected: C:\cygwin\home\crystalpack\boot.img<br />
  Preferred POSIX equivalent is: /boot.img<br />
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.<br />
  Consult the user's guide for more details about POSIX paths:<br />
    [URL=http://cygwin.com/cygwin-ug-net/using]http://cygwin.com/cygwin-ug-net/using[/URL].html#using-pathnames<br />
1+0 records in<br />
0+1 records out<br />
4 bytes (4 <img src='http://www.slatedroid.com/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' /> copied, 7.1797e-05 s, 55.7 kB/s<br />
uImage recognized.<br />
Extracting data...<br />
56251+1 records in<br />
7031+1 records out<br />
3600101 bytes (3.6 MB) copied, 0.120966 s, 29.8 MB/s<br />
Checking for ARM mach-type...<br />
3+0 records in<br />
0+1 records out<br />
3 bytes (3 <img src='http://www.slatedroid.com/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' /> copied, 0.000122082 s, 24.6 kB/s<br />
Checking for zImage...<br />
1+0 records in<br />
0+1 records out<br />
4 bytes (4 <img src='http://www.slatedroid.com/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' /> copied, 0.000127949 s, 31.3 kB/s<br />
>>> C:\cygwin\home\crystalpack\boot.img extracted to Image<br />
>>> Image unlzma'd to Image-ext<br />
Extracting initramfs image (start = 154600, end = 2300000)<br />
2145400+0 records in<br />
2145400+0 records out<br />
2145400 bytes (2.1 MB) copied, 15.9616 s, 134 kB/s<br />
initlogo.rle.bak<br />
sbin<br />
sbin/ueventd<br />
sbin/adbd<br />
sys<br />
system<br />
init.factorytest.rc<br />
proc<br />
default.prop<br />
dev<br />
ueventd.goldfish.rc<br />
data<br />
ueventd.rc<br />
init.rc<br />
ueventd.amlogic.rc<br />
init.usb.rc<br />
init.trace.rc<br />
boot<br />
boot/ump.ko<br />
boot/mali.ko<br />
init.goldfish.rc<br />
init<br />
4191 blocks<br />
initramfs.cpio extracted<br />
<br />
<br />
================================================<br />
Unpacking done!<br />
Now edit initramfs and press any key when done.<br />
<br />
Press Ctrl+C to cancel now without repacking.<br />
================================================<br />
<br />
Repacking<br />
C:\cygwin\home\crystalpack\boot.img<br />
================================================<br />
<br />
cygwin warning:<br />
  MS-DOS style path detected: C:\cygwin\home\crystalpack\boot.img<br />
  Preferred POSIX equivalent is: /boot.img<br />
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.<br />
  Consult the user's guide for more details about POSIX paths:<br />
    [URL=http://cygwin.com/cygwin-ug-net/using]http://cygwin.com/cygwin-ug-net/using[/URL].html#using-pathnames<br />
1+0 records in<br />
0+1 records out<br />
32 bytes (32 <img src='http://www.slatedroid.com/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' /> copied, 0.000112025 s, 286 kB/s<br />
boot<br />
boot/mali.ko<br />
boot/ump.ko<br />
data<br />
default.prop<br />
dev<br />
init<br />
init.factorytest.rc<br />
init.goldfish.rc<br />
init.rc<br />
init.trace.rc<br />
init.usb.rc<br />
initlogo.rle.bak<br />
proc<br />
sbin<br />
sbin/adbd<br />
sbin/ueventd<br />
sys<br />
system<br />
ueventd.amlogic.rc<br />
ueventd.goldfish.rc<br />
ueventd.rc<br />
4191 blocks<br />
2145400+0 records in<br />
2145400+0 records out<br />
2145400 bytes (2.1 MB) copied, 16.2973 s, 132 kB/s<br />
New initramfs is 2145400 bytes (0 bytes spare)<br />
Adding padding to end of initramfs.new.cpio<br />
0+0 records in<br />
0+0 records out<br />
0 bytes (0 <img src='http://www.slatedroid.com/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' /> copied, 2.3746e-05 s, 0.0 kB/s<br />
Adding initramfs.new.cpio to kernel (start = 154600, end = 2300000)<br />
154600+0 records in<br />
154600+0 records out<br />
154600 bytes (155 kB) copied, 1.3845 s, 112 kB/s<br />
7917508+0 records in<br />
7917508+0 records out<br />
7917508 bytes (7.9 MB) copied, 29.3055 s, 270 kB/s<br />
Compressing kernel to LZMA<br />
Making uImage<br />
Image Name:   Linux-3.0.8-g710665b-dirty<br />
Created:      Wed Feb 27 22:22:56 2013<br />
Image Type:   ARM Linux Kernel Image (lzma compressed)<br />
Data Size:    3595355 Bytes = 3511.09 kB = 3.43 MB<br />
Load Address: 80008000<br />
Entry Point:  80008000<br />
<br />
<br />
================================================<br />
Repacking done! Output file:<br />
C:\cygwin\home\crystalpack\boot.img.new<br />
<br />
Removing uImage-tmp files. ( Ctrl+C to cancel )<br />
================================================<br />
Drücken Sie eine beliebige Taste . . .
Do you think the new boot.img will work. I would try to change something, maybe the bootlogo.rle in the next step and repack the boot.img. Then it would be time for the first flashing.

JDfense
See less See more
Thanks cxz.

Here comes the result of the test. The Christian Troy script failed with repack again with the message
Code:
New initramfs is too big (2145792 vs 2145400)
I have copied the mkimage file in the work directory and the Linux system /bin directory.
Anyway no choice with the repack script.

After that I tried your batch script in cygwin. Congratulations, it seem to look fine accept of one point. The original file is larger than the repacked file, but I had nothing changed in the unpacked boot.img.
3.600.165MB original boot.img
3.598.963MB original boot.img.new

Here comes the script run.
Code:
================================================<br />
uImage/_recovery unpack-repack batch file by cxz<br />
<br />
About to run unpacking-sh-script. Target file:<br />
C:\cygwin\home\crystalpack\boot.img<br />
<br />
Removes uImage-tmp and initramfs directories!<br />
(press Ctrl+C to cancel)<br />
================================================<br />
Drücken Sie eine beliebige Taste . . .<br />
<br />
Unpacking<br />
C:\cygwin\home\crystalpack\boot.img<br />
================================================<br />
<br />
Checking for uImage magic word...<br />
cygwin warning:<br />
  MS-DOS style path detected: C:\cygwin\home\crystalpack\boot.img<br />
  Preferred POSIX equivalent is: /boot.img<br />
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.<br />
  Consult the user's guide for more details about POSIX paths:<br />
    [URL=http://cygwin.com/cygwin-ug-net/using]http://cygwin.com/cygwin-ug-net/using[/URL].html#using-pathnames<br />
1+0 records in<br />
0+1 records out<br />
4 bytes (4 <img src='http://www.slatedroid.com/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' /> copied, 7.1797e-05 s, 55.7 kB/s<br />
uImage recognized.<br />
Extracting data...<br />
56251+1 records in<br />
7031+1 records out<br />
3600101 bytes (3.6 MB) copied, 0.120966 s, 29.8 MB/s<br />
Checking for ARM mach-type...<br />
3+0 records in<br />
0+1 records out<br />
3 bytes (3 <img src='http://www.slatedroid.com/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' /> copied, 0.000122082 s, 24.6 kB/s<br />
Checking for zImage...<br />
1+0 records in<br />
0+1 records out<br />
4 bytes (4 <img src='http://www.slatedroid.com/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' /> copied, 0.000127949 s, 31.3 kB/s<br />
>>> C:\cygwin\home\crystalpack\boot.img extracted to Image<br />
>>> Image unlzma'd to Image-ext<br />
Extracting initramfs image (start = 154600, end = 2300000)<br />
2145400+0 records in<br />
2145400+0 records out<br />
2145400 bytes (2.1 MB) copied, 15.9616 s, 134 kB/s<br />
initlogo.rle.bak<br />
sbin<br />
sbin/ueventd<br />
sbin/adbd<br />
sys<br />
system<br />
init.factorytest.rc<br />
proc<br />
default.prop<br />
dev<br />
ueventd.goldfish.rc<br />
data<br />
ueventd.rc<br />
init.rc<br />
ueventd.amlogic.rc<br />
init.usb.rc<br />
init.trace.rc<br />
boot<br />
boot/ump.ko<br />
boot/mali.ko<br />
init.goldfish.rc<br />
init<br />
4191 blocks<br />
initramfs.cpio extracted<br />
<br />
<br />
================================================<br />
Unpacking done!<br />
Now edit initramfs and press any key when done.<br />
<br />
Press Ctrl+C to cancel now without repacking.<br />
================================================<br />
<br />
Repacking<br />
C:\cygwin\home\crystalpack\boot.img<br />
================================================<br />
<br />
cygwin warning:<br />
  MS-DOS style path detected: C:\cygwin\home\crystalpack\boot.img<br />
  Preferred POSIX equivalent is: /boot.img<br />
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.<br />
  Consult the user's guide for more details about POSIX paths:<br />
    [URL=http://cygwin.com/cygwin-ug-net/using]http://cygwin.com/cygwin-ug-net/using[/URL].html#using-pathnames<br />
1+0 records in<br />
0+1 records out<br />
32 bytes (32 <img src='http://www.slatedroid.com/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' /> copied, 0.000112025 s, 286 kB/s<br />
boot<br />
boot/mali.ko<br />
boot/ump.ko<br />
data<br />
default.prop<br />
dev<br />
init<br />
init.factorytest.rc<br />
init.goldfish.rc<br />
init.rc<br />
init.trace.rc<br />
init.usb.rc<br />
initlogo.rle.bak<br />
proc<br />
sbin<br />
sbin/adbd<br />
sbin/ueventd<br />
sys<br />
system<br />
ueventd.amlogic.rc<br />
ueventd.goldfish.rc<br />
ueventd.rc<br />
4191 blocks<br />
2145400+0 records in<br />
2145400+0 records out<br />
2145400 bytes (2.1 MB) copied, 16.2973 s, 132 kB/s<br />
New initramfs is 2145400 bytes (0 bytes spare)<br />
Adding padding to end of initramfs.new.cpio<br />
0+0 records in<br />
0+0 records out<br />
0 bytes (0 <img src='http://www.slatedroid.com/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' /> copied, 2.3746e-05 s, 0.0 kB/s<br />
Adding initramfs.new.cpio to kernel (start = 154600, end = 2300000)<br />
154600+0 records in<br />
154600+0 records out<br />
154600 bytes (155 kB) copied, 1.3845 s, 112 kB/s<br />
7917508+0 records in<br />
7917508+0 records out<br />
7917508 bytes (7.9 MB) copied, 29.3055 s, 270 kB/s<br />
Compressing kernel to LZMA<br />
Making uImage<br />
Image Name:   Linux-3.0.8-g710665b-dirty<br />
Created:      Wed Feb 27 22:22:56 2013<br />
Image Type:   ARM Linux Kernel Image (lzma compressed)<br />
Data Size:    3595355 Bytes = 3511.09 kB = 3.43 MB<br />
Load Address: 80008000<br />
Entry Point:  80008000<br />
<br />
<br />
================================================<br />
Repacking done! Output file:<br />
C:\cygwin\home\crystalpack\boot.img.new<br />
<br />
Removing uImage-tmp files. ( Ctrl+C to cancel )<br />
================================================<br />
Drücken Sie eine beliebige Taste . . .
Do you think the new boot.img will work. I would try to change something, maybe the bootlogo.rle in the next step and repack the boot.img. Then it would be time for the first flashing.

JDfense
Wow you have try it and it work for ya, big thanks to cxz for bring the working tools


Sent from my Aurora-II using Tapatalk HD
See less See more
Awesome work cxz, thanks!
2
Here is a tool I just put together. Hope it works alright... (it's almost 4 a.m. here... --->
)
It contains needed Cygwin files, modified sh scripts and a Windows batch file to run them.

http://yadi.sk/d/YJ9dYZUS2ux5v
Confirm the tools are really working with my Aurora II
, now I can edit my boot.img correctly many thanks for CXZ and fuser for helpfull link in this thread
See less See more
Nice to know that it works for others too...


Here comes the result of the test. The Christian Troy script failed with repack again with the message
Code:
New initramfs is too big (2145792 vs 2145400)
I have copied the mkimage file in the work directory and the Linux system /bin directory.
Anyway no choice with the repack script.

After that I tried your batch script in cygwin. Congratulations, it seem to look fine accept of one point. The original file is larger than the repacked file, but I had nothing changed in the unpacked boot.img.
3.600.165MB original boot.img
3.598.963MB original boot.img.new

Do you think the new boot.img will work. I would try to change something, maybe the bootlogo.rle in the next step and repack the boot.img. Then it would be time for the first flashing.
That old repack script packs also the root dir . to the cpio package. -> too big error
I substituted that bug with my own, it works but doesn't include file names starting with "." ...
I'll fix it soon but if needed before just change "find * -print0" -> "find . -mindepth 1 -print0" on line 12.

The size can vary because the files are not in the same order inside cpio. Also lzma options/versions may be different...

Keep us updated about that logo project... I tried with initlogo.rle.bak but I couldn't get a picture out of it.
See less See more
Yeah, I'd like to know how to extract the logo image, edit it and then repackage it as a .rle.bak file. So if anyone figures that out please post your solution here.

Also, does anyone know how to take a boot.img and recovery.img that was extracted from a device via ROM dump and convert to to a uImage of the correct size? I'm trying to help some people with a Karbonn Smart Tab but there is no official stock firmware release. I have the extracted files but they aren't recognized as uImage files.
Also, does anyone know how to take a boot.img and recovery.img that was extracted from a device via ROM dump and convert to to a uImage of the correct size? I'm trying to help some people with a Karbonn Smart Tab but there is no official stock firmware release. I have the extracted files but they aren't recognized as uImage files.
If they have different headers they might need different scripts... or some manual labour...
But do you have to edit them? If not, why not just write them to the partitions as they are...

If you want to do the trimming, correct sha1 sums for them might hide inside etc/install-recovery.sh script...
Okay, I figured out how convert initlogo.rle.bak to a raw and back.
There are many posts about the subject, usually without rle -> raw conversion.

The tools needed are from565 (for rle -> raw) and to565 (for raw -> rle)
Other names for them: 5652rgb and rgb2565.

Usage:
from565.exe -rle < initlogo.rle.bak > initlogo.raw
to565.exe -rle < initlogo.raw > initlogo.rle.new

To edit raw images one can use free tools like IrfanView.
Or Imagemagick to convert the file type for editing:

convert -depth 8 -size 1024x600 rgb:initlogo.raw initlogo.png
convert -depth 8 initlogo.png rgb:initlogo.raw # seem to do -depth 8 even without it...

Here is one place to download them for windows: https://github.com/OlegKyiashko/RK29kitchen/tree/master/win
The cygwin1.dll file is also needed...

@fuser: there is also abootimg.exe that you can use to check those boot images you asked about, that is,
if they are those that have the 2048 byte ANDROID! header, "page" or whatever it is. Our tab doesn't have it
for some reason... You really should have given more info about them (and files perhaps) if you want more than
blind guessing... Hopefully the program gives the sizes you wanted although those sha1 sums would be good to
have too in case of dump errors. (Don't know if there is some check sums in the headers too...)
(BTW, the 64 byte header (having the image name) also contains the size(-64) written in hex, bytes 14-16)

edit: in 64 byte header the bytes 19-22 contain crc-32 sum of lzma (should probably read some manual about the structure(s))
See less See more
  • Like
Reactions: 1
Confirm the tools are really working with my Aurora II
, now I can edit my boot.img correctly many thanks for CXZ and fuser for helpfull link in this thread


An updated version of uImage/_recovery unpack-repack batch file

- previously mentioned little bug is now fixed
- running from command prompt also works correctly
- added gzip to make cpio package smaller if it doesn't fit anymore
- cpio package size is now correctly calculated (-> a tiny amount of more space for a new package if needed badly)
- made more changes to sh scripts to make them to run faster...

The download link is the same: http://yadi.sk/d/YJ9dYZUS2ux5v
See less See more
  • Like
Reactions: 2
Hey cxz, you have done it again. Thank you very much.
Now its time to try a bootlogo change.

By the way, what does your oven know about a Linux for amlogic devices.

Ubuntu touch comes up - early state of course, but for a Linux guy there is maybe some insperation inside.

JDfense
See less See more
Oven knows not much about the Linux... and baked a bit burned cake again...

Just re-checked the script because of bad vibes, and yes I somehow managed to put
a half done unpacking file to the package. It cuts (*) the cpio pretty much like
before, not good... Sorry! A fixed version of this version is now uploaded...

Hopefully it works now correctly...

edit:
(*)in the worst case
I had no time to check so fare and I see it is tricky stuff.
I think, we have to wait for ubuntu touch, its to early, works not really for tegra3.
JDfense
So here is an example of what I was talking about with the boot.img not being recognized as a uImage. This is the boot..img from the latest Ainol Fire ROM but it won't extract. The package is built to be used with the AML USB burning software so that might be part of the problem.
41 - 60 of 84 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top