Would it be possible for someone who is rooted on 2.3.4 to copy the startXServer.sh file in /etc/init.d and post it?
I used the HDMI Mirror hack over in http://forum.xda-developers.com/showthread.php?t=1169457 and for some reason the original one that was backed up in startXServer.bak was overwritten. I think it is the reason I cannot get my media center to work again.
Thanks.
I am on K. Penn's 4.5.91 beta 3, and this file does not exist for me in that location.
CaelanT said:
I am on K. Penn's 4.5.91 beta 3, and this file does not exist for me in that location.
Click to expand...
Click to collapse
Same here....don't have it. Sorry man!
J-man67 said:
Same here....don't have it. Sorry man!
Click to expand...
Click to collapse
Thanks for the look. I appreciate it. I'm on the OTA from the update.zip
it was under the /ect/init.d folder, there is another ect folder in system but that one is different( /system/ect)
#!/bin/sh
#
# startX.sh
#
# This script starts the X server
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=startX
DESC="OSH X Server"
. /lib/lsb/init-functions
#umask 002
log_begin_msg "Starting $DESC: $NAME"
rm -f /tmp/serverauth.*
rm -f /tmp/.X0-lock
rm -fr /tmp/.X11-unix
rm -fr /tmp/.ICE-unix
if [ ! -e /home/adas/.tag_master_reset_ls ]; then
/usr/local/sbin/update-language.pl "en_US.UTF-8"
echo 1 > /home/adas/.tag_master_reset_ls
fi
. /etc/environment
export PATH
export LANG
export DISPLAY
export LD_LIBRARY_PATH
export USER=adas
export HOME=/home/$USER
# new way of starting
if [ $1 = "webtop" ]
then
sudo -u adas -i /usr/bin/startx -- -nolisten tcp -layout HDMI vt2 &
else
sudo -u adas -i /usr/bin/startx /usr/local/bin/xnull -- -nolisten tcp -layout HDMI vt2 &
fi
Sent from my MB860 using XDA App
Robert Havens said:
#!/bin/sh
#
# startX.sh
#
# This script starts the X server
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=startX
DESC="OSH X Server"
. /lib/lsb/init-functions
#umask 002
log_begin_msg "Starting $DESC: $NAME"
rm -f /tmp/serverauth.*
rm -f /tmp/.X0-lock
rm -fr /tmp/.X11-unix
rm -fr /tmp/.ICE-unix
if [ ! -e /home/adas/.tag_master_reset_ls ]; then
/usr/local/sbin/update-language.pl "en_US.UTF-8"
echo 1 > /home/adas/.tag_master_reset_ls
fi
. /etc/environment
export PATH
export LANG
export DISPLAY
export LD_LIBRARY_PATH
export USER=adas
export HOME=/home/$USER
# new way of starting
if [ $1 = "webtop" ]
then
sudo -u adas -i /usr/bin/startx -- -nolisten tcp -layout HDMI vt2 &
else
sudo -u adas -i /usr/bin/startx /usr/local/bin/xnull -- -nolisten tcp -layout HDMI vt2 &
fi
Sent from my MB860 using XDA App
Click to expand...
Click to collapse
Thank you very much for this. Worked like a charm. I basically used it to rewrite the .sh file. You're a life saver. MODS please close if needed, unless someone else runs into the same issue.
I need some help with compiling a lib (ODE) for android - problem is it uses automake and I can't seem to find any decent documentation/howto to cross compile a static/dynamic lib for android.
If anyone has any experience in doing such builds, please can you help.
BTW, I'm using ubuntu 12.04 as a dev environment (latest up-to-datest SDK and NDKs are installed) and I have no problem with making the wrapper library - just need to get the static (or dynamic) lib built.
Never mind...
Never mind, I seem to have cracked it...
Here's the script I wrote...
ndk-autoconf
Code:
#!/bin/bash
if [ "$1" = "" ]; then
echo "Usage ndk-autoconf <api>\ne.g. ndk-autoconf android-9"
exit 1
else
platform=$1
shift
export NDK=${HOME}/android-ndk
cp ${NDK}/config.guess .
cp ${NDK}/config.sub .
export NDK_TOOLCHAIN=${NDK}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin
export CROSS_COMPILE=arm-linux-androideabi
export CC=${NDK_TOOLCHAIN}/${CROSS_COMPILE}-gcc
export CXX=${NDK_TOOLCHAIN}/${CROSS_COMPILE}-g++
export LD=${NDK_TOOLCHAIN}/${CROSS_COMPILE}-ld
export AR=${NDK_TOOLCHAIN}/${CROSS_COMPILE}-ar
export RANLIB=${NDK_TOOLCHAIN}/${CROSS_COMPILE}-ranlib
export STRIP=${NDK_TOOLCHAIN}/${CROSS_COMPILE}-strip
export ac_cv_func_malloc_0_nonnull=yes
export ac_cv_func_realloc_0_nonnull=yes
export SYSROOT=${NDK}/platforms/${platform}/arch-arm
export CXXFLAGS=--sysroot=${SYSROOT}
export CFLAGS=--sysroot=${SYSROOT}
argStr=""
while [ "$1" != "" ]; do
argStr="${argStr} $1"
shift
done
./configure --host=arm-linux-androideabi --target=arm-linux-androideabi --prefix=$SYSROOT/usr LIBS="-lc -lgcc" $argStr
make
make install
fi
you'll need to get config.sub and config.guess from stackoverflow.com/questions/4594736/configure-does-not-recognize-androideabi (bottom answer) and copy them into your ndk root
improved
i improved your script.
after i wrote it down i realize that with NDK is more easier create a specific Android.mk rather then running configure.
hope this helps.
Code:
#!/bin/bash
# static data
CROSS_COMPILE=arm-linux-androideabi
NDK_TOOLCHAIN=""
function die()
{
echo [email protected]
exit 1
}
function arg_parse()
{
if [ $# -lt 2 ] ; then
die -e "Usage ndk-autoconf <ndk_path> <api>\ne.g. ndk-autoconf /opt/android-ndk 9"
fi
if [ ! -d "$1" ] ; then
die "error: the ndk-path is not valid"
fi
if [ ! -d "$1/platforms/android-$2/" ] ; then
die "cannot find android sysroot in your ndk_path"
fi
}
function check_external_scripts()
{
if [ ! -f "${NDK}/config.guess" -o ! -f "${NDK}/config.sub" ] ; then
echo "warning: missing config.guess or config.sub in your ndk dir"
echo "info: should i download them for you? [y/n]"
read choice
if [ "x$choice" != "xy" -a "x$choice" != "xY" ] ; then
die "error: missing config.guess or config.sub"
fi
wget "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD" -qO "${NDK}/config.sub" || die "cannot download config.sub"
wget "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD" -qO "${NDK}/config.guess" || die "cannot download config.guess"
fi
cp ${NDK}/config.guess . || die "cannot import files"
cp ${NDK}/config.sub . || die "cannot import files"
}
function find_toolchain()
{
local tmp;
local host_arch;
case $(uname -m) in
x86_64)
host_arch="x86_64"
;;
i[3456]86)
host_arch="x32"
;;
*)
die "cannot detect your system arch"
;;
esac
for d in $( ls -1 "${NDK}/toolchains/" ); do
name=$(basename "$d")
case $name in
*clang*) continue
;;
$CROSS_COMPILE-*)
NDK_TOOLCHAIN="${NDK}/toolchains/$name/prebuilt/linux-$host_arch/bin"
tmp="${NDK_TOOLCHAIN}/${CROSS_COMPILE}-"
for bin in gcc g++ ld ar ranlib strip; do
if [ ! -f "$tmp$bin" ] ; then
unset NDK_TOOLCHAIN
break
fi
done
;;
*) continue
;;
esac
done
test "x$NDK_TOOLCHAIN" != "x" || die "cannot find an usable toolchain"
}
## MAIN ##
arg_parse [email protected]
NDK=$1
PLATFORM="android-$2"
shift
shift
check_external_scripts [email protected]
find_toolchain
export CC=${NDK_TOOLCHAIN}/${CROSS_COMPILE}-gcc
export CXX=${NDK_TOOLCHAIN}/${CROSS_COMPILE}-g++
export LD=${NDK_TOOLCHAIN}/${CROSS_COMPILE}-ld
export AR=${NDK_TOOLCHAIN}/${CROSS_COMPILE}-ar
export RANLIB=${NDK_TOOLCHAIN}/${CROSS_COMPILE}-ranlib
export STRIP=${NDK_TOOLCHAIN}/${CROSS_COMPILE}-strip
export ac_cv_func_malloc_0_nonnull=yes
export ac_cv_func_realloc_0_nonnull=yes
export SYSROOT=${NDK}/platforms/${PLATFORM}/arch-arm
export CXXFLAGS=--sysroot=${SYSROOT}
export CFLAGS=--sysroot=${SYSROOT}
argStr=""
while [ "$1" != "" ] ; do
argStr="${argStr} $1"
shift
done
./configure "--host=$CROSS_COMPILE" "--target=$CROSS_COMPILE" "--prefix=$SYSROOT/usr" LIBS="-lc -lgcc" $argStr && \
make -j$(( $(cat /proc/cpuinfo | grep processor | wc -l) +1 ))
#DEBUG
#make install
Hi,
I have modified a line in the current script at function find_toolchain() as on my setup (having Ubuntu 32 bit) the host_arch field always comes x86.
I have downloaded latest NDK toolchain for API19 (or Kitkat). However when I am compiling ncurses library I am getting following error in configure. Any guesses?
checking how to run the C++ preprocessor... /lib/cpp
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
The command I gave is
./ndk_autoconf.sh <path to ndk> 19
Thanks.
actiononmail said:
Hi,
I have modified a line in the current script at function find_toolchain() as on my setup (having Ubuntu 32 bit) the host_arch field always comes x86.
I have downloaded latest NDK toolchain for API19 (or Kitkat). However when I am compiling ncurses library I am getting following error in configure. Any guesses?
checking how to run the C++ preprocessor... /lib/cpp
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
The command I gave is
./ndk_autoconf.sh <path to ndk> 19
Thanks.
Click to expand...
Click to collapse
You must include this line on script:
Code:
export CPP=${NDK_TOOLCHAIN}/${CROSS_COMPILE}-cpp
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
I am trying to extract vendor files from an i8730 phone using extract-files.sh
I have Linux Mint 14 with android-tools-adb installed as the adb
adb works fine to a point
[email protected] ~ $ adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
333398202BDF00EC device
adb shell and ls shows files on the phone including the vendor folder
If I run ls from my working directly I can see extract-files.sh
Think the solution is in .bashrc but believe I am not doing it right. When I run extract-files.sh I get this
[email protected] ~ $ ./extract-files.sh
bash: ./extract-files.sh: Permission denied
[email protected] ~ $ sudo extract-files.sh
[sudo] password for megan:
sudo: extract-files.sh: command not found
[email protected] ~ $ sudo./extract-files.sh
bash: sudo./extract-files.sh: No such file or directory
location adb shows
/usr/share/doc/android-tools-adb
location bashrc shows
/etc/bash.bashrc
I have edit bashrc
[email protected] ~ $ sudo gedit /etc/bash.bashrc
[sudo] password for megan:
Have added this to the end
export PATH=${PATH}:/home/megan/usr/share/doc/android-tools-adb
Think this is where I have gone wrong. Any suggestions?
Thanks
Bazzan
http://forum.xda-developers.com/showpost.php?p=7146410&postcount=5
unable to create 99-android.rules
MoonBlade said:
http://forum.xda-developers.com/showpost.php?p=7146410&postcount=5
Click to expand...
Click to collapse
Thanks MoonBlade. Think you are suggesting the version on the link so have been working through it. Had to source the files elsewhere as original link is dead. May or may not be a problem.
Got as far as creating the file in /etc/udev/rules.d/ but am unable to create a file in that folder. I am logged in as root. I can view the folder through GUI but not able to create 99-android.rules
Get this mess in terminal
[email protected] ~ $ su
Password:
megan-901 megan # cd /etc/udev/rules.d/
megan-901 rules.d # ls
Traceback (most recent call last):
File "/usr/lib/command-not-found", line 21, in <module>
os.execvp("python3", [sys.argv[0]] + sys.argv)
File "/usr/lib/python2.7/os.py", line 344, in execvp
_execvpe(file, args)
File "/usr/lib/python2.7/os.py", line 380, in _execvpe
func(fullname, *argrest)
OSError: [Errno 2] No such file or directory
megan-901 rules.d #
Not sure the above is anything to do with not being able to write to that folder. Any ideas?
Bazzan
ok im not sure exactly what youre trying to do but it sounds like you want to get files from your phones /vendor/ directory and copy them to a directory on your computer. if this is correct then you need to stop playiing around with your .bashrc and your $PATH appends. all you need to use is adb
you dont have to adb shell. once you run adb shell it opens up a terminal inside your device so if youre trying to run a shell script on your computer from inside an adb shell it just wont work.
a simpler way to put this is, if you want to get /vendor/firmware/bcm4329.bin from your phone and put it on your computer in a folder on your desktop you would run it like this
$adb pull /vendor/firmware/bcm4329.bin /home/megan/Desktop/phonevendorfirmware/bcm439.bin
and the directory and file will automatically be created on your computer. from there you can do what ever you wanted to do to the files that you pulled from the phone.
the same works in reverse if you want to move a file to the phone using $adb push
bazzan said:
[email protected] ~ $ ./extract-files.sh
bash: ./extract-files.sh: Permission denied
Click to expand...
Click to collapse
You need to give execution permissions to the script, this way:
Code:
chmod +x extract-files.sh
And then, run your script like this (if the script doesn't need root permissions, run it without sudo):
Code:
sudo ./extract-files.sh
Many thanks haxin and RoberGalarga
I was given the extract-files.sh by a developer to extract vendor files for ROM development - i8730. He did not have the phone (I don't at the moment as has been wrapped for the kids to give to me for my birthday - practicing on an a Galaxy S)
From peeking inside the file it looks like a batch file that grabs all the content from the vendor folder. Did SQL 10 years ago and looks like that. Essentially does what you gave me haxim, but pulls the content of the entire folder. What is the best way to do that with adb pull?
Gave chmod +x extract-files.sh a try.
Without sudo I get
bash:./extract-files.sh : /bin/sh^M: bad interpreter: No such file or directory
With sudo
sudo: unable to execute ./extract-files.sh: No such file or directory.
Remember I am running this against a i9000, not the phone that I was given the sh file to run against. Get that back the begining of September. Not sure if that makes a difference but if it does not obvious to me.Seems to be falling over on the first line as that appears in the non sudo error message.
Have copied the content of extract-files.sh below.
Thanks again guys. Learning heaps and loving it.
Bazzan
#!/bin/sh
set -e
export DEVICE=express
export VENDOR=samsung
if [ $# -eq 0 ]; then
SRC=adb
else
if [ $# -eq 1 ]; then
SRC=$1
else
echo "$0: bad number of arguments"
echo ""
echo "usage: $0 [PATH_TO_EXPANDED_ROM]"
echo ""
echo "If PATH_TO_EXPANDED_ROM is not specified, blobs will be extracted from"
echo "the device using adb pull."
exit 1
fi
fi
BASE=../../../vendor/$VENDOR/$DEVICE/proprietary
rm -rf $BASE/*
for FILE in `egrep -v '(^#|^$)' ../$DEVICE/proprietary-files.txt`; do
echo "Extracting /system/$FILE ..."
DIR=`dirname $FILE`
if [ ! -d $BASE/$DIR ]; then
mkdir -p $BASE/$DIR
fi
if [ "$SRC" = "adb" ]; then
adb pull /system/$FILE $BASE/$FILE
else
cp $SRC/system/$FILE $BASE/$FILE
fi
done
./setup-makefiles.sh
Where did you get the script? This error:
bazzan said:
bash:./extract-files.sh : /bin/sh^M: bad interpreter: No such file or directory
Click to expand...
Click to collapse
is caused by a bad formatting in the file (Window$ editing... pfff....), so, make a new file using Gedit and paste this directly (don't copy&paste from the original script!!):
bazzan said:
#!/bin/sh
set -e
export DEVICE=express
export VENDOR=samsung
if [ $# -eq 0 ]; then
SRC=adb
else
if [ $# -eq 1 ]; then
SRC=$1
else
echo "$0: bad number of arguments"
echo ""
echo "usage: $0 [PATH_TO_EXPANDED_ROM]"
echo ""
echo "If PATH_TO_EXPANDED_ROM is not specified, blobs will be extracted from"
echo "the device using adb pull."
exit 1
fi
fi
BASE=../../../vendor/$VENDOR/$DEVICE/proprietary
rm -rf $BASE/*
for FILE in `egrep -v '(^#|^$)' ../$DEVICE/proprietary-files.txt`; do
echo "Extracting /system/$FILE ..."
DIR=`dirname $FILE`
if [ ! -d $BASE/$DIR ]; then
mkdir -p $BASE/$DIR
fi
if [ "$SRC" = "adb" ]; then
adb pull /system/$FILE $BASE/$FILE
else
cp $SRC/system/$FILE $BASE/$FILE
fi
done
Click to expand...
Click to collapse
Delete the old file, and try the new one (you can use any filename, it doesn't matter).
Many thanks RoberGalarga.
Got the script off a recognised developer along with proprietary-files.txt and setup-makefiles.sh
He is working a CWM and a rom for owners of the i8730 - he does not have the phone so community feed in content. Get the impression he is not a Windows user (he did not have a Windows script for this) so reckon I might have corrupted it.
I did as you advised and made some real progress. Now we get the following:
[email protected] ~ $ sudo ./extract-files.sh
[sudo] password for megan:
egrep: ../express/proprietary-files.txt: No such file or directory
: not foundefiles.sh: 3: ./setup-makefiles.sh:
: Directory nonexistentk ./setup-makefiles.sh: cannot create ../../../vendor/samsung/express
[email protected] ~ $
It breaks further down the script. In the home folder there is proprietary-files.txt which list the files to be extracted along with their file path. Does that message indicate it is looking for proprietary-files.txt in /home/express?
Setup-makefiles.sh is in the home folder as well and appears to be a Cyanogenmod Project file to create a blob from the the results of extract-files.sh
Bazzan
bazzan said:
Does that message indicate it is looking for proprietary-files.txt in /home/express?
Click to expand...
Click to collapse
Yes, that's it. Check again, seems like something is missing yet.
Thanks again. Got it to work by building the folder structure
/home/vendor/Samsung/express
And then running the files from there
Bazzan
Sorry my En bad
Iam complice Color os 2.0 Form source github ok
Iam build color os 2.0 but bug
code bug:
#compile framework-res.apk
/home/leminh/color/tools/aapt p -f -m -x -z -J out/gen -S /home/leminh/color/build/res-build/oppo-overlay/res/ -S out/framework-res/res -M out/framework-res/AndroidManifest.xml -F out/framework-res-unsigned.apk -P out/gen/public_resources.xml -A out/framework-res/assets --auto-add-overlay > compile.framework-res.log
/bin/sh: 1: /home/leminh/color/tools/aapt: not found
make: *** [resource] Error 127
How to Fix
tksss
The Android Asset Packaging Tool (aapt) takes your application resource files, such as the*AndroidManifest.xmlfile and the XML files for your Activities, and compiles them. An*R.java*is also produced so you can reference your resources from your Java code.
the aapt is not found this interns stop building from creating R.java which stops creation of class files which disrupts the formation of dex files and so on..
Solution: Looks like you don't have sdk installed on your Linux or you didn't set the path to sdk.
Regards
MasterAwesome
MasterAwesome said:
The Android Asset Packaging Tool (aapt) takes your application resource files, such as the*AndroidManifest.xmlfile and the XML files for your Activities, and compiles them. An*R.java*is also produced so you can reference your resources from your Java code.
the aapt is not found this interns stop building from creating R.java which stops creation of class files which disrupts the formation of dex files and so on..
Solution: Looks like you don't have sdk installed on your Linux or you didn't set the path to sdk.
Regards
MasterAwesome
Click to expand...
Click to collapse
tks
how to set the path to sdk.
Uzayr said:
Thank you MasterAwesome for repsonding.
And, if you don't mind. Any idea how i can set the linux path to the latest SDK?
Click to expand...
Click to collapse
Open your ~/.bashrc and at the end add
Code:
export PATH=$PATH:~/SDK/platform-tools;
export PATH=$PATH:~/SDK/build-tools;
export PATH=$PATH:~/SDK/tools;
or to do it via terminal
Code:
echo 'export PATH=$PATH:~/SDK/platform-tools;' >> ~/.bashrc
echo 'export PATH=$PATH:~/SDK/build-tools;' >> ~/.bashrc
echo 'export PATH=$PATH:~/SDK/tools;' >> ~/.bashrc
29y6145 said:
Sorry my En bad
Iam complice Color os 2.0 Form source github ok
Iam build color os 2.0 but bug
code bug:
#compile framework-res.apk
/home/leminh/color/tools/aapt p -f -m -x -z -J out/gen -S /home/leminh/color/build/res-build/oppo-overlay/res/ -S out/framework-res/res -M out/framework-res/AndroidManifest.xml -F out/framework-res-unsigned.apk -P out/gen/public_resources.xml -A out/framework-res/assets --auto-add-overlay > compile.framework-res.log
/bin/sh: 1: /home/leminh/color/tools/aapt: not found
make: *** [resource] Error 127
How to Fix
tksss
Click to expand...
Click to collapse
Do you have color os sources ? Because looks like OPPO have deleted them from GitHub.