u-boot: fix the use of boot image recipe and prefix

A variable called IMAGE_BOOTLOADER was being used without distinction for
referring to two different things:
 - the recipe that builds the bootable artifacts
 - the prefix of those artifacts

The value of this is "u-boot" for most platforms, but "imx-boot" for the
CC8X based platforms.

The name of the variable is misleading, so this commit splits it into two:
 - BOOTLOADER_IMAGE_RECIPE, to refer to the recipe
 - UBOOT_PREFIX, to refer to the prefix of the bootable artifact

With the separation, the variable UBOOT_SYMLINK becomes a generic formed
one, so it is moved to digi-defaults.inc.

While on it, fix the image_types_digi.bbclass which was not making use of
the original variable to establish all the dependencies.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
This commit is contained in:
Hector Palacios 2019-07-11 11:10:58 +02:00
parent 7d64118a94
commit e50f6c3e91
6 changed files with 15 additions and 11 deletions

View File

@ -3,6 +3,8 @@ inherit image_types
################################################################################
# BOOT IMAGES #
################################################################################
BOOTLOADER_IMAGE_RECIPE ?= "u-boot"
def TRUSTFENCE_BOOTIMAGE_DEPENDS(d):
tf_initramfs = d.getVar('TRUSTFENCE_INITRAMFS_IMAGE',True) or ""
return "%s:do_image_complete" % tf_initramfs if tf_initramfs else ""
@ -11,7 +13,7 @@ do_image_boot_vfat[depends] += " \
coreutils-native:do_populate_sysroot \
dosfstools-native:do_populate_sysroot \
mtools-native:do_populate_sysroot \
u-boot:do_deploy \
${BOOTLOADER_IMAGE_RECIPE}:do_deploy \
virtual/kernel:do_deploy \
${@TRUSTFENCE_BOOTIMAGE_DEPENDS(d)} \
"
@ -74,7 +76,7 @@ do_image_boot_vfat[imgsuffix] = "."
do_image_boot_ubifs[depends] += " \
mtd-utils-native:do_populate_sysroot \
u-boot:do_deploy \
${BOOTLOADER_IMAGE_RECIPE}:do_deploy \
virtual/kernel:do_deploy \
${@TRUSTFENCE_BOOTIMAGE_DEPENDS(d)} \
"
@ -144,7 +146,7 @@ IMAGE_TYPEDEP_recovery.vfat = "boot.vfat"
do_image_recovery_ubifs[depends] += " \
mtd-utils-native:do_populate_sysroot \
u-boot:do_deploy \
${BOOTLOADER_IMAGE_RECIPE}:do_deploy \
virtual/kernel:do_deploy \
${RECOVERY_INITRAMFS_IMAGE}:do_image_complete \
"
@ -228,7 +230,6 @@ BOARD_BOOTIMAGE_PARTITION_SIZE ??= "65536"
# SD card image name
SDIMG = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.sdcard"
IMAGE_BOOTLOADER ?= "u-boot"
BOOTLOADER_SEEK ?= "1"
SDIMG_BOOTLOADER ?= "${DEPLOY_DIR_IMAGE}/${UBOOT_SYMLINK}"
@ -241,7 +242,7 @@ do_image_sdcard[depends] = " \
dosfstools-native:do_populate_sysroot \
mtools-native:do_populate_sysroot \
parted-native:do_populate_sysroot \
${IMAGE_BOOTLOADER}:do_deploy \
${BOOTLOADER_IMAGE_RECIPE}:do_deploy \
virtual/kernel:do_deploy \
"

View File

@ -9,8 +9,8 @@ include conf/machine/include/imx-digi-base.inc
include conf/machine/include/tune-cortexa9.inc
# Platform u-boot settings
UBOOT_PREFIX = "u-boot"
UBOOT_SUFFIX = "imx"
UBOOT_SYMLINK = "u-boot-${MACHINE}.${UBOOT_SUFFIX}"
# Linux kernel configuration
KERNEL_DEFCONFIG ?= "arch/arm/configs/ccimx6sbc_defconfig"

View File

@ -9,8 +9,8 @@ include conf/machine/include/imx-digi-base.inc
include conf/machine/include/tune-cortexa7.inc
# Platform u-boot settings
UBOOT_PREFIX = "u-boot"
UBOOT_SUFFIX = "imx"
UBOOT_SYMLINK = "u-boot-${MACHINE}.${UBOOT_SUFFIX}"
# Wireless external module
WIRELESS_MODULE ?= ""

View File

@ -9,15 +9,15 @@ include conf/machine/include/imx-digi-base.inc
include conf/machine/include/arm/arch-arm64.inc
# Platform u-boot settings
UBOOT_PREFIX = "imx-boot"
UBOOT_SUFFIX = "bin"
UBOOT_SYMLINK = "u-boot-${MACHINE}.${UBOOT_SUFFIX}"
# The bootloader image that gets flashed consists of U-Boot and several fw binaries
EXTRA_IMAGEDEPENDS = "imx-boot"
IMAGE_BOOTLOADER = "imx-boot"
BOOTLOADER_IMAGE_RECIPE = "imx-boot"
# BOOTLOADER_SEEK is 33 for step A of the silicon and 32 for step B
BOOTLOADER_SEEK = "32"
BOOTABLE_FILENAME = "imx-boot-${MACHINE}.bin"
BOOTABLE_FILENAME = "${UBOOT_PREFIX}-${MACHINE}.bin"
SDIMG_BOOTLOADER = "${DEPLOY_DIR_IMAGE}/${BOOTABLE_FILENAME}"
# RAM variants

View File

@ -50,3 +50,6 @@ USE_VT ?= "0"
# Add the machine variant to the valid machine override
MACHINE_VARIANT ?= ""
MACHINEOVERRIDES .= "${@['', ':${MACHINE_VARIANT}']['${MACHINE_VARIANT}' != '']}"
# U-Boot symlink
UBOOT_SYMLINK ?= "${UBOOT_PREFIX}-${MACHINE}.${UBOOT_SUFFIX}"

View File

@ -27,7 +27,7 @@ generate_installer_zip () {
fi
done
for ubconf in ${UBOOT_CONFIG}; do
if readlink -e "${DEPLOY_DIR_IMAGE}/${IMAGE_BOOTLOADER}-${ubconf}.${UBOOT_SUFFIX}" >/dev/null; then
if readlink -e "${DEPLOY_DIR_IMAGE}/${UBOOT_PREFIX}-${ubconf}.${UBOOT_SUFFIX}" >/dev/null; then
INSTALLER_FILELIST="${INSTALLER_FILELIST} ${DEPLOY_DIR_IMAGE}/${IMAGE_BOOTLOADER}-${ubconf}.${UBOOT_SUFFIX}"
fi
done