Related
Arch Linux is a rolling release distribution, but Android requires you to have jdk6 (or openjdk6) and python2 to build it. It took me some time to setup everything, and I hope this guide will be useful to anyone who's trying to do the same.
The ArchWiki is a bit outdated. Among other things, it suggests changing the "python" symlink to point to python2, which I didn't want to do as it could cause problems ("python" is supposed to point to python3). Also, Arch Linux uses openjdk7, so you'd have to downgrade to openjdk6 (or Oracle's jdk6) - which isn't mentioned in the Wiki, and is something I'd rather avoid as I want to keep using the latest version.
Basically, I'd like to share this here for now to get some input, and later update the ArchWiki.
0- Quick note about this guide
I think it's pretty safe to assume you're familiar with the terminal.
Also note that this guide will not really talk about how to actually build Android, it's focused on setting up your Arch distro to do so in an easy way.
1- Prerequisites
The ArchWiki covers installing the Android SDK and ADB pretty well.
You'll need these packages for building Android:
Code:
git gnupg flex bison gperf sdl wxgtk squashfs-tools curl ncurses zlib schedtool perl-switch zip unzip
And for 64 bit systems (make sure multilib is enabled):
Code:
lib32-zlib lib32-ncurses lib32-readline gcc-libs-multilib gcc-multilib lib32-gcc-libs
You also need the "repo" utility, which is available in the AUR.
2- Setting up Java
The AUR has packages that should install alongside openjdk7, but that didn't work for me and I found it easier to simply install jdk6 independently of pacman's packages.
To do so, download the latest Linux .bin file (jdk-6u45-linux-x64.bin), and place it in /opt (run a root shell, "sudo bash"):
Code:
cp ~/Downloads/jdk-6u45-linux-x64.bin
Make it executable and run it as root:
Code:
cd /opt
chmod +x jdk-6u45-linux-x64.bin
./jdk-6u45-linux-x64.bin
We'll be updating our path before building to use this version.
3- Setting up Python
We're going to create a python symlink to python2, and place it in /opt/android-build. We'll use this later by updating our path when necessary.
Code:
mkdir /opt/android-build
cd /opt/android-build
ln -s $(which python2) python
4- (Temporarily) Setting up our PATH to test if everything's fine
We just installed jdk6 and made a symlink to python2, but we still need to update our path. In this step, we'll do that in order to test that everything's fine:
Code:
export PATH="/opt/android-build:/opt/jdk1.6.0_45/bin:$PATH"
Make sure jdk6 and python2 are being used:
Code:
echo -n $(python -V)
echo -n $(java -version)
The output should be similar to:
Code:
Python [COLOR="Red"]2[/COLOR].x.x
java version "1.[COLOR="Red"]6[/COLOR].xx"
Java(TM) SE Runtime Environment (build 1.[COLOR="Red"]6[/COLOR].xx)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
5- Make a build script (or just build).
I'd highly suggest making a build script and placing it in ~/bin. You can then easily run it, and it will take care of everything.
Otherwise, you can run this in the terminal every time before building:
Code:
export PATH="/opt/android-build:/opt/jdk1.6.0_45/bin:$PATH"
And then proceed normally, for example:
Code:
. build/envsetup.sh
lunch cyanogen_cooperve-eng
make clean
time make -j6 bacon
This is my (trimmed down to remove some git revert checks) personal build script, you can modify it to fit your needs. The working directory is your home folder, change the "path" variable around the middle if yours is different.
Code:
Help() {
echo -n "Usage: build [OPTIONS]
-h, --help show this screen
-s, --sync run repo sync before building
-c, --clean make clean"
echo
}
box () {
tput setaf 6
echo
str="[email protected]"
len=$((${#1}+4))
for ((i = 1; i <= $len; i++)); do
echo -n '*'
done
echo
echo "* $str *"
for ((i = 1; i <= $len; i++)); do
echo -n '*'
done
echo
tput sgr0
}
path="/home/germain/"
sync=0
clean=0
while :; do
case $1 in
-h | --help)
Help
exit 0
;;
-s | --sync)
sync=1
shift
;;
-c | --clean)
clean=1
shift
;;
--)
shift
break
;;
-*)
echo "Unknown option $1, ignoring" >&2
shift
;;
*)
break
;;
esac
done
clear
box "Setting up \$PATH..."
export PATH="/opt/android-build:/opt/jdk1.6.0_45/bin:$PATH"
echo -n $(python -V)
echo -n $(java -version)
cd "$path"
(( "$sync"==1 )) && box "Syncing..." && repo sync -j64
box "Starting build..."
. build/envsetup.sh
lunch cyanogen_cooperve-eng
(( "$clean"==1 )) && box "Clean build!" && echo && make clean
time make -j6 bacon
box "Done!"
To set it up:
Code:
nano ~/bin/build
<copy the above script, press SHIFT + INSERT to paste, and CTRL+X followed by "Y" to save>
chmod +x ~/bin/build
Usage:
Code:
Usage: build [OPTIONS]
-h, --help show this screen
-s, --sync run repo sync before building
-c, --clean make clean
Sources
These web pages helped me a lot.
http://f0rki.at/building-android-on-arch-linux-x86_64.html
https://wiki.archlinux.org/index.php/Android
https://bbs.archlinux.org/viewtopic.php?id=131939
Good job dude. I already use Arch Linux for developing Android firmware but I haven't the time to make one tutorial for others.:laugh:
Thanks for the guide, but even after I have set the correct java path, (java -version shows Java SE), while building, it still gives a warning that I'm building with Java 1.7 (openjdk). Any pointers?
Checking build tools versions...
************************************************************
You are attempting to build with an unsupported version
of java.
Your version is: java version "1.7.0_21".
The correct version is: Java SE 1.6 or 1.7.
Please follow the machine setup instructions at
https://source.android.com/source/download.html
EDIT: NVM. Fixed by exporting JAVA_HOME and J2SDKDIR
Geat job GermainZ!
The packages in the AUR which should install alongside openjdk7 should work (it works for me) if you:
Code:
export PATH="/opt/java6/bin:$PATH"
Then (as you mention) you can check by:
Code:
echo -n $(java -version)
Anyway thanks for the guide, I think it is definitely worth updating the Arch Wiki to include this information!
marno11 said:
Geat job GermainZ!
The packages in the AUR which should install alongside openjdk7 should work (it works for me) if you:
Code:
export PATH="/opt/java6/bin:$PATH"
Then (as you mention) you can check by:
Code:
echo -n $(java -version)
Anyway thanks for the guide, I think it is definitely worth updating the Arch Wiki to include this information!
Click to expand...
Click to collapse
I see they were recently updated. They weren't building for me at the time, and I didn't have enough time to check the PKGBUILD.
I'll do my best to update the wiki when I can, including both options. Thanks.
Thanks for putting this up, I landed on this after following the link in the Arch wiki.
I have a suggestion concerning point 3 (python). Wouldn't it be more sane to use python's virtualenv to set up a python distro for Android?
And BTW, I am trying out the new android-studio, which works for me out of the box, even with openjdk7. Just make sure you install openjdk7-src as Java sources are not (yet) in the dependencies of the android-studio package from the AUR.
stammler said:
Thanks for putting this up, I landed on this after following the link in the Arch wiki.
I have a suggestion concerning point 3 (python). Wouldn't it be more sane to use python's virtualenv to set up a python distro for Android?
And BTW, I am trying out the new android-studio, which works for me out of the box, even with openjdk7. Just make sure you install openjdk7-src as Java sources are not (yet) in the dependencies of the android-studio package from the AUR.
Click to expand...
Click to collapse
So basically, create a python 2.7 virtualenv, activate and build from it?
Personally, I find that creating a symlink and adding it to your path (temporary) seems easier and requires no extra tools, but that's up to you. Have you tried it out? Can you please elaborate on why it would be preferable?
Thanks
i have to ask, instead of doing all these steps, wouldn't it be easier just to install BBQLinux and change the java version with a purge command and reinstall 1.6 ?
Warped420 said:
i have to ask, instead of doing all these steps, wouldn't it be easier just to install BBQLinux and change the java version with a purge command and reinstall 1.6 ?
Click to expand...
Click to collapse
Are you suggesting that installing a whole distro on top of the one you use, just to build ROMs, is easier than installing one package, making a symlink and prepending something to your path? Because if you think that's hard, then I must say Arch might be the wrong distro for you.
All these instructions should not take more than 2 minutes, excluding the download time (frankly, I spent most of my time deciding if I should get openjdk6 or java6, then customizing my build script (you can just use a bash profile which virtually takes no time to setup, but I needed some extra stuff)).
That being said, if you want to downgrade, you can also do it using Arch (get openjdk6 from the ARM (Arch Rollback Machine), install it, edit pacman.conf to ignore it - very straightforward to do). The whole point was not to, but you can.
??
Warped420 said:
not exactly, i build with Mint, I have 5 OS's on my drive at the moment, but i want to add Arch. And BBQ is supposed to be Arch made 4 us. Still having trouble getting it to boot, Its the kernel i think, error messages and str8 to black screen on a intel chip. tried no modset, video=SVIDEO-1:d, i915.modeset=0 , and acpi=off, no luck.
Click to expand...
Click to collapse
Well, this is meant for existing Arch users (and Arch is my main distro/OS - not Windows/...).
IMHO, Arch derived distros that add installers and packages go against the Arch philosophy, but whatever suits you. Anyway, I'd suggest asking the BBQLinux community since you're installing that, I can't help you in this thread. Good luck.
Ok i fixed it شكرا لكم على المساعدة
Warped420 said:
Ok then, i will stick to a Arch question, What is the Arch Philosophy ? and what makes it different from other distros?
Click to expand...
Click to collapse
Not to be mean, but this isn't an "Ask your Arch related enquiries" thread, and you're hijacking/off-topic.
Read the archwiki article on The Arch Way. There's also another article that compares Arch to other distros.
GermainZ said:
Arch Linux is a rolling release distribution, but Android requires you to have jdk6 (or openjdk6) and python2 to build it. It took me some time to setup everything, and I hope this guide will be useful to anyone who's trying to do the same.
The ArchWiki is a bit outdated. Among other things, it suggests changing the "python" symlink to point to python2, which I didn't want to do as it could cause problems ("python" is supposed to point to python3). Also, Arch Linux uses openjdk7, so you'd have to downgrade to openjdk6 (or Oracle's jdk6) - which isn't mentioned in the Wiki, and is something I'd rather avoid as I want to keep using the latest version.
Basically, I'd like to share this here for now to get some input, and later update the ArchWiki.
0- Quick note about this guide
I think it's pretty safe to assume you're familiar with the terminal.
Also note that this guide will not really talk about how to actually build Android, it's focused on setting up your Arch distro to do so in an easy way.
1- Prerequisites
The ArchWiki covers installing the Android SDK and ADB pretty well.
You'll need these packages for building Android:
Code:
git gnupg flex bison gperf sdl wxgtk squashfs-tools curl ncurses zlib schedtool perl-switch zip unzip
And for 64 bit systems (make sure multilib is enabled):
Code:
lib32-zlib lib32-ncurses lib32-readline gcc-libs-multilib gcc-multilib lib32-gcc-libs
You also need the "repo" utility, which is available in the AUR.
2- Setting up Java
The AUR has packages that should install alongside openjdk7, but that didn't work for me and I found it easier to simply install jdk6 independently of pacman's packages.
To do so, download the latest Linux .bin file (jdk-6u45-linux-x64.bin), and place it in /opt (run a root shell, "sudo bash"):
Code:
cp ~/Downloads/jdk-6u45-linux-x64.bin
Make it executable and run it as root:
Code:
cd /opt
chmod +x jdk-6u45-linux-x64.bin
./jdk-6u45-linux-x64.bin
We'll be updating our path before building to use this version.
3- Setting up Python
We're going to create a python symlink to python2, and place it in /opt/android-build. We'll use this later by updating our path when necessary.
Code:
mkdir /opt/android-build
cd /opt/android-build
ln -s $(which python2) python
4- (Temporarily) Setting up our PATH to test if everything's fine
We just installed jdk6 and made a symlink to python2, but we still need to update our path. In this step, we'll do that in order to test that everything's fine:
Code:
export PATH="/opt/android-build:/opt/jdk1.6.0_45/bin:$PATH"
Make sure jdk6 and python2 are being used:
Code:
echo -n $(python -V)
echo -n $(java -version)
The output should be similar to:
Code:
Python [COLOR="Red"]2[/COLOR].x.x
java version "1.[COLOR="Red"]6[/COLOR].xx"
Java(TM) SE Runtime Environment (build 1.[COLOR="Red"]6[/COLOR].xx)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
5- Make a build script (or just build).
I'd highly suggest making a build script and placing it in ~/bin. You can then easily run it, and it will take care of everything.
Otherwise, you can run this in the terminal every time before building:
Code:
export PATH="/opt/android-build:/opt/jdk1.6.0_45/bin:$PATH"
And then proceed normally, for example:
Code:
. build/envsetup.sh
lunch cyanogen_cooperve-eng
make clean
time make -j6 bacon
This is my (trimmed down to remove some git revert checks) personal build script, you can modify it to fit your needs. The working directory is your home folder, change the "path" variable around the middle if yours is different.
Code:
Help() {
echo -n "Usage: build [OPTIONS]
-h, --help show this screen
-s, --sync run repo sync before building
-c, --clean make clean"
echo
}
box () {
tput setaf 6
echo
str="[email protected]"
len=$((${#1}+4))
for ((i = 1; i <= $len; i++)); do
echo -n '*'
done
echo
echo "* $str *"
for ((i = 1; i <= $len; i++)); do
echo -n '*'
done
echo
tput sgr0
}
path="/home/germain/"
sync=0
clean=0
while :; do
case $1 in
-h | --help)
Help
exit 0
;;
-s | --sync)
sync=1
shift
;;
-c | --clean)
clean=1
shift
;;
--)
shift
break
;;
-*)
echo "Unknown option $1, ignoring" >&2
shift
;;
*)
break
;;
esac
done
clear
box "Setting up \$PATH..."
export PATH="/opt/android-build:/opt/jdk1.6.0_45/bin:$PATH"
echo -n $(python -V)
echo -n $(java -version)
cd "$path"
(( "$sync"==1 )) && box "Syncing..." && repo sync -j64
box "Starting build..."
. build/envsetup.sh
lunch cyanogen_cooperve-eng
(( "$clean"==1 )) && box "Clean build!" && echo && make clean
time make -j6 bacon
box "Done!"
To set it up:
Code:
nano ~/bin/build
<copy the above script, press SHIFT + INSERT to paste, and CTRL+X followed by "Y" to save>
chmod +x ~/bin/build
Usage:
Code:
Usage: build [OPTIONS]
-h, --help show this screen
-s, --sync run repo sync before building
-c, --clean make clean
Sources
These web pages helped me a lot.
http://f0rki.at/building-android-on-arch-linux-x86_64.html
https://wiki.archlinux.org/index.php/Android
https://bbs.archlinux.org/viewtopic.php?id=131939
Click to expand...
Click to collapse
Could i put this line in my .bashrc file? wouldn't this do the same thing....
export PATH="/opt/android-build:/opt/jdk1.6.0_45/bin:$PATH"
dantheman1977 said:
Could i put this line in my .bashrc file? wouldn't this do the same thing....
export PATH="/opt/android-build:/opt/jdk1.6.0_45/bin:$PATH"
Click to expand...
Click to collapse
Not exactly the same thing, considering calling 'python' will always direct to 'python2' and 'java' to java1.6, and not only when actually building.
Also, can you please not quote the whole post?
GermainZ said:
Not exactly the same thing, considering calling 'python' will always direct to 'python2' and 'java' to java1.6, and not only when actually building.
Also, can you please not quote the whole post?
Click to expand...
Click to collapse
Great guide.. !!
I had a problem with setting up JDK6 cause I already had OPENJDK7
So I did is
Code:
sudo pacman -Rndd jdk7-openjdk jre7-openjdk icedtea-web-java7 java-rhino jre7-openjdk-headless
and did what you said i.e. installed the binary and it works awesomely well ! .
Thanks for this tutorial! I learned android on ubuntu and ubuntu forks, so trying it on arch is totaly different ball game.
I have one remark:
you also need to install make-3.81 from AUR otherwise you get error:
build/core/main.mk:45: ********************************************************************************
build/core/main.mk:46: * You are using version 4.0 of make.
build/core/main.mk:47: * Android can only be built by versions 3.81 and 3.82.
build/core/main.mk:48: * see https://source.android.com/source/download.html
build/core/main.mk:49: ***************************************************************************
Click to expand...
Click to collapse
so I am using make-3.81 -j4 (have both versions of make on system)
or you can make use simlink a add to your path (similar as export PATH="/opt/android-build:$PATH")
Are you sure about that? https://gerrit.paranoidandroid.co/#/c/108/
absolutly - as you can see at my first post - it is warning message during trying to compile fROM few hours ago today. so yes, I am sure. you can try (I am trying KITKAT)
Did you try? with make-3.81 I do not have this error
---------- Post added at 06:23 PM ---------- Previous post was at 06:00 PM ----------
have another strange problem:
I have running custom kernel on my phone. I've downloaded sources from git, compile on my pc but --- kernel does not boot, immediatelly goes to reboot (compiling procces was successfull). So where the problem is I do not know.
Has anybody any idea? Can it be by bad toochains?
Linux 3.11.6-1-ARCH #1 SMP PREEMPT Fri Oct 18 23:22:36 CEST 2013 x86_64 GNU/Linux
make v4 and also make-3.81
Python 3.3.2 and also Python2
java version "1.6.0_51"
Java(TM) SE Runtime Environment (build 1.6.0_51-b09)
Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01, mixed mode)
toolchains arm-eabi-4.4.3
kernel cm10 for xperia x10i
Click to expand...
Click to collapse
Hello
I'm building CM for my Xperia J, almost finished but I have this stupid error:
Code:
Package target files: /home/lozohcum/CM/out/target/product/jlo/obj/PACKAGING/target_files_intermediates/cm_jlo-target_files-2081b25fba.zip
Package OTA: /home/lozohcum/CM/out/target/product/jlo/cm_jlo-ota-2081b25fba.zip
MKBOOTIMG=device/sony/tamsui-common/custombootimg.mk \
device/sony/tamsui-common/releasetools/semc_ota_from_target_files -v \
-p /home/lozohcum/CM/out/host/linux-x86 \
-k build/target/product/security/testkey \
--backup=true \
--override_device=ST26i,ST26a,jlo \
/home/lozohcum/CM/out/target/product/jlo/obj/PACKAGING/target_files_intermediates/cm_jlo-target_files-2081b25fba.zip /home/lozohcum/CM/out/target/product/jlo/cm_jlo-ota-2081b25fba.zip
unzipping target target-files...
running: unzip -o -q /home/lozohcum/CM/out/target/product/jlo/obj/PACKAGING/target_files_intermediates/cm_jlo-target_files-2081b25fba.zip -d /tmp/targetfiles-ttBFcz
/tmp/targetfiles-ttBFcz/SYSTEM/lib/libOmxWmvDec.so: write error (disk full?). Continue? (y/n/^C) y
The problem is that I actually have 94.5GB free on my /home
/home is on different partition that ubuntu itself.
I have the strange feeling that CM build script is trying to build CM on my system partition where I had my home in past but it would be nonsense
Hi guys,
I am trying to generate an incremental OTA update package from AOSP source code.
I saw that the key may be the file ./build/tools/releasetools/ota_from_target_files that requires the "-i <previous_OTA_zip_file>" parameter to do this.
I tried adding this in the ./build/core/Makefile correct section, changing :
Code:
$(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(DISTTOOLS)
@echo "Package OTA: [email protected]"
$(hide) ./build/tools/releasetools/ota_from_target_files -v \
-p $(HOST_OUT) \
-k $(KEY_CERT_PAIR) \
$(BUILT_TARGET_FILES_PACKAGE) [email protected]
to
Code:
$(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(DISTTOOLS)
@echo "Package OTA: [email protected]"
$(hide) ./build/tools/releasetools/ota_from_target_files -v \
[B]-i ./temp/old_ota.zip \[/B]
-p $(HOST_OUT) \
-k $(KEY_CERT_PAIR) \
$(BUILT_TARGET_FILES_PACKAGE) [email protected]
However, when I issue the command 'make otapackage', I receive the following error :
... can't find recovery API version in input target-files
Does anyone know how to fix this ? Or, if I'm doing something wrong, please enlighten me
Thanks/
Is there already a solution? I have the same problem.
TheRavenGod said:
Hi guys,
I am trying to generate an incremental OTA update package from AOSP source code.
I saw that the key may be the file ./build/tools/releasetools/ota_from_target_files that requires the "-i <previous_OTA_zip_file>" parameter to do this.
I tried adding this in the ./build/core/Makefile correct section, changing :
Code:
$(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(DISTTOOLS)
@echo "Package OTA: [email protected]"
$(hide) ./build/tools/releasetools/ota_from_target_files -v \
-p $(HOST_OUT) \
-k $(KEY_CERT_PAIR) \
$(BUILT_TARGET_FILES_PACKAGE) [email protected]
to
Code:
$(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(DISTTOOLS)
@echo "Package OTA: [email protected]"
$(hide) ./build/tools/releasetools/ota_from_target_files -v \
[B]-i ./temp/old_ota.zip \[/B]
-p $(HOST_OUT) \
-k $(KEY_CERT_PAIR) \
$(BUILT_TARGET_FILES_PACKAGE) [email protected]
However, when I issue the command 'make otapackage', I receive the following error :
... can't find recovery API version in input target-files
Does anyone know how to fix this ? Or, if I'm doing something wrong, please enlighten me
Thanks/
Click to expand...
Click to collapse
did you solved this??
Yes, I did !
The trick is that the old OTA file should actually be one of the other files produced by the 'make otapackage' command : the one with target in the title.
After a lot of struggle (that in the end produced the desired incremental OTA), I also found this site that explains it : http://jhshi.me/2014/11/09/aosp-release-tools/
Best regards
Hi,
I have decided to write this post after reading so many different guides on my journey to build my own version of Cyanogenmod and after countless tries and hours of research I succeeded. Here's how:
You will need:
A Ubuntu box
A basic knowledge of Linux
A fast internet connection or a lot of patience.
Once you have setup your Ubuntu box either in a Virtual Machine of as a stand alone PC you will need to open a terminal, this can be done by pressing 'CTRL + ALT + T' or opening the search menu and typing "Terminal".
You should see the following:
Code:
[email protected]:~$
We will need to install all the necessary files in order to build and download Cyanogenmod, we can do this by running the following command:
Code:
sudo apt-get install bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev openjdk-7-jdk openjdk-7-jre
As many Linux users have more than one version of Java installed we will need to set the the version we just installed as our default version.
Code:
sudo update-alternatives --config java
sudo update-alternatives --config javac
If by any chance you have a 64-bit version of Ubuntu installed we will require some extra files, if not please skip this command.
Code:
sudo apt-get install g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev
We will now for simplicity's sake need to create the following directories in your home folder. These directories will host our build.
Code:
mkdir -p ~/bin
mkdir -p ~/android/system
Once you have setup everything correctly we will now to download the Cyanogenmod source code of which we are going to use the 'Repo' utility. This utility is an automated tool for GitHub cloning. We can download this and set the correct permissions by running the following commands.
Code:
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
To continue with download the source code we will now initialize the GitHub repository that holds Cyanogenmod. We are going to need to specify the repository with -u and the branch with -b. Here I am going to download the latest available version of Cyanagenmod 13.0.
Code:
cd ~/android/system/
~/bin/repo init -u https://github.com/CyanogenMod/android.git -b cm-13.0
And to finally start downloading the source:
Code:
~/bin/repo sync -c -f -j8
Where:
-c Download the current version instead of all history.
-F Forces the connection to continue even if a connection error occurs.
-j8 This specifies the number of parallel operations. Use -j8 for a quad core processor and a -j16 for an octa-core.
Once the download completes successfully we will need to download the device specific code, this includes specific applications and kernel configurations for your device. To start downloading the files type:
Code:
source build/envsetup.sh
breakfast angler
The download should now start, it should only take minutes however this depends on your internet connection.
Again once this completes, we need to grab proprietary specific files. We first need to navigate to ~/android/system/device/huawei/angler. You can do this by running the following command:
Code:
cd ~/android/system/device/huawei/angler
As the script we are going to use has some dependencies we will need to get them first.
Code:
git clone https://github.com/JesusFreke/smali
cd smali
./gradlew build
cd ..
Additionally we need to download a Google Stock Image, I'm using angler-mmb29m-factory-8c31db3f.tgz, once downloaded you will need to unzip it and cd to it within the terminal.
and then download:
Code:
wget http://people.canonical.com/~mfisch/tools/ext4_utils.tar.gz
tar xzsf ext4_utils.tar.gz
cd ext4_utils
mv simg2img ../angler-mmb29m/
cd ../angler-mmb29m/
We will now convert the system and vendor img's using simg2img to a readable format and mount them so we extract the propriety files using ./extract_files.sh
We can do all of this by using the following commands.
Code:
./simg2img system.img system.ext4
./simg2img vendor.img vendor.ext4
sudo mkdir -p /mnt/system
sudo mkdir -p /mnt/vendor
sudo mount -rw system.ext4 /mnt/system
sudo mount -rw vendor.ext4 /mnt/vendor
Finally we can extract the proprietary files for the system image by running the following commands.
Code:
cd ~/android/system/device/huawei/angler/
./extract_files /mnt/ smali/
Finally we can finish off by our by running the brunch command to build and generate the .zip file of our own Cyanogenmod.
Code:
brunch angler
Note: This will take 20 mins - 2 hours - 2 days depending on your hardware spec.
And well that's it, the location of your generated .zip file should be in blue at the end of your terminal.
Reserved
N/A
This is amazing. Many thanks.
Great I've been looking
Sent from my XT1526 using XDA Forums Pro.
If there are bugs how can we fix that .Such as camera ,ril.For nexus 6p it is fine but for other phones
AANISH said:
If there are bugs how can we fix that .Such as camera ,ril.For nexus 6p it is fine but for other phones
Click to expand...
Click to collapse
As I have only just started my journey on this long path I have done a bit of research for you. Google released there own device specific binaries for the Nexus devices of which usually include the following:
NFC, Bluetooth and Wi-Fi
Media, Audio, Thermal, Touch Screen, Sensors
GPS, Camera, Gestures, Graphics, DRM, Video
This to me suggests that the chipset suppliers supply them - Broadcom, Qualcomm... or even other companies like Motorola. So if you are looking for binaries for other devices I would start with there chipset.
If you would like to look at Google's binaries following the link below however before you go looking for the 6P binaries they haven't been uploaded yet + if you do find any further information please reply to this comment or PM me.
Just saying, the official guide on the wiki works just fine. Been building for all my CM12-capable devices since 2015. Good for people who don't go there, though.
Sent from Google Nexus 6P @ CM13
[WARNING: XDA One have not implemented "mark forum as read" - do not use]
AndyYan said:
Just saying, the official guide on the wiki works just fine. Been building for all my CM12-capable devices since 2015. Good for people who don't go there, though.
Sent from Google Nexus 6P @ CM13
[WARNING: XDA One have not implemented "mark forum as read" - do not use]
Click to expand...
Click to collapse
That is true but I had major difficulties with it, for example it asks you to initialise the cm 12.1 branch when it wasn't available and I had a major pain with extract_files as it wouldnt use adb but instead had to use stock firmware to grab the proprietary files.
connectionalive said:
That is true but I had major difficulties with it, for example it asks you to initialise the cm 12.1 branch when it wasn't available and I had a major pain with extract_files as it wouldnt use adb but instead had to use stock firmware to grab the proprietary files.
Click to expand...
Click to collapse
You still have to spot the tiny mistakes in the guide, of course. The guide hasn't been updated in a long time.
I didn't grab any proprietary files for any of my devices and the builds still run fine - the files should already be in the repo.
Sent from Google Nexus 6P @ CM13
[WARNING: XDA One have not implemented "mark forum as read" - do not use]
AndyYan said:
You still have to spot the tiny mistakes in the guide, of course. The guide hasn't been updated in a long time.
I didn't grab any proprietary files for any of my devices and the builds still run fine - the files should already be in the repo.
Sent from Google Nexus 6P @ CM13
[WARNING: XDA One have not implemented "mark forum as read" - do not use]
Click to expand...
Click to collapse
Ah I didn't know this, I have only just started learning and researching all of this so all helps, if you could point me in the right direction, it would be greatly appreciated.
connectionalive said:
Ah I didn't know this, I have only just started learning and researching all of this so all helps, if you could point me in the right direction, it would be greatly appreciated.
Click to expand...
Click to collapse
I'm also just at the beginning - building according to official guides without modifying the source. Just giving some tips so that you don't step on the same mines as I did
P.S. Transition from CM12.1 to CM13 was a real PITA...
Sent from Google Nexus 6P @ CM13
[WARNING: XDA One have not implemented "mark forum as read" - do not use]
Great guide, I have a build environment setup on Linux Mint, but I am curious to know if the simg2img stuff and extraction is necessary, I thought the initial build process took care of that??
adzcache said:
Great guide, I have a build environment setup on Linux Mint, but I am curious to know if the simg2img stuff and extraction is necessary, I thought the initial build process took care of that??
Click to expand...
Click to collapse
It's not, it's a lot easier to just use the Muppets and not worry about it.
akellar said:
It's not, it's a lot easier to just use the Muppets and not worry about it.
Click to expand...
Click to collapse
I suppose I should start learning how to building up a roomservice.xml for this 6P then. Thanks for the confirmation.
akellar said:
It's not, it's a lot easier to just use the Muppets and not worry about it.
Click to expand...
Click to collapse
I couldn't find it on their repository under Google or Huawei
connectionalive said:
I couldn't find it on their repository under Google or Huawei
Click to expand...
Click to collapse
Look under the right branch
Code:
./simg2img system.img system.ext4
./simg2img vendor.img vendor.ext4
sudo mkdir -p /mnt/system
sudo mkdir -p /mnt/vendor
sudo mount -rw system.ext4 /mnt/system
sudo mount -rw vendor.ext4 /mnt/vendor
Code:
cd ~/android/system/device/huawei/angler/
./extract_files /mnt/ smali/
You have to take ownership of the mounted images before you can extract the blobs. Otherwise you have to use sudo for extract. Then the folder is root and make is denied permission while compiling.
XxMORPHEOUSxX said:
Code:
./simg2img system.img system.ext4
./simg2img vendor.img vendor.ext4
sudo mkdir -p /mnt/system
sudo mkdir -p /mnt/vendor
sudo mount -rw system.ext4 /mnt/system
sudo mount -rw vendor.ext4 /mnt/vendor
Code:
cd ~/android/system/device/huawei/angler/
./extract_files /mnt/ smali/
You have to take ownership of the mounted images before you can extract the blobs. Otherwise you have to use sudo for extract. Then the folder is root and make is denied permission while compiling.
Click to expand...
Click to collapse
I had no issues when actioning any of these commands but in theory you are correct.
connectionalive said:
I had no issues when actioning any of these commands but in theory you are correct.
Click to expand...
Click to collapse
I ran into issues. That's why I mentioned it. Also the extract-files tool is formatted different in my tree. After mounting these were are my exact commands. Maybe it will help someone else.
Code:
sudo chown -hR <user> /mnt/system
sudo chown -hR <user> /mnt/vendor
cd ~/android/system/device/huawei/angler
./extract-files.sh /mnt/ smali/
Hola
I have gone through this guide (really well put together) but I am getting an error almost at the very end and I need some guidance please:
I invoke brunch angler command but it shows:
~/android/system/device/huawei/angler$ brunch angler
bash: build/tools/roomservice.py: No such file or directory
** Don't have a product spec for: 'cm_angler'
** Do you have the right repo manifest?
No such item in brunch menu. Try 'breakfast'
I tried the lunch and breakfast commands but it comes up with the same error.
I did run both:
source build/envsetup.sh
breakfast angler
from the right directory and no errors came up. Can anyone assist me? Thanks.
I would like to have a dual boot (Android / Ubuntu Touch) on an Aquaris E5 HD phone ( the Ubuntu Touch variant can be flashed with stock Android and vice versa, see mibqyyo.com/en-articles/2015/09/16/ubuntu-android-installation-process-for-bq-aquaris-e4-5-and-e5 ). ((sorry for the links, new user))
Unfortunately, the instructions from wiki.ubuntu.com/Touch/DualBootInstallation do not work with this phone anymore: it seems that the software in those instructions relies on the device having custom ClockworkMod (CWM) recovery -- and, it seems ClockworkMod does not support this device anymore, if it ever did ( see askubuntu.com/questions/666070/cant-install-ubuntu-touch-dual-boot-on-mobile-stuck-in-waiting-for-device/776357 ).
The only other option I could see for dual boot is MultiROM Manager, unfortunately it fails with "This is unsupported device (Aquaris_E5_HD)!"
However, it is possible to root this phone using a TeamWin Recovery Project (TWRP) custom recovery image ( v3.0.2-0, see mibqyyo.com/comunidad/discussion/77467/how-to-root-a-bq-aquaris-e5-hd-phone ), which seemingly does support this phone. Furthermore, from twrp.me/devices/bqaquarise5hd.html there is a reference to:
Device Tree / files: github.com/TeamWin/android_device_bq_vegetahd - and from there:
Kernel source available on: github.com/bq/aquaris-E5
So, I thought - maybe it would be possible to port / build MultiROM from source, with support for this device? I tried something, and maybe I even got part of the way - unfortunately I cannot get the build to complete, so I hope I can get some assistance here. I will outline the steps I did below. First of all, I use this as my PC:
Code:
$ uname -a
Linux MYPC 4.2.0-38-generic #45~14.04.1-Ubuntu SMP Thu Jun 9 09:27:51 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/issue
Ubuntu 14.04.4 LTS \n \l
Then I looked at github.com/Tasssadar/multirom/wiki/Porting-MultiROM:
Prerequisites
* Android 4.1+ tree
* TWRP ported to your device. There are guides on the internet on how to do that.
* Kernel sources
Downloading sources
Just clone TWRP, MultiROM and libbootimg repos into your Android Tree, the commands would look something like this: [...]
Click to expand...
Click to collapse
I was somewhat puzzled about what this "Android Tree" is, but eventually I guessed it is the Android Open Source Project (AOSP) source code. So, I looked and did this:
source.android.com/source/initializing.html
(Note: http removed from links in code below, because I'm a new user and cannot post links):
Code:
cd /tmp
wget archive.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jre-headless_8u45-b14-1_amd64.deb
wget archive.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jre_8u45-b14-1_amd64.deb
wget archive.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jdk_8u45-b14-1_amd64.deb
sudo dpkg -i openjdk-8-jre-headless_8u45-b14-1_amd64.deb
sudo dpkg -i openjdk-8-jre_8u45-b14-1_amd64.deb
sudo dpkg -i openjdk-8-jdk_8u45-b14-1_amd64.deb
sudo apt-get -f install
# already have libgl1-mesa-dev-lts-wily mesa-common-dev-lts-wily
# so removed libgl1-mesa-dev from list below:
sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \
libxml2-utils xsltproc unzip
sudo apt-get autoremove --purge
wget -S -O - source.android.com/source/51-android.rules | sed "s/<username>/$USER/" | sudo tee >/dev/null /etc/udev/rules.d/51-android.rules
# for the aquaris:
echo "SUBSYSTEM==\"usb\", ATTRidVendor==\"2a47\", ATTRidProduct==\"201d\", MODE=\"0600\", OWNER=\"$USER\"" \
| sudo tee -a /etc/udev/rules.d/51-android.rules
sudo udevadm control --reload-rules
then
source.android.com/source/downloading.html
Code:
mkdir ~/bin
PATH=~/bin:$PATH
curl storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
cd /path/to/src
mkdir AOSP
cd AOSP
repo init -u android.googlesource.com/platform/manifest -b android-4.1.2_r2.1 2>&1 | tee repo.log
repo sync
Note that here, I took the `4.1+` requirement quite literally, so just chose to checkout the last 4.1 branch, `4.1.2_r2.1`.
Also, repo sync took 14+ hours to complete, for my PC+Internet connection combo (!)
With that done, I have this in the directory:
Code:
AOSP$ ls
abi cts docs hardware ndk prebuilts
bionic dalvik external libcore packages repo.log
bootable development frameworks libnativehelper pdk sdk
build device gdk Makefile prebuilt system
Now, at this point, we should be running build/envsetup.sh and lunch; however, that will cause only the default Google devices (Nexus etc) to be recognized. So, here I did cloned the "device tree" (I guess) into the "Android tree":
Code:
AOSP$ mkdir device/bq
AOSP$ git clone github.com/TeamWin/android_device_bq_vegetahd device/bq/vegetahd
AOSP$ chmod +x device/bq/vegetahd/vendorsetup.sh
AOSP$ ls device/bq/vegetahd/
AndroidBoard.mk BoardConfig.mk kernel omni_vegetahd.mk recovery
AndroidProducts.mk device.mk mkbootimg.mk README.md vendorsetup.sh
AOSP$ ls device/samsung/crespo # for comparison
Android.mk full_crespo.mk libsensors recovery
AndroidProducts.mk gps.conf libstagefrighthw recovery.fstab [...]
vendorsetup.sh
and also cloned the Omnirom TWRP recovery sources (note that if you just mv bootable/recovery bootable/old.recovery, then the builds process may also pick some of those files up, so that directory should be deleted, as guides elsewhere recommend):
Code:
AOSP$ rm -rf bootable/recovery
cd bootable
git clone https://github.com/omnirom/android_bootable_recovery.git recovery-twrp
cd ..
Since build/envsetup.sh should be running the vendorsetup.sh when it finds them, after running it, the Aquaris device should be visible:
Code:
AOSP$ source build/envsetup.sh
including device/asus/grouper/vendorsetup.sh
including device/bq/vegetahd/vendorsetup.sh # ***
including device/generic/armv7-a-neon/vendorsetup.sh
including device/generic/armv7-a/vendorsetup.sh
including device/moto/wingray/vendorsetup.sh
including device/samsung/crespo/vendorsetup.sh
including device/samsung/maguro/vendorsetup.sh
including device/ti/panda/vendorsetup.sh
including sdk/bash_completion/adb.bash
AOSP$ lunch
You're building on Linux
Lunch menu... pick a combo:
1. full-eng
2. full_x86-eng
3. vbox_x86-eng
4. full_grouper-userdebug
5. omni_vegetahd-eng # ***
6. mini_armv7a_neon-userdebug
7. mini_armv7a-userdebug
8. full_wingray-userdebug
9. full_crespo-userdebug
10. full_maguro-userdebug
11. full_panda-userdebug
Which would you like? [full-eng] 5
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.1.2
TARGET_PRODUCT=omni_vegetahd
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.2.0-38-generic-x86_64-with-Ubuntu-14.04-trusty
HOST_BUILD_TYPE=release
BUILD_ID=JZO54M
OUT_DIR=out
============================================
Now, it seems that for such an old version like 4.1.2_r2.1, there is no mka command (not found), which should otherwise be ran at this point - however, I can run make instead of it.
Also because it's so old, I get "You are attempting to build with the incorrect version of java. Your version is: openjdk version "1.8.0_45-internal". The correct version is: Java SE 1.6.", which it so happens, I have - but I have to set environment variables. So here I run:
Code:
AOSP$ export RECOVERY_VARIANT=twrp
AOSP$ ANDROID_PRE_BUILD_PATHS=/path/to/jdk1.6.0_45/bin \
ANDROID_JAVA_TOOLCHAIN=/path/to/jdk1.6.0_45/bin \
JAVA_HOME=/path/to/jdk1.6.0_45 \
PATH=/path/to/jdk1.6.0_45/bin:$PATH \
make -j3 recoveryimage
...
target thumb C: adbd <= system/core/adb/log_service.c
make: *** No rule to make target `out/target/product/vegetahd/obj/EXECUTABLES/recovery_intermediates/recovery', needed by `out/target/product/vegetahd/recovery.img'. Stop.
make: *** Waiting for unfinished jobs....
target thumb C: adbd <= system/core/adb/utils.c
... but as you can see, it fails. This was for the Omnirom sources of TWRP recovery.
Then I thought of going back to the Multirom porting, and so did this:
Code:
AOSP$ rm -r bootable/recovery-twrp
git clone github.com/Tasssadar/Team-Win-Recovery-Project.git bootable/recovery
git clone github.com/Tasssadar/multirom.git system/extras/multirom
git clone github.com/Tasssadar/libbootimg.git system/extras/libbootimg
cd system/extras/multirom
git submodule update --init
cd ../../..
Then I checked the touchpad from adb shell as root:
Code:
cat /proc/bus/input/devices
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="mtk-tpd"
P: Phys=
S: Sysfs=/devices/virtual/input/input3
U: Uniq=
H: Handlers=mouse0 event3 cpufreq
B: PROP=2
B: EV=b
B: KEY=10 0 0 0 0 0 0 0 400 0 0 0 0 1000 40000000 100000 0 0 0
B: ABS=6630000 1000003
... so definitely "type b"; then by doing `find /sys | grep uevent` and comparing as in the porting guide, I put together this file as device/bq/vegetahd/mr_init_devices.c:
Code:
#include <stdlib.h>
// These are paths to folders in /sys which contain "uevent" file
// need to init this device.
// MultiROM needs to init framebuffer, mmc blocks, input devices,
// some ADB-related stuff and USB drives, if OTG is supported
// You can use * at the end to init this folder and all its subfolders
const char *mr_init_devices[] =
{
"/sys/devices/platform/mtkfb.0/graphics/fb0",
"/sys/devices/platform/mtkfb.0",
"/sys/devices/platform/mtk-msdc.0",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0boot0",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0boot1",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0rpmb",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p1",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p2",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p3",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p4",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p5",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p6",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p7",
"/sys/devices/platform/mtk-msdc.1",
"/sys/devices/platform/mtk-msdc.1/mmc_host/mmc1",
"/sys/devices/platform/mtk-msdc.1/mmc_host/mmc1/mmc1:0007",
"/sys/devices/platform/mtk-msdc.1/mmc_host/mmc1/mmc1:0007/block/mmcblk1/mmcblk1p1",
"/sys/devices/platform/mtk-msdc.1/mmc_host/mmc1/mmc1:0007/block/mmcblk1",
"/sys/bus/mmc/uevent",
"/sys/bus/mmc/drivers/mmcblk/uevent",
"/sys/bus/sdio/uevent",
"/sys/devices/virtual/input/*",
"/sys/devices/virtual/misc/uinput",
"/sys/devices/platform/mtk-tpd",
"/sys/devices/platform/mtk-kpd",
"/sys/devices/platform/mtk-kpd/input/input0",
"/sys/devices/platform/mtk-kpd/input/input0/event0",
"/sys/devices/platform/mtk-kpd/misc/mtk-kpd",
// for adb
"/sys/devices/virtual/tty/ptmx",
"/sys/devices/virtual/misc/android_adb",
"/sys/devices/virtual/android_usb/android0/f_adb",
"/sys/bus/usb",
NULL // must be NULL-terminated
}
Then I inspected boot.img of the stock Android firmware:
Code:
$ /path/to/bootimg_tools/boot_info /path/to/bq/2.1.0_20151104-0859_E5HD_bq-FW/boot.img
Page size: 2048 (0x00000800)
Kernel size: 3747904 (0x00393040)
Ramdisk size: 615529 (0x00096469)
Second size: 0 (0x00000000)
Board name: fbcdadc
Command line: ''
Base address: 2147483648 (0x80000000)
... and also did:
Code:
mkdir device/bq/vegetahd/mrom-infos/
wget raw.githubusercontent.com/Tasssadar/device_asus_grouper/cm-10.2-mrom/mrom_infos/ubuntu_touch.txt -O device/bq/vegetahd/mrom-infos/ubuntu_touch.txt
... and confirmed paths, and could finally add this to device/bq/vegetahd/BoardConfig.mk :
Code:
#MultiROM config. MultiROM also uses parts of TWRP config
MR_INPUT_TYPE := type_b
MR_INIT_DEVICES := device/bq/vegetahd/mr_init_devices.c
MR_RD_ADDR := 0x82500000
MR_DPI := hdpi
MR_DPI_FONT := 216
MR_FSTAB := device/bq/vegetahd/recovery/etc/twrp.fstab
MR_KEXEC_MEM_MIN := 0x85000000
MR_INFOS := device/bq/vegetahd/mrom_infos
Here, if I run ... make ... (after first exiting the old terminal shell, and repeating envsetup.sh / lunch in a new one), I get "build/core/base_rules.mk:103: *** user tag detected on new module - user tags are only supported on legacy modules. Stop." So, I did these changes:
Code:
# bootable/recovery/Android.mk:
LOCAL_MODULE := recovery
LOCAL_MODULE_TAGS := optional # add
# bootable/recovery/tests/Android.mk:
LOCAL_MODULE := asn1_decoder_test
LOCAL_MODULE_TAGS := optional # add
Then, a ... make ... at this point fails with: "make: *** No rule to make target `out/target/product/vegetahd/system/xbin/busybox', needed by `out/target/product/vegetahd/obj/SHARED_LIBRARIES/libbmlutils_intermediates/teamwin'. Stop.".
Here I found "[DEV]How to compile TWRP touch recovery - Pg. 150 | Android Development and Hacking" ( forum.xda-developers.com/showthread.php?p=65556586 ), and I downloaded busybox.zip from that page - and did:
Code:
AOSP$ unzip busybox.zip
AOSP$ mv busybox external/
Now, the ... make ... at this point is a bit funny, because it will exit not reporting an error, as if it finished:
Code:
AOSP$ ANDROID_PRE_BUILD_PATHS=/path/to/jdk1.6.0_45/bin \
ANDROID_JAVA_TOOLCHAIN=/path/to/jdk1.6.0_45/bin \
JAVA_HOME=/path/to/jdk1.6.0_45 \
PATH=/path/to/jdk1.6.0_45/bin:$PATH \
make -j3 recoveryimage
...
GEN include/usage_compressed.h
GEN include/applet_tables.h
HOSTCC applets/usage_pod
GEN include/bbconfigopts.h
CC applets/applets.o
LD applets/built-in.o
make[1]: Leaving directory `/media/Data1/src/AOSP/external/busybox'
AOSP$
But here it is apparently just done with applets in busybox! So, I try running ... make ... again, and get:
Code:
external/busybox/android/librpc/bindresvport.c:41:13: error: conflicting types for '__set_errno'
bionic/libc/include/errno.h:45:15: note: previous declaration of '__set_errno' was here
This I fix by changing external/selinux/libsepol/include to external/libsepol/include in:
Code:
# external/busybox/Android.mk:
BUSYBOX_C_INCLUDES = \
$(BB_PATH)/include $(BB_PATH)/libbb \
bionic/libc/private \
bionic/libm/include \
bionic/libc \
bionic/libm \
libc/kernel/common \
external/libselinux/include \
external/libsepol/include \
...
... and at this point, ... make ... will fail with:
Code:
external/busybox/android/librpc/pmap_rmt.c:235:8: warning: implicit declaration of function 'inet_makeaddr' [-Wimplicit-function-declaration]
external/busybox/android/librpc/pmap_rmt.c:238:8: warning: implicit declaration of function 'inet_netof' [-Wimplicit-function-declaration]
external/busybox/android/librpc/pmap_rmt.c:235:19: error: incompatible types when assigning to type 'struct in_addr' from type 'int'
Here I found stackoverflow.com/questions/27762475/incompatible-types-when-assigning-to-type-struct-in-addr-from-type-int/27763398, which notes:
The error message is misleading, the function is simply missing from earlier versions of the NDK.
Click to expand...
Click to collapse
So, as a final try, I tried forcing a newer NDK through an environment variable, as in:
Code:
NDK_HOME=/path/to/android-ndk-r10e \
ANDROID_PRE_BUILD_PATHS=/path/to/jdk1.6.0_45/bin \
ANDROID_JAVA_TOOLCHAIN=/path/to/jdk1.6.0_45/bin \
JAVA_HOME=/path/to/jdk1.6.0_45 \
PATH=/path/to/jdk1.6.0_45/bin:$PATH \
make -j3 recoveryimage
... but this fails in exactly the same manner (with "implicit declaration of function 'inet_makeaddr'", etc).
At this point, I really don't know what I should do... Should I:
Try to use the BQ Kernel sources for this device (even if mentioned above, I haven't used them anywhere yet) somewhere (say clone them in the Android tree)? If so - where?
Try to find a busybox for AOSP 4.1.2? If so - what version is OK, and where do I find it?
Try to bump the AOSP repo version up from 4.1.2? If so, what would be the minimum version required so this builds - and would I have to wait 14+ hours again?
... or is there anything else I could try?
Again, I'm mostly interested in building MultiROM and the recovery image (TWRP?) required for it on the Aquaris E5 - but it would be nice to know how to build TWRP proper recovery image as well...
Thanks in advance for any hints...
Me too
I am planning on doing almost the exact same thing you're trying! But I have a few questions:
Have you tried adding --depth 1 to your repo command to reduce the download time?
Have you seen https://forum.xda-developers.com/showthread.php?t=2329228 ? Mainly the local manifest, also to reduce download time
Why do you want to use the lowest version possible? The TWRP device tree is for Android 5.1, so I'll be using that version.