Linux in Android! DesirAPT is at Beta Test! [9 Feb] - Desire Android Development

Well, as an introduction to topic, you could read the following entry:
http://forum.xda-developers.com/showthread.php?t=1296186
So far, when using "-static" directive for compiler, the applications could be compiled without doing of these steps, so why do I try this? Well, a statically linked executable is embedding all the required libraries to itself, so it's generally too huge. Also, if you compile all the applications statically, you probably link the same library (like C library, for instance) twice or more for every application you compile. This is definitely unnecessary.
It's why, for a few days now, I'm trying to compile the whole GlibC suite for Android (ARM devices, to be precise). The motive behind it is simple: since all Linux applications rely on full-fledged C library (rather than trimmed version like Bionic), if I compile it for this device, I can run every application; given that its compiled for the device.
Since it's Linux kernel underneath, we don't have to worry about changing whole system from Android to native Linux (hopefully )
So far what I did was following (I'm going to write the steps more systematically once I've time, so don't worry if those steps are too vague for you ):
1- Make a toolchain for ARMv7 architecture (which Desire CPU rely on). You can use crosstool-ng etc. or (if you're masochistic enough ) try to make your own.
2- Compile GlibC with this new toolchain of yours, store the compiled libraries in a folder where you can easily access (I keep mine at Desktop/glibc-arm for instance)
3- Edit Ramdisk of the Kernel. To do this, first you must extract the boot.img; then extract the ramdisk, edit init.rc to accordingly, so the libraries can be searched in a folder other than /system/lib (say, /data/lib). You can tweak PATH env-variable while you're at it as well . This is necessary because /system partition isn't big enough to carry all GlibC lib in it, so we can copy the library to some other folder (like /data/lib) and then make the system search for libraries there as well. The point is, since I'm using Data2ext; my data is large enough for this. I'd recommend the same to you if you're willing to go on this road.
After the editing of init.rc, reconstruct ramdisk; make a boot.img with it and flash it to the device.
4- Copy the libraries to the folder of you picked.
5- Compile some test apps (like Hello world etc ) with your cross compiler and place them to your device as well.
6- Test if they're running.
What I've found so far, the cross compiled executable (like simple Hello world), when dynamically linked, gives "no such file or directory" error when tried to be run at the device (WTF, right ). However, when when I do run it with the cross-compiled ld-linux.so (the linker of C library) it runs perfectly. So what I should do to overcome this is, somehow inform the system that this ld-linux.so binary should be used.
I'll keep you updated as I try new things
Till next time, happy Android'ing
ADDENDUM 1:
EUREKA! Found the solution! It's as simple as symbolically linking the library folder of your GlibC as /lib to root file system. You can edit ramdisk accordingly to do this process automatically.
Another thing I'm going to try is finding a way to change the path of the dynamic-linker option of my cross compiler accordingly. Apparently, the cause of the problem was the compiler, telling the application to look for the dynamical linker at /lib/ld-linux.so.3; while it was at /data/lib (in my case). I can put ld-linux.so.3 to /system/lib and change compiler accordingly; but I don't know which way would be the best for flexibility: symbolic linking of /lib to library dir; or putting dynamic linker to /system/lib (the dynamic linker can look for libraries at the "custom" libdir already, since $LD_LIBRARY_PATH is already showing it).
Will try some tweaks now. If I can make it all work, I'll see if I can make a flashable zip or something (also will write whole process step by step
-------------------------------------
ADDENDUM 2!!
Well, I kept you waiting a lot, but wow, was this process head spinning. This was the first time I actually wrote a recovery script; first time I had to use AWK, SED or regex; and first time I wrote such a long scripts Well, whatever, we're done for now..
There are two zip files attached to the end of this thread: One is an installer and other is uninstaller. Just flash the recovery zip and reboot the phone. Your native C or C++ applications should run flawlessly (only added support for this two language for now) if all other dependencies are also met
Happy Android'ing guys; and well, I'd appreciate if you'd buy me a beer for that (or just click thanks, or just say thanks.. If you did all of those, you're my hero )
Here is the hero of the post :
Glibc for Android v0.9.5
Uninstaller for GlibC
NOTE: Uninstallers erase only files, not directories. Ergo, you might need to erase them yourself (had to do it for not to erase your own binaries and such).
HERE'S HOW YOU'RE GOING TO MAKE TOOLCHAIN YOURSELF (making a toolchain):
http://forum.xda-developers.com/showpost.php?p=18356849&postcount=5
CHANGELOG
Code:
Version 0.9.5:
* Ramdisk-boot image editing tools are included in the package, for some systems might not have it.
-------------------
Version 0.9.4:
* A bugfix for a script syntax error which causes GlibC to pass the installation checks but make binaries give "not found" error.
* A bugfix for Bash, not working well, so causing system to freeze at boot.
-------------------
Version 0.9.3:
* A major bugfix for the bug that was causing bootloops.
* A bugfix for scripting errors inside the recovery zip, causing half-installation
-------------------
Version 0.9.2:
* A small patch added that will allow GlibC to be installed with Apt-get without problems.
* Made compatible with the Sibere's new Data2SD solutions
-------------------
Version 0.9:
* Moved configuration files from /data/etc to /system/etc
-------------------
Version 0.8.1:
* Removed a symlink which may cause some Android apps use wrong version of library.
-------------------
Version 0.8:
* Complete recompilation.
-------------------
Version 0.7:
* Fixed a bug which causes Sibere's Data2sd unrecognized if Droidzone's flasher is not used
* Fixed a bug with the installation of locales.
* Included a basic busybox binary and flash_image to make library installation successfull in all recovery systems - was causing problems in some systems
-------------------
Version 0.6:
* Standart C++, MPRF, GMG and MPC libraries are added to the package
* Library profiling support is added
* All libraries are recompiled with PIC (position independent code) for better portability.
-------------------
Version 0.5:
* LibGD included in package - it's a picture manipulation library
* GlibC Version 2.14 - I'm sure even your Ubuntu-Debian machines have older versions now :)
* Locale support added. Your C/C++ programs can use it freely.
-------------------
Version 0.4:
* /tmp support added, necessary configurations are done
* Package manager support is implemented, allows users to install to both MTD and SD-ext in coexistent way (no more had to choose!).
* Developed a flexible structure, thus allowing libraries to be installed with a helper application (it's going to be shipped later)
-------------------
Version 0.3:
* Stripped libraries and binaries for make them smaller
-------------------
Version 0.2:
* Installs to the MTD Partition instead of sd-ext. Needed for inital-time programs to run correctly.
-------------------
Version 0.1:
* Initial version
-----------------------------------------------------
Thank you very much for donations of:
Mr. Brochard and Mr. Huemer
I really appreciate it.

Eureka! Found an overcome!
Well, forgot to say this: if you want the compiled applications to be installed to some place if possible, create a "defaultinstall" file under sd-card root and write "EXT" (for sd-card) or "MTD" (for internal MTD storage) to the file (note that all uppercase).
Install manager first checks this file and if not found, uses default setting found in package (which I wrote /sd-ext generally for not-so-essential stuff ). You can use this functionality to override this setting.
Note that, some libraries and stuff cannot be installed to a different location - package manager handles this and acts accordingly; so don't worry about it
PS: The stuff I keep calling Package Manager is actually just bunch of scripts, so it's not like I wrote a whole suit

Sounds Interesting

Some compiled applications!
Well, if we're not going to use it, then why did we compiled it, right?
NOTE: The following packages don't have any specific order of installation: you can install them at any order you wish. The only exception is APT - it should be installed after DPKG, or otherwise your system will think you didn't install it
For those who hates command-line interfaces: DesirAPT (the APT front-end for Android) is here DesirAPT v1.0.0
For those who would like to run Enlightenment WM in Desire - this is the mediator application for Android: LinuxInAndroid APK
Note that it requires APT and it's dependencies, along with super user privilages.
---------------------
PACKAGE: NCurses Library
DEPENDENCIES: GlibC Library
WHAT DOES IT DO: It's a shell extension library which is used to format shell (or terminal output) like colorful texts, and such. Default shell might not use it (but it's definitely something necessary for new applications like nano, like "new" bash etc.)
HOW BIG IS IT: Approx. 3.4 Mb.
WHERE TO DOWNLOAD: NCurses Lib. 5.5.9
UNINSTALL?: Available at NCurses Uninstaller
CHANGELOG:
Code:
v 0.4.1 :
* Made Compatible with Sibere's new Data2SD solutions.
------------------------
v 0.4 :
* Complete recompilation with UTF-8 and wide-char support
------------------------
v 0.3 :
* Fixed the Sibere data2sd un-recognization bug
* Added flasher files into the binary for support of all recovery systems.
------------------------
v 0.2 :
* Adding package manager support
------------------------
v 0.1 :
* Initial Release
---------------------
PACKAGE: Bash
DEPENDENCIES: GlibC Library, NCurses Library, Readline Library
WHAT DOES IT DO: It's the main command interpreter for a linux system (also Android). Normally, Android is also shipped with it, but it's a very lightweight and trimmed version (also annoying - it doesn't support tab completion!). This is 4.2 version (latest now).
HOW BIG IS IT: Approx. 3.8 Mb.
WHERE TO DOWNLOAD: Bash 4.2
UNINSTALL?: Available at Bash Uninstaller/reverter
EXAMPLE OF A COOLNESS: You can change your shell label (the one shows before $ or # sign) by assigning PS1 environment variable. For instance, this : PS1="[\w]\$ " (with quotes) will show your current working directory at every prompt
(More at: http://www.lifeaftercoffee.com/2006/10/31/customize-your-bash-prompt/ )
NOTES: The bash will run the commands that you write initially on /etc/profile automatically. You can define your PS1 values, environment variables (be careful to add "export" before them) there for whole system )
Code:
v 0.7.2 :
* Made Compatible with Sibere's new Data2SD solutions.
------------------------
v 0.7.1 :
* Included automatic bash_completion file (stolen from Ubuntu :D) into package - now even apt-get packages are auto completed!
-------------------------
v 0.7 :
* Recompiled with LibReadline for history and auto-completion abilities.
------------------------
v 0.6 :
* Added Locale support
------------------------
v 0.5 :
* Complete recompilation with new schematics
* HOME directory set to /data/home by default
------------------------
v 0.4 :
* Fixed the Sibere data2sd unregnization bug
* Added flasher files into the binary for support of all recovery systems.
------------------------
v 0.3 :
* Added package management support
---------------------
v 0.2.2:
* Added ENV variable, thus support for /etc/profile shell starter file. You can define new environment variables there which is valid for all system (you don't need to change ramdisk each time now!)
--------------------
v 0.2 :
* "Jobs" support fixed
---------------------
v 0.1 :
* Initial Release
---------------------
PACKAGE: Busybox Binary
NOTE: Busybox with GlibC dependency is no longer supported, because package update mechanisms require some command interpreter independent of the updated package. In order to support GlibC Update, Busybox binary will no longer be updated with GlibC support. I recommend you to revert back to static, or Bionic-linked Busybox with the link below.
UNINSTALL: Available at Busybox old version reverter
---------------------
PACKAGE: Zlib Library
DEPENDENCIES: GlibC Library
WHAT DOES IT DO: It's compression library that is used with various applications like Git, Apt, DPKG etc.. It's recommended to keep it there
HOW BIG IS IT: Approx. 350 Kb.
WHERE TO DOWNLOAD: ZLib 1.2.5
UNINSTALL?: Available at ZLib Uninstaller
CHANGELOG:
Code:
v 0.2.1 :
* Made Compatible with Sibere's new Data2SD solutions.
--------------------
v 0.2 :
* Fixed a bug causing system library to clash with the installed one
* Fixed a bug causing Segmentation Faults in some cases
--------------------
v 0.1 :
* Initial Release
---------------------
PACKAGE: ReadLine Library
DEPENDENCIES: GlibC Library, NCurses Lib.
WHAT DOES IT DO: Readline is a command line and history manager library that's used in some command line tools like socat. I personally don't know what else uses it
HOW BIG IS IT: Approx. 1.4 Mb.
WHERE TO DOWNLOAD: Readline 6.2 - v0.1
UNINSTALL?: Available at Readline Uninstaller
CHANGELOG:
Code:
v 0.1.2 :
* Made Compatible with Sibere's new Data2SD solutions.
--------------------
v 0.1 :
* Initial Release
---------------------
PACKAGE: OpenSSL Library
DEPENDENCIES: GlibC Library
WHAT DOES IT DO: OpenSSL Library is Secure Socket Library that is used in various secure applications and web browsers.
HOW BIG IS IT: Approx. 5.9 Mb.
WHERE TO DOWNLOAD: OpenSSL 1.0.0e
UNINSTALL?: Available at OpenSSL Uninstaller
CHANGELOG:
Code:
v 0.2.1 :
* Made Compatible with Sibere's new Data2SD solutions.
--------------------
v 0.2 :
* Fixed a bug causing system library to clash with the installed one
* Fixed a bug causing OpenSSL to do Segmentation Fault and crash
--------------------
v 0.1 :
* Initial Release
---------------------
PACKAGE: APT - Advanced Package Tool
DEPENDENCIES: GlibC Library, Curl Library, Zlib library
WHAT DOES IT DO: APT is a front-end for DPKG which installs, removes, updates etc. packages easily. APT also supports dependency tracking, and automatically removal of unneeded packages.
HOW BIG IS IT: Approx. 1.8 Mb.
WHERE TO DOWNLOAD: apt 0.8.10.3
UNINSTALL?: Available at apt Uninstaller
CHANGELOG:
Code:
v 0.2.1 :
* Made Compatible with Sibere's new Data2SD solutions.
--------------------
v 0.2 :
* Apt now assumes required packages are pre-installed; thus doesn't re-download them unnecessarily ..
* Changed repo host - configuration in sources.list is changed.
--------------------
v 0.1.1 :
* Configuration files are added. Apt-is ready to use out-of-the-box now..
--------------------
v 0.1 :
* Initial Release
---------------------
PACKAGE: Cryptography Package
DEPENDENCIES: GlibC Library , Zlib Library, PTH Library, Readline library
WHAT DOES IT DO: This package contains some cyrptographic libraries necessary for various applications. If you're to use APT, it's recommended to install this package, for since it also carries GPG package inside. Package includes
GnuPG (2.0.18), LibGPG-error (1.9), LibGcrypt 1.5.0, LibKSBA (1.2.0), LibAssuan (2.0.2)
HOW BIG IS IT: Approx. 8.2 Mb.
WHERE TO DOWNLOAD: crpyto package
UNINSTALL?: Available at crpyto Uninstaller
CHANGELOG:
Code:
v 0.1.2 :
* Made Compatible with Sibere's new Data2SD solutions.
--------------------
v 0.1 :
* Initial Release
---------------------
PACKAGE: cUrl
DEPENDENCIES: GlibC Library, OpenSSL Library, Zlib library
WHAT DOES IT DO: cUrl is a secure web client that supports HTTPS protocol. Package includes also libcurl which provides secure web connection API
HOW BIG IS IT: Approx. 916 Kb.
WHERE TO DOWNLOAD: cUrl 7.23.1
UNINSTALL?: Available at cUrl Uninstaller
CHANGELOG:
Code:
v 0.1.2 :
* Made Compatible with Sibere's new Data2SD solutions.
--------------------
v 0.1 :
* Re-Initial Release
---------------------
PACKAGE: Dpkg - Debian Package Manager
DEPENDENCIES: GlibC Library, Zlib library, Tar binary, Linux Utils
WHAT DOES IT DO: Dpkg is the main package for Debian package managing structure. DPKG is the responsible application for installing, removing and updating packages. Using with Apt (or other front-end) DPKG allows users to install new packages easily.
HOW BIG IS IT: Approx. 7.5 Mb.
WHERE TO DOWNLOAD: dpkg 1.16.1.2
UNINSTALL?: Available at dpkg Uninstaller
CHANGELOG:
Code:
v 0.4 :
* Fixed a bug which was causing GlibC not to upgrade from APT.
--------------------
v 0.3 :
* Links renewed
--------------------
v 0.2.1 :
* Made Compatible with Sibere's new Data2SD solutions.
--------------------
v 0.2 :
* Fixed a bug that causes some big archives not to install
* DPKG now informs system that GlibC, OpenSSL, Ncurses libraries are already installed (necessary for DPKG anyway)
---------------------
v 0.1 :
* Initial Release
---------------------
PACKAGE: PTH - Portable Threads Library
DEPENDENCIES: GlibC Library
WHAT DOES IT DO: PTH is a POSIX compliant thread library that is used in some linux applications.
HOW BIG IS IT: Approx. 251 Kb.
WHERE TO DOWNLOAD: pth 2.70
UNINSTALL?: Available at pth Uninstaller
CHANGELOG:
Code:
v 0.1.2 :
* Made Compatible with Sibere's new Data2SD solutions.
--------------------
v 0.1 :
* Initial Release
---------------------
PACKAGE: Tar Archiver
DEPENDENCIES: GlibC Library
WHAT DOES IT DO: TAR is and old and multi-purpose compression format used in various places. This tar suite is designed to be 100% compatible with the PC one (busybox one is not so good at this).
HOW BIG IS IT: Approx. 3.7 Mb (1 MB in System partition).
WHERE TO DOWNLOAD: Tar 1.23
UNINSTALL?: Available at Tar Reverter
CHANGELOG:
Code:
v 0.1.2 :
* Made Compatible with Sibere's new Data2SD solutions.
--------------------
v 0.1 :
* Initial Release
---------------------
PACKAGE: Linux Utilities
DEPENDENCIES: GlibC Library, Ncurses Library
WHAT DOES IT DO: This package includes low-level linux tools that is necessary for a system to run in well manner. Busybox do provide many of those, but they are quite crippled versions - so high level applications may crash using busybox ones (like DPKG).
HOW BIG IS IT: Approx. 5.6 Mb
WHERE TO DOWNLOAD: Linux Utils 2.20
UNINSTALL?: Available at Uninstaller
CHANGELOG:
Code:
v 0.1.2 :
* Made Compatible with Sibere's new Data2SD solutions.
--------------------
v 0.1 :
* Initial Release
Where the hell is the other packages?
Since we know have an APT repository for our distributions, in order to follow all the packages from one source, they won't be published in zip form anymore. In order to obtain them, or update them if you have older versions, you can use apt :
Code:
apt-get install <packagename>
The packages distributed can be list with the following command:
Code:
apt-cache dumpavail | grep Package:
OR, you can use DesirAPT to do these works.
See you around!

NOTE
Before you start anything, don't forget to install build-essentials package. Under ubuntu, the command necessary for it is: sudo apt-get install build-essential - I don't know about other distros..
-------------------------
Well, as promised, now we should write the steps; right?... Now, before we begin, I should really warn that the process is really head spinning if you're to do all by yourself; so take heed to the warnings I give you (I learned the hard way)
Well, first thing is first, we need a Cross Compiler Toolchain, properly built that allows us to build applications, libraries etc. There is one toolchain that's already given to you with Android Native Development Kit (called NDK) but that one is quite restricted because it's built with support for Bionic (trimmed C library that is presented in Android), not Glibc or uGlibC. If you want to develop more native-like applications (especially linux programs) you need GlibC or uGlibC. You can try to build these libraries with that toolchain too, but don't do that, because it's going to fail as well. The reason is that some sort of Chicken-Egg problem is eminent in GlibC-GCC compilation
Let's put the steps to be followed first to build a nice toolchain. I assume you're using Linux - because the tools are developed for this platform only. If you're going to use them in Windows, you need Cygwin or such tools but I can't supply help about that, for since I didn't use them before at all. Google is your friend about this
(Note, the packages I wrote at this list are available at GNU's website www.gnu.org freely, open source)
1- We're going to build "binutils" first. This package includes some important stuff like assembler, linker, archiver (for libraries) etc..
2- We're going to build GCC's prerequisites. These are GMP, MPRF and MPC packages.
3- We're going to build a "bootstap" gcc (God, I hate that name. I like to call it "naked gcc" more ). This GCC just converts source codes to pure assemblies: thus cannot generate linkages or such. We're going to use it to build "actual" tools we're going to use.
4- We're going to extract Kernel source/headers - use Desire Kernel's here. There is some copying, and such to be done tho.
5- We're going to make GlibC headers installed, which will allow us to build more "complex" gcc, which can link applications with those libraries when the library binaries are given (so such thing is there yet, but we fool it )
6- We're going to build a very limited GlibC which will give us support for building more "complex" gcc.
7- We're going to build GCC again. This is called "Pass 1 GCC" or "GCC Stage 1". This GCC can link applications to libraries, with the information in Kernel headers and library headers (it's why we give it the headers, so it can create applications suitable with the Kernel architecture).
8- We're to build actual GlibC now. This glibC will be used for our compiled applications, statically or dynamically. You can, at the end of this step, copy the files to your devices and they would work, but picking files here is harder, so I'd recommend you to leave this alone for now
9- We're going to build "Pass 2 GCC" or "GCC Step 2" This is a full fledged GCC that can do anything we want
Complex isn't it? This is precisely why I recommend you to use Crostool-NG. The other tools (like Buildtools or Crosstool) (sadly) don't create GlibC based toolchains, or use old versions of them, so using this one is recommended. This package automatically will download, setup and link your all toolchain without you worrying about something (believe me, this is what you need. I gave 8 days without this to create a working GCC and Crosstool-NG made another one to me in 50 minutes. )
Well, however, Crosstool-NG won't create "nice" applications (they'll run allright, but they won't be optimized) without some settings done, so, let's go there. First, we need to install Crosstool-NG itself. To do that; go to http://crosstool-ng.org/ website, download and extract it to some place. Even though the steps are written in Crosstool website, you don't need all commands there (like setting PATH is unnecessary). The commands you should use is, after CD'ing to the Crosstool dir;
./configure --prefix="</some/place>"
make
make install
cd "</some/place/bin>"
./ct-ng menuconfig
I used prefix as /home/ahmet/crosstool for instance. Note that this is not going to be where your toolchain is, this is where your "toolchain creator" is .
---- NECESSARY KERNEL HEADER CHANGES ----
OK now, before we start compiling; we need to make some folder moving, copying etc. in Kernel directory. This is needed, because tree structure changed a tad in 2.6 kernels and unless you compiled this kernel before, some directories won't be in their correct place for our cross compiler. Switch to the directory which you extracted the kernel image. Now, from now on, I'm going to assume you're an Qualcomm/MSM board (like Desire, Nexus One etc.) user; but if you're not, change my descriptions accordingly:
1- Go to <kernel dir>/arch/arm/include folder. Copy "asm" directory and paste it into <kernel dir>/include directory.
2- Go to <kernel dir>/arch/arm/mach-msm/include folder. Copy "mach" directory and paste it to <kernel dir>/include/asm directory. It's going to complain that there is another mach folder there and will ask if you want to merge/overwrite. Say yes to all questions.
Now our kernel headers folder is showing a Desire device. Note that if you're not a Desire user, you should use your cpu folder instead of ARM and your board manufacturer in mach-xxxxx instead of mach-msm.
Note this kernel directory, we're going to use it to configure crosstool..
--- CONFIGURING CROSSTOOL ---
After issuing the commands, the crosstool-ng will give you a configuration menu. Most of the setting here are unchanged, but the ones you should change are given below.
1- Paths and misc options
a) Try features marked as EXPERIMENTAL (this is needed to build a toolchain with the latest GlibC support) -> Enabled
b) Local Tarballs directory -> The folder address that you want downloaded stuff to be kept. You might use them again (like for compiling GlibC again for device, you will use them
c) Save New Tarballs -> Enabled ( so that new downloaded files aren't erased )
d) Working Directory and Prefix directory -> Normally you don't have to change them, but you can if you want to install your toolchain to some other location. CT_TARGET signifies your target name (like arm-msm-linux-gnueabi - arm is cpu model, msm is vendor (can be anything), linux is showing the binaries are for linux system (you can use android, but then you'll get not GlibC but Bionic) and gnueabi shows you're going to use open-source EABI structure for your executables. The other option is ELF but EABI is more flexible (because also supports ELF).
e) Strip all toolchain executables -> do it if you don't want to debug GCC itself. this makes toolchain smaller of size, and a tad faster.
The other options can stay the way they are, or you can change them accordingly here. You can get help with ? key, and if you don't understand anything, just leave them default - there are very complex things there that you don't need to know if you're not planning to be a expert on subject
2- Target options
a) Target Architecture -> arm should be selected, cos Desire uses ARM. If you plan to make toolchain for, say, powerpc, pick that.
b) Endianness -> Should be little. ARM processors in Desire uses little endian system.
c) Architecture level -> "armv7-a" this is should be written. Desire uses ARMv7 based instructions and if you leave here empty, the applications will be built with armv5 support - they're still going to run but not use advanced v7 features.
d) Use Specific FPU -> "neon" . Desire uses NEON structure for floating point arithmetic, and if you leave here empty, the applications will not use Desire's FPU abilities (everything will be software based, which is slower)
e) Default instruction set mode -> arm . You can use thumb here for allegedly faster code but not every build system supports it. Leave it ARM.
f) Use EABI -> enabled. EABI is necessary for most flexible desing of binaries.
The other settings be as they were.
3- Toolchain options
a) Tuple's vendor string -> You can leave here empty if you don't want to; it's not necessary to use a string here. I used "msm" but you can write anything. This string here is used in toolchain name as arm-xxxxx-linux-gnueabi, so make it short, I recommend
b) Tuple's alias -> make it something short like "arm-linux" This alias string is used to make calls to your toolchain easier. Instead of writing arm-msm-linux-gnueabi-gcc everytime, you can use arm-linux-gcc to compile your applications. Can write anything here (like toolchain if you want to use toolchain-gcc to compile your applications)
The other settings can stay as they are, for since default values are the best in our case. You can tweak them only if you know Desire cpu like the back of your hand
4- Operating system
a) Target OS -> Use "linux" if you want the applications to run in Android and Linux; use "bare metal" if you're to compile low level applications which won't use linux headers. Default is linux.
b) Get Kernel headers from -> say "pre installed" because otherwise it's going to download standard Linux headers from internet. We needed some changes, so this option is compulsory to be "pre installed"
c) Path to custom headers directory/tarball -> Path to your kernel source folder - which you made changes above. WARNING: I say specifically extracted, because standart tarball won't work for us. We're going to make some changes in kernel directories, which is non-standart (Instructions were above).
d) This is a tarball -> No . We're going to use extracted folder.
e) Build shared libraries -> say "yes"; because we want dynamic linkage, not static one
f) Check kernel headers -> say "no" otherwise some unnecessary check causes compilation to stop.
5- Binary utilities
a) Binutils version - pick the latest one, 2.20.1a. If you use older versions with newer GCC/GlibC, it's not going to succeed.
Leave others as they are, they are not big deal..
6- C Compiler
a) GCC Version -> pick 4.6.1 for since it's the latest and most bug free. Just stay away from 4.5
b) Pick the languages you want support for. I've read online that Java is a tad troublesome in Android platform, for since Java in Android uses Dalvik, not Sun systems. You can try it at your second toolchain if you want Definitely pick C++ tho
c) Link libstdc++ statically -> say yes; it really saves you from big configure scripts later - apparently needed to avoid PPL problems as well
d) Compile lidmudflap/libgomp/libssp -> say no. These libraries are not the most suitable libraries for ARM platform (at least at cross-compiler level. You can compile them later, if you want, with your cross-toolchain.)
You can leave others as default
7- C library
a) C library -> gLibC (recommended). You can use other libraries which are eGlibC (embedded Glibc, like Bionic) and uGlibC (micro-glibc) too, but GlibC is the most spanning solution above those. The libraries are bigger, but they support more.
b) glibC version -> Use 2.13 (experimental) it compiles just fine, and you get a new version of GlibC. Not the newest, but that's ok
c) Threading implementation -> nptl (recommended) . You can use linuxthreads too, but nptl is more advanced ( like giving support to Thread-Local-Storage and such)
d) Force Unwind Support -> Enabled . If you don't use this option, for since we're making this toolchain from scratch, it's going to give you error during compiling that it couldn't find necessary headers (we're building them now, dumbass!)
Leave others default if you don't know what they're about
8- Companion Libraries
Well, go and pick the latest versions, even though when it says "Experimental", otherwise your GCC compilation will give you error about these libraries being old.
After setting these settings, press ESC key twice till it goes way back and ask if you want to save configuration; say yes.
--- STARTING COMPILATION ---
Now to start compilation write
./ct-ng build.
This is going to take approx. 45 minutes, so go watch some episodes of Big Bang Theory or something. Normally, there should be no errors but if there is; most probably either you made a wrong configuration, or didn't set your kernel folders well. Try again with other settings, google your problem etc..
After this process, you're going to have a cross-compiler at your use at /home/<username>/x-tool/arm-<vendor>-linux-gnueabi/bin folder. Note that Crosstool-NG automatically makes this folder read only to make you prevent screwing your toolchain You must edit your path variable to show "/home/<username>/x-tool/arm-<vendor>-linux-gnueabi/bin" folder as well for less headaches during compiling later
Whilst compiling other application, most used configure options you're going to use is "--host=arm-<vendor>-linux-gnueabi" and "--prefix=/some/folder/you/want/this/application/copied". After compilation, you can send binaries to your phone from prefix folder.
More options about GCC and Configure is available at GCC and Autoconf man pages; check them as well
Happy cross-compiling people

Woah, amazing work, congrats!
Sent from my HTC Desire using XDA App

Interesting..It answers some of my unanswered queries regarding cross compiling.. Thanks...Please keep documenting your progress.

THIS POST IS ONLY FOR THE BRAVE MAN
These are packages which are compiled; but not installed and/or tested by myself. Please test them and inform me if they work (PM me if they work or not; it's better that way ).
--------------
NO PACKAGES HERE! Frankly, I did test virtually all of them. They might not work as expected maybe, but at least they don't impede functions of device

Developer Log
Now while preparing a suitable (and as flexible as it can) recovery zip; I realized that instead of editing ramdisk, I can also use init.d script to link /lib to /data/lib. This also allows some flexibility to user (i.e. move library folder around -if needed- and edit init.d script accordingly and still have a running system).
What baffles me most is PATH env-variable. Apparently, if I set it at init.d level, it's not exported quite well - apparently, there is a user mode switch between init.d script run and ramdisk loading process (because PATH variables at Ramdisk are exported to all applications, whilst init.d ones are not) and the only way to set PATH variable for all processes is editing Ramdisk (AFAIK)...
And another point: what if kernel doesn't support init.d? (Go to hell if you're reading this post with a kernel which doesn't ) Ramdisk solution is quite general (i.e. works for everyone) but it's a little harder to edit with scripts and not as flexible as init.d method. I think it's safe to assume that there is init.d support at this level
Maybe I can create two versions (init.d one and ramdisk one) of recovery zip's.. Keep in touch guys..

theGanymedes said:
Now while preparing a suitable (and as flexible as it can) recovery zip; I realized that instead of editing ramdisk, I can also use init.d script to link /lib to /data/lib. This also allows some flexibility to user (i.e. move library folder around -if needed- and edit init.d script accordingly and still have a running system).
What baffles me most is PATH env-variable. Apparently, if I set it at init.d level, it's not exported quite well - apparently, there is a user mode switch between init.d script run and ramdisk loading process (because PATH variables at Ramdisk are exported to all applications, whilst init.d ones are not) and the only way to set PATH variable for all processes is editing Ramdisk (AFAIK)...
And another point: what if kernel doesn't support init.d? (Go to hell if you're reading this post with a kernel which doesn't ) Ramdisk solution is quite general (i.e. works for everyone) but it's a little harder to edit with scripts and not as flexible as init.d method. I think it's safe to assume that there is init.d support at this level
Maybe I can create two versions (init.d one and ramdisk one) of recovery zip's.. Keep in touch guys..
Click to expand...
Click to collapse
Well, what's the difference between init.d and ramdisk, when init.d support means running busybox runparts from ramdisk?

Droidzone said:
Well, what's the difference between init.d and ramdisk, when init.d support means running busybox runparts from ramdisk?
Click to expand...
Click to collapse
Well the difference is caused by Unix variable propagation.
Normally, when ramdisk is loaded and init.d scripts are starting to run (with run-parts binary) the exported variables are valid only for the scripts that run-parts do run. Since Linux only allows child processes to inherit variables from host, when runparts finishes job; defined variables within the scripts vanish.
When you add variables to Ramdisk (init.rc) directly, since variables become declared from init directly (and since init runs all the processes on boot) the variables automatically become available for all processes.
That's the difference I meant

Got it..So the variables from init.rc persist till shutdown..

Droidzone said:
Got it..So the variables from init.rc persist till shutdown..
Click to expand...
Click to collapse
Precisely. It's why the variables (even those which defined by export keyword) are vanished when the system booted up (unless defined in ramdisk)
Well, I've gotta learn RegEx one day anyways

Recovery zip is done! Now, I should test it on my device first
I'm also going to make a uninstaller script I think. It's really messy to clean this up otherwise

Android binaries and dependencies
I've examined the dependencies of all the binaries in /system/bin and /system/xbin in Android system. Too sad that the list contains some non-standart libraries (that's not that bad, sure you can find their sources).
Also, another problem is that you need to compile the binaries themselves from the source code as well (with the GlibC libraries) - which is near to the compiling the whole ROM itself - I'm not even sure if we can find source code (will check the Android source code itself when I've time)
The dependencies in my system, for instance, are as follows:

So that's a no-go for people with closed source system...
@theGanymedes, do you know if the system can mount ext4 at init.rc level (on early init) without using busybox?

Well, it can, but the kernel needs ext4 modules (or direct support). I checked the native mount source, it actually does nothing much more than simply calling kernel's ioctl or mount system call..
I think a simple tweak at ramdisk is all you need for that (and a supporting kernel, of course )
Weird thing about previous issue is, I have the source codes of most utilities, I can compile them too, but I don't have proper makefiles and I'm too lazy to write them myself - that's a lot of trial and error.
Well, apparently, we're not going to be able to switch from Bionic to Glibc completely. I think I can make them coexist tho.

theGanymedes said:
Well, it can, but the kernel needs ext4 modules (or direct support). I checked the native mount source, it actually does nothing much more than simply calling kernel's ioctl or mount system call..
I think a simple tweak at ramdisk is all you need for that (and a supporting kernel, of course )
Click to expand...
Click to collapse
Yup, my compiled kernel has direct support.
This is how mtd is mounted..
mount yaffs2 [email protected] /data nosuid nodev
And this is how I mount ext4 from init.d:
/system/xbin/busybox mount -t ext4 -o barrier=0,noatime,nodiratime,nosuid,nodev,nobh,nouser_xattr,noauto_da_alloc,commit=50 /dev/block/mmcblk0p2 /data
I need to change it to init.rc (init) language...

theGanymedes said:
Weird thing about previous issue is, I have the source codes of most utilities, I can compile them too, but I don't have proper makefiles and I'm too lazy to write them myself - that's a lot of trial and error.
Well, apparently, we're not going to be able to switch from Bionic to Glibc completely. I think I can make them coexist tho.
Click to expand...
Click to collapse
Earlier this month, I was trying to compile dosfstools for Android. But got stuck at static cross compile with ndk gcc

Droidzone said:
Earlier this month, I was trying to compile dosfstools for Android. But got stuck at static cross compile with ndk gcc
Click to expand...
Click to collapse
So, I'm not barking for the hollow tree here.. That's a relief. Seeing that this post is not that active, I was starting to think I'm working in vain..
Well, now, apparently init version of mount is quite restricted about options. The ones it supports are given in mount.c as:
Code:
"async", "atime", "bind", "dev", "diratime", "dirsync", "exec", "move", "recurse", "remount", "ro", "rw", "suid", "sync", "verbose"
I'm checking the mount.c source as we speak. I'm going to inform you if I can find something.
EDIT: BTW, also "no"+options are recognized (like noatime)
ADDENDUM:
The internal mount is exactly the same as the mount we use at busybox. So, most probably, it's the same was in init script.
Try this line
Code:
mount ext4 /dev/block/mmcblk0p2 /data noatime,nodiratime,nosuid,nodev,nobh
Notice that I erased some flags. You might also try to add them, but check if this line works first.

Related

[ROM] EzGingerbread (Dream and Sapphire) stable-v1.0 2011-12-04

[size=+3]EzGingerbread[/size]
(Latest release: stable v1.0)
Welcome to the ezGingerbread Rom and Development thread
Here we discuss building, testing, and patching a basic gingerbread build for the Dream Sapphire platform.
The goal is for this to be a reasonably bare bones build gingerbread build; Focusing on memory and speed performance.
[size=+2]Installation Guide (of Binaries)[/size]
While ezGingerbread remains as open source as possible this sections will provide some pointers to installing the latest distributed binary.
(The following is automatically done if installed via Rom Manager)
Requirements
EzGingerbread works on most 32b Dream, 32b Magic (MT3G), and 32a magic devices running 2.22, and/or 3.22 radios, and will auto detect the correct configuration on install.
However the following configurations are optimal:
32b Dream: Radio-2.22.28.25 and SPL 1.33.0013d are recommended
32b Sapphire: Radio-2.22.28.25 and either SPL 1.33.0013d or 1.33.0013 (if the SPL is not already installed I recommend 1.33.0013d)
32a Sapphire w/ audio plug (ie MT2.1/fender): Radio-2.22.28.25 and either SPL 1.33.0013d or 1.33.0013 (This is likely what you already have installed, if you don't have this and your phone works you likely you don't have a MT2.1/fender)
32a Classic (no audio plug): Radio 3.22.20.17 + any SPL (however 1.33.2009 or 1.33.2010 may be better) [Note 6.x radio will not work with this rom]
Users of customMTD must have an 87 Meg system '87 2' is common. There is no need to flash the cMTD boot patch as the rom installer automatically patches the boot image for cMTD.
Download Rom related files
> The ROM: GINGERBREAD-DS-Stable-v1.0-20111204.zip (md5: 2ae9f618b0650c98b9621b37ad7e8596)
> GAPPS: gapps-mdpi-gb-20110709_S.zip (mirror)(mirror 2 -- dead) (md5: 6f9a6d27cce1f58be1f34f696212d326)
> GPRS Patch (optional but recommended) gprs_patch_S.zip (md5: fa259735ca394a650710e6b26673c91a)
> Alt Launcher [Zeam] Completely optional, but for those that want a smaller launcher, or just intend to replace the default (Launcher2) anyway with a market download this may apply to you, Note its an older version, and the newer market version has been slightly unstable:
ezgb_ZeamReplacement2_S.zip (md5: 6416ec0efa15f92f3d36f6ec6b524a11)
Language Port/Pack File
If you use (German, English, Spanish, French, Italian, Japanese, Korean, Polish, Portuguese, Russian, and Chinese)
These are contained in the base rom, do not download a language pack.
If you use (Bulgarian, Czech, Danish, Greek, Finnish, Hungarian, Dutch, Slovak, Serbian, Swedish, Tagalog, Turkish, Ukrainian)
These require lang pack 1:
EZGB_lang1_20111204_S.zip MD5: 37ee9cbf4f4c80a4b5fd96269332b853
Copy Files to the phone
Copy all the downloaded zip packages to your SD Card, Remember Ra-Recovery users must put them on the root of the sd-card.
wipe or not to wipe, and other preparations
> Users upgrading from
GINGERBREAD-DS-Alpha-20110509-1, Beta builds, or the Gamma build
There is no need to wipe as long as you wiped when you first installed one of these versions of ezGingerbread. You are however encouraged to uninstall SetCPU or other overclock software, and backup your rom before installing. (if the new built in CPU Speed function is not to your liking feel free to disable and re-install the 3rd party overclock software after upgrading)
> Users New to ezGingerbread (upgrading from a different rom)
You are encouraged to wipe before installing, however feel free to use Titanium or other utility to back up your application and application data to be restored after installation.
Installing the rom
flash in the following Order:
> GINGERBREAD-DS-Stable-v1.0-20111204.zip
> [If you need it] EZGB_lang1_20111204_S.zip
> gapps-mdpi-gb-20110709_S.zip
> [optional but recommended] gprs_patch_S.zip
> [if you chose it] ezgb_ZeamReplacement2_S.zip
Reboot
Reboot the phone and wait for the screen to dim before interacting with the phone
(First boot will take additional time; longer if you had many applications installed and are doing a no-wipe upgrade)
[size=+2]Tips and Tricks[/size]
Now that the system is installed I have some pointers to making the system as fast as possible, you may ignore these if you really must have something they don't allow but if the phone runs slower you know why:
Tip 1: Google Maps: If you can live without it the phone will be much more stable.. (Maybe using mapquest as an alternative) However if you really do need Google Maps note the newer versions require much more resources than the older ones.
If you must have google maps try an older version rather than maps 5+
Google Maps 4.7 (mirror) MD5: b8c558351949be97eb8703d1f4a05807 (download/place on SD card and install with File Manager)
Brut Maps based on Maps v4.6
Tip 2: Facebook: Well I can't say facebook was ever fast on our slow Dream, but the most resent versions run an "Upload Service" 24/7 in the background eating much unnecessary ram.. v1.6.4 is the newest version I know of without this behavior.
Tip 3: Apps2SD, well best to keep apps you want to use frequently of quickly on the system, but to enable Apps2SDext if you have an ext partition here are the directions:
> goto settings->Applications->Development
> Check SD-EXT
> Reboot
> Now you can use the Manager Applications screen to move apps to/from sd-ext .. if you want sd-ext to be the default install location choose it in Settings->Applications->Preferred install Location
> Data2sd will move all your application data to the sd-ext partition.. this will significantly slow down the phone thus best to leave unchecked.
Tip 4: SuperUser
The system by default prevents the update of superuser or anything signed with the same key (such as superuser elite); to temporary lift this restriction goto Settings->Applications->Development and check Update Superuser.
This will allow superuser to be updated, superuser elite to be installed/updated until reboot.
This ensures no application can change Superuser.apk on your behalf when you do not expect it thus can't grant themselves superuser access.
Tip 5: EzGb Extras
Settings->EzGingerbread Extras
This menu has historic "Spare Parts" funcitons, as well as other performance enhancements.
> Configure PowerWidget allows you to configure the powerbar widgets, when you are done configuring either reboot, or rotate the display to re-set the widget and see the update
> Incoming Call TouchUI - enables the slide to answer/end calls when a call comes in, rather than only being able to use send/end hardware buttons
> Busybox NTP Cliemt - If your phone is not keeping time, even with the sync to network time enabled, checking this may help keep the phone in sync with earthly time
> CPU Speeds, This lets you overclock and under volt, I recommend setting Min speed to 128000, leave Max screen off 480000, and max screen on may either stay 528000, or very slightly overclock to 537600. If you want the settings to apply after your next boot tap "Apply On Boot" if you have problems with the settings, before the screen turns off after boot enter this screen and tap "Reset CPU Settings" before rebooting again.
> Compcache RAM Usage, sets the amount of compcache, keep this as low as possible but not so low background services keep restarting.
> Use KSM Module, this may improve ram usage if checked, however may also slightly increase CPU usage and reduce battery life (all three results are very slight and thus hard to notice) no restart is required so test when/if it works best for you
> Window/Transition animatinos, since froyo animation times have been increased.. many find speeding these up make the rom feel more responsive as they are historically used to.
> End button behavior: choose "go to sleep"
> Haptic feedback/Compatibility Mode .. most will leave these alone
Tip 6: Surface Dithering:
Well this is a trade off [Settings->Display->Surface Dithering] if its checked the display may loose some more frames than if unchecked.. but some people rather loose the frames than see the artifacts left by skipping the dither, choose your poison and reboot
Tip 7: sync: disable what you can
Go into settings -> Accounts &sync
Tap your Google Id. Unless otherwise needed, unchecked Sync Picasa Web Albums, and Books
If you have Google plus you may also wish to disable Sync Instant Upload.
Historic versions, and additional addons can be found below in post 2
[size=+2]Kernels:[/size]
Regarding kernels: If you are looking for stand alone kernels (sometimes there is an update between official releases; or for use in other roms):
See the Stand Alone Kernel Post
The Stand Alone Kernel Post contains both the ezgb-2636 kernels and links to the tags in github they are built from.
[size=+2]Developers:[/size]
Developer's Guide (How to build ezGingerbread and the ezgb2636 kernel) is now on GitHub:
https://github.com/ezterry/manifest-gingerbread-DS/blob/gingerbread/README.mkdn
Includes instructions to fetch and build from source both ezGingerbread and its related kernel.
Binaries
"NIGHTLY" BINARIES:
Builds 20110116-1 and newer are EBI0/EBI1/2708+ auto kernel, Flash and the rom will install the correct kernel
Builds 20110107-1 and older are 2708+ kernel only
20111204-1: GINGERBREAD-DS-Stable-v1.0-20111204.zip
(md5: 2ae9f618b0650c98b9621b37ad7e8596)
Note: Release v1.0 (stable): clean resync with android.googlesource.com, Fix Japanese IME force quit, Update timezone data (removal of DST from the Moscow Time Zone), add libpico fix to build (fix text to speech force quit), Add Russian dictionary to keyboard, Fix SuperUser lock down to properly allow unmodified apk to be locked down, and cleanly allow update/elite install, update Superuser.apk, Force Quite fix on entering About Phone with no keyboard installed, some translations via AndDiSa, add new Cpu Speed settings to EzGb extras (note you will want to disable this if you wish to continue using 3rd party overclocking apps).
/
20111107-1: GINGERBREAD-DS-Gamma-20111107-1.zip
(md5: f57ebc7ccd0819e0536407d066f02c6b)
Note: Gamma release (beta+1): Kernel update to v1.5.2 w/ patches for time skew, updates to android 2.3.7, wifi lease fix, add pt_BR to language set, various framework patches fixes speedups from CM7, KSM (Kernel SamePage Merging) support to dalvik-vm with supporting kernels (eg: ezgb-2636) MMS Time display and MDPI icon from CM7, compress xbin and move various libs to a compressed xlib, compact (pngcrush + zip -9 resources.arsc) apks, superuser 3.0.6, Odex framework (shrinks the framework jars, and moves the framework dalvik-cache into system) EzGbExtras also now has options for KSM, Incoming Call TouchUI CompCache chooser, ntpd background service for better time sync. Security fixes based off digitalgardian certs, Settings no long has compcache (moved to EzGb Extras)
Edit 20111110:PICO Fix (ie: text to speech for navigation)
/
20110828-1: GINGERBREAD-DS-Beta-20110828.zip
(md5: 0161b47d36ce3ae24b85907fe19fe4ca)
Note: Kernel update to v1.5.1, Android update to 2.3.5, Pan networking from CM7 (allows bluetooth tethering without extra software, just link the devices and use tether to your phone) Gallery 3d: CM7 patches for MT zoom bug and MDPI patches, Phone: CM patches for 2g/3g power widgets toggle, framework updates thanks to AndDiSa/ADS Magpie, "Disk" (MTD) io enhancements, wifi renew logic described starting here; auto custom MTD via bootcmdutil (no need to flash boot patcher anymore) , some translation updates. Faster boot time patch from Firerat
Please read the security notice here regarding ca certs and DigiNotar
/
20110716-1: GINGERBREAD-DS-Beta-20110716.zip
(md5: 8c3293e26b6aef25851a9ce5c53fc81b)
Note: Kernel update to v1.5 (as previously released here, USB Accessory support working, update to minfree levels, improvements to services, statusbar power widgets (configure in Settigns->EzGingerbread Extras) Spare parts replaced with EzGb Extras, GPS improvements, HW3D settings improvements, please note gapps package 20110709 is recommended (however 20110508b should still work)
/
20110626-1: GINGERBREAD-DS-Beta-20110626.zip
(md5: d03a960c90b80eb077a1fe46581cc759)
Note: Kernel update to v1.4 (as released last week in the stand alone version, Fix out of space install bug when user had no sd-ext partition or sd-ext disabled, add option in Settings->Applications->Development to allow superuser updates until subsequent reboot, fix an outstanding reboot menu bug, superuser, and stability updates.
/
20110605-1: GINGERBREAD-DS-Beta-20110605.zip
(md5: fc2a33cad7affe4cf656067118eecfcb)
Note: Kernel update (Wifi disabled drain solved with hack, MMC temp log in ram for 30s after SMS details, Surface Dithering option added to Display settings, French translations, Update to services. Attention if you have long stalls after update/clean install run fix permissions [logcat shows CPU pegged], also its highly recommended to clear dalvik cache on the install of this rom.
/
20110529-1: GINGERBREAD-DS-Beta-20110529.zip (md5: 50fba2c5adabe0f83a4e4b9616680ba1)
Note: BETA!!!! Features magpie, to enable you first need to allow sd-ext to be mounted Settings->Applications->Development->Attempt to mount sd-ext.. Other features: Data 2 sd bind mount, touch screen edge bugfix, and some other bug fixes including many for better memory maintenance. Available on rom manger including options for gapps, zeam launcher and small older stable facebook [manual links below]
/
20110509-1: GINGERBREAD-DS-Alpha-20110509-1.zip (md5: e22dd434aa41cbdd744893951b12e5bc)
Note: Security updates, preventing Settings and Superuser apps to have another app using their keys on /data (this prevents a non-system app from having access to all your settings, or able to give its self root privileges), in addition I've changed the platform key, Kernel updates, swipe notification now visually swipes away (thanks to update in CyanogenMod), some settings tweaks, and minor bug fixes. Starting this version you must use GAPPS: 20110508b due to the new Platform key in use.
/
20110502-CheckPoint: GINGERBREAD-DS-CheckPoint-20110502.zip (md5: 5c0969ebf1209922add7a1e357d969ca)
Note: A re-sync with aosp to fix various bugs in the sync on 2011-05-01, APN now can be created w/o error [new IPV4/IPV6 protocol caused the confusion] various other projects got updates in AOSP as well synced into this build (additional CheckPoint build info here) ATTENTION: kernel update possible fix to camera and other crashes here for use with 20110425-1 and newer
/
20110501-CheckPoint: GINGERBREAD-DS-CheckPoint-20110501.zip (md5: d5a3765001f6fa69321bcffb642ce516)
Note: Checkpoint of the android-2.3.4 initial release. Updated to head of Gingerbread branch and the 2.3.4 release. Also renamed typo CompCache script and lowered 32b default CompCache to 8MB, 32a remains disabled by default. (build info here)
/
20110425-1: GINGERBREAD-DS-Alpha-20110425-1.zip (md5: d69b689e4aeb12335c6e67123abf20fd)
Note: New kernel 2.6.36.4-s1-ezgb-v1 / Built in zram compcache (default enabled on 32b, disabled on 32a) settable in Settings->Applications->CompCache; {requires kernel with built in zram module} / new lowmemorykiller min free and Home App memory levels for hopefully better memory use.
/
20110308-1: GINGERBREAD-DS-Alpha-20110308-1.zip (md5: bf0f6a922b3afd5c9faa15333b1e32f5)
Note: Update to android 2.3.3, add in white-listed unrestricted packages (fixes Facebook sync), Add build.trout to make dream not identify as sapphire, make sound recorder visible in launcher (was always included), include file manager (CM's version), allow download of all file types.
/
20110304-CheckPoint: GINGERBREAD-DS-CheckPoint-20110304.zip (md5: 715eba3cf37270a5ff3456c9e5c04563)
Note: Checkpoint of the android-2.3.2 ezGingerbread build; all future builds will be 2.3.3 See checkpoint information here
/
20110208-1: GINGERBREAD-DS-Alpha-20110208-1.zip (md5: 2211d8f9a1f8071b28734999d4908f3a)
Note: Added CM7 dictionaries to LatinIME (word auto completion), added pl_PL bringing supported locales to: en_US en_GB fr_FR it_IT de_DE es_ES ja_JP es_US ko_KR pl_PL pt_PT ru_RU zh_TW zh_CN (let me know if you have font issues), updated LatinIME touch logic, fix_permissions, enhanced blend/blur transforms to libsurfaceflinger.
/
20110129-1: GINGERBREAD-DS-Alpha-20110129-1.zip (md5: 87d74801b43fb97740799bacd8adccc7)
Note: Various patch sets from Cyanogen Mod 7: Javascript engine switched to V8, armv6j JIT and processor support (was previously v5), swipe to dismiss individual notification, some webkit and skia patches.. the combo of these among other things fixes gmail; Also pushed in this build to su from ChainsDD, build env updates (32bit builders, try a clean environment); some additional graphic speed enhancements.
/
20110122-1: GINGERBREAD-DS-Alpha-20110122-1.zip (md5: 74c081f42cb25cef79b5c6077866a239)
Note: some graphics framework updates, Superuser.apk, Fonts.sqf + fallback fonts (from issue 3), LiveWallpaper picker, busybox sh in use for all sh needs, super tiny toolkit.. and some small fixes. (For a terminal get one you like from market or elsewhere .. I just use connection bot for both local and remote)
/
20110117-1: GINGERBREAD-DS-Alpha-20110117-1.zip (md5: b6aa8732517f52565efac3d9febe0f5c)
Notes: GPS working, cleanup camera shim, update opengls and agl framework (video) details, builders please delete and regenerate your vendor/htc/sapphire directory (extract-files or unzip-files)
/
20110116-1: GINGERBREAD-DS-Alpha-20110116-1.zip (md5: aef05eef5e7be24e46d2f6cc70218c63)
Notes: Auto kernel (EBI1/EBI0/2708) using ez-exp20110109-cm binaries, Audio hack (corrects AudioPara4.csv on flash, gziped versions of all profiles in /system/etc/.audio/) SpareParts included, run-parts, fix modprobe (had wrong path for modules), modules.sqf
/
20110107-1: GINGERBREAD-DS-Alpha-20110107-1.zip (md5: 3f0cc16aac87a8ebc3f8c9aa3c11a3fe)
Notes: Updated proprietary files, video decoder now working in gallery3d, update internet calling permissions, fix a bug with restart menu.
/
20110103-1: GINGERBREAD-DS-Alpha-20110103-1.zip (md5: b81545dcbd5ae0f2da388d77aa3b5997)
Notes: fixed video recording thanks to CM framework patches (playback still fails), reboot power menu option thanks to CM, gsensor thanks to havlenapetr. Current Languages: en_US en_GB fr_FR it_IT de_DE es_ES ja_JP
/
20101222-1: GINGERBREAD-DS-Alpha-20101222-1.zip (md5: e16ac0bcfbf6c6e163410a3ded97fb8a)
Notes: first build released, kernel is my 2708+ port of the cm 285 nightly kernel, overall drawing speed increased.
/
20101219-1: GINGERBREAD-DS-Alpha-20101219-1.zip (md5: bef700cf0e04de003788365de469dd49)
Notes: first build released, kernel is my 20101106, better results with CM nightly or pershoot kernels however.
/
ADDONS:
Additional non-open addons that may be useful
Zeam Launcher By cloakt(replacing Launcher2 on system, also reduced to MDPI only):
ezgb_ZeamReplacement2_S.zip(md5: 6416ec0efa15f92f3d36f6ec6b524a11) [updated june 26th, 2011]​
LANGUAGE PACK1:
The packages above include support for: de, en, es, fr, it, ja, ko, pl, pt, ru, zh and are recommended for most users
If however your preferred language is not listed above, this LANG PACK 1 will replace the above languages with support for:
bg, cs, da, el, fi, hu, nl, sk, sr, sv, tl, tr, uk
Please download the version matching the ROM you are installing (see: adtl. details)
20111204-1:EZGB_lang1_20111204_S.zip(v1.0)
(md5: 37ee9cbf4f4c80a4b5fd96269332b853)
20111107-1:EZGB_lang1_20111107_S.zip
(md5: 957a943e10c81699070bd415d74ae9c8)
20110828-1:EZGB_lang1_20110828_S.zip
(md5: 054d28fe41976eabdb6d26b92bcfc045)
20110716-1:EZGB_lang1_20110716_S.zip
(md5: dfb83772e2a0d9edf6f72cdc23966e8b)
20110626-1:EZGB_lang1_20110626_S.zip
(md5: eb354f34573db67270da57cc27fa737b)
Mobile Data GPRS Tool:
A tool to update GPRS settings form gprsclass=10 to gprsclass=12 (also enables dtm)
Most users will experience better mobile network rates if they flash and choose yes, however if you run into problems simple re-flash choosing no to revert to the ezGingerbread defaults,
This tool will likely work on most Dream/Sapphire roms, however as always best to make a backup first
gprs_patch_S.zip
(md5: fa259735ca394a650710e6b26673c91a)​
GAPPS:
GAPPS: 20110709 (Please note if you are using 20110502-CheckPoint or an older build you must use gapps 20110205)
gapps-mdpi-gb-20110709_S.zip (mirror)(mirror 2 -- dead)
MD5: 6f9a6d27cce1f58be1f34f696212d326
Cleaner 2.3.4 gapps package, recommended over 20110508b. Restore from Google corrected in this package, Talk2 has been replaced with the original talk app due to incompatibilities with voice/audio chat. However you may manually install it if you wish to use the newer interface w/o the newer features. While not 100% support of all languages, core apps support more languages in this package. Mirror thanks to SilentTweak.
GAPPS: 20110508b (Please note if you are using 20110502-CheckPoint or an older build you must use gapps 20110205)
gapps-mdpi-gb-20110508_b_S.zip
MD5: 475fbf654977af73f30e509cb4adb21c
Also see information about Talk
Previous GAPPS: 20110205
gapps-mdpi-gb-20110205_S.zip (mirror)
md5: 70ddd820738b902d9b9f9b109e8fad5a
Note do not install both 20110508 and 20110205
MDPI Facebook App:
http://depositfiles.com/files/sdhr9ol3g [gb_facebook_fix_S.zip] (outdated)
md5: 17cb43e88f42cdf513f2c7c960347f21
v1.6.4 is newer w/o some of the newest memory eating services get the apk from:
http://www.apktops.com/facebook-for-android-1-6-4.html
For additional gapps:
1) Log into your Google account
2) tap gtalk to make sure its running
3) install the gapps you want from market (some common ones):
You Tube
GMail
Voice Search
Google Translate
*Maps and Streetview may also be grabbed from market; however Maps v5.* appears to be very resource intensive and overwhelms our poor devices; therefore I recommend either installing MapQuest; and/or an older version of GoogleMaps example extracted from froyo gapp pacakges. This will provide a much better gingerbread experience both while running maps and while not running maps.
Brut Maps based on Maps v4.6
Google Maps 4.7 (mirror) MD5: b8c558351949be97eb8703d1f4a05807 (download/place on SD card and install with File Manager)
​
Apps2Ext: (Included in 20110529-1 onwards)
This enabled in Settings->Applications->Development->SD-EXT
Sim Toolkit:
See: http://forum.xda-developers.com/showpost.php?p=15742165&postcount=2618
A friendly reminder... One hopes users of this thread know how to wipe their device .. and if they fail how to see they missed something in logcat.. but if not Super Wipe because regardless of subsequent errors all of these do boot to the Launcher.
Other uses are free to post custom builds in the thread for reference and testing.
Note however all of the above builds were cleanly made from the repo without modification. (ie. you are getting the file produced by the build system)
[SIZE=+2]For full credits check github; Many peoples hard work (particularly that of the CyanogemMod's team make this rom possible)[/SIZE]
GINGERBREAD-DS-Alpha-20101222-1.zip boots very well.
Under android version it still says 2.2.1. Almost ready for a daily driver.
I hope this becomes CM7 someday
Edit: I seem to have battery life issues using pershoots 2708 2.6.34.*... Any other kernel I should try (that does not have usb unplug bug)?
mschoolbus said:
Terry,
I am unable to get the alpha1 to boot no matter what kernel I try. I am using your +15mb ram hack and 2708 kernels on cm6.1 just fine.
Am I missing something?
Your work is fantastic btw! So nice you are continuing support for our old dreams
Click to expand...
Click to collapse
Not that I know much, did you check if you have the latest radio and SPL?
sada23 said:
Not that I know much, did you check if you have the latest radio and SPL?
Click to expand...
Click to collapse
I have: HBOOT-1.33.0013d
RADIO-2.22.28.25
Thanks for the help!
Did you get it to boot?
The first time i installed, it would not boot, I waited for like 15 minutes or so, then tried a different kernel, same thing.
Just to try it, I flashed the gingerbread alpha again, and tried one more time, and it booted up.
I did notice the first time I flashed it, the "progress bar" did not move at all, the second time I was able to see it move.
-Jeff
um worked fine for me but, on the setup "Touch Android to Begin", is irresponsive
the android flashes on touch but no continuation, hhelp?
Love it! Looking forward to a beta next year
mschoolbus said:
Terry,
...
I am unable to get the alpha1 to boot no matter what kernel I try.
Click to expand...
Click to collapse
1. backup
2. superwipe
3. shutdown
4. boot to recovery
5. flash the alpha rom (do not reboot)
6. flash pershoot latest New SPL + Radio 2708 Combo
7. unplug USB and reboot
Let it boot all the way up and let it sleep on it's own.
Don't expect a fluid UI and don't compare it to other ROMs. It's not intended for public consumption.
im able able to get it boot, but it hangs at the setup
when I touch the android an error pops up that launcher force closed and I cant go on with the setup
Since001 said:
im able able to get it boot, but it hangs at the setup
when I touch the android an error pops up that launcher force closed and I cant go on with the setup
Click to expand...
Click to collapse
Um.. setup is part of gapps .. we have not hacked gingerbread gapps to work yet on this.. so I'd not install whatever non gingerbread gapps you have.
I haven't flashed any gapps. I just flashed your alpha, nothing else.
Sent from my HTC Dream using XDA App
While trying to build gingerbread I've experienced some trouble:
Code:
. build/envsetup.sh
including device/htc/sapphire/vendorsetup.sh
debian:~/Desktop/android/gingerbread$ lunch
You're building on Linux
Lunch menu... pick a combo:
1. generic-eng
2. simulator
3. full_sapphire-userdebug
Which would you like? [generic-eng] 3
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: /lib/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: /lib/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: /lib/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: /lib/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: /lib/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: /lib/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: /lib/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: /lib/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.3.1
TARGET_PRODUCT=full_sapphire
TARGET_BUILD_VARIANT=userdebug
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=GINGERBREAD
============================================
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: /lib/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: /lib/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)
A quick and brutal fix is to:
1) go to gingerbread/prebuilt/linux-x86/toolchain
2) rename arm-eabi-4.4.3 to arm-eabi-4.4.3.old
3) link arm-eabi-4.4.0 to arm-eabi-4.4.3
Code:
cd gingerbread/prebuilt/linux-x86/toolchain
mv arm-eabi-4.4.3 to arm-eabi-4.4.3.old
ln -s arm-eabi-4.4.0 arm-eabi-4.4.3
One more fix needed to build on x86 is to change
Code:
# This forces a 64-bit build for Java6
LOCAL_CFLAGS += -m64
LOCAL_LDFLAGS += -m64
in the Android.mk files of the gingerbread/external/clearsilver/ directory
and subdirectories to:
Code:
# This forces a 64-bit build for Java6
LOCAL_CFLAGS += -m32
LOCAL_LDFLAGS += -m32
This should be fixed in a more elegant way based on the host arch.
Started to compile now....................................Done.
Works so far.
Patch attached to fix build on 32 bit hosts.
Code:
repo diff
project build/
diff --git a/core/main.mk b/core/main.mk
index 6113e52..72e32c8 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -72,7 +72,8 @@ $(info Checking build tools versions...)
ifeq ($(BUILD_OS),linux)
build_arch := $(shell uname -m)
-ifneq (64,$(findstring 64,$(build_arch)))
+#ifneq (64,$(findstring 64,$(build_arch)))
+ifneq (i686,$(findstring i686,$(build_arch)))
$(warning ************************************************************)
$(warning You are attempting to build on a 32-bit system.)
$(warning Only 64-bit build environments are supported beyond froyo/2.2.)
project external/clearsilver/
diff --git a/cgi/Android.mk b/cgi/Android.mk
index 21c534b..2c7bf36 100644
--- a/cgi/Android.mk
+++ b/cgi/Android.mk
@@ -13,8 +13,12 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
LOCAL_CFLAGS := -fPIC
# This forces a 64-bit build for Java6
-LOCAL_CFLAGS += -m64
-LOCAL_LDFLAGS += -m64
+#LOCAL_CFLAGS += -m64
+#LOCAL_LDFLAGS += -m64
+
+# This forces a 64-bit build for Java6
+LOCAL_CFLAGS += -m32
+LOCAL_LDFLAGS += -m32
LOCAL_NO_DEFAULT_COMPILER_FLAGS := true
diff --git a/cs/Android.mk b/cs/Android.mk
index 9f0e30a..4807b3f 100644
--- a/cs/Android.mk
+++ b/cs/Android.mk
@@ -9,8 +9,10 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
LOCAL_CFLAGS := -fPIC
# This forces a 64-bit build for Java6
-LOCAL_CFLAGS += -m64
-LOCAL_LDFLAGS += -m64
+#LOCAL_CFLAGS += -m64
+#LOCAL_LDFLAGS += -m64
+LOCAL_CFLAGS += -m32
+LOCAL_LDFLAGS += -m32
LOCAL_NO_DEFAULT_COMPILER_FLAGS := true
diff --git a/java-jni/Android.mk b/java-jni/Android.mk
index 21b4fd1..cc6d3ce 100644
--- a/java-jni/Android.mk
+++ b/java-jni/Android.mk
@@ -34,8 +34,10 @@ LOCAL_C_INCLUDES := \
LOCAL_CFLAGS += -fPIC
# This forces a 64-bit build for Java6
-LOCAL_CFLAGS += -m64
-LOCAL_LDFLAGS += -m64
+#LOCAL_CFLAGS += -m64
+#LOCAL_LDFLAGS += -m64
+LOCAL_CFLAGS += -m32
+LOCAL_LDFLAGS += -m32
LOCAL_NO_DEFAULT_COMPILER_FLAGS := true
diff --git a/util/Android.mk b/util/Android.mk
index 386f379..fc27bbf 100644
--- a/util/Android.mk
+++ b/util/Android.mk
@@ -18,8 +18,12 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
LOCAL_CFLAGS := -fPIC
# This forces a 64-bit build for Java6
-LOCAL_CFLAGS += -m64
-LOCAL_LDFLAGS += -m64
+#LOCAL_CFLAGS += -m64
+#LOCAL_LDFLAGS += -m64
+
+# This forces a 64-bit build for Java6
+LOCAL_CFLAGS += -m32
+LOCAL_LDFLAGS += -m32
LOCAL_NO_DEFAULT_COMPILER_FLAGS := true
I saw you changed a few things so i made a new build, 3d seams faster, but it will crash still:
http://cyanogenmod.pastebin.com/eSGptyBR
Click to expand...
Click to collapse
I build the test rom with the Pershoot 2.6.35.10.
Also i attached the script im using for the build, isnt "mine", just adapted it a bit
p.s make the directory for the repo, put this script in in, chmod a+X G1Ginger.txt, ./G1Ginger.txt
roalex said:
I saw you changed a few things so i made a new build, 3d seams faster, but it will crash still:
I build the test rom with the Pershoot 2.6.35.10.
Also i attached the script im using for the build, isnt "mine", just adapted it a bit
p.s make the directory for the repo, put this script in in, chmod a+X G1Ginger.txt, ./G1Ginger.txt
Click to expand...
Click to collapse
You could add processor number autodetection to your the script:
Code:
processors=`grep -c processor /proc/cpuinfo`
and substitute the -j n switch with:
Code:
-j $processors
Going to give this a try on my spare G1.
Is this designed to require the 2708 or do we need to run a different kernel for 2708 support?
brentil said:
Going to give this a try on my spare G1.
Is this designed to require the 2708 or do we need to run a different kernel for 2708 support?
Click to expand...
Click to collapse
ATM it is a 2708 kernel.
If you dont have lastest radio you can always try to flash pershoot's Kernel 2.6.35.10 – OC-UV-RAM-FP – Dream/Sapphire (32B/A) here right after flashing the rom.
I have'nt tested it myself, but I changed and used pershoot's 2708 kernel zImage instead of ezterry's since it was getting a lil old when we first started working together on this...
It worked fine so it should work...
Yeah, I'm running the newer radio on both my G1 & MT3G.
Ok so I tried flashing the Gingerbread rom after super wiping my G1. I get the following error.
Code:
Installing update...
assert failed: || getprop("ro.bootloader") == "1.33.0011" ||
...
|| getprop("ro.bootloader") == "1.33.0013d"
(status 7)
So I thought maybe it was the spoofed SPL so I refashed back to engineering HBOOT 2005 and fastbooted 2013d without spoofing it and I get the same issue,
farmatito said:
You could add processor number autodetection to your the script:
Code:
processors=`grep -c processor /proc/cpuinfo`
and substitute the -j n switch with:
Code:
-j $processors
Click to expand...
Click to collapse
normaly you dont access /proc/cpuinfo w/o sudo tho right ?
in any case people can just change it as they see fit
brentil said:
Yeah, I'm running the newer radio on both my G1 & MT3G.
Ok so I tried flashing the Gingerbread rom after super wiping my G1. I get the following error.
Code:
Installing update...
assert failed: || getprop("ro.bootloader") == "1.33.0011" ||
...
|| getprop("ro.bootloader") == "1.33.0013d"
(status 7)
So I thought maybe it was the spoofed SPL so I refashed back to engineering HBOOT 2005 and fastbooted 2013d without spoofing it and I get the same issue,
Click to expand...
Click to collapse
If you have the newest radio and spl combo, you don't need to spoof the SPL.
You can always remove the SPL check in the updater script (\META-INF\com\google\android\updater-script) :
Code:
assert(getprop("ro.bootloader") == "1.33.0011" ||
getprop("ro.bootloader") == "1.33.2011" ||
getprop("ro.bootloader") == "1.33.3011" ||
getprop("ro.bootloader") == "1.33.0013" ||
getprop("ro.bootloader") == "1.33.2013" ||
getprop("ro.bootloader") == "1.33.3013" ||
getprop("ro.bootloader") == "1.33.0013d");
and resign with test-keys the modded update.zip and it will flash without checking the installed SPL.
roalex said:
normaly you dont access /proc/cpuinfo w/o sudo tho right ?
in any case people can just change it as they see fit
Click to expand...
Click to collapse
Code:
dr-xr-xr-x 69 root root 0 2010-12-06 10:16 /proc
-r--r--r-- 1 root root 0 2010-12-22 17:17 /proc/cpuinfo
/proc/cpuinfo is world-readable.

[TOOL]RK29kitchen - firmware customizer for Linux and rk2918 based tablets

This package is designed to automate operations firmware update for the devices based on processor RK2918.
Important!
Use of this software package can cause damage to your device!
This software package is supplied "as is" and without warranty.
This software package may not meet your expectations.
ONLY FOR LINUX (and other *nix like OS)
You can:
- Unpack the firmware file consisting of one kind update.img (img mode, used RKBatchTool)
- Unpack the firmware file consisting of a set RK29xxLoader.bin Image/boot.img Image/system.img etc (Image mode, used RKTool)
- Change the name of the device and partition sizes (parameter file)
- Install su and superuser (root access)
- Install busybox in /system/xbin and create symlinks for the utilities that comes with busybox
- Choose and install/uninstall some system applications
- Change the file size system.img
- Create update.img
also
- Create their own plug-ins
- Create automated scripts based on an existing plugin library
- Modify the list of proposed system applications
- Plug-in to remove files from the "black list"
- some build.prop fixes
and
- dump current flash from device
Notes
The package runs on Linux operating systems (development and testing on OpenSUSE 11.4/12.2)
The user interface is implemented using utilities 'dialog'
Binary utilities (directory bin) can be compiled using:
# cd src /
# make && make install
Dependences: libusb-1.0, libusb-1.0-devel, libssl, libssl-devel, dialog, sudo, gcc
To work actively used sudo (you can set up password-less mode) - need to modify the partition 'system'
Use:
[full_or_partial_path/]menu.sh [workdir]
[full_or_partial_path/]batchImgRepack.sh [full_or_partial_path/]old.img
[full_or_partial_path/]batchImageRepack.sh [full_or_partial_path_to_Image]
flashdump
workdir may contain update.img (img mode) or set of files (Image mode)
Homepage
Latest version
Updates:
not use sudo if run as root
src/update.sh - update sources for used tools (start make && make install after update)

[DEV][TEMPLATE] AnyKernel3 - Easily Mod ROM Ramdisk + Pack Image.gz [Flashable Zip]

AnyKernel3 -- Flashable Zip Template for Kernel Releases with Ramdisk Modifications
"AnyKernel is a template for an update.zip that can apply any kernel to any ROM, regardless of ramdisk." - Koush
The concept of AnyKernel has been around for awhile, (originally by Koushik Dutta/ClockworkMod,) which allowed a device-specific kernel zImage to be flashed over device-specific ROM and use the ramdisk that came with the ROM to reduce the chance of any issues arising from the custom kernel pairing.
The drawback to this was that some kernels require modifications to the ramdisk to enable/set up kernel features, and in the old AnyKernel format there was no way to do this. Enter AnyKernel2.
AnyKernel2 pushed the format even further by allowing kernel developers to modify the underlying ramdisk for kernel feature support easily using a number of included command methods along with properties and variables to customize the installation experience to their kernel. AnyKernel3 adds the power of topjohnwu's magiskboot for wider format support by default.
A script based on Galaxy Nexus (tuna) is included for reference. An example of ramdisk-only changes can be seen in my GN Synapse Injector repo. For an example that also modifies ROM and properly injects init.d support using busybox run-parts and sepolicy-inject see CosmicDan's CosmicTweaks project. For a multi-partition example and an example of how to handle a device which only has a ramdisk when rooted see my N5X/6P BLOD Workaround Injector. Other working AK2/3 examples for more recent devices may be found on eng.stk's blu_spark device repos under Releases.
Please see the linked posts here for instructions on enabling full AVBv1 (Pixel), AVBv1, A/B slot and/or system-as-root (SAR) or 2-stage init (2SI) device support, and further guidelines for system-as-root/2-stage init (/system/system in recovery) modifications in general.
Please also see the post here for important notes about the current state of AOSP vendor_boot v4 support and AVBv2 flag options.
Magisk root is automatically detected and retained by patching the new Image.*-dtb as Magisk would!
My development work on my many projects comes out of my free time, so if you enjoy this project or anything else I've done on xda, please consider sponsoring my ongoing work using my GitHub Sponsors profile. For a one-time donation you can hit the donate link from my profile. Thank you for your support!
Source: https://github.com/osm0sis/AnyKernel3/
Download: https://github.com/osm0sis/AnyKernel3/archive/master.zip
Instructions
1) Place final kernel build product, e.g. Image.gz-dtb or zImage to name a couple, in the zip root (any separate dt, dtb, recovery_dtbo, dtbo and/or vendor_dlkm should also go here for devices that require custom ones, each will fallback to the original if not included)
2) Place any required ramdisk files in /ramdisk (/vendor_ramdisk for simple multi-partition vendor_boot v3 support) and module files in /modules (with the full path like /modules/system/lib/modules)
3) Place any required patch files (generally partial files which go with AK3 file editing commands) in /patch (/vendor_patch for simple multi-partition vendor_boot v3 support)
4) Modify the anykernel.sh to add your kernel's name, boot partition location, permissions for any added ramdisk files, and use methods for any required ramdisk modifications (optionally, also place banner and/or version files in the root to have these displayed during flash)
5) `zip -r9 UPDATE-AnyKernel3.zip * -x .git -x .github README.md *placeholder`
The LICENSE file must remain in the final zip to comply with licenses for binary redistribution and the license of the AK3 scripts.
If supporting a recovery that forces zip signature verification (like Cyanogen Recovery) then you will need to also sign your zip using the method I describe here:
[DEV][TEMPLATE] Complete Shell Script Flashable Zip Replacement + Signing [SCRIPT]
Not required, but any tweaks you can't hardcode into the source (best practice) should be added with an additional init.tweaks.rc or bootscript.sh to minimize the necessary ramdisk changes. On newer devices Magisk allows these within /overlay.d - see examples.
It is also extremely important to note that for the broadest AK3 compatibility it is always better to modify a ramdisk file rather than replace it.
If running into trouble when flashing an AK3 zip, the suffix -debugging may be added to the zip's filename to enable creation of a debug .tgz of /tmp for later examination while booted or on desktop.
Staying Up-To-Date
Now that you've got a ready zip for your device, you might be wondering how to keep it up-to-date with the latest AnyKernel commits. AnyKernel2 and AnyKernel3 have been painstakingly developed to allow you to just drop in the latest update-binary and tools directory and have everything "just work" for beginners not overly git or script savvy, but the best practice way is as follows:
1) Fork my AnyKernel3 repo on GitHub
2) `git clone https://github.com/<yourname>/AnyKernel3`
3) `git remote add upstream https://github.com/osm0sis/AnyKernel3`
4) `git checkout -b <devicename>`
5) Set it up like your <devicename> zip (i.e. remove any folders you don't use like ramdisk or patch, delete README.md, and add your anykernel.sh and optionally your Image.*-dtb if you want it up there) then commit all those changes
6) `git push --set-upstream origin <devicename>`
7) `git checkout master` then repeat steps 4-6 for any other devices you support
Then you should be able to `git pull upstream master` from your master branch and either merge or cherry-pick the new AK3 commits into your device branches as needed.
Enjoy!
Questions, comments and feedback welcome.
Credits & Thanks: All authors of the included binaries and the tools I used to port them over for their amazing work. koush for the original AnyKernel concept.
Disclaimer: Naturally, you take all the responsibility for what happens to your device when you start messing around with things.
Script Commands Reference
Everything to edit is self-contained in anykernel.sh. A quick-reference for the commands and properties included are as follows.
Properties / Variables
These are some values that will be read during the install process, allowing you to customize your installation, e.g. block= is a shell variable to specify the kernel/boot block partition that the dump_boot command method will copy and unpack.
Code:
kernel.string=KernelName by YourName @ xda-developers
do.devicecheck=1
do.modules=1
do.systemless=1
do.cleanup=1
do.cleanuponabort=0
device.name1=maguro
device.name2=toro
device.name3=toroplus
device.name4=tuna
supported.versions=6.0 - 7.1.2
supported.patchlevels=2019-07 -
block=/dev/block/platform/omap/omap_hsmmc.0/by-name/boot;
is_slot_device=0;
ramdisk_compression=auto;
patch_vbmeta_flag=auto;
do.devicecheck=1 specified requires at least device.name1 to be present. This should match ro.product.device, ro.build.product, ro.product.vendor.device or ro.vendor.product.device from the build.prop files for your device. There is support for as many device.name# properties as needed. You may remove any empty ones that aren't being used.
do.modules=1 will push the .ko contents of the modules directory to the same location relative to root (/) and apply correct permissions. On A/B devices this can only be done to the active slot.
do.systemless=1 (with do.modules=1) will instead push the full contents of the modules directory to create a simple "ak3-helper" Magisk module, allowing developers to effectively replace system files, including .ko files. If the current kernel is changed then the kernel helper module automatically removes itself to prevent conflicts.
do.cleanup=0 will keep the zip from removing its working directory in /tmp/anykernel (by default) - this can be useful if trying to debug in adb shell whether the patches worked correctly.
do.cleanuponabort=0 will keep the zip from removing its working directory in /tmp/anykernel (by default) in case of installation abort.
supported.versions= will match against ro.build.version.release from the current ROM's build.prop. It can be set to a list or range. As a list of one or more entries, e.g. 7.1.2 or 8.1.0, 9 it will look for exact matches, as a range, e.g. 7.1.2 - 9 it will check to make sure the current version falls within those limits. Whitespace optional, and supplied version values should be in the same number format they are in the build.prop value for that Android version.
supported.patchlevels= will match against ro.build.version.security_patch from the current ROM's build.prop. It can be set as a closed or open-ended range of dates in the format YYYY-MM, whitespace optional, e.g. 2019-04 - 2019-06, 2019-04 - or - 2019-06 where the last two examples show setting a minimum and maximum, respectively.
block=auto instead of a direct block filepath enables detection of the device boot partition for use with broad, device non-specific zips. Also accepts any partition filename (from by-name), e.g. boot, recovery, or vendor_boot.
is_slot_device=1 enables detection of the suffix for the active boot partition on slot-based devices and will add this to the end of the supplied block= path. Also accepts auto for use with broad, device non-specific zips.
ramdisk_compression=auto allows automatically repacking the ramdisk with the format detected during unpack. Changing auto to gz, lzo, lzma, xz, bz2, lz4, or lz4-l (for lz4 legacy) instead forces the repack as that format, and using cpio or none will (attempt to) force the repack as uncompressed.
patch_vbmeta_flag=auto allows automatically using the default AVBv2 vbmeta flag on repack, and use the Magisk configuration (Canary 23016+). Set to 0 forces keeping whatever is in the original AVBv2 flags, and set to 1 forces patching the flag (only necessary on few devices).
customdd="<arguments>" may be added to allow specifying additional dd parameters for devices that need to hack their kernel directly into a large partition like mmcblk0, or force use of dd for flashing.
slot_select=active|inactive may be added to allow specifying the target slot. If omitted the default remains active.
no_block_display=1 may be added to disable output of the detected final used partition+slot path for zips which choose to include their own custom output instead.
Command Methods
Code:
ui_print "<text>" [...]
abort ["<text>" [...]]
contains <string> <substring>
file_getprop <file> <property>
set_perm <owner> <group> <mode> <file> [<file2> ...]
set_perm_recursive <owner> <group> <dir_mode> <file_mode> <dir> [<dir2> ...]
dump_boot
split_boot
unpack_ramdisk
backup_file <file>
restore_file <file>
replace_string <file> <if search string> <original string> <replacement string> <scope>
replace_section <file> <begin search string> <end search string> <replacement string>
remove_section <file> <begin search string> <end search string>
insert_line <file> <if search string> before|after <line match string> <inserted line>
replace_line <file> <line replace string> <replacement line> <scope>
remove_line <file> <line match string> <scope>
prepend_file <file> <if search string> <patch file>
insert_file <file> <if search string> before|after <line match string> <patch file>
append_file <file> <if search string> <patch file>
replace_file <file> <permissions> <patch file>
patch_fstab <fstab file> <mount match name> <fs match type> block|mount|fstype|options|flags <original string> <replacement string>
patch_cmdline <cmdline entry name> <replacement string>
patch_prop <prop file> <prop name> <new prop value>
patch_ueventd <ueventd file> <device node> <permissions> <chown> <chgrp>
repack_ramdisk
flash_boot
flash_generic <partition name>
write_boot
reset_ak [keep]
setup_ak
"if search string" is the string it looks for to decide whether it needs to add the tweak or not, so generally something to indicate the tweak already exists. "cmdline entry name" behaves somewhat like this as a match check for the name of the cmdline entry to be changed/added by the patch_cmdline function, followed by the full entry to replace it. "prop name" also serves as a match check in patch_prop for a property in the given prop file, but is only the prop name as the prop value is specified separately.
Similarly, "line match string" and "line replace string" are the search strings that locate where the modification needs to be made for those commands, "begin search string" and "end search string" are both required to select the first and last lines of the script block to be replaced for replace_section, and "mount match name" and "fs match type" are both required to narrow the patch_fstab command down to the correct entry.
"scope" may be specified as "global" to force all instances of the string/line targeted by replace_string, replace_line or remove_line to be replaced/removed accordingly. Omitted or set to anything else and it will perform the default first-match action.
"before|after" requires you simply specify "before" or "after" for the placement of the inserted line, in relation to "line match string".
"block|mount|fstype|options|flags" requires you specify which part (listed in order) of the fstab entry you want to check and alter.
dump_boot and write_boot are the default method of unpacking/repacking, but for more granular control, or omitting ramdisk changes entirely ("OG AK" mode), these can be separated into split_boot; unpack_ramdisk and repack_ramdisk; flash_boot respectively. flash_generic can be used to flash an image to the corresponding partition. It is automatically included for dtbo and vendor_dlkm in write_boot but can be called separately if using "OG AK" mode or creating a simple partition flashing only zip.
Multi-partition zips can be created by removing the ramdisk and patch folders from the zip and including instead "-files" folders named for the partition (without slot suffix), e.g. boot-files + recovery-files, or kernel-files + ramdisk-files (on some Treble devices). These then contain Image.gz, and ramdisk, patch, etc. subfolders for each partition. To setup for the next partition, simply set block= (without slot suffix) and ramdisk_compression= for the new target partition and use the reset_ak command.
Similarly, multi-slot zips can be created with the normal zip layout for the active (current) slot, then resetting for the inactive slot by setting block= to the partition (without slot suffix) again, slot_select=inactive and ramdisk_compression= to the desired options for the target slot and using the reset_ak keep command, which will retain the patch and any added ramdisk files for the next slot.
backup_file may be used for testing to ensure ramdisk changes are made correctly, transparency for the end-user, or in a ramdisk-only "mod" zip. In the latter case restore_file could also be used to create a "restore" zip to undo the changes, but should be used with caution since the underlying patched files could be changed with ROM/kernel updates.
You may also use ui_print "<text>" to write messages back to the recovery during the modification process, abort "<text>" to abort with optional message, and file_getprop "<file>" "<property>" and contains "<string>" "<substring>" to simplify string testing logic you might want in your script.
Binary Inclusion
The AK3 repo includes current ARM builds of magiskboot, magiskpolicy, lptools_static and busybox by default to keep the basic package small. Builds for other architectures and optional binaries (see below) are available from the latest Magisk zip, or my latest AIK-mobile and Flashlt packages, respectively, here:
https://forum.xda-developers.com/t/...kernel-ramdisk-win-android-linux-mac.2073775/ (Android Image Kitchen thread)
https://forum.xda-developers.com/t/...-and-ends-multiple-devices-platforms.2239421/ (Odds and Ends thread)
Optional supported binaries which may be placed in /tools to enable built-in expanded functionality are as follows:
mkbootfs - for broken recoveries, or, booted flash support for a script/app via bind mount to /tmp (deprecated/use with caution)
flash_erase, nanddump, nandwrite - MTD block device support for devices where the dd command is not sufficient
dumpimage, mkimage - DENX U-Boot uImage format support
mboot - Intel OSIP Android image format support
unpackelf, mkbootimg - Sony ELF kernel.elf format support, repacking as AOSP standard boot.img for unlocked bootloaders
elftool (with unpackelf) - Sony ELF kernel.elf format support, repacking as ELF for older Sony devices
mkmtkhdr (with unpackelf) - MTK device boot image section headers support for Sony devices
futility + chromeos test keys directory - Google ChromeOS signature support
boot_signer-dexed.jar + avb keys directory - Google Android Verified Boot 1.0 (AVBv1) signature support
rkcrc - Rockchip KRNL ramdisk image support
Optionally moving ARM builds to tools/arm and putting x86 builds in tools/x86 will enable architecture detection for use with broad, device non-specific zips.
Boom . dibs on first :good:
You get 2 thank button presses fro me lol
Awesome work man as always
Good thing that this amazing work has it's own thread. Congrats buddy.
Sent from my Galaxy Nexus using XDA Premium 4 mobile app
Thanks guys!
I figured it would be nice to get it out there and also have it as a "Help Desk" thread for kernel devs who have questions about implementation, etc. too. Some devices might require switching it from dd to MTD-Utils, so I can help with that. So on and so forth.
Once we get a few devs who know how to use it, it should be pretty easy to help others. I'm looking at you Smitty. No pressure.
I finished my thanks ... but as always a great job.
ak said:
I finished my thanks ... but as always a great job.
Click to expand...
Click to collapse
So wait im confused. ?.. so 1) those that mean I can flash ak kerenl 4.2 with ur any kernel to my 4.4 .
2) those it have to be same kerenl for same phone manufacturer. Meaning can I be stupid enought to flash a nexus 4 kernel in my gnexus?
I understand any kernel cause I have been using smitty so thanks
milojoseph said:
So wait im confused. ?.. so 1) those that mean I can flash ak kerenl 4.2 with ur any kernel to my 4.4 .
2) those it have to be same kerenl for same phone manufacturer. Meaning can I be stupid enought to flash a nexus 4 kernel in my gnexus?
I understand any kernel cause I have been using smitty so thanks
Click to expand...
Click to collapse
Haha I wrote "device-specific" in the OP to try and avoid this very confusion.
Since I answered this same question earlier tonight in my Odds and Ends thread I'll just paste it here:
caspboy said:
so now devs can use kernels from other devices with their roms?
Click to expand...
Click to collapse
osm0sis said:
No. That's crazy talk. :laugh:
The concept of AnyKernel has been around for awhile, (originally by Koushik Dutta/ClockworkMod,) which allows device-specific kernels to be flashed over device-specific ROMs and use the ramdisk that came with the ROM to reduce the chance of any issues arising from the custom kernel pairing.
The drawback to this is that some kernels require modifications to the ramdisk to enable/set up kernel features, but in the old AnyKernel format there was no way to do this. Until now.
AnyKernel 2.0 makes it easy for kernel devs to use a number of simple command methods to automate the process of adding tweaks into a ROM's underlying ramdisk during the flashing process. :good:
Click to expand...
Click to collapse
Hopefully that helps. Basically exactly what's in the OP since that's where I edited it in from.
The only way I can explain it any further is with the very basics: that kernel boot.img files contain a zImage and a ramdisk. "AnyKernel Classic" just slaps the custom kernel zImage on top of the ROM's untouched default kernel boot.img ramdisk. AnyKernel 2.0 allows kernel devs to also modify the ramdisk to add anything required for kernel features in addition to the usual repacking it with the custom zImage and flashing it.
Great thread!! Best of lucky bro!!!
Sent from my Galaxy Nexus using xda app-developers app
AnyKernel will work on my phone now ? Thanks for enhancing awesome @osm0sis but DrRamdisk to the rest of you guys ?
wow,thats very cool,great work.
Github updated with my own forked native compiles of mkbootimg+unpackbootimg.
This should expand AnyKernel 2.0 device support a lot by using all the available offsets in mkbootimg, as exported by my drastically updated unpackbootimg. :good:
osm0sis said:
Github updated with my own forked native compiles of mkbootimg+unpackbootimg.
This should expand AnyKernel 2.0 device support a lot by using all the available offsets in mkbootimg, as exported by my drastically updated unpackbootimg. :good:
Click to expand...
Click to collapse
Hi osm0sis,
Have You update anykernel 2.0 to work with cyanogen11 roms ? Thanks for Your hard work !
Should already?
It uses the ROM kernel ramdisk like AnyKernel always has. Your custom kernel dev just needs to use it. Spread the word. :good:
osm0sis said:
Should already?
It uses the ROM kernel ramdisk like AnyKernel always has. Your custom kernel dev just needs to use it. Spread the word. :good:
Click to expand...
Click to collapse
Recently I had used Your method on Cyano11 but boot stopped on "Google".. new Cyano11 (that required ramdisk changes) had just come out and maybe anykernel 2.0 was not ready yet (I had just discovered your brillant work on It ! : Dita incrociate.
I'll try again ... if I have trouble going to ask you for help ...
I am already spreading the word : Cool:
Thanks man : Good:
What custom kernel were you trying to adapt to AnyKernel so you could flash it on CM?
osm0sis said:
What custom kernel were you trying to adapt to AnyKernel so you could flash it on CM?
Click to expand...
Click to collapse
Two kernels... My custom kernel (from cyanogenmod sources) and recently Fancy kernel (dirty-fancy)... now I want to try Fancy Kernel .. I need of a hibryd ramdisk for best final results and Your project is perfect for It !!! You're a genius !!!
Please, Can You link me Your dirty-V kernel re-pack by Anykernel 2.0 ? So I can follow It as an example. Thanks a lot...
So if I understand you, you're trying to make an AnyKernel 2.0 of Fancy Kernel so that you can flash it on any ROM for your device?
Should be doable. The DirtyV AnyKernel 2.0 is the example posted to the GitHub repo in the OP. Just follow the instructions to make your own anykernel script so that it will add the /sbin/ scripts and other ramdisk modifications (init.d, etc.) that @boype uses, instead of the DirtyV ones.
Good luck!
osm0sis said:
So if I understand you, you're trying to make an AnyKernel 2.0 of Fancy Kernel so that you can flash it on any ROM for your device?
Should be doable. The DirtyV AnyKernel 2.0 is the example posted to the GitHub repo in the OP. Just follow the instructions to make your own anykernel script so that it will add the /sbin/ scripts and other ramdisk modifications (init.d, etc.) that @boype uses, instead of the DirtyV ones.
Good luck!
Click to expand...
Click to collapse
Yes !
osm0sis ? If I want include init.rc original file by "real" ramdisk can I copy It as is into patch folder ?
It would go against the idea of AnyKernel to include the file like that. Remember, everything automatically comes from the original ramdisk, I just give you the ability to alter those files to add tweaks. :good:

[TOOL][Windows] Zip Builder v4.5.2 - Build and Sign ANY script based installer

Zip Builder is a stand-alone Windows exe (ZipBuild.exe) that can be used to build and sign Android zip-based installers from Windows folders. All required components to build and sign a zip installer are included - no additional files or software are required. The only requirement is that you have a current version of Java installed on your system. Zip Builder can be used on both shell-script and edify-script based installers and performs the proper build and signing methods, accordingly.
Although it's highly recommended to install the software using the Windows Installer (see below), the stand-alone exe is all that's required to use the program. The program command line options are as follows:
ZipBuild.exe <option1> <option2...> <*Folder Name>
Valid options are as follows:
'm' or '-manual': Manually select folder to be processed
's' or '-signed': Append '-signed' to the output file name
'5' or '-md5': Generate corresponding MD5 checksum file
'c' or '-confirm': Confirm options before building
'g' or '-gitinclude': include .git folders and related files
* Ignored when using manual selection mode
OPTIONS EXPLAINED
'm' or '-manual': In Manual mode you will be presented with a dialog box where you can manually select the folder containing the files to be processed. *When using Manual mode, the folder name will be ignored if it was provided in the command line
's' or '-signed': This option will append '-signed' to the output file name. For example: Folder name 'UPDATE-adb.Installer.v1.0.36' would produce a signed zip file named 'UPDATE-adb.Installer.v1.0.36-signed.zip'.
'5' or '-md5': This option will create a separate, corresponding MD5 checksum file that can be used to verify file integrity in TWRP or with other Windows checksum utilities.
'c' or '-confirm': When this option is used, you will be presented with a dialog box where you can confirm (or change) the 2 options above. If either (or both) options above have been specified on the command line, the checkboxes will be pre-selected accordingly. Once you're satisfied with your selections, click the 'Build Zip File' button to begin the zip building and signing process.
'g' or '-gitinclude': This option will include any .git folders and related files (.git, .gitignore, and .gitattributes) that are excluded from the zip file by default. [Should rarely be needed, if ever]​
ZIP BUILDER SETTINGS MANAGER
Zip Builder Settings Manager (ZipBuildSettings.exe) is an optional companion app that can be used to manage the settings and options (shown below) for Zip Builder:
You can choose to create Windows Context (Right-Click) menus that will allow you to build a signed zip installer simply by right-clicking on a folder name. Folder names that end in '20YYMMDD' or '20YYxxxx' as well as folder names that begin with 'UPDATE' are supported in Windows 7 and above. You can also enable the option to build from any folder by holding the SHIFT key while selecting the folder.
You can choose when to display the confirmation dialog
You can choose when to append '-signed' to output file names
You can choose when to create md5 checksum files
You can choose to include all .git folders and related files (see above)
DATE CODE FEATURE
If you're building from a Windows folder name that ends in '20YYMMDD' or '20YYxxxx', Zip Builder will give you the option to change or update the date code portion of the file name before building the zip (it will also suggest the current date's date code - YYYYMMDD). And, if you're building a zip installer that includes a g.prop file (found in many GApps packages), the installer will read the date code from the 'ro.addon.*_version=' property and automatically use it in place of the date code from the Windows folder name.​
WINDOWS INSTALLER
As mentioned above, you'll have the best user experience if you install Zip Builder using the Windows installer. It runs in standard user mode (no Admin access required or requested) and installs the Zip Builder and Zip Builder Settings exe's in: 'C:Users<user>AppDataRoamingZip Builder'. The installer will create a program group and shortcuts in the Windows start menu (and optionally on the desktop) that can be used to launch Zip Builder in 'manual selection mode', where the user can manually select the folder they wish to build. The installer will automatically run Zip Builder Settings Manager at the conclusion of the install where you can configure the settings and options to your personal preference.
Uninstalling Zip Builder from the Windows Uninstall menu will remove all traces of the software from your system. And, since Zip Builder, Zip Builder Settings Manager, or its installer will NEVER prompt for UAC access, you can be confident that it's not touching the Windows operating system. Of course, all source code is available if you want to check for yourself - you can even build it for yourself, if you want!​
TECHNICAL NOTES
Version 4.3+ of Zip Builder includes the new ZipSigner 2.1 Java executable that was rewritten from the ground up by @topjohnwu for use in his Magisk root management software. This change will allow you to build the largest zip installer on even the smallest 32-bit machine. I was able to build a 1.0+GB shell-script based installed on a 32-bit Windows XP machine with only 1GB of RAM.
If you have had java heap size issues building zip installers in the past, version 4.3+ of Zip Builder should completely eliminate these problems.​
XDA:DevDB Information
Zip Builder, Tool/Utility for all devices (see above for details)
Contributors
TKruzze
Version Information
Status: Stable
Current Stable Version: 4.5.2
Stable Release Date: 2020-09-06
Created 2018-01-23
Last Updated 2020-09-06
Anti-Virus False-Positives
ANTI-VIRUS FALSE-POSITIVES
There have been reports of false-positive flaggings of Zip Builder and/or the Windows installer. While I can, personally, assure you that there's no malware included in Zip Builder or its installer, I also understand that there may be some concern with using software that's been flagged on your machine.
To allay your concerns as best as possible, I have included 100% of the original source code for you to inspect and/or build the software yourself. Again, there is no possibility of malware as I do all of my compiling on a clean machine that is not connected to the internet. I have also submitted all 4 Windows executables to the major AV inspection service on the net. Below are the results of these inspections:
VirusTotal.com
ZipBuild.exe (32 bit) 7/68
ZipBuild.exe (64 bit) 2/68
ZipBuildSettings.exe 4/67
Zip Builder_4.5.2_Setup.exe 1/69
Sources & Acknowledgements / Recent Changes
SOURCES AND ACKNOWLEDGEMENTS
Zip Builder has existed for me since way back in 2013 when I started developing GApps packages. I've added features here and there and finally decided to share it. After privately sharing with @osm0sis, I received a lot of very constructive feedback and based on this, I polished the interface and added some new features. A big thank you to @osm0sis for this feedback. Without his input, it would look a lot clunkier than it does today.
All source code is provided, however, it's only appropriate for me to publicly acknowledge that this work includes code and binaries from several third party sources. Below is a complete list of these sources. You will also find this list as well as the actual code and binaries in the Source Code Zip file available for download.
Zip Builder
------------
Zip Builder is Copyright (c) 2013-2020 by @TKruzze
Original source code and compiled executables can be found on
XDA Developers. Zip Builder also includes code and compiled
executables from the sources listed below:
ZipSigner
---------------
ZipSigner is Copyright (c) 2016-2020, John Wu @topjohnwu)
Original source code and license can be found at:
https://github.com/topjohnwu/Magisk
The version of ZipSigner used in Zip Builder was built by @topjohnwu using the source code above and optimized using ProGuard optimizations
Info-ZIP
----------
Info-ZIP is Copyright (c) 1990-2007 Info-ZIP
Original License can be found at:
http://www.info-zip.org/license.html
Downloads can be found at:
ftp://ftp.info-zip.org/pub/infozip/win32/
Original source code can be found at:
https://sourceforge.net/projects/infozip/
Hashutils
----------
The MD5 Checksum code and executable are from code.kliu.org
Original source code and compiled executables can be found at:
http://code.kliu.org/misc/hashutils/
SUMMARY OF RECENT CHANGES
SEPTEMBER 6, 2020 - v4.5.2
Fixed RegEx bug (oversight) that only supported automatic folder renaming through the year 2019. Now we're good through the year 2029.
As always, the best and easiest way to update is to simply install the new version using the Windows installer without uninstalling the previous version. All of your settings and options will be retained
NOVEMBER 1, 2018 - v4.5.1
Updated the cleanup function to also include removal of the SignAPK*.tmp files that are created in the %TEMP% folder during the signing process.
- Thanks to @osm0sis for reporting
MARCH 26, 2018 - v4.4.0
Updated the ZipSigner java executable to v2.1-min. This version is significantly smaller than v2.1 (458K vs 4.0MB) and was built by @topjohnwu, himself, using using ProGuard optimizations
Recompiled Zip Builder Settings Manager (ZipBuildSettings.exe) without UPX compression to try and further minimize AV false-positives
Windows installer now built using lzma2/max compression and no longer uses solid compression. This was done to optimize installation speed and further minimize AV false-positives
MARCH 25, 2018 - v4.3.0
Updated signing code with the new ZipSigner 2.1 Java executable that was rewritten from the ground up by @topjohnwu for use in his Magisk root management software. This change will allow you to build the largest zip installer on even the smallest 32-bit machine. I was able to build a 1.0+GB shell-script based installer on a 32-bit Windows XP machine with only 1GB of RAM.
- Thanks, of course, to @topjohnwu, but also to @osm0sis for the heads up on its existence
- Thanks to @jenslody for building it for inclusion here.
Since memory and java heap size issues are now resolved with the above change, I have removed all memory and java heap size checks from Zip Builder. The above change also allowed me to remove the separate test key files (testkey.pk8 and testkey.x509.pem), signapk.jar, zipadjust, and minsignapk.jar executables as their functions are all now contained in the new ZipSigner 2.1 Java executable mentioned above.
Installer will now clean up its 'temp folder' files before displaying the 'COMPLETED' message. On slower systems this should reduce the delay when selecting the 'Close' button after Zip Builder completes the signing process.
- Thanks to @osm0sis for reporting and helping track down the issue
Zip Builder is now built without UPX compression on the Windows exe's. This was done to try and reduce false-positives that may be reported by your AV software. If you're still having AV hits, please read the ANTI-VIRUS FALSE-POSITIVES section on the OP.
Fixed bug in installer that would corrupt the context (right-click) menu settings on an update (not initial) installation.
- Thanks to @osm0sis for reporting and helping track down the issue
Excellent! Glad to see a public release! I was using Zip Builder all day to prepare my latest round of updates for my Odds and Ends thread, and it couldn't be easier!
It's been great working with you again @TKruzze, I knew you couldn't stay away from contributing awesome things to the community for too long.
Looks very cool! You're inspiring me to clean up and release a tool that I built which has no current equivalent.
Seeing as this uses Java, what would it take to make it work under linux? As a staunch Linux/osx user who only runs a windows VM for flashing his Samsung with odin, I would love to integrate this into my workflow, but without linux or Mac support for me personally that will be difficult ?
This is an incredible contribution. Thank you for making this public and for your hard work!
partcyborg said:
Seeing as this uses Java, what would it take to make it work under linux?
Click to expand...
Click to collapse
The only thing I'm actually using Java for is the signing portion of the process. There's no real way I can think of to easily port the rest of it to Linux. Thanks for the feedback!
wow thanks @TKruzze :good:
this will be really helpful for my future firmware updates ✌
Ok im very very new to all this but does this make zips that are flashable in twrp? Im wanting to learn how to do that if you guys could point me in the right direction id be thankful.
papasmurf879 said:
Ok im very very new to all this but does this make zips that are flashable in twrp? Im wanting to learn how to do that if you guys could point me in the right direction id be thankful.
Click to expand...
Click to collapse
yes
you need update-script and update-binary along other files
TKruzze said:
The only thing I'm actually using Java for is the signing portion of the process. There's no real way I can think of to easily port the rest of it to Linux. Thanks for the feedback!
Click to expand...
Click to collapse
My mistake. Thanks for the explanation! I'm sure then that this will run in wine however, I may give it a shot at some point. If I do I will let you know.
kamilmirza said:
yes
you need update-script and update-binary along other files
Click to expand...
Click to collapse
Thank you for replying im doing searches right now trying to figure it out.
papasmurf879 said:
Thank you for replying im doing searches right now trying to figure it out.
Click to expand...
Click to collapse
Advanced, but check out my thread here and the linked resources: [DEV][TEMPLATE] Complete Shell Script Flashable Zip Replacement + Signing [SCRIPT]
The EDIFY references/resources are the place to start. :good:
Can i create flashable zips of my apks. I Flash custom roms very often and some apps are needed as my daily driver so can i make a flashable zip of those apk file and flash via this tool
Ash225 said:
Can i create flashable zips of my apks. I Flash custom roms very often and some apps are needed as my daily driver so can i make a flashable zip of those apk file and flash via this tool
Click to expand...
Click to collapse
Have you tried this?
This tool in this thread is for making a zip if you already have the components (updater script and binary).
madbat99 said:
Have you tried this?
This tool in this thread is for making a zip if you already have the components (updater script and binary).
Click to expand...
Click to collapse
Thanks but i knew about this app i want to creat zips from my computer and not from my phone thats why i asked the question thanks for your prompt reply
This looks like this tool that will, hopefully, be helpful for one of my other little projects that I had to put aside till I finish catching up with some other projects/developments that's already on my plate.
I already have a working set of script commands for safely disabling the Google Play Protect but, i will need a medium/delivery system before I can release it and this looks promising to help with this.
~~~~~~~~~~~~~~~
I DO NOT provide support via PM unless asked/requested by myself. PLEASE keep it in the threads where everyone can share.
Did you just give me a Trojan? Because Defender says so and even VirusTotal was positive about this. Beware about using this software!
Djentist said:
Did you just give me a Trojan? Because Defender says so and even VirusTotal was positive about this. Beware about using this software!
Click to expand...
Click to collapse
Yeah, I'm sure one of the most respected developers on XDA would do that. I'd be more worried about those antivirus softwares you're using than anything.
Djentist said:
Did you just give me a Trojan? Because Defender says so and even VirusTotal was positive about this. Beware about using this software!
Click to expand...
Click to collapse
Definitely not a very responsible post to make. There's nothing wrong about reporting your findings, but to make an accusation like this is a bit irresponsible. I also seriously doubt that Microsoft Defender identified this as a virus (as you claim).
Anyways, here are the facts: There is no virus or malicious behavior. Below are the actual results of scans by VirusTotal and VirScan
Zip Builder_4.2.1_Setup.exe
VirusTotal.com (0/65)
VirScan.org (1/39)
ZipBuildSettings.exe
VirusTotal.com (2/66)
VirScan.org (2/39)
ZipBuild.exe (32 bit)
VirusTotal.com (2/66)
VirScan.org (2/39)
ZipBuild.exe (64 bit)
VirusTotal.com (1/65)
VirScan.org (1/39)
Based on personal experience, ANY file that is not signed with a Microsoft Root Certificate and/or uses UPX compression is going to produce false positives with the heuristics deployed by some of these 'so called' anti-virus software products in the marketplace. I'm actually surprised the numbers are as low as they are.
All that said, if you are not comfortable using the software, fine. But please exercise responsible reporting if you have questions or concerns. A big part of the reason for me releasing all the source code is to avoid having to defend myself from people making exactly this type of assertion.

🕹️ apk.sh - makes reverse engineering Android apps easier.

Hi all folks,
I just want to introduce apk.sh (https://github.com/ax/apk.sh).
It is a Bash script that makes reverse engineering Android apps easier, automating some repetitive tasks like pulling, decoding, rebuilding and patching an APK.
Features​apk.sh basically uses apktool to disassemble, decode and rebuild resources and some bash to automate the frida gadget injection process. It also supports app bundles/split APKs.
Patching APKs to load frida-gadget.so on start.
Support for app bundles/split APKs.
Disassembling resources to nearly original form with apktool.
Rebuilding decoded resources back to binary APK/JAR with apktool.
Code signing the apk with apksigner.
Multiple arch support (arm, arm64, x86, x86_64).
No rooted Android device needed.
Getting Started​Pulling an APK from a device is simple as running
Code:
./apk.sh pull <package_name>
Decoding an APK is simple as running
Code:
./apk.sh decode <apk_name>
Rebuilding an APK is simple as running
Code:
./apk.sh build <apk_dir>
apk.sh pull​
Code:
apk.sh pull
pulls an APK from a device. It also supports app bundles/split APKs combining split APKs in a single APK file.
apk.sh patch​
Code:
apk.sh patch
patch an APK to load frida-gadget.so on start.
frida-gadget.so is a Frida's shared library meant to be loaded by programs to be instrumented (when the Injected mode of operation isn’t suitable). By simply loading the library it will allow you to interact with it using existing Frida-based tools like frida-trace. It also supports a fully autonomous approach where it can run scripts off the filesystem without any outside communication.
Patching an APK is simple as running
Code:
./apk.sh patch <apk_name> --arch arm
.
You can calso specify a Frida gadget configuration in a json
Code:
./apk.sh patch <apk_name> --arch arm --gadget-conf <config.json>
More info at: https://github.com/ax/apk.sh
Enjoy.
Added the ability to pull APK file from devices.
Added support for app bundles/split APKs.
v0.9.7 is OUT!
Added support for multidex APKs.
Bugfix.
v0.9.8 is OUT!
Updated to apktool v2.7.0.
Some refactoring.
Are you planning to implement anything to help with proguard?
MidasGlove said:
Are you planning to implement anything to help with proguard?
Click to expand...
Click to collapse
Where are you stuck?
tryin said:
Where are you stuck?
Click to expand...
Click to collapse
Well, I'm stuck with reversing an APK protected with ProGuard so I wondered if you know any tools you can add regarding that in the future.
MidasGlove said:
Well, I'm stuck with reversing an APK protected with ProGuard so I wondered if you know any tools you can add regarding that in the future.
Click to expand...
Click to collapse
I recommend you a new tool:
https://github.com/REAndroid/APKEditor
v1.0.3 is OUT!
Added support for APK renaming.
Bugfix.
v.1.0.4 is OUT!
Added `--net` to add a permissing network security config when building.
Added `--safe` to not decode resources when decoding (i.e. apktool -r).
Added `--no-dis` to not disassemble dex when decoding (i.e. apktool -s).
Bugfixing
Refactoring

Categories

Resources