[CLOSED] Having a issue when building PixelExperience - General Topics

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

Related

Script: Check Samsung ROMs tar.md5 format using Linux/bash

Hi,
The Samsung ODIN .tar.md5 format files contain an embedded md5sum signature for download checking. I found this handy bash script for checking .tar.md5 format for md5sum. Original sources are (thanks to contributors!)
http://stackoverflow.com/questions/...how-to-remove-md5-extension/17751305#17751305
http://stackoverflow.com/questions/...-case-in-bash-shell-scripting/2264435#2264435
I've added lowercase conversion and echoing both signatures, just for checking.
The script (source it and you'll have check_tar_md5 command in your env).
Code:
#! /bin/bash
check_tar_md5 () {
local file="${1:?Required: file to check}"
[[ ! -f "$file" ]] && {
echo "File not found: $file" >&2
return 1
}
local filename="$(basename "$file")"
if [ "${filename##*.}" = md5 ]; then filename="${filename%.*}"; fi;
local md5_line_length=$(printf "%032d *%s\n" 0 "$filename" | wc -c)
local embedded_md5=$(tail -c $md5_line_length "$file" | tr [A-Z] [a-z] | ( read md5 rest; echo $md5 ) )
local actual_md5=$(head -c -$md5_line_length "$file" | md5sum | ( read md5 rest; echo $md5 ) )
echo "Embedded md5: " $embedded_md5
echo "Actual md5: " $actual_md5
if [ $embedded_md5 = $actual_md5 ]; then
echo "$file: OK"
else
echo "$file: FAILED"
return 1
fi
}
[[ ! -z "$1" ]] && check_tar_md5 "$1"

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

TWRP question

i am trying to build twrp for a device and i get this
[ 76% 10/13] ----- Making recovery ramdisk ------
FAILED: /home/wajdi/Documents/omni/out/target/product/wingray/ramdisk-recovery.cpio
/bin/bash -c "(mkdir -p /home/wajdi/Documents/omni/out/target/product/wingray/recovery ) && (mkdir -p /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/etc /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/sdcard /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/tmp ) && (echo Copying baseline ramdisk... ) && (rsync -a --exclude=etc --exclude=sdcard --exclude=vendor --exclude=/root/sepolicy --exclude=/root/plat_file_contexts --exclude=/root/nonplat_file_contexts --exclude=/root/plat_property_contexts --exclude=/root/nonplat_property_contexts --exclude=cache /home/wajdi/Documents/omni/out/target/product/wingray/root /home/wajdi/Documents/omni/out/target/product/wingray/recovery ) && (cp -f /home/wajdi/Documents/omni/out/target/product/wingray/system/bin/adbd /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/sbin/adbd ) && (echo Modifying ramdisk contents... ) && (rm -f /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/init*.rc ) && (cp -f bootable/recovery/etc/init.rc /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/ ) && (cp /home/wajdi/Documents/omni/out/target/product/wingray/root/init.recovery.*.rc /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/ || true ) && (mkdir -p /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/res ) && (rm -rf /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/res/* ) && (cp -rf bootable/recovery/res-xhdpi/* /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/res ) && (cp -f bootable/recovery/fonts/12x22.png /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/res/images/font.png ) && (cp -rf device/moto/wingray/recovery/root /home/wajdi/Documents/omni/out/target/product/wingray/recovery/ ) && (cp -f device/moto/wingray/twrp.fstab /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/etc/recovery.fstab ) && (cp /home/wajdi/Documents/omni/out/target/product/wingray/obj/PACKAGING/ota_keys_intermediates/keys /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/res/keys ) && (cat /home/wajdi/Documents/omni/out/target/product/wingray/root/default.prop > /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/prop.default ) && (cat /home/wajdi/Documents/omni/out/target/product/wingray/obj/ETC/system_build_prop_intermediates/build.prop >> /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/prop.default ) && (ln -sf prop.default /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/default.prop ) && (echo "----- Making uncompressed recovery ramdisk ------" ) && (/home/wajdi/Documents/omni/out/host/linux-x86/bin/mkbootfs /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root > /home/wajdi/Documents/omni/out/target/product/wingray/ramdisk-recovery.cpio )"
Copying baseline ramdisk...
cp: cannot stat '/home/wajdi/Documents/omni/out/target/product/wingray/system/bin/adbd': No such file or directory
ninja: build stopped: subcommand failed.
17:08:13 ninja failed with: exit status 1
#### failed to build some targets (48 seconds) ####
ive spent a week searching for a solution and i didnt find anything
Wajdi Muhtadi said:
i am trying to build twrp for a device and i get this
[ 76% 10/13] ----- Making recovery ramdisk ------
FAILED: /home/wajdi/Documents/omni/out/target/product/wingray/ramdisk-recovery.cpio
/bin/bash -c "(mkdir -p /home/wajdi/Documents/omni/out/target/product/wingray/recovery ) && (mkdir -p /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/etc /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/sdcard /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/tmp ) && (echo Copying baseline ramdisk... ) && (rsync -a --exclude=etc --exclude=sdcard --exclude=vendor --exclude=/root/sepolicy --exclude=/root/plat_file_contexts --exclude=/root/nonplat_file_contexts --exclude=/root/plat_property_contexts --exclude=/root/nonplat_property_contexts --exclude=cache /home/wajdi/Documents/omni/out/target/product/wingray/root /home/wajdi/Documents/omni/out/target/product/wingray/recovery ) && (cp -f /home/wajdi/Documents/omni/out/target/product/wingray/system/bin/adbd /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/sbin/adbd ) && (echo Modifying ramdisk contents... ) && (rm -f /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/init*.rc ) && (cp -f bootable/recovery/etc/init.rc /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/ ) && (cp /home/wajdi/Documents/omni/out/target/product/wingray/root/init.recovery.*.rc /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/ || true ) && (mkdir -p /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/res ) && (rm -rf /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/res/* ) && (cp -rf bootable/recovery/res-xhdpi/* /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/res ) && (cp -f bootable/recovery/fonts/12x22.png /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/res/images/font.png ) && (cp -rf device/moto/wingray/recovery/root /home/wajdi/Documents/omni/out/target/product/wingray/recovery/ ) && (cp -f device/moto/wingray/twrp.fstab /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/etc/recovery.fstab ) && (cp /home/wajdi/Documents/omni/out/target/product/wingray/obj/PACKAGING/ota_keys_intermediates/keys /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/res/keys ) && (cat /home/wajdi/Documents/omni/out/target/product/wingray/root/default.prop > /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/prop.default ) && (cat /home/wajdi/Documents/omni/out/target/product/wingray/obj/ETC/system_build_prop_intermediates/build.prop >> /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/prop.default ) && (ln -sf prop.default /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root/default.prop ) && (echo "----- Making uncompressed recovery ramdisk ------" ) && (/home/wajdi/Documents/omni/out/host/linux-x86/bin/mkbootfs /home/wajdi/Documents/omni/out/target/product/wingray/recovery/root > /home/wajdi/Documents/omni/out/target/product/wingray/ramdisk-recovery.cpio )"
Copying baseline ramdisk...
cp: cannot stat '/home/wajdi/Documents/omni/out/target/product/wingray/system/bin/adbd': No such file or directory
ninja: build stopped: subcommand failed.
17:08:13 ninja failed with: exit status 1
#### failed to build some targets (48 seconds) ####
ive spent a week searching for a solution and i didnt find anything
Click to expand...
Click to collapse
It seems that omni project has remove TWRP from their manifest.xml so the source code of boot/recovery folder is from AOSP, not TWRP.
I have the same problem and I solve it by using minimal-manifest-twrp/platform_manifest_twrp_omni on github and I success.
don't forget to use `export ALLOW_MISSING_DEPENDENCIES=true` command before u compile by using minimal-manifest-twrp/platform_manifest_twrp_omni project

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)

Question S22: vendor_dlkm.img

Hi
I am evaluating SM-S908E_12_Opensource provided by Samsung opensource site
The parameters in the build.sh provided by the opensource configure the vendor_dlkm.img to EXT4.
However, the original firmware's vendor_dlkm.img is F2FS
Could someone advise what are the modifications need to be made in the build.sh to configure the vendor_dlkm to F2FS
The following is code snipplet of build.sh:
:
local vendor_dlkm_props_file
if [ -z "${VENDOR_DLKM_PROPS}" ]; then
vendor_dlkm_props_file="$(mktemp)"
echo -e "vendor_dlkm_fs_type=ext4\n" >> ${vendor_dlkm_props_file}
echo -e "use_dynamic_partition_size=true\n" >> ${vendor_dlkm_props_file}
echo -e "ext_mkuserimg=mkuserimg_mke2fs\n" >> ${vendor_dlkm_props_file}
echo -e "ext4_share_dup_blocks=true\n" >> ${vendor_dlkm_props_file}
else
vendor_dlkm_props_file="${VENDOR_DLKM_PROPS}"
if [[ -f "${ROOT_DIR}/${vendor_dlkm_props_file}" ]]; then
vendor_dlkm_props_file="${ROOT_DIR}/${vendor_dlkm_props_file}"
elif [[ "${vendor_dlkm_props_file}" != /* ]]; then
echo "VENDOR_DLKM_PROPS must be an absolute path or relative to ${ROOT_DIR}: ${vendor_dlkm_props_file}"
exit 1
:
:
I had tried to amending vendor_dlkm_fs_type=f2fs which end the build with the following error:
:
extra/test/mmrm_test_module.ko
========================================================
Trimming unused modules
2022-07-15 08:00:53 - build_image.py - ERROR : Failed to build /home/cara/Downloads/SM-S908E_12_Opensource/K2/Kernel/out/msm-waipio-waipio-gki/dist/vendor_dlkm.img from /home/cara/Downloads/SM-S908E_12_Opensource/K2/Kernel/out/msm-waipio-waipio-gki/staging/vendor_dlkm_staging
:
KeyError: 'partition_size'
Could someone advise what are the modifications need to be made in the build.sh to configure the vendor_dlkm to F2FS
Thanks
regards
MHC

Categories

Resources