How to make boot.img file

I’m trying to build kernel and make boot.img file
But I couldn’t make boot.img file when I execute “make bootimage -j24” after execute “make -j24”.

Someone help me to make boot.img file?

  • kernel build

Building the kernel

1.Run the following commands:
$ git clone kernel/hikey-linaro - Git at Google
$ cd hikey-linaro
$ git checkout -b android-hikey-linaro-4.4 origin/android-hikey-linaro-4.4
$ make ARCH=arm64 hikey_defconfig
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-android- -j24

2.Copy output to the hikey kernel directory (/kernel/hikey-linaro):
1.Copy hi6220-hikey.dtb (arch/arm64/boot/dts/hisilicon/hi6220-hikey.dtb) to the hikey-kernel directory.
2.Copy the Image file (arch/arm64/boot/Image-dtb) to the hikey-kernel directory.
3.Make the boot image:
$ make bootimage -j24

=====> What do I have to do?
/work/Hikey/kernel/hikey-linaro$ make bootimage -j32

scripts/kconfig/conf --silentoldconfig Kconfig
warning: (HISI_FIQ_DEBUGGER && FIQ_WATCHDOG) selects FIQ_DEBUGGER which has unmet direct dependencies (STAGING && ANDROID && (ARM || ARM64))
*

  • Restart config…
  • General setup

Cross-compiler tool prefix (CROSS_COMPILE) []
Compile also drivers which will not load (COMPILE_TEST) [N/y/?] n
Local version - append to kernel release (LOCALVERSION) []
Automatically append version information to the version string (LOCALVERSION_AUTO) [Y/n/?] y
Kernel compression mode

  1. Gzip (KERNEL_GZIP) (NEW)
  1. Bzip2 (KERNEL_BZIP2) (NEW)
  2. LZMA (KERNEL_LZMA) (NEW)
  3. XZ (KERNEL_XZ) (NEW)
  4. LZO (KERNEL_LZO) (NEW)
  5. LZ4 (KERNEL_LZ4) (

Execute the following commands from the kernel source directory.

echo "Removing old image..."
rm ../device/linaro/hikey-kernel/*
echo "Copying new image..."
cp arch/arm64/boot/dts/hisilicon/hi6220-hikey.dtb ../device/linaro/hikey-kernel/
cp arch/arm64/boot/Image-dtb ../device/linaro/hikey-kernel/
cd ../
source ./build/envsetup.sh
lunch hikey-userdebug
make bootimage -j24
cd -

It will build the boot.img for u

You should execute the make bootimg -j24 at the android home directory.

1 Like

when I removed …/device/linaro/hikey-kernel/* , I encoutered buid error as under the text

ninja: error: ‘device/linaro/hikey-kernel/hi6220-hikey.dtb-4.9’, needed by ‘out/target/product/hikey/hi6220-hikey.dtb’, missing and no known rule to make it

R u using 4.9 kernel?

My instruction are for 4.4 kernel. U can copy the stuff in the required format for 4.9

cp arch/arm64/boot/dts/hisilicon/hi6220-hikey.dtb device/linaro/hikey-kernel/hi6220-hikey.dtb-4.9

and the same way for the boot image

Thank you for your support.
I’m using Kernel 4.9 so I modified to kernel 4.9 format as your guide then it worked.