kernel doesn't start booting after chaning to minimum config (on qemu arm64 machine)

Greg KH greg at kroah.com
Wed Oct 13 03:23:21 EDT 2021


On Tue, Oct 12, 2021 at 11:06:53PM +0900, Chan Kim wrote:
> Hello all,
> 
> To make a minimal kernel size (with almost no driver), I copied a .config
> that was used for building kernel for sparc machine using linux 3.3 several
> years ago to current linux 5.4.21 version build tree.
> 
> (That .config was for kernel with interrupt controller, timer and uart so a
> very basic scheduling and shell is possible.)
> 
> Then I ran 
> 
> Yes "" | make ARCH=arm64 CROSS_COMPILE=aarch64-none-elf- oldconfig
> 
> This copies the configs and sets all the new config settings with default
> values. 
> 
> (see
> https://serverfault.com/questions/116299/automatically-answer-defaults-when-
> doing-make-oldconfig-on-a-kernel-tree)
> 
>  
> 
> Now I can see the start_kernel function runs to the end and it's running
> inside the cpu_idle function. but I don't see the first scrolling message
> below that I normally should see.
> 
> [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd083]
> 
> I tried adding several CONFIG variables using menuconfig but it's still the
> same.
> 
> (CONFIG_SERIAL_AMBA_PL010, CONFIG_SERIAL_AMBA_PL010_CONSOLE,
> CONFIG_SERIAL_CORE, CONFIG_SERIAL_CORE_CONSOLE were already automatically
> set. 
> 
> And later I tried adding CONFIG_CPU_IDLE, CONFIG_CPU_IDLE_GOV_LADDR,
> CONFIG_ACPI and other ACPI related things, CONFIG_PCI_ECAM, CONFIG_PNP,
> CONFIG_PNP_DEBUG_MESSAGES, .. )
> 
> And the qemu command is like this.
> 
> ${QEMU_DIR}/qemu-system-aarch64 -M ${QMACHINE} -cpu cortex-a72 -kernel
> ${LINUX_DIR}/arch/arm64/boot/Image -initrd ${BUSYBOX_DIR}/initramfs.cpio.gz
> --append "root=/dev/ram init=/init nokaslr earlycon ip=dhcp" -m 2048M
> -nographic -netdev user,id=n1 -device e1000,netdev=n1
> 
> Has anyone any idea what I can add in the config or try? (with original
> .config, the kernel boots ok to the bash in initramfs)
> 
> Any suggestion will be appreciated.

There are two different ways of getting a "minimal" kernel
configuration:
	- start with a working one and remove items until something
	  breaks
	- start with a minimal config and keep adding things until it
	  works.

Usually the first option is the easier one, as it should go faster and
you can figure out exactly what is needed.  The second way is just
blindly guessing, like it seems you are doing here.

Best of luck!

greg k-h



More information about the Kernelnewbies mailing list