ARM64 Linux Kernel Builds but Image Is Not in arch/arm64/boot

Asked 1 years ago, Updated 1 years ago, 374 views

I am cross-building the Linux kernel in the Docker container because I want to run BusyBox with the kernel I built myself in qemu as shown in the link below, but there is no kernel image in arch/arm64/boot after the build is finished.
Why?

The Docker container uses archlinux:base-devel.

Build is

export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-

with
make defconfig
make Image dtbs-j8

You are about to build Linux 6.1.8.

Reference Links
https://www.honamium.net/post/run_linux_arm64/

I tried to follow the link, but it didn't work.
Image did not exist

$makeARCH=arm64defconfig
$ make ARCH=arm64CROSS_COMPILE=aarch64-linux-gnu-Image dtbs-j`nproc`

linux build kernel

2023-01-26 12:51

1 Answers

Short answer:

  • The archlinux:base-devel container image alone does not have enough packages to compile.
  • The article you are referring to is probably Debian/Ubuntu because you use apt, but you should read the Preparing for Linux for Arm64 section carefully.
  • The results (error messages) of the command also contain important tips.
    You should check it yourself and present it when you ask questions.

Tried steps:

Downloading the kernel source code and make ARCH=arm64defconfig are no major issues.

Running the following command results in an error stating "aarch64-linux-gnu-gcc not found" in the cross compiler:

#makeARCH=arm64CROSS_COMPILE=aarch64-linux-gnu-Image dtbs-j`nproc`
arch/arm64/Makefile:36—Detected assembler with broken.inst;disassembly will be unreliable 
  SYNC include/config/auto.conf 
scripts/Kconfig.include:39:C compiler'aarch64-linux-gnu-gcc'not found 
make[2]:*** [scripts/kconfig/Makefile:77:synconfig] Error 1 
make[1]:*** [Makefile:708:syncconfig] Error 2 
make:*** [Makefile:809:include/config/auto.conf] Error 2 
make:***[include/config/auto.conf]Deleting file 'include/generated/rustc_cfg' 
make:***[include/config/auto.conf]Deleting file 'include/generated/autoconf.h'

Install additional packages

#pacman-Sarch64-linux-gnu-gcc

If you try to make again, you will not see any errors at first glance, but if you look at ls./arch/arm64/boot/, you will see dtbs, but Image has not been generated.

"This time, when I tried to set the target only to ""Image"" when I made it, I got an error saying ""I couldn't find the bc command."""

#makeARCH=arm64CROSS_COMPILE=aarch64-linux-gnu-Image-j`nproc` 
  CC kernel/bounds.s 
/bin/sh:line1:bc:command not found 
/bin/sh:line1:echo:write error:Broken pipe 
  CHKSHA1 include/linux/atomic/atomic-arch-fallback.h 
make[1]:*** [Kbuild:24: include/generated/timeconst.h] Error 127 
make[1]:*** Waiting for unfinished jobs.... 
  CHKSHA1 include/linux/atomic/atomic-instrumented.h 
make:*** [Makefile:1298:prepare0] Error 2 

Install additional packages again.

$pacman-Sbc

We have confirmed that making again after adding the package will also generate an image.

#makeARCH=arm64CROSS_COMPILE=aarch64-linux-gnu-Image-j`nproc`


2023-01-26 13:35

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.