Patched kernel CVE-2016-5195 (aka "Dirtycow") - Galaxy Note 4 Android Development (Exynos)

For those of you wanting to patch your device asap, you can download my patched kernel. This is built from the latest Samsung standard sources with a couple of minor config changes, namely the ability to change SELinux enforcing mode as boot and runtime, removal of DM_VERITY and KNOX_KAP and a couple of IPv6 / QoS items (netfilter targets, qdiscs). The full config diff is below.
If you want to use this kernel you will need to create your own bootimage. On your device
Code:
# dd if=/dev/block/platform/15540000.dwmmc0/by-name/BOOT of=/sdcard/boot.img
Unpack the boot image (you can use this tool. In the unpacked folder, replace the boot.img-zImage with the new zImage from the zip file you downloaded. Recreate the bootimage with the mkbootimg tool (all the command line args you need to supply will be in the files that the unpackbootimg command created - just plug these values back in).
Now you can adb push the new boot.img back to your device and flash it using the reverse operation
Code:
# dd if=/sdcard/boot.img of=/dev/block/platform/15540000.dwmmc0/by-name/BOOT
If you want to compile your own kernel, here's the patch. In the kernel source dir, do
Code:
$ git init
$ git add .
$ git commit -m "initial"
$ git apply CVE-2016-5195.patch
CVE-2016-5195.patch:
Code:
From 4ecebb23a13c366b5d46cd0a76f14e6c81dd2da7 Mon Sep 17 00:00:00 2001
From: DL <[email protected]>
Date: Tue, 25 Oct 2016 19:36:32 +0700
Subject: [PATCH] Dirtycow Patch - CVE-2016-5195
---
include/linux/mm.h | 1 +
mm/memory.c | 28 ++++++++++++++++++++++++----
2 files changed, 25 insertions(+), 4 deletions(-)
mode change 100755 => 100644 include/linux/mm.h
mode change 100755 => 100644 mm/memory.c
diff --git a/include/linux/mm.h b/include/linux/mm.h
old mode 100755
new mode 100644
index 93b01bb..979e4c7
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1711,6 +1711,7 @@ static inline struct page *follow_page(struct vm_area_struct *vma,
#define FOLL_HWPOISON 0x100 /* check page is hwpoisoned */
#define FOLL_NUMA 0x200 /* force NUMA hinting page fault */
#define FOLL_MIGRATION 0x400 /* wait for page to replace migration entry */
+#define FOLL_COW 0x4000 /* internal GUP flag */
typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr,
void *data);
diff --git a/mm/memory.c b/mm/memory.c
old mode 100755
new mode 100644
index bcde4a1..5331526
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1497,6 +1497,16 @@ int zap_vma_ptes(struct vm_area_struct *vma, unsigned long address,
}
EXPORT_SYMBOL_GPL(zap_vma_ptes);
+/*
+ * FOLL_FORCE can write to even unwritable pte's, but only
+ * after we've gone through a COW cycle and they are dirty.
+ */
+static inline bool can_follow_write_pte(pte_t pte, unsigned int flags)
+{
+ return pte_write(pte) ||
+ ((flags & FOLL_FORCE) && (flags & FOLL_COW) && pte_dirty(pte));
+}
+
/**
* follow_page_mask - look up a page descriptor from a user-virtual address
* @vma: vm_area_struct mapping @address
@@ -1604,7 +1614,7 @@ split_fallthrough:
}
if ((flags & FOLL_NUMA) && pte_numa(pte))
goto no_page;
- if ((flags & FOLL_WRITE) && !pte_write(pte))
+ if ((flags & FOLL_WRITE) && !can_follow_write_pte(pte, flags))
goto unlock;
page = vm_normal_page(vma, address, pte);
@@ -1911,7 +1921,7 @@ long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
*/
if ((ret & VM_FAULT_WRITE) &&
!(vma->vm_flags & VM_WRITE))
- foll_flags &= ~FOLL_WRITE;
+ foll_flags |= FOLL_COW;
cond_resched();
}
@@ -3913,8 +3923,18 @@ retry:
if (unlikely(pmd_none(*pmd)) &&
unlikely(__pte_alloc(mm, vma, pmd, address)))
return VM_FAULT_OOM;
- /* if an huge pmd materialized from under us just retry later */
- if (unlikely(pmd_trans_huge(*pmd)))
+ /*
+ * If a huge pmd materialized under us just retry later. Use
+ * pmd_trans_unstable() instead of pmd_trans_huge() to ensure the pmd
+ * didn't become pmd_trans_huge under us and then back to pmd_none, as
+ * a result of MADV_DONTNEED running immediately after a huge pmd fault
+ * in a different thread of this mm, in turn leading to a misleading
+ * pmd_trans_huge() retval. All we have to ensure is that it is a
+ * regular pmd that we can walk with pte_offset_map() and we can do that
+ * through an atomic read in C, which is what pmd_trans_unstable()
+ * provides.
+ */
+ if (unlikely(pmd_trans_unstable(pmd)))
return 0;
/*
* A regular pmd is established and it can't morph into a huge pmd
--
1.8.3.1
diff -Naur arch/arm/configs/trelte_00_defconfig .config
Code:
--- arch/arm/configs/trelte_00_defconfig 2016-03-01 17:00:22.000000000 +0700
+++ .config 2016-10-18 19:21:17.000000000 +0700
@@ -102,7 +102,8 @@
# CONFIG_TREE_RCU_TRACE is not set
# CONFIG_RCU_BOOST is not set
# CONFIG_RCU_NOCB_CPU is not set
-# CONFIG_IKCONFIG is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=19
CONFIG_CGROUPS=y
CONFIG_CGROUP_DEBUG=y
@@ -391,7 +392,7 @@
CONFIG_RKP_DBLMAP_PROT=y
CONFIG_HYP_RKP=y
CONFIG_TIMA_RKP_30=y
-CONFIG_KNOX_KAP=y
+# CONFIG_KNOX_KAP is not set
CONFIG_TIMA_RKP_L1_TABLES=y
# CONFIG_TIMA_RKP_L2_TABLES is not set
# CONFIG_TIMA_RKP_DEBUG is not set
@@ -741,9 +742,23 @@
CONFIG_INET_DIAG=y
CONFIG_INET_TCP_DIAG=y
# CONFIG_INET_UDP_DIAG is not set
-# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_ADVANCED=y
+# CONFIG_TCP_CONG_BIC is not set
CONFIG_TCP_CONG_CUBIC=y
-CONFIG_DEFAULT_TCP_CONG="cubic"
+CONFIG_TCP_CONG_WESTWOOD=y
+# CONFIG_TCP_CONG_HTCP is not set
+# CONFIG_TCP_CONG_HSTCP is not set
+# CONFIG_TCP_CONG_HYBLA is not set
+# CONFIG_TCP_CONG_VEGAS is not set
+# CONFIG_TCP_CONG_SCALABLE is not set
+# CONFIG_TCP_CONG_LP is not set
+# CONFIG_TCP_CONG_VENO is not set
+# CONFIG_TCP_CONG_YEAH is not set
+# CONFIG_TCP_CONG_ILLINOIS is not set
+# CONFIG_DEFAULT_CUBIC is not set
+CONFIG_DEFAULT_WESTWOOD=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="westwood"
# CONFIG_TCP_MD5SIG is not set
CONFIG_IPV6=y
CONFIG_IPV6_PRIVACY=y
@@ -839,7 +854,7 @@
CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=y
# CONFIG_NETFILTER_XT_TARGET_CT is not set
# CONFIG_NETFILTER_XT_TARGET_DSCP is not set
-# CONFIG_NETFILTER_XT_TARGET_HL is not set
+CONFIG_NETFILTER_XT_TARGET_HL=y
# CONFIG_NETFILTER_XT_TARGET_HMARK is not set
CONFIG_NETFILTER_XT_TARGET_IDLETIMER=y
CONFIG_NETFILTER_XT_TARGET_LOG=y
@@ -948,16 +963,16 @@
CONFIG_NF_DEFRAG_IPV6=y
CONFIG_NF_CONNTRACK_IPV6=y
CONFIG_IP6_NF_IPTABLES=y
-# CONFIG_IP6_NF_MATCH_AH is not set
-# CONFIG_IP6_NF_MATCH_EUI64 is not set
-# CONFIG_IP6_NF_MATCH_FRAG is not set
-# CONFIG_IP6_NF_MATCH_OPTS is not set
-# CONFIG_IP6_NF_MATCH_HL is not set
-# CONFIG_IP6_NF_MATCH_IPV6HEADER is not set
-# CONFIG_IP6_NF_MATCH_MH is not set
-# CONFIG_IP6_NF_MATCH_RPFILTER is not set
-# CONFIG_IP6_NF_MATCH_RT is not set
-# CONFIG_IP6_NF_TARGET_HL is not set
+CONFIG_IP6_NF_MATCH_AH=y
+CONFIG_IP6_NF_MATCH_EUI64=y
+CONFIG_IP6_NF_MATCH_FRAG=y
+CONFIG_IP6_NF_MATCH_OPTS=y
+CONFIG_IP6_NF_MATCH_HL=y
+CONFIG_IP6_NF_MATCH_IPV6HEADER=y
+CONFIG_IP6_NF_MATCH_MH=y
+CONFIG_IP6_NF_MATCH_RPFILTER=y
+CONFIG_IP6_NF_MATCH_RT=y
+CONFIG_IP6_NF_TARGET_HL=y
CONFIG_IP6_NF_FILTER=y
CONFIG_IP6_NF_TARGET_REJECT=y
CONFIG_IP6_NF_TARGET_REJECT_SKERR=y
@@ -987,39 +1002,39 @@
#
# Queueing/Scheduling
#
-# CONFIG_NET_SCH_CBQ is not set
+CONFIG_NET_SCH_CBQ=y
CONFIG_NET_SCH_HTB=y
-# CONFIG_NET_SCH_HFSC is not set
-# CONFIG_NET_SCH_PRIO is not set
+CONFIG_NET_SCH_HFSC=y
+CONFIG_NET_SCH_PRIO=y
# CONFIG_NET_SCH_MULTIQ is not set
# CONFIG_NET_SCH_RED is not set
# CONFIG_NET_SCH_SFB is not set
-# CONFIG_NET_SCH_SFQ is not set
+CONFIG_NET_SCH_SFQ=y
# CONFIG_NET_SCH_TEQL is not set
# CONFIG_NET_SCH_TBF is not set
# CONFIG_NET_SCH_GRED is not set
-# CONFIG_NET_SCH_DSMARK is not set
+CONFIG_NET_SCH_DSMARK=y
# CONFIG_NET_SCH_NETEM is not set
# CONFIG_NET_SCH_DRR is not set
# CONFIG_NET_SCH_MQPRIO is not set
# CONFIG_NET_SCH_CHOKE is not set
# CONFIG_NET_SCH_QFQ is not set
# CONFIG_NET_SCH_CODEL is not set
-# CONFIG_NET_SCH_FQ_CODEL is not set
-# CONFIG_NET_SCH_INGRESS is not set
+CONFIG_NET_SCH_FQ_CODEL=y
+CONFIG_NET_SCH_INGRESS=y
# CONFIG_NET_SCH_PLUG is not set
#
# Classification
#
CONFIG_NET_CLS=y
-# CONFIG_NET_CLS_BASIC is not set
+CONFIG_NET_CLS_BASIC=y
# CONFIG_NET_CLS_TCINDEX is not set
# CONFIG_NET_CLS_ROUTE4 is not set
-# CONFIG_NET_CLS_FW is not set
+CONFIG_NET_CLS_FW=y
CONFIG_NET_CLS_U32=y
# CONFIG_CLS_U32_PERF is not set
-# CONFIG_CLS_U32_MARK is not set
+CONFIG_CLS_U32_MARK=y
# CONFIG_NET_CLS_RSVP is not set
# CONFIG_NET_CLS_RSVP6 is not set
# CONFIG_NET_CLS_FLOW is not set
@@ -1036,7 +1051,7 @@
CONFIG_NET_ACT_GACT=y
# CONFIG_GACT_PROB is not set
CONFIG_NET_ACT_MIRRED=y
-# CONFIG_NET_ACT_IPT is not set
+CONFIG_NET_ACT_IPT=y
# CONFIG_NET_ACT_NAT is not set
# CONFIG_NET_ACT_PEDIT is not set
# CONFIG_NET_ACT_SIMP is not set
@@ -1438,7 +1453,6 @@
# CONFIG_BCACHE is not set
CONFIG_BLK_DEV_DM=y
# CONFIG_DM_DEBUG is not set
-CONFIG_DM_BUFIO=y
CONFIG_DM_CRYPT=y
# CONFIG_DM_SNAPSHOT is not set
# CONFIG_DM_THIN_PROVISIONING is not set
@@ -1450,7 +1464,7 @@
# CONFIG_DM_DELAY is not set
# CONFIG_DM_UEVENT is not set
# CONFIG_DM_FLAKEY is not set
-CONFIG_DM_VERITY=y
+# CONFIG_DM_VERITY is not set
# CONFIG_TARGET_CORE is not set
# CONFIG_FUSION is not set
@@ -1467,7 +1481,7 @@
# CONFIG_EQUALIZER is not set
# CONFIG_NET_FC is not set
CONFIG_MII=y
-# CONFIG_IFB is not set
+CONFIG_IFB=y
# CONFIG_NET_TEAM is not set
# CONFIG_MACVLAN is not set
# CONFIG_VXLAN is not set
@@ -4524,8 +4538,9 @@
# CONFIG_SECURITY_PATH is not set
CONFIG_LSM_MMAP_MIN_ADDR=4096
CONFIG_SECURITY_SELINUX=y
-# CONFIG_SECURITY_SELINUX_BOOTPARAM is not set
-# CONFIG_SECURITY_SELINUX_DISABLE is not set
+CONFIG_SECURITY_SELINUX_BOOTPARAM=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1
+CONFIG_SECURITY_SELINUX_DISABLE=y
CONFIG_SECURITY_SELINUX_DEVELOP=y
CONFIG_SECURITY_SELINUX_AVC_STATS=y
CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1

Well done. Working good so far.
What sources did you use?

dicksteele said:
Well done. Working good so far.
What sources did you use?
Click to expand...
Click to collapse
He said" This is built from the latest Samsung standard source"

zealjibia said:
He said" This is built from the latest Samsung standard source"
Click to expand...
Click to collapse
I understand that. N910CXXU2DPI7 appears to be the latest. Which is why my question was simply, which one did he use, to verify that was it.

dicksteele said:
I understand that. N910CXXU2DPI7 appears to be the latest. Which is why my question was simply, which one did he use, to verify that was it.
Click to expand...
Click to collapse
Yes, correct. I used the latest vanilla Samsung sources N910CXXU2DPI7. You can download them directly from Samsung. I've supplied the patch and the config diff, so everyone can precisely replicate the linked binary kernel version if they wish.

dl12345 said:
Yes, correct. I used the latest vanilla Samsung sources N910CXXU2DPI7. You can download them directly from Samsung. I've supplied the patch and the config diff, so everyone can precisely replicate the linked binary kernel version if they wish.
Click to expand...
Click to collapse
Excellent thanks. I've downloaded and getting compile errors. But I've been on travel for the past couple of weeks and my brains is not completely functioning.

dicksteele said:
Excellent thanks. I've downloaded and getting compile errors. But I've been on travel for the past couple of weeks and my brains is not completely functioning.
Click to expand...
Click to collapse
If it helps to know, I use the android ndk 13 toolchain. Here are two files that I use, the first to setup the environment, the second to build the kernel. My NDK is installed in /opt/android/android-ndk-r13
/opt/android/setvars.sh
Code:
#!/bin/bash
NDKARCH="arm-linux-androideabi"
NDKARCHVER="4.9"
NDKVER="r13"
NDKBASE="/opt/android/android-ndk"
NDK="${NDKBASE}-${NDKVER}"
export NDKBIN="${NDK}/toolchains/${NDKARCH}-${NDKARCHVER}/prebuilt/linux-x86_64/bin"
export CROSS_COMPILE="${NDKARCH}-"
export ARCH=arm
export SUBARCH=arm
RE=".*${NDK}.*[:]*"
if [[ ! ${PATH} =~ ${RE} ]] ; then
export PATH="$PATH:${NDKBIN}"
elif [[ ${PATH} =~ ${RE} ]]; then
export PATH=$(echo $PATH | awk -F':' \
"{ \
i = 1; \
for (i = 1; i <= NF; i++) { \
if (\$i !~ /android-ndk/) printf \"%s\", \$i; \
else printf \"%s\", \"${NDKBIN}\"; \
if ( i < NF) printf \":\"; \
}; \
}")
fi
echo CROSS_COMPILE=$CROSS_COMPILE
echo PATH=$PATH
/opt/android/note4/src/kernel/build_kernel.sh
Code:
#!/bin/bash
. /opt/android/setvars.sh
export KBUILD_BUILD_USER=dl12345
export KBUILD_BUILD_HOST=xda
set -x
make -j16 ARCH=arm KBUILD_USER=$KBUILD_BUILD_USER KBUILD_BUILD_HOST=$KBUILD_BUILD_HOST $1
make ARCH=arm exynos5433-tre_eur_open_16.dtb

dl12345 said:
If it helps to know, I use the android ndk 13 toolchain. Here are two files that I use, the first to setup the environment, the second to build the kernel. My NDK is installed in /opt/android/android-ndk-r13
/opt/android/setvars.sh
Code:
#!/bin/bash
NDKARCH="arm-linux-androideabi"
NDKARCHVER="4.9"
NDKVER="r13"
NDKBASE="/opt/android/android-ndk"
NDK="${NDKBASE}-${NDKVER}"
export NDKBIN="${NDK}/toolchains/${NDKARCH}-${NDKARCHVER}/prebuilt/linux-x86_64/bin"
export CROSS_COMPILE="${NDKARCH}-"
export ARCH=arm
export SUBARCH=arm
RE=".*${NDK}.*[:]*"
if [[ ! ${PATH} =~ ${RE} ]] ; then
export PATH="$PATH:${NDKBIN}"
elif [[ ${PATH} =~ ${RE} ]]; then
export PATH=$(echo $PATH | awk -F':' \
"{ \
i = 1; \
for (i = 1; i <= NF; i++) { \
if (\$i !~ /android-ndk/) printf \"%s\", \$i; \
else printf \"%s\", \"${NDKBIN}\"; \
if ( i < NF) printf \":\"; \
}; \
}")
fi
echo CROSS_COMPILE=$CROSS_COMPILE
echo PATH=$PATH
/opt/android/note4/src/kernel/build_kernel.sh
Code:
#!/bin/bash
. /opt/android/setvars.sh
export KBUILD_BUILD_USER=dl12345
export KBUILD_BUILD_HOST=xda
set -x
make -j16 ARCH=arm KBUILD_USER=$KBUILD_BUILD_USER KBUILD_BUILD_HOST=$KBUILD_BUILD_HOST $1
make ARCH=arm exynos5433-tre_eur_open_16.dtb
Click to expand...
Click to collapse
This helps thanks a ton. I've really never attempted to compile a kernel for android. That's my last frontier.
I've done Linux over 10 years ago, I've just been content with using others.
They've all been great, but the only thing that was missing was the Revoke USB debugging authorizations on most of the custom ones.
I'd have to flash back to stock if ADB lost its mind and wouldn't recognize the phone.
Good stuff, great work. Much appreciation. Hope you stick around !

If you want to use ADB on this kernel and you're booting with SELinux in enforcing mode, you'll need to first run a terminal and execute
Code:
$ su
# setenforce 0
If you don't do this, ADB will appear not to work or even recognize the device.
When you're done, just setenforce 1 again. Of course, depending on how your ramdisk is setup, this may not be necessary but it's worth knowing if you run into apparent problems with ADB.

dl12345 said:
If you want to use ADB on this kernel and you're booting with SELinux in enforcing mode, you'll need to first run a terminal and execute
Code:
$ su
# setenforce 0
If you don't do this, ADB will appear not to work or even recognize the device.
When you're done, just setenforce 1 again. Of course, depending on how your ramdisk is setup, this may not be necessary but it's worth knowing if you run into apparent problems with ADB.
Click to expand...
Click to collapse
ADB usually works fine. After reflashing and moving to a new machine ADBKeys is usually hosed.
So Revoke USB debugging authorizations is not under Developer Options to reset under some kernels, but it is under stock and it was after I applied yours. Which was cool.
It doesn't happen a lot just enough to be annoying.

This is nice.. @dl12345 I suggest make a flashable kernel..
Im not seeing any updated kernel right now specially for n910c device,.. no more kernel devs

radz_ said:
This is nice.. @dl12345 I suggest make a flashable kernel..
Im not seeing any updated kernel right now specially for n910c device,.. no more kernel devs
Click to expand...
Click to collapse
[KERNEL][PI7 v1.5][6.0.1][TW] talexop - Note4 N910C Permissive
N910C_PI7_6.0.1_talexop_v1.5.zip
Came out Nov 2
Hoping sources will be out soon

The thing with a flashable kernel is that everyone has a different ramdisk, so making something that fits all sizes is tricky. I figured it better to just let people use their existing ramdisk and so they won't notice any real change, regardless of the ROM they're using.

dl12345 said:
The thing with a flashable kernel is that everyone has a different ramdisk, so making something that fits all sizes is tricky. I figured it better to just let people use their existing ramdisk and so they won't notice any real change, regardless of the ROM they're using.
Click to expand...
Click to collapse
I saw your post in talexop's thread... are you able to confirm if dm verity is disabled with Permissive?
Im not really satisfied with systemless root, i want system mode root.. but it requires custom kernel with dm verity disabled.
http://forum.xda-developers.com/app...LX5SBEoShv5AasiQg&sig2=4Ak_z3p5coQU3YK0NY8aYw

radz_ said:
I saw your post in talexop's thread... are you able to confirm if dm verity is disabled with Permissive?
Im not really satisfied with systemless root, i want system mode root.. but it requires custom kernel with dm verity disabled.
http://forum.xda-developers.com/app...LX5SBEoShv5AasiQg&sig2=4Ak_z3p5coQU3YK0NY8aYw
Click to expand...
Click to collapse
Flashed the talexop kernel, then the system mode supersu. Both worked fine together

radz_ said:
I saw your post in talexop's thread... are you able to confirm if dm verity is disabled with Permissive?
Im not really satisfied with systemless root, i want system mode root.. but it requires custom kernel with dm verity disabled.
http://forum.xda-developers.com/app...LX5SBEoShv5AasiQg&sig2=4Ak_z3p5coQU3YK0NY8aYw
Click to expand...
Click to collapse
Yes, CONFIG_DM_VERITY is disabled on this kernel as is CONFIG_KNOX_KAP. I run this kernel in enforcing mode (you can switch SELinux on or off with a boot command line parameter, or with the setenforce command).

dicksteele said:
Flashed the talexop kernel, then the system mode supersu. Both worked fine together
Click to expand...
Click to collapse
Oh nice... thanks for the confirmation mate.
For now I went back to stock, talexop kernel has wifi issue.. hoping for a fix soon..

radz_ said:
Oh nice... thanks for the confirmation mate.
For now I went back to stock, talexop kernel has wifi issue.. hoping for a fix soon..
Click to expand...
Click to collapse
I compiled a kernel and mine is doing the same thing. But I think I found the fix. I hope. Kernel's running good I think.
But it's my first one ever and I'm still tickering with things.
It will be 70-80% stock. IF I release it it won't be until the end of the month at least.

dicksteele said:
I compiled a kernel and mine is doing the same thing. But I think I found the fix. I hope. Kernel's running good I think.
But it's my first one ever and I'm still tickering with things.
It will be 70-80% stock. IF I release it it won't be until the end of the month at least.
Click to expand...
Click to collapse
These are all ramdisk related problems, and one of the reasons I just posted a link to a kernel rather than full boot image.
This wifi issue is a known problem caused by using secure_storage with a custom kernel or ROM. Your default.prop in your ramdisk should turn off securestorage
Code:
ro.securestorage.support=false
I'd also suggest the following edits in default.prop which are related to adb. Just search them here on XDA. There's lots of info
Code:
ro.secure=0
persist.service.adb.enable=1
persist.service.debuggable=1
ro.debuggable=1
ro.adb.secure=0
persist.sys.usb.config=mtp,adb

dl12345 said:
Yes, CONFIG_DM_VERITY is disabled on this kernel as is CONFIG_KNOX_KAP. I run this kernel in enforcing mode (you can switch SELinux on or off with a boot command line parameter, or with the setenforce command).
Click to expand...
Click to collapse
I do not think you can change to enforcing... It is only permissive. Are you sure it changed?
---------- Post added at 10:47 ---------- Previous post was at 10:45 ----------
dl12345 said:
These are all ramdisk related problems, and one of the reasons I just posted a link to a kernel rather than full boot image.
This wifi issue is a known problem caused by using secure_storage with a custom kernel or ROM. Your default.prop in your ramdisk should turn off securestorage
Code:
ro.securestorage.support=false
I'd also suggest the following edits in default.prop which are related to adb. Just search them here on XDA. There's lots of info
Code:
ro.secure=0
persist.service.adb.enable=1
persist.service.debuggable=1
ro.debuggable=1
ro.adb.secure=0
persist.sys.usb.config=mtp,adb
Click to expand...
Click to collapse
Bump

Related

compiling problems, at a loss and been googling for days.

this is the error i come accross when trying to compile from source.
i'm running ubunut 8.0.4 LTS Hardy Heron
these are the steps i use when settign it up:
http://source.android.com/download (for downloading and compiling the source)
'make' is ran once for the purposes of gettign ready to edit with eclipse
i git cloned housh's vendor tree from http://github.com/koush
SDK is installed in ~/android-sdk
sourcecode is in ~/android-source/android-2.1_r1
the files from koush's vendor tree are in ~/android-source/android-2.1_r1/vendor/motorola/sholes-open
proprietary files are from a 2.0.1 rom and located in ~/android-source/android-2.1_r1/proprietary
Code:
. build/envsetup.sh
lunch sholes-eng
make
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.1
TARGET_PRODUCT=sholes
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=ERD79
============================================
build/core/copy_headers.mk:15: warning: overriding commands for target `out/target/product/sholes-open/obj/include/libpv/getactualaacconfig.h'
build/core/copy_headers.mk:15: warning: ignoring old commands for target `out/target/product/sholes-open/obj/include/libpv/getactualaacconfig.h'
/bin/bash: line 0: cd: sdk/layoutopt/app/src/resources: No such file or directory
No private recovery resources for TARGET_DEVICE sholes-open
Install: out/host/linux-x86/bin/vm-tests
Install: out/target/product/sholes-open/system/app/Mms.apk
target Executable: app_process (out/target/product/sholes-open/obj/EXECUTABLES/app_process_intermediates/LINKED/app_process)
/home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/../lib/gcc/arm-eabi/4.4.0/../../../../arm-eabi/bin/ld: warning: libril_rds.so, needed by out/target/product/sholes-open/obj/lib/libmoto_gps.so, not found (try using -rpath or -rpath-link)
/home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/../lib/gcc/arm-eabi/4.4.0/../../../../arm-eabi/bin/ld: warning: libnmea.so, needed by out/target/product/sholes-open/obj/lib/libmoto_gps.so, not found (try using -rpath or -rpath-link)
out/target/product/sholes-open/obj/lib/libmoto_gps.so: undefined reference to `RdsSetupRemoteConnection'
out/target/product/sholes-open/obj/lib/libmoto_gps.so: undefined reference to `RdsUtilCreateMsg'
out/target/product/sholes-open/obj/lib/libmoto_gps.so: undefined reference to `nmea_parse_sentence'
out/target/product/sholes-open/obj/lib/libmoto_gps.so: undefined reference to `RdsUtilSendMsg'
out/target/product/sholes-open/obj/lib/libmoto_gps.so: undefined reference to `nmea_parse_error_string'
out/target/product/sholes-open/obj/lib/libmoto_gps.so: undefined reference to `RdsReadServerRsp'
collect2: ld returned 1 exit status
make: *** [out/target/product/sholes-open/obj/EXECUTABLES/app_process_intermediates/LINKED/app_process] Error 1
i tried using -rpath-link as you can see these were my results.
Code:
*****@lap:~/android-source/android-2.1_r1$ make -rpath-link=/home/tourach23/android-source/proprietary
make: invalid option -- a
Usage: make [options] [target] ...
Options:
-b, -m Ignored for compatibility.
-B, --always-make Unconditionally make all targets.
-C DIRECTORY, --directory=DIRECTORY
Change to DIRECTORY before doing anything.
-d Print lots of debugging information.
--debug[=FLAGS] Print various types of debugging information.
-e, --environment-overrides
Environment variables override makefiles.
-f FILE, --file=FILE, --makefile=FILE
Read FILE as a makefile.
-h, --help Print this message and exit.
-i, --ignore-errors Ignore errors from commands.
-I DIRECTORY, --include-dir=DIRECTORY
Search DIRECTORY for included makefiles.
-j [N], --jobs[=N] Allow N jobs at once; infinite jobs with no arg.
-k, --keep-going Keep going when some targets can't be made.
-l [N], --load-average[=N], --max-load[=N]
Don't start multiple jobs unless load is below N.
-L, --check-symlink-times Use the latest mtime between symlinks and target.
-n, --just-print, --dry-run, --recon
Don't actually run any commands; just print them.
-o FILE, --old-file=FILE, --assume-old=FILE
Consider FILE to be very old and don't remake it.
-p, --print-data-base Print make's internal database.
-q, --question Run no commands; exit status says if up to date.
-r, --no-builtin-rules Disable the built-in implicit rules.
-R, --no-builtin-variables Disable the built-in variable settings.
-s, --silent, --quiet Don't echo commands.
-S, --no-keep-going, --stop
Turns off -k.
-t, --touch Touch targets instead of remaking them.
-v, --version Print the version number of make and exit.
-w, --print-directory Print the current directory.
--no-print-directory Turn off -w, even if it was turned on implicitly.
-W FILE, --what-if=FILE, --new-file=FILE, --assume-new=FILE
Consider FILE to be infinitely new.
--warn-undefined-variables Warn when an undefined variable is referenced.
This program built for i486-pc-linux-gnu
Report bugs to <[email protected]>
# Make data base, printed on Mon Mar 1 17:14:13 2010
# Variables
# environment
DESKTOP_SESSION = default
# environment
ANDROID_EABI_TOOLCHAIN = /home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin
# environment
GTK_RC_FILES = /etc/gtk/gtkrc:/home/tourach23/.gtkrc-1.2-gnome2
# environment
DESKTOP_STARTUP_ID =
# environment
XAUTHORITY = /home/tourach23/.Xauthority
# environment
GDMSESSION = default
# environment
SHELL = /bin/bash
# environment
GDM_LANG = en_US.UTF-8
# environment
_ = /usr/bin/make
# environment
BUILD_ENV_SEQUENCE_NUMBER = 9
# environment
HISTCONTROL = ignoreboth
# environment
USERNAME = tourach23
# environment
ANDROID_BUILD_PATHS = :/home/tourach23/android-source/android-2.1_r1/out/host/linux-x86/bin:/home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin:/home/tourach23/android-source/android-2.1_r1/development/emulator/qtools:/home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin:/home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin
# environment
XDG_DATA_DIRS = /usr/local/share/:/usr/share/:/usr/share/gdm/
# environment
TARGET_SIMULATOR = false
# environment
DBUS_SESSION_BUS_ADDRESS = unix:abstract=/tmp/dbus-3sPGG4tkYw,guid=7738ab73bff2808fff67e4da4b8a9d2c
# environment
GNOME_KEYRING_SOCKET = /tmp/keyring-x3cTQA/socket
# environment
LESSOPEN = | /usr/bin/lesspipe %s
# environment
TARGET_BUILD_TYPE = release
# environment
PATH = /home/tourach23/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/tourach23/android-source/android-2.1_r1/out/host/linux-x86/bin:/home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin:/home/tourach23/android-source/android-2.1_r1/development/emulator/qtools:/home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin:/home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin
# environment
ANDROID_QTOOLS = /home/tourach23/android-source/android-2.1_r1/development/emulator/qtools
# environment
GPG_AGENT_INFO = /tmp/seahorse-ssh3T0/S.gpg-agent:5563:1
# environment
SESSION_MANAGER = local/lap:/tmp/.ICE-unix/5448
# environment
WINDOWID = 56623197
# environment
GDM_XSERVER_LOCATION = local
# default
.FEATURES := target-specific order-only second-expansion else-if archives jobserver check-symlink
# environment
LS_COLORS = no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.svgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:
# environment
SSH_AUTH_SOCK = /tmp/keyring-x3cTQA/ssh
# environment
DISPLAY = :0.0
# environment
OPROFILE_EVENTS_DIR = /home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/oprofile
# environment
PWD = /home/tourach23/android-source/android-2.1_r1
# environment
HOME = /home/tourach23
# environment
ANDROID_PRODUCT_OUT = /home/tourach23/android-source/android-2.1_r1/out/target/product/sholes-open
# environment
XDG_SESSION_COOKIE = c6a232a9259e01cec5dca10f4b8a3c01-1267375402.490755-69030679
# environment
LOGNAME = tourach23
# environment
TARGET_PRODUCT = sholes
# environment
LESSCLOSE = /usr/bin/lesspipe %s %s
# environment
GNOME_DESKTOP_SESSION_ID = Default
# environment
COLORTERM = gnome-terminal
# environment
SHLVL = 1
# environment
DISABLE_DEXPREOPT = true
# environment
USER = tourach23
# environment
GNOME_KEYRING_PID = 5447
# environment
ANDROID_TOOLCHAIN = /home/tourach23/android-source/android-2.1_r1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin
# environment
OLDPWD = /home/tourach23/android-source
# default
.VARIABLES :=
# environment
PROMPT_COMMAND = echo -ne "\033]0;[sholes-eng] [email protected]: /home/tourach23/android-source/android-2.1_r1\007"
# environment
OUT = /home/tourach23/android-source/android-2.1_r1/out/target/product/sholes-open
# environment
ANDROID_BUILD_TOP = /home/tourach23/android-source/android-2.1_r1
# environment
TARGET_BUILD_VARIANT = eng
# environment
WINDOWPATH = 7
# environment
LANG = en_US.UTF-8
# environment
TERM = xterm
# variable set hash-table stats:
# Load=53/1024=5%, Rehash=0, Collisions=2/60=3%
# Pattern-specific Variable Values
# No pattern-specific variable values.
# Directories
# No files, no impossibilities in 0 directories.
# Implicit Rules
# No implicit rules.
# Files
# files hash-table stats:
# Load=0/1024=0%, Rehash=0, Collisions=0/0=0%
# VPATH Search Paths
# No `vpath' search paths.
# No general (`VPATH' variable) search path.
# # of strings in strcache: 0
# # of strcache buffers: 0
# strcache size: total = 0 / max = 0 / min = 4096 / avg = 0
# strcache free: total = 0 / max = 0 / min = 4096 / avg = 0
# Finished Make data base on Mon Mar 1 17:14:13 2010
as the post says i ahve been googling this for days trying to figure something out. any help even if it's a point in the right direction would be greatly appreciated.
You are posting in the HTC passion group, but the procedure should be the same as far as building using koush's vendor packages.
I myself am trying to find instructions on building AOSP with vendor overlay just as you describe. I am looking for the equivalent of "building for dream" on source.android.com, for the nexus one. The same instructions would probably mostly apply to the motorola sholes you are asking for.
help!
yeah i debated between the G1 forum and the N1 forum since there isn't a sholes forum.
i've got everything setup as far as i know, but i am obviously missing something. i can compile individual system apk's like Launcher2.apk but if i go for a full system build it crashes out.
sniffle said:
yeah i debated between the G1 forum and the N1 forum since there isn't a sholes forum.
i've got everything setup as far as i know, but i am obviously missing something. i can compile individual system apk's like Launcher2.apk but if i go for a full system build it crashes out.
Click to expand...
Click to collapse
Did you remember to extract the proprietary files by using the extract-files.sh in koush's vendor dir?
I ran the extraction file in both the sholes-open directory as well as the root directory of the source files since I wasn't sure if the files needed to be placed in the source directory or the vendor directory.
Proprietary firles are locate in the following locations
Android-2.1_r1>proprietary
And
Android-2.1_r1>vendor>motorola>sholes-open>proprietary
sniffle said:
this is the error i come accross when trying to compile from source.
Code:
. build/envsetup.sh
lunch sholes-eng
make
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.1
TARGET_PRODUCT=sholes
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=ERD79
============================================
build/core/copy_headers.mk:15: warning: overriding commands for target `out/target/product/sholes-open/obj/include/libpv/getactualaacconfig.h'
build/core/copy_headers.mk:15: warning: ignoring old commands for target `out/target/product/sholes-open/obj/include/libpv/getactualaacconfig.h'
/bin/bash: line 0: cd: sdk/layoutopt/app/src/resources: No such file or directory
Click to expand...
Click to collapse
Hi there, I've been looking for a while, ... and twice !
This error comes from your java version. You should use jdk-1.5.0.19
That you can find there
Code:
https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/[email protected]_Developer
Cheers,
Shaiton
drop by cyanogenmod IRC for live help, someone or the other will be able to help, according to me it might be some lib error. try repo sync again and make clean. then try building again

[BUILD] Use Raspberry Pi to build Android Project (AOSP)

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 !

[GUIDE] How to port Bluez to Kitkat, Lollipop & Marshmallow

Introduction
When the bluetooth stack changed to Bluedroid in Android 4.2, it was a nightmare to some of the old devices like my GT-P6800. I didn't have any experience in Bluetooth before so I did what I know. I spent weeks to revert the 4.2 platform to Bluez. Even though I succeeded, it probably not doable for 4.3 and later.
Last Nov. I found that bluez.org announced support for Andriod in Sep. It gave me hope again! Thanks to the bluez team!:good: The principle is straight forward - Implement the functions defined in "hardware/libhardware/include/hardware/bluetooth.h". That's what I thought but I didn't have enough knowledge nor confidence to try...
After studying for a while, I started porting bluez to Android 4.4 last Christmas. It was frustrated and helpless. Although the lastest Android 4.4 example for Mako and Flo are out, they don't help much. A bunch of prebuilt kernel objects surely doesn't help! Porting for those devices already having bluedroid support is meaningless to most of us too...
Building the bluez hal and daemon are straight forward but how to make it really work is another story. After a few painful and frustrated weekends, I finally managed to pull everything together. I can start/stop and pairing bluetooth devices in the platform now. And here I'm, sharing my experiences. I think there might be better way and I welcome any corrections.
My p6800 has CSR bluetooth chip which has no bluedroid support. I think the same approach would work for other chips too. Cheers! :highfive:
** All paths assume your rom source dircetory to be the current directory **
1. Downlaod and Build
Bluez.org already has its own tutorial. I just summerize and list my suggestions.
1.1 local manifest
I learned my lesson and would avoid touching the "manifest.xml".
Add the following lines to your ".repo/local_manifests/local_menifest.xml"
For cm11, omni, etc.
Code:
<remote name="gcode" fetch="https://code.google.com/p/"/>
<remote name="korg" fetch="git://git.kernel.org/pub/scm/bluetooth/"/>
<remove-project name="android_external_bluetooth_bluedroid"/>
<project remote="korg" path="external/bluetooth/bluez" name="bluez" group="pdk" revision="master"/>
<project remote="korg" path="external/bluetooth/sbc" name="sbc" group="pdk" revision="master"/>
<project remote="gcode" path="external/bluetooth/glib" name="aosp-bluez.glib" group="pdk" revision="master"/>
For AOSP, replace the remove-project with:
Code:
<remove-project name="platform/external/bluetooth/bluedroid"/>
After repo sync, bluez will replace bluedroid.
1.2 patching bionic
The patches for bionic are simple. Mainly by adding two flags and the function epoll_create1().
Bionic may vary from ROMs. It is wiser to patch the bionic of your ROM manually. You may follow the changes of the two commits below:
https://code.google.com/p/aosp-blue...96020013615b00d70579123f&repo=platform-bionic
https://code.google.com/p/aosp-blue...3347746d0d9727d8439ef4c4&repo=platform-bionic
1.3 neccessary tools
There are tools in "external/bluetooth/bluez/tools". You may need some of those tools for setup or testing.
This is the "Android.mk" I added to "external/bluetooth/bluez/tools". You may cheery pick the required tools for your device.
Code:
#
# Bluetooth tools for setup and debug
# daniel_hk
LOCAL_PATH := external/bluetooth
# Retrieve BlueZ version from configure.ac file
BLUEZ_VERSION := $(shell grep ^AC_INIT $(LOCAL_PATH)/bluez/configure.ac | cpp -P -D'AC_INIT(_,v)=v')
# Specify pathmap for glib
#pathmap_INCL += glib:external/bluetooth/glib
# Specify common compiler flags
BLUEZ_COMMON_CFLAGS := -DVERSION=\"$(BLUEZ_VERSION)\" \
-DSTORAGEDIR=$(ANDROID_STORAGEDIR) \
# Disable warnings enabled by Android but not enabled in autotools build
BLUEZ_COMMON_CFLAGS += -Wno-pointer-arith -Wno-missing-field-initializers
# @ daniel, extra tools for CSR
ifeq ($(BOARD_HAVE_BLUETOOTH_CSR),true)
#
# bccmd
#
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
bluez/lib/hci.c \
bluez/lib/bluetooth.c \
bluez/tools/bccmd.c \
bluez/tools/csr.c \
bluez/tools/csr_3wire.c \
bluez/tools/csr_bcsp.c \
bluez/tools/csr_hci.c \
bluez/tools/csr_h4.c \
bluez/tools/csr_usb.c \
bluez/tools/ubcsp.c
LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS)
LOCAL_C_INCLUDES:=\
$(LOCAL_PATH)/bluez \
$(LOCAL_PATH)/bluez/lib \
$(LOCAL_PATH)/bluez/tools \
$(LOCAL_PATH)/bluez/src \
$(LOCAL_PATH)/bluez/src/shared \
LOCAL_MODULE:=bccmd
include $(BUILD_EXECUTABLE)
#
# sdptool
#
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
bluez/lib/hci.c \
bluez/lib/bluetooth.c \
bluez/lib/sdp.c \
bluez/tools/sdptool.c \
bluez/src/sdp-xml.c
LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS)
LOCAL_C_INCLUDES:=\
$(LOCAL_PATH)/bluez \
$(LOCAL_PATH)/bluez/lib \
$(LOCAL_PATH)/bluez/tools \
$(LOCAL_PATH)/bluez/src \
$(LOCAL_PATH)/bluez/src/shared \
LOCAL_C_INCLUDES += \
$(call include-path-for, glib) \
$(call include-path-for, glib)/glib \
LOCAL_SHARED_LIBRARIES := \
libglib \
LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE:=sdptool
include $(BUILD_EXECUTABLE)
endif
1.4 patches for CyanogenMod 11
In CyanogenMod 11, the function "pin_request_cb" has one more argument. The following file need some patches:
in the file "external/bluetooth/bluez/android/hal-bluetooth.c"
Code:
[I]** in function: handle_pin_request[/I]
bt_hal_cbacks->pin_request_cb(addr, name, ev->class_of_dev, 0); // @ daniel, added 0 for cm11
in the file "external/bluetooth/bluez/android/client/if-bt.c"
Code:
[I]** in function: pin_request_cb[/I]
static void pin_request_cb(bt_bdaddr_t *remote_bd_addr, bt_bdname_t *bd_name,
uint32_t cod, uint8_t secure) // @ daniel, added secure from cm11
{
/* Store for command completion */
bt_bdaddr_t2str(remote_bd_addr, last_remote_addr);
pin_request_addr = *remote_bd_addr;
haltest_info("%s: remote_bd_addr=%s bd_name=%s cod=%06x secure=%02x\n", __func__,
last_remote_addr, bd_name->name, cod, secure); // @ daniel, added
terminal_prompt_for("Enter pin: ", pin_request_answer);
}
2. kerenl patch
In the "README" inside "external/bluetooth/bluez/android", there is the line:
Minimal required version of management interface is 1.3. This corresponds to Linux 3.9 but latest available version is recommended.
Click to expand...
Click to collapse
If you have tried porting bluez and fail, check the logcat. You might probably found the error "Failed to access management interface". This is the key making bluez to work! Sadly, most of the existing Android kernels are before ver. 3.9! The latest kernel we have might be ver. 3.4.x and the kernel for my p6800 is ver. 3.0.x! As the above line stated, Bluez5 requires the kernel to have management interface 1.3 or above. That means we have to backport the bluetooth subsystem from at least ver. 3.9. I backport my kernel with the latest (3.13-1) found in linux-foundation.org: http://drvbp1.linux-foundation.org/~mcgrof/rel-html/backports/
It was a tough and painful job! There are lots of changes. I finally got a bootable backport kernel in 2 days!
I packed my patches in View attachment kernel-3.0.x-backport-3.13-1.zip. This patch is for my 3.0.x kernel which might be different from other 3.0.x kernels. Don't have time to tidy up but it works for me. Although I've done the hard part, it still requires extra patience to get yours done. Prepare yourself...
2.1 Backport 3.13-1 to your kernel
Direct replacements.
Replace the following folders in the zip with the one in your kernel source:
drivers/bluetooth
net/bluetooth
include/net/bluetooth
include/backport​
Direct replacement might not work!
Check include/linux in the zip
For each file,
add the required part (which I delimited with comments @ daniel and //@ ) to the corresponding file in your kernel source.
If file not exist,
copy the files to your kernel source​
Check your defconfig. As README suggested, defconfig should have:
CONFIG_BT
CONFIG_BT_RFCOMM
CONFIG_BT_RFCOMM_TTY
CONFIG_BT_BNEP
CONFIG_BT_BNEP_MC_FILTER
CONFIG_BT_BNEP_PROTO_FILTER
CONFIG_BRIDGE
CONFIG_UHID
# and for CSR chips
CONFIG_BT_HCIUART=y
CONFIG_BT_HCIUART_H4=y
CONFIG_BT_HCIUART_BCSP=y​
You probably need to compile the kernel many times to get it work. I worte a build script View attachment build-k.zip to compile the kernel only.
Copy build-k to your ROM source directory and type:
Code:
./build-k <your device>
2.2 Backport-hid-generic to your kernel
There is another patch in the Mako-kern example:
https://code.google.com/p/aosp-blue...eneric-driver.patch?repo=device-lge-mako-kern
Don't know if it is required for your kernel but adding this patch seems doesn't hurt.
If you do it right, you may find "Bluetooth management interface 1.4" in your logcat. Congratulation! Bluetoothd can connect to your kernel now!
3. initialization and setup
Take a look at your devices tree's TARGET_CUSTOM_BLUEDROID definition. If you have a file assigned, it supposed to replace the file "bluetooth.c" in the "system/bluetooth" project. In Android 4.4, this project is no longer exist/needed. Before Android 4.2, this project provide the functions "bt_enable()" and "bt_disable()" which are called in the frameworks. These functions will tell you how to "power on", "power off" and init your device's Bluetooth chip.
For CSR:
set /sys/class/rfkill/rfkill0/state to 1 ("power on")
start the service "bccmd" which will setup the chip and upload a PSConfig to the chip
start the service "hciattach" which init the port hci0 with parameters
start the service "bluetoothd" which is the bluez stack
The services are defined in init.rc or init.${ro.hardware}.rc.
3.1 Test your device and the tools
Disable the "import init.bluetooth.rc" line if you have added it before.
Example for CSR chips. Follow the steps in bt_enable. In a terminal or via adb:
Code:
$ su -- [I][COLOR="SeaGreen"]root user is required[/COLOR][/I]
# echo "1" > /sys/class/rfkill/rfkill0/state
# bccmd -t bcsp -d /dev/ttySAC0 -b 115200 psload -r /system/etc/PSConfig_8811.psr
Loading 0x212c ... done
Loading 0x212d ... done
...
Loading PSKEY_CLOCK_REQUEST_ENABLE ... done
Loading PSKEY_UART_HOST_WAKE ... done
# hciattach -p /dev/ttySAC0 bcsp 3000000 flow
Device setup complete
# hciconfig hci0 up
# hcitool scan -- [I][COLOR="SeaGreen"]turn on a device's bluetooth for testing[/COLOR][/I]
Nexus 4 -- [I][COLOR="SeaGreen"]found the device means bluetooth is working now[/COLOR][/I]
3.2 Init sequence
In Bluez5, the HAL (bluetooth.default.so) driver will be loaded at boot and the daemon (bluetoothd) will be started inside too. Take a look at the function "bool hal_ipc_init(void)" in "external/bluetooth/bluez/android/hal-ipc.c". You may find how the HAL is init which is different from pre-4.2 Androids.
In order to get the daemon (bluetoothd) to work, we have to init the chip before that.
I worte a shell script init.bt.sh to init the chip/port:
Code:
#!/system/bin/sh
# modified by daniel_hk
LOG_TAG="CSR8811-HCI"
BTUART_PORT=/dev/ttySAC0
BTSTATE=/sys/class/rfkill/rfkill0/state
PSCONFIG=/system/etc/PSConfig_8811.psr
logi ()
{
/system/bin/log -t $LOG_TAG -p i ": [email protected]"
}
loge ()
{
/system/bin/log -t $LOG_TAG -p e ": [email protected]"
}
failed ()
{
loge "$1: exit code $2"
exit $2
}
#Enable power of csr chip
echo "1" > $BTSTATE
# PS Config with bccmd
logwrapper /system/bin/bccmd -t bcsp -d $BTUART_PORT -b 115200 psload -r $PSCONFIG
case $? in
0) logi "bccmd init port....done";;
*) failed "port: $BTUART_PORT - bccmd failed" $?;
exit $?;;
esac
# attach HCI
logwrapper /system/bin/hciattach -p $BTUART_PORT bcsp 3000000 flow
case $? in
0) logi "hci attached to : $BTUART_PORT";;
*) failed "port: $BTUART_PORT - hciattach failed" $?;
exit $?;;
esac
exit 0
It takes time for bccmd and hciattach to complete. Putting them in seperate services requires delay in between. I think it is better to run them as application one after one.
A new rc file init.${ro.hardware}.bt.rc is created and need to be imported in your init.${ro.hardware}.rc
Code:
on boot
start bt_init
on property:init.svc.bluetoothd=running
start hci0_up
on property:init.svc.bluetoothd=stopped
start hci0_down
service bt_init /system/bin/logwrapper /system/bin/sh /system/etc/init.bt.sh
class main
user root
group bluetooth net_bt_admin system
disabled
oneshot
service hci0_up /system/bin/logwrapper /system/xbin/hciconfig hci0 up
class main
group bluetooth
disabled
oneshot
service hci0_down /system/bin/logwrapper /system/xbin/hciconfig hci0 down
class main
group bluetooth
disabled
oneshot
import init.bluetooth.rc
Since HAL (bluetooth.default.so) is started quite early, I start the service bt_init at boot. I have tried a few places, daemon might timed out before bt_init finish. It also seems no need to repeat the init process everytime.
When bluetoothd is running (system/core/init will set the property init.svc.bluetoothd=running), set hci0 up with hciconfig. And when the service bluetoothd is stopped, set hci0 down with hciconfig. There might be a better way. Please indulge me if something better coming up.
You may turn ON/OFF bluetooth in settings now. Pairing and file transfer is working too.
4. Further porting
Take a look at the function get_profile_interface() in the file external/bluetooth/bluez/android/hal-bluetooth.c. Some interfaces which frameworks requested are missing.
eg. Bluetooth Handsfree interface
Bluetooth Map Client Interface
Bluetooth Health Interface
Bluetooth GATT Interface​Update: Fully support for Kitkat now. Check the README inside the android folder for detail.
As I mentioned before, I'm new to bluetooth. Further reading is required for me to fix other services. I also don't have enough time now. I have to process the stuck works after the Chinese New Year holiday. :cyclops: Hoping I can continue by the end of Feb. In the mean time, I hope someone have better knowledge may help fix other services.
For those devices don't have bluedroid support, we have a chance to carry on now!
[GUIDE] Porting Bluez to Marshmallow
Check the modified Bluez in my github.
It has been tested with Omni6 (Android-6.0.1_r3)
You have to remove system_bt in local_manifest.xml (similar to bluedroid, check post #1 for detail)
CM needs extra modifications. Will be available after testing.
Nice , Xperia Novathor devs also working on stable bluez 
 @95A31
Nice guide In CM11 you need also revert this https://github.com/CyanogenMod/andr...mmit/763c68d048d268bd931dffa72000f52830ffe2d8
95A31 said:
Nice guide In CM11 you need also revert this https://github.com/CyanogenMod/andr...mmit/763c68d048d268bd931dffa72000f52830ffe2d8
Click to expand...
Click to collapse
Thanks! Patch in section 1.4 is another alternative for cm11.
daniel_hk said:
Thanks! Patch in section 1.4 is another alternative for cm11.
Click to expand...
Click to collapse
Wops my fault :silly:, you have right
although i dont have my previous device which has csr chip..but those still have csr will get greatly benefited ..your work is incredible......god bless u!!!
keep the good work!!!
static void pin_request_cb is defined in external/bluetooth/bluez/android/client/if-bt.c
95A31 said:
static void pin_request_cb is defined in external/bluetooth/bluez/android/client/if-bt.c
Click to expand...
Click to collapse
yeah, it is also defined in if-bt.c but if you check android/Android.mk, only haltest use it. If you want to build haltest, you need to change if-bt.c too.
Take a look the file android/Android.mk which is the make file for android. bluetooth.default.so which cm11 refered to, use the definition in hal-bluetoth.c.
Sent from my Nexus 7 using Tapatalk
daniel_hk said:
yeah, it is also defined in if-bt.c but if you check android/Android.mk, only haltest use it. If you want to build haltest, you need to change if-bt.c too.
Take a look the file android/Android.mk which is the make file for android. bluetooth.default.so which cm11 refered to, use the definition in hal-bluetoth.c.
Sent from my Nexus 7 using Tapatalk
Click to expand...
Click to collapse
Forgot my unknowledge/newbie but I can not find it in hal-bluetoth.c (In BLueZ git)
95A31 said:
Forgot my unknowledge/newbie but I can not find it in hal-bluetoth.c (In BLueZ git)
Click to expand...
Click to collapse
It's in the android folder. In the same place as Android.mk.
If you can't find inside the file, you might have the old version. Try include the project in manifest and sync again.
I have a suggested local_manifest in post #1.
Good luck!
Sent from my Nexus 7 using Tapatalk
daniel_hk said:
It's in the android folder. In the same place as Android.mk.
Sent from my Nexus 7 using Tapatalk
Click to expand...
Click to collapse
I mean in hal-bluetooth.c, can you tell me the line in this version ot the file? (I know that it is a retarded question but I really can find other occurences of pin_request_cb outside handle_pin_request function) I am working on BlueZ git so I am working on lastest version
95A31 said:
I mean in hal-bluetooth.c, can you tell me the line in this version ot the file? (I know that it is a retarded question but I really can find other occurences of pin_request_cb outside handle_pin_request function) I am working on BlueZ git so I am working on lastest version
Click to expand...
Click to collapse
All the changes are listed in post#1.
In line 239 of you link, there is the line:
bt_hal_cbacks->pin_request_cb(addr, name, ev->class_of_dev);
It is a callback. The definition is in cm11 which had changed. That's why we have to add one more argument. (or revert the cm11 commit as you said)
The definition if-bt.c which is a client, is for testing. It has to define the callback which is required in int. Got it?
daniel_hk said:
All the changes are listed in post#1.
In line 239 of you link, there is the line:
bt_hal_cbacks->pin_request_cb(addr, name, ev->class_of_dev);
It is a callback. The definition is in cm11 which had changed. That's why we have to add one more argument. (or revert the cm11 commit as you said)
The definition if-bt.c which is a client, is for testing. It has to define the callback which is required in int. Got it?
Click to expand...
Click to collapse
Get it :good:
Ok, I have a nice bootloop: http://pastebin.com/QcZbEkfx Guys some ideas ?
95A31 said:
Ok, I have a nice bootloop: http://pastebin.com/QcZbEkfx Guys some ideas ?
Click to expand...
Click to collapse
I have checked your logcat. There is no management interface log. The kernel backport on blietooth subsystem is probably failed.
Sent from my Nexus 7 using Tapatalk
daniel_hk said:
I have checked your logcat. There is no management interface log. The kernel backport on blietooth subsystem is probably failed.
Sent from my Nexus 7 using Tapatalk
Click to expand...
Click to collapse
I foud this dependence in my case: WLAN init need that BT chip is initialized because WLAN ask clock to BT. The intoduction of import init.bluetooth.rc broke this dependence. Fu*king details :cyclops: I hope to save debug time to someone
Thanks, very helpful guide. Following this I was able to get BlueZ working on MSM7x27a. However, instead of dropping the backport sources in the kernel tree I followed this documentation to build the backports as external modules, which looks like a cleaner way to me. This requires building the kernel without BT (and, in cases like this, patching the source to remove some dependencies on built-in BT). This leaves the kernel sources (mostly) untouched, and makes adapting the backport sources easier because you can separately build the modules without doing a full kernel build.
The modules can then be built like this:
Code:
# clean output files
make -C kernel/backports ARCH=arm CROSS_COMPILE="arm-eabi-" KLIB=$OUT/obj/KERNEL_OBJ KLIB_BUILD=$OUT/obj/KERNEL_OBJ mrproper
# configure
make -C kernel/backports ARCH=arm CROSS_COMPILE="arm-eabi-" KLIB=$OUT/obj/KERNEL_OBJ KLIB_BUILD=$OUT/obj/KERNEL_OBJ menuconfig
# build
make -C kernel/backports ARCH=arm CROSS_COMPILE="arm-eabi-" KLIB=$OUT/obj/KERNEL_OBJ KLIB_BUILD=$OUT/obj/KERNEL_OBJ
jjm34 said:
Thanks, very helpful guide. Following this I was able to get BlueZ working on MSM7x27a. However, instead of dropping the backport sources in the kernel tree I followed this documentation to build the backports as external modules, which looks like a cleaner way to me. This requires building the kernel without BT (and, in cases like this, patching the source to remove some dependencies on built-in BT). This leaves the kernel sources (mostly) untouched, and makes adapting the backport sources easier because you can separately build the modules without doing a full kernel build.
The modules can then be built like this:
Code:
# clean output files
make -C kernel/backports ARCH=arm CROSS_COMPILE="arm-eabi-" KLIB=$OUT/obj/KERNEL_OBJ KLIB_BUILD=$OUT/obj/KERNEL_OBJ mrproper
# configure
make -C kernel/backports ARCH=arm CROSS_COMPILE="arm-eabi-" KLIB=$OUT/obj/KERNEL_OBJ KLIB_BUILD=$OUT/obj/KERNEL_OBJ menuconfig
# build
make -C kernel/backports ARCH=arm CROSS_COMPILE="arm-eabi-" KLIB=$OUT/obj/KERNEL_OBJ KLIB_BUILD=$OUT/obj/KERNEL_OBJ
Click to expand...
Click to collapse
Yeah! Yours seems better. I was messing with the kernel for a while before backport. Traditional backport kill my WiFi so I did what I knew. I will try yours later.
Any other success would be cheerful.
Sent from my Nexus 7 using Tapatalk
Sucessfully ported on CyanogenMod 11.0 git (using Bluetooth from AOSP).
HOWTO:
Remove CyanogenMod Bluetooth and grab AOSP version by local_manifest:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="kernel"
fetch="git://git.kernel.org/pub/scm/" />
<remote name="googlecode"
fetch="https://code.google.com/" />
<remove-project name="CyanogenMod/android_external_bluetooth_bluedroid" />
<project remote="kernel" path="external/bluetooth/bluez" name="bluetooth/bluez" groups="pdk" revision="master" />
<project remote="kernel" path="external/bluetooth/sbc" name="bluetooth/sbc" groups="pdk" revision="master" />
<project remote="googlecode" path="external/bluetooth/glib" name="p/aosp-bluez.glib" groups="pdk" revision="master" />
<remove-project name="CyanogenMod/android_packages_apps_Bluetooth" />
<remove-project name="CyanogenMod/android_packages_apps_BluetoothExt" />
<project path="packages/apps/Bluetooth" name="platform/packages/apps/Bluetooth" remote="aosp" revision="refs/tags/android-4.4.2_r1" />
<project path="aosp/packages/apps/Settings" name="platform/packages/apps/Settings" remote="aosp" revision="refs/tags/android-4.4.2_r1" />
<project path="aosp/frameworks/base" name="platform/frameworks/base/" remote="aosp" revision="refs/tags/android-4.4.2_r1" />
<project path="aosp/hardware/libhardware" name="platform/hardware/libhardware/" remote="aosp" revision="refs/tags/android-4.4.2_r1" />
</manifest>
Replace CyanogenMod Bluetooth system with AOSP one:
Code:
rm cm-11.0/hardware/libhardware/include/hardware/bluetooth.h
cp aosp/hardware/libhardware/include/hardware/bluetooth.h cm-11.0/hardware/libhardware/include/hardware/bluetooth.h
rm -rf cm-11.0/frameworks/base/core/java/android/bluetooth
cp -r aosp/frameworks/base/core/java/android/bluetooth cm-11.0/frameworks/base/core/java/android
rm cm-11.0/frameworks/base/services/java/com/android/server/BluetoothManagerService.java
cp aosp/frameworks/base/services/java/com/android/server/BluetoothManagerService.java cm-11.0/frameworks/base/services/java/com/android/server/BluetoothManagerService.java
rm -rf cm-11.0/packages/apps/Settings/src/com/android/settings/bluetooth
cp -r aosp/packages/apps/Settings/src/com/android/settings/bluetooth cm-11.0/packages/apps/Settings/src/com/android/settings
Adapt CyanogenMod with this changes:
Code:
diff --git a/frameworks/base/Android.mk b/frameworks/base/Android.mk
index 91338ef..43a87ef 100644
--- a/frameworks/base/Android.mk
+++ b/frameworks/base/Android.mk
@@ -88,10 +88,8 @@ LOCAL_SRC_FILES += \
core/java/android/wipower/IWipower.aidl \
core/java/android/wipower/IWipowerManagerCallback.aidl \
core/java/android/bluetooth/IBluetooth.aidl \
- core/java/android/bluetooth/IQBluetooth.aidl \
core/java/android/bluetooth/IBluetoothA2dp.aidl \
core/java/android/bluetooth/IBluetoothCallback.aidl \
- core/java/android/bluetooth/IQBluetoothAdapterCallback.aidl \
core/java/android/bluetooth/IBluetoothHeadset.aidl \
core/java/android/bluetooth/IBluetoothHeadsetPhone.aidl \
core/java/android/bluetooth/IBluetoothHealth.aidl \
@@ -100,18 +98,12 @@ LOCAL_SRC_FILES += \
core/java/android/bluetooth/IBluetoothPan.aidl \
core/java/android/bluetooth/IBluetoothManager.aidl \
core/java/android/bluetooth/IBluetoothManagerCallback.aidl \
- core/java/android/bluetooth/IQBluetoothManagerCallback.aidl \
core/java/android/bluetooth/IBluetoothPbap.aidl \
core/java/android/bluetooth/IBluetoothMap.aidl \
core/java/android/bluetooth/IBluetoothStateChangeCallback.aidl \
- core/java/android/bluetooth/IBluetoothHandsfreeClient.aidl \
- core/java/android/bluetooth/IBluetoothHidDevice.aidl \
- core/java/android/bluetooth/IBluetoothHidDeviceCallback.aidl \
core/java/android/bluetooth/IBluetoothGatt.aidl \
core/java/android/bluetooth/IBluetoothGattCallback.aidl \
core/java/android/bluetooth/IBluetoothGattServerCallback.aidl \
- core/java/android/bluetooth/IBluetoothSap.aidl \
- core/java/android/bluetooth/IBluetoothDun.aidl \
core/java/android/content/IClipboard.aidl \
core/java/android/content/IContentService.aidl \
core/java/android/content/IIntentReceiver.aidl \
@@ -407,7 +399,6 @@ aidl_files := \
frameworks/base/core/java/com/android/internal/view/IInputMethodClient.aidl \
frameworks/base/core/java/com/android/internal/view/IInputMethodManager.aidl \
frameworks/base/core/java/com/android/internal/view/IInputMethodSession.aidl \
- frameworks/base/core/java/android/bluetooth/BluetoothLEServiceUuid.aidl \
frameworks/base/graphics/java/android/graphics/Bitmap.aidl \
frameworks/base/graphics/java/android/graphics/Rect.aidl \
frameworks/base/graphics/java/android/graphics/Region.aidl \

[patch] Android Shell (mksh) bash_profile replacement

Android default shell is a bit tricky when you want to do customiztaion. So, i just happen to browsing a bit to its source and do a little patch. This is a bit dangerous coz it'll automatically eval the .shinit in /sdcard/ which we know some apps wight r/w that file, use with caution. Tested on x86, 4.4.2. ASUS Zenfone C.
Patch,
Code:
diff --git a/src/main.c b/src/main.c
index ebbadd9..712d5f9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -38,6 +38,10 @@ __RCSID("$MirOS: src/bin/mksh/main.c,v 1.322 2016/11/11 23:48:30 tg Exp $");
extern char **environ;
+#ifndef FORCE_LOAD
+#define FORCE_LOAD "/sdcard/.shinit"
+#endif
+
#ifndef MKSHRC_PATH
#define MKSHRC_PATH "~/.mkshrc"
#endif
@@ -619,6 +623,7 @@ main_init(int argc, const char *argv[], Source **sp, struct block **lp)
if (cp[0] != '\0')
include(cp, 0, NULL, true);
}
+ include(FORCE_LOAD, 0, NULL, true);
} else {
include(MKSH_SUID_PROFILE, 0, NULL, true);
/* turn off -p if not set explicitly */
Build-step, tweak a bit to compatible with your phone.
Code:
# clone repo
$ git clone https://android.googlesource.com/platform/external/mksh
# setting up standalone-toolchain
$ $NDK_ROOT/build/tools/make_standalone_toolchain.py --api 19 --install-dir toolchain/ --arch x86
$ export CROSS=toolchain/bin/i686-linux-android
$ export CC=${CROSS}-gcc
$ export AS=${CROSS}-as
$ export LD=${CROSS}-ld
$ export AR=${CROSS}-ar
# Apply patch
$ patch src/main.c android.patch
# Build time!
$ ./src/Build.sh
Push and replace mksh to android, dont forget to make a backup for original mksh in case things goes wrong.
This mksh will force load .shinit in /sdcard/ (/sdcard/.shinit). example for my .shinit,
Code:
export PATH=/data/local/bin:$PATH
alias bash='bash --rcfile /sdcard/bashrc'
alias gdb='gdb -q'
alias ll='ls -laH'

[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?

Categories

Resources