Kernel (uImage) build fail when build android pie for vim1

Just got the vim1 board last week.

First, repo init & repo sync “khadas-vims-pie” branch successfully,
then according to https://docs.khadas.com/vim1/BuildAndroid.html to build uboot and android,
Not found any obvious compilation errors ,uImage build fail log as below:

[ 1% 1288/68460] make Image
FAILED: out/target/product/kvim/obj/KERNEL_OBJ/arch/arm/boot/uImage
/bin/bash -c "(make -j4 -C common O=…/out/target/product/kvim/obj/KERNEL_OBJ ARCH=arm CROSS_COMPILE=/mnt/UbuntuData/DevTools/opt/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- modules uImage ) && (make -j4 KERNEL_ARCH=arm CROSS_COMPILE=/mnt/UbuntuData/DevTools/opt/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -f hardware/amlogic/wifi/configs/wifi_driver.mk multiwifi ) && (make -j4 KERNEL_ARCH=arm CROSS_COMPILE=/mnt/UbuntuData/DevTools/opt/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -f hardware/amlogic/bluetooth/configs/bluetooth_driver.mk BLUETOOTH_INF= BCMBT ) && (: ) && (mkdir -p out/target/product/kvim/obj/lib_vendor ) && (rm out/target/product/kvim/obj/lib_vendor/tb_detect.ko -f ) && (cp device/khadas/common/tb_detect/tb_detect.ko out/target/product/kvim/obj/lib_vendor/tb_detect.ko -airf ) && (echo “copy Amlogic TB Detect module from device/khadas/common/tb_detect to out/target/product/kvim/vendor/lib/modules” ) && (mkdir -p out/target/product/kvim/root/boot ) && (mkdir -p out/target/product/kvim/obj/lib_vendor ) && (cp out/target/product/kvim/obj/KERNEL_OBJ/drivers/usb/dwc3/dwc3.ko out/target/product/kvim/obj/lib_vendor/ ; true ) && (cp out/target/product/kvim/obj/KERNEL_OBJ/drivers/amlogic/usb/dwc_otg/310/dwc_otg.ko out/target/product/kvim/obj/lib_vendor/ ; true ) && (make -j4 -C /mnt/UbuntuData/android-src/khadas/p_android/out/target/product/kvim/obj/KERNEL_OBJ/ M=/mnt/UbuntuData/android-src/khadas/p_android/out/target/product/kvim/obj/media_modules ARCH=arm CROSS_COMPILE=/mnt/UbuntuData/DevTools/opt/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- CONFIG_AMLOGIC_MEDIA_VDEC_MPEG12=m CONFIG_AMLOGIC_MEDIA_VDEC_MPEG2_MULTI=m CONFIG_AMLOGIC_MEDIA_VDEC_MPEG4=m CONFIG_AMLOGIC_MEDIA_VDEC_MPEG4_MULTI=m CONFIG_AMLOGIC_MEDIA_VDEC_VC1=m CONFIG_AMLOGIC_MEDIA_VDEC_H264=m CONFIG_AMLOGIC_MEDIA_VDEC_H264_MULTI=m CONFIG_AMLOGIC_MEDIA_VDEC_H264_MVC=m CONFIG_AMLOGIC_MEDIA_VDEC_H265=m CONFIG_AMLOGIC_MEDIA_VDEC_VP9=m CONFIG_AMLOGIC_MEDIA_VDEC_MJPEG=m CONFIG_AMLOGIC_MEDIA_VDEC_MJPEG_MULTI=m CONFIG_AMLOGIC_MEDIA_VDEC_REAL=m CONFIG_AMLOGIC_MEDIA_VDEC_AVS=m CONFIG_AMLOGIC_MEDIA_VDEC_AVS2=m CONFIG_AMLOGIC_MEDIA_VENC_H264=m CONFIG_AMLOGIC_MEDIA_VENC_H265=m CONFIG_AMLOGIC_MEDIA_ENHANCEMENT_DOLBYVISION=y EXTRA_CFLAGS+=-I./hardware/amlogic/media_modules/drivers/include modules; find /mnt/UbuntuData/android-src/khadas/p_android/out/target/product/kvim/obj/media_modules -name “.ko" | xargs -i cp {} /mnt/UbuntuData/android-src/khadas/p_android/out/target/product/kvim/obj/lib_vendor ) && (mkdir -p out/target/product/kvim/vendor/lib/modules/ ) && (cp out/target/product/kvim/obj/lib_vendor/ out/target/product/kvim/vendor/lib/modules/ )”
make: Entering directory ‘/mnt/UbuntuData/android-src/khadas/p_android/common’
make[1]: Entering directory ‘/mnt/UbuntuData/android-src/khadas/p_android/out/target/product/kvim/obj/KERNEL_OBJ’
GEN ./Makefile
scripts/kconfig/conf --silentoldconfig Kconfig
CHK include/config/kernel.release
CHK include/config/kernel.release_full
GEN ./Makefile
CHK include/generated/uapi/linux/version.h
CHK scripts/mod/devicetable-offsets.h
Using /mnt/UbuntuData/android-src/khadas/p_android/common as source for kernel
CHK include/generated/utsrelease.h
CHK include/generated/timeconst.h
CHK include/generated/bounds.h
CHK include/generated/asm-offsets.h
CALL /mnt/UbuntuData/android-src/khadas/p_android/common/scripts/checksyscalls.sh
CHK include/generated/compile.h
GZIP kernel/config_data.gz
CHK kernel/config_data.h
Building modules, stage 2.
Kernel: arch/arm/boot/Image is ready
MODPOST 7 modules
Kernel: arch/arm/boot/zImage is ready
UIMAGE arch/arm/boot/uImage
==> /mnt/UbuntuData/DevTools/opt/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-mkimage
“mkimage” command not found - U-Boot images will not be built
/mnt/UbuntuData/android-src/khadas/p_android/common/arch/arm/boot/Makefile:101: recipe for target ‘arch/arm/boot/uImage’ failed
make[2]: *** [arch/arm/boot/uImage] Error 1
arch/arm/Makefile:336: recipe for target ‘uImage’ failed
make[1]: *** [uImage] Error 2
make[1]: Leaving directory ‘/mnt/UbuntuData/android-src/khadas/p_android/out/target/product/kvim/obj/KERNEL_OBJ’
Makefile:152: recipe for target ‘sub-make’ failed
make: *** [sub-make] Error 2
make: Leaving directory ‘/mnt/UbuntuData/android-src/khadas/p_android/common’

Could you help me how to build android pie successfully ??
What’s the cmd to build uImage separately ??
Thank you very much !!
(build environment: Ubuntu 18.04)

The fail reason: missing “mkimage” in the build environment.
Add it as below:

  1. cp bootloader/uboot/build/tools/mkimage ~/bin/
    chmod +x ~/bin/mkimage

  2. add “~/bin” to $PATH environment var on Ubuntu.

Then rebuild it, boot.img build successfully, it’s solved.

1 Like