[GUIDE] Compile the stock android kernel - Eee Pad Transformer General

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.

Related

[Q] Help Compiling the source

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

[Q] Compilation of OpenSwift 2.2.1

Anybody managed to compile OpenSwift 2.2.1 from github? I'm trying to do that for 2 days without success.
My last error is:
Code:
Install: out/target/product/swift/system/lib/libdiskconfig.so
Install: out/target/product/swift/system/bin/vold
Symlink: out/target/product/swift/system/bin/watchprops -> toolbox
Symlink: out/target/product/swift/system/bin/wipe -> toolbox
target Strip: wpa_cli (out/target/product/swift/obj/EXECUTABLES/wpa_cli_intermediates/wpa_cli)
Install: out/target/product/swift/system/bin/wpa_cli
target Strip: wpa_supplicant (out/target/product/swift/obj/EXECUTABLES/wpa_supplicant_intermediates/wpa_supplicant)
Copy: out/target/product/swift/system/bin/wpa_supplicant
target Strip: zipalign (out/target/product/swift/obj/EXECUTABLES/zipalign_intermediates/zipalign)
Install: out/target/product/swift/system/bin/zipalign
Target buildinfo: out/target/product/swift/system/build.prop
/bin/bash: -c: line 0: unexpected EOF while looking for matching `"'
/bin/bash: -c: line 1: syntax error: unexpected end of file
make: *** [out/target/product/swift/system/build.prop] Error 1
make: *** Deleting file `out/target/product/swift/system/build.prop'
Maybe we can share experience about compilation of OpenSwift in this thread?
I have the same issue. But not find a solution yet.
Early I've success compile whole system. But after last updates from github gets errors.
I found solutions for all recent errors on 4pda.ru.
This is the original post:
http://4pda.ru/forum/index.php?s=&showtopic=215440&view=findpost&p=6414296
just got wubi ubuntu 10.10 installed and git and python were a nightmare and repo wouldnt work until i went and edited repo myself so it installed fine. i worked out how to install python2.4 on 10.10 and git running nicely. when i do the sync command it starts downloading the whole cyanogen mod tree i just want whats on the openswift branch thats it. any advice on the whole source codes and compiling would be greatly apppreciated.

{Guide} [HOW TO]Building CM11 from source for i9082/L

Here are the steps to build your own kernel from source. This guide is showing you how to build your first the stock kernel on your own..... It is kick start for making things on your own way....
This guide applies to i9082/i9082L and general devices also.:laugh:
This guide assumes you have basic knowledge of linux and linux system configuration.
Prerequisites
Quote:
HTML:
1. Ubuntu 13.10 / BBQLINUX (I personally use this)
2. patience...lots and lots of patience.
Here starts the fun:-
1. Installing ubuntu 13.10.
Quote:
This can be done in 3 ways and I am not gonna cover it all.
- along with windows ,i.e dual boot
- in virtualbox within windows
- as a windows application installation with "wubi" installer
For starting user i think second option, i.e installing in virtualbox is best.
here's starting tutorials
http://www.youtube.com/watch?v=tDDRFiwHujg
NOTE - you should have atleast 100 Gb partion for virtualbox.
2. Setting up building environment.
PHP:
THIS ALL BELOW STEPS ARE NOT NEEDED IF YOU HAVE INSTALLED BBQLINUX, BUILDING ENVIRONMENT IS SET IN BBQLINUX BY DEFAULT. IT WORKS OUT-OF-THE-BOX.
Initializing a fresh Android Build Environment in Ubuntu 13.10 sucks, right? The instructions at the AOSP page are outdated and inaccurate. Near as I can tell, they try to have you install 2 JDKs, the first one not even being the correct link for Saucy Salamander, and the second being OpenJDK. Which might work. But I dunno about all that, I’d rather have Oracle’s official stamp when it comes to building for Android.
Currently most of the guides are up to 12.04 LTS, which is fine and dandy, but being on the cutting edge is nice too.
This guide applies to all variations of Ubuntu 13.10 Saucy Salamander 64 bit. Do not use the 32 Bit version. Also, PAY CLOSE ATTENTION when to use “sudo” and when to not. It can make things funky if you do something as root that you shouldn’t.
Much thanks goes out to Google, ProTekk, Canonical, and everyone else that I read a random paragraph here and snippet there.
First, let’s set up the correct JDK.
Many of you probably have some kind of wrong Java installed unless you’re starting with a fresh Ubuntu base, and even then maybe.
Let’s get rid of that. Copy and paste this into a Terminal window:
Code:
PHP:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
Follow the instructions to remove OpenJDK.
If you must keep it, it’s possible. But I’m not going to tell you how to do it here. I don’t want any chance of confusion or mistake.
Now copy and paste the following into the Terminal:
Code:
PHP:
sudo add-apt-repository ppa:webupd8team/java
This will add the correct PPA to your system for updated builds of Java 6 JDK that are compatible with 13.10.
No more unrecognized Java version errors! And it will update automatically with the rest of your system.
Next, we actually need to install the package. More copy-paste:
Code:
PHP:
sudo apt-get update && sudo apt-get install oracle-java6-installer
Follow the on-screen instructions. You have to Accept the Licensing Agreement to complete the install. Hopefully no human centipede clauses.
Let’s make sure the correct version of Java is activated, run the following Terminal command:
Code:
PHP:
java -version
You should see something like the following:
Code:
PHP:
java version “1.6.0_45″ Java(TM) SE Runtime Environment (build 1.6.0_45-b06) Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01, mixed mode)
Ok, back to a fresh Terminal prompt. Time for installing the guts to build stuff in Ubuntu:
Code:
PHP:
sudo apt-get install git-core gnupg ccache lzop flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5 lib32z1 lib32bz2-1.0 lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python
When that is done installing, run the following command in your Terminal window:
Code:
PHP:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
That’s it on the package side of things.
You guessed it, time for more Terminal. This really is the easiest way, seriously. And it’s totally worth it when you’re basking in the glory of a bunch of people on XDA.
The binary for a program called “repo” will let you talk to git servers and download all that precious source code. That second part after the && allows it to be executable:
Code:
PHP:
mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo
Use your favorite text editor to open ~/.bashrc
I like nano:
Code:
PHP:
sudo nano ~/.bashrc
At the very bottom, add the following line:
Code:
PHP:
export PATH=~/bin:$PATH
Save it. In nano that would be Ctrl-O and then Enter. Then Ctrl-X to exit back to a prompt. Restart bash:
Code:
PHP:
source ~/.bashrc
That should be everything. Now you’re ready to build Android the right way. Luck!
3. Downloading source
Open terminal
To initialize your local repository using the CyanogenMod trees, use a command like this:
HTML:
mkdir cm11
cd cm11
repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
Create local_manifest.xml in .repo folder.
PHP:
cd .repo
nano local_manifest.xml
Paste following into the terminal
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project path="device/samsung/i9082" name="pawitp/android_device_samsung_i9082" remote="github" revision="cm-11.0" />
<project path="vendor/samsung/i9082" name="k2wl/android_vendor_samsung_i9082" remote="github" revision="master" />
<project path="kernel/samsung/i9082" name="pawitp/android_kernel_samsung_i9082" remote="github" revision="cm-11.0" />
</manifest>
Save it. In nano that would be Ctrl-O and then Enter. Then Ctrl-X to exit back to a prompt. Restart bash.
Then to sync up:
HTML:
repo sync -j#
# is number of jobs you want to give for your downloading source. I use 2.
Download gonna be huge. Approx 12-15 GB.
So its gonna take while depending upon your internet connection.
You may get errors while downloading, like
HTML:
Sync exited due to fetch errors
Just restart download by
HTML:
repo sync
4. Starting Building process
PHP:
. build/envsetup.sh && time brunch i9082 -j#
Again # is meant for No. of CPU cores you have.
Building gonna take time, depending upon your computer configuration.
Any errors, post here.
I will try my best to solve problems .
Start building your own CM11...
Any suggestion welcome.
reserved for future use.
one more
Just last in case
THANKS K2wl for this amazing guide.
k2wl said:
Here starts the fun
Click to expand...
Click to collapse
Wow that's a really good guide.
You make building from a ROM/Kernel from source much simpler than it should be.
I just replaced my 12.04 LTS with 13.10 last night, was wondering if I shouldn't have, but if it's working good for your development, think I'll keep it for a while. And yes, building a fresh android build environment sucks
I'm new to android development, but so far the linux, java and php code seems mostly regular. Gonna start with kernel first, then maybe try my hand on building a ROM. Thank you for the guide! :good:
iceyhotguy said:
Wow that's a really good guide.
You make building from a ROM/Kernel from source much simpler than it should be.
I just replaced my 12.04 LTS with 13.10 last night, was wondering if I shouldn't have, but if it's working good for your development, think I'll keep it for a while. And yes, building a fresh android build environment sucks
I'm new to android development, but so far the linux, java and php code seems mostly regular. Gonna start with kernel first, then maybe try my hand on building a ROM. Thank you for the guide! :good:
Click to expand...
Click to collapse
Good. Thats the spirit.
keep 13.10. its good.
i switched to BBQLINUX just few days, until earlier i was using 13.10.
kernel develpment is not much hussle.
just be sure...dont add features which make kernel unstable.
i statred with kernel development only...:good::laugh:
and then come to ROM development.
best luck..
if any queries regarding kernel or ROM development, just ask me...i am here to help.
this can be used to build other roms too right .... by just changing the github repo to the rom u wanna build
One more question, how to apply patches?
But, k2wl.
This method builds an Odin flashable file.
How to make flashable zips, which can be flashed through custom recoveries.????
Sent from my iPhone using Tapatalk
rutvikrvr said:
this can be used to build other roms too right .... by just changing the github repo to the rom u wanna build
Click to expand...
Click to collapse
yes its gonna be useful to build other AOSP based roms. like PA,AOKP,OMNI,AICP etc... just need few modifications according to respective roms.
black87 said:
One more question, how to apply patches?
Click to expand...
Click to collapse
copy the patch file to respective directory and apply patch with following command.
HTML:
patch -p1 < patch.diff
eg. if you want to apply bluetooth patch and ur patch name is fixbluetooth.diff
then
HTML:
cd hardware/broadcom/libbt/
git checkout .
patch -p1 < fixbluetooth.diff
if any problems plz tell me..
Ateekujjawal said:
But, k2wl.
This method builds an Odin flashable file.
How to make flashable zips, which can be flashed through custom recoveries.????
Sent from my iPhone using Tapatalk
Click to expand...
Click to collapse
It builds flashable zips only ......with CWM or any other....
@k2wl im getting this error http://pastebin.com/uLy1MGew
rutvikrvr said:
@k2wl im getting this error http://pastebin.com/uLy1MGew
Click to expand...
Click to collapse
check slimrom's github source. instructions are given there.
also @k2wl said that you have to make some other modifications.
Did you try the breakfast command???
rutvikrvr said:
@k2wl im getting this error http://pastebin.com/uLy1MGew
[email protected]:~/slimrom$ . build/envsetup.sh && time brunch i9082 -j4
including device/generic/armv7-a-neon/vendorsetup.sh
including device/generic/x86/vendorsetup.sh
including device/generic/mips/vendorsetup.sh
including vendor/slim/vendorsetup.sh
including sdk/bash_completion/adb.bash
including vendor/slim/vendorsetup.sh
ls: cannot access device/*/i9082/slim.mk: No such file or directory
build/core/product_config.mk:231: *** Can not locate config makefile for product "slim_i9082". Stop.
Device i9082 not found. Attempting to retrieve device repository from SlimRoms Github (http://github.com/SlimRoms).
Repository for i9082 not found in the SlimRoms Github repository list. If this is in error, you may need to manually add it to .repo/local_manifests/slim_manifest.xml
ls: cannot access device/*/i9082/slim.mk: No such file or directory
build/core/product_config.mk:231: *** Can not locate config makefile for product "slim_i9082". Stop.
** Don't have a product spec for: 'slim_i9082'
** Do you have the right repo manifest?
No such item in brunch menu. Try 'breakfast'
real 0m22.876s
user 0m0.219s
sys 0m0.087s
Click to expand...
Click to collapse
your device folder points to device named cm_i9082, not slim_i9082. thats why.
jst open cm.mk file in device/samsung/i9082 cm.mk and edit its content to slim.
means
if it says in the line cm_i9082 change it to slim_i9082.
save it.
rename the file to slim.mk
and change one more file which will point to slim.mk
i.e androidproducts.mk
change the
HTML:
PRODUCT_MAKEFILES := \ $(LOCAL_DIR)/device_i9082.mk
to
HTML:
PRODUCT_MAKEFILES := \ $(LOCAL_DIR)/slim.mk
after that one more file to be created.
slim.dependencies.
just rename cm.dependencies to slim.dependencies.
and then try that command again.
i am attaching files for you.
jst replace them. or edit as you like.
---------------------------------------------------------------------------------------------------------------------
good to know some one started something.
you downloaded source. thats great....keep up... i will help you as much as i can....
rutvikrvr said:
@k2wl im getting this error http://pastebin.com/uLy1MGew
Click to expand...
Click to collapse
Or simply use i9082 device tree for SlimROMs from my Github. I have made all the necessary changes.
xenon92 said:
Or simply use i9082 device tree for SlimROMs from my Github. I have made all the necessary changes.
Click to expand...
Click to collapse
yep....that will do....
but i think untill and unless he do it himself, he wont understand....
@xenon92 as k2wl is saying.. Il try on my own first otherwise I'll use ur device tree if I'm not able to do it at all... Thanx fr the reply.
Sent from my GT-I9082 using XDA Premium 4 mobile app
EDIT: ITS STARTED BUILDING ..THANX FR THE SUPPORT
rutvikrvr said:
@xenon92 as k2wl is saying.. Il try on my own first otherwise I'll use ur device tree if I'm not able to do it at all... Thanx fr the reply.
Sent from my GT-I9082 using XDA Premium 4 mobile app
EDIT: ITS STARTED BUILDING ..THANX FR THE SUPPORT
Click to expand...
Click to collapse
thats the spirit of learning...keep up...
one more error http://pastebin.com/wcuPHsi0 ..pl help
device/samsung/i9082/overlay/frameworks/base/core/res/res/values/config.xml
just edit this file and delete line number 34,199,205. and save it.
just restart building again.

[ Guide ] [ Tutorial ] Compiling 64 bit Android Kernel [ Yureka ] [ NOOB Friendly ]

This is My first post on XDA
From the day I owned YUreka I always wished to compile my own kernel. I searched on the web for compiling 64bit android kernel but didn't get satisfying results. So I did some research and asked some android developers, I got help from some developers but some of the developer refused may be due to their attitude or may be they didn't want to share their ideas / knowledge. Anyways here's a guide for compiling 64 bit kernel. I have also made a video tutorial check that out [ status == uploaded ].
What will YU need :
1. Ubuntu 64 Bit OS
2. Good Internet Connection.
3. Usable Brain.
4. Basic Knowledge of Linux.
Lets Start
First we need to get some important stuff / tools / software .
1. Open Ubuntu Software center and install JDK 7 or JDK 8
2. Open terminal and run the following command
Code:
sudo apt-get install libncurses5-dev
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Code:
sudo apt-get install -y ccache &&echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a ~/.bashrc &&source ~/.bashrc && echo $PATH
Code:
export USE_CCACHE=1
Code:
mkdir ~/bin
Code:
export PATH=~/bin:$PATH
Code:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
Code:
chmod a+x ~/bin/repo
Now YU'r Linux machine is all set to compile kernel.
3. Now YU need to download a toolchain. I have uploaded the toolchain that i used for compiling the kernel. Click from here > h t t p s ://drive.google.com/open?id=0B9D4jOdpRzZHOURMTS1VaXplc0U
4. Time to download Kernel sources. For this tutorial I am using Varun Chitre's Thunderzap kernel. Here is the link for thunderzap's sources > h t t p s ://github.com/varunchitre15/thunderzap_tomato
.Select branch as cm 12.1 from left and press download on the right.
5. Make a directory "android-kernel" under "/Home" and place both the zips in "android-kernel" directory.
6. Extract both the zips. Now YU will have two folders one of toolchain and other of kernel source.
7. YU no more need the zip files just delete both the zips.
8. Open the kernel source folder and type the following code.
9. Run the following command to point the variable to toolchains path :
Code:
export CROSS_COMPILE=/home/r0h4n/android-kernel/aarch64-linux-android-4.9-uber-master/bin/aarch64-linux-android-
If YU followed along with me YU will just have to change the name of the user ( replace <r0h4n> with <YU'r username> )
10. Time to Compile your kernel :
Code:
export ARCH=arm64
Code:
export SUBARCH=arm64
Code:
export USE_CCACHE=1
Code:
make cyanogenmod_tomato-64_defconfig
The name of defconfig file may be different check it in "kernel_source/arch/arm64/defconfig/"
Code:
make menuconfig
Here YU can explore various options. I'll not explain everything in detail here.
Now the final command make. It takes a parameter -jn. Where ( n = # of threads per core + 1 )
I have a Dual core processor with 2 thread per processor so for me it is " make -j3 ".
Code:
make -j3
Now sit back and relax.......let the kernel compile
Got a compilation error ?
Post it here.
Now we need to create a flashable zip. Download this kernel flash zip from here > h t t p s : //drive.google.com/open?id=0B9D4jOdpRzZHdTJibndqQzhVdFk
1. Extract kernel.zip.
2. Navigate to tools in "/kernel".
3. Open "kernel_source/arch/arm64/boot/".
4. Copy "Image".
5. Replace it with the "Image" in "/kernel/tools/Image".
6. Copy "kernel_source/driver/stagging/prima/wlan.ko" and replace it with "kernel/system/lib/modules/wlan.ko".
7. Goto "/kernel" select all the three folders "META-INF", "system", "tools" and rezip it.
8. Flash the zip via recovery and now YU'r Phone rocks YU'r own compile kernel.
Rohan459 said:
This is My first post on XDA
Click to expand...
Click to collapse
Life saver for the 64bit part, thank you very much! :good::good::good:
some issues
Hello, i'm trying to compile this kernel (for xiaomi redmi note 3 "kenzo") https://github.com/cyanogenmod/android_kernel_xiaomi_msm8956/tree/stable/cm-13.0-ZNH5Y, and get the flashable zip.
I made a few tries and i can't do it, i going to tell you my problems and how i could fix some of them.
Error 1:
when i try to compile i get this error:
scripts/Makefile.build:455: recipe for target 'drivers/video/msm' failed
make[2]: *** [drivers/video/msm] Error 2
scripts/Makefile.build:455: recipe for target 'drivers/video' failed
make[1]: *** [drivers/video] Error 2
make[1]: *** Waiting for unfinished jobs....
I solved it changing a line in /home/user/Desktop/android_kernel_xiaomi_msm8956-stable-cm-13.0-ZNH5Y/drivers/video/msm/msm_dba/msm_dba.c
I changed #include <msm_dba_internal.h> for rhis #include "msm_dba_internal.h"
After that i get another error.
Error 2:
After solve Error 1, when i try to compile i get this error:
make[1]: *** No rule to make target 'arch/arm64/boot/dts/msm8956-mtp.dtb', needed by 'arch/arm64/boot/Image.gz-dtb'. Stop.
make[1]: *** Waiting for unfinished jobs....
OBJCOPY arch/arm64/boot/Image
/home/guille/Desktop/android_kernel_xiaomi_msm8956-stable-cm-13.0-ZNH5Y/arch/arm64/Makefile:84: recipe for target 'Image.gz-dtb' failed
make: *** [Image.gz-dtb] Error 2
make: *** Waiting for unfinished jobs....
This error i solved disabling this line #CONFIG_BUILD_ARM64_APPENDED_DTB_IMAGE=y in cyanogenmod_kenzo_defconfig, but i don't know if this is the correct way.
After that changes i get finally the image (used in the tutorial) and image.gz, then i proced to put the image and wlan.ko in in kernel.zip, but when i flash it the phone don't boot.
What can i do?
P.S.: Sorry my bad english.
Hello the friend really super guide and especially the only one or with whom I managed to compile my own kernel.
Is especially as said in the OP I contact a lot of kernel dev and nobody answered so I will have only one person to thank lol.
omega691 said:
Hello, i'm trying to compile this kernel (for xiaomi redmi note 3 "kenzo") https://github.com/cyanogenmod/android_kernel_xiaomi_msm8956/tree/stable/cm-13.0-ZNH5Y, and get the flashable zip.
I made a few tries and i can't do it, i going to tell you my problems and how i could fix some of them.
Error 1:
when i try to compile i get this error:
scripts/Makefile.build:455: recipe for target 'drivers/video/msm' failed
make[2]: *** [drivers/video/msm] Error 2
scripts/Makefile.build:455: recipe for target 'drivers/video' failed
make[1]: *** [drivers/video] Error 2
make[1]: *** Waiting for unfinished jobs....
I solved it changing a line in /home/user/Desktop/android_kernel_xiaomi_msm8956-stable-cm-13.0-ZNH5Y/drivers/video/msm/msm_dba/msm_dba.c
I changed #include <msm_dba_internal.h> for rhis #include "msm_dba_internal.h"
After that i get another error.
Error 2:
After solve Error 1, when i try to compile i get this error:
make[1]: *** No rule to make target 'arch/arm64/boot/dts/msm8956-mtp.dtb', needed by 'arch/arm64/boot/Image.gz-dtb'. Stop.
make[1]: *** Waiting for unfinished jobs....
OBJCOPY arch/arm64/boot/Image
/home/guille/Desktop/android_kernel_xiaomi_msm8956-stable-cm-13.0-ZNH5Y/arch/arm64/Makefile:84: recipe for target 'Image.gz-dtb' failed
make: *** [Image.gz-dtb] Error 2
make: *** Waiting for unfinished jobs....
This error i solved disabling this line #CONFIG_BUILD_ARM64_APPENDED_DTB_IMAGE=y in cyanogenmod_kenzo_defconfig, but i don't know if this is the correct way.
After that changes i get finally the image (used in the tutorial) and image.gz, then i proced to put the image and wlan.ko in in kernel.zip, but when i flash it the phone don't boot.
What can i do?
P.S.: Sorry my bad english.
Click to expand...
Click to collapse
Change directory and try again
Sent from my Redmi 3S using Tapatalk
i have this error:
sound/soc/msm/msm8996.c:34:26: fatal error: device_event.h: No such file or directory
#include <device_event.h>
^
compilation terminated.
i'm on ubuntu 16.04.02 x64
i think the problem is the library "libevent-dev" but i don't understand how to fix it because libevent-dev is installed
problem in yureka
i rooted my phone long back.. but i didnt used it...lots of problems in it it is in boot loop amd when ever it is luckily on wifi is not working ...it is not even displaying near by wifi and not even data connection ,i thought of new cm12 rom and flashed it stiill same issue. and more over after flashing stock cm12 and it is still in boot loop..please help
Hello there,
i am having this said problem when i follow your tutorial on how to build a 64bit kernel.
Code:
In file included from include/linux/compiler.h:54:0,
from include/uapi/linux/stddef.h:1,
from include/linux/stddef.h:4,
from /home/protox/android/berlin_kernel/include/uapi/linux/posix_types.h:4,
from include/uapi/linux/types.h:13,
from include/linux/types.h:5,
from include/linux/mod_devicetable.h:11,
from scripts/mod/devicetable-offsets.c:2:
include/linux/compiler-gcc.h:106:30: fatal error: linux/compiler-gcc7.h: No such file or directory
#include gcc_header(__GNUC__)
^
compilation terminated.
/home/protox/android/berlin_kernel/scripts/mod/Makefile:34: recipe for target 'scripts/mod/devicetable-offsets.s' failed
make[2]: *** [scripts/mod/devicetable-offsets.s] Error 1
scripts/Makefile.build:468: recipe for target 'scripts/mod' failed
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
HOSTCC scripts/dtc/livetree.o
HOSTCC scripts/dtc/srcpos.o
HOSTCC scripts/dtc/treesource.o
HOSTCC scripts/dtc/util.o
HOSTCC scripts/dtc/dtc-lexer.lex.o
HOSTCC scripts/dtc/dtc-parser.tab.o
HOSTLD scripts/dtc/dtc
Makefile:559: recipe for target 'scripts' failed
make: *** [scripts] Error 2
make: *** Waiting for unfinished jobs....
Can you please help me out mate
Thanks
hello sir can you help me please??
my device is redmi note 4x ( mido ) snapdragon 625 64 bit i build kernel without error but when i want to flash it on my device
device not boot to system but to fastboot mod and need to flash other kernel to make it boot ?? any idea about that ?
Compiling kernrl
I need some help if any body is out there .after months of trying and trying i am finally able to compli my kernel .after is completes with no error i go to arch/arm64/boot and all i have is am image.gz and and image no ziamge or nothing ive goigle it but i cant figure out whats the next step
akino553 said:
hello sir can you help me please??
my device is redmi note 4x ( mido ) snapdragon 625 64 bit i build kernel without error but when i want to flash it on my device
device not boot to system but to fastboot mod and need to flash other kernel to make it boot ?? any idea about that ?
Click to expand...
Click to collapse
The kernel has not compiled properly...
fowler82 said:
I need some help if any body is out there .after months of trying and trying i am finally able to compli my kernel .after is completes with no error i go to arch/arm64/boot and all i have is am image.gz and and image no ziamge or nothing ive goigle it but i cant figure out whats the next step
Click to expand...
Click to collapse
Find a zip with the image.gz and image file and replace the files with ur compiled files.
Rohan459 said:
Find a zip with the image.gz and image file and replace the files with ur compiled files.
Click to expand...
Click to collapse
Once I build the kernel and I build the modules how do i find them to load them does anybody no
Toolchains
fowler82 said:
Once I build the kernel and I build the modules how do i find them to load them does anybody no
Click to expand...
Click to collapse
go in kernel root directory and within search box look for .ko files. It will give you a list of modules from where you can copy them and paste in your new ROM system/lib/modules directory.
can any device use the kernel.zip to flash the boot.img after replacing wlan.ko ?
Rohan459 said:
This is My first post on XDA
From the day I owned YUreka I always wished to compile my own kernel. I searched on the web for compiling 64bit android kernel but didn't get satisfying results. So I did some research and asked some android developers, I got help from some developers but some of the developer refused may be due to their attitude or may be they didn't want to share their ideas / knowledge. Anyways here's a guide for compiling 64 bit kernel. I have also made a video tutorial check that out [ status == uploaded ].
What will YU need :
1. Ubuntu 64 Bit OS
2. Good Internet Connection.
3. Usable Brain.
4. Basic Knowledge of Linux.
Lets Start
First we need to get some important stuff / tools / software .
1. Open Ubuntu Software center and install JDK 7 or JDK 8
2. Open terminal and run the following command
Code:
sudo apt-get install libncurses5-dev
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Code:
sudo apt-get install -y ccache &&echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a ~/.bashrc &&source ~/.bashrc && echo $PATH
Code:
export USE_CCACHE=1
Code:
mkdir ~/bin
Code:
export PATH=~/bin:$PATH
Code:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
Code:
chmod a+x ~/bin/repo
Now YU'r Linux machine is all set to compile kernel.
3. Now YU need to download a toolchain. I have uploaded the toolchain that i used for compiling the kernel. Click from here > h t t p s ://drive.google.com/open?id=0B9D4jOdpRzZHOURMTS1VaXplc0U
4. Time to download Kernel sources. For this tutorial I am using Varun Chitre's Thunderzap kernel. Here is the link for thunderzap's sources > h t t p s ://github.com/varunchitre15/thunderzap_tomato
.Select branch as cm 12.1 from left and press download on the right.
5. Make a directory "android-kernel" under "/Home" and place both the zips in "android-kernel" directory.
6. Extract both the zips. Now YU will have two folders one of toolchain and other of kernel source.
7. YU no more need the zip files just delete both the zips.
8. Open the kernel source folder and type the following code.
9. Run the following command to point the variable to toolchains path :
Code:
export CROSS_COMPILE=/home/r0h4n/android-kernel/aarch64-linux-android-4.9-uber-master/bin/aarch64-linux-android-
If YU followed along with me YU will just have to change the name of the user ( replace <r0h4n> with <YU'r username> )
10. Time to Compile your kernel :
Code:
export ARCH=arm64
Code:
export SUBARCH=arm64
Code:
export USE_CCACHE=1
Code:
make cyanogenmod_tomato-64_defconfig
The name of defconfig file may be different check it in "kernel_source/arch/arm64/defconfig/"
Code:
make menuconfig
Here YU can explore various options. I'll not explain everything in detail here.
Now the final command make. It takes a parameter -jn. Where ( n = # of threads per core + 1 )
I have a Dual core processor with 2 thread per processor so for me it is " make -j3 ".
Code:
make -j3
Now sit back and relax.......let the kernel compile
Got a compilation error ?
Post it here.
Now we need to create a flashable zip. Download this kernel flash zip from here > h t t p s : //drive.google.com/open?id=0B9D4jOdpRzZHdTJibndqQzhVdFk
1. Extract kernel.zip.
2. Navigate to tools in "/kernel".
3. Open "kernel_source/arch/arm64/boot/".
4. Copy "Image".
5. Replace it with the "Image" in "/kernel/tools/Image".
6. Copy "kernel_source/driver/stagging/prima/wlan.ko" and replace it with "kernel/system/lib/modules/wlan.ko".
7. Goto "/kernel" select all the three folders "META-INF", "system", "tools" and rezip it.
8. Flash the zip via recovery and now YU'r Phone rocks YU'r own compile kernel.
Click to expand...
Click to collapse
created kernel using tutorial,,,but this kernel boots in fastboot mode only..
dont know why..
device is lenovo k6 note(sd430 msm8937)
please help
i am facing this error and can not resolve the problem.
property '#gpio-cells' in node /soc/msm_cdc_pinctrl_us_euro_sw or bad phandle (referred from /soc/sound:qcom,cdc-us-eu-gpios[0])
arch/arm64/boot/dts/qcom/msm8953-pmi8937.dtb: Warning (gpios_property): Missing property '#gpio-cells' in node /soc/cdc_comp_pinctrl or bad phandle (referred from /soc/sound:qcom,cdc-comp-gpios[0])
arch/arm64/boot/dts/qcom/msm8953-pmi8937.dtb: Warning (gpios_property): Missing property '#gpio-cells' in node /soc/msm_cdc_pinctrl_pri or bad phandle (referred from /soc/sound:qcom,pri-mi2s-gpios[0])
arch/arm64/boot/dts/qcom/msm8953-pmi8937.dtb: Warning (gpios_property): Missing property '#gpio-cells' in node /soc/msm_cdc_pinctrl_quin or bad phandle (referred from /soc/sound:qcom,quin-mi2s-gpios[0])
arch/arm64/boot/dts/qcom/msm8953-pmi8937.dtb: Warning (gpios_property): Missing property '#gpio-cells' in node /soc/msm_cdc_pinctrl_us_euro_sw or bad phandle (referred from /soc/sound-9335:qcom,cdc-us-eu-gpios[0])
arch/arm64/boot/dts/qcom/msm8953-pmi8937.dtb: Warning (gpios_property): Missing property '#gpio-cells' in node /soc/msm_cdc_pinctrl_quin or bad phandle (referred from /soc/sound-9335:qcom,quin-mi2s-gpios[0])
arch/arm64/boot/dts/qcom/msm8953-pmi8937.dtb: Warning (interrupts_property): interrupts size is (12), expected multiple of 8 in /soc/[email protected]
CC lib/mpi/generic_mpih-lshift.o
DTC arch/arm64/boot/dts/qcom/msm8953-ext-codec-rcm-overlay.dtbo
Error: ../arch/arm64/boot/dts/qcom/msm8953-audio-cdp.dtsi:14.1-11 syntax error
FATAL ERROR: Unable to parse input tree
scripts/Makefile.dtbo:24: recipe for target 'arch/arm64/boot/dts/qcom/msm8953-ext-codec-rcm-overlay.dtbo' failed
make[3]: *** [arch/arm64/boot/dts/qcom/msm8953-ext-codec-rcm-overlay.dtbo] Error 1
../scripts/Makefile.build:653: recipe for target 'arch/arm64/boot/dts/qcom' failed
make[2]: *** [arch/arm64/boot/dts/qcom] Error 2
arch/arm64/Makefile:194: recipe for target 'dtbs' failed
make[1]: *** [dtbs] Error 2
make[1]: *** Waiting for unfinished jobs..

[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

Categories

Resources