dtbtool error (read i have some other questions too) - General Questions and Answers

Hi there, ive almost posted atleast 5 times for errors and im really thankfull for all the help i got.
im building pac-5.1 from source from my phone. my phones manufacturer (lenovo) did not release the complete source so im using the kernel of surnia (moto e 2015 4g) which also has the same kernel. my mkboot.img looks like this -
Code:
# Use prebuilt dt.img
INSTALLED_DTIMAGE_TARGET := $(PRODUCT_OUT)/dt.img
$(INSTALLED_DTIMAGE_TARGET):
@echo -e ${CL_CYN}"Start DT image: [email protected]"${CL_RST}
$(call append-dtb)
$(call pretty,"Target dt image: $(INSTALLED_DTIMAGE_TARGET)")
@echo -e ${CL_CYN}"Made DT image: [email protected]"${CL_RST}
## Overload bootimg generation: Same as the original, + --dt arg
$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(INSTALLED_DTIMAGE_TARGET)
$(call pretty,"Target boot image: [email protected]")
$(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(BOARD_MKBOOTIMG_ARGS) --dt $(INSTALLED_DTIMAGE_TARGET) --output [email protected]
$(hide) $(call assert-max-image-size,[email protected],$(BOARD_BOOTIMAGE_PARTITION_SIZE),raw)
@echo -e ${CL_CYN}"Made boot image: [email protected]"${CL_RST}
## Overload recoveryimg generation: Same as the original, + --dt arg
$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTIMG) $(INSTALLED_DTIMAGE_TARGET) \
$(recovery_ramdisk) \
$(recovery_kernel)
@echo -e ${CL_CYN}"----- Making recovery image ------"${CL_RST}
$(hide) $(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) $(BOARD_MKBOOTIMG_ARGS) --dt $(INSTALLED_DTIMAGE_TARGET) --output [email protected]
$(hide) $(call assert-max-image-size,[email protected],$(BOARD_RECOVERYIMAGE_PARTITION_SIZE),raw)
@echo -e ${CL_CYN}"Made recovery image: [email protected]"${CL_RST}
and moto e's like this -
Code:
LOCAL_PATH := $(call my-dir)
## Build and run dtbtool
[COLOR="Red"]DTBTOOL := $(HOST_OUT_EXECUTABLES)/dtbToolCM$(HOST_EXECUTABLE_SUFFIX)[/COLOR]
INSTALLED_DTIMAGE_TARGET := $(PRODUCT_OUT)/dt.img
$(INSTALLED_DTIMAGE_TARGET): $(DTBTOOL) $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr $(INSTALLED_KERNEL_TARGET)
$(call pretty,"Target dt image: $(INSTALLED_DTIMAGE_TARGET)")
$(hide) $(DTBTOOL) -2 -o $(INSTALLED_DTIMAGE_TARGET) -s $(BOARD_KERNEL_PAGESIZE) -p $(KERNEL_OUT)/scripts/dtc/ $(KERNEL_OUT)/arch/arm/boot/dts/
@echo -e ${CL_CYN}"Made DT image: [email protected]"${CL_RST}
## Overload bootimg generation: Same as the original, + --dt arg
$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(INSTALLED_DTIMAGE_TARGET)
$(call pretty,"Target boot image: [email protected]")
$(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(BOARD_MKBOOTIMG_ARGS) --dt $(INSTALLED_DTIMAGE_TARGET) --output [email protected]
$(hide) $(call assert-max-image-size,[email protected],$(BOARD_BOOTIMAGE_PARTITION_SIZE),raw)
@echo -e ${CL_CYN}"Made boot image: [email protected]"${CL_RST}
## Overload recoveryimg generation: Same as the original, + --dt arg
$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTIMG) $(INSTALLED_DTIMAGE_TARGET) \
$(recovery_ramdisk) \
$(recovery_kernel)
@echo -e ${CL_CYN}"----- Making recovery image ------"${CL_RST}
$(hide) $(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) $(BOARD_MKBOOTIMG_ARGS) --dt $(INSTALLED_DTIMAGE_TARGET) --output [email protected]
$(hide) $(call assert-max-image-size,[email protected],$(BOARD_RECOVERYIMAGE_PARTITION_SIZE),raw)
@echo -e ${CL_CYN}"Made recovery image: [email protected]"${CL_RST}
i had to remove the highlited part in my mkboot.img because of this error
Code:
make: *** No rule to make target '/ home/bassface/PAC/out/host/linux-x86/bin/dtbToolCM' necessary '/ home/bassface/PAC/out/target/product /a6000/dt.img '.
the rom succesfully compiles for 4+hours then stops saying it could not find dt.img in product/a6000 if i remove the
Code:
DTBTOOL := $(HOST_OUT_EXECUTABLES)/dtbToolCM$(HOST_EXECUTABLE_SUFFIX
line. i just deleted the entire out ditrectory and im recompiling i placed the dt.img in now. but i want to know whats causing this error. why dont i have the dtbtool? is it supposed to be downloaded seperately.? evem if the rom builds succesfully after copying it and pasting in the out directory. what am i supposed to do for it to copy automatically in the future, if someone else wants to make something using my source? thankyou

Did you solve this? I'm struggling with this too...
I know the dtbtool is in my repo...
Thanks in advance,
Yordi

I know this is quite old, but for people who have run into this problem like me, try adding this to your repo manifest. Adapt it according to the ROM you are building.
<project path="system/tools/dtbtool" name="android_system_tools_dtbtool" remote="lineage" />

Related

NDK-less native apps

Seems to me the Android NDK has been abstracted to the point of obscurity.
I understand the need for a regimented application framework; but talk about over engineering...
> cd $(NDK_HOME)
> build/host-setup.sh
> make app=hello-jni
# ... some magic ...
> cd apps/hello-jni/project
> android.bat update project -p .
> ant debug
# ... more magic ...
> adb install bin/hello-jni-debug.apk
#hey wait wheres my c executable...
> vi apps/hello-jni/project/jni/Android.mk
# change BUILD_SHARED_LIBRARY to BUILD_EXECUTABLE
>make app=hello-jni
# there we go
what a pain, not to mention porting existing posix code with multiple dependencies...
Here is my Makefile developed in cygwin on windows by running:
> make APP=hello-jni V=1
and copying all the pertinent flags into a generic Makefile...
Hope this helps anyone having the same frustrations.
Code:
.KEEP_STATE:
#
# Android NDK tool chain setup
# run cd ~/android/ndk; make APP-xxx -V1 to obtain toolchain values
#
NDK=/home/Administrator/android/ndk
GCC=$(NDK)/build/prebuilt/windows/arm-eabi-4.2.1/bin/arm-eabi-gcc
AR=$(NDK)/build/prebuilt/windows/arm-eabi-4.2.1/bin/arm-eabi-ar
STRIP=$(NDK)/build/prebuilt/windows/arm-eabi-4.2.1/bin/arm-eabi-strip
NDK_INCLUDE=-I$(NDK)/build/platforms/android-3/arch-arm/usr/include
NDK_CFLAGS=\
-march=armv5te -mtune=xscale -msoft-float -fpic -mthumb-interwork \
-ffunction-sections -funwind-tables -fstack-protector -fno-short-enums \
-D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ \
-mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 \
-DANDROID \
#
# THIS WORKS
#
NDK_LDFLAGS=\
-nostdlib -Bdynamic -Wl,-dynamic-linker,/system/bin/linker -Wl,--gc-sections -Wl,-z,nocopyreloc \
$(NDK)/build/platforms/android-3/arch-arm/usr/lib/libc.so \
$(NDK)/build/platforms/android-3/arch-arm/usr/lib/libstdc++.so \
$(NDK)/build/platforms/android-3/arch-arm/usr/lib/libm.so \
$(NDK)/build/platforms/android-3/arch-arm/usr/lib/crtbegin_dynamic.o \
-Wl,--no-undefined -Wl,-rpath-link=$(NDK)/build/platforms/android-3/arch-arm/usr/lib \
$(NDK)/build/prebuilt/windows/arm-eabi-4.2.1/lib/gcc/arm-eabi/4.2.1/interwork/libgcc.a \
$(NDK)/build/platforms/android-3/arch-arm/usr/lib/crtend_android.o
#
# Local setup
#
INCLUDE=$(NDK_INCLUDE) -I../sockets -I.
CFLAGS=$(NDK_CFLAGS)
LDFLAGS=$(NDK_LDFLAGS)
LDPATH=$(NDK_LDPATH) -L../sockets -L.
LIBS=$(NDK_LIBS) -ludp -lsockets
OBJS=$(NDK_OBJS) \
udp.o \
readTest.o \
hostnameToIp.o
# Implicit target definition for generating objects. (don't touch!)
.c.o:
$(GCC) $(INCLUDE) $(CFLAGS) -Wall -D__cygwin__ -O2 -DNDEBUG -g -c -MMD -MP -MF [email protected] $< -o [email protected]
# Target section
all: libudp.a readTest writeTest udpRecord multiRead multiWrite
# Dependency section
libudp.a: udp.o hostnameToIp.o multi.o
$(AR) crs [email protected] udp.o multi.o hostnameToIp.o
#ranlib [email protected]
udpRecord: udpRecord.o libudp.a
$(GCC) udpRecord.o $(LDFLAGS) $(LDPATH) $(LIBS) -o udpRecord
$(STRIP) --strip-debug [email protected]
readTest: readTest.o libudp.a
$(GCC) readTest.o $(LDFLAGS) $(LDPATH) $(LIBS) -o readTest
$(STRIP) --strip-debug [email protected]
writeTest: writeTest.o libudp.a
$(GCC) writeTest.o $(LDFLAGS) $(LDPATH) $(LIBS) -o writeTest
$(STRIP) --strip-debug [email protected]
multiRead: multiRead.o libudp.a
$(GCC) multiRead.o $(LDFLAGS) $(LDPATH) $(LIBS) -o multiRead
$(STRIP) --strip-debug [email protected]
multiWrite: multiWrite.o libudp.a
$(GCC) multiWrite.o $(LDFLAGS) $(LDPATH) $(LIBS) -o multiWrite
$(STRIP) --strip-debug [email protected]
clean:
-rm *.o *.a *.o.d.tmp
now its a simple
> make
> adb push program /data
> adb shell chmod 777 /data/program
> adb shell /data/program
this should be useful for command line tools and inittab daemons

[RESOLVED]Problem while building CM12 based ROM

Hello,
Today i tried to "do" a CM12 based ROM but i have a problem during the build.
i tried a hundred times but everytime, it fails...
Code:
/home/maxime/test/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/bin/../lib/gcc/x86_64-linux/4.6/../../../../x86_64-linux/bin/ld: error: /home/maxime/test/out/host/linux-x86/obj32/EXECUTABLES/rsg-generator_support_intermediates/rsg_generator.o: file is empty
/home/maxime/test/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/bin/../lib/gcc/x86_64-linux/4.6/../../../../x86_64-linux/bin/ld: error: /home/maxime/test/out/host/linux-x86/obj32/EXECUTABLES/rsg-generator_support_intermediates/spec.o: file is empty
/home/maxime/test/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/bin/../sysroot/usr/lib/../lib32/Scrt1.o(.text+0x28): error: undefined reference to 'main'
target thumb C++: libjni_pacprocessor <= frameworks/base/packages/services/PacProcessor/jni/com_android_pacprocessor_PacNative.cpp
/home/maxime/test/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/../lib/gcc/arm-linux-androideabi/4.8/././../home../maxime/test/..prebuilts/gcc//linux-armx86/arm-linux/arm--linux-androideabiandroideabi-4.8//bin/.bin/./libld/gcc/:arm- errorlinux-: /androideabi/home/4.8/maxime/..test/out/./target.//product../tf700t/./obj./arm/SHARED_LIBRARIES-linux/libjni_eglfence_intermediates-androideabi/jni_egl_fence.o/bin: /ld:file is error empty:
/home/maxime/test/out/target/product/tf700t/obj/SHARED_LIBRARIES/libjni_tinyplanet_intermediates/tinyplanet.o: file is empty
collect2: ld returned 1 exit status
target SharedLib: libjni_filtershow_filters (/home/maxime/test/out/target/product/tf700t/obj/SHARED_LIBRARIES/libjni_filtershow_filters_intermediates/LINKED/libjni_filtershow_filters.so)
make: *** [/home/maxime/test/out/host/linux-x86/obj32/EXECUTABLES/rsg-generator_support_intermediates/rsg-generator_support] Erreur 1
make: *** Attente des tâches non terminées....
target thumb C++: libpac <= external/chromium-libpac/src/proxy_resolver_v8.cc
/home/maxime/test/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: /home/maxime/test/out/target/product/tf700t/obj/SHARED_LIBRARIES/libjni_filtershow_filters_intermediates/filters/tinyplanet.o: file is empty
/home/maxime/test/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: /home/maxime/test/out/target/product/tf700t/obj/SHARED_LIBRARIES/libjni_filtershow_filters_intermediates/filters/kmeans.o: file is empty
/home/maxime/test/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: /home/maxime/test/out/target/product/tf700t/obj/SHARED_LIBRARIES/libjni_filtershow_filters_intermediates/filters/gradient.o: file is empty
/home/maxime/test/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: /home/maxime/test/out/target/product/tf700t/obj/SHARED_LIBRARIES/libjni_filtershow_filters_intermediates/filters/saturated.o: file is empty
/home/maxime/test/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: /home/maxime/test/out/target/product/tf700t/obj/SHARED_LIBRARIES/libjni_filtershow_filters_intermediates/filters/exposure.o: file is empty
/home/maxime/test/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: /home/maxime/test/out/target/product/tf700t/obj/SHARED_LIBRARIES/libjni_filtershow_filters_intermediates/filters/edge.o: file is empty
/home/maxime/test/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: /home/maxime/test/out/target/product/tf700t/obj/SHARED_LIBRARIES/libjni_filtershow_filters_intermediates/filters/contrast.o: file is empty
/home/maxime/test/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: /home/maxime/test/out/target/product/tf700t/obj/SHARED_LIBRARIES/libjni_filtershow_filters_intermediates/filters/hue.o: file is empty
/home/maxime/test/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: /home/maxime/test/out/target/product/tf700t/obj/SHARED_LIBRARIES/libjni_filtershow_filters_intermediates/filters/shadows.o: file is empty
/home/maxime/test/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: /home/maxime/test/out/target/product/tf700t/obj/SHARED_LIBRARIES/libjni_filtershow_filters_intermediates/filters/highlight.o: file is empty
/home/maxime/test/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: /home/maxime/test/out/target/product/tf700t/obj/SHARED_LIBRARIES/libjni_filtershow_filters_intermediates/filters/hsv.o: file is empty
/home/maxime/test/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: /home/maxime/test/out/target/product/tf700t/obj/SHARED_LIBRARIES/libjni_filtershow_filters_intermediates/filters/vibrance.o: file is empty
/home/maxime/test/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: /home/maxime/test/out/target/product/tf700t/obj/SHARED_LIBRARIES/libjni_filtershow_filters_intermediates/filters/geometry.o: file is empty
/home/maxime/test/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: /home/maxime/test/out/target/product/tf700t/obj/SHARED_LIBRARIES/libjni_filtershow_filters_intermediates/filters/negative.o: file is empty
/home/maxime/test/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: /home/maxime/test/out/target/product/tf700t/obj/SHARED_LIBRARIES/libjni_filtershow_filters_intermediates/filters/redEyeMath.o: file is empty
/home/maxime/test/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: /home/maxime/test/out/target/product/tf700t/obj/SHARED_LIBRARIES/libjni_filtershow_filters_intermediates/filters/fx.o: file is empty
/home/maxime/test/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: /home/maxime/test/out/target/product/tf700t/obj/SHARED_LIBRARIES/libjni_filtershow_filters_intermediates/filters/wbalance.o: file is empty
/home/maxime/test/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: /home/maxime/test/out/target/product/tf700t/obj/SHARED_LIBRARIES/libjni_filtershow_filters_intermediates/filters/redeye.o: file is empty
/home/maxime/test/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: /home/maxime/test/out/target/product/tf700t/obj/SHARED_LIBRARIES/libjni_filtershow_filters_intermediates/filters/bwfilter.o: file is empty
collect2: error: ld returned 1 exit status
collect2: error: ld returned 1 exit status
make: *** [/home/maxime/test/out/target/product/tf700t/obj/SHARED_LIBRARIES/libjni_eglfence_intermediates/LINKED/libjni_eglfence.so] Erreur 1
make: *** [/home/maxime/test/out/target/product/tf700t/obj/SHARED_LIBRARIES/libjni_filtershow_filters_intermediates/LINKED/libjni_filtershow_filters.so] Erreur 1
collect2: error: ld returned 1 exit status
make: *** [/home/maxime/test/out/target/product/tf700t/obj/SHARED_LIBRARIES/libjni_tinyplanet_intermediates/LINKED/libjni_tinyplanet.so] Erreur 1
frameworks/base/packages/services/PacProcessor/jni/jni_init.cpp:28:17: warning: unused parameter 'reserved' [-Wunused-parameter]
extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved) {
^
frameworks/base/packages/services/PacProcessor/jni/com_android_pacprocessor_PacNative.cpp:63:17: warning: unused parameter 'env' [-Wunused-parameter]
static jboolean com_android_pacprocessor_PacNative_createV8ParserNativeLocked(JNIEnv* env,
^
frameworks/base/packages/services/PacProcessor/jni/com_android_pacprocessor_PacNative.cpp:75:17: warning: unused parameter 'env' [-Wunused-parameter]
static jboolean com_android_pacprocessor_PacNative_destroyV8ParserNativeLocked(JNIEnv* env,
^
make: *** wait: Aucun processus enfant. Arrêt.
#### make failed to build some targets (02:05 (mm:ss)) ####
Thank you
maxou2600 said:
Code:
/home/maxime/test/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/bin/../lib/gcc/x86_64-linux/4.6/../../../../x86_64-linux/bin/ld: error: /home/maxime/test/out/host/linux-x86/obj32/EXECUTABLES/rsg-generator_support_intermediates/rsg_generator.o: file is empty
...[/QUOTE]
Weird error. Have you tried "make clean" and rebuilding?
Click to expand...
Click to collapse
Thank you
Yep' i tried it unsuccessfully...
i Think that a lot of files were corrupted (Bad ADSL connection, with lot of FEC, HEC and CRC...)
I removed the "test" folder and resync all the files during the night (about 15-20GB)
Now after half an hour i have that error
Code:
/usr/bin/lzma : /home/maxime/test/out/target/product/tf700t/ramdisk-recovery.cpio: Aucun fichier ou dossier de ce type
make: *** [/home/maxime/test/out/target/product/tf700t/recovery.img] Erreur 1
make: *** Attente des tâches non terminées....
####make failed to build some targets (30:27 (mm:ss)) ####
in folder ~/test/out/target/product/tf700t i found a file called "ramdisk-recovery.img", i renamed it to "ramdisk-recovery.cpio" but i think it was not the same file because now i have this error.
Code:
mkdir -p /home/maxime/test/out/target/product/tf700t/obj/PACKAGING/recovery_patch_intermediates/
PATH=/home/maxime/test/out/host/linux-x86/bin:$PATH /home/maxime/test/out/host/linux-x86/bin/imgdiff /home/maxime/test/out/target/product/tf700t/boot.img /home/maxime/test/out/target/product/tf700t/recovery.img /home/maxime/test/out/target/product/tf700t/obj/PACKAGING/recovery_patch_intermediates/recovery_from_boot.p
source and target don't have same number of chunks!
source chunks:
chunk 0: type 0 start 0 len 4253810
chunk 1: type 2 start 4253810 len 1161984
chunk 2: type 0 start 4927508 len 84
target chunks:
chunk 0: type 0 start 0 len 7227496
make: *** [/home/maxime/test/out/target/product/tf700t/obj/PACKAGING/recovery_patch_intermediates/recovery_from_boot.p] Erreur 1
make: *** Attente des tâches non terminées....
So, i "make clean" and "brunch" again. I tell you if the first error (No such File or directory) re-comes (no-reason )
yep' same as this morning :
Code:
/usr/bin/lzma : /home/maxime/test/out/target/product/tf700t/ramdisk-recovery.cpio: Aucun fichier ou dossier de ce type
make: *** [/home/maxime/test/out/target/product/tf700t/recovery.img] Erreur 1
make: *** Attente des tâches non terminées....
####make failed to build some targets (30:30 (mm:ss)) ####
EDIT : At the begin of the build i got some errors (I Don't know if it's a problem, i think it's not otherwise build stop like (Ramdisk-recovery.cpio error...) :
Code:
No private recovery resources for TARGET_DEVICE tf700t
"ebtables is disabled on this build"
After some research i think that the "ramdisk_recovery" isn't "created" during the build.
I changed the Recovery.mk in /device/asus/tf700t
The original
Code:
TF_BLOBIFIER := $(HOST_OUT_EXECUTABLES)/blobpack_tfp
LZMA_BIN := /usr/bin/lzma
$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTIMG) \
$(recovery_ramdisk) \
$(TF_BLOBIFIER) \
$(recovery_kernel)
@echo ----- Compressing recovery ramdisk with lzma ------
rm -f $(recovery_uncompressed_ramdisk).lzma
$(LZMA_BIN) $(recovery_uncompressed_ramdisk)
$(hide) cp $(recovery_uncompressed_ramdisk).lzma $(recovery_ramdisk)
@echo ----- Making recovery image ------
$(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) --output [email protected]
$(TF_BLOBIFIER) [email protected] SOS [email protected]
@echo ----- Made recovery image -------- [email protected]
$(hide) $(call assert-max-image-size,[email protected],$(BOARD_RECOVERYIMAGE_PARTITION_SIZE),raw)
$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(TF_BLOBIFIER)
$(call pretty,"Target boot image: [email protected]")
$(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) --output [email protected]
$(TF_BLOBIFIER) [email protected] LNX [email protected]
$(hide) $(call assert-max-image-size,[email protected],$(BOARD_BOOTIMAGE_PARTITION_SIZE),raw)
give me
Code:
/usr/bin/lzma : /home/maxime/test/out/target/product/tf700t/ramdisk-recovery.cpio: Aucun fichier ou dossier de ce type
make: *** [/home/maxime/test/out/target/product/tf700t/recovery.img] Erreur 1
make: *** Attente des tâches non terminées....
####make failed to build some targets (30:30 (mm:ss)) ####
and the modified
Code:
TF_BLOBIFIER := $(HOST_OUT_EXECUTABLES)/blobpack_tfp
$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTIMG) \
$(recovery_ramdisk) \
$(TF_BLOBIFIER) \
$(recovery_kernel)
@echo ----- Making recovery image ------
$(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) --output [email protected]
$(TF_BLOBIFIER) [email protected] SOS [email protected]
@echo ----- Made recovery image -------- [email protected]
$(hide) $(call assert-max-image-size,[email protected],$(BOARD_RECOVERYIMAGE_PARTITION_SIZE),raw)
$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(TF_BLOBIFIER)
$(call pretty,"Target boot image: [email protected]")
$(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) --output [email protected]
$(TF_BLOBIFIER) [email protected] LNX [email protected]
$(hide) $(call assert-max-image-size,[email protected],$(BOARD_BOOTIMAGE_PARTITION_SIZE),raw)
give me
Code:
----- Making recovery image ------
/home/maxime/test/out/host/linux-x86/bin/mkbootimg --kernel /home/maxime/test/out/target/product/tf700t/kernel --ramdisk /home/maxime/test/out/target/product/tf700t/ramdisk-recovery.img --cmdline "androidboot.selinux=enforcing" --base 0x10000000 --output /home/maxime/test/out/target/product/tf700t/recovery.img.orig
/home/maxime/test/out/host/linux-x86/bin/blobpack_tfp /home/maxime/test/out/target/product/tf700t/recovery.img SOS /home/maxime/test/out/target/product/tf700t/recovery.img.orig
Found 1 partitions as commandline arguments
Partname: SOS Filename: /home/maxime/test/out/target/product/tf700t/recovery.img.orig
Size: 60
1 partitions starting at offset 0x3C
Offset: 76
----- Made recovery image -------- /home/maxime/test/out/target/product/tf700t/recovery.img
/home/maxime/test/out/target/product/tf700t/recovery.img maxsize=8562048 blocksize=4224 total=9359464 reserve=88704
error: /home/maxime/test/out/target/product/tf700t/recovery.img too large (9359464 > [8650752 - 88704])
make: *** [/home/maxime/test/out/target/product/tf700t/recovery.img] Erreur 1
make: *** Destruction du fichier « /home/maxime/test/out/target/product/tf700t/recovery.img »
#### make failed to build some targets (01:25 (mm:ss)) ####
Ideas ?
maxou2600 said:
Thank you
Yep' i tried it unsuccessfully...
i Think that a lot of files were corrupted (Bad ADSL connection, with lot of FEC, HEC and CRC...)
I removed the "test" folder and resync all the files during the night (about 15-20GB)
Now after half an hour i have that error
Code:
/usr/bin/lzma : /home/maxime/test/out/target/product/tf700t/ramdisk-recovery.cpio: Aucun fichier ou dossier de ce type
make: *** [/home/maxime/test/out/target/product/tf700t/recovery.img] Erreur 1
make: *** Attente des tâches non terminées....
####make failed to build some targets (30:27 (mm:ss)) ####
in folder ~/test/out/target/product/tf700t i found a file called "ramdisk-recovery.img", i renamed it to "ramdisk-recovery.cpio" but i think it was not the same file because now i have this error.
Code:
mkdir -p /home/maxime/test/out/target/product/tf700t/obj/PACKAGING/recovery_patch_intermediates/
PATH=/home/maxime/test/out/host/linux-x86/bin:$PATH /home/maxime/test/out/host/linux-x86/bin/imgdiff /home/maxime/test/out/target/product/tf700t/boot.img /home/maxime/test/out/target/product/tf700t/recovery.img /home/maxime/test/out/target/product/tf700t/obj/PACKAGING/recovery_patch_intermediates/recovery_from_boot.p
source and target don't have same number of chunks!
source chunks:
chunk 0: type 0 start 0 len 4253810
chunk 1: type 2 start 4253810 len 1161984
chunk 2: type 0 start 4927508 len 84
target chunks:
chunk 0: type 0 start 0 len 7227496
make: *** [/home/maxime/test/out/target/product/tf700t/obj/PACKAGING/recovery_patch_intermediates/recovery_from_boot.p] Erreur 1
make: *** Attente des tâches non terminées....
So, i "make clean" and "brunch" again. I tell you if the first error (No such File or directory) re-comes (no-reason )
yep' same as this morning :
Code:
/usr/bin/lzma : /home/maxime/test/out/target/product/tf700t/ramdisk-recovery.cpio: Aucun fichier ou dossier de ce type
make: *** [/home/maxime/test/out/target/product/tf700t/recovery.img] Erreur 1
make: *** Attente des tâches non terminées....
####make failed to build some targets (30:30 (mm:ss)) ####
EDIT : At the begin of the build i got some errors (I Don't know if it's a problem, i think it's not otherwise build stop like (Ramdisk-recovery.cpio error...) :
Code:
No private recovery resources for TARGET_DEVICE tf700t
"ebtables is disabled on this build"
After some research i think that the "ramdisk_recovery" isn't "created" during the build.
I changed the Recovery.mk in /device/asus/tf700t
The original
Code:
TF_BLOBIFIER := $(HOST_OUT_EXECUTABLES)/blobpack_tfp
LZMA_BIN := /usr/bin/lzma
$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTIMG) \
$(recovery_ramdisk) \
$(TF_BLOBIFIER) \
$(recovery_kernel)
@echo ----- Compressing recovery ramdisk with lzma ------
rm -f $(recovery_uncompressed_ramdisk).lzma
$(LZMA_BIN) $(recovery_uncompressed_ramdisk)
$(hide) cp $(recovery_uncompressed_ramdisk).lzma $(recovery_ramdisk)
@echo ----- Making recovery image ------
$(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) --output [email protected]
$(TF_BLOBIFIER) [email protected] SOS [email protected]
@echo ----- Made recovery image -------- [email protected]
$(hide) $(call assert-max-image-size,[email protected],$(BOARD_RECOVERYIMAGE_PARTITION_SIZE),raw)
$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(TF_BLOBIFIER)
$(call pretty,"Target boot image: $@")
$(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) --output [email protected]
$(TF_BLOBIFIER) [email protected] LNX [email protected]
$(hide) $(call assert-max-image-size,[email protected],$(BOARD_BOOTIMAGE_PARTITION_SIZE),raw)
give me
Code:
/usr/bin/lzma : /home/maxime/test/out/target/product/tf700t/ramdisk-recovery.cpio: Aucun fichier ou dossier de ce type
make: *** [/home/maxime/test/out/target/product/tf700t/recovery.img] Erreur 1
make: *** Attente des tâches non terminées....
####make failed to build some targets (30:30 (mm:ss)) ####
and the modified
Code:
TF_BLOBIFIER := $(HOST_OUT_EXECUTABLES)/blobpack_tfp
$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTIMG) \
$(recovery_ramdisk) \
$(TF_BLOBIFIER) \
$(recovery_kernel)
@echo ----- Making recovery image ------
$(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) --output [email protected]
$(TF_BLOBIFIER) [email protected] SOS [email protected]
@echo ----- Made recovery image -------- [email protected]
$(hide) $(call assert-max-image-size,[email protected],$(BOARD_RECOVERYIMAGE_PARTITION_SIZE),raw)
$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(TF_BLOBIFIER)
$(call pretty,"Target boot image: [email protected]")
$(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) --output [email protected]
$(TF_BLOBIFIER) [email protected] LNX [email protected]
$(hide) $(call assert-max-image-size,[email protected],$(BOARD_BOOTIMAGE_PARTITION_SIZE),raw)
give me
Code:
----- Making recovery image ------
/home/maxime/test/out/host/linux-x86/bin/mkbootimg --kernel /home/maxime/test/out/target/product/tf700t/kernel --ramdisk /home/maxime/test/out/target/product/tf700t/ramdisk-recovery.img --cmdline "androidboot.selinux=enforcing" --base 0x10000000 --output /home/maxime/test/out/target/product/tf700t/recovery.img.orig
/home/maxime/test/out/host/linux-x86/bin/blobpack_tfp /home/maxime/test/out/target/product/tf700t/recovery.img SOS /home/maxime/test/out/target/product/tf700t/recovery.img.orig
Found 1 partitions as commandline arguments
Partname: SOS Filename: /home/maxime/test/out/target/product/tf700t/recovery.img.orig
Size: 60
1 partitions starting at offset 0x3C
Offset: 76
----- Made recovery image -------- /home/maxime/test/out/target/product/tf700t/recovery.img
/home/maxime/test/out/target/product/tf700t/recovery.img maxsize=8562048 blocksize=4224 total=9359464 reserve=88704
error: /home/maxime/test/out/target/product/tf700t/recovery.img too large (9359464 > [8650752 - 88704])
make: *** [/home/maxime/test/out/target/product/tf700t/recovery.img] Erreur 1
make: *** Destruction du fichier « /home/maxime/test/out/target/product/tf700t/recovery.img »
#### make failed to build some targets (01:25 (mm:ss)) ####
Ideas ?
Click to expand...
Click to collapse
Yes, I see exactly what is going on here .....
You need to install lzma on your host PC .....
So in /usr/bin/ you need to find a file called 'lzma'
Removing this from the recovery.mk ...
Code:
LZMA_BIN := /usr/bin/lzma
Has made the recovery to large to fix in the space provided by the device''s recovery partition ......
Code:
error: /home/maxime/test/out/target/product/tf700t/recovery.img too large (9359464 > [8650752 - 88704])
Thx Josh
Hello, I found the solution (thanks to _that in #TWRP IRC )
lzma was in usr/bin, no problem
the problem was that the ramdisk_recovery.cpio file wasn't found, the solution was to edit some lines (in red)
Code:
$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTIMG) \
$(recovery_[COLOR="Red"]uncompressed_[/COLOR]ramdisk) \
$(TF_BLOBIFIER) \
$(recovery_kernel)
[user=279333]@ECHO[/user] ----- Compressing recovery ramdisk with lzma ------
rm -f $(recovery_uncompressed_ramdisk).lzma
$(LZMA_BIN) $(recovery_uncompressed_ramdisk)
$(hide) cp $(recovery_uncompressed_ramdisk).lzma $(recovery_[COLOR="Red"]uncompressed_[/COLOR]ramdisk)
[user=279333]@ECHO[/user] ----- Making recovery image ------
$(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) --output [email protected]
$(TF_BLOBIFIER) [email protected] SOS [email protected]
[user=279333]@ECHO[/user] ----- Made recovery image -------- [email protected]
$(hide) $(call assert-max-image-size,[email protected],$(BOARD_RECOVERYIMAGE_PARTITION_SIZE),raw)
After that, just needed to erase .ccache folder and make clean. And then recovery.img compiled successfully.
(sorry for bad english).
I will edit the title because it's resolved
please help
maxou2600 said:
Hello, I found the solution (thanks to _that in #TWRP IRC )
lzma was in usr/bin, no problem
the problem was that the ramdisk_recovery.cpio file wasn't found, the solution was to edit some lines (in red)
Code:
$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTIMG) \
$(recovery_[COLOR="Red"]uncompressed_[/COLOR]ramdisk) \
$(TF_BLOBIFIER) \
$(recovery_kernel)
[user=279333]@ECHO[/user] ----- Compressing recovery ramdisk with lzma ------
rm -f $(recovery_uncompressed_ramdisk).lzma
$(LZMA_BIN) $(recovery_uncompressed_ramdisk)
$(hide) cp $(recovery_uncompressed_ramdisk).lzma $(recovery_[COLOR="Red"]uncompressed_[/COLOR]ramdisk)
[user=279333]@ECHO[/user] ----- Making recovery image ------
$(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) --output [email protected]
$(TF_BLOBIFIER) [email protected] SOS [email protected]
[user=279333]@ECHO[/user] ----- Made recovery image -------- [email protected]
$(hide) $(call assert-max-image-size,[email protected],$(BOARD_RECOVERYIMAGE_PARTITION_SIZE),raw)
After that, just needed to erase .ccache folder and make clean. And then recovery.img compiled successfully.
(sorry for bad english).
I will edit the title because it's resolved
Click to expand...
Click to collapse
i also met the problem that boot.img too large when i compile recovery.img. how do you solve it. sorry for my ban english
Hello, I erased ccache folders and i make clean. After that, all was working fine
i fixed it.but also thank you

"Too many arguments to function call" ninja build error

Here is the log: https://paste.myself5.de/2jWlYThBb5.vbs
As you can see it brings up the 'too many arguments to function call' and I have no clue how to fix this error - does anyone else know?
Code:
1 warning generated.
[ 64% 33226/51897] target C++: netd <= system/netd/server/CommandListener.cpp
FAILED: /bin/bash -c "(PWD=/proc/self/cwd prebuilts/clang/host/linux-x86/clang-2690385/bin/clang++ -I device/sony/suzuran/include -I hardware/libhardware_legacy/include/hardware_legacy -I bionic/libc/dns/include -I external/mdnsresponder/mDNSShared -I system/netd/include -I /home/zane/Lineage/out/target/product/suzuran/obj/EXECUTABLES/netd_intermediates/aidl-generated/include -I system/netd/server -I /home/zane/Lineage/out/target/product/suzuran/obj/EXECUTABLES/netd_intermediates -I /home/zane/Lineage/out/target/product/suzuran/gen/EXECUTABLES/netd_intermediates -I libnativehelper/include/nativehelper \$(cat /home/zane/Lineage/out/target/product/suzuran/obj/EXECUTABLES/netd_intermediates/import_includes) -isystem system/core/include -isystem system/media/audio/include -isystem hardware/libhardware/include -isystem hardware/libhardware_legacy/include -isystem libnativehelper/include -isystem frameworks/native/include -isystem frameworks/native/opengl/include -isystem frameworks/av/include -isystem frameworks/base/include -isystem hardware/ril-caf/include -isystem /home/zane/Lineage/out/target/product/suzuran/obj/include -isystem bionic/libc/arch-arm64/include -isystem bionic/libc/include -isystem bionic/libc/kernel/uapi -isystem bionic/libc/kernel/common -isystem bionic/libc/kernel/uapi/asm-arm64 -isystem bionic/libm/include -isystem bionic/libm/include/arm64 -c -fno-exceptions -Wno-multichar -fno-strict-aliasing -fstack-protector-strong -ffunction-sections -fdata-sections -funwind-tables -Wa,--noexecstack -Werror=format-security -D_FORTIFY_SOURCE=2 -fno-short-enums -no-canonical-prefixes -Werror=pointer-to-int-cast -Werror=int-to-pointer-cast -Werror=implicit-function-declaration -DQCOM_HARDWARE -DQCOM_BSP -DQTI_BSP -DHAS_EXTRA_FLAC_METADATA -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=date-time -DNDEBUG -O2 -g -Wstrict-aliasing=2 -DNDEBUG -UDEBUG -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics -nostdlibinc -target aarch64-linux-android -Bprebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin -fvisibility-inlines-hidden -DQCOM_HARDWARE -DQCOM_BSP -DQTI_BSP -DHAS_EXTRA_FLAC_METADATA -Wsign-promo -Wno-inconsistent-missing-override -nostdlibinc -fno-rtti -fpie -D_USING_LIBCXX -std=gnu++14 -std=c++11 -Wall -Werror -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=address-of-temporary -Werror=null-dereference -Werror=return-type -MD -MF /home/zane/Lineage/out/target/product/suzuran/obj/EXECUTABLES/netd_intermediates/CommandListener.d -o /home/zane/Lineage/out/target/product/suzuran/obj/EXECUTABLES/netd_intermediates/CommandListener.o system/netd/server/CommandListener.cpp ) && (cp /home/zane/Lineage/out/target/product/suzuran/obj/EXECUTABLES/netd_intermediates/CommandListener.d /home/zane/Lineage/out/target/product/suzuran/obj/EXECUTABLES/netd_intermediates/CommandListener.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\\\\$//' -e '/^\$/ d' -e 's/\$/ :/' < /home/zane/Lineage/out/target/product/suzuran/obj/EXECUTABLES/netd_intermediates/CommandListener.d >> /home/zane/Lineage/out/target/product/suzuran/obj/EXECUTABLES/netd_intermediates/CommandListener.P; rm -f /home/zane/Lineage/out/target/product/suzuran/obj/EXECUTABLES/netd_intermediates/CommandListener.d )"
system/netd/server/CommandListener.cpp:804:51: error: too many arguments to function call, expected at most single argument 'global_ctrl_iface', have 2 arguments
rc = gCtls->softapCtrl.startSoftap(false, cli);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~
system/netd/server/SoftapController.h:41:5: note: 'startSoftap' declared here
int startSoftap(bool global_ctrl_iface = false);
^
1 error generated.
[ 64% 33226/51897] target C++: netd <= system/netd/server/BandwidthController.cpp
ninja: build stopped: subcommand failed.
make: *** [ninja_wrapper] Error 1
make: Leaving directory `/home/zane/Lineage'
#### make failed to build some targets (01:25:28 (hh:mm:ss)) ####
Same issue with LineageOS 14.1 - new device (so unsupported)
z3ntu said:
Same issue with LineageOS 14.1 - new device (so unsupported)
Click to expand...
Click to collapse
FOLLOW UP:
Fixed the error by replacing the lineage netd folder with the netd folder from carbonrom
I made it past this error by adding and editing the following variables before building.
Code:
export LC_ALL=C
Edit java.security file under /etc/java-8-openjdk/security/
Remove TLSv1, TLSv1.1 from jdk.tls.disabledAlgorithms
Restart the jack server:
Code:
jack-admin kill-server
jack-admin start-server
Code:
. build/envsetup.sh
run brunch command
Code:
brunch lineage_jfltexx-userdebug

Custom Recovery problem "ValueError: header_version and dt can not be set at the same time"

I am trying to compile an Orange Fox custom recovery for poco x2 device. Source sync was 100% and I generated device tree using SebaUbuntu's Script. When I try to compile, I get this error. What is it and how can I fix it...
Code:
[ 99% 13183/13195] Target boot image: /home/koken/Desktop/orangefox/out/target/product/phoenix/boot.img
FAILED: /home/koken/Desktop/orangefox/out/target/product/phoenix/boot.img
/bin/bash -c "(/home/koken/Desktop/orangefox/out/host/linux-x86/bin/mkbootimg --kernel /home/koken/Desktop/orangefox/out/target/product/phoenix/kernel --ramdisk /home/koken/Desktop/orangefox/out/target/product/phoenix/ramdisk.img --base 0x00000000 --pagesize 4096 --cmdline \"console=ttyMSM0,115200n8 androidboot.hardware=qcom androidboot.console=ttyMSM0 androidboot.memcg=1 lpm_levels.sleep_disabled=1 video=vfb:640x400,bpp=32,memsize=3072000 msm_rtb.filter=0x237 service_locator.enable=1 androidboot.usbcontroller=a600000.dwc3 swiotlb=2048 loop.max_part=7 cgroup.memory=nokmem,nosocket androidboot.selinux=permissive androidboot.init_fatal_reboot_target=recovery buildvariant=eng buildvariant=eng\" --os_version 16.1.0 --os_patch_level 2099-12-31 --ramdisk_offset 0x01000000 --tags_offset 0x00000100 --header_version 2 --dt device/xiaomi/phoenix/prebuilt/dtb.img --output /home/koken/Desktop/orangefox/out/target/product/phoenix/boot.img ) && (true )"
Traceback (most recent call last):
File "/home/koken/Desktop/orangefox/out/host/linux-x86/bin/mkbootimg", line 216, in <module>
main()
File "/home/koken/Desktop/orangefox/out/host/linux-x86/bin/mkbootimg", line 206, in main
args = parse_cmdline()
File "/home/koken/Desktop/orangefox/out/host/linux-x86/bin/mkbootimg", line 191, in parse_cmdline
raise ValueError('header_version and dt cannot be set at the same time')
ValueError: header_version and dt cannot be set at the same time
[ 99% 13185/13195] build /home/koken/Desktop/orangefox/out/target/pro...ct/phoenix/obj_arm/SHARED_LIBRARIES/libbmlutils_intermediates/teamwin
ninja: build stopped: subcommand failed.
04:38:54 ninja failed with: exit status 1
Disabling this line fixed it for me:
> cat BoardConfig.mk | grep header_version
#BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOTIMG_HEADER_VERSION)

Repacked boot.img with my compiled Poco M3 kernel won't boot

I compiled the Xiaomi poco M3 kernel from
https://github.com/MiCode/Xiaomi_Kernel_OpenSource
on branch
lime-q-oss
with commands
export ARCH=arm64 && export SUBARCH=arm64
export CROSS_COMPILE=/opt/aosp_prebuilts/aarch64-linux-android-4.9/bin/aarch64-linux-android-
export DTC_EXT=
make ARCH=arm64 CC=clang CLANG_TRIPLE=aarch64-linux-gnu- vendor/citrus-perf_defconfig
make ARCH=arm64 CC=clang CLANG_TRIPLE=aarch64-linux-gnu- EXTRA_CFLAGS="-I $PWD/techpack/display/pll/ -I $PWD/techpack/camera/drivers/cam_sensor_module/cam_cci/ -I $PWD/techpack/camera/drivers/cam_req_mgr -DSDCARDFS_VERSION= -I $PWD/" -j$(nproc --all)
I unpacked the original boot.img from the official ROM from the xiaomi's website, which is the exact ROM I have on my phone:
unpackbootimg -i boot.img -o boot_img_unpacked
Then I repacked with the new kernel:
mkbootimg --kernel "$SCRIPT_DIR/devices/$DEVICE/kernel/k/arch/arm64/boot/Image" \
--ramdisk boot.img-ramdisk \
--dtb boot.img-dtb \
--cmdline "$(< boot.img-cmdline)" \
--base "$(< boot.img-base)" \
--kernel_offset "$(< boot.img-kernel_offset)" \
--ramdisk_offset "$(< boot.img-ramdisk_offset)" \
--tags_offset "$(< boot.img-tags_offset)" \
--dtb_offset "$(< boot.img-dtb_offset)" \
--os_version "$(< boot.img-os_version)" \
--os_patch_level "$(< boot.img-os_patch_level)" \
--pagesize "$(< boot.img-pagesize)" \
--header_version "$(< boot.img-header_version)" \
--hashtype "$(< boot.img-hashtype)" \
--board "$(< boot.img-board)" \
--ramdisk_offset "$(< boot.img-ramdisk_offset)" \
-o ../boot.img
then the phone won't boot. I repacked with the official kernel from boot.img just to see if my repacking method was working, and with the original kernel, it boots. So the problem is probably on the kernel.
Do I have to update some offset? Like, is the dtb offset the same in this kernel as in the official one? I don't know why the dtb offset since the dtb is also in the ramdisk. How do I know if the dtb is being picked from inside the kernel or from the ramdisk?
One thing to notice is that my phone is on Android 11, which uses 4.19.113 while my kernel is 4.19.95 (the latest available on xiaomi's website), which I think was meant for Android 10. However, I think I should at least boot, even if with an older kernel. At least see some error.
I tried fastboot oem enable uart but this option is not supported by the Poco M3, so I guess there's no way to debug over usb like in the Pixel phones. Is there any way to know what's happening? I found some methods for debugging but they all require a kernel that at least boots, but I don't even know if mine is booting. Maybe it is but can't start any graphics?
I made a docker container that facilitates downloading, hacking the kernel and etc: https://github.com/lucaszanella/and...tree/18fbd933094f8ad6e63e65b2795ce80c377f8dc6 so if anyone wants to try, I'd be really glad. I'm working on tutorials to bring more people to kernel hacking, that's why I bought the Poco M3.

Categories

Resources