[GUIDE] How to build a Project Treble GSI ROM from source? [31/08] - Treble-Enabled Device Guides, News, & Discussion

Hello guys, in this guide I'll try to simplify building Treble GSI process.
As you read this guide now I'll assume you already have a previous knowledge about How to build android from source, so I won't cover some points with too many basic details.
So, let's start:
What you’ll need
A treble enabled device, basically all devices that come with Android 8.1 out of box support it.
A relatively recent 64-bit computer (Linux, OS X, or Windows) with a reasonable amount of RAM and about 100 GB of free storage (more if you enable ccache or build for multiple devices). The less RAM you have, the longer the build will take (aim for 8 GB or more). Using SSDs results in considerably faster build times than traditional hard drives.
A USB cable compatible with your device
A decent internet connection & reliable electricity
Some familiarity with basic Android operation and terminology. It would help if you’ve installed custom ROMs on other devices and are familiar with recovery. It may also be useful to know some basic command line concepts such as cd for “change directory”, the concept of directory hierarchies, that in Linux they are separated by /. etc.
Summary
1. Install SDK
2. Install build packages
3. Install the repo command
4. Configure git
5. Turn on caching to speed up build
6. Build using phhusson's script
7. Build using dakkar's script
8. Build using the manual way
1. Install SDK
If you haven’t previously installed adb and fastboot, you can download them from Google. Extract it using:
Code:
unzip platform-tools-latest-linux.zip -d ~
Now we have to add adb and fastboot to our path. Open ~/.profile and add the following:
Code:
# add Android SDK platform tools to path
if [ -d "$HOME/platform-tools" ] ; then
PATH="$HOME/platform-tools:$PATH"
fi
Then, run this to update your environment.
Code:
source ~/.profile
2. Install build packages
Several packages are needed to build Android. You can install these using your distribution’s package manager.
You’ll need:
Code:
bc bison build-essential curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev
lib32readline-gplv2-dev lib32z1-dev libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk3.0-dev
libxml2 libxml2-utils lzop pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev openjdk-8-jdk
3. Install the repo command
Enter the following to download the repo binary and make it executable (runnable):
Code:
mkdir -p ~/bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
Put the ~/bin directory in your path of execution
In recent versions of Ubuntu, ~/bin should already be in your PATH. You can check this by opening ~/.profile with a text editor and verifying the following code exists (add it if it is missing):
Code:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
Then, use this to update your environment.
Code:
source ~/.profile
4. Configure git
You’ll need to set up git identity in order to sync the source, run these commands:
Code:
git config --global user.name "your username"
git config --global user.email [email protected]
5. Turn on caching to speed up build
You can speed up subsequent builds by running:
Code:
export USE_CCACHE=1
export CCACHE_COMPRESS=1
And adding that line to your ~/.bashrc file. Then, specify the maximum amount of disk space you want the cache to use by typing this from the top of your Android tree:
Code:
prebuilts/misc/linux-x86/ccache/ccache -M 50G
Where 50G corresponds to 50GB of cache. This needs to be run once. Anywhere from 25GB-100GB will result in very noticeably increased build speeds (for instance, a typical 1hr build time can be reduced to 20min). If you’re only building for one device, 25GB-50GB is fine. If you plan to build for several devices that do not share the same kernel source, aim for 75GB-100GB. This space will be permanently occupied on your drive, so take this into consideration. See more information about ccache on Google’s Android build environment initialization page.
6. Build using phhusson's script
We can't deny that @phhusson has made amazing works and countless contributions to Project Treble ROMs development apart from his experimentations is a build script which make build a GSI super simple job.
By default, it supports building LineageOS - RR - Carbon.
1- Open your terminal and run:
Code:
git clone https://github.com/phhusson/treble_experimentations
2- To clone and build enter the following command and replace "romname" with lineage|rr|carbon
Code:
mkdir romname; cd romname
bash ../treble_experimentations/build-rom.sh android-8.1 romname
3- The script will automatically initialize the repository, sync the source, apply patches and start building.
7. Build using dakkar's script
dakkar's script is another treble building script, originally made by @Dakkar and improved by contributors on treble experimentations repo. It's customizable, easy to understand and can build almost all ROMs with simple edits.
1- Open your terminal and run:
Code:
git clone https://github.com/phhusson/treble_experimentations
2- To start the process:
Code:
bash ../treble_experimentations/build-dakkar.sh romname variant
Variants are dash-joined combinations of (in order):
* processor type
* "arm" for ARM 32 bit
* "arm64" for ARM 64 bit
* A or A/B partition layout ("aonly" or "ab")
* GApps selection
* "vanilla" to not include GApps
* "gapps" to include opengapps
* "go" to include gapps go
* SU selection ("su" or "nosu")
for example:
* arm-aonly-vanilla-nosu
* arm64-ab-gapps-su
Click to expand...
Click to collapse
Note: check patches when you use these auto scripts, if some patch is broken you'll have build errors
8. Build using the manual way
In simple steps:
1. Repo init the rom you want to build GSI for.
Code:
mkdir ~/rom && cd ~/rom
repo init -u https://github.com/LineageOS/android.git -b lineage-15.1
2. Add phh repos to your local_manifest
Code:
git clone https://github.com/phhusson/treble_manifest .repo/local_manifests -b android-8.1
After git clone you need to remove replace.xml if you're building any rom expect aosp.
phhusson said:
The replace.xml is meant only for AOSP, if you build a custom ROM, remove it, but don't forget to cherry-pick the patches.
Click to expand...
Click to collapse
3. Sync the source
Code:
repo sync -c -j4 --force-sync --no-tags --no-clone-bundle
4. Modify the source to fix issues in other devices using one of these methods:
- Apply phh patches:
Code:
git clone https://github.com/phhusson/treble_patches -b android-8.1
Then apply each path in its project
Code:
patch -p1 < patch
- Or cherry-pick changes by phhusson from here, remember to choose the latest branch
platform_build - platform_external_selinux - platform_frameworks_av - platform_frameworks_base - platform_frameworks_native - platform_frameworks_opt_telephony - platform_system_bt - platform_system_core - platform_system_libvintf - platform_system_vold
Code:
git fetch repo branch && git cherry-pick commit
5. Go to the phh device repo and edit the .mk for your ROM (example lineage.mk)
6. Lunch the build varaint you want (ex. treble_arm64_avN-userdebug) and start the build
Code:
. build/envsetup.sh
lunch treble_arm64_avN-userdebug
WITHOUT_CHECK_API=true make -j8 systemimage
7. If you want to compress the system image after build finishes, go to out/target/product/phh_*/ folder and run
Code:
xz -c system.img > system.img.xz
That's all
Credits:
- @phhusson for all his contributions, without his efforts this can't be possible.
- @Dakkar for his build script
- @fAIyaZ for helping me build my first GSI
- @sooti for his simplified instruction on phh-treble telegram.
- @lineageos guys for their wiki
- And me for writing this guide

Community Edition
I made a community edition of this guide, available on @phhusson treble experimentations wiki
Feel free to edit it and improve the current one
How to build a GSI?

Weew thanks. Will try to ?

I'm getting an error when trying to repo sync manually the sources to download all of the phhusson's code. The thing is that even modifying the "replace.xml" file (the one "causing" the error) to adapt it to the rom's manifest, the error persists.
Repo is telling me the following: fatal: remove-project element specifies non-existent project: platform/build If I change the "platform/build" reference to the correct path, it's still giving me the error but with the new route, even while the folders and files clearly exist.
Anyone got a clue on why is this happening? I mean, the way to solve the problem is pretty straightforward, I just need to download manually the file from the Github repo and then perform all the needed chances, but it's always easier and cleaner to do it via the repo command.

Sinek_ said:
I'm getting an error when trying to repo sync manually the sources to download all of the phhusson's code. The thing is that even modifying the "replace.xml" file (the one "causing" the error) to adapt it to the rom's manifest, the error persists.
Repo is telling me the following: fatal: remove-project element specifies non-existent project: platform/build If I change the "platform/build" reference to the correct path, it's still giving me the error but with the new route, even while the folders and files clearly exist.
Anyone got a clue on why is this happening? I mean, the way to solve the problem is pretty straightforward, I just need to download manually the file from the Github repo and then perform all the needed chances, but it's always easier and cleaner to do it via the repo command.
Click to expand...
Click to collapse
Ah indeed, the replace.xml is meant only for AOSP, if you build a custom ROM, remove it, but don't forget to cherry-pick the patches.
@yshalsager ^^^

I'm sure this thread will see a lot of views in the coming years. Also it gives us noobs (me) a chance to build ROMs that actually build and run on our devices. Thanks for writing this.
Edit: in future if there's a way to add device specific features into here, it would be amazing. (Alert slider etc)

Jamie_oppo said:
Edit: in future if there's a way to add device specific features into here, it would be amazing. (Alert slider etc)
Click to expand...
Click to collapse
I'm not sure what you mean. Alert slider is already supported in GSIs
Or you're asking for a documentation on how to implement such features for GSIs?

phhusson said:
I'm not sure what you mean. Alert slider is already supported in GSIs
Or you're asking for a documentation on how to implement such features for GSIs?
Click to expand...
Click to collapse
Oh I isn't know the alert slider was already implemented in gsi. ( the only one I've flashed is dot os. ) maybe thats why.
Yeah I'm asking if its possible to add documentation for device specific features. Like imagine a new budget Motorola (with something specific like alert slider v3) with treble as a base and a Dev would be able to add the device specific "alert slider V3" from source to the gsi (and that gsi can be the ones that, that specific Motorola will flash).
Its so awesome they all of us involved with treble have an awesome Dev like you.

Hi
i try to build gsi on windows subsystem for linux with dakkar's script. But it failed with the following error:
...
[ 2% 2291/105390] Build hyb /root/tre...phenation-patterns/nn//hyph-nn.pat.txt
12585 unique nodes, 42861 total
[ 2% 2359/105390] Generating TOC: /ro...S/sdk_v8_intermediates/classes.jar.toc
FAILED: /root/treble_experimentations/out/target/common/obj/JAVA_LIBRARIES/sdk_v8_intermediates/classes.jar.toc
/bin/bash -c "(ASAN_OPTIONS=detect_leaks=0 prebuilts/build-tools/linux-x86/bin/ijar /root/treble_experimentations/out/target/common/obj/JAVA_LIBRARIES/sdk_v8_intermediates/classes.jar /root/treble_experimentations/out/target/common/obj/JAVA_LIBRARIES/sdk_v8_intermediates/classes.jar.toc.tmp ) && (if cmp -s /root/treble_experimentations/out/target/common/obj/JAVA_LIBRARIES/sdk_v8_intermediates/classes.jar.toc.tmp /root/treble_experimentations/out/target/common/obj/JAVA_LIBRARIES/sdk_v8_intermediates/classes.jar.toc ; then rm /root/treble_experimentations/out/target/common/obj/JAVA_LIBRARIES/sdk_v8_intermediates/classes.jar.toc.tmp ; else mv /root/treble_experimentations/out/target/common/obj/JAVA_LIBRARIES/sdk_v8_intermediates/classes.jar.toc.tmp /root/treble_experimentations/out/target/common/obj/JAVA_LIBRARIES/sdk_v8_intermediates/classes.jar.toc ; fi )"
ftruncate(fd_out, GetSize()): Invalid argument
/bin/bash: Zeile 1: 2346 Abgebrochen (Speicherabzug geschrieben) ( ASAN_OPTIONS=detect_leaks=0 prebuilts/build-tools/linux-x86/bin/ijar /root/treble_experimentations/out/target/common/obj/JAVA_LIBRARIES/sdk_v8_intermediates/classes.jar /root/treble_experimentations/out/target/common/obj/JAVA_LIBRARIES/sdk_v8_intermediates/classes.jar.toc.tmp )
[ 2% 2362/105390] Build hyb /root/tre...phenation-patterns/hu//hyph-hu.pat.txt
21515 unique nodes, 102669 total
ninja: build stopped: subcommand failed.
11:27:50 ninja failed with: exit status 1
[email protected]:~/treble_experimentations#
Click to expand...
Click to collapse
I used this command to build lineage with su und gapps:
bash ../treble_experimentations/build-dakkar.sh lineage arm64-aonly-gapps-su
Click to expand...
Click to collapse

I figured out, that the error is a problem with the wsl. To fix this problem a patch is needed: https://forum.xda-developers.com/showpost.php?p=70571884&postcount=20.
How can i apply this patch?

Saftpresse99 said:
I figured out, that the error is a problem with the wsl. To fix this problem a patch is needed: https://forum.xda-developers.com/showpost.php?p=70571884&postcount=20.
How can i apply this patch?
Click to expand...
Click to collapse
Cherry pick his commit like I explained in the guide

need a developer for treble natrium. The sources of the past developer remained, but he can not continue to update, since this device does not exist anymore. if someone can continue his work, then write to me, I'm ready to become a beta tester

Saftpresse99 said:
I figured out, that the error is a problem with the wsl. To fix this problem a patch is needed: https://forum.xda-developers.com/showpost.php?p=70571884&postcount=20.
How can i apply this patch?
Click to expand...
Click to collapse
If you can't find that source file yourself and make the change because you lack C knowledge (I mean, the error log already says where the problematic file/line is), then you're probably better off using real Linux. WSL is still beta and designed for experienced developers.

yshalsager said:
Cherry pick his commit like I explained in the guide
Click to expand...
Click to collapse
CosmicDan said:
If you can't find that source file yourself and make the change because you lack C knowledge (I mean, the error log already says where the problematic file/line is), then you're probably better off using real Linux. WSL is still beta and designed for experienced developers.
Click to expand...
Click to collapse
Hi,
the problem is in zip.cc. User @Uldiniad has started a pr to fix the the problem: https://review.lineageos.org/#/c/LineageOS/android_build/+/208102/5
He also microsoft opens an issue at microsoft: https://github.com/Microsoft/WSL/issues/3157
I will try to cherry pick this commit. I don't know how exactly i can do this, but i will try

Saftpresse99 said:
Hi,
the problem is in zip.cc. User @Uldiniad has started a pr to fix the the problem: https://review.lineageos.org/#/c/LineageOS/android_build/+/208102/5
He also microsoft opens an issue at microsoft: https://github.com/Microsoft/WSL/issues/3157
I will try to cherry pick this commit. I don't know how exactly i can do this, but i will try
Click to expand...
Click to collapse
You can just edit it manually if you don't want to add the remote and cherry-pick. Just make a note of the manual change the did since a git pull from later will have a conflict, requiring you to manually resolve it.

Code:
git fetch repo branch && git cherry-pick commit
~/build-treble/rom$ git fetch repo branch && git cherry-pick commit
fatal: not a git repository (or any of the parent directories): .git
wrong directory?

meltbanana said:
Code:
git fetch repo branch && git cherry-pick commit
~/build-treble/rom$ git fetch repo branch && git cherry-pick commit
fatal: not a git repository (or any of the parent directories): .git
wrong directory?
Click to expand...
Click to collapse
No expert here but I'd say "repo branch" and "commit" don't mean absolutely anything except that you need to specifiy the repo branch and the specific commit to be applied.
On the other hand I am trying to build a CandyRom GSI following this guide and the spectacular work of phhusson and the rest of the guys making the scripts and project treble possible. I initially modified the build-rom.sh to include candy's repo and run the command. I obviously had a first error because candy.mk didn't exist. Created it and then, as source was there and patches were supposed to have been applied too (although when applying them I get a bunch of errors which I interpret are due to some files that don't exist or code that can't be modified because it doesn't match), opted for the manual building process and run . build/envsetup.sh, lunch treble_arm64_avN-userdebug and make -j8 systemimage. It starts running and then I get a whole bunch of errors before the building begins: missing libraries:
Code:
packages/apps/Bluetooth/Android.mk: error: Bluetooth (APPS android-arm64) missing sap-api-java-static (JAVA_LIBRARIES android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/core/adb/Android.mk: error: adbd (EXECUTABLES android-arm64) missing libbootloader_message (STATIC_LIBRARIES android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/core/healthd/Android.mk: error: libhealthd_draw (STATIC_LIBRARIES android-arm64) missing libminui (STATIC_LIBRARIES android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/core/healthd/Android.mk: error: libhealthd_draw (STATIC_LIBRARIES android-arm) missing libminui (STATIC_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/core/healthd/Android.mk: error: libhealthd_charger (STATIC_LIBRARIES android-arm64) missing libminui (STATIC_LIBRARIES android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/core/healthd/Android.mk: error: libhealthd_charger (STATIC_LIBRARIES android-arm) missing libminui (STATIC_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/core/healthd/Android.mk: error: charger (EXECUTABLES android-arm64) missing libminui (STATIC_LIBRARIES android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/core/init/Android.mk: error: init (EXECUTABLES android-arm64) missing libbootloader_message (STATIC_LIBRARIES android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/extras/slideshow/Android.mk: error: slideshow (EXECUTABLES android-arm64) missing libminui (STATIC_LIBRARIES android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/vold/Android.mk: error: libvold (STATIC_LIBRARIES android-arm64) missing libbootloader_message (STATIC_LIBRARIES android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/vold/Android.mk: error: libvold (STATIC_LIBRARIES android-arm) missing libbootloader_message (STATIC_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/vold/Android.mk: error: vold (EXECUTABLES android-arm64) missing libbootloader_message (STATIC_LIBRARIES android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/vold/Android.mk: error: libminivold (STATIC_LIBRARIES android-arm64) missing libbootloader_message (STATIC_LIBRARIES android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/vold/Android.mk: error: libminivold (STATIC_LIBRARIES android-arm) missing libbootloader_message (STATIC_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/vold/Android.mk: error: minivold (RECOVERY_EXECUTABLES android-arm64) missing libbootloader_message (STATIC_LIBRARIES android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
vendor/candy/charger/Android.mk: error: libhealthd.candy (STATIC_LIBRARIES android-arm64) missing libminui (STATIC_LIBRARIES android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
vendor/candy/charger/Android.mk: error: libhealthd.candy (STATIC_LIBRARIES android-arm) missing libminui (STATIC_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
build/core/main.mk:798: error: exiting from previous errors.
09:08:01 ckati failed with: exit status 1
I have built and used Candy for lithium and never had any building errors, so I have no idea why those libraries are missing or of course how to fix it...
If anyone can give a hint it will be appreciated.
Thanks and keep it up!

meltbanana said:
Code:
git fetch repo branch && git cherry-pick commit
~/build-treble/rom$ git fetch repo branch && git cherry-pick commit
fatal: not a git repository (or any of the parent directories): .git
wrong directory?
Click to expand...
Click to collapse
Repo and branch are what you are trying to get changes from, I mean phh repos
albertoduqe said:
No expert here but I'd say "repo branch" and "commit" don't mean absolutely anything except that you need to specifiy the repo branch and the specific commit to be applied.
On the other hand I am trying to build a CandyRom GSI following this guide and the spectacular work of phhusson and the rest of the guys making the scripts and project treble possible. I initially modified the build-rom.sh to include candy's repo and run the command. I obviously had a first error because candy.mk didn't exist. Created it and then, as source was there and patches were supposed to have been applied too (although when applying them I get a bunch of errors which I interpret are due to some files that don't exist or code that can't be modified because it doesn't match), opted for the manual building process and run . build/envsetup.sh, lunch treble_arm64_avN-userdebug and make -j8 systemimage. It starts running and then I get a whole bunch of errors before the building begins: missing libraries:
Code:
packages/apps/Bluetooth/Android.mk: error: Bluetooth (APPS android-arm64) missing sap-api-java-static (JAVA_LIBRARIES android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/core/adb/Android.mk: error: adbd (EXECUTABLES android-arm64) missing libbootloader_message (STATIC_LIBRARIES android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/core/healthd/Android.mk: error: libhealthd_draw (STATIC_LIBRARIES android-arm64) missing libminui (STATIC_LIBRARIES android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/core/healthd/Android.mk: error: libhealthd_draw (STATIC_LIBRARIES android-arm) missing libminui (STATIC_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/core/healthd/Android.mk: error: libhealthd_charger (STATIC_LIBRARIES android-arm64) missing libminui (STATIC_LIBRARIES android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/core/healthd/Android.mk: error: libhealthd_charger (STATIC_LIBRARIES android-arm) missing libminui (STATIC_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/core/healthd/Android.mk: error: charger (EXECUTABLES android-arm64) missing libminui (STATIC_LIBRARIES android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/core/init/Android.mk: error: init (EXECUTABLES android-arm64) missing libbootloader_message (STATIC_LIBRARIES android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/extras/slideshow/Android.mk: error: slideshow (EXECUTABLES android-arm64) missing libminui (STATIC_LIBRARIES android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/vold/Android.mk: error: libvold (STATIC_LIBRARIES android-arm64) missing libbootloader_message (STATIC_LIBRARIES android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/vold/Android.mk: error: libvold (STATIC_LIBRARIES android-arm) missing libbootloader_message (STATIC_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/vold/Android.mk: error: vold (EXECUTABLES android-arm64) missing libbootloader_message (STATIC_LIBRARIES android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/vold/Android.mk: error: libminivold (STATIC_LIBRARIES android-arm64) missing libbootloader_message (STATIC_LIBRARIES android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/vold/Android.mk: error: libminivold (STATIC_LIBRARIES android-arm) missing libbootloader_message (STATIC_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/vold/Android.mk: error: minivold (RECOVERY_EXECUTABLES android-arm64) missing libbootloader_message (STATIC_LIBRARIES android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
vendor/candy/charger/Android.mk: error: libhealthd.candy (STATIC_LIBRARIES android-arm64) missing libminui (STATIC_LIBRARIES android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
vendor/candy/charger/Android.mk: error: libhealthd.candy (STATIC_LIBRARIES android-arm) missing libminui (STATIC_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
build/core/main.mk:798: error: exiting from previous errors.
09:08:01 ckati failed with: exit status 1
I have built and used Candy for lithium and never had any building errors, so I have no idea why those libraries are missing or of course how to fix it...
If anyone can give a hint it will be appreciated.
Thanks and keep it up!
Click to expand...
Click to collapse
Simply type
export ALLOW_MISSING_DEPENDENCIES=true
Before building

When make system image, I got:
ninja: error: '/home/alan/dotos/out/target/common/obj/JAVA_LIBRARIES/sap-api-java-static_intermediates/classes.jack', needed by '/home/alan/dotos/out/target/common/obj/APPS/Bluetooth_intermediates/with-local/classes.dex', missing and no known rule to make it
14:35:40 ninja failed with: exit status 1
What should I do?

it is likely too hard to build by newbie.
I give up to build GSI rom.

Related

Help with ubuntu vm for cm7

I have jdk installed. Working on sdk. When I run android from tools I get command not found. I think the problem is I have to add platforms dir to path. Can somebody please tell me how, or if u think the problem is something else then what? Thanks everyone.
main problem is 32-bit adb playing nice in 64-bit linux install. general issue discussed here: https://help.ubuntu.com/community/32bit_and_64bit
i would try using getlibs to install required 32-bit library files and dependencies, follow instructions here, except you use "getlibs adb" in the "platform-tools" directory, should get something like this:
Code:
The following extra packages will be installed:
lib32asound2 lib32bz2-1.0 lib32gcc1 lib32ncurses5 lib32ncursesw5
lib32stdc++6 lib32v4l-0 lib32z1 libc6-i386
Suggested packages:
lib32asound2-plugins
The following NEW packages will be installed:
ia32-libs lib32asound2 lib32bz2-1.0 lib32gcc1 lib32ncurses5 lib32ncursesw5
lib32stdc++6 lib32v4l-0 lib32z1 libc6-i386
otherwise set your path environment variables like here, and set up udev for nook color per instructions here.
it's a real PITA, worse comes to worse use whatever adb you have working to get the propietary files and move it into your linux install and move on with the build.
hth
MedLine said:
main problem is 32-bit adb playing nice in 64-bit linux install. general issue discussed here: https://help.ubuntu.com/community/32bit_and_64bit
i would try using getlibs to install required 32-bit library files and dependencies, follow instructions here, except you use "getlibs adb" in the "platform-tools" directory, should get something like this:
Code:
The following extra packages will be installed:
lib32asound2 lib32bz2-1.0 lib32gcc1 lib32ncurses5 lib32ncursesw5
lib32stdc++6 lib32v4l-0 lib32z1 libc6-i386
Suggested packages:
lib32asound2-plugins
The following NEW packages will be installed:
ia32-libs lib32asound2 lib32bz2-1.0 lib32gcc1 lib32ncurses5 lib32ncursesw5
lib32stdc++6 lib32v4l-0 lib32z1 libc6-i386
otherwise set your path environment variables like here, and set up udev for nook color per instructions here.
it's a real PITA, worse comes to worse use whatever adb you have working to get the propietary files and move it into your linux install and move on with the build.
hth
Click to expand...
Click to collapse
I don't have a platforms-tools directory. I skipped the install of eclipse because it said it was optional. I'm trying to install it now. When i tyoe getlibs aapt.from the tools directory like the articles says, all I get r the syntax command options.
newellj79 said:
I don't have a platforms-tools directory. I skipped the install of eclipse because it said it was optional. I'm trying to install it now. When i tyoe getlibs aapt.from the tools directory like the articles says, all I get r the syntax command options.
Click to expand...
Click to collapse
When you install adb, you should see ~/android-sdk-linux_x86/platform-tools/. I added the following line to ~/.profile to place it (and ~/bin) in my $PATH:
PATH=$HOME/android-sdk-linux_x86/platform-tools:$HOME/bin:$PATH
bigbob23 said:
When you install adb, you should see ~/android-sdk-linux_x86/platform-tools/. I added the following line to ~/.profile to place it (and ~/bin) in my $PATH:
PATH=$HOME/android-sdk-linux_x86/platform-tools:$HOME/bin:$PATH
Click to expand...
Click to collapse
Ok. Ill try to press on and figure how to get adb installed. Hopefully after I get that installed I can run getlibs which my understanding is will allow me to then run android from /tools.
Edit.. back to original problem. I can't install adb because I can't run sdk. When i type android
in /tools I get command not found. I can't run getlibs on the platforms-tools directory becuz it doesn't exist, and getlibs aapt in /tools as suggested in the referenced link does nothing but show getlibs help. Grrr. What am I missing!!!
newellj79 said:
Ok. Ill try to press on and figure how to get adb installed. Hopefully after I get that installed I can run getlibs which my understanding is will allow me to then run android from /tools.
Click to expand...
Click to collapse
Where the instructions http://wiki.cyanogenmod.com/wiki/Howto:_Install_the_Android_SDK say to install ADB, you are really installing the SDK. This includes ~/android-sdk-linux_x86/tools.
bigbob23 said:
Where the instructions http://wiki.cyanogenmod.com/wiki/Howto:_Install_the_Android_SDK say to install ADB, you are really installing the SDK. This includes ~/android-sdk-linux_x86/tools.
Click to expand...
Click to collapse
****. Thank you! I was typing android not ./android. My apologies! Please disregard all above posted problems
edit... my mistake
Ok, hopefully this is the last bit of help I need. I successfully made it to the configue build and compile. I get /bin/bash: bison: command not found, a bunch of times, i get 64-bit build environment is needed beyond froyo and I'm in 32, then i get a whole lot of no file or directory. I'm going to try and paste the output here, this is after all the "including"s. thanks
/bin/bash: bison: command not found
/bin/bash: bison: command not found
/bin/bash: bison: command not found
/bin/bash: bison: command not found
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.3.4
TARGET_PRODUCT=cyanogen_encore
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=GINGERBREAD
============================================
/bin/bash: bison: command not found
The program 'schedtool' is currently not installed. You can install it by typing:
sudo apt-get install schedtool
[email protected]:~/android/system$ sudo apt-get install schedtool
[sudo] password for newellj79:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-2.6.38-8 linux-headers-2.6.38-8-generic
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
schedtool
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 24.7 kB of archives.
After this operation, 86.0 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ natty/universe schedtool i386 1.3.0-1 [24.7 kB]
Fetched 24.7 kB in 0s (36.4 kB/s)
Selecting previously deselected package schedtool.
(Reading database ... 161913 files and directories currently installed.)
Unpacking schedtool (from .../schedtool_1.3.0-1_i386.deb) ...
Processing triggers for man-db ...
Setting up schedtool (1.3.0-1) ...
[email protected]:~/android/system$ . build/envsetup.sh && brunch encore
including device/advent/vega/vendorsetup.sh
including device/bn/encore/vendorsetup.sh
including device/geeksphone/one/vendorsetup.sh
including device/htc/ace/vendorsetup.sh
including device/htc/bravoc/vendorsetup.sh
including device/htc/bravo/vendorsetup.sh
including device/htc/buzz/vendorsetup.sh
including device/htc/click/vendorsetup.sh
including device/htc/desirec/vendorsetup.sh
including device/htc/dream_sapphire/vendorsetup.sh
including device/htc/espresso/vendorsetup.sh
including device/htc/glacier/vendorsetup.sh
including device/htc/heroc/vendorsetup.sh
including device/htc/hero/vendorsetup.sh
including device/htc/inc/vendorsetup.sh
including device/htc/legend/vendorsetup.sh
including device/htc/leo/vendorsetup.sh
including device/htc/liberty/vendorsetup.sh
including device/htc/mecha/vendorsetup.sh
including device/htc/passion/vendorsetup.sh
including device/htc/speedy/vendorsetup.sh
including device/htc/supersonic/vendorsetup.sh
including device/htc/vision/vendorsetup.sh
including device/htc/vivo/vendorsetup.sh
including device/htc/vivow/vendorsetup.sh
including device/huawei/u8220/vendorsetup.sh
including device/lge/p999/vendorsetup.sh
including device/lge/thunderg/vendorsetup.sh
including device/malata/smb_a1002/vendorsetup.sh
including device/malata/smb_b9701/vendorsetup.sh
including device/motorola/droid2/vendorsetup.sh
including device/motorola/jordan/vendorsetup.sh
including device/motorola/morrison/vendorsetup.sh
including device/motorola/shadow/vendorsetup.sh
including device/motorola/sholes/vendorsetup.sh
including device/motorola/zeppelin/vendorsetup.sh
including device/samsung/captivatemtd/vendorsetup.sh
including device/samsung/crespo4g/vendorsetup.sh
including device/samsung/crespo/vendorsetup.sh
including device/samsung/fascinatemtd/vendorsetup.sh
including device/samsung/galaxys2/vendorsetup.sh
including device/samsung/galaxysmtd/vendorsetup.sh
including device/samsung/sidekick4g/vendorsetup.sh
including device/samsung/vibrantmtd/vendorsetup.sh
including device/zte/blade/vendorsetup.sh
including vendor/cyanogen/vendorsetup.sh
including vendor/cyanogen/vendorsetup.sh
/bin/bash: bison: command not found
/bin/bash: bison: command not found
/bin/bash: bison: command not found
/bin/bash: bison: command not found
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.3.4
TARGET_PRODUCT=cyanogen_encore
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=GINGERBREAD
============================================
/bin/bash: bison: command not found
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.3.4
TARGET_PRODUCT=cyanogen_encore
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=GINGERBREAD
============================================
/bin/bash: bison: command not found
Checking build tools versions...
build/core/main.mk:76: ************************************************************
build/core/main.mk:77: You are attempting to build on a 32-bit system.
build/core/main.mk:78: Only 64-bit build environments are supported beyond froyo/2.2.
build/core/main.mk:79: ************************************************************
diff: out/target/product/encore/obj/PACKAGING/updater_extensions_intermediates/register.inc.list: No such file or directory
find: `out/target/common/docs/gen': No such file or directory
find: `out/target/common/docs/gen': No such file or directory
find: `out/target/common/docs/gen': No such file or directory
find: `out/target/common/docs/gen': No such file or directory
find: `out/target/common/docs/gen': No such file or directory
build/core/Makefile:21: warning: overriding commands for target `out/target/product/encore/system/etc/wifi/tiwlan.ini'
build/core/base_rules.mk:479: warning: ignoring old commands for target `out/target/product/encore/system/etc/wifi/tiwlan.ini'
build/core/Makefile:21: warning: overriding commands for target `out/target/product/encore/system/lib/hw/overlay.omap3.so'
build/core/base_rules.mk:479: warning: ignoring old commands for target `out/target/product/encore/system/lib/hw/overlay.omap3.so'
build/core/Makefile:21: warning: overriding commands for target `out/target/product/encore/system/lib/libLCML.so'
build/core/base_rules.mk:479: warning: ignoring old commands for target `out/target/product/encore/system/lib/libLCML.so'
build/core/Makefile:21: warning: overriding commands for target `out/target/product/encore/system/lib/libbridge.so'
build/core/base_rules.mk:479: warning: ignoring old commands for target `out/target/product/encore/system/lib/libbridge.so'
build/core/Makefile:21: warning: overriding commands for target `out/target/product/encore/system/lib/libOMX.TI.Video.Decoder.so'
build/core/base_rules.mk:479: warning: ignoring old commands for target `out/target/product/encore/system/lib/libOMX.TI.Video.Decoder.so'
build/core/Makefile:21: warning: overriding commands for target `out/target/product/encore/system/lib/libOMX.TI.AAC.encode.so'
build/core/base_rules.mk:479: warning: ignoring old commands for target `out/target/product/encore/system/lib/libOMX.TI.AAC.encode.so'
build/core/Makefile:21: warning: overriding commands for target `out/target/product/encore/system/lib/libOMX.TI.Video.encoder.so'
build/core/base_rules.mk:479: warning: ignoring old commands for target `out/target/product/encore/system/lib/libOMX.TI.Video.encoder.so'
build/core/Makefile:21: warning: overriding commands for target `out/target/product/encore/system/lib/libOMX_Core.so'
build/core/base_rules.mk:479: warning: ignoring old commands for target `out/target/product/encore/system/lib/libOMX_Core.so'
build/core/Makefile:21: warning: overriding commands for target `out/target/product/encore/system/lib/libOMX.TI.WBAMR.encode.so'
build/core/base_rules.mk:479: warning: ignoring old commands for target `out/target/product/encore/system/lib/libOMX.TI.WBAMR.encode.so'
build/core/Makefile:21: warning: overriding commands for target `out/target/product/encore/system/lib/libOMX.TI.AMR.encode.so'
build/core/base_rules.mk:479: warning: ignoring old commands for target `out/target/product/encore/system/lib/libOMX.TI.AMR.encode.so'
build/core/Makefile:21: warning: overriding commands for target `out/target/product/encore/system/lib/egl/libGLES_android.so'
build/core/base_rules.mk:479: warning: ignoring old commands for target `out/target/product/encore/system/lib/egl/libGLES_android.so'
No private recovery resources for TARGET_DEVICE encore
Header: out/host/linux-x86/obj/include/libexpat/expat.h
Header: out/host/linux-x86/obj/include/libexpat/expat_external.h
Header: out/target/product/encore/obj/include/libexpat/expat.h
Header: out/target/product/encore/obj/include/libexpat/expat_external.h
Header: out/host/linux-x86/obj/include/libpng/png.h
Header: out/host/linux-x86/obj/include/libpng/pngconf.h
Header: out/host/linux-x86/obj/include/libpng/pngusr.h
Header: out/target/product/encore/obj/include/libpng/png.h
Header: out/target/product/encore/obj/include/libpng/pngconf.h
Header: out/target/product/encore/obj/include/libpng/pngusr.h
Header: out/target/product/encore/obj/include/libsonivox/eas.h
Header: out/target/product/encore/obj/include/libsonivox/eas_types.h
Header: out/target/product/encore/obj/include/libsonivox/eas_reverb.h
Header: out/target/product/encore/obj/include/libsonivox/jet.h
Header: out/target/product/encore/obj/include/libsonivox/ARM_synth_constants_gnu.inc
Header: out/target/product/encore/obj/include/libwpa_client/wpa_ctrl.h
host C: mkimage <= system/extras/mkimage/mkimage.c
host C: mkimage <= system/extras/mkimage/crc32.c
system/extras/mkimage/crc32.c:11:18: fatal error: zlib.h: No such file or directory
compilation terminated.
make: *** [out/host/linux-x86/obj/EXECUTABLES/mkimage_intermediates/crc32.o] Error 1
[email protected]:~/android/system$
newellj79 said:
Ok, hopefully this is the last bit of help I need. I successfully made it to the configue build and compile. I get /bin/bash: bison: command not found, a bunch of times, i get 64-bit build environment is needed beyond froyo and I'm in 32, then i get a whole lot of no file or directory. I'm going to try and paste the output here, this is after all the "including"s. thanks
/bin/bash: bison: command not found
system/extras/mkimage/crc32.c:11:18: fatal error: zlib.h: No such file or directory
Click to expand...
Click to collapse
Try 'sudo apt-get install bison zlib1g-dev'
brahahahahaha
you need 64-bit UBuntu: http://groups.google.com/group/android-building/browse_thread/thread/852d63ab6124c87e?pli=1
actually it's not funny because i did the same thing. cloned the entire cm7 gingerbread branch and the whole shebang in Ubuntu 32-bit only to find in the end that Ubuntu 64-bit required.
basically you have to start over. after installing Ubuntu 64-bit, you may run into trouble setting up adb, do yourself a favor and zip up the propietary files you already pulled, just in case, otherwise you're basically there.
good luck.
MedLine said:
brahahahahaha
you need 64-bit UBuntu: http://groups.google.com/group/android-building/browse_thread/thread/852d63ab6124c87e?pli=1
actually it's not funny because i did the same thing. cloned the entire cm7 gingerbread branch and the whole shebang in Ubuntu 32-bit only to find in the end that Ubuntu 64-bit required.
basically you have to start over. after installing Ubuntu 64-bit, you may run into trouble setting up adb, do yourself a favor and zip up the propietary files you already pulled, just in case, otherwise you're basically there.
good luck.
Click to expand...
Click to collapse
Golly. Thank you all kind sirs. I had such problems getting adb to work right I hope I can getit going again. Downloading now.
Any ideas here. Im using vmware which says it supports 32 and 64bit installs. I downloaded Ubuntu 64bit. When I try to make a new vm it says my system does not support 64bit. Please help. (All under 64bit windows 7)
got me on that one. my set up as well, Ubuntu 11.04 (64-bit) in VMWare Workstation 7 on a Windows 7 SP1 (64-bit). downloaded "ubuntu-11.04-desktop-amd64.iso" and VMWare went straight to "Easy Install" and did everything by itself.
sounds like you got pretty far with the build. except for setting up adb, should be smooth sailing once you get the VMWare issue sorted out. to build you really only need adb to run extract-files.sh. if you did this you already have the proprietary files in "/system/vendor/bn/encore/proprietary". for time being you can always zip that up and copy to Ubuntu 64-bit install, if adb proves impossible.
MedLine said:
got me on that one. my set up as well, Ubuntu 11.04 (64-bit) in VMWare Workstation 7 on a Windows 7 SP1 (64-bit). downloaded "ubuntu-11.04-desktop-amd64.iso" and VMWare went straight to "Easy Install" and did everything by itself.
sounds like you got pretty far with the build. except for setting up adb, should be smooth sailing once you get the VMWare issue sorted out. to build you really only need adb to run extract-files.sh. if you did this you already have the proprietary files in "/system/vendor/bn/encore/proprietary". for time being you can always zip that up and copy to Ubuntu 64-bit install, if adb proves impossible.
Click to expand...
Click to collapse
Ill see what I can do tommorrow after work. I've heard of maybe of maybe using wubi too. But I really liked the vmware setup.
I got Ubuntu 64 bit installed using wubi. I think something went wrong with jdk install. When I run. /android it says Java not found. I am suppose to use the ...64 jdk right? N e ways can someone please tell me how to uninstall jdk so I can reinstall it? When I just try to install again it says something to the effect of directory already exists. Thanks again!!
Edit... a Google search shows i just need to delete the directory. So ill do that and try reinstalling it later tonight.
if ./android didn't run script you probably don't have jdk installed.
easiest way to install jdk in Ubuntu 11.04 is use Synaptic Package Manager:
1. System > Administration > Synaptic Package Manager
2. Settings > Repositories > Other Software
3. Check "Canonical Partners" > Close > Reload
4. Quick Filter > type "sun-java6-jdk"
5. Right click sun-java6-jdk > Mark for Installation
6. Apply
MedLine said:
if ./android didn't run script you probably don't have jdk installed.
easiest way to install jdk in Ubuntu 11.04 is use Synaptic Package Manager:
1. System > Administration > Synaptic Package Manager
2. Settings > Repositories > Other Software
3. Check "Canonical Partners" > Close > Reload
4. Quick Filter > type "sun-java6-jdk"
5. Right click sun-java6-jdk > Mark for Installation
6. Apply
Click to expand...
Click to collapse
Awesome. Will try. Family reunion this weekend so I wont get much done untilled Sunday night or Monday. But please stick around.
Back from vaca and need help. I got 64 bit ubuntu setup. ADB and sdk running. When i get to repo init in the cm7 compile guide i get the following error. Please help...
[email protected]:~$ cd ~/android/system/
[email protected]:~/android/system$ repo init -u git://github.com/CyanogenMod/android.git -b gingerbread
Traceback (most recent call last):
File "/home/newellj79/bin/repo", line 603, in <module>
main(sys.argv[1:])
File "/home/newellj79/bin/repo", line 570, in main
_Init(args)
File "/home/newellj79/bin/repo", line 184, in _Init
_CheckGitVersion()
File "/home/newellj79/bin/repo", line 213, in _CheckGitVersion
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
File "/usr/lib/python2.7/subprocess.py", line 672, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1213, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
[email protected]:~/android/system$
edit... figured it out. i had to use synapatic to install the listed libraries. duh... i could not find sun-java6-jdk though. I did add the partner repository line as stated. anyways i'm running repo sync right now. will see what happens..
one of the packages didn't get installed, just redo it:
Code:
sudo apt-get installgit-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev sun-java6-jdk pngcrush schedtool
cm7 repo should then initialize properly

[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.

[Q] Anybody know what I'm doing wrong? Need a hand with building.

I can't get it to build properly, I'm not sure if the toolchain version I'm using or what but I'm stalled. Any help would be greatly appreciated.
[email protected]:~$ cd ~/android/kernel/msm
[email protected]:~/android/kernel/msm$ export ARCH=arm
[email protected]:~/android/kernel/msm$ export SUBARCH=arm
[email protected]:~/android/kernel/msm$ export CROSS_COMPILE=arm-linux-androideabi-
[email protected]:~/android/kernel/msm$ make mako_defconfig
warning: (ARCH_MSM_KRAITMP && ARCH_MSM_CORTEX_A5) selects HAVE_HW_BRKPT_RESERVED_RW_ACCESS which has unmet direct dependencies (HAVE_HW_BREAKPOINT)
warning: (ARCH_MSM_KRAITMP && ARCH_MSM_CORTEX_A5) selects HAVE_HW_BRKPT_RESERVED_RW_ACCESS which has unmet direct dependencies (HAVE_HW_BREAKPOINT)
#
# configuration written to .config
#
[email protected]:~/android/kernel/msm$ make -j4
scripts/kconfig/conf --silentoldconfig Kconfig
warning: (ARCH_MSM_KRAITMP && ARCH_MSM_CORTEX_A5) selects HAVE_HW_BRKPT_RESERVED_RW_ACCESS which has unmet direct dependencies (HAVE_HW_BREAKPOINT)
warning: (ARCH_MSM_KRAITMP && ARCH_MSM_CORTEX_A5) selects HAVE_HW_BRKPT_RESERVED_RW_ACCESS which has unmet direct dependencies (HAVE_HW_BREAKPOINT)
CHK include/linux/version.h
HOSTCC scripts/bin2c
CC scripts/mod/empty.o
HOSTCC scripts/mod/mk_elfconfig
arm-linux-androideabi-gcc: No such file or directory
Is your PATH set correctly?
make[2]: *** [scripts/mod/empty.o] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [scripts/mod] Error 2
make: *** [scripts] Error 2
make: *** Waiting for unfinished jobs....
[email protected]:~/android/kernel/msm$
Bump
I would guess that you have not defined the path to the actual toolchain. I recommend a build script - it's much faster than typing everything in and saves you from typing mistakes. Create the file /android/kernel/buildscript.sh, make it executable and add
Code:
cd msm
export PATH=$PATH:~/android/toolchain/arm-linux-androideabi-4.6/bin
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=arm-linux-androideabi-
make clean
make mako_defconfig
make -j6
This assumes that the kernel makefile is located in /android/kernel/msm/makefile The important line is 'export PATH=$PATH:~/android/toolchain/arm-linux-androideabi-4.6/bin' (depending on where your toolchain actually resides). This tells make where to look for the arm-linux-androideabi- binaries. For further info, I recommend this guide.
XDA_Bam said:
I would guess that you have not defined the path to the actual toolchain. I recommend a build script - it's much faster than typing everything in and saves you from typing mistakes. Create the file /android/kernel/buildscript.sh, make it executable and add
Code:
cd msm
export PATH=$PATH:~/android/toolchain/arm-linux-androideabi-4.6/bin
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=arm-linux-androideabi-
make clean
make mako_defconfig
make -j6
This assumes that the kernel makefile is located in /android/kernel/msm/makefile The important line is 'export PATH=$PATH:~/android/toolchain/arm-linux-androideabi-4.6/bin' (depending on where your toolchain actually resides). This tells make where to look for the arm-linux-androideabi- binaries. For further info, I recommend this guide.
Click to expand...
Click to collapse
Same problem here. On Ubuntu and Mac OS. No idea what's causing it, the path seems to be OK and pointing to the right file, if I try to execute it on its own, it will say: cannot execute binary file
You couldn't ask for a clearer error message. The build system wants to call "arm-linux-androideabi-gcc", but this program can't be found (executable isn't in the $PATH directory list).
As someone else told you, you must add this to your path. On my computer I would write:
Code:
PATH="$PATH:/Volumes/android/cm10.1/prebuilts/gcc/darwin-x86/arm/arm-linux-androideabi-4.6/bin"
But I'm not building the same thing you are (or using the same method). You'll need to follow whatever procedure is recommended for that project.
fenstre said:
You couldn't ask for a clearer error message. The build system wants to call "arm-linux-androideabi-gcc", but this program can't be found (executable isn't in the $PATH directory list).
As someone else told you, you must add this to your path. On my computer I would write:
Code:
PATH="$PATH:/Volumes/android/cm10.1/prebuilts/gcc/darwin-x86/arm/arm-linux-androideabi-4.6/bin"
But I'm not building the same thing you are (or using the same method). You'll need to follow whatever procedure is recommended for that project.
Click to expand...
Click to collapse
Like I said before, it's IN the PATH. The problem appears to be that this is a 64-bit only binary, on my Ubuntu test case it was a 32-bit OS, but on the Mac it doesn't make sense at all since it's Mountain Lion --> x86_64.
Same Problem Here
I just compiled yesterday on debian testing reinstalled the same OS for other reasons, pulled git, tried to build and get the same error. I have PATH set correctly and can run arm-eabi-gcc --version no problem from any directory. I have multiarch setup with both x86-64 and i386. The only difference between today and yesterday is I switched from GNOME 3 to window maker and switched from xterm to aterm.
Anybody got a clue whats going wrong here yet?? :crying::crying:
Got It to Work (At lease for me)
On my Debian box I setup by doing apt-get install make git libncurses5 figuring everything else was in google's toolchain. Well today I installed kernel-package which installs build-essentials and installed libncurses-dev now I still get the unmet dependencies error but am able to do make menuconfig and make and build just fine now. If you are on OS X I suggest googling debian package search, search for build-essentials and use MacPorts or Brew (depending on your preference) to install as many of those utilities as you can. :good:

[Guide][G800F/M/Y][7.1.2][UNOFFICIAL] Build Slim ROM 7 Nougat from Source

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

[Q] Issues with porting OmniROM to Nubia Z18 (NX606J)

Hi,
since last week I've been trying to port Omni to the ZTE nubia Z18 (NX606J) with more or less success but a few more obstacles to clear.
Basically, what I'm stuck at at the moment is the final make to build the actual ROM itself, but it's a bit more than that.. but first things first:
- I initialized the repo from OmniRom's android repository on GitHub and successfully ran repo sync
Code:
repo init -u git://github.com/omnirom/android.git -b android-9.0 && repo sync -j `nproc` -c -f --no-clone-bundle
- I cloned the device's config from youyim123's GitHub into device/nubia/nx606j, as per the envsetup.mk (so it finds the appropriate vendorsetup)
Code:
git clone https://github.com/youyim123/android_device_nubia_nx609j.git -b master
- I run . build/envsetup.sh and then lunch omni-nx606j-eng which produces
Code:
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=9
TARGET_PRODUCT=omni_nx606j
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=kryo
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=cortex-a53
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.18.16-96.current-x86_64-Solus-3.9999
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=PD1A.180720.031
OUT_DIR=/run/media/curtisy/Solus-Data/Omni_NX606J/out
============================================
- I run make clean && make -j4, this works for a while and then exits with of the following error:
Code:
ninja: error: 'prebuilts/ndk/current/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libunwind.a', needed by '/run/media/curtisy/Solus-Data/Omni_NX606J/out/soong/.intermediates/external/boringssl/libcrypto/android_arm_armv8-a_cortex-a53_core_shared/libcrypto.so', missing and no known rule to make it
20:00:44 ninja failed with: exit status 1
I see it's missing some files, but repo sync again, doesn't help either, so I'm lost.
One pretty weird thing I noticed is that the second ninja step is only showing 55/56 as done but still continues. Is this normal?
Code:
[1/1] /run/media/curtisy/Solus-Data/Om...X606J/out/soong/.bootstrap/build.ninja
[55/56] glob prebuilts/ndk/stl.bp
[77/77] /run/media/curtisy/Solus-Data/...Data/Omni_NX606J/out/soong/build.ninja
Running make recoveryimage worked once, but when I tried flashing that, my device said it wasn't trusted and I had to reflash the source image again.
I'm really hitting a dead end with my little knowledge here, so it would be cool if anyone could point me in the right direction so I could at least get TWRP to work.
The phone has a Snapdragon 845. If you need any additional information, feel free to ask as I'm happy about any straw I can grab here.
Update: I somehow got around this issue doing another repo sync but now I'm prompted with another issue.
Code:
[945/945] including vendor/omni/Android.mk ...
packages/apps/Bluetooth/Android.mk: error: Bluetooth (APPS android-arm) missing libbluetooth_jni (SHARED_LIBRARIES android-arm)
Available variants:
libbluetooth_jni (SHARED_LIBRARIES android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
build/make/core/main.mk:833: error: exiting from previous errors.
03:34:57 ckati failed with: exit status 1
Or with ALLLOW_MISSING_DEPENDENCIES=true
Code:
[ 99% 1390/1391] glob vendor/omni/overlay/common/**/*
ninja: error: '/run/media/curtisy/Solus-Data/omni_nx606j/out/target/product/nx606j/obj_arm/SHARED_LIBRARIES/libbluetooth_jni_intermediates/link_type', needed by '/run/media/curtisy/Solus-Data/omni_nx606j/out/target/product/nx606j/obj/APPS/Bluetooth_intermediates/2ND_jni_link_type', missing and no known rule to make it
03:39:28 ninja failed with: exit status 1
For reference, this is the kernel source and this is the device specific source I'm currently using.
curtisy said:
Update: I somehow got around this issue doing another repo sync but now I'm prompted with another issue.
Code:
[945/945] including vendor/omni/Android.mk ...
packages/apps/Bluetooth/Android.mk: error: Bluetooth (APPS android-arm) missing libbluetooth_jni (SHARED_LIBRARIES android-arm)
Available variants:
libbluetooth_jni (SHARED_LIBRARIES android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
build/make/core/main.mk:833: error: exiting from previous errors.
03:34:57 ckati failed with: exit status 1
Or with ALLLOW_MISSING_DEPENDENCIES=true
Code:
[ 99% 1390/1391] glob vendor/omni/overlay/common/**/*
ninja: error: '/run/media/curtisy/Solus-Data/omni_nx606j/out/target/product/nx606j/obj_arm/SHARED_LIBRARIES/libbluetooth_jni_intermediates/link_type', needed by '/run/media/curtisy/Solus-Data/omni_nx606j/out/target/product/nx606j/obj/APPS/Bluetooth_intermediates/2ND_jni_link_type', missing and no known rule to make it
03:39:28 ninja failed with: exit status 1
For reference, this is the kernel source and this is the device specific source I'm currently using.
Click to expand...
Click to collapse
How do for fix?

Categories

Resources