Building Lineageos from source. Kernel issues after config update - Android Q&A, Help & Troubleshooting

Hi all I'm trying to build a Lineageos 14.1 from source, as i'm trying to add support for a USB Wifi card.
I'm using the "UNOFFICIAL Lineage OS for Samsung Galaxy S5+ / G901F / kccat6xx" source originally worked on by sktjdgns1189 then forked to 14.1 by ionkiwi and github-cygwin on git hub. I've had some degree of success compiling the source code to an installable file. However. As soon as i start messing with the kernel config, even if i open the menuconfig making no changes but save and recompile using the following process...
Step1
make ARCH=arm cyanogenmod_kccat6_defconfig VARIANT_DEFCONFIG=dummy_defconfig SELINUX_DEFCONFIG=selinux_defconfig
Click to expand...
Click to collapse
and open the config page using...
Step2
make ARCH=arm menuconfig
Click to expand...
Click to collapse
Make no changes but save and quit then copy the file back.
Step3
cp ~/cm14.1/kernel/samsung/kccat6/.config ~/cm14.1/kernel/samsung/kccat6/arch/arm/configs/cyanogenmod_kccat6_defconfig
Click to expand...
Click to collapse
and recompile with
Step4
make -j16 ARCH=arm
Click to expand...
Click to collapse
All the above works without any problems and the kernel compile completes successfully. However. when I try and create the new LineageOS image, fully recompiling the whole ROM with the new kernel config, i get the following errors.
Scripts/selinux/genheaders/genheaders
In file included from /home/simon/cm14.1/kernel/samsung/kccat6/include/linux/types.h:5:0,
from /home/simon/cm14.1/kernel/samsung/kccat6/include/linux/mod_devicetable.h:11,
from /home/simon/cm14.1/kernel/samsung/kccat6/scripts/mod/devicetable-offsets.c:2:
/home/simon/cm14.1/kernel/samsung/kccat6/include/uapi/linux/types.h:4:23: fatal error: asm/types.h: No such file or directory
#include <asm/types.h>
^
compilation terminated.
/home/simon/cm14.1/kernel/samsung/kccat6/scripts/mod/Makefile:34: recipe for target 'scripts/mod/devicetable-offsets.s' failed
make[3]: *** [scripts/mod/devicetable-offsets.s] Error 1
make[3]: *** Waiting for unfinished jobs....
Click to expand...
Click to collapse
This is really messing with my head. The LineageOS build all compiles fine, up until try and save a config (without changes). What am i doing wrong? The kernel compiles without errors on it's own, but not as part of the LineageOS brunch build.
I can fix the types.h error by creating a symbolic link for generic-asm to asm. but then i hit more errors later in other modules. The weired thing is it all compiles out of the straight from the repo I only run into problems when I've recompiled the kernel. Even without the changes to the config files it imports in step 1 above. When i get the kernel to successfully recompile with LineageOS, I want to add the following.
"Networking support" -> "Wireless"
<*> Common routines for IEEE802.11 drivers
<*> Generic IEEE 802.11 Networking Stack (mac80211)
"Device Drivers" -> "Network device support" -> "Wireless LAN"
[*] Realtek 8187 and 8187B USB support
"Device Drivers" -> "Network device support" -> "Wireless LAN" -> "Realtek wireless card support"
[*] Debugging output for rtlwifi driver family (NEW) ¦ ¦
<*> Realtek RTL8192CE/RTL8188CE Wireless Network Adapter
<*> Realtek RTL8192CU/RTL8188CU USB Wireless Network Adapter
Click to expand...
Click to collapse
Can anyone point me in the right direction?

My build notes so far... (I've had to deface the u.r.l.s below to post as i'm under 10 remove the ~'s
#How to build an Android Kernel
#1. Install Ubuntu...
#2. add java
add-apt-repository ppa:webupd8team/java
apt-get update
sudo apt-get install openjdk-8-jre
sudo apt-get install openjdk-8-jdk
#3. Install compilers
install sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \
libgl1-mesa-dev libxml2-utils xsltproc unzip
sudo apt-get install python-networkx
sudo apt-get install lzop
#4. CONFIGURE GIT
mkdir ~/bin
c~u~r~l [ u~r~l ]h~t~t~p~s:~/~/storage.googleapis~c~o~m/git-repo-downloads/repo [ ~/~u~r~l] > ~/bin/repo
chmod a+x ~/bin/repo
git config --global user.name "YourGitname"
git config --global user.email "[email protected]"
#5. Add your source
mkdir cm14.1
cd cm14.1
repo init -u .g~i~t~:~/~/~github.c~o~m/LineageOS/android.git -b cm-14.1
#7. Add the unoffical stuff from kccat6xx git repos
mkdir ~/.repo/local_manifests
#8 create this file here paste the content of this xml into the file to get all the samsung device drivers for this device.
#[~u~r~l~]~h~t~t~p~s~:~/~/~github.c~o~m/github-cygwin/kccat6xx-roomservice.git[~/~u~r~l]
gedit ~/cm14.1/.repo/local_manifests/roomservice.xml
#9 Run the repo sync to get all the source locally. This takes ages to download.
~/bin/repo sync
#10. Settup environment vars to cross compile the kernel
export PATH=~/cm14.1/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin:$PATH
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=arm-eabi-
#9. initialise the environment
source build/envsetup.sh
#10. run breakfast
breakfast kccat6xx
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ START - This block breaks it the compile but leave it out and the ROM compiles~~~~~~~~~~~~~~~~
##11. Backup your original Kernel config
#mkdir ~/cm14.1/kernel/samsung/kccat6/arch/arm/configs/backups
#cp ~/cm14.1/kernel/samsung/kccat6/arch/arm/configs/*kccat6* ~/cm14.1/kernel/samsung/kccat6/arch/arm/configs/backups
#cp ~/cm14.1/kernel/samsung/kccat6/arch/arm/configs/*apq8084* ~/cm14.1/kernel/samsung/kccat6/arch/arm/configs/backups
##12. Make config files
#cd ~/cm14.1/kernel/samsung/kccat6
#make ARCH=arm cyanogenmod_kccat6_defconfig VARIANT_DEFCONFIG=dummy_defconfig SELINUX_DEFCONFIG=selinux_defconfig
##~~~~ These are the changes i want to make - even if i don't save and exit from the menuconfig it fails~~~~~~
#
##13. Now configure the kernel with any changes you want to make#
# make ARCH=arm menuconfig
#
# "Networking support" -> "Wireless"
# <*> Common routines for IEEE802.11 drivers
# <*> Generic IEEE 802.11 Networking Stack (mac80211)
#
# "Device Drivers" -> "Network device support" -> "Wireless LAN"
# [*] Realtek 8187 and 8187B USB support
#
# "Device Drivers" -> "Network device support" -> "Wireless LAN" -> "Realtek wireless card support"
# [*] Debugging output for rtlwifi driver family (NEW)
# <*> Realtek RTL8192CE/RTL8188CE Wireless Network Adapter
# <*> Realtek RTL8192CU/RTL8188CU USB Wireless Network Adapter
#
##~~~~ These are the changes i want to make - even if i don't save and exit from the menuconfig it fails~~~~~~
##14. Copy your new config to the kernel config directory for your device
#cp ~/cm14.1/kernel/samsung/kccat6/.config ~/cm14.1/kernel/samsung/kccat6/arch/arm/configs/cyanogenmod_kccat6_defconfig
##15. recompile the kernel
#make -j16 ARCH=arm
#go back to the top of your stack in my case ~/cm14.1
#cd ~/cm14.1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ END - This bit breaks it the compile but leave it out and the ROM compiles ~~~~~~~~~~~~~~~~~~~~~
#16. Compile the ROM
brunch kccat6xx
#If you left out steps 11 - 15 the ROM will compile. How do I compile the new ROM with my changes successfully? why do i get loads
#of errors when i change the kernel from it's default. Other examples where people have done this seem to work?
Click to expand...
Click to collapse
Any ideas greatly appreciated. I've hit a brick wall and google no longer appears to be my friend

Have you got your solution ?

Related

Help with compiling / porting MultiRom / TWRP for Aquaris E5?

I would like to have a dual boot (Android / Ubuntu Touch) on an Aquaris E5 HD phone ( the Ubuntu Touch variant can be flashed with stock Android and vice versa, see mibqyyo.com/en-articles/2015/09/16/ubuntu-android-installation-process-for-bq-aquaris-e4-5-and-e5 ). ((sorry for the links, new user))
Unfortunately, the instructions from wiki.ubuntu.com/Touch/DualBootInstallation do not work with this phone anymore: it seems that the software in those instructions relies on the device having custom ClockworkMod (CWM) recovery -- and, it seems ClockworkMod does not support this device anymore, if it ever did ( see askubuntu.com/questions/666070/cant-install-ubuntu-touch-dual-boot-on-mobile-stuck-in-waiting-for-device/776357 ).
The only other option I could see for dual boot is MultiROM Manager, unfortunately it fails with "This is unsupported device (Aquaris_E5_HD)!"
However, it is possible to root this phone using a TeamWin Recovery Project (TWRP) custom recovery image ( v3.0.2-0, see mibqyyo.com/comunidad/discussion/77467/how-to-root-a-bq-aquaris-e5-hd-phone ), which seemingly does support this phone. Furthermore, from twrp.me/devices/bqaquarise5hd.html there is a reference to:
Device Tree / files: github.com/TeamWin/android_device_bq_vegetahd - and from there:
Kernel source available on: github.com/bq/aquaris-E5
So, I thought - maybe it would be possible to port / build MultiROM from source, with support for this device? I tried something, and maybe I even got part of the way - unfortunately I cannot get the build to complete, so I hope I can get some assistance here. I will outline the steps I did below. First of all, I use this as my PC:
Code:
$ uname -a
Linux MYPC 4.2.0-38-generic #45~14.04.1-Ubuntu SMP Thu Jun 9 09:27:51 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/issue
Ubuntu 14.04.4 LTS \n \l
Then I looked at github.com/Tasssadar/multirom/wiki/Porting-MultiROM:
Prerequisites
* Android 4.1+ tree
* TWRP ported to your device. There are guides on the internet on how to do that.
* Kernel sources
Downloading sources
Just clone TWRP, MultiROM and libbootimg repos into your Android Tree, the commands would look something like this: [...]
Click to expand...
Click to collapse
I was somewhat puzzled about what this "Android Tree" is, but eventually I guessed it is the Android Open Source Project (AOSP) source code. So, I looked and did this:
source.android.com/source/initializing.html
(Note: http removed from links in code below, because I'm a new user and cannot post links):
Code:
cd /tmp
wget archive.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jre-headless_8u45-b14-1_amd64.deb
wget archive.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jre_8u45-b14-1_amd64.deb
wget archive.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jdk_8u45-b14-1_amd64.deb
sudo dpkg -i openjdk-8-jre-headless_8u45-b14-1_amd64.deb
sudo dpkg -i openjdk-8-jre_8u45-b14-1_amd64.deb
sudo dpkg -i openjdk-8-jdk_8u45-b14-1_amd64.deb
sudo apt-get -f install
# already have libgl1-mesa-dev-lts-wily mesa-common-dev-lts-wily
# so removed libgl1-mesa-dev from list below:
sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \
libxml2-utils xsltproc unzip
sudo apt-get autoremove --purge
wget -S -O - source.android.com/source/51-android.rules | sed "s/<username>/$USER/" | sudo tee >/dev/null /etc/udev/rules.d/51-android.rules
# for the aquaris:
echo "SUBSYSTEM==\"usb\", ATTRidVendor==\"2a47\", ATTRidProduct==\"201d\", MODE=\"0600\", OWNER=\"$USER\"" \
| sudo tee -a /etc/udev/rules.d/51-android.rules
sudo udevadm control --reload-rules
then
source.android.com/source/downloading.html
Code:
mkdir ~/bin
PATH=~/bin:$PATH
curl storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
cd /path/to/src
mkdir AOSP
cd AOSP
repo init -u android.googlesource.com/platform/manifest -b android-4.1.2_r2.1 2>&1 | tee repo.log
repo sync
Note that here, I took the `4.1+` requirement quite literally, so just chose to checkout the last 4.1 branch, `4.1.2_r2.1`.
Also, repo sync took 14+ hours to complete, for my PC+Internet connection combo (!)
With that done, I have this in the directory:
Code:
AOSP$ ls
abi cts docs hardware ndk prebuilts
bionic dalvik external libcore packages repo.log
bootable development frameworks libnativehelper pdk sdk
build device gdk Makefile prebuilt system
Now, at this point, we should be running build/envsetup.sh and lunch; however, that will cause only the default Google devices (Nexus etc) to be recognized. So, here I did cloned the "device tree" (I guess) into the "Android tree":
Code:
AOSP$ mkdir device/bq
AOSP$ git clone github.com/TeamWin/android_device_bq_vegetahd device/bq/vegetahd
AOSP$ chmod +x device/bq/vegetahd/vendorsetup.sh
AOSP$ ls device/bq/vegetahd/
AndroidBoard.mk BoardConfig.mk kernel omni_vegetahd.mk recovery
AndroidProducts.mk device.mk mkbootimg.mk README.md vendorsetup.sh
AOSP$ ls device/samsung/crespo # for comparison
Android.mk full_crespo.mk libsensors recovery
AndroidProducts.mk gps.conf libstagefrighthw recovery.fstab [...]
vendorsetup.sh
and also cloned the Omnirom TWRP recovery sources (note that if you just mv bootable/recovery bootable/old.recovery, then the builds process may also pick some of those files up, so that directory should be deleted, as guides elsewhere recommend):
Code:
AOSP$ rm -rf bootable/recovery
cd bootable
git clone https://github.com/omnirom/android_bootable_recovery.git recovery-twrp
cd ..
Since build/envsetup.sh should be running the vendorsetup.sh when it finds them, after running it, the Aquaris device should be visible:
Code:
AOSP$ source build/envsetup.sh
including device/asus/grouper/vendorsetup.sh
including device/bq/vegetahd/vendorsetup.sh # ***
including device/generic/armv7-a-neon/vendorsetup.sh
including device/generic/armv7-a/vendorsetup.sh
including device/moto/wingray/vendorsetup.sh
including device/samsung/crespo/vendorsetup.sh
including device/samsung/maguro/vendorsetup.sh
including device/ti/panda/vendorsetup.sh
including sdk/bash_completion/adb.bash
AOSP$ lunch
You're building on Linux
Lunch menu... pick a combo:
1. full-eng
2. full_x86-eng
3. vbox_x86-eng
4. full_grouper-userdebug
5. omni_vegetahd-eng # ***
6. mini_armv7a_neon-userdebug
7. mini_armv7a-userdebug
8. full_wingray-userdebug
9. full_crespo-userdebug
10. full_maguro-userdebug
11. full_panda-userdebug
Which would you like? [full-eng] 5
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.1.2
TARGET_PRODUCT=omni_vegetahd
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.2.0-38-generic-x86_64-with-Ubuntu-14.04-trusty
HOST_BUILD_TYPE=release
BUILD_ID=JZO54M
OUT_DIR=out
============================================
Now, it seems that for such an old version like 4.1.2_r2.1, there is no mka command (not found), which should otherwise be ran at this point - however, I can run make instead of it.
Also because it's so old, I get "You are attempting to build with the incorrect version of java. Your version is: openjdk version "1.8.0_45-internal". The correct version is: Java SE 1.6.", which it so happens, I have - but I have to set environment variables. So here I run:
Code:
AOSP$ export RECOVERY_VARIANT=twrp
AOSP$ ANDROID_PRE_BUILD_PATHS=/path/to/jdk1.6.0_45/bin \
ANDROID_JAVA_TOOLCHAIN=/path/to/jdk1.6.0_45/bin \
JAVA_HOME=/path/to/jdk1.6.0_45 \
PATH=/path/to/jdk1.6.0_45/bin:$PATH \
make -j3 recoveryimage
...
target thumb C: adbd <= system/core/adb/log_service.c
make: *** No rule to make target `out/target/product/vegetahd/obj/EXECUTABLES/recovery_intermediates/recovery', needed by `out/target/product/vegetahd/recovery.img'. Stop.
make: *** Waiting for unfinished jobs....
target thumb C: adbd <= system/core/adb/utils.c
... but as you can see, it fails. This was for the Omnirom sources of TWRP recovery.
Then I thought of going back to the Multirom porting, and so did this:
Code:
AOSP$ rm -r bootable/recovery-twrp
git clone github.com/Tasssadar/Team-Win-Recovery-Project.git bootable/recovery
git clone github.com/Tasssadar/multirom.git system/extras/multirom
git clone github.com/Tasssadar/libbootimg.git system/extras/libbootimg
cd system/extras/multirom
git submodule update --init
cd ../../..
Then I checked the touchpad from adb shell as root:
Code:
cat /proc/bus/input/devices
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="mtk-tpd"
P: Phys=
S: Sysfs=/devices/virtual/input/input3
U: Uniq=
H: Handlers=mouse0 event3 cpufreq
B: PROP=2
B: EV=b
B: KEY=10 0 0 0 0 0 0 0 400 0 0 0 0 1000 40000000 100000 0 0 0
B: ABS=6630000 1000003
... so definitely "type b"; then by doing `find /sys | grep uevent` and comparing as in the porting guide, I put together this file as device/bq/vegetahd/mr_init_devices.c:
Code:
#include <stdlib.h>
// These are paths to folders in /sys which contain "uevent" file
// need to init this device.
// MultiROM needs to init framebuffer, mmc blocks, input devices,
// some ADB-related stuff and USB drives, if OTG is supported
// You can use * at the end to init this folder and all its subfolders
const char *mr_init_devices[] =
{
"/sys/devices/platform/mtkfb.0/graphics/fb0",
"/sys/devices/platform/mtkfb.0",
"/sys/devices/platform/mtk-msdc.0",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0boot0",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0boot1",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0rpmb",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p1",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p2",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p3",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p4",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p5",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p6",
"/sys/devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p7",
"/sys/devices/platform/mtk-msdc.1",
"/sys/devices/platform/mtk-msdc.1/mmc_host/mmc1",
"/sys/devices/platform/mtk-msdc.1/mmc_host/mmc1/mmc1:0007",
"/sys/devices/platform/mtk-msdc.1/mmc_host/mmc1/mmc1:0007/block/mmcblk1/mmcblk1p1",
"/sys/devices/platform/mtk-msdc.1/mmc_host/mmc1/mmc1:0007/block/mmcblk1",
"/sys/bus/mmc/uevent",
"/sys/bus/mmc/drivers/mmcblk/uevent",
"/sys/bus/sdio/uevent",
"/sys/devices/virtual/input/*",
"/sys/devices/virtual/misc/uinput",
"/sys/devices/platform/mtk-tpd",
"/sys/devices/platform/mtk-kpd",
"/sys/devices/platform/mtk-kpd/input/input0",
"/sys/devices/platform/mtk-kpd/input/input0/event0",
"/sys/devices/platform/mtk-kpd/misc/mtk-kpd",
// for adb
"/sys/devices/virtual/tty/ptmx",
"/sys/devices/virtual/misc/android_adb",
"/sys/devices/virtual/android_usb/android0/f_adb",
"/sys/bus/usb",
NULL // must be NULL-terminated
}
Then I inspected boot.img of the stock Android firmware:
Code:
$ /path/to/bootimg_tools/boot_info /path/to/bq/2.1.0_20151104-0859_E5HD_bq-FW/boot.img
Page size: 2048 (0x00000800)
Kernel size: 3747904 (0x00393040)
Ramdisk size: 615529 (0x00096469)
Second size: 0 (0x00000000)
Board name: fbcdadc
Command line: ''
Base address: 2147483648 (0x80000000)
... and also did:
Code:
mkdir device/bq/vegetahd/mrom-infos/
wget raw.githubusercontent.com/Tasssadar/device_asus_grouper/cm-10.2-mrom/mrom_infos/ubuntu_touch.txt -O device/bq/vegetahd/mrom-infos/ubuntu_touch.txt
... and confirmed paths, and could finally add this to device/bq/vegetahd/BoardConfig.mk :
Code:
#MultiROM config. MultiROM also uses parts of TWRP config
MR_INPUT_TYPE := type_b
MR_INIT_DEVICES := device/bq/vegetahd/mr_init_devices.c
MR_RD_ADDR := 0x82500000
MR_DPI := hdpi
MR_DPI_FONT := 216
MR_FSTAB := device/bq/vegetahd/recovery/etc/twrp.fstab
MR_KEXEC_MEM_MIN := 0x85000000
MR_INFOS := device/bq/vegetahd/mrom_infos
Here, if I run ... make ... (after first exiting the old terminal shell, and repeating envsetup.sh / lunch in a new one), I get "build/core/base_rules.mk:103: *** user tag detected on new module - user tags are only supported on legacy modules. Stop." So, I did these changes:
Code:
# bootable/recovery/Android.mk:
LOCAL_MODULE := recovery
LOCAL_MODULE_TAGS := optional # add
# bootable/recovery/tests/Android.mk:
LOCAL_MODULE := asn1_decoder_test
LOCAL_MODULE_TAGS := optional # add
Then, a ... make ... at this point fails with: "make: *** No rule to make target `out/target/product/vegetahd/system/xbin/busybox', needed by `out/target/product/vegetahd/obj/SHARED_LIBRARIES/libbmlutils_intermediates/teamwin'. Stop.".
Here I found "[DEV]How to compile TWRP touch recovery - Pg. 150 | Android Development and Hacking" ( forum.xda-developers.com/showthread.php?p=65556586 ), and I downloaded busybox.zip from that page - and did:
Code:
AOSP$ unzip busybox.zip
AOSP$ mv busybox external/
Now, the ... make ... at this point is a bit funny, because it will exit not reporting an error, as if it finished:
Code:
AOSP$ ANDROID_PRE_BUILD_PATHS=/path/to/jdk1.6.0_45/bin \
ANDROID_JAVA_TOOLCHAIN=/path/to/jdk1.6.0_45/bin \
JAVA_HOME=/path/to/jdk1.6.0_45 \
PATH=/path/to/jdk1.6.0_45/bin:$PATH \
make -j3 recoveryimage
...
GEN include/usage_compressed.h
GEN include/applet_tables.h
HOSTCC applets/usage_pod
GEN include/bbconfigopts.h
CC applets/applets.o
LD applets/built-in.o
make[1]: Leaving directory `/media/Data1/src/AOSP/external/busybox'
AOSP$
But here it is apparently just done with applets in busybox! So, I try running ... make ... again, and get:
Code:
external/busybox/android/librpc/bindresvport.c:41:13: error: conflicting types for '__set_errno'
bionic/libc/include/errno.h:45:15: note: previous declaration of '__set_errno' was here
This I fix by changing external/selinux/libsepol/include to external/libsepol/include in:
Code:
# external/busybox/Android.mk:
BUSYBOX_C_INCLUDES = \
$(BB_PATH)/include $(BB_PATH)/libbb \
bionic/libc/private \
bionic/libm/include \
bionic/libc \
bionic/libm \
libc/kernel/common \
external/libselinux/include \
external/libsepol/include \
...
... and at this point, ... make ... will fail with:
Code:
external/busybox/android/librpc/pmap_rmt.c:235:8: warning: implicit declaration of function 'inet_makeaddr' [-Wimplicit-function-declaration]
external/busybox/android/librpc/pmap_rmt.c:238:8: warning: implicit declaration of function 'inet_netof' [-Wimplicit-function-declaration]
external/busybox/android/librpc/pmap_rmt.c:235:19: error: incompatible types when assigning to type 'struct in_addr' from type 'int'
Here I found stackoverflow.com/questions/27762475/incompatible-types-when-assigning-to-type-struct-in-addr-from-type-int/27763398, which notes:
The error message is misleading, the function is simply missing from earlier versions of the NDK.
Click to expand...
Click to collapse
So, as a final try, I tried forcing a newer NDK through an environment variable, as in:
Code:
NDK_HOME=/path/to/android-ndk-r10e \
ANDROID_PRE_BUILD_PATHS=/path/to/jdk1.6.0_45/bin \
ANDROID_JAVA_TOOLCHAIN=/path/to/jdk1.6.0_45/bin \
JAVA_HOME=/path/to/jdk1.6.0_45 \
PATH=/path/to/jdk1.6.0_45/bin:$PATH \
make -j3 recoveryimage
... but this fails in exactly the same manner (with "implicit declaration of function 'inet_makeaddr'", etc).
At this point, I really don't know what I should do... Should I:
Try to use the BQ Kernel sources for this device (even if mentioned above, I haven't used them anywhere yet) somewhere (say clone them in the Android tree)? If so - where?
Try to find a busybox for AOSP 4.1.2? If so - what version is OK, and where do I find it?
Try to bump the AOSP repo version up from 4.1.2? If so, what would be the minimum version required so this builds - and would I have to wait 14+ hours again?
... or is there anything else I could try?
Again, I'm mostly interested in building MultiROM and the recovery image (TWRP?) required for it on the Aquaris E5 - but it would be nice to know how to build TWRP proper recovery image as well...
Thanks in advance for any hints...
Me too
I am planning on doing almost the exact same thing you're trying! But I have a few questions:
Have you tried adding --depth 1 to your repo command to reduce the download time?
Have you seen https://forum.xda-developers.com/showthread.php?t=2329228 ? Mainly the local manifest, also to reduce download time
Why do you want to use the lowest version possible? The TWRP device tree is for Android 5.1, so I'll be using that version.

[GUIDE] Build CM12.1 from source for Note 3 Neo

I would like to have more roms for this device and guide how to make rom based on my source/work
Note: There is no need to credit me , but yeah i will admire if you mention me for this
SO before we start lets get some things cleared
You have quad core CPU
You have atleast 4GB ram
Stable Internet
Linux Installed ( I am using ubuntu 14.04 LTS)
Brain.apk
Getting started
Installing the required packages
Easy just open a terminal.
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \
libgl1-mesa-dev libxml2-utils xsltproc unzip
Installing JAVA
Code:
sudo apt-get update
sudo apt-get install openjdk-7-jdk
Getting ready with repo
Code:
mkdir ~/bin && PATH=~/bin:$PATH && echo 'PATH=~/bin:$PATH' >> ~/.bashrc && curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo
Settings up the GIT
Before doing the below step head over to github.com and make a git account
Code:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
Making CyanogeMod 12.1
First we will make a folder where we can hold our repos and source codes
Code:
mkdir ~/cm-12.1/
Now we will sync the cm sources.. depending on your internet speed it may take mins , hours and days. (for me 30 to 60 mins)
Code:
cd ~/cm-12.1/ && repo init -u https://github.com/CyanogenMod/android.git -b cm-12.1
repo sync -j4
Getting note 3 neo codes, vendor and etc
Code:
cd ~/cm-12.1/ && git clone https://github.com/FireLord1/android_.repo_local_manifests_n3n.git -b cm-12.1 .repo/local_manifests
repo sync -j4 --force-sync
Building the ROM
Code:
cd ~/cm-12.1
source build/envsetup.sh
lunch (now select your device 3g is hl3g and 4g is hllte and select userdebug)
brunch (your device codename like cm_hl3g-userdebug)
Thats all for now if you face any error try googling the dev is not free man!
Thank U fire lord U can do anything thanks For showing interest on our device
nice thank you very much for this
but i hate ubuntu's terminal , no ctrl+c, ctrl+v -.-
EDit
bash: /home/berk/bin/repo: Permission denied
i get this error when i setup the repo before downloading
Any help? @FireLord
TimurAlaskara_TR said:
nice thank you very much for this
but i hate ubuntu's terminal , no ctrl+c, ctrl+v -.-
EDit
bash: /home/berk/bin/repo: Permission denied
i get this error when i setup the repo before downloading
Any help? @FireLord
Click to expand...
Click to collapse
Try doing in superuser mode
Code:
sudo su
Sent from FireLord's device

Establishing Android Build Enviroment under openSuse Leap

Tutorial how set up Android Build Enviroment on openSUSE Leap
If this help's u hit Thanks!
1) If you don’t have fresh installed openSUSE Leap first you need remove all Java installation, many people might have the wrong version of Java installed.
Code:
sudo zypper remove openjdk-* icedtea-* icedtea6-*
Follow the on-screen instructions to remove any stray Java versions. Otherwise, move on to the next step.
2) Install the main build tools with this command:
Code:
sudo zypper install bison curl flex git gnupg gperf libesd-devel liblz4-1_4 ncurses-devel libSDL-devel python-wxWi dgets-devel libxml2-2 libxml2-tools lzop java-1.7.0-openjdk java-1.7.0-openjdk-devel schedtool squashfs libxslt1 zip zlib-devel make gcc-c++
Appendx A to 2:
To setup maven which is needed for building:
1. Download maven:
wget http://mirrors.ibiblio.org/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
2. Extract the file
tar -xvzf apache-maven-3.3.9-bin.tar.gz /tmp
3. Move to /opt/ folder
sudo mv /tmp/apache-maven-3.3.9 /opt/
4. Update environment, cd to home directory
cd ~
nano .bashrc
5. Append the path
export PATH=$PATH:/opt/apache-maven-3.3.9/bin
6. Reload
source .bashrc
7. Verify maven
mvn --version
Appendix B to 2:
For 64-bit system also install:
sudo zypper install glibc-devel-32bit ncurses-devel-32bit readline-devel-32bit libz1-32bit
>> build-essential << is Ubuntu meta package which in openSUSE is devel_basis
And u can install it by command
sudo zypper install --type pattern devel_basis
Select y to what it is offering to install.
3) Repo install...
mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo
Appendix to 3:
To fix repo sync u will need install this:
sudo zypper install libpth20-32bit
maybe this to:
sudo zypper install openjdk-8-devel
4) Use your favorite text editor to open ~/.bashrc - I like nano:
Code:
nano ~/.bashrc
By default nano is not installed so install it by command:
sudo zypper install nano
5) At the very bottom (use the Page Down key) paste this code to a new line:
Code:
export PATH=~/bin:$PATH
export USE_CCACHE=1
6) Save it. In nano that would be Ctrl-O and then Enter. Then Ctrl-X to exit back to a prompt. Restart bash:
Code:
source ~/.bashrc
7) In the terminal, navigate to where you would like to download the Android source code. The commands below will make it in your home folder.
Code:
mkdir ~/android
cd ~/android
8) Now you're going to initialize the repo. This is where you decide the flavor of Android you want to build, i.e. AOKP, CyanogenMod, AOSP etc.
For the purposes of this tutorial, here's the command for Cyanogenmod 13 (Marshmallow) :
Code:
repo init -u https://github.com/CyanogenMod/android.git -b cm-13.0
9) Time to get the source, many gigabytes of downloading await.
Don't worry, it's automated. It's the last one!
Code:
repo sync
Check back periodically every hour or so. It all depends on how fast your connection is.
That's it! Everything should be ready to go.
Thanks for the guide
In Tumbleweed, the package is liblz4-1_7
There is a typo, it should be python-wxWidgets-devel
Also, the link to repo should be complete:
Code:
http://commondatastorage.googleapis.com/git-repo-downloads/repo
Thanks
does it worth to have a separate user for builds?
Android Build Enviroment for openSUSE tumbleweed early 2019
Sorry for necromancing this old thread, but I've recently switched to openSUSE and these are the dependencies that I've used to successfully build LineageOS-16.0.:
Code:
sudo zypper install --type pattern devel_basis
sudo zypper install bison java-1_8_0-openjdk java-1_8_0-openjdk-devel SDL-devel python-wxWidgets-devel lzop schedtool squashfs glibc-devel-32bit ncurses-devel-32bit ncurses5-devel-32bit readline-devel-32bit ccache libz1-32bit python-xml bc
You can find maven here:
https://software.opensuse.org/package/maven
and android-tools here:
https://software.opensuse.org/package/android-tools
Dependencies already included by default in my system (not included in "devel_basis") that may you don't have but you need:
Code:
gpg2 liblz4-1 libxml2-2 libxml2-tools libxslt-tools zip
Just sharing because this post will (probably) save some time to someone in the same situation in early 2019.
_mone said:
Sorry for necromancing this old thread, but I've recently switched to openSUSE and these are the dependencies that I've used to successfully build LineageOS-16.0.:
Code:
sudo zypper install --type pattern devel_basis
sudo zypper install bison java-1_8_0-openjdk java-1_8_0-openjdk-devel SDL-devel python-wxWidgets-devel lzop schedtool squashfs glibc-devel-32bit ncurses-devel-32bit ncurses5-devel-32bit readline-devel-32bit ccache libz1-32bit python-xml bc
You can find maven here:
https://software.opensuse.org/package/maven
and android-tools here:
https://software.opensuse.org/package/android-tools
Dependencies already included by default in my system (not included in "devel_basis") that may you don't have but you need:
Code:
gpg2 liblz4-1 libxml2-2 libxml2-tools libxslt-tools zip
Just sharing because this post will (probably) save some time to someone in the same situation in early 2019.
Click to expand...
Click to collapse
Thanks for this. I'm still getting an error and wondering what SSL packages you have installed? I'm obviously missing one below.
EDIT: i kept installing SSL packages until it worked, can't remember which one did the trick but it seems it's chugging along now
/run/media/david/4d58d760-2359-46fb-b95b-1b374cb34428/android/lineage/kernel/oneplus/sdm845/scripts/extract-cert.c:21:10: fatal error: openssl/bio.h: No such file or directory
#include <openssl/bio.h>
^~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.host:101: scripts/extract-cert] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/run/media/david/4d58d760-2359-46fb-b95b-1b374cb34428/android/lineage/kernel/oneplus/sdm845/Makefile:558: scripts] Error 2
make[1]: Leaving directory '/run/media/david/4d58d760-2359-46fb-b95b-1b374cb34428/android/lineage/out/target/product/fajita/obj/KERNEL_OBJ'
make: *** [Makefile:152: sub-make] Error 2
make: Leaving directory '/run/media/david/4d58d760-2359-46fb-b95b-1b374cb34428/android/lineage/kernel/oneplus/sdm845'
[ 0% 70/94167] //external/protobuf:aprotoc clang++ src/google/protobuf/compiler/javanano/javanano_extension.cc [linux_glibc]
ninja: build stopped: subcommand failed.
12:41:48 ninja failed with: exit status 1

building AOSP for Intel Platform(NEED HELP)

Actually I have read so many topics about building Android Open Source Project for Intel based platform , they are such Android X86 , OS Remix and AOSP_IA (AOSP for Intel Architecture).
Now I want to build an AOSP for my tablet which is based on Intel Atom ( Z3735F), 10.1 inches display , 2 GB RAM and INSYDE UEFI bios type , device codename :inet_phone_32
My tablet runs Android 5.1.1_r1 (AOSP_AI TYPE) , there is no back up or rooting technique for this tablet ,so I decide to build an AOSP ROM for this tablet ,if the Android OS has a problem , I am able to flash it again and survive it.
I have tried in 3 ways to build an AOSP for my tablet but no one is correct so, I need an android developer or android expert to guide me and modify my mistakes .
According to google source :
these are steps for building AOSP for a device :
1. install , Java 8 ,git, curl , ($ sudo apt-get install "App")
2. Setting up ccache
3. install repo
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
4. creating working Directory
$ mkdir WORKING_DIRECTORY
$ cd WORKING_DIRECTORY
5.git configuration (name and email)
$ git config --global user.name "Your Name"
$ git config --global user.email "[email protected]"
6.inititilized repo and download the proper ROM
$ repo init -u https://android.googlesource.com/platform/manifest
$ repo init -u https://android.googlesource.com/platform/manifest -b android-5.1.1_r1
$ repo sync
7.$ . build/envsetup.sh
8. choosing the target
$ lunch inet_phone_32-userdebug
9.$ make(m) -j4-efi
Click to expand...
Click to collapse
unfortunately , it wont flash on my tablet !
According to Android X86 : these are steps for building an AOSP_X86
1. install , Java 8 ,git, curl , ($ sudo apt-get install "App")
2. Setting up ccache
3. install repo
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
4. creating working Directory
$ mkdir WORKING_DIRECTORY
$ cd WORKING_DIRECTORY
5.git configuration (name and email)
$ git config --global user.name "Your Name"
$ git config --global user.email "[email protected]"
6.inititilized repo and download the proper ROM
$ repo init -u http://scm.osdn.net/gitroot/android-x86/manifest
$ repo init -u http://scm.osdn.net/gitroot/android-x86/manifest -b lollipop-x86
$ repo sync --no-tags --no-clone-bundle
7.$ . build/envsetup.sh
8. choosing the target
as it was said on Android X86 instruction :
$ lunch android_x86-userdebug
9.$ make(m) -j4-efi
Click to expand...
Click to collapse
unfortunately , it also wont flash on my tablet !
According to Android on Intel Platform , these are below steps for building AOSP_IA:
Dependencies:
Follow initial steps from here: https://source.android.com/source/initializing.html
Additional Dependencies:
sudo apt-get install git-core gnupg flex bison gperf build-essential lunch zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip squashfs-tools python-mako distcc ccache python2.7 python-mako gettext mtools qt-sdk
Additional packages to be installed when developing in a Ubuntu chroot environment (created with debootstrap):
bc, dosfstools, mtools, libssl-dev
Github Account and SSH Keys:
Ensure you have your ssh key setup with your Github account:
https://help.github.com/articles/generating-an-ssh-key/
https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/
https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/
Setup CCache (Speeds up compilation):
https://source.android.com/source/initializing.html#setting-up-ccache
Downloading the source code
Using SSH protocol:
repo init -u [email protected]:android-ia/manifest.git
If you prefer using https:
repo init -u https://github.com/android-ia/manifest.git
Sync Code
repo sync
Building the OS image
. build/envsetup.sh
lunch androidia_64-eng
m -j4 android_ia-efi
Flash Image:
Unmount USB: sudo umount /dev/sdg* (Check where usb is mounted and change appropriately)
Flash the image: sudo dd if=out/target/product/androidia_64/androidia_64.img of=/dev/sdg (Check where usb is mounted and change appropriately)
Click to expand...
Click to collapse
which is not flashing on my tablet
Please kindly help me where are my mistakes , how can I modify it , if I dont know missing information , please contribute ,thank you

Upstream arm64 kernel for Raspberry Pi 3

Hi all
If you just need Raspberry Pi 3 to run headless linux and unleash its full 64bit power then you can compile vanilla kernel (kernel.org) for Raspberry Pi 3 using this tutorial.
YOU NEED TO USE THIS WITH ARM64 LINUX DISTRIBUTION
I don't know if it's my custom distribution's fault or kernel fault but when I use arm64 kernel on Raspberry Pi's Github then it's panic because fs driver on heavy load.
This tutorial doesn't use u-boot for booting the kernel, instead I use the firmware as it is.
This tutorial has been tested on Ubuntu 16.10, 17.04 host and you just need to copy and paste, it will work.
First of all, you need to setup build environment by using command below (maybe not all of these are necessary but this is how I usually setup my Android build environment and it's work for kernel build too):
Code:
sudo apt update
sudo apt install -y bison bc build-essential flex git-core gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libxml2 libxml2-utils lzop schedtool xsltproc zlib1g-dev g++-multilib gcc-multilib lib32ncurses5-dev lib32z1-dev
Now you need to get the aarch64 toolchain, here I'll use Linaro because it will somewhat improve performance but you can use the gcc-aarch64-linux-gnu if you want.
This code will download Linaro 6.3.1 and extract it to /opt/ for use later on:
Code:
wget http://releases.linaro.org/components/toolchain/binaries/latest/aarch64-linux-gnu/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu.tar.xz
sudo tar -xvf gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu.tar.xz -C /opt/
Now you need to clone kernel source code, this will takes some time on slow connection even though I did make it only clone the latest commit (shadow clone) but without clone the whole history:
Code:
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git --depth=1 -b linux-4.10.y
You can change the linux-4.10.y to another branch if you want, this branch clone will give you the latest version of that particular kernel version (4.10).
Now start the compilation, here I'm using a build machine with 14 cores, you can replace -j14 with your CPU core number for faster build, don't set it to higher than your real CPU core or it will slow your machine down:
Code:
cd linux-stable
mkdir MODULES BOOT
#
# Export necessary variable
#
export CROSS_COMPILE=/opt/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
export ARCH=arm64
#
# Make arm64 default defconfig
#
make defconfig -j14
#
# You must enable FB_SIMPLE or it will not boot
#
sed -i 's/# CONFIG_FB_SIMPLE is not set/CONFIG_FB_SIMPLE=y/g' .config
#
# Here I enable ethernet driver as built-in because you'll need it in some situation like kernel module not loaded
#
sed -i 's/CONFIG_USB_USBNET=m/CONFIG_USB_USBNET=y/g' .config
sed -i 's/CONFIG_USB_NET_SMSC95XX=m/CONFIG_USB_NET_SMSC95XX=y/g' .config
#
# Disable these heavy module which we will not use it at all
#
sed -i 's/CONFIG_DRM_NOUVEAU=m/# CONFIG_DRM_NOUVEAU is not set/g' .config
sed -i 's/CONFIG_DRM_TEGRA=m/# CONFIG_DRM_TEGRA is not set/g' .config
#
# Making the modules, copy it to ./MODULES
#
make modules -j14
make modules_install -j14 INSTALL_MOD_PATH=MODULES/
#
# Making the kernel and dtbs
#
make Image dtbs -j14
#
# It's compiled, copy it to ./BOOT for easy to work with
#
cp ./arch/arm64/boot/Image ./BOOT/Image
cp ./arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dtb ./BOOT/
You should have all the necessary file from build kernel in 2 directory (BOOT, MODULES) if nothing wrong happens.
[INSTALL KERNEL]
Plug the MicroSDcard of Raspberry Pi 3 to your computer and copy ./BOOT/Image and ./BOOT/bcm2837-rpi-3-b.dtb to partition #1 (vfat)
Edit the config.txt and add lines below, edit if already exist, this will: active arm64 mode, use device_tree for boot kernel, use kernel named Image:
Code:
arm_control=0x200
device_tree=bcm2837-rpi-3-b.dtb
kernel=Image
[INSTALL MODULES]
Now you have to mount the Raspberry Pi 3 Linux OS partition (usually is partition #2) to your system to copy file into it
Make backup and delete every directory in /lib/modules/ of OS partition
Copy ./MODULES/lib/modules/* to /lib/modules/ of OS partition using root
Now it's basically done, unmount/safely eject the sdcard and plug it to your Raspberry Pi 3, boot it up.
Modules might not loaded automatically, run this command on Raspberry Pi 3 shell:
Code:
sudo find "/lib/modules" -mindepth 1 -maxdepth 1 -type d | while read DIR; do echo ${DIR}; BASEDIR=$(basename "${DIR}"); echo " *** depmod ${BASEDIR}"; depmod -b "/" -a "${BASEDIR}"; done
Now modules should be loaded and will be loaded automatically on next boot.
Disclaimer:
- Only Kernel 4.9 and above are supported Raspberry Pi 3 AArch64
- Wifi/Bluetooth will not work since driver still haven't implemented
- Other function might not work
Tested/working:
- USB
- Ethernet
- HDMI
- UART
- GPU acceleration

Categories

Resources