Android Tablets Forum banner

Helpful Links to Get Started with Firmware Development

62172 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
1 - 9 of 84 Posts
Hi fuser, i have a questions about repacking boot.img but no luck maybe you can give me direction for me to make unsecure boot.img.
I use unpack and repack.sh from patmoss (lokum rom) and try to remove initgoldfish.rc to keep new initramfs-cpio is less then original but still no luck maybe you can help me, thanks in advanced

Sent from my Aurora-II using Tapatalk
I read in this thread that you need to:

But I'm unsure of exactly how to modify the script and what part of it needs to be deleted. I haven't had any time to experiment with it lately. Let me know if you figure it out before I do.
Thanks for you're fast reply, now i must read first then try to modify the script


Sent from my Aurora-II using Tapatalk
See less See more
Hi fuser, how about the repack script? The unpack script work fine but still stuck on repack script

Sent from my Aurora-II using Tapatalk HD
2
Thanks for your'e fast reply
take your'e time bro, i try a lot of repack script but still no luck. I guess need more time to do some experiment ( as you said trial and error ).


Sent from my Aurora-II using Tapatalk HD
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
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
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
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


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
Thanks for your'e hard work CXZ with your'e first tools it run ok will try soon with your'e new tools, its working ok but will try your'e new tools soon


Sent from my Aurora-II using Tapatalk HD
See less See more
1 - 9 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