[BUILD] Use Raspberry Pi to build Android Project (AOSP) - Android Software/Hacking General [Developers Only]

Hi all !
My current project is to use my Raspberry Pi as a Build Machine to build all Android sources (AOSP). In fact, I'll not build AOSP but the CyanogenMod (wich is mainly a fork from AOSP).
I know this may sound crazy, dumb or useless (according to Google, a 64-bit environment is required, and a lot (>> 4GB) of RAM if you're in a hurry), especially to use an ARM processor to build while all the Makefiles has been written to be used on x86...
But what I'm thinking about is a really cheap, silent, but working build machine, to sync the repo and build nightlies everyday. The first build will take some days but then, only the changes will be build so I think that only some hours per day will be required.
If I success, I'll create a big tutorial to explain what changes was required.
First of all, I had to add the Linux-armv61 arch as Host OS/ARCH :
Code:
[email protected] ~/buildspace/android/system/build $ git diff
diff --git a/core/envsetup.mk b/core/envsetup.mk
index 862b7f0..34eb31a 100644
--- a/core/envsetup.mk
+++ b/core/envsetup.mk
@@ -77,6 +77,10 @@ ifneq (,$(findstring Power,$(UNAME)))
HOST_ARCH := ppc
endif
[COLOR="SeaGreen"]+ifneq (,$(findstring arm,$(UNAME)))
+ HOST_ARCH := armv61
+endif
+[/COLOR]
BUILD_ARCH := $(HOST_ARCH)
ifeq ($(HOST_ARCH),)
then, I did this (because the raspbian ld doesn't support --icf) :
AdamOutler said:
so I did a
Code:
[email protected] ~/adb $ grep -r 'icf=safe' ./*
./build/core/combo/TARGET_linux-arm.mk: -Wl,--icf=safe \
and I removed that icf parameter.
Click to expand...
Click to collapse
-->
Code:
[email protected] ~/buildspace/android/system/build $ git diff
diff --git a/core/combo/TARGET_linux-arm.mk b/core/combo/TARGET_linux-arm.mk
index b36111f..24e0d99 100644
--- a/core/combo/TARGET_linux-arm.mk
+++ b/core/combo/TARGET_linux-arm.mk
@@ -146,7 +146,6 @@ TARGET_GLOBAL_LDFLAGS += \
-Wl,-z,relro \
-Wl,-z,now \
-Wl,--warn-shared-textrel \
[COLOR="Red"]- -Wl,--icf=safe \[/COLOR]
$(arch_variant_ldflags)
# We only need thumb interworking in cases where thumb support
but now I am stuck with this error :
Code:
make -C kernel/samsung/smdk4210 O=/media/totoext4part/cyanogenmod/system/out/target/product/n7000/obj/KERNEL_OBJ ARCH=arm CROSS_COMPILE=" /media/totoext4part/cyanogenmod/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-" headers_install
make[1]: Entering directory `/media/totoext4part/cyanogenmod/system/kernel/samsung/smdk4210'
/media/totoext4part/cyanogenmod/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: 1: /media/totoext4part/cyanogenmod/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: Syntax error: "(" unexpected
CHK include/linux/version.h
make[1]: Leaving directory `/media/totoext4part/cyanogenmod/system/kernel/samsung/smdk4210'
/bin/bash: r: command not found
make: [/media/totoext4part/cyanogenmod/system/out/target/product/n7000/obj/lib/crtbegin_static.o] Error 127 (ignored)
[COLOR="SeaGreen"]target SharedLib[/COLOR]: libdl (/media/totoext4part/cyanogenmod/system/out/target/product/n7000/obj/SHARED_LIBRARIES/libdl_intermediates/LINKED/libdl.so)
/usr/bin/ld: error: /media/totoext4part/cyanogenmod/system/out/target/product/n7000/obj/SHARED_LIBRARIES/libdl_intermediates/LINKED/libdl.so uses VFP register arguments, /media/totoext4part/cyanogenmod/system/out/target/product/n7000/obj/SHARED_LIBRARIES/libdl_intermediates/libdl.o does not
/usr/bin/ld: failed to merge target specific data of file /media/totoext4part/cyanogenmod/system/out/target/product/n7000/obj/SHARED_LIBRARIES/libdl_intermediates/libdl.o
/usr/bin/ld: warning: creating a DT_TEXTREL in a shared object.
collect2: ld returned 1 exit status
make: *** [/media/totoext4part/cyanogenmod/system/out/target/product/n7000/obj/SHARED_LIBRARIES/libdl_intermediates/LINKED/libdl.so] Error 1
I don't really know what I have to do and if it is because the HOST is an arm arch...
It have been a long time since I didn't put my hands in this kind of things and I need help to solve this problems... Thanks in advance !

Related

[HELP] Android Kernel Building Errors. permission denied :(

Hi every body, i'm now building android kernel for SKY-VEGA-S5 phone ( IM-A840S).
I followed these steps on the homepage of SKY .
They're :
1. How to build Kernel source of UI18760_kernel
a.First, Get Toolchain from android git server and etc ¡Š
GCC correct version is arm-eabi-4.4.3
b.modify Makefile
edit "CROSS_COMPILE" to toolchain path ( You downloaded )
ex) CROSS_COMPILE=$(You Download directory)/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
c.make CONFIG_DEBUG_SECTION_MISMATCH=y ARCH=arm msm8960_ef44s_tp20_defconfig
d.make CONFIG_DEBUG_SECTION_MISMATCH=y ARCH=arm
2. Kernel Image Location is arch/arm/boot/zImage
Module Image Location is drivers/*/*.ko
3. How to Clean Kernel object files
a.make ARCH=arm clean
______________________________________________________________________________________
I downloaded the kernel package and extract to the /home folder.
And toolchain ..... /prebuilt folder is also extracted to the /home folder.
I modified Makefile.
CROSS_COMPILE ?=$/home/vip7009pro/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
Then I step by step followed the guide. But i got many error... ( I think the PATH was wrong, but I dont know how to correctly edit it ==' ).
Here they are :
__________________________________________________________________________________________
[email protected]:~/kernel$ make CONFIG_DEBUG_SECTION_MISMATCH=y ARCH=arm
"======================LINUX INCLUDE==========================================================="
-I/home/vip7009pro/kernel/arch/arm/include -Iarch/arm/include/generated -Iinclude -include include/generated/autoconf.h
"=============================================================================================="
"KERNEL ======================================================================================"
-Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -DT_EF44S -I ./include/pantech -include ./include/pantech/CUST_PANTECH.h -DFIRM_VER=\"S0215141\" -DSYS_MODEL_NAME=\"EF44S\" -DPANTECH_MODEL_NAME=\"IM-A840S\" -DFS_USER_DATA_VER=37 -DPANTECH_STORAGE_INTERNAL_EMUL -DFEATURE_AARM_RELEASE_MODE -D__KERNELBUILD__
"=============================================================================================="
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CC kernel/bounds.s
/home/vip7009pro/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc -Wp,-MD,kernel/.bounds.s.d -nostdinc -isystem /home/vip7009pro/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc -print-file-name=include [Errno 13] Permission denied -I/home/vip7009pro/kernel/arch/arm/include -Iarch/arm/include/generated -Iinclude -include include/generated/autoconf.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-msm/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -DT_EF44S -I ./include/pantech -include ./include/pantech/CUST_PANTECH.h -DFIRM_VER="S0215141" -DSYS_MODEL_NAME="EF44S" -DPANTECH_MODEL_NAME="IM-A840S" -DFS_USER_DATA_VER=37 -DPANTECH_STORAGE_INTERNAL_EMUL -DFEATURE_AARM_RELEASE_MODE -D__KERNELBUILD__ -O2 -fstack-protector -mabi=aapcs-linux -mno-thumb-interwork -funwind-tables -D__LINUX_ARM_ARCH__=7 -march=armv5t -Wa,-march=armv7-a -msoft-float -Uarm -fomit-frame-pointer -g -DKBUILD_STR(s)=#s -DKBUILD_BASENAME=KBUILD_STR(bounds) -DKBUILD_MODNAME=KBUILD_STR(bounds) -fverbose-asm -S -o kernel/bounds.s kernel/bounds.c [Errno 13] Permission denied
make[1]: *** [kernel/bounds.s] Error 13
make: *** [prepare0] Error 2
[email protected]:~/kernel$
____________________________________________________________________________________________________________
Can any one tell me what do these errors mean and how to fix them ..
I'm looking forward to receiving answers from y0u all, soon .. Thanks

MK802IV Compilation error when trying to mka recoveryimage twrp via CM12.1 sources

Every time I try to do mka recoveryimage (with twrp) using the cm12.1 sources for my mk802iv that used a rockchip 3188 I get the following error :
Code:
make: *** No rule to make target '/home/patrick/android/rk3188/cm12.1/out/target/product/rk3188/obj/STATIC_LIBRARIES/libminui_intermediates/export_includes', needed by '/home/patrick/android/rk3188/cm12.1/out/target/product/rk3188/obj/EXECUTABLES/healthd_intermediates/import_includes'. *Stop
The device tree I use :
https://github.com/CTXz/android_device_rikomagic_mk802iv
CTXz said:
Every time I try to do mka recoveryimage (with twrp) using the cm12.1 sources for my mk802iv that used a rockchip 3188 I get the following error :
Code:
make: *** No rule to make target '/home/patrick/android/rk3188/cm12.1/out/target/product/rk3188/obj/STATIC_LIBRARIES/libminui_intermediates/export_includes', needed by '/home/patrick/android/rk3188/cm12.1/out/target/product/rk3188/obj/EXECUTABLES/healthd_intermediates/import_includes'. *Stop
The device tree I use :
https://github.com/CTXz/android_device_rikomagic_mk802iv
Click to expand...
Click to collapse
C,
goto system/core/healthd/Android.mk
and change
LOCAL_C_INCLUDES := $(call project-path-for,recovery)
to
# LOCAL_C_INCLUDES := $(call project-path-for,recovery)
LOCAL_C_INCLUDES := bootable/recovery
m

Maguro / Galaxy Nexus CM 12.1 build

Hi,
I've been playing a bit with CM's build as I expect to retire my Galaxy Nexus from its duty soon. The build went fine if not for the following build error:
Code:
target Executable: pvrsrvinit (/home/user/Development/Cyanogenmod/android/system/out/target/product/p5100/obj/EXECUTABLES/pvrsrvinit_intermediates/LINKED/pvrsrvinit)
/home/user/Development/Cyanogenmod/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lsrv_init_SGX540_120
/home/user/Development/Cyanogenmod/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lsrv_um_SGX540_120
hardware/ti/omap4/pvrsrvinit/pvrsrvinit.c:8: error: undefined reference to 'SrvInit'
collect2: error: ld returned 1 exit status
make: *** [/home/user/Development/Cyanogenmod/android/system/out/target/product/p5100/obj/EXECUTABLES/pvrsrvinit_intermediates/LINKED/pvrsrvinit] Error 1
make: *** Waiting for unfinished jobs....
make: Leaving directory `/home/user/Development/Cyanogenmod/android/system'
Other threads[0] reference the following fix, namely adding
Code:
<project name="DonkeyCoyote/proprietary_vendor_samsung" path="vendor/samsung" remote="github" revision="android-5.0" />
in
Code:
.repo/local_manifests/roomservice.xml
Unfortunately this trick didn't work. Upon closer inspection, the required libraries are part of the `omap4-common` subdirectory which is *not* sourced during the build[1]. I was nevertheless able to fix the build with the following change
Code:
% repo diff hardware/ti/omap4/
project hardware/ti/omap4/
diff --git a/pvrsrvinit/Android.mk b/pvrsrvinit/Android.mk
index 97d27c4..cdc6441 100644
--- a/pvrsrvinit/Android.mk
+++ b/pvrsrvinit/Android.mk
@@ -9,9 +9,9 @@ LOCAL_LDLIBS := -lsrv_init_SGX544_112 -lsrv_um_SGX544_112
pvrsrvinit: $(TARGET_OUT_VENDOR)/lib/libsrv_init_SGX544_112.so
pvrsrvinit: $(TARGET_OUT_VENDOR)/lib/libsrv_um_SGX544_112.so
else
-LOCAL_LDLIBS := -lsrv_init_SGX540_120 -lsrv_um_SGX540_120
-pvrsrvinit: $(TARGET_OUT_VENDOR)/lib/libsrv_init_SGX540_120.so
-pvrsrvinit: $(TARGET_OUT_VENDOR)/lib/libsrv_um_SGX540_120.so
+LOCAL_LDLIBS := -lsrv_init -lsrv_um
+pvrsrvinit: $(TARGET_OUT_VENDOR)/lib/libsrv_init.so
+pvrsrvinit: $(TARGET_OUT_VENDOR)/lib/libsrv_um.so
endif
LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES)
LOCAL_MODULE := pvrsrvinit
Which means that the libraries are definitively extracted by `cd device/samsung/maguro/ && ./extract-files.sh` however, the libraries are merely named differently.
Has anybody encountered such a failure ?
ps: on another side note. how are you suppose to extract all the files from the stock 4.2.1 upstream build ? `system/bin/fRom`, `system/vendor/lib/mediadrm/libwvdrmengine.so` and `system/vendor/lib/libfrsdk.so` are missing from the image...
[0]: http://forum.xda-developers.com/showpost.php?p=59115913&postcount=1372
[1]: confirmed by `inotifywait -m vendor/samsung/omap4-common/*mk`
Btw, I looked at the content of a CM11 nightly[0], there is no trace of `libsrv_init_SGX540_120.so` or `libsrv_um_SGX540_120.so` either...
[0]: cm-11-20151213-NIGHTLY-maguro.zip

[Exynos] [DTBH] Compiling a dtb.img with Linux

Hello developers of Exynos devices!
I've come up with a solution to integrate dtb.img building into Exynos kernel sources.
This will allow you to easily build your own dtb.img from Samsung's sources, rather than use dtb.img files pulled from stock kernels.
First, you'll need to apply a patch to the kernel sources.
This is an example taken from the Note 8 tree. You may need to make minor adjustments to get it to apply cleanly on your own tree. That means using git apply --rej then manually inserting contents from rej files most likely.
https://github.com/jcadduono/androi...45a8df88cf1d783407a36b660e8c767634a1968.patch
Once that's done, you will need to manually add some device specific additions. Samsung has already done this on a few of their kernel trees.
See https://github.com/jcadduono/androi...mmit/ebc62a93a80685a262516883b0b059d828d038b7 for an example on the Galaxy Note 8.
This is a config declaration of the variant of your device, used to determine which DTB files to build. You'll have to look around in arch/arm64/boot/dts folder for dts files regarding your device.
dtbtool_exynos is based on Ketut Putu Kumajaya's work, (using his load_dtbh_block function) then making a tool similar to Qualcomm's dtbTool. It takes arguments in a way that makes it easy to integrate in the Linux build system.
It produces 100% bit-exact dtb.img files compared to Samsung's stock images if you have the same dts sources.
Code:
[email protected]:~/build/kernel/android/samsung_universal8895$ build/scripts/dtbtool_exynos/dtbtool --help
usage: dtbtool
-o|--output <filename>
[ -s|--pagesize <pagesize> ]
[ --platform <hex platform code> ]
[ --subtype <hex subtype code> ]
[ -d|--dtb <dtb path> ]...
[ <dtb file> ]...
I have included defaults which apply across most Samsung devices. It requires at least 1 dtb file generated by the kernel build system to make a dtb.img.
Note that when using -d, it scans a directory's first level and sorts the dtbs in alphabetical order. (00, 01, 02, 05, 07, etc.)
When using dtb files by themselves as arguments, you will want to sort them yourself!
You can mix and match arguments however you like, so ./dtbtool -o dtb.img somefile1.dtb somefile2.dtb -d /somepath/ somefile3.dtb -d /someotherpath/ would actually scan and write them in that order.
You can use `make your-defconfig dtb.img` with CONFIG_EXYNOS_DTBTOOL=y in your device defconfig to immediately build the dtbtool, followed by the dtb files, followed by dtb.img. If CONFIG_EXYNOS_DTBTOOL=y then make/make all will build the dtb.img with your zImage.
I tried to make this as seamless and easy as possible.
You can then build your own boot image with https://github.com/jcadduono/android_external_libbootimg (make bootimg) or flash the dtb.img alongside ramdisk modifications, kernel images, etc. using LazyFlasher. (see more here)
HOW DO I KNOW THE PLATFORM/SUBTYPE CODES FOR MY DEVICE?
All you need is the original dtb.img from a stock boot/recovery image for your device.
If you only have a boot.img or recovery.img, use the above mentioned bootimg tool.
Code:
./bootimg x boot.img boot --dt
You will find dtb.img as boot/boot.img-dt.
This command will give you the values based on what is used in the original image:
Code:
xxd -e -s16 -l8 dtb.img | awk '{ print "platform code: 0x"$2; print "subtype code: 0x"$3 }'
The values will likely be the same on most devices. These are the defaults used by dtbtool_exynos:
Code:
platform code: 0x000050a6
subtype code: 0x217584da
link die
minhka98 said:
link die
Click to expand...
Click to collapse
fixed thanks
jcadduono said:
fixed thanks
Click to expand...
Click to collapse
i can patch in source 32bit? i have error
DTBTOOL arch/arm/boot/dtb.img
dtbtool: model_info-chip of arch/arm/boot/dts/exynos3475-universal3475.dtb is of invalid size, skipping
dtbtool: unable to locate any dtbs in the given path
error: could not load device tree blobs
/home/minhka98/m/arch/arm/boot/Makefile:44: formulas for destination “arch/arm/boot/dtb.img” error
minhka98 said:
i can patch in source 32bit? i have error
DTBTOOL arch/arm/boot/dtb.img
dtbtool: model_info-chip of arch/arm/boot/dts/exynos3475-universal3475.dtb is of invalid size, skipping
dtbtool: unable to locate any dtbs in the given path
error: could not load device tree blobs
/home/minhka98/m/arch/arm/boot/Makefile:44: formulas for destination “arch/arm/boot/dtb.img” error
Click to expand...
Click to collapse
hmm I will need to clone your repository and see why it is doing this
jcadduono said:
hmm I will need to clone your repository and see why it is doing this
Click to expand...
Click to collapse
here can u help https://github.com/minhka/minhka_kernelj200/commit/3fecaa24dd0915d1b68b81b082d6cf06c599444a
minhka98 said:
here can u help https://github.com/minhka/minhka_kernelj200/commit/3fecaa24dd0915d1b68b81b082d6cf06c599444a
Click to expand...
Click to collapse
it's because you didn't do the 2nd step, you were building dtb for a non-existent device
here is a patch...you might want to adjust it or add SWA as a variant if you are building for that device, I only added XX/EUR
it is possible you can get away with just adding them to CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAMES=
rather than needing this patch as well
ex.
CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAMES="exynos3475-j2lte_eur_open_01 exynos3475-j2lte_eur_open_02 exynos3475-j2lte_eur_open_03"
this might still cause problems though because other exynos dtb might be built which are not actually usable in a dtb.img. this is why we add an override rule (dtb-$(X) := ...) near the end of the dts makefile that is triggered by MACH config.
Code:
From a469b896f66c49ca2ae34e953a8a715626a71104 Mon Sep 17 00:00:00 2001
From: James Christopher Adduono <[email protected]>
Date: Sun, 17 Dec 2017 18:52:06 -0500
Subject: [PATCH] Add j2ltexx mach target
---
arch/arm/boot/dts/Makefile | 5 +++++
arch/arm/configs/exynos3475-j2lteswa_defconfig | 4 ++--
arch/arm/mach-exynos/Kconfig | 14 ++++++++++++++
3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index d1341b51..c4f8465c 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -213,6 +213,11 @@ dtb-$(CONFIG_ARCH_VT8500) += vt8500-bv07.dtb \
wm8850-w70v2.dtb
dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb
+dtb-$(CONFIG_MACH_EXYNOS3475_J2LTE_EUR) := \
+ exynos3475-j2lte_eur_open_01.dtb \
+ exynos3475-j2lte_eur_open_02.dtb \
+ exynos3475-j2lte_eur_open_03.dtb
+
DTB_NAMES := $(subst $\",,$(CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAMES))
ifneq ($(DTB_NAMES),)
DTB_LIST := $(addsuffix .dtb,$(DTB_NAMES))
diff --git a/arch/arm/configs/exynos3475-j2lteswa_defconfig b/arch/arm/configs/exynos3475-j2lteswa_defconfig
index 92a9f011..25de34cb 100755
--- a/arch/arm/configs/exynos3475-j2lteswa_defconfig
+++ b/arch/arm/configs/exynos3475-j2lteswa_defconfig
@@ -334,6 +334,7 @@ CONFIG_S5P_SLEEP=y
CONFIG_ARCH_EXYNOS3=y
# CONFIG_ARCH_EXYNOS4 is not set
# CONFIG_ARCH_EXYNOS5 is not set
+CONFIG_MACH_EXYNOS3475_J2LTE_EUR=y
CONFIG_EXYNOS_DTBTOOL=y
CONFIG_EXYNOS_DTBH_PLATFORM_CODE=0x50a6
CONFIG_EXYNOS_DTBH_SUBTYPE_CODE=0x217584da
@@ -518,8 +519,7 @@ CONFIG_SECCOMP=y
#
CONFIG_USE_OF=y
# CONFIG_ATAGS is not set
-CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE=y
-CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAMES="exynos3475-universal3475"
+# CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE is not set
CONFIG_ZBOOT_ROM_TEXT=0x0
CONFIG_ZBOOT_ROM_BSS=0x0
CONFIG_ARM_APPENDED_DTB=y
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index d565c183..a05510a9 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -18,6 +18,20 @@ config ARCH_EXYNOS3
select HAVE_EXYNOS5_HSI2C if I2C
help
Samsung EXYNOS3 (Cortex-A7) SoC based systems
+
+choice
+ prompt "Exynos device target"
+ default MACH_EXYNOS3575_NONE
+
+config MACH_EXYNOS3475_NONE
+ bool "None"
+
+config MACH_EXYNOS3475_J2LTE_EUR
+ bool "Galaxy J2 International (j2ltexx)"
+ select EXYNOS_DTBTOOL
+
+endchoice
+
menuconfig EXYNOS_DTBTOOL
bool "Build dtbtool for Exynos"
select DTC
--
2.11.0
jcadduono said:
it's because you didn't do the 2nd step, you were building dtb for a non-existent device
here is a patch...you might want to adjust it or add SWA as a variant if you are building for that device, I only added XX/EUR
it is possible you can get away with just adding them to CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAMES=
rather than needing this patch as well
ex.
CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAMES="exynos3475-j2lte_eur_open_01 exynos3475-j2lte_eur_open_02 exynos3475-j2lte_eur_open_03"
this might still cause problems though because other exynos dtb might be built which are not actually usable in a dtb.img. this is why we add an override rule (dtb-$(X) := ...) near the end of the dts makefile that is triggered by MACH config.
Code:
From a469b896f66c49ca2ae34e953a8a715626a71104 Mon Sep 17 00:00:00 2001
From: James Christopher Adduono <[email protected]>
Date: Sun, 17 Dec 2017 18:52:06 -0500
Subject: [PATCH] Add j2ltexx mach target
---
arch/arm/boot/dts/Makefile | 5 +++++
arch/arm/configs/exynos3475-j2lteswa_defconfig | 4 ++--
arch/arm/mach-exynos/Kconfig | 14 ++++++++++++++
3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index d1341b51..c4f8465c 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -213,6 +213,11 @@ dtb-$(CONFIG_ARCH_VT8500) += vt8500-bv07.dtb \
wm8850-w70v2.dtb
dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb
+dtb-$(CONFIG_MACH_EXYNOS3475_J2LTE_EUR) := \
+ exynos3475-j2lte_eur_open_01.dtb \
+ exynos3475-j2lte_eur_open_02.dtb \
+ exynos3475-j2lte_eur_open_03.dtb
+
DTB_NAMES := $(subst $\",,$(CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAMES))
ifneq ($(DTB_NAMES),)
DTB_LIST := $(addsuffix .dtb,$(DTB_NAMES))
diff --git a/arch/arm/configs/exynos3475-j2lteswa_defconfig b/arch/arm/configs/exynos3475-j2lteswa_defconfig
index 92a9f011..25de34cb 100755
--- a/arch/arm/configs/exynos3475-j2lteswa_defconfig
+++ b/arch/arm/configs/exynos3475-j2lteswa_defconfig
@@ -334,6 +334,7 @@ CONFIG_S5P_SLEEP=y
CONFIG_ARCH_EXYNOS3=y
# CONFIG_ARCH_EXYNOS4 is not set
# CONFIG_ARCH_EXYNOS5 is not set
+CONFIG_MACH_EXYNOS3475_J2LTE_EUR=y
CONFIG_EXYNOS_DTBTOOL=y
CONFIG_EXYNOS_DTBH_PLATFORM_CODE=0x50a6
CONFIG_EXYNOS_DTBH_SUBTYPE_CODE=0x217584da
@@ -518,8 +519,7 @@ CONFIG_SECCOMP=y
#
CONFIG_USE_OF=y
# CONFIG_ATAGS is not set
-CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE=y
-CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAMES="exynos3475-universal3475"
+# CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE is not set
CONFIG_ZBOOT_ROM_TEXT=0x0
CONFIG_ZBOOT_ROM_BSS=0x0
CONFIG_ARM_APPENDED_DTB=y
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index d565c183..a05510a9 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -18,6 +18,20 @@ config ARCH_EXYNOS3
select HAVE_EXYNOS5_HSI2C if I2C
help
Samsung EXYNOS3 (Cortex-A7) SoC based systems
+
+choice
+ prompt "Exynos device target"
+ default MACH_EXYNOS3575_NONE
+
+config MACH_EXYNOS3475_NONE
+ bool "None"
+
+config MACH_EXYNOS3475_J2LTE_EUR
+ bool "Galaxy J2 International (j2ltexx)"
+ select EXYNOS_DTBTOOL
+
+endchoice
+
menuconfig EXYNOS_DTBTOOL
bool "Build dtbtool for Exynos"
select DTC
--
2.11.0
Click to expand...
Click to collapse
ok. thanks
---------- Post added at 07:55 AM ---------- Previous post was at 07:44 AM ----------
jcadduono said:
it's because you didn't do the 2nd step, you were building dtb for a non-existent device
here is a patch...you might want to adjust it or add SWA as a variant if you are building for that device, I only added XX/EUR
it is possible you can get away with just adding them to CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAMES=
rather than needing this patch as well
ex.
CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAMES="exynos3475-j2lte_eur_open_01 exynos3475-j2lte_eur_open_02 exynos3475-j2lte_eur_open_03"
this might still cause problems though because other exynos dtb might be built which are not actually usable in a dtb.img. this is why we add an override rule (dtb-$(X) := ...) near the end of the dts makefile that is triggered by MACH config.
Code:
From a469b896f66c49ca2ae34e953a8a715626a71104 Mon Sep 17 00:00:00 2001
From: James Christopher Adduono <[email protected]>
Date: Sun, 17 Dec 2017 18:52:06 -0500
Subject: [PATCH] Add j2ltexx mach target
---
arch/arm/boot/dts/Makefile | 5 +++++
arch/arm/configs/exynos3475-j2lteswa_defconfig | 4 ++--
arch/arm/mach-exynos/Kconfig | 14 ++++++++++++++
3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index d1341b51..c4f8465c 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -213,6 +213,11 @@ dtb-$(CONFIG_ARCH_VT8500) += vt8500-bv07.dtb \
wm8850-w70v2.dtb
dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb
+dtb-$(CONFIG_MACH_EXYNOS3475_J2LTE_EUR) := \
+ exynos3475-j2lte_eur_open_01.dtb \
+ exynos3475-j2lte_eur_open_02.dtb \
+ exynos3475-j2lte_eur_open_03.dtb
+
DTB_NAMES := $(subst $\",,$(CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAMES))
ifneq ($(DTB_NAMES),)
DTB_LIST := $(addsuffix .dtb,$(DTB_NAMES))
diff --git a/arch/arm/configs/exynos3475-j2lteswa_defconfig b/arch/arm/configs/exynos3475-j2lteswa_defconfig
index 92a9f011..25de34cb 100755
--- a/arch/arm/configs/exynos3475-j2lteswa_defconfig
+++ b/arch/arm/configs/exynos3475-j2lteswa_defconfig
@@ -334,6 +334,7 @@ CONFIG_S5P_SLEEP=y
CONFIG_ARCH_EXYNOS3=y
# CONFIG_ARCH_EXYNOS4 is not set
# CONFIG_ARCH_EXYNOS5 is not set
+CONFIG_MACH_EXYNOS3475_J2LTE_EUR=y
CONFIG_EXYNOS_DTBTOOL=y
CONFIG_EXYNOS_DTBH_PLATFORM_CODE=0x50a6
CONFIG_EXYNOS_DTBH_SUBTYPE_CODE=0x217584da
@@ -518,8 +519,7 @@ CONFIG_SECCOMP=y
#
CONFIG_USE_OF=y
# CONFIG_ATAGS is not set
-CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE=y
-CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAMES="exynos3475-universal3475"
+# CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE is not set
CONFIG_ZBOOT_ROM_TEXT=0x0
CONFIG_ZBOOT_ROM_BSS=0x0
CONFIG_ARM_APPENDED_DTB=y
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index d565c183..a05510a9 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -18,6 +18,20 @@ config ARCH_EXYNOS3
select HAVE_EXYNOS5_HSI2C if I2C
help
Samsung EXYNOS3 (Cortex-A7) SoC based systems
+
+choice
+ prompt "Exynos device target"
+ default MACH_EXYNOS3575_NONE
+
+config MACH_EXYNOS3475_NONE
+ bool "None"
+
+config MACH_EXYNOS3475_J2LTE_EUR
+ bool "Galaxy J2 International (j2ltexx)"
+ select EXYNOS_DTBTOOL
+
+endchoice
+
menuconfig EXYNOS_DTBTOOL
bool "Build dtbtool for Exynos"
select DTC
--
2.11.0
Click to expand...
Click to collapse
if dont have file *.dtb What can I do. In another kernel source I do not see any * .dtb files
minhka98 said:
ok. thanks
---------- Post added at 07:55 AM ---------- Previous post was at 07:44 AM ----------
if dont have file *.dtb What can I do. In another kernel source I do not see any * .dtb files
Click to expand...
Click to collapse
up
minhka98 said:
ok. thanks
---------- Post added at 07:55 AM ---------- Previous post was at 07:44 AM ----------
if dont have file *.dtb What can I do. In another kernel source I do not see any * .dtb files
Click to expand...
Click to collapse
kernel source should not come with *.dtb files, those are files we build, it should come with *.dts files!
if it does not come with *.dts files specific to your device then you may need to try downloading other kernel sources for your chipset (ex. exynos 3475) and they may come with your device's *.dts files.
in the case of samsung devices, they dts are named like exynosXXXX-devicecodename_region_subregion_XX.dts
the number on the end usually correlates to newer revisions of the device, and you most likely won't need all of the revisions (some are probably unreleased) but it is good to have them anyway. they will get sorted by that number when the dtb.img is built.
you should NOT mix different region/variant dts, so don't use a eur_open dtb and a swa dtb. they can share hardware revision/subtype numbers and it will confuse the bootloader and they won't be able to load the correct ones.
also please do not bump threads on xda unless your bump consists of useful information that may help others
jcadduono said:
kernel source should not come with *.dtb files, those are files we build, it should come with *.dts files!
if it does not come with *.dts files specific to your device then you may need to try downloading other kernel sources for your chipset (ex. exynos 3475) and they may come with your device's *.dts files.
in the case of samsung devices, they dts are named like exynosXXXX-devicecodename_region_subregion_XX.dts
the number on the end usually correlates to newer revisions of the device, and you most likely won't need all of the revisions (some are probably unreleased) but it is good to have them anyway. they will get sorted by that number when the dtb.img is built.
you should NOT mix different region/variant dts, so don't use a eur_open dtb and a swa dtb. they can share hardware revision/subtype numbers and it will confuse the bootloader and they won't be able to load the correct ones.
also please do not bump threads on xda unless your bump consists of useful information that may help others
Click to expand...
Click to collapse
@@ -213,6 +213,11 @@ dtb-$(CONFIG_ARCH_VT8500) += vt8500-bv07.dtb \
wm8850-w70v2.dtb
dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb
+dtb-$(CONFIG_MACH_EXYNOS3475_J2LTE_EUR) := \
+ exynos3475-j2lte_eur_open_01.dtb \
+ exynos3475-j2lte_eur_open_02.dtb \
+ exynos3475-j2lte_eur_open_03.dtb
+
DTB_NAMES := $(subst $",,$(CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAMES))
i dont see any file "exynos3475-j2lte_eur_open_0*.dtb" just "exynos3475-j2lte_eur_open_0*.dts" why different?
minhka98 said:
i dont see any file "exynos3475-j2lte_eur_open_0*.dtb" just "exynos3475-j2lte_eur_open_0*.dts" why different?
Click to expand...
Click to collapse
as i said in my last post....dtb is MADE FROM dts, you only should have dts NOT dtb!
by specifying dtb in the makefile as a dependency, the build system will compile *.dts into *.dtb during build! it is automatic, just see *.dts files that exist and add them to makefile as done in my patches, but change dts to dtb for extension and it will make dtb from dts.
finally my build system additions combine the dtb files into a dtb.img
jcadduono said:
as i said in my last post....dtb is MADE FROM dts, you only should have dts NOT dtb!
by specifying dtb in the makefile as a dependency, the build system will compile *.dts into *.dtb during build! it is automatic, just see *.dts files that exist and add them to makefile as done in my patches, but change dts to dtb for extension and it will make dtb from dts.
finally my build system additions combine the dtb files into a dtb.img
Click to expand...
Click to collapse
ok. thanks
hello bro.
i successfully build kernel for galaxy note fe running on nougat.
and now i want build for oreo.but sammy not give fully dts source..then i asked to osrc team to give full source..they reupload the source with full dts source..
but it cant boot in my device..when i only compile zimage.its successfully booted..i got null pointer error with dtb-image..
here my Logcat
jaran kepang said:
hello bro.
i successfully build kernel for galaxy note fe running on nougat.
and now i want build for oreo.but sammy not give fully dts source..then i asked to osrc team to give full source..they reupload the source with full dts source..
but it cant boot in my device..when i only compile zimage.its successfully booted..i got null pointer error with dtb-image..
here my Logcat
Click to expand...
Click to collapse
compare your built dtb.img with original one from your stock kernel on same android version
make sure that compatible matches and you have the right values for the dtb magics, you can use hexdump on each dtb.img, also make sure they are in right order and have same amount of dtb
you can separate the original dtb.img into dtb files by breaking them up at dtb magic and then use kernel dts tool to convert them back into dtsi format and compare to see if any values are different too
HXD is a really useful tool with its visual compare function, you can run it in Wine i think (i use windows as a host with linux in vm, and just samba share my work directory)
jcadduono said:
compare your built dtb.img with original one from your stock kernel on same android version
make sure that compatible matches and you have the right values for the dtb magics, you can use hexdump on each dtb.img, also make sure they are in right order and have same amount of dtb
you can separate the original dtb.img into dtb files by breaking them up at dtb magic and then use kernel dts tool to convert them back into dtsi format and compare to see if any values are different too
HXD is a really useful tool with its visual compare function, you can run it in Wine i think (i use windows as a host with linux in vm, and just samba share my work directory)
Click to expand...
Click to collapse
thank you for your response.
i asked djb77 and he give me tool to extract dtb from boot.img
to dts file..i guess this tools is simillar about what u say..
any guide to make dt.img for qualcomm device?

Issues with building a kernel

I'm trying to build a kernel with the CONFIG_USB_SERIAL_CH341 driver for my Xiaomi Redmi 6 running LOS, but I'm having troubles doing so. My best guess would be that I have the wrong toolchain? I would like to ask for help, any pointers, guides, reading material, etc. If you have any questions, requests for logs, ask and I'll try to hastily respond.
Linux 5.15.7
gcc (GCC) 11.1.0
arm-none-eabi-gcc (Arch Repository) 11.2.0
Target kernel
cd android_kernel_xiaomi_mt6765/
export ARCH=arm & export SUBARCH=arm
echo 'CONFIG_USB_SERIAL_CH341=y' >> arch/arm/configs/cereus_defconfig
make clean
make mrproper
make cereus_defconfig
make -j$(nproc)
Returns: 'Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler'.
After commenting out the stackprotector from the defconfig and making again... returns:
'/usr/bin/ld: scripts/dtc/dtc-parser.tab.o:(.bss+0x10): multiple definition of `yylloc'; scripts/dtc/dtc-lexer.lex.o:(.bss+0x0): first defined here
HOSTLD scripts/genksyms/genksyms
collect2: error: ld returned 1 exit status
make[2]: *** [scripts/Makefile.host:110: scripts/dtc/dtc] Error 1
make[1]: *** [scripts/Makefile.build:648: scripts/dtc] Error 2
make: *** [Makefile:560: scripts] Error 2'
I tried removing the yylloc lines from the dtc related files, but only to watch even more bizarre errors being thrown at me... From what I searched prepending the line with the 'extern' modifier was a common fix, but in the source code it was already defined as extern YYLTYPE yylloc;
I would be very grateful for any help.

Categories

Resources