[Guide][G800F/M/Y][7.1.2][UNOFFICIAL] Build Slim ROM 7 Nougat from Source - Galaxy S5 Mini General

Overview
I've created a very simple #!/bin/bash script (attached) to automate the initial build or subsequent rebuild of SpookCity138's ROM:
Slim Rom 7 for the Samsung S5 mini G800f (kminilte). The script simply automates the steps and processes created by others (none of which is my own work - all credit goes to the original creators). I have only tested this script on my own working environment: Gnome Ubuntu 17.04; 16GB RAM; i7-7700HQ; If your environment differs from this your experience may differ from mine.
How to Execute script
See readme at: https://github.com/fidoedidoe/build_scripts
Thanks
@spookcity138, @jimmy999x. Taking the time to educate me at each and every tentative step and demonstrating great patience
Contributors
spookcity138
jimmy999x
Script Source
The latest version of the script (and others for different devices) can be found here: https://github.com/fidoedidoe/build_scripts
SpookCity138's ROM
https://forum.xda-developers.com/galaxy-s5-mini/development/rom-slim-rom-7-nougat-t3558926
Created 2017-09-20
Last Updated 2017-12-09

There are sources to build this ROM for the Snapdragon variant (G800H)? It's a very good device, but simply there is not a single Nougat ROM for it...

wow, excellent, I have reviewed the code (I have not executed it yet) looks pretty good, it should work, I have to copy your script and modify it for other roms, thanks!
edit 1: it is possible to use this script (I use it and it works perfect) to automate even more the process of configuring the compilation environment https://github.com/akhilnarang/scripts
Also, for Ubunt 16.04 I added a couple more to make it easier some things:
cmake
nautilus (optional)
phablet-tools
unrar
silversearcher-ag (this is optional, but extremely useful for me, allows me to find the problematic lines inside a document or folder)

lfom said:
There are sources to build this ROM for the Snapdragon variant (G800H)? It's a very good device, but simply there is not a single Nougat ROM for it...
Click to expand...
Click to collapse
You need to apply some SELinux, CAF, And CM/LOS Patches to build a Nougat ROM for G800H, or that rom will not boot, or will shall not pass from build errors.
Is not a easy task.....

lfom said:
There are sources to build this ROM for the Snapdragon variant (G800H)? It's a very good device, but simply there is not a single Nougat ROM for it...
Click to expand...
Click to collapse
i found this on YT
so far so good for me
give it a try
https://youtu.be/UPOpJgqnlf8

not working for me -- using xubuntu 17.10

ko_taka said:
not working for me -- using xubuntu 17.10
Click to expand...
Click to collapse
Script updated on github (follow links for build_slimrom7_kminilte.sh). Tested on my laptop (Ubuntu gnome 17.04) and SlimRom7 version 1.17 builds successfully (although I have yet to test the build on the device). I'll update the attached zip in the opening page in the coming days, but as a general rule github is the best place to find latest version(s).
Thanks to @spookcity138 (again) for taking time the time and offering sound help / advice identifying the issues and resolve (the issue was within applying device specific patches ./apply.sh).

I am on 40GB partition. Not enough?
perly terminated.
Fetching projects: 70% (381/544) fatal: unable to access 'https://android.googlesource.com/platform/hardware/akm/': gnutls_handshake() failed: The TLS connection was non-properly terminated.
Fetching projects: 73% (398/544) fatal: unable to access 'https://android.googlesource.com/platform/system/connectivity/shill/': gnutls_handshake() failed: The TLS connection was non-properly terminated.
fatal: unable to access 'https://android.googlesource.com/platform/external/jsr330/': gnutls_handshake() failed: The TLS connection was non-properly terminated.
Fetching projects: 74% (403/544) fatal: unable to access 'https://android.googlesource.com/platform/external/jsr330/': gnutls_handshake() failed: The TLS connection was non-properly terminated.
error: Cannot fetch platform/external/jsr330
Fetching projects: 78% (425/544) fatal: write error: No space left on device
fatal: write error: No space left on device
fatal: write error: No space left on device
fatal: write error: No space left on device
fatal: write error: No space left on device
fatal: write error: No space left on device
fatal: write error: No space left on device
fatal: index-pack failed
error: index-pack died
fatal: index-pack failed
fatal: index-pack failed
fatal: index-pack failed
fatal: index-pack failed
fatal: index-pack failed
error: Cannot fetch SlimRoms/frameworks_base
Click to expand...
Click to collapse

ko_taka said:
I am on 40GB partition. Not enough?
Click to expand...
Click to collapse
Yeah,you're running out of space. I don't recall exactly what the sources and the build of a nougat ROM take,space wise. It seems a little weird you were running out of space syncing the sources. If I recall correctly nougat sources are somewhere between 25-30GB. I could be wrong though. The actual build itself (the out folder) also takes a fair bit of space. Again,just guessing,but around 15-20GB. I would say 60GB would be what you need.

hi spookcity138, nice to see you around
I haven't coded that so I'm feeling a bit lost
The process finally ended (now I am on 80GB partition)
I do not know where is the build if that built anything
those are the last lines
build_slimrom7_kminilte.sh: 176: build_slimrom7_kminilte.sh: [[: not found
Remove references to OmniRom recovery...
remove config_uriBlruEnabled references, spoils the build...
alter local manifest files for slimrom 7 build compatability...
insert text into file: frameworks/base/core/res/res/values/config.xml...
delete file cm_arrays.xml...
remove flipflap stuff from device/samsung/smdk3470-common/smdk3470-common.mk...
build_slimrom7_kminilte.sh: 205: read: Illegal option -t
build_slimrom7_kminilte.sh: 210: build_slimrom7_kminilte.sh: [[: not found
patching file include/telephony/ril.h
Hunk #1 FAILED at 31.
Hunk #2 succeeded at 395 (offset -1 lines).
Hunk #3 succeeded at 409 (offset -1 lines).
Hunk #4 succeeded at 569 (offset -1 lines).
Hunk #5 succeeded at 624 (offset -1 lines).
Hunk #6 succeeded at 1023 (offset -1 lines).
Hunk #7 succeeded at 5217 (offset -1 lines).
Hunk #8 succeeded at 5866 (offset -1 lines).
1 out of 8 hunks FAILED -- saving rejects to file include/telephony/ril.h.rej
manually reapplying failed Hunk #1...
patching file ril/Android.mk
patching file ril/libril/Android.mk
patching file ril/libril/ril.cpp
patching file ril/libsecril-client/Android.mk
applying frameworks_av to frameworks/av
Applying: av: Add samsung wfd service
Applying: add Android M MediaBufferGroup:MediaBufferGroup() for libwvm.so
applying frameworks_native to frameworks/native
Applying: Revert "Remove Parcel::writeIntPtr."
Applying: add missing const getSensorList() for MM gpsd (G800FXXU1CPK5)
applying hardware_libhardware to hardware/libhardware
applying hardware_ril to hardware/ril
Applying: ril: recover on crash
applying hardware_samsung_ril to hardware/samsung/ril
Applying: add SetAudioMode and SetSoundClockMode for MM audio-ril
applying packages_services_Telephony to packages/services/Telephony
./apply.sh: line 24: cd: /home/ferran/android/build_scripts/packages/services/Telephony: No such file or directory
build_slimrom7_kminilte.sh: 238: read: Illegal option -t
build_slimrom7_kminilte.sh: 243: build_slimrom7_kminilte.sh: [[: not found
prepare device specific code...
build_slimrom7_kminilte.sh: 249: build_slimrom7_kminilte.sh: source: not found
build_slimrom7_kminilte.sh: 250: build_slimrom7_kminilte.sh: lunch: not found
running croot...
build_slimrom7_kminilte.sh: 253: build_slimrom7_kminilte.sh: croot: not found
build_slimrom7_kminilte.sh: 262: read: Illegal option -t
build_slimrom7_kminilte.sh: 267: build_slimrom7_kminilte.sh: [[: not found
running mka bacon...
build_slimrom7_kminilte.sh: 273: build_slimrom7_kminilte.sh: mka: not found
Click to expand...
Click to collapse

ko_taka said:
hi spookcity138, nice to see you around
I haven't coded that so I'm feeling a bit lost
The process finally ended (now I am on 80GB partition)
I do not know where is the build if that built anything
those are the last lines
Click to expand...
Click to collapse
The build did not start. It applied the patches successfully (all but one where there was an error) Then it is just a serious of failures. I have not used this script so I cant say specifically where you are going wrong. Does the script have executable permissions? (I assume so as it partially worked) Do you have all of the need dependencies for building Android? Thats not the issue I don't think,but you need them either way. Other than that I am not real sure honestly. You may need to wait for @fidoedidoe to help you. I'll reply back if any possible reason comes to mind.

ko_taka said:
hi spookcity138, nice to see you around
I haven't coded that so I'm feeling a bit lost
The process finally ended (now I am on 80GB partition)
I do not know where is the build if that built anything
those are the last lines
Click to expand...
Click to collapse
Hi @ko_taka
@spookcity138 is correct, the script failed...when it succeeds it's pretty clear the last few messages published will read along the lines of: "Package Complete: .../out/target/product/kminilte/Slim-kminilte-7.1.2.build.1.17-UNOFFICIAL-20171209-1401.zip" followed by "#### make completed successfully (24:30 (mm:ss)) ####" (note the build time will vary depending on the power of your build machine and utilisation of ccache). Oh, FYI - my build folder is ~95GB in size (the ../out/ folder is 26GB and the ../.repo/ folder is 47GB!!)
Back to the script failure....first verify the following variable in the build_slimrom7_kminilte.sh is defined correctly for your environment:
Code:
WORK_DIRECTORY="$HOME/android/slimrom7"
For my personal build environment I keep the script (build_slimrom7_kminilte.sh) in a separate folder to where the source is located and the build is output to (just so i can purge those folders without losing the build script). FYI on your laptop your folder structure should look something like that shown below, with build_slimrom7.kminilte.sh stored in the folder .../build_scripts
Code:
/home/ferran/android/build_scripts
/home/ferran/android/slimrom7
Once the above is verified...the primary issue you have is every time you see "...[[: not found", the script is hitting an issue. Check that the first line of the script contains the line "#!/bin/bash ", this is called "shebang" and it tells your shell what program to interpret the script with, in our case we need "Bash". I'm now wondering what OS / Shell you're using (I use Ubuntu Gnome 17.04 with Bash version 4.4.7) does yours differ from this? To verify your Bash version:
Code:
$ bash -version
GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)
Copyright © 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
You could try forcing your shell to use bash (from memory), by switching to the /build_scripts/ folder and running the following command (do not use sudo or any elevated permissions):
Code:
$ cd /home/ferran/android/build_scripts
$ ./build_slimrom7_kminilte.sh
Let me know how you get on, in essence the script is failing on the evaluation lines where "if [[....]]" is used. if we can't get it to work, in your case, the script may need to be altered to change the evaluation (perhaps "if [...]" would be more suitable). Anyway - give me some feedback and lets see if we can get you a little further.

my bash is 4.4.12
working directory had been set correctly
I removed the double [[ leaving a simple [ same with ]] closing brackets
it says Illegal option -t in line 238
this is line 238: read -r -p "6/7. Initialise environment for Build <Y/n>? (automatically continues unprompted after 10 seconds): " -t 10 -e -i Y PROMPT
it also says [: Y: unexpected operator on line 243
this is line 243: if [ ! $PROMPT =~ ^[Yy]$ ]; then

Timte to time I was getting errors while fetching
TLS errors
I found it is due gnutls package and applied the following solution:
compile git with openssl. To do this, run the following commands:
sudo apt-get update
sudo apt-get install build-essential fakeroot dpkg-dev libcurl4-openssl-dev
sudo apt-get build-dep git
mkdir ~/git-openssl
cd ~/git-openssl
apt-get source git
dpkg-source -x git_1.7.9.5-1.dsc
cd git-1.7.9.5
(Remember to replace 1.7.9.5 with the actual version of git in your system.)
Then, edit debian/control file (run the command: gksu gedit debian/control) and replace all instances of libcurl4-gnutls-dev with libcurl4-openssl-dev.
Then build the package (if it's failing on test, you can remove the line TEST=test from the file debian/rules):
sudo dpkg-buildpackage -rfakeroot -b
Install new package:
x86_64: sudo dpkg -i ../git_1.7.9.5-1_amd64.deb
Click to expand...
Click to collapse
I'm using git-openssl build now
Just started the fetching process again
I'm under virtual machine on a host with a proper firewall configuration -- maybe that caused the connection problems while fetching

ko_taka said:
my bash is 4.4.12
working directory had been set correctly
I removed the double [[ leaving a simple [ same with ]] closing brackets
it says Illegal option -t in line 238
this is line 238: read -r -p "6/7. Initialise environment for Build <Y/n>? (automatically continues unprompted after 10 seconds): " -t 10 -e -i Y PROMPT
it also says [: Y: unexpected operator on line 243
this is line 243: if [ ! $PROMPT =~ ^[Yy]$ ]; then
Click to expand...
Click to collapse
Sounds like we're making progress. This is good. So, reading around the subject of square brackets vs double. It transpires converting the evaluations from double square brackets ([[..]]) to singles ([..]) may** change how variables are referenced. In my script I was forced to use double square brackets to correctly evaluate the response from the "read -r....." (read input) command (where it evaluates when upper or lower case Y is entered). If this command is changed from double square brackets to single ones the command then fails (on my setup). Further to this, in your reply it appears you're also having issues with the "read" command, for some reason your version doesn't support the -t directive (which waits for N seconds - ie: -t 5 will wait 5 seconds for user input).
For now the easiest thing to do is to remove *all* of the steps in the script that awaits input from the user to continue processing the script (they are non essential vanity items primarily used while I was building out the script). There are 7 is these in the script (look for "1/7", "2/7", "3/7", etc etc), just comment out (insert # at beginning of each line) for all 7 instances. There are ~10 lines per instance, examples of how instance #1 and #7 should look after editing is below. Just do the same for all 7 instances in your script and re run the script.
Code:
...
...
#PROMPT=""
#read -r -p "1/7. Initialise/Reinitialise Repo, first 'repo init' will take hours <Y/n>? (automatically continues unpromted after 5 seconds): " -t 5 -e -i Y PROMPT
#echo
#if [ -z "$PROMPT" ]; then
# PROMPT="Y"
#fi
#if [[ ! $PROMPT =~ ^[Yy]$ ]]; then
# echo "Response: '$PROMPT', exiting!"
# exit 1
#fi
...
...
#PROMPT=""
#read -r -p "7/7. Build rom (this segment can take hours) <Y/n>? (automatically continues unprompted after 10 seconds): " -t 10 -e -i Y PROMPT
#echo
#if [ -z "$PROMPT" ]; then
# PROMPT="Y"
#fi
#if [[ ! $PROMPT =~ ^[Yy]$ ]]; then
# echo "Response: '$PROMPT', exiting!"
# exit 1
#fi
...
I'd be really interested in knowing what OS you're using (Ubuntu, Mac, etc along with version) perhaps I can use this detail to come up with a more generic version of the script.
Good luck, let me know how you get on.

ko_taka said:
Timte to time I was getting errors while fetching
TLS errors
I found it is due gnutls package and applied the following solution:
I'm using git-openssl build now
Just started the fetching process again
I'm under virtual machine on a host with a proper firewall configuration -- maybe that caused the connection problems while fetching
Click to expand...
Click to collapse
I'd also try changing the value of the variable: REPO_SYNC_THREADS in the script to something lower (more suitable to your internet bandwidth / performance), try 2 or 4 and build up from there. ie: REPO_SYNC_THREADS=2

I think the problem was on GIT .. confusing I think so
I would be waiting a message like (file doesnt exist or something like that)
anyway I still with compiling errors but now is quite different
I am using virtualbox (Xubuntu 17.10) on Mac OS 10.13.2 Mac Mini 2014 entry level
applying packages_services_Telephony to packages/services/Telephony
./apply.sh: line 24: cd: /home/ferran/android/slimrom7/packages/services/Telephony: No such file or directory
6/7. Initialise environment for Build <Y/n>? (automatically continues unprompted after 10 seconds): Y
prepare device specific code...
including device/generic/mini-emulator-arm64/vendorsetup.sh
including device/generic/mini-emulator-armv7-a-neon/vendorsetup.sh
including device/generic/mini-emulator-mips64/vendorsetup.sh
including device/generic/mini-emulator-mips/vendorsetup.sh
including device/generic/mini-emulator-x86_64/vendorsetup.sh
including device/generic/mini-emulator-x86/vendorsetup.sh
including device/samsung/kminilte/vendorsetup.sh
build/envsetup.sh: line 1716: vendor/slim/build/envsetup.sh: No such file or directory
build/core/product_config.mk:250: *** _nic.PRODUCTS.[[device/samsung/kminilte/slim.mk]]: "vendor/slim/config/common_full_phone.mk" does not exist. Stop.
build/envsetup.sh: line 624: vendor/slim/build/tools/roomservice.py: No such file or directory
build/core/product_config.mk:250: *** _nic.PRODUCTS.[[device/samsung/kminilte/slim.mk]]: "vendor/slim/config/common_full_phone.mk" does not exist. Stop.
cat: /home/ferran/android/slimrom7/vendor/slim/build/envsetup.sh: No such file or directory
cat: /home/ferran/android/slimrom7/vendor/slim/build/envsetup.sh: No such file or directory
build/core/product_config.mk:250: *** _nic.PRODUCTS.[[device/samsung/kminilte/slim.mk]]: "vendor/slim/config/common_full_phone.mk" does not exist. Stop.
** Don't have a product spec for: 'slim_kminilte'
** Do you have the right repo manifest?
running croot...
mka clean/clobber needed...
./build_slimrom7_kminilte.sh: line 257: mka: command not found
7/7. Build rom (this segment can take hours) <Y/n>? (automatically continues unprompted after 10 seconds): Y
running mka bacon...
./build_slimrom7_kminilte.sh: line 273: mka: command not found
Click to expand...
Click to collapse

ko_taka said:
I think the problem was on GIT .. confusing I think so
I would be waiting a message like (file doesnt exist or something like that)
anyway I still with compiling errors but now is quite different
I am using virtualbox (Xubuntu 17.10) on Mac OS 10.13.2 Mac Mini 2014 entry level
Click to expand...
Click to collapse
Thanks for the feedback. At first glance it looks to me like your issue is less to do with the script and more to do with not having all the source locally. Seeing commands such as running ./apply.sh (puled down with the source) error reporting "file not found" is the smoking gun.
Right now I'd be tempted to say ensure you've successfully pulled the primary SlimRom7 source locally. It may be easier to do this outside of the script by running the following:
Code:
$ cd /home/ferran/android/slimrom7/
$ repo forall -vc "git reset --hard" --quiet
$ repo sync --jobs="2"
Keep an eye out of timeouts / 404 while it's syncing the repo's (the third of the three commands above). If you get errors just keep rerunning the "repo sync" command given above while in the correct directory until it completes without error. Once you have that done successfully, change the the build_scripts directory and re-run the script. If you see timeouts / 404 in the script output then you might have to manually run the "git clone" commands to see which one is causing the issue(s).

why does need that much space?
I was executing
$ repo forall -vc "git reset --hard" --quiet
$ repo sync --jobs="2"
Click to expand...
Click to collapse
I am getting the message "out of space"
80GB full of source code and even need more space??

ko_taka said:
why does need that much space?
I was executing
I am getting the message "out of space"
80GB full of source code and even need more space??
Click to expand...
Click to collapse
Use a disk usage analysis tool to find out whether earlier failed attempts pulled source down to multiple locations (when the script was failing).. I mentioned in an earlier post the size of the repo, look back 5 or 6 posts. Don't forget the bulk of the source will be contained in a hidden folder named /.repo/ check this folder doesn't exist outside of the build folder (/slimrom7/)...looking at earlier attempts I'd fist check your /build_scripts/ folder for the hidden .repo folder and if there delete it. Good luck

Related

[Q] Help Compiling the source

Trying to compile the source for the archos gen 8s. If I can compile it, I might be able to add in root support, but I have hit a snag. When I compile I get this:
Code:
make[4]: Leaving directory `/home/jonathan/Downloads/Archos/gen8-gpl-froyo/buildroot/build_arm/glib-2.16.5/gthread'
make[3]: Leaving directory `/home/jonathan/Downloads/Archos/gen8-gpl-froyo/buildroot/build_arm/glib-2.16.5/gthread'
Making install in gobject
make[3]: Entering directory `/home/jonathan/Downloads/Archos/gen8-gpl-froyo/buildroot/build_arm/glib-2.16.5/gobject'
/usr/bin/make glib-genmarshal
make[4]: Entering directory `/home/jonathan/Downloads/Archos/gen8-gpl-froyo/buildroot/build_arm/glib-2.16.5/gobject'
make[4]: `glib-genmarshal' is up to date.
make[4]: Leaving directory `/home/jonathan/Downloads/Archos/gen8-gpl-froyo/buildroot/build_arm/glib-2.16.5/gobject'
echo "#ifndef __G_MARSHAL_H__" > xgen-gmh \
&& echo "#define __G_MARSHAL_H__" >> xgen-gmh \
&& --nostdinc --prefix=g_cclosure_marshal ./gmarshal.list --header >> xgen-gmh \
&& echo "#endif /* __G_MARSHAL_H__ */" >> xgen-gmh \
&& (cmp -s xgen-gmh gmarshal.h 2>/dev/null || cp xgen-gmh gmarshal.h) \
&& rm -f xgen-gmh xgen-gmh~ \
&& echo timestamp > stamp-gmarshal.h
[COLOR="Red"]/bin/bash: line 2: --nostdinc: command not found[/COLOR]
make[3]: *** [stamp-gmarshal.h] Error 127
make[3]: Leaving directory `/home/jonathan/Downloads/Archos/gen8-gpl-froyo/buildroot/build_arm/glib-2.16.5/gobject'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/home/jonathan/Downloads/Archos/gen8-gpl-froyo/buildroot/build_arm/glib-2.16.5'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/home/jonathan/Downloads/Archos/gen8-gpl-froyo/buildroot/build_arm/glib-2.16.5'
make: *** [/home/jonathan/Downloads/Archos/gen8-gpl-froyo/buildroot/build_arm/staging_dir/lib/libglib-2.0.a] Error 2
I googled around and was unable to figure out what is going on there. --nostdinc should be a command for GCC, but doesn't seem to be working correctly. When I run gcc -v I get:
Code:
Using built-in specs.
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.4.4-14ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5)
PS If you do get it compiled I found where you can override user for certain applications: /buildroot/package/dbus/archos.conf
It looks like this:
Code:
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<!-- ../system.conf have denied everything, so we just punch some holes -->
<policy user="root">
<allow own="com.archos.emaild"/>
</policy>
<!-- Add your service name
<policy user="root">
<allow own="com.archos.Service"/>
</policy>
-->
</busconfig>
the whole build process seems to be buggy as hell
# make menuconfig
results in
Code:
package/Config.in:443: can't open file "package/apdf/Config.in"
# make clean
results in
Code:
/data/temp/archos/gen8-gpl-froyo/buildroot/project_build_arm/uclibc/root/usr/share/info/dir: could not read (No such file or directory) and could not create (No such file or directory)
make[2]: *** [uninstall-info-am] Error 1
make[2]: Leaving directory `/data/temp/archos/gen8-gpl-froyo/buildroot/build_arm/diffutils-2.8.7/doc'
make[1]: *** [uninstall-recursive] Error 1
make[1]: Leaving directory `/data/temp/archos/gen8-gpl-froyo/buildroot/build_arm/diffutils-2.8.7'
make: *** [diffutils-clean] Error 2
How long did yours compile for? Mine compiled for over an hour before failing.
I'll start all over again and measure it.
Code:
/data/temp/archos/gen8-gpl-froyo/buildroot/build_arm/staging_dir/usr/bin/arm-linux-uclibcgnueabi-gcc -shared .libs/libgphoto2_la-gphoto2-abilities-list.o .libs/libgphoto2_la-ahd_bayer.o .libs/libgphoto2_la-bayer.o .libs/libgphoto2_la-gphoto2-camera.o .libs/libgphoto2_la-gphoto2-context.o .libs/libgphoto2_la-exif.o .libs/libgphoto2_la-gphoto2-file.o .libs/libgphoto2_la-gphoto2-filesys.o .libs/libgphoto2_la-gamma.o .libs/libgphoto2_la-jpeg.o .libs/libgphoto2_la-gphoto2-list.o .libs/libgphoto2_la-gphoto2-result.o .libs/libgphoto2_la-gphoto2-version.o .libs/libgphoto2_la-gphoto2-setting.o .libs/libgphoto2_la-gphoto2-widget.o -Wl,--rpath -Wl,/data/temp/archos/gen8-gpl-froyo/buildroot/project_build_arm/uclibc/root/usr/lib -L/data/temp/archos/gen8-gpl-froyo/buildroot/build_arm/staging_dir/lib -L/data/temp/archos/gen8-gpl-froyo/buildroot/build_arm/staging_dir/usr/lib -L/usr/lib -lgphoto2_port -L/data/temp/archos/gen8-gpl-froyo/buildroot/project_build_arm/uclibc/root/usr/lib -L/data/temp/archos/gen8-gpl-froyo/buildroot/build_arm/staging_dir/data/temp/archos/gen8-gpl-froyo/buildroot/project_build_arm/uclibc/root/usr/lib -lltdl -lm -isysroot /data/temp/archos/gen8-gpl-froyo/buildroot/build_arm/staging_dir -mtune=cortex-a8 -isysroot /data/temp/archos/gen8-gpl-froyo/buildroot/build_arm/staging_dir -mtune=cortex-a8 -Wl,-soname -Wl,libgphoto2.so.2 -Wl,-version-script -Wl,.libs/libgphoto2.ver -o .libs/libgphoto2.so.2.4.0
/usr/lib/libltdl.so: file not recognized: File format not recognized
collect2: ld returned 1 exit status
libtool: install: error: relink `libgphoto2.la' with the above command before installing it
make[3]: *** [install-libLTLIBRARIES] Error 1
make[3]: Leaving directory `/data/temp/archos/gen8-gpl-froyo/buildroot/build_arm/libgphoto2-2.4.9.1/libgphoto2'
make[2]: *** [install-am] Error 2
make[2]: Leaving directory `/data/temp/archos/gen8-gpl-froyo/buildroot/build_arm/libgphoto2-2.4.9.1/libgphoto2'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/data/temp/archos/gen8-gpl-froyo/buildroot/build_arm/libgphoto2-2.4.9.1'
make: *** [/data/temp/archos/gen8-gpl-froyo/buildroot/build_arm/staging_dir/usr/lib/libgphoto2.so] Error 2
real 38m3.275s
user 50m36.129s
sys 6m27.836s
I don't know why it's referring to /usr/lib/libltdl.so because this would be a 64bit lib of my linux machine. bug?
You two realise that you can't just use a PC version of gcc to compile an arm version of sw?
You need the crosscompile toolchain to do this, and than its working correctly.
the toolchain is inside the xxx.tgz archive and it is used for building. no need for extra toolchain
But laptopfeak is using something that does:
Target: i686-linux-gnu
wrong. he just typed gcc -v in his shell. this uses of course his very own gcc and not the one served by the archos toolchain.
when I type gcc -v using the archos toolchain it looks like this:
# gen8-gpl-froyo/buildroot/build_arm/staging_dir/usr/bin/arm-linux-gcc -v
Using built-in specs.
Target: arm-linux-uclibcgnueabi
Configured with: /data/temp/archos/gen8-gpl-froyo/buildroot/toolchain_build_arm/gcc-4.4.1/configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=arm-linux-uclibcgnueabi --enable-languages=c,c++ --with-sysroot=/data/temp/archos/gen8-gpl-froyo/buildroot/build_arm/staging_dir --with-build-time-tools=/data/temp/archos/gen8-gpl-froyo/buildroot/build_arm/staging_dir/usr/arm-linux-uclibcgnueabi/bin --disable-__cxa_atexit --enable-target-optspace --with-gnu-ld --enable-shared --with-gmp=/data/temp/archos/gen8-gpl-froyo/buildroot/toolchain_build_arm/gmp --with-mpfr=/data/temp/archos/gen8-gpl-froyo/buildroot/toolchain_build_arm/mpfr --disable-nls --enable-threads --disable-multilib --with-tune=cortex-a8 --with-cpu=cortex-a8 --with-arch=armv7-a --with-fpu=vfp3 --with-float=softfp
Thread model: posix
gcc version 4.4.1 (GCC)
Click to expand...
Click to collapse
the toolchain builds the crosscompiler itself and then starts crosscompiling
I did find out why I was getting one of the errors. I was missing some dependencies. Found a quick tutorial on how to compile the kernel for the gen7. http://archos.g3nius.org/index.php?title=Compiling_gen7-gpl
Now I am getting an error about the .config file being out of date. Odd thing is that the make menuconfig does not work... as previously mentioned.
Code:
PATH="/home/jonathan/Downloads/Archos/gen8-gpl-froyo/buildroot/toolchain_build_arm/bin:/home/jonathan/Downloads/Archos/gen8-gpl-froyo/buildroot/build_arm/staging_dir/bin:/home/jonathan/Downloads/Archos/gen8-gpl-froyo/buildroot/build_arm/staging_dir/usr/bin:/home/jonathan/Downloads/Archos/gen8-gpl-froyo/buildroot/build_arm/staging_dir/usr/bin/:/home/jonathan/Downloads/Archos/gen8-gpl-froyo/buildroot/build_arm/staging_dir/usr/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin" \
./Configure linux-arm --prefix=/ \
--openssldir=/lib/ssl -L/home/jonathan/Downloads/Archos/gen8-gpl-froyo/buildroot/build_arm/staging_dir/lib -ldl \
-I/home/jonathan/Downloads/Archos/gen8-gpl-froyo/buildroot/build_arm/staging_dir/usr/include threads \
shared no-idea no-mdc2 no-rc5)
Configuring for linux-arm
IsWindows=0
CC =gcc
CFLAG =-fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DOPENSSL_NO_KRB5 -I/home/jonathan/Downloads/Archos/gen8-gpl-froyo/buildroot/build_arm/staging_dir/usr/include -DOPENSSL_NO_IDEA -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5 -DL_ENDIAN -DTERMIO -fomit-frame-pointer -Wall
EX_LIBS =-L/home/jonathan/Downloads/Archos/gen8-gpl-froyo/buildroot/build_arm/staging_dir/lib -ldl -ldl
BN_ASM =bn_asm.o
DES_ENC =des_enc.o fcrypt_b.o
BF_ENC =bf_enc.o
CAST_ENC =c_enc.o
RC4_ENC =rc4_enc.o
RC5_ENC =rc5_enc.o
MD5_OBJ_ASM =
SHA1_OBJ_ASM =
RMD160_OBJ_ASM=
PROCESSOR =
RANLIB =/usr/bin/ranlib
ARFLAGS =
PERL =/usr/bin/perl
THIRTY_TWO_BIT mode
DES_RISC1 used
BN_LLONG mode
RC4_CHUNK is undefined
make[1]: Entering directory `/home/jonathan/Downloads/Archos/gen8-gpl-froyo/buildroot/build_arm/openssl-0.9.7m'
Makefile is older than Makefile.org.
Reconfigure the source tree (via './config' or 'perl Configure'), please.
make[1]: *** [Makefile] Error 1
make[1]: Leaving directory `/home/jonathan/Downloads/Archos/gen8-gpl-froyo/buildroot/build_arm/openssl-0.9.7m'
/usr/bin/make MAKE="/usr/bin/make -j1" CC=/home/jonathan/Downloads/Archos/gen8-gpl-froyo/buildroot/build_arm/staging_dir/usr/bin/arm-linux-uclibcgnueabi-gcc -C /home/jonathan/Downloads/Archos/gen8-gpl-froyo/buildroot/build_arm/openssl-0.9.7m all build-shared
make[1]: Entering directory `/home/jonathan/Downloads/Archos/gen8-gpl-froyo/buildroot/build_arm/openssl-0.9.7m'
Makefile is older than Makefile.org.
Reconfigure the source tree (via './config' or 'perl Configure'), please.
make[1]: *** [Makefile] Error 1
make[1]: Leaving directory `/home/jonathan/Downloads/Archos/gen8-gpl-froyo/buildroot/build_arm/openssl-0.9.7m'
make: *** [/home/jonathan/Downloads/Archos/gen8-gpl-froyo/buildroot/build_arm/openssl-0.9.7m/apps/openssl] Error 2
[email protected]:~/Downloads/Archos/gen8-gpl-froyo/buildroot$ make menuconfig
make CC="/usr/bin/gcc" -C package/config conf mconf
make[1]: Entering directory `/home/jonathan/Downloads/Archos/gen8-gpl-froyo/buildroot/package/config'
/usr/bin/gcc -DCURSES_LOC="<ncurses.h>" -DLOCALE -g -O2 -c conf.c -o conf.o
conf.c: In function ‘conf_askvalue’:
conf.c:104: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
conf.c: In function ‘conf_choice’:
conf.c:362: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
/usr/bin/gcc -DCURSES_LOC="<ncurses.h>" -DLOCALE -g -O2 -c kxgettext.c -o kxgettext.o
/usr/bin/gcc -DCURSES_LOC="<ncurses.h>" -DLOCALE -g -O2 -c lxdialog/checklist.c -o lxdialog/checklist.o
/usr/bin/gcc -DCURSES_LOC="<ncurses.h>" -DLOCALE -g -O2 -c lxdialog/inputbox.c -o lxdialog/inputbox.o
/usr/bin/gcc -DCURSES_LOC="<ncurses.h>" -DLOCALE -g -O2 -c lxdialog/menubox.c -o lxdialog/menubox.o
/usr/bin/gcc -DCURSES_LOC="<ncurses.h>" -DLOCALE -g -O2 -c lxdialog/textbox.c -o lxdialog/textbox.o
/usr/bin/gcc -DCURSES_LOC="<ncurses.h>" -DLOCALE -g -O2 -c lxdialog/util.c -o lxdialog/util.o
/usr/bin/gcc -DCURSES_LOC="<ncurses.h>" -DLOCALE -g -O2 -c lxdialog/yesno.c -o lxdialog/yesno.o
make[1]: *** No rule to make target `/usr/include/ncurses/ncurses.h', needed by `mconf.o'. Stop.
make[1]: Leaving directory `/home/jonathan/Downloads/Archos/gen8-gpl-froyo/buildroot/package/config'
make: *** [package/config/mconf] Error 2
Oh and this does seem to be the buggiest source/compile I have ever dealt with. But I did talk to someone on xchat last night and they said that they got it to compile out of box.
I installed a fresh ubuntu 10.10 into a virtual machine and installed the packages mentioned on this website: http://archos.g3nius.org/index.php?title=Compiling_gen7-gpl
currently building.. stay tuned..
edit: still buggy
Finally got it to compile thanks to jensbln:
According to him you have to: "disable gdb in /buildroot/local/g8_arm/g8_arm.config"
So I poked around in the g8_arm.config and found the gdb. I then set all instances of gdb to n instead of y. I then had to sudo make, because I was getting permission demied. After that it compiled fine.
Let's see if this works for me too...
edit: failed on the x64 machine.. not that surprisingly as others had problems too. testing on x32..
damn, its not working (failed because of missing symlinks to libmpfr.so.1)..
edit: ahh.. it seems that i missed this dependency: libmpfr1ldbl
edit2: yes, this was the missing dependency.
using a fresh ubuntu 10.10 x32, to compile the froyo gpl sources install these packages:
Code:
# apt-get install flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl automake autoconf libtool gettext texinfo libmpfr1ldbl
edit3: make menuconfig does work too
Code:
# cd gen8-gpl-froyo/linux
# cp linux.config .config
# make oldconfig
# make menuconfig
chulri said:
the whole build process seems to be buggy as hell
# make menuconfig
results in
Code:
package/Config.in:443: can't open file "package/apdf/Config.in"
# make clean
results in
Code:
/data/temp/archos/gen8-gpl-froyo/buildroot/project_build_arm/uclibc/root/usr/share/info/dir: could not read (No such file or directory) and could not create (No such file or directory)
make[2]: *** [uninstall-info-am] Error 1
make[2]: Leaving directory `/data/temp/archos/gen8-gpl-froyo/buildroot/build_arm/diffutils-2.8.7/doc'
make[1]: *** [uninstall-recursive] Error 1
make[1]: Leaving directory `/data/temp/archos/gen8-gpl-froyo/buildroot/build_arm/diffutils-2.8.7'
make: *** [diffutils-clean] Error 2
Click to expand...
Click to collapse
you are not supposed to use "make menuconfig"
just type "make" in the buildroot folder and it will build the kernel and buildroot packages that are in gen8 units...
@_nz_ you're late, see my last post.
btw: yes I'm supposed to use make menuconfig when I want to change kernel settings without changing the kernel config file manually
chulri said:
@_nz_ you're late, see my last post.
btw: yes I'm supposed to use make menuconfig when I want to change kernel settings without changing the kernel config file manually
Click to expand...
Click to collapse
sure. I was referring more to make menuconfig in buildroot which is not used during our SW development, so it's not really "supported" and might be broken. All our configs are hardcoded
it's not used inside buildroot, I use it inside linux
btw: do you work at archos?
chulri said:
it's not used inside buildroot, I use it inside linux
btw: do you work at archos?
Click to expand...
Click to collapse
Assuming it is the same nz that posts at archosfans then yes he/she is an Archos employee.
blazingwolf said:
Assuming it is the same nz that posts at archosfans then yes he/she is an Archos employee.
Click to expand...
Click to collapse
yes, we are
Hey -nz- I posted this on the Archos Fans forum in response to an answer to my question; why can't we reflash to 2.1. You probably didn't see it......what do you say?
Thanks for the reply about the bootloader. Again ignorance on my part. Surely Archos could release a patch that would allow the bootloader to install any version of the OS? I mean its all just code going into a certain memory address. I have a hard time with companies like Archos who seem to make things difficult for owners. I can see Apple doing it because they really are the 800 pound gorilla in the corner but the Dev Team and smart guys have always found a way round what they do. Archos are a relatively small fish in the pond. The tablet scene is moving very fast and new tablets are coming out every day.
It reminds me of the Pandigital novel. We pleaded with Pandigital to give us the source code. They said they would but never did. The smart guys were able to do wonders with what they had but ultimately within 3 months people had given up and moved on. Once the smart guys were gone all development stopped and now the PDN is just a mostly forgotten memory. If Pandigital had of opened up, the word of mouth would have spread, people would have bought their reader, hacked it and they would have both sold more and got the hearts and minds (and money) of people who would have considered any product they brought out. Now they are pretty much dead in the water and will likely just stay selling photo frames. People and technology has passed them by.
I won't say the same will happen to Archos. They are a bigger fish but they seem to have generated a lot of ill will over the 2.2 release. Even all those who were trumpeting how wonderful 2.2 was going to be have slunk away. Apple will bring out a new iPad next year. The price of the present one is dropping and will continue to do so. Say what you like about the iPad, but it works and it works well. It's too big and I'll probably sell mine again in a month or so depending on what comes out next in the 7 to 8 inch form factor.
Archos have the opportunity to buck the trend and open their software up and let people make it fly. There are some really sharp, switched on guys out there and if given the encouragement and support by Archos, they could do wonders. How cool would it be for Archos to be known as the one company that actually helped and supported its customers. The hardware is all there, the software is lacking but it is easier to make something better if it is only the software that is holding back the hardware.
So come on Mr Archos, if you are reading this, do some deep thinking. Be the tablet company of the people. Lets see some liberté, égalité, fraternité.

[GUIDE] Compile the stock android kernel

I have already discussed how to unpack/repack the boot.img file.
Now let's try to recompile the android kernel.
You will need some packages not included in a default Ubuntu 11.04 installation:
Code:
sudo apt-get install git unrar libncurses5-dev qt3-dev-tools
Unrar and git are the only necessary packages.
Install libncurses if you want to modify the kernel configuration with the command line menu.
Otherwise, if you want a graphical interface, go with qt3.
Please refer to the documentation of your linux distro for help on how to install additional packages.
For the purpose of this guide we are going to rebuild the official asus kernel with no modifications.
Download the latest kernel source from the ASUS site (atm 2.6.36.3)
Code:
wget http://dlcdnet.asus.com/pub/ASUS/EeePAD/TF101/Eee_PAD_TF101_Kernel_Code_8_4_4_11.rar
Now unpack it:
Code:
unrar e Eee_PAD_TF101_Kernel_Code_8_4_4_11.rar
tar xvfz kernel-3eb19ec-fix-lic.tar.gz
We need a config file for the compile process.
The config file essentially sets features ON or OFF from the final kernel (yes, I know that is much more than this...).
If your tablet is upgraded to the latest build (8.4.4.11) you can extract the config file from your running device:
Code:
adb pull /proc/config.gz ./
Or you can find it attached to this post (the forum won't allow to upload a .gz file, so i made a .zip file; use unzip instead of gunzip).
Now uncompress and move it into the kernel dir (renaming it in .config).
Code:
gunzip config.gz
cp config kernel-3eb19ec/.config
Now the not-so-fun part.
We will need a compiler for the arm platform.
The android source comes with the arm compiler. You can download it following this instructions http://source.android.com/source/downloading.html .
The only problem is that the repository is about 2.6GB...
So we are going to download only the prebuilt toolchain (1,8GB):
Code:
git clone git://android.git.kernel.org/platform/prebuilt.git
After git finishes his download, you will have a new directory called "toolchain".
We have to set some environment variables (i assume you have downloaded the toolchain in your home directory):
Code:
export ARCH=arm
export CROSS_COMPILE=arm-eabi-
export PATH=$PATH:~/toolchain/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/
Ok, the compiler is installed and configured.
It's time to come back to the kernel source.
If you want to modify some settings in your config file (!!AT YOUR OWN RISK!!) you can edit the .config file or use a graphical interface.
Code:
cd kernel-3eb19ec
make xconfig (make menuconfig if you prefer a command-line menu)
Now we can compile the android kernel:
Code:
make -j4
Our new kernel is stored in : arch/arm/boot/zImage
We can use it for make a boot image and flash in our TF101 (use this guide http://forum.xda-developers.com/showthread.php?t=1193737)
Let me say this again: I'm not an expert in android kernel/compiler.
If you find something wrong with this guide, please tell me.
I've learned this with google and by trial and error.
If you brick something don't blame on me.
If you want to hit "thanks", you're welcome.
Have Fun!
Pulling out config.gz you will get the current kernel configuration...it could not fit the stock kernel..
gnufabio said:
Pulling out config.gz you will get the current kernel configuration...it could not fit the stock kernel..
Click to expand...
Click to collapse
Of course the kernel source has to be exactly the same version as the running kernel for this to work.
In this example, the source and running kernel were both 2.6.36.3 (build 8.4.4.11).
For use an older .config (or a newer source tree), we should run:
Code:
make oldconfig
to adapt them (...kinda).
Thanks for point this out.
I was eventually planning on making this guide, good work!
gnufabio said:
Pulling out config.gz you will get the current kernel configuration...it could not fit the stock kernel..
Click to expand...
Click to collapse
This is a possibility if anything in the config changes from the kernel you're running in the actual source Asus has posted
I've always done the following:
Code:
make tegra_defconfig
make
I haven't actually checked to see if this is up to date with a running kernel, just noticed Asus pops up a few times in there.
Actually this is the default TF101 config: tf101_defconfig
Thanks for the guides. These are really helpful -
Hashi
I'm getting this set of errors. I've built and modified many linux kernels, so I'm guessing this is in the toolchain area, and am wondering if it needs to know something else for where to look at dynamic load libraries, etc?
I created a shell script to setup / export the shell environment vars. It looks like this:
Code:
export ARCH=arm
export CROSS_COMPILE=arm-eabi-
export PATH=$PATH:~/sandbox/android-sdk-linux_x86/toolchain/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/
I'm using a PC I use for work ARM cross compiles that is 64 bit Ubuntu 9.10.
Thanks --
--- make -j4 errors ---
Code:
[email protected]:~/sandbox/android-sdk-linux_x86/kernel/kernel-3eb19ec$ make -j4
arm-eabi-gcc: /lib32/libc.so.6: version `GLIBC_2.11' not found (required by arm-eabi-gcc)
CHK include/linux/version.h
CHK include/generated/utsrelease.h
CC scripts/mod/empty.o
arm-eabi-gcc: /lib32/libc.so.6: version `GLIBC_2.11' not found (required by arm-eabi-gcc)
make[2]: *** [scripts/mod/empty.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: `include/generated/mach-types.h' is up to date.
make[1]: *** [scripts/mod] Error 2
CC kernel/bounds.s
arm-eabi-gcc: /lib32/libc.so.6: version `GLIBC_2.11' not found (required by arm-eabi-gcc)
make: *** [scripts] Error 2
make: *** Waiting for unfinished jobs....
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2
[email protected]:~/sandbox/android-sdk-linux_x86/kernel/kernel-3eb19ec$
In searching for the basic problem, that arm*gcc can't see libc.so.6 in the version it wants, I think it's not seeing this at all:
~/sandbox/android-sdk-linux_x86/kernel/kernel-3eb19ec$ find ../../toolchain/ -iname libc.so.6 -exec ls -al {} \;
lrwxrwxrwx 1 hashi hashi 11 2011-08-01 15:58 ../../toolchain/prebuilt/linux-x86/toolchain/i686-linux-glibc2.7-4.4.3/sysroot/usr/lib/libc.so.6 -> libc-2.7.so
[email protected]:~/sandbox/android-sdk-linux_x86/kernel/kernel-3eb19ec$
thanks. I'm not new to kernel compiling but I'm new to android
hachamacha said:
I'm getting this set of errors. I've built and modified many linux kernels, so I'm guessing this is in the toolchain area, and am wondering if it needs to know something else for where to look at dynamic load libraries, etc?
I created a shell script to setup / export the shell environment vars. It looks like this:
Code:
export ARCH=arm
export CROSS_COMPILE=arm-eabi-
export PATH=$PATH:~/sandbox/android-sdk-linux_x86/toolchain/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/
I'm using a PC I use for work ARM cross compiles that is 64 bit Ubuntu 9.10.
Thanks --
--- make -j4 errors ---
Code:
[email protected]:~/sandbox/android-sdk-linux_x86/kernel/kernel-3eb19ec$ make -j4
arm-eabi-gcc: /lib32/libc.so.6: version `GLIBC_2.11' not found (required by arm-eabi-gcc)
CHK include/linux/version.h
CHK include/generated/utsrelease.h
CC scripts/mod/empty.o
arm-eabi-gcc: /lib32/libc.so.6: version `GLIBC_2.11' not found (required by arm-eabi-gcc)
make[2]: *** [scripts/mod/empty.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: `include/generated/mach-types.h' is up to date.
make[1]: *** [scripts/mod] Error 2
CC kernel/bounds.s
arm-eabi-gcc: /lib32/libc.so.6: version `GLIBC_2.11' not found (required by arm-eabi-gcc)
make: *** [scripts] Error 2
make: *** Waiting for unfinished jobs....
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2
[email protected]:~/sandbox/android-sdk-linux_x86/kernel/kernel-3eb19ec$
In searching for the basic problem, that arm*gcc can't see libc.so.6 in the version it wants, I think it's not seeing this at all:
~/sandbox/android-sdk-linux_x86/kernel/kernel-3eb19ec$ find ../../toolchain/ -iname libc.so.6 -exec ls -al {} \;
lrwxrwxrwx 1 hashi hashi 11 2011-08-01 15:58 ../../toolchain/prebuilt/linux-x86/toolchain/i686-linux-glibc2.7-4.4.3/sysroot/usr/lib/libc.so.6 -> libc-2.7.so
[email protected]:~/sandbox/android-sdk-linux_x86/kernel/kernel-3eb19ec$
Click to expand...
Click to collapse
The toolchain has everything it needs for compile the kernel.
The problem seems to be your 64 bit...
The arm compiler is built against 32bit version of glibc library; I think you already have a multilib environment (you have a /lib32 dir). Maybe the 32bit verion of the glibc is not the correct version.
Try this command:
Code:
ldd ~/sandbox/android-sdk-linux_x86/toolchain/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc
And look what it says for the libc.so.6. In my system it says it is located in /lib/i386-linux-gnu/libc.so.6. So if I run it:
Code:
$ /lib/i386-linux-gnu/libc.so.6
GNU C Library (Ubuntu EGLIBC 2.13-0ubuntu13) stable release version 2.13, by Roland McGrath et al.
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.5.2.
Compiled on a Linux 2.6.38 system on 2011-04-11.
Available extensions:
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
Native POSIX Threads Library by Ulrich Drepper et al
BIND-8.2.3-T5B
libc ABIs: UNIQUE IFUNC
For bug reporting instructions, please see:
<http://www.debian.org/Bugs/>.
The first line tell the version number. If it's older than 2.11 you need to update your multilib libc.
gnufabio said:
Actually this is the default TF101 config: tf101_defconfig
Click to expand...
Click to collapse
This is for 2.6.36.3 but seems way older. It says "Fri Mar 25 19:50:17 2011".
Maybe it's from an old build?
The last ASUS config (the one attached to the first post) is "Mon Jul 11 14:47:43 2011".
Brilliant!
I had problems cloning using the git protocol because of a corporate firewall, but the HTTP method worked fine:
Code:
http://android.git.kernel.org/platform/prebuilt.git
I also found the the toolchain with the Android NDK failed to build the kernel but the one linked to in the OP worked perfectly.
SammyC said:
I also found the the toolchain with the Android NDK failed to build the kernel but the one linked to in the OP worked perfectly.
Click to expand...
Click to collapse
Yes, I have tried this also, with the same result.
Someone said that the codesourcery compiler can compile the android kernel.
I have tried, it compiles all, but when i flash on the tablet it stucks on the boot screen.
Initially I wrote the guide using this compiler (it's smaller and has a graphical installer), when i realized that it doesn't work , i switched back to the android official compiler.
If someone want to try with the codesourcery compiler here's the (unsuccessful) process I have used:
!!ATTENTION!!: ATM THIS DOESN'T WORK
An easier (and somewhat faster) way is downloading the Code Sorcery's "Code Bench" compiler (http://www.codesourcery.com/) and install it.
Code:
wget http://www.codesourcery.com/sgpp/lite/arm/portal/package8741/public/arm-none-linux-gnueabi/arm-2011.03-41-arm-none-linux-gnueabi.bin
This compiler need some extra packages to work in Ubuntu:
Code:
sudo apt-get install git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind
For some reason, in Ubuntu 11.04 the /bin/sh link refer to the dash shell and not bash.
The compiler's installer will comply for this, so we do as follows:
Code:
sudo dpkg-reconfigure -plow dash
and when it asks to use dash as the default shell, click on "NO"
Code:
sh arm-2011.03-41-arm-none-linux-gnueabi.bin
Leave all the default options. The installer will copy the files in your home directory.
We should set some environmet variables:
Code:
export ARCH=arm
export CROSS_COMPILE=arm-none-linux-gnueabi-
export PATH=$PATH:~/CodeSourcery/Sourcery_G++_Lite/bin
Click to expand...
Click to collapse
Then continue with the guide from the "make xconfig".
If someone can make it work with this compiler, could be so gentle to tell us how?
rebound821 said:
The toolchain has everything it needs for compile the kernel.
The problem seems to be your 64 bit...
The arm compiler is built against 32bit version of glibc library; I think you already have a multilib environment (you have a /lib32 dir). Maybe the 32bit verion of the glibc is not the correct version.
Try this command:
Code:
ldd ~/sandbox/android-sdk-linux_x86/toolchain/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc
And look what it says for the libc.so.6. In my system it says it is located in /lib/i386-linux-gnu/libc.so.6. So if I run it:
Code:
$ /lib/i386-linux-gnu/libc.so.6
GNU C Library (Ubuntu EGLIBC 2.13-0ubuntu13) stable release version 2.13, by Roland McGrath et al.
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.5.2.
Compiled on a Linux 2.6.38 system on 2011-04-11.
Available extensions:
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
Native POSIX Threads Library by Ulrich Drepper et al
BIND-8.2.3-T5B
libc ABIs: UNIQUE IFUNC
For bug reporting instructions, please see:
<http://www.debian.org/Bugs/>.
The first line tell the version number. If it's older than 2.11 you need to update your multilib libc.
Click to expand...
Click to collapse
Thanks again -- I'll try that out as soon as I'm back in TF mode.
Code:
~/sandbox/android-sdk-linux_x86/toolchain/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: /lib32/libc.so.6: version `GLIBC_2.11' not found (required by ~/sandbox/android-sdk-linux_x86/toolchain/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)
linux-gate.so.1 => (0xf77e0000)
libc.so.6 => /lib32/libc.so.6 (0xf7677000)
/lib/ld-linux.so.2 (0xf77e1000)
^^ that was from the first command
Code:
GNU C Library (EGLIBC) stable release version 2.10.1, by Roland McGrath et al.
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.4.1.
Compiled on a Linux >>2.6.24-27-server<< system on 2011-01-11.
Available extensions:
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
Native POSIX Threads Library by Ulrich Drepper et al
BIND-8.2.3-T5B
For bug reporting instructions, please see:
<http://www.eglibc.org/issues/>.
And ^^ from the second.
It looks like with 9.10 Ubuntu, (backporting something from 10 or 11.x notwithstanding), I can't easily get to GLIBC 2.11 from GLIBC 2.10.x. Thanks. I'll put together an 11.x VM for this task.
For 64bit machines, you might need to do the following?
apt-get install ia32-libs
raypou said:
For 64bit machines, you might need to do the following?
apt-get install ia32-libs
Click to expand...
Click to collapse
Thanks, I managed to download a ARM toolchain from their site that works fine with Ubuntu 9.10 64 bit.
Whether or not it'll run when I try to install a kernel is another question, but it builds without problem and produces ARM code.
rebound821 said:
Yes, I have tried this also, with the same result.
Someone said that the codesourcery compiler can compile the android kernel.
I have tried, it compiles all, but when i flash on the tablet it stucks on the boot screen.
Initially I wrote the guide using this compiler (it's smaller and has a graphical installer), when i realized that it doesn't work , i switched back to the android official compiler.
If someone want to try with the codesourcery compiler here's the (unsuccessful) process I have used:
!!ATTENTION!!: ATM THIS DOESN'T WORK
Then continue with the guide from the "make xconfig".
If someone can make it work with this compiler, could be so gentle to tell us how?
Click to expand...
Click to collapse
Wow can't believe I found this thread. I just want to confirm that I'm also having a horrible time with the code sourcery toolchain trying to compile the android kernel, the moto atrix kernel specifically. The zimage compiles, but flashing to the device it just hangs.
So im currently downloading the official android toolchain.
Also some learned knowledge for everybody, the correct code sourcery toolchain supposedly android equivalent is arm-none-linux-gnueabi-, NOT the arm-none-eabi- or any of the others. This info is very hard to find fyi.
However as this thread seems to prove, even using the correct one doesn't exactly work.
Hi,
I'm trying to build the stock Memo Pad smart(ME301t) stock kernel 10.6.1.29 downloaded directly from asus.
I used 4.3.3 to 4.7 toolchains with similar results(give or take some deprecated compiler arguments).
What I really want to know is why I'm getting a lot of warnings(NOT ERRORS), some of them are minor errors like "unused function" and some of them are major warnings breaking function functionality. Some of the builds don't even boot.
What toolchain should I use with this kernel?
Why a stock kernel(from asus) should produce warnings at the first place?
I'm on linux BTW.

[GUIDE] Building CyanogenMod 9 from Source with openSuSE 12.1

Introduction
If you have tried to build Android on systems other than Ubuntu (or Ubuntu based systems) you may have noticed, that there are pretty much no guides for other systems.
I finally set up my openSuSE to build CM9 successfully, and would like to share the process with you.
I will also try to adopt this guide for CM10 if i find the time.
If you find mistakes feel free to post them here or PM me.
Contents
Requirements
About this guide
Install "Oracle JDK"
Install other needed packages
Install "make 3.81"
Install "Android SDK"
Set up source directories
Set up "repo"
Set up repositories
Update source code
Update device specific source code
Copy proprietary files
Download prebuilts
Build CyanogenMod 9
Done!
Possible build errors on openSuSE
Credits
1. Requirements
openSuSE 12.1 64bit (may work on other versions too)
a good internet connection
as much RAM as possible (at least 2GB to finish a build, but that will take very, very long.)
patience
common sense
Note: I did all this in a virtual machine, but i highly recommend installing Linux on your hardware. Building Android takes a long time even on high end hardware.
2. About this guide
Lines beginning with '$' are supposed to be entered in shell (without the $ sign).
File names are bold.
This guide assumes that you set up the sources at ~/android/system/. Feel free to change that.
bacon = device name (e.g. i9300 for Samsung Galaxy SIII I9300. See CyanogenMod Homepage for other devices.)
3. Install "Oracle JDK"
Download latest jdk-6uXX-linux-x64-rpm.bin from http://www.oracle.com/technetwork/java/javase/downloads/jdk6-downloads-1637591.html
$ <downloadfolder>/jdk-6uXX-linux-x64-rpm.bin -x
Open <downloadfolder> in your file manager
Right click jdk-6uXX-linux-x64-rpm -> open with -> Install Software
YaST Software Manager will open up.
DON'T click accept yet.
Search for openJDK and check uninstall for ALL openJDK packages.
DON'T click accept yet, go to next chapter.
4. Install other needed packages
Search and install following packages with YaST
git
gnupg
flex
bison
gperf
SDL-devel
esound-devel
wxGTK-devel
zip
curl
ncurses-devel
ncurses-devel 32bit
zlib-devel
zlib-devel 32bit
gcc-c++
glibc-devel 32bit
libstdc++ 32bit
mesa libs
Now click accept.
5. Install "make 3.81"
Note: Other versions won't work.
Download source from http://ftp.gnu.org/gnu/make/make-3.81.tar.gz.
Extract downloaded file.
$ cd <extracted folder>
$ ./configure
$ make
$ make install
6. Install "Android SDK"
Note: This is pretty straightforward. I will add this section later.
7. Set up source directories
$ mkdir ~/android
$ mkdir ~/android/system
$ mkdir ~/android/cache
8. Set up "repo"
Note: "repo" is a tool by Google, created to make access to git and gerrit very, very easy.
$ mkdir ~/bin
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
Open ~/.bashrc in a file editor (e.g. kwrite)
Add the following line:
PATH=~/bin:$PATH
Save and close.
Close your shell and re-open it.
9. Set up repositories
$ cd ~/android/system
$ repo init -u git://github.com/CyanogenMod/android.git -b ics
10. Update source code
$ cd ~/android/system
$ repo sync -jX
X = number of connections. Try X = 1 if there are problems downloading.
This will take a while.
11. Update device specific source code
$ cd ~/android/system
$ . build/envsetup.sh && breakfast bacon
12. Copy proprietary files
Note: This only needs to be run once. You will need CyanogenMod 9 running on the device you are building for to complete this.
Connect the phone via USB.
Install USB drivers to get ADB access.
$ cd ~/android/system/device/<manufacturer>/<devicename>
$ ./extract-files.sh
13. Download prebuilts
$ ~/android/system/vendor/cm/get-prebuilts
14. Build CyanogenMod 9
$ ~/android/system
$ . build/envsetup.sh && brunch bacon
15. Done!
You now should have a CWM-flashable .zip file ~/android/system/out/target/product/maguro/cm-9-XXXXX-UNOFFICIAL-bacon.zip.
16. Possible build errors on openSuSE
Because Ubuntu is based on Debian and openSuSE is based on Slackware, you will probable get some build errors. In post 2 is a list of errors that can occur and how to fix them.
Credits
CyanogenMod Team
CyanogenMod Wiki
The Software Rouge (http://thesoftwarerogue.blogspot.de/2011/11/building-android-ics-ice-cream-sandwich.html)
Note: I got the fixes for build errors from some page in Google Groups. I can't find it anymore. If someone finds it, please PM me.
Possible build errors on openSuSE
Note: I used kwrite as text editor. To use another, just change kwrite to whatever editor you want to use.
Note: Open shell and got to ~/android/system
Error 1
make gets killed at some point
Fix: you need more RAM to finish the build.
Error 2
Code:
frameworks/base/include/utils/KeyedVector.h:193:31: note: declarations in dependent base ‘android::KeyedVector<android::String8, android::sp<AaptDir> >’ are not found by unqualified lookup
frameworks/base/include/utils/KeyedVector.h:193:31: note: use ‘this->indexOfKey’ instead
make: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/AaptAssets.o] Error 1
Fix:
$ kwrite frameworks/base/tools/aapt/Android.mk
Add '-fpermissive' to line 31:
LOCAL_CFLAGS += -Wno-format-y2k -fpermissive
Error 3
Code:
frameworks/base/include/utils/KeyedVector.h:193:31: error: ‘indexOfKey’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
frameworks/base/include/utils/KeyedVector.h:193:31: note: declarations in dependent base ‘android::KeyedVector<android::String8, android::wp<android::AssetManager::SharedZip> >’ are not found by unqualified lookup
frameworks/base/include/utils/KeyedVector.h:193:31: note: use ‘this->indexOfKey’ instead
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/AssetManager.o] Error 1
Fix:
$ kwrite frameworks/base/libs/utils/Android.mk
Add '-fpermissive' to line 64:
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive
Error 4
Code:
external/srec/tools/thirdparty/OpenFst/fst/lib/cache.h:136:11: note: use ‘this->SetState’ instead
make: *** [out/host/linux-x86/obj/EXECUTABLES/grxmlcompile_intermediates/grxmlcompile.o] Error 1
Fix:
$ cd external/srec
$ wget "https://github.com/CyanogenMod/android_external_srec/commit/4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff"
$ patch -p1 < 4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff
$ rm -f 4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff
$ cd ../..
Error 5
Code:
development/tools/emulator/opengl/host/tools/emugen/main.cpp:79:9: error: ‘optind’ was not declared in this scope
development/tools/emulator/opengl/host/tools/emugen/main.cpp:92:45: error: ‘optind’ was not declared in this scope
make: *** [out/host/linux-x86/obj/EXECUTABLES/emugen_intermediates/main.o] Error 1
Fix:
$ kwrite development/tools/emulator/opengl/host/tools/emugen/main.cpp
Add '#include <getopt.h>' to list of includes:
#include <getopt.h>
Error 6
Code:
host C++: liboprofile_pp <= external/oprofile/libpp/arrange_profiles.cpp
In file included from external/oprofile/libpp/arrange_profiles.cpp:24:0:
external/oprofile/libpp/format_output.h:94:22: error: reference ‘counts’ cannot be declared ‘mutable’ [-fpermissive]
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/liboprofile_pp_intermediates/arrange_profiles.o] Error 1
Fix:
$ kwrite external/oprofile/libpp/format_output.h
Remove 'mutable' from 'mutable counts_t & counts;' on line 94:
counts_t & counts;
Error 7
Code:
development/tools/emulator/opengl/shared/OpenglCodecCommon/GLSharedGroup.cpp:345:65: required from here
frameworks/base/include/utils/KeyedVector.h:193:31: error: ‘indexOfKey’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
frameworks/base/include/utils/KeyedVector.h:193:31: note: declarations in dependent base ‘android::KeyedVector<unsigned int, ShaderData*>’ are not found by unqualified lookup
frameworks/base/include/utils/KeyedVector.h:193:31: note: use ‘this->indexOfKey’ instead
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libOpenglCodecCommon_intermediates/GLSharedGroup.o] Error 1
Fix:
$ kwrite development/tools/emulator/opengl/Android.mk
Add '-fpermissive' to line 25:
EMUGL_COMMON_CFLAGS := -DWITH_GLES2 -fpermissive
Error 8
Code:
/usr/bin/ld: note: 'XInitThreads' is defined in DSO /lib/libX11.so.6 so try adding it to the linker command line
/lib/libX11.so.6: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/emulator_renderer_intermediates/emulator_renderer] Error 1
Fix:
$ kwrite development/tools/emulator/opengl/host/renderer/Android.mk
Add new entry 'LOCAL_LDLIBS += -lX11' after line 6 as shown:
LOCAL_SRC_FILES := main.cpp
LOCAL_CFLAGS += -O0 -g
LOCAL_LDLIBS += -lX11
#ifeq ($(HOST_OS),windows)
#LOCAL_LDLIBS += -lws2_32
Error 9
Code:
external/llvm/include/llvm/ADT/PointerUnion.h:56:10: error: enumeral mismatch in conditional expression: ‘llvm::PointerLikeTypeTraits<llvm::PointerUnion<clang::Stmt*, const clang::Type*> >::<anonymous enum>’ vs ‘llvm::PointerLikeTypeTraits<clang::eek:bjCInterfaceDecl*>::<anonymous enum>’ [-Werror]
cc1plus: all warnings being treated as errors
make: *** [out/host/linux-x86/obj/EXECUTABLES/llvm-rs-cc_intermediates/slang_rs.o] Error 1
Fix:
$ kwrite frameworks/compile/slang/Android.mk
Remove '-Werror' from line 22:
local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter
Error 10
Code:
frameworks/base/libs/rs/rsFont.cpp:224:76: required from here
frameworks/base/include/utils/KeyedVector.h:193:31: error: ‘indexOfKey’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
frameworks/base/include/utils/KeyedVector.h:193:31: note: declarations in dependent base ‘android::KeyedVector<unsigned int, android::renderscript::Font::CachedGlyphInfo*>’ are not found by unqualified lookup
frameworks/base/include/utils/KeyedVector.h:193:31: note: use ‘this->indexOfKey’ instead
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libRS_intermediates/rsFont.o] Error 1
Fix:
$ kwrite frameworks/base/libs/rs/Android.mk
Add '-fpermissive' to line 183:
LOCAL_CFLAGS += -Werror -Wall -Wno-unused-parameter -Wno-unused-variable -fpermissive
Error 11
Code:
external/mesa3d/src/glsl/linker.cpp:1394:49: error: expected primary-expression before ‘,’ token
......
external/mesa3d/src/glsl/linker.cpp:1734:59: error: ‘offsetof’ was not declared in this scope
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libMesa_intermediates/src/glsl/linker.o] Error 1
Fix:
$ kwrite external/mesa3d/src/glsl/linker.cpp
Add '#include <stddef.h>' to list of includes as shown:
#include <climits>
#include <stddef.h>
#include <pixelflinger2/pixelflinger2_interface.h>
Error 12
Code:
external/gtest/src/../include/gtest/gtest-param-test.h:287:58: note: ‘template<class Container> testing::internal::ParamGenerator<typename Container::value_type> testing::ValuesIn(const Container&)’ declared here, later in the translation unit
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libgtest_host_intermediates/gtest-all.o] Error 1
Fix 1:
$ kwrite external/gtest/src/Android.mk
Add '-fpermissive' to lines 52 and 70 (both lines contain same info)
LOCAL_CFLAGS += -O0 -fpermissive
Fix 2:
$ kwrite external/gtest/include/gtest/internal/gtest-param-util.h
Add '#include <stddef.h>' to list of includes as shown:
#include <vector>
#include <stddef.h>
#include <gtest/internal/gtest-port.h>
Error 13
Code:
frameworks/compile/slang/slang_rs_export_foreach.cpp: In static member function ‘static slang::RSExportForEach* slang::RSExportForEach::Create(slang::RSContext*, const clang::FunctionDecl*)’:
frameworks/compile/slang/slang_rs_export_foreach.cpp:249:23: error: variable ‘ParamName’ set but not used [-Werror=unused-but-set-variable]
cc1plus: all warnings being treated as errors
make: *** [out/host/linux-x86/obj/EXECUTABLES/llvm-rs-cc_intermediates/slang_rs_export_foreach.o] Error 1
Fix:
$ kwrite kwrite frameworks/compile/slang/Android.mk
change
local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter -Werror
to
local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter
reserved #2
Wish somebody would build for the LG optimistic logic
Sent from my LGL35G using xda premium

[DEV]Build Recovery Using Minimal Setup CM11 (4GB minimal)

EDIT:I've haven't had the need to setup a recovery build environment in sometime now, as such, I'd no longer maintaining this, beginners and novice users are recommended to follow standard setup, while advanced users can probably adopt this to work for them.
So lately I broke my CM11 base which i use for kernel/recovery compiling,
trying nearly everything to fix it failed, So i took the lazy route, deleted it and started a new base,
So for the moment, I left it sync'ing and went to watch the TV, knowing it takes around 3 hours for a full sync,
came back few hours later and sync was complete and before anything I scrolled he terminal backup and realised there is alot of 'junk' that is of no use to kernel/recovery compiling, so I asked around and i was told Helicopter88 had a minimal setup just for that, but it's out of date,
and from one thing into another I came up with this.
This is a stripped down version of CM11 that allows you to compile recoveries from,
It's main feature is that all(most) of the 'junk' which isn't used in recovery build is removed not only saving you time in downloading but also space,
Sync'ing this setup took me 1 hour and 4 minutes and saved me alot of space and download bandwidth.
(for a bit of transparency, I'm running a slightly modified setup, so there can be some discrepancies in the steps, if that’s the case, post about it and hopefully I'll fix it, though looking through, everything seems correct, I'll also describe my setup in a new post below if you're interested)
1) setup your packages
For linux based systems (32bit & 64bit)
Code:
sudo apt-get install bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop openjdk-6-jdk openjdk-6-jre pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev
For Linux based System (64bits ONLY)
Code:
sudo apt-get install g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev
2) Setup Repo
Change droid_root to whatever directory you prefer
Code:
mkdir -p ~/bin
PATH="$HOME/bin:$PATH"
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
droid_root="~/android/cm11"
mkdir -p ~/$droid_root
cd [I]droid_root[/I]
repo init -u https://github.com/Thunder07/minimal_android.git -b cm-11.0_min
3) Setup Up Environment
Now, you're almost done, just wait for the sync to finish and run these commands,
Which will setup your environment and download your device tree if required.
remove the {} and replace the content with actual device code name
Do also keep in-mind that you'd need to run these 2 lines every-time you start a new shell when building the recovery.
and that you're cd into your droid_root.
Note: calling breakfast the 1st time will through few error, call it again should throw a dependency error, which we will fix in the next step
Code:
source build/envsetup.sh
breakfast {DEVICE_CODE_NAME}
I'm using an htc one x, so my commands would look like this
DONT RUN THIS CODE, ITS FOR HTC ONE X ONLY
Code:
source build/envsetup.sh
breakfast endeavouru
4) Removing Android Build Requirements
the error should look something like this
Code:
build/core/product_config.mk:239: *** _nic.PRODUCTS.[[device/BRAND/DEVICE/cm.mk]]: "[B]hardware[/B]/ti/wlan/mac80211/wl128x-wlan-products.mk" does not exist. Stop.
and as you might have guessed from the word hardware, the build (CM) is expecting files assoicated with hardware, which are not required by the recovery.
Open $droid_root/device/BRAND/DEVICE/ preferably in file manager
Note: that DEVICE & BRAND refer to you device name and brand and not a directory called BRAND/DEVICE
open cm.mk and change this
Code:
# Inherit some common CM stuff.
$(call inherit-product, vendor/cm/config/common_full_phone.mk)
# Enhanced NFC
$(call inherit-product, vendor/cm/config/nfc_enhanced.mk)
# Inherit device configuration
$(call inherit-product, device/htc/endeavoru/full_endeavoru.mk)
To look like this.
Don't copy and paste as these file contains reference to my device (htc/endeavoru)
as you can see the highlighted bit is the changes you need to make.
Code:
# Inherit some common CM stuff.
$(call inherit-product, vendor/cm/config/[B][COLOR="Green"]common.mk[/COLOR][/B])
# Enhanced NFC
[B][COLOR="Green"]#[/COLOR][/B]$(call inherit-product, vendor/cm/config/nfc_enhanced.mk)
# Inherit device configuration
[B][COLOR="Green"]#[/COLOR][/B]$(call inherit-product, device/htc/endeavoru/full_endeavoru.mk)
Now, onto DEVICE.mk
is a bit more messy to desribe so i paste a diff to illustrate: http://pastebin.com/jNDGhSPe
Note you can probably get away with leaving PRODUCT_COPY_FILES alone and just removing the hardware related $(call inherit-product, hardware/*.mk)
but just as well, you've got no use for them in this current setup​
5) Build
Bofore you start Building, make sure you're building the recovery you want TWRP/CWM/CWM_Phil/CM simple Recovery cloned into $droid_root/bootable/recovery/
Now for the building part itself, this will build the kernel & recovery and create a flashable image
Note:Make sure you're cd'ed to $droid_root and remember to do step 3 EVERYTIME you open a new shell
Code:
mka recoveryimage
Reserve: advance setup
To speed up the building process I've taken the process a step further, instead of building the kernel with the recovery,
I'd build both seperately and use the zImage as a prebuilt image, that way whenever I can "mka recoveryimage", I dont have to go through the process of building the zImage, even though it might already be built and fast enough, I'd rather just skip it all,
if you want to do the same, follow this.
For this part I'm assuming you know how to build a kernel, so i wont go through it.
so open $droid_root/device/BRAND/DEVICE/Boardconfig.mk
Code:
TARGET_KERNEL_SOURCE := kernel/BRAND/DEVICE
TARGET_KERNEL_CONFIG := cyanogenmod_endeavoru_defconfig
replace it with this
Code:
TARGET_PREBUILT_KERNEL := LOCATION_TO_PREBUILT_ZIMAGE
TARGET_PREBUILT_RECOVERY_KERNEL := LOCATION_TO_PREBUILT_ZIMAGE
open AndroidBoard.mk
Note: your AndroidBoard.mk may already have this, so be sure to check before replacing anything.
Code:
ALL_PREBUILT += $(INSTALLED_KERNEL_TARGET)
Replace With
Code:
file := $(INSTALLED_KERNEL_TARGET)
ALL_PREBUILT += $(file)
$(file): $(TARGET_PREBUILT_KERNEL) | $(ACP)
$(transform-prebuilt-to-target)
and you're done,
Now whenever you run "mka recoveryimage", a prebuilt zImage will be used,
and whenever you rebuild your kernel, "mka recoveryimage" would use that image.
reserve... just incase
Can I use Minimal set up for cm12.0 for building CWM recovery?
Thunder07 said:
reserve... just incase
Click to expand...
Click to collapse
Can I follow this guide for making a CWM recovery for compiling a CWM recovery for my android mobile(Celkon Q 500, android 4.4.2, Broadcom chip based), by replacing cm11.0 with cm 12.0? Please guide.
Eversmile23 said:
Can I follow this guide for making a CWM recovery for compiling a CWM recovery for my android mobile(Celkon Q 500, android 4.4.2, Broadcom chip based), by replacing cm11.0 with cm 12.0? Please guide.
Click to expand...
Click to collapse
Hi, sorry for the late reply, I'm buzy these days,
but I just updated the repo to allow for that.
though I didn't/dont have the time to test the changes myself.
Can youexplain a bit furher>
Thunder07 said:
Hi, sorry for the late reply, I'm buzy these days,
but I just updated the repo to allow for that.
though I didn't/dont have the time to test the changes myself.
Click to expand...
Click to collapse
As I am new to this 'building from source', I could not understand your statement ' I just updated the repo to allow for that'. What exactly, I will have to do to achieve my goal as I stated previously?
Eversmile23 said:
As I am new to this 'building from source', I could not understand your statement ' I just updated the repo to allow for that'. What exactly, I will have to do to achieve my goal as I stated previously?
Click to expand...
Click to collapse
You asked if you can use cm12 for the recovery building, before yesterday the answer was no, but I've updated the repo to use cm12 code... If you change cm11 to cm12 that is.
Also, if you're new to this, I'll avoid this particular guide as I won't be able to guide you through it if it doesn't work, as I'm busy for the next 2 weeks.
Sent from my A0001 using XDA Free mobile app
Good job
Gửi từ SM-G906K của tôi bằng cách sử dụng Tapatalk
Please help. I do not undertstand why 'repo sync' always fails at a particular stage, though I have 30+ GB of disk space available in my working folder named 'cm12'. Following is the last screen message :
Fetching project platform/external/ant-glob
Fetching projects: 8% (40/495) Receiving objects: 86% (2389/2771), 26.68 MiBerror: RPC failed; result=56, HTTP code = 200iB | 124.00 KiB/s
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
remote: Sending approximately 1.94 GiB ...
remote: Counting objects: 85, done
remote: Finding sources: 100% (85/85)
error: RPC failed; result=56, HTTP code = 200iB | 88.00 KiB/s
fatal: The remote end hung up unexpectedly
Now should I run 'repo sync' again or should I use 'repo sync -j1' ?
topic no support good
Gửi từ MX4 Pro của tôi bằng cách sử dụng Tapatalk
Eversmile23 said:
Please help. I do not undertstand why 'repo sync' always fails at a particular stage, though I have 30+ GB of disk space available in my working folder named 'cm12'. Following is the last screen message :
Fetching project platform/external/ant-glob
Fetching projects: 8% (40/495) Receiving objects: 86% (2389/2771), 26.68 MiBerror: RPC failed; result=56, HTTP code = 200iB | 124.00 KiB/s
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
remote: Sending approximately 1.94 GiB ...
remote: Counting objects: 85, done
remote: Finding sources: 100% (85/85)
error: RPC failed; result=56, HTTP code = 200iB | 88.00 KiB/s
fatal: The remote end hung up unexpectedly
Now should I run 'repo sync' again or should I use 'repo sync -j1' ?
Click to expand...
Click to collapse
No point in using j1, try sync, if it fails you might have to start fresh.
But the error at it reads is an error in the host and not your problem.
29y6145 said:
topic no support good
Gửi từ MX4 Pro của tôi bằng cách sử dụng Tapatalk
Click to expand...
Click to collapse
Sent from my A0001 using XDA Free mobile app
Thunder07 said:
So lately I broke my CM11 base which i use for kernel/recovery compiling,
trying nearly everything to fix it failed, So i took the lazy route, deleted it and started a new base,
So for the moment, I left it sync'ing and went to watch the TV, knowing it takes around 3 hours for a full sync,
came back few hours later and sync was complete and before anything I scrolled he terminal backup and realised there is alot of 'junk' that is of no use to kernel/recovery compiling, so I asked around and i was told Helicopter88 had a minimal setup just for that, but it's out of date,
and from one thing into another I came up with this.
This is a stripped down version of CM11 that allows you to compile recoveries from,
It's main feature is that all(most) of the 'junk' which isn't used in recovery build is removed not only saving you time in downloading but also space,
Sync'ing this setup took me 1 hour and 4 minutes and saved me alot of space and download bandwidth.
(for a bit of transparency, I'm running a slightly modified setup, so there can be some discrepancies in the steps, if that’s the case, post about it and hopefully I'll fix it, though looking through, everything seems correct, I'll also describe my setup in a new post below if you're interested)
1) setup your packages
For linux based systems (32bit & 64bit)
Code:
sudo apt-get install bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop openjdk-6-jdk openjdk-6-jre pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev
For Linux based System (64bits ONLY)
Code:
sudo apt-get install g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev
2) Setup Repo
Change droid_root to whatever directory you prefer
Code:
mkdir -p ~/bin
PATH="$HOME/bin:$PATH"
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
droid_root="~/android/cm11"
mkdir -p ~/$droid_root
cd [I]droid_root[/I]
repo init -u https://github.com/Thunder07/minimal_android.git -b cm-11.0_min
3) Setup Up Environment
Now, you're almost done, just wait for the sync to finish and run these commands,
Which will setup your environment and download your device tree if required.
remove the {} and replace the content with actual device code name
Do also keep in-mind that you'd need to run these 2 lines every-time you start a new shell when building the recovery.
and that you're cd into your droid_root.
Note: calling breakfast the 1st time will through few error, call it again should throw a dependency error, which we will fix in the next step
Code:
source build/envsetup.sh
breakfast {DEVICE_CODE_NAME}
I'm using an htc one x, so my commands would look like this
DONT RUN THIS CODE, ITS FOR HTC ONE X ONLY
Code:
source build/envsetup.sh
breakfast endeavouru
4) Removing Android Build Requirements
the error should look something like this
Code:
build/core/product_config.mk:239: *** _nic.PRODUCTS.[[device/BRAND/DEVICE/cm.mk]]: "[B]hardware[/B]/ti/wlan/mac80211/wl128x-wlan-products.mk" does not exist. Stop.
and as you might have guessed from the word hardware, the build (CM) is expecting files assoicated with hardware, which are not required by the recovery.
Open $droid_root/device/BRAND/DEVICE/ preferably in file manager
Note: that DEVICE & BRAND refer to you device name and brand and not a directory called BRAND/DEVICE
open cm.mk and change this
Code:
# Inherit some common CM stuff.
$(call inherit-product, vendor/cm/config/common_full_phone.mk)
# Enhanced NFC
$(call inherit-product, vendor/cm/config/nfc_enhanced.mk)
# Inherit device configuration
$(call inherit-product, device/htc/endeavoru/full_endeavoru.mk)
To look like this.
Don't copy and paste as these file contains reference to my device (htc/endeavoru)
as you can see the highlighted bit is the changes you need to make.
Code:
# Inherit some common CM stuff.
$(call inherit-product, vendor/cm/config/[B][COLOR="Green"]common.mk[/COLOR][/B])
# Enhanced NFC
[B][COLOR="Green"]#[/COLOR][/B]$(call inherit-product, vendor/cm/config/nfc_enhanced.mk)
# Inherit device configuration
[B][COLOR="Green"]#[/COLOR][/B]$(call inherit-product, device/htc/endeavoru/full_endeavoru.mk)
Now, onto DEVICE.mk
is a bit more messy to desribe so i paste a diff to illustrate: http://pastebin.com/jNDGhSPe
Note you can probably get away with leaving PRODUCT_COPY_FILES alone and just removing the hardware related $(call inherit-product, hardware/*.mk)
but just as well, you've got no use for them in this current setup​
5) Build
Bofore you start Building, make sure you're building the recovery you want TWRP/CWM/CWM_Phil/CM simple Recovery cloned into $droid_root/bootable/recovery/
Now for the building part itself, this will build the kernel & recovery and create a flashable image
Note:Make sure you're cd'ed to $droid_root and remember to do step 3 EVERYTIME you open a new shell
Code:
mka recoveryimage
Click to expand...
Click to collapse
i need to change endevoru to my device name and htc to n=my brand name everywhere.. right??
jackey31 said:
i need to change endevoru to my device name and htc to n=my brand name everywhere.. right??
Click to expand...
Click to collapse
basically, but each device tree is different, so this tutorial is to explain how and why to do it.
you probably need some basic knowledge of how to build the recovery using the proper way, before attempting this.
can you port for me??? please
Thunder07 said:
basically, but each device tree is different, so this tutorial is to explain how and why to do it.
you probably need some basic knowledge of how to build the recovery using the proper way, before attempting this.
Click to expand...
Click to collapse
thanks for writing such a great guide for compiling cwm..
but i can't do this bcause i don't know much abt it ..
i don't have linux based os..
very slow and limited internet connection, would probably take a week to download 4gb source.. ..
so can you port for my device.. i will upload..
recovery.img
boot.img
build.prop
and i have extracted recovery.fstab so know the mount points..
thanking you in advance..
syncing repo..
Thunder07 said:
basically, but each device tree is different, so this tutorial is to explain how and why to do it.
you probably need some basic knowledge of how to build the recovery using the proper way, before attempting this.
Click to expand...
Click to collapse
i installed linux mint in virtual box.. currently syncing repo...
my net gets disconnected after 40 minutes i don't know why... so i have run repo sync again every time i got disconnected.
has it started syncing from the begining?? or just picked up from the last point when my net got disconnected??
will i ever be able to sync it??..
jackey31 said:
i installed linux mint in virtual box.. currently syncing repo...
my net gets disconnected after 40 minutes i don't know why... so i have run repo sync again every time i got disconnected.
has it started syncing from the begining?? or just picked up from the last point when my net got disconnected??
will i ever be able to sync it??..
Click to expand...
Click to collapse
if you run "repo sync" after you're disconnected it will continue from where it left off.
can't sync
Thunder07 said:
if you run "repo sync" after you're disconnected it will continue from where it left off.
Click to expand...
Click to collapse
i can never sync this repo.. my connection drops after 400 mb so stuck at 70 % project 80/114 platform/prebuilts/tools 445mb..
i have run repo sync several time it starts downloading this project from the beginning.. :crying::crying:
i does not actually resume it restarts the project which was not completely downloaded.

Compiling dropbear 2015.67 for Zenfone 2 (x86-64)

Hi,
This is a guide on compiling the latest (as of 2015-06-24) dropbear SSH daemon (2015.67) for the Zenfone 2 but should also work for other x86-64 architecture Android devices. The guide is mainly based off the work from the blog http://blog.xulforum.org/index.php?post/2013/12/19/Compiling-Dropbear-for-a-Nexus-7-tablet which is an excellent guide to getting an older version of dropbear running on Android devices.
I've modified the patch made by the original author to work on the latest dropbear version. There are not much changes from ver 2013.58 to 2015.67. The main difference seems to be the support for Elliptical Curve encryption.
** START DISCLAIMER **
I did not write the original codes/patch myself and have not scrutinized it for any security issues. USE IT AT YOUR OWN RISK.
** END DISCLAIMER **
Here's the list of requirements :-
1) Dropbear 2015.67 source code - dropbear-2015.67.tar.bz2 (https://matt.ucc.asn.au/dropbear/releases/dropbear-2015.67.tar.bz2)
2) Patch to compile for Android - dropbear-v67-android-patch-20150629 (https://goo.gl/LBokgG)
3) A recent Linux distro (I use Ubuntu 14.04.2 LTS) running x86-64.
4) Development tools i.e. C compiler, linker, etc... all the necessary tools to run configure, make, etc..
Steps :-
(1) Extract the source code to a directory of its own :-
Code:
tar xjf dropbear-2015.67.tar.bz2
cd dropbear-2015.67
(2) Patch the source :-
Code:
patch -p1 < dropbear-v67-android-patch-20150629
(3) Run configure :-
Code:
./configure --disable-zlib --disable-largefile --disable-loginfunc \
--disable-shadow --disable-utmp --disable-utmpx --disable-wtmp \
--disable-wtmpx --disable-pututline --disable-pututxline --disable-lastlog
(4) Run make :-
Code:
STATIC=1 MULTI=1 SCPPROGRESS=0 PROGRAMS="dropbear dropbearkey scp dbclient" make strip
(5) You should end up with a single static binary "dropbearmulti" which you should link dropbear, dbclient/ssh, dropbearkey and scp to.
Code:
./dropbear -h
Dropbear server v2015.67 [URL]https://matt.ucc.asn.au/dropbear/dropbear.html[/URL]
Usage: ./dropbear [options]
-A Android Mode, specify a user explicitly
-N Android Mode, user name
-C Android Mode, password
-R Android Mode, public key file (authorized_keys)
-U Android Mode, UID
-G Android Mode, GID
-b bannerfile Display the contents of bannerfile before user login
(default: none)
-r keyfile Specify hostkeys (repeatable)
defaults:
dss /etc/dropbear/dropbear_dss_host_key
rsa /etc/dropbear/dropbear_rsa_host_key
ecdsa /etc/dropbear/dropbear_ecdsa_host_key
-F Don't fork into background
-E Log to stderr rather than syslog
-m Don't display the motd on login
-w Disallow root logins
-s Disable password logins
-g Disable password logins for root
-B Allow blank password logins
-j Disable local port forwarding
-k Disable remote port forwarding
-a Allow connections to forwarded ports from any host
-p [address:]port
Listen on specified tcp port (and optionally address),
up to 10 can be specified
(default port is 22 if none specified)
-P PidFile Create pid file PidFile
(default /var/run/dropbear.pid)
-i Start for inetd
-W <receive_window_buffer> (default 24576, larger may be faster, max 1MB)
-K <keepalive> (0 is never, default 0, in seconds)
-I <idle_timeout> (0 is never, default 0, in seconds)
-V Version
I will assume you know what to do with the binary file generated so will not elaborate on the process.
Hope it works for you guys. I'll be happy to help out anyone who needs more details.
Cheers.
UPDATE: 2015-06-29
- I've updated the patch to fix dbclient/ssh client using password authentication.
Hi all,
For those of you using the dropbear ssh client and encountering a seg fault when using password authentication, I've fixed the patch now and it should be working.
Cheers.
wolfdude said:
I will assume you know what to do with the binary file generated so will not elaborate on the process.
Hope it works for you guys. I'll be happy to help out anyone who needs more details.
Click to expand...
Click to collapse
Ehm...
Replacing the not working dropbear binaries of ARM-oriented SSHD servers with a link to this should solve the problem discussed here ...
is it right ?!
Thanks again
Val3r10 said:
Ehm...
Replacing the not working dropbear binaries of ARM-oriented SSHD servers with a link to this should solve the problem discussed here ...
is it right ?!
Thanks again
Click to expand...
Click to collapse
In a nutshell, you will need to copy dropbearmulti to /system/xbin, create some symbolic links to it (dropbear, dropbearkey, dbclient, scp), run dropbearkey to generate your host keys, copy your client pubkey to /data/dropbear/authorized_keys and then startup dropbear with parameters like :-
Code:
dropbear -A -N root -R /data/dropbear/authorized_keys
Hope this helps.
Cheers.
wolfdude said:
[...] and then startup dropbear with parameters like :-
Hope this helps.
Click to expand...
Click to collapse
Thanks. Got that.
Actually I mean I would replace - with the symlink - the x86 binary file inside one of the above mentionned packages, i.e. QuickSSHd or SSHDroid, to make them compatible with ZE55xML...
I'm trying and reporting here

Categories

Resources