meta-rockchip/conf/machine/include/rockchip-extlinux.inc
Quentin Schulz cb3dedaede rockchip-extlinux.inc: add kernel and dtb packages to the image
If an image doesn't include kernel-modules, the kernel-image package
won't be installed by default. This means that no
kernel-image-${KERNEL_IMAGETYPE} package will be pulled in, resulting in
neither fitImage nor Image (or uImage, or zImage, or...) making it to
the filesystem, rendering the image non-bootable.

For non-fitImage scenarios, we currently expect DTB-less kernel images
(no bundle, like in uImage) so we also need to pull in the DTB via the
kernel-devicetree package.

Those packages used to be pulled in by the wic plugin through the
IMAGE_BOOT_FILES variable.

Reviewed-by: Trevor Woerner <twoerner@gmail.com>
Fixes: 3b51866f22 ("remove /boot partition")
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-05-26 09:35:04 -04:00

26 lines
1.3 KiB
C++

# KERNEL_DEVICETREE follows the pattern of
# 'rockchip/${SOC_FAMILY}-${BOARD}.dtb' which is required when compiling
# the kernel so the kernel's Makefile can find the device tree
#
# when using extlinux with a fitImage the device tree is contained in the
# fitImage
#
# however for non-fitImages it is not found at
# $UBOOT_EXTLINUX_FDTDIR/rockchip/$KERNEL_DEVICETREE but rather at
# $UBOOT_EXTLINUX_FDTDIR/$KERNEL_DEVICETREE therefore we need to strip off
# the 'rockchip/' part for extlinux non-fitImage builds
NONFITDT ?= "${@d.getVar('KERNEL_DEVICETREE').split()[0].split('/')[1]}"
UBOOT_EXTLINUX ?= "1"
UBOOT_EXTLINUX_ROOT ?= "root=PARTLABEL=rootfsA"
UBOOT_EXTLINUX_FDTDIR ?= "${@bb.utils.contains('KERNEL_IMAGETYPE', 'fitImage', '', '/boot', d)}"
UBOOT_EXTLINUX_FDT ?= "${@bb.utils.contains('KERNEL_IMAGETYPE', 'fitImage', '', '${NONFITDT}', d)}"
UBOOT_EXTLINUX_CONSOLE ?= "earlycon console=tty1 console=${RK_CONSOLE_DEVICE},${RK_CONSOLE_BAUD}n8"
UBOOT_EXTLINUX_KERNEL_ARGS ?= "rootwait rw rootfstype=ext4"
UBOOT_EXTLINUX_KERNEL_IMAGE ?= "/boot/${KERNEL_IMAGETYPE}"
UBOOT_EXTLINUX_LABELS ?= "default"
UBOOT_EXTLINUX_MENU_DESCRIPTION:default ?= "${MACHINE}"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "u-boot-extlinux"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-image ${@bb.utils.contains('KERNEL_IMAGETYPE', 'fitImage', '', 'kernel-devicetree', d)}"