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

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)

Related

[Q] boot.img creation dt.img problem

Recently I tried to build kernel from source. All went pretty good, kernel works but only with old pre-build dt.img which comes with the boot.img which I use as a base.
To collect dt.img i used compiled from source
gitlab.com/Thecrazyskull/oneplus2/raw/652861ab053df83c61e4c8d4807a52598703a5e6/dtbTool/dtbtool.c
Code:
./dtbTool -s 4096 -o boot/dt.img -p kernel-out/scripts/dtc/ kernel-out/arch/arm64/boot/dts/
or mkqcdtbootimg(allow to specify dtb dir) from sony xperia
To make image I use github.com/luckasfb/mkbootimg-worked-mtk
Code:
./mkbootimg --kernel Image --ramdisk boot.img-ramdisk.gz --cmdline "console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 boot_cpus=0-5 ramoops_memreserve=2M androidboot.selinux=permissive" --base 0 --pagesize 4096 --dt dt.img --ramdisk_offset 01000000 --tags_offset 00000100 -o newboot.img
So, the question, what am I doing wrong?
Use the dtbTool found here https://source.codeaurora.org/quic/kernel/skales/tree/
git clone git://codeaurora.org/quic/kernel/skales
Click to expand...
Click to collapse
I use it in my kernel build helper and it works.
Cozzmy13 said:
Use the dtbTool found here https://source.codeaurora.org/quic/kernel/skales/tree/
I use it in my kernel build helper and it works.
Click to expand...
Click to collapse
Thanks a lot! It worked! Problem solved.
can I use this tool for qualcomm and exynos (samsung) devices?

Problems with building LineageOS 14.1 on my own

At the beginning, great thanks to Comzzmy13 for his work for official LineageOS.
I don't know if it is suitable to post this thread here. If it is not that proper, please tell me!
I want to build LineageOS on my computer and met some problems. I need some help now...
Thanks all the guys coming into this thread!
I followed the official guide to get all the sources, vendor, device, kernel from GitHub. But after running 'brunch libra'. after several minutes, errors occurred.
Environment: Ubuntu 17.10 on a real machine (dual systems with windows 10)
Tools should be enough but I'm not so sure and I just follow the guide.
Firstly, just in case...
Code:
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=7.1.2
LINEAGE_VERSION=14.1-20171214_170732-UNOFFICIAL-libra
TARGET_PRODUCT=lineage_libra
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=cortex-a53
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=cortex-a53.a57
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.13.0-17-generic-x86_64-with-Ubuntu-17.10-artful
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=NJH47F
OUT_DIR=/home/ippfcox/android/lineage/out
============================================
make: Entering directory '/home/ippfcox/android/lineage'
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=7.1.2
LINEAGE_VERSION=14.1-20171214_170732-UNOFFICIAL-libra
TARGET_PRODUCT=lineage_libra
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=cortex-a53
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=cortex-a53.a57
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.13.0-17-generic-x86_64-with-Ubuntu-17.10-artful
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=NJH47F
OUT_DIR=/home/ippfcox/android/lineage/out
============================================
Code:
/home/ippfcox/android/lineage/out/build-lineage_libra.ninja is missing, regenerating...
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=7.1.2
LINEAGE_VERSION=14.1-20171214_170745-UNOFFICIAL-libra
TARGET_PRODUCT=lineage_libra
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=cortex-a53
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=cortex-a53.a57
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.13.0-17-generic-x86_64-with-Ubuntu-17.10-artful
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=NJH47F
OUT_DIR=/home/ippfcox/android/lineage/out
============================================
The build log is too long so I just choose the error lines
these seems not the key errors...
Code:
Checking build tools versions...
find: ‘/home/ippfcox/android/lineage/out/target/common/obj/SHARED_LIBRARIES/libwifi-hal-mock_intermediates’: 没有那个文件或目录
PRODUCT_COPY_FILES device/xiaomi/libra/audio/audio_effects.conf:system/etc/audio_effects.conf ignored.
build/core/Makefile:54: Duplicate header copy: /home/ippfcox/android/lineage/out/target/product/libra/obj/include/time-services/time_genoff.h
build/core/Makefile:54: Defined in: device/xiaomi/libra/time-services/Android.mk vendor/qcom/opensource/time-services/Android.mk
The Chinese "没有那个文件或目录" == "No such file or dictionary"
and then
Code:
make: Leaving directory '/home/ippfcox/android/lineage/kernel/xiaomi/msm8992'
make: Entering directory '/home/ippfcox/android/lineage/kernel/xiaomi/msm8992'
/home/ippfcox/android/lineage/kernel/xiaomi/msm8992/Makefile:801: *** 多个目标匹配。 停止。
Makefile:130: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2
The Chinese "多个目标匹配。停止。" == "multiple target patterns. stop."
and the last one
Code:
ninja: build stopped: subcommand failed.
build/core/ninja.mk:151: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
Please give me some advice! Thanks
I need more info, it is all error log?
I use this guide to build lineageOS: https://wiki.lineageos.org/devices/libra/build
Enviado desde mi Mi-4c mediante Tapatalk
groche97 said:
I need more info, it is all error log?
I use this guide to build lineageOS: https://wiki.lineageos.org/devices/libra/build
Enviado desde mi Mi-4c mediante Tapatalk
Click to expand...
Click to collapse
Yeah, this is also the guide I used. I will post the whole error log below, wait a moment.
@groche97 sorry for waiting so long. Something went wrong with my Internet connection...
before building, I run repo sync.
All the logs are attached below, 241 lines. Thanks!
All right....I will try to use Ubuntu 16.04 to build again...
Ippfcox said:
All right....I will try to use Ubuntu 16.04 to build again...
Click to expand...
Click to collapse
have you build kernel?
i have same error
orfik said:
have you build kernel?
i have same error
Click to expand...
Click to collapse
I think the error of mine is generated when building the kernel. Now I'm trying to build LineageOS 15.1, there is also this error... I will try again after some days.
I have googled this error, maybe you can try to upgrade the build tools? I don't know exactly.
And maybe you can just ask the author cozzmy13. But before that, I think we should try to fix by ourselves.
Ippfcox said:
I think the error of mine is generated when building the kernel.
Click to expand...
Click to collapse
Yes. And i have build kernel successfully. Change Makefile in kernel folder and build kernel for RR based on cm-14.1
I send you this Makefile in pm later. After work
orfik said:
Yes. And i have build kernel successfully. Change Makefile in kernel folder and build kernel for RR based on cm-14.1
I send you this Makefile in pm later. After work
Click to expand...
Click to collapse
Wow! You are great! Waiting for you
I have been experiencing the same kind of issues with the Ninja tool. It leaves the directory with no reason at all (OK, there has to be a reason for it to leave the directory or just encounter an error). I also used this command:
export USE_NINJA=false
And I think it uses the Java to build the ROM but still encounters errors and exits after 1 - 2 minutes into the build process.
Not sure what is the issue or how to fix it. And it is not that I am waiting for the guys at Lineage to build the ROM for me, I wanted to build it for myself and help out. But keep having these errors and everyting goes to dust.
I also tried building Nougat with the same issues.
Off the record, I am building for Bacon, but the process is the same. Looking forward to new ideas/solutions/anything that can help us get past this step and successfully build the ROM.
i have remove ccach in Makefile,but in the end ,I encounter the error below
[ 96% 647/668] Target userdata fs image: /home/zhj/code/LineageOs/out/target/product/libra/userdata.img
Running: mkuserimg.sh -s /home/zhj/code/LineageOs/out/target/product/libra/data /home/zhj/code/LineageOs/out/target/product/libra/userdata.img ext4 data 12469648896 -D /home/zhj/code/LineageOs/out/target/product/libra/system -L data /home/zhj/code/LineageOs/out/target/product/libra/obj/ETC/file_contexts.bin_intermediates/file_contexts.bin
make_ext4fs -s -T -1 -S /home/zhj/code/LineageOs/out/target/product/libra/obj/ETC/file_contexts.bin_intermediates/file_contexts.bin -L data -l 12469648896 -a data /home/zhj/code/LineageOs/out/target/product/libra/userdata.img /home/zhj/code/LineageOs/out/target/product/libra/data /home/zhj/code/LineageOs/out/target/product/libra/system
Creating filesystem with parameters:
Size: 12469645312
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 32768
Label: data
Blocks: 3044347
Block groups: 93
Reserved block group size: 743
Created filesystem with 38/761856 inodes and 90385/3044347 blocks
/home/zhj/code/LineageOs/out/target/product/libra/userdata.img maxsize=12730643904 blocksize=135168 total=149892064 reserve=128679936
[ 97% 654/668] Building Kernel
make: Entering directory '/home/zhj/code/LineageOs/kernel/xiaomi/libra'
GEN /home/zhj/code/LineageOs/out/target/product/libra/obj/KERNEL_OBJ/Makefile
scripts/kconfig/conf --silentoldconfig Kconfig
warning: (SND_SOC_APQ8074 && SND_SOC_MSM8994) selects SND_SOC_MSM_HDMI_CODEC_RX which has unmet direct dependencies (SOUND && !M68K && !UML && SND && SND_SOC && FB_MSM_MDSS_HDMI_PANEL && (SND_SOC_MSM8974 || SND_SOC_APQ8084 || SND_SOC_MSM8994))
warning: (SND_SOC_APQ8074 && SND_SOC_MSM8994) selects SND_SOC_MSM_HDMI_CODEC_RX which has unmet direct dependencies (SOUND && !M68K && !UML && SND && SND_SOC && FB_MSM_MDSS_HDMI_PANEL && (SND_SOC_MSM8974 || SND_SOC_APQ8084 || SND_SOC_MSM8994))
GEN /home/zhj/code/LineageOs/out/target/product/libra/obj/KERNEL_OBJ/Makefile
CHK include/generated/uapi/linux/version.h
CC scripts/mod/devicetable-offsets.s
GEN scripts/mod/devicetable-offsets.h
HOSTCC scripts/mod/file2alias.o
HOSTLD scripts/mod/modpost
Using /home/zhj/code/LineageOs/kernel/xiaomi/libra as source for kernel
CHK include/generated/utsrelease.h
CALL /home/zhj/code/LineageOs/kernel/xiaomi/libra/scripts/checksyscalls.sh
CHK include/generated/compile.h
GZIP kernel/config_data.gz
CHK kernel/config_data.h
make[2]: 'arch/arm64/boot/Image' is up to date.
make: Leaving directory '/home/zhj/code/LineageOs/kernel/xiaomi/libra'
Building DTBs
make: Entering directory '/home/zhj/code/LineageOs/kernel/xiaomi/libra'
CC scripts/mod/devicetable-offsets.s
GEN scripts/mod/devicetable-offsets.h
HOSTCC scripts/mod/file2alias.o
HOSTLD scripts/mod/modpost
make[2]: Nothing to be done for 'dtbs'.
make[2]: Nothing to be done for 'dtbs'.
make: Leaving directory '/home/zhj/code/LineageOs/kernel/xiaomi/libra'
[ 98% 657/668] Target boot image: /home/zhj/code/LineageOs/out/target/product/libra/boot.img
FAILED: /home/zhj/code/LineageOs/out/target/product/libra/boot.img
/bin/bash -c "(/home/zhj/code/LineageOs/out/host/linux-x86/bin/mkbootimg --kernel /home/zhj/code/LineageOs/out/target/product/libra/kernel --ramdisk /home/zhj/code/LineageOs/out/target/product/libra/ramdisk.img --base 0x00000000 --pagesize 4096 --cmdline "console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 boot_cpus=0-5 buildvariant=userdebug" --os_version 8.1.0 --os_patch_level 2018-05-05 -2 --output /home/zhj/code/LineageOs/out/target/product/libra/boot.img ) && (size=\$(for i in /home/zhj/code/LineageOs/out/target/product/libra/boot.img; do stat --format "%s" "\$i" | tr -d '\\n'; echo +; done; echo 0); total=\$(( \$( echo "\$size" ) )); printname=\$(echo -n "/home/zhj/code/LineageOs/out/target/product/libra/boot.img" | tr " " +); img_blocksize=135168; twoblocks=\$((img_blocksize * 2)); onepct=\$(((((69206016 / 100) - 1) / img_blocksize + 1) * img_blocksize)); reserve=\$((twoblocks > onepct ? twoblocks : onepct)); maxsize=\$((69206016 - reserve)); echo "\$printname maxsize=\$maxsize blocksize=\$img_blocksize total=\$total reserve=\$reserve"; if [ "\$total" -gt "\$maxsize" ]; then echo "error: \$printname too large (\$total > [69206016 - \$reserve])"; false; elif [ "\$total" -gt \$((maxsize - 32768)) ]; then echo "WARNING: \$printname approaching size limit (\$total now; limit \$maxsize)"; fi )"
usage: mkbootimg [-h] --kernel KERNEL [--ramdisk RAMDISK] [--second SECOND]
[--cmdline CMDLINE] [--base BASE]
[--kernel_offset KERNEL_OFFSET]
[--ramdisk_offset RAMDISK_OFFSET]
[--second_offset SECOND_OFFSET] [--os_version OS_VERSION]
[--os_patch_level OS_PATCH_LEVEL] [--tags_offset TAGS_OFFSET]
[--board BOARD]
[--pagesize {2048,4096,8192,16384,32768,65536,131072}] [--id]
[--dt DT] -o OUTPUT
mkbootimg: error: unrecognized arguments: -2
ninja: build stopped: subcommand failed.
10:58:38 ninja failed with: exit status 1
Ippfcox said:
Wow! You are great! Waiting for you
Click to expand...
Click to collapse
Can you send me a copy of makefile? I also encountered this problem. Thank
orfik said:
Yes. And i have build kernel successfully. Change Makefile in kernel folder and build kernel for RR based on cm-14.1
I send you this Makefile in pm later. After work
Click to expand...
Click to collapse
can you send me a copy of makefile? I also encountered this problem. Thank
zhanyue1124 said:
[ 96% 647/668] Target userdata fs image: /home/zhj/code/LineageOs/out/target/product/libra/userdata.img
Running: mkuserimg.sh -s /home/zhj/code/LineageOs/out/target/product/libra/data /home/zhj/code/LineageOs/out/target/product/libra/userdata.img ext4 data 12469648896 -D /home/zhj/code/LineageOs/out/target/product/libra/system -L data /home/zhj/code/LineageOs/out/target/product/libra/obj/ETC/file_contexts.bin_intermediates/file_contexts.bin
make_ext4fs -s -T -1 -S /home/zhj/code/LineageOs/out/target/product/libra/obj/ETC/file_contexts.bin_intermediates/file_contexts.bin -L data -l 12469648896 -a data /home/zhj/code/LineageOs/out/target/product/libra/userdata.img /home/zhj/code/LineageOs/out/target/product/libra/data /home/zhj/code/LineageOs/out/target/product/libra/system
Creating filesystem with parameters:
Size: 12469645312
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 32768
Label: data
Blocks: 3044347
Block groups: 93
Reserved block group size: 743
Created filesystem with 38/761856 inodes and 90385/3044347 blocks
/home/zhj/code/LineageOs/out/target/product/libra/userdata.img maxsize=12730643904 blocksize=135168 total=149892064 reserve=128679936
[ 97% 654/668] Building Kernel
make: Entering directory '/home/zhj/code/LineageOs/kernel/xiaomi/libra'
GEN /home/zhj/code/LineageOs/out/target/product/libra/obj/KERNEL_OBJ/Makefile
scripts/kconfig/conf --silentoldconfig Kconfig
warning: (SND_SOC_APQ8074 && SND_SOC_MSM8994) selects SND_SOC_MSM_HDMI_CODEC_RX which has unmet direct dependencies (SOUND && !M68K && !UML && SND && SND_SOC && FB_MSM_MDSS_HDMI_PANEL && (SND_SOC_MSM8974 || SND_SOC_APQ8084 || SND_SOC_MSM8994))
warning: (SND_SOC_APQ8074 && SND_SOC_MSM8994) selects SND_SOC_MSM_HDMI_CODEC_RX which has unmet direct dependencies (SOUND && !M68K && !UML && SND && SND_SOC && FB_MSM_MDSS_HDMI_PANEL && (SND_SOC_MSM8974 || SND_SOC_APQ8084 || SND_SOC_MSM8994))
GEN /home/zhj/code/LineageOs/out/target/product/libra/obj/KERNEL_OBJ/Makefile
CHK include/generated/uapi/linux/version.h
CC scripts/mod/devicetable-offsets.s
GEN scripts/mod/devicetable-offsets.h
HOSTCC scripts/mod/file2alias.o
HOSTLD scripts/mod/modpost
Using /home/zhj/code/LineageOs/kernel/xiaomi/libra as source for kernel
CHK include/generated/utsrelease.h
CALL /home/zhj/code/LineageOs/kernel/xiaomi/libra/scripts/checksyscalls.sh
CHK include/generated/compile.h
GZIP kernel/config_data.gz
CHK kernel/config_data.h
make[2]: 'arch/arm64/boot/Image' is up to date.
make: Leaving directory '/home/zhj/code/LineageOs/kernel/xiaomi/libra'
Building DTBs
make: Entering directory '/home/zhj/code/LineageOs/kernel/xiaomi/libra'
CC scripts/mod/devicetable-offsets.s
GEN scripts/mod/devicetable-offsets.h
HOSTCC scripts/mod/file2alias.o
HOSTLD scripts/mod/modpost
make[2]: Nothing to be done for 'dtbs'.
make[2]: Nothing to be done for 'dtbs'.
make: Leaving directory '/home/zhj/code/LineageOs/kernel/xiaomi/libra'
[ 98% 657/668] Target boot image: /home/zhj/code/LineageOs/out/target/product/libra/boot.img
FAILED: /home/zhj/code/LineageOs/out/target/product/libra/boot.img
/bin/bash -c "(/home/zhj/code/LineageOs/out/host/linux-x86/bin/mkbootimg --kernel /home/zhj/code/LineageOs/out/target/product/libra/kernel --ramdisk /home/zhj/code/LineageOs/out/target/product/libra/ramdisk.img --base 0x00000000 --pagesize 4096 --cmdline "console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 boot_cpus=0-5 buildvariant=userdebug" --os_version 8.1.0 --os_patch_level 2018-05-05 -2 --output /home/zhj/code/LineageOs/out/target/product/libra/boot.img ) && (size=\$(for i in /home/zhj/code/LineageOs/out/target/product/libra/boot.img; do stat --format "%s" "\$i" | tr -d '\\n'; echo +; done; echo 0); total=\$(( \$( echo "\$size" ) )); printname=\$(echo -n "/home/zhj/code/LineageOs/out/target/product/libra/boot.img" | tr " " +); img_blocksize=135168; twoblocks=\$((img_blocksize * 2)); onepct=\$(((((69206016 / 100) - 1) / img_blocksize + 1) * img_blocksize)); reserve=\$((twoblocks > onepct ? twoblocks : onepct)); maxsize=\$((69206016 - reserve)); echo "\$printname maxsize=\$maxsize blocksize=\$img_blocksize total=\$total reserve=\$reserve"; if [ "\$total" -gt "\$maxsize" ]; then echo "error: \$printname too large (\$total > [69206016 - \$reserve])"; false; elif [ "\$total" -gt \$((maxsize - 32768)) ]; then echo "WARNING: \$printname approaching size limit (\$total now; limit \$maxsize)"; fi )"
usage: mkbootimg [-h] --kernel KERNEL [--ramdisk RAMDISK] [--second SECOND]
[--cmdline CMDLINE] [--base BASE]
[--kernel_offset KERNEL_OFFSET]
[--ramdisk_offset RAMDISK_OFFSET]
[--second_offset SECOND_OFFSET] [--os_version OS_VERSION]
[--os_patch_level OS_PATCH_LEVEL] [--tags_offset TAGS_OFFSET]
[--board BOARD]
[--pagesize {2048,4096,8192,16384,32768,65536,131072}] [--id]
[--dt DT] -o OUTPUT
mkbootimg: error: unrecognized arguments: -2
ninja: build stopped: subcommand failed.
10:58:38 ninja failed with: exit status 1
Click to expand...
Click to collapse
have you got the solution as I am also running into same error

Build fails with userdata.img generation - what is going wrong?

Hello all! I'm building bullhead on BlissRoms. Currently I'm running into this issue where userdata.img generation fails:
Code:
++++ userdata ++++
creating userdata.img...
Running: mkf2fsuserimg.sh /home/users/ideaman924/bliss/p9.0/out/target/product/bullhead/obj/PACKAGING/target_files_intermediates/bliss_bullhead-target_files-2ab3584229/IMAGES/userdata.img 11649679360 -f /tmp/tmpBxgXxI -s /home/users/ideaman924/bliss/p9.0/out/target/product/bullhead/obj/PACKAGING/target_files_intermediates/bliss_bullhead-target_files-2ab3584229/META/file_contexts.bin -t data -T 1230786000 -L data
Traceback (most recent call last):
File "build/make/tools/releasetools/add_img_to_target_files", line 825, in <module>
main(sys.argv[1:])
File "build/make/tools/releasetools/add_img_to_target_files", line 819, in main
AddImagesToTargetFiles(args[0])
File "build/make/tools/releasetools/add_img_to_target_files", line 744, in AddImagesToTargetFiles
AddUserdata(output_zip)
File "build/make/tools/releasetools/add_img_to_target_files", line 336, in AddUserdata
succ = build_image.BuildImage(user_dir, image_props, img.name)
File "/home/users/ideaman924/bliss/p9.0/build/make/tools/releasetools/build_image.py", line 750, in BuildImage
(mkfs_output, exit_code) = RunCommand(build_command)
File "/home/users/ideaman924/bliss/p9.0/build/make/tools/releasetools/build_image.py", line 67, in RunCommand
env=env_copy)
File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
ninja: build stopped: subcommand failed.
07:57:36 ninja failed with: exit status 1
#### failed to build some targets (42:25 (mm:ss)) ####
real 42m25.455s
user 550m32.002s
sys 31m15.947s
[email protected]:~/bliss/p9.0$
These two commands fix it:
Code:
m -j brillo_update_payload
m -j otatools
But I'm not sure what is breaking. Is there a way to fix this behavior without issuing those commands periodically?
Thread closed at OP request

Problem unpack kernel pxa1908 (Android Image Kitchen)

Hello,
I own a samsung xcover 3 (sm-g388f, android lollitop) and out of curiosity I start to be interested in the android system. I downloaded the ROM and get back the file boot.img, i try to get the file Image.gz (kernel) with Android Image Kitchen.
Code:
./unpackimg.sh boot.img
I get:
Code:
Android Image Kitchen - UnpackImg Script
by osm0sis @ xda-developers
Supplied image: boot.img
Setting up work folders...
Image type: AOSP-PXA
Footer with "SEAndroid" type detected.
Splitting image to "split_img/"...
BOARD_KERNEL_CMDLINE
BOARD_KERNEL_BASE 0x10000000
BOARD_NAME
BOARD_PAGE_SIZE 2048
BOARD_KERNEL_OFFSET 0x00008000
BOARD_RAMDISK_OFFSET 0x01000000
BOARD_SECOND_OFFSET 0x00f00000
BOARD_TAGS_OFFSET 0x00000100
BOARD_DT_SIZE 475136
BOARD_UNKNOWN 0x03000000
Unpacking ramdisk (as root) to "ramdisk/"...
Compression used: gzip
4739 blocs
Done!
I get the file boot.img-kernel, i use dumpimage:
Code:
./dumpimage -i boot.img-kernel -p 0 Image.gz
The return is:
Code:
./dumpimage: invalid option -- 'i'
Usage: ./dumpimage -l image
-l ==> list image header information
./dumpimage [-T type] [-p position] [-o outfile] image
-T ==> declare image type as 'type'
-p ==> 'position' (starting at 0) of the component to extract from image
-o ==> extract component to file 'outfile'
./dumpimage -h ==> print usage information and exit
./dumpimage -V ==> print version information and exit
I try the command:
Code:
./dumpimage -T boot.img-kernel -p 0 Image.gz
i get:
Code:
./dumpimage: Invalid type
I no longer see what to do, here is the boot.img
If anyone has an idea I’m interested
Thanks

[CLOSED] Having a issue when building PixelExperience

FAILED: out/target/product/chopin/boot.img
/bin/bash -c "(out/host/linux-x86/bin/mkbootimg --kernel out/target/product/chopin/kernel --
ramdisk out/target/product/chopin/ramdisk-recovery.img --cmdline \"bootopt=64S3,32N2,64N2 andr
oidboot.selinux=permissive androidboot.init_fatal_reboot_target=recovery buildvariant=userdebu
g\" --base 0x40078000 --pagesize 2048 --recovery_dtbo device/xiaomi/chopin-prebuilts/base/dtbo
.img --dtb out/target/product/chopin/dtb.img --os_version 11 --os_patch_level 2021-12-05 --bas
e 0x40078000 --dtb device/xiaomi/chopin-prebuilts/base/dtb.img --dtb_offset 0x07c08000 --pages
ize 2048 --kernel_offset 0x00008000 --ramdisk_offset 0x11088000 --tags_offset 0x07c08000 --sec
ond_offset 0xbff88000 --header_version 2 --output out/target/product/chopin/boot.img ) && (si
ze=\$(for i in out/target/product/chopin/boot.img; do stat -c \"%s\" \"\$i\" | tr -d '\\n'; e
cho +; done; echo 0); total=\$(( \$( echo \"\$size\" ) )); printname=\$(echo -n \" out/target/
product/chopin/boot.img\" | tr \" \" +); maxsize=\$(( 134217728-69632)); if [ \"\$total\"
-gt \"\$maxsize\" ]; then echo \"error: \$printname too large (\$total > \$maxsize)\"; false;
elif [ \"\$total\" -gt \$((maxsize - 32768)) ]; then echo \"WARNING: \$printname approaching s
ize limit (\$total now; limit \$maxsize)\"; fi ) && (out/host/linux-x86/bin/avbtool add_hash_f
ooter --image out/target/product/chopin/boot.img --partition_size 134217728 --partition_nam
e boot --prop com.android.build.boot.fingerprint:\$(cat out/target/product/chopin/build_finge
rprint.txt) --prop com.android.build.boot.os_version:11 )"
Traceback (most recent call last):
File "/mnt/sda1/AndroidSources/PixelExperience11P/out/host/linux-x86/bin/mkbootimg/internal/
stdlib/runpy.py", line 174, in _run_module_as_main
File "/mnt/sda1/AndroidSources/PixelExperience11P/out/host/linux-x86/bin/mkbootimg/internal/
stdlib/runpy.py", line 72, in _run_code
File "/mnt/sda1/AndroidSources/PixelExperience11P/out/host/linux-x86/bin/mkbootimg/__main__.
py", line 12, in <module>
File "/mnt/sda1/AndroidSources/PixelExperience11P/out/host/linux-x86/bin/mkbootimg/internal/
stdlib/runpy.py", line 174, in _run_module_as_main
File "/mnt/sda1/AndroidSources/PixelExperience11P/out/host/linux-x86/bin/mkbootimg/internal/
stdlib/runpy.py", line 72, in _run_code
File "/mnt/sda1/AndroidSources/PixelExperience11P/out/host/linux-x86/bin/mkbootimg/mkbootimg
.py", line 321, in <module>
File "/mnt/sda1/AndroidSources/PixelExperience11P/out/host/linux-x86/bin/mkbootimg/mkbootimg
.py", line 308, in main
File "/mnt/sda1/AndroidSources/PixelExperience11P/out/host/linux-x86/bin/mkbootimg/mkbootimg
.py", line 128, in write_header
struct.error: 'I' format requires 0 <= number <= 4294967295
08:51:11 ninja failed with: exit status 1
It happened when I was trying to build PixelExperience11Plus with a prebuilt kernel. How can I fix it.
@LMFuture Thread closed as duplicate of
I have an issue when I was building PixelExperience.
FAILED: out/target/product/chopin/boot.img /bin/bash -c "(out/host/linux-x86/bin/mkbootimg --kernel out/target/product/chopin/kernel -- ramdisk out/target/product/chopin/ramdisk-recovery.img --cmdline \"bootopt=64S3,32N2,64N2 andr...
forum.xda-developers.com
Please review the XDA Forum Rules with special emphasis on rule no. 5 and post only ONCE! Thanks for your cooperation.
Regards
Oswald Boelcke
Senior Moderator

Categories

Resources