meta-digi: drop legacy SD card image support
Remove obsolete SD card image creation logic and related variables. We will use WIC images for bootable SD cards. https://onedigi.atlassian.net/browse/DEL-9768 Signed-off-by: Javier Viguera <javier.viguera@digi.com>
This commit is contained in:
parent
d98b875ea5
commit
3dfd6b77ef
|
|
@ -5,6 +5,9 @@ inherit image_types
|
|||
################################################################################
|
||||
BOOTLOADER_IMAGE_RECIPE ?= "u-boot"
|
||||
|
||||
# Boot partition size in KiB, (default 64MiB)
|
||||
BOARD_BOOTIMAGE_PARTITION_SIZE ?= "65536"
|
||||
|
||||
def TRUSTFENCE_BOOTIMAGE_DEPENDS(d):
|
||||
tf_initramfs = d.getVar('TRUSTFENCE_INITRAMFS_IMAGE') or ""
|
||||
return "%s:do_image_complete" % tf_initramfs if tf_initramfs else ""
|
||||
|
|
@ -263,95 +266,3 @@ rootfs_sign() {
|
|||
rootfs_sign[dirs] = "${DEPLOY_DIR_IMAGE}"
|
||||
|
||||
do_image_squashfs[vardeps] += "TRUSTFENCE_SIGN_KEYS_PATH TRUSTFENCE_KEY_INDEX"
|
||||
|
||||
################################################################################
|
||||
# SDCARD IMAGES #
|
||||
################################################################################
|
||||
# Set alignment to 4MB [in KiB]
|
||||
IMAGE_ROOTFS_ALIGNMENT = "4096"
|
||||
|
||||
# Boot partition size in KiB, (default 64MiB)
|
||||
BOARD_BOOTIMAGE_PARTITION_SIZE ??= "65536"
|
||||
|
||||
# SD card image name
|
||||
SDIMG = "${IMGDEPLOYDIR}/${IMAGE_NAME}.sdcard"
|
||||
|
||||
BOOTLOADER_SEEK_USERDATA ?= "1"
|
||||
|
||||
SDIMG_BOOTLOADER ?= "${DEPLOY_DIR_IMAGE}/${UBOOT_SYMLINK}"
|
||||
SDIMG_BOOTFS_TYPE ?= "boot.vfat"
|
||||
SDIMG_BOOTFS = "${IMGDEPLOYDIR}/${IMAGE_NAME}.${SDIMG_BOOTFS_TYPE}"
|
||||
SDIMG_ROOTFS_TYPE ?= "ext4"
|
||||
SDIMG_ROOTFS = "${IMGDEPLOYDIR}/${IMAGE_NAME}.${SDIMG_ROOTFS_TYPE}"
|
||||
|
||||
do_image_sdcard[depends] = " \
|
||||
dosfstools-native:do_populate_sysroot \
|
||||
mtools-native:do_populate_sysroot \
|
||||
parted-native:do_populate_sysroot \
|
||||
${BOOTLOADER_IMAGE_RECIPE}:do_deploy \
|
||||
virtual/kernel:do_deploy \
|
||||
"
|
||||
|
||||
#
|
||||
# Create an image that can be written onto an SD card using dd.
|
||||
#
|
||||
# The disk layout used is:
|
||||
#
|
||||
# 1. Not partitioned : reserved for bootloader (u-boot)
|
||||
# 2. BOOT PARTITION : kernel and device tree blobs
|
||||
# 3. ROOTFS PARTITION : rootfs
|
||||
#
|
||||
# 4MiB BOOT_SPACE ROOTFS_SIZE
|
||||
# <------------> <--------------------> <------------------------------>
|
||||
# +--------------+----------------------+--------------------------------+
|
||||
# | U-BOOT (RAW) | BOOT PARTITION (FAT) | ROOTFS PARTITION (EXT4) |
|
||||
# +--------------+----------------------+--------------------------------+
|
||||
# ^ ^ ^ ^
|
||||
# | | | |
|
||||
# 0 4MiB 4MiB + BOOT_SPACE SDIMG_SIZE
|
||||
#
|
||||
IMAGE_CMD:sdcard() {
|
||||
# Align boot partition and calculate total sdcard image size
|
||||
BOOT_SPACE_ALIGNED="$(expr \( \( ${BOARD_BOOTIMAGE_PARTITION_SIZE} + ${IMAGE_ROOTFS_ALIGNMENT} - 1 \) / ${IMAGE_ROOTFS_ALIGNMENT} \) \* ${IMAGE_ROOTFS_ALIGNMENT})"
|
||||
SDIMG_SIZE="$(expr ${IMAGE_ROOTFS_ALIGNMENT} + ${BOOT_SPACE_ALIGNED} + $ROOTFS_SIZE)"
|
||||
|
||||
# Initialize sdcard image file
|
||||
dd if=/dev/zero of=${SDIMG} bs=1024 count=0 seek=${SDIMG_SIZE}
|
||||
|
||||
# Create partition table, boot partition (with bootable flag) and rootfs partition (to the end of the disk)
|
||||
parted -s ${SDIMG} mklabel msdos
|
||||
parted -s ${SDIMG} unit KiB mkpart primary fat32 ${IMAGE_ROOTFS_ALIGNMENT} $(expr ${IMAGE_ROOTFS_ALIGNMENT} \+ ${BOOT_SPACE_ALIGNED})
|
||||
parted -s ${SDIMG} set 1 boot on
|
||||
parted -s ${SDIMG} -- unit KiB mkpart primary ext2 $(expr ${IMAGE_ROOTFS_ALIGNMENT} \+ ${BOOT_SPACE_ALIGNED}) -1s
|
||||
parted -s ${SDIMG} unit KiB print
|
||||
|
||||
# Set u-boot image to flash depending on whether TRUSTFENCE_SIGN is enabled
|
||||
if [ "${SWUPDATE_UBOOTIMG}" = "true" ]; then
|
||||
SDIMG_BOOT="$(readlink -e ${SDIMG_BOOTLOADER})"
|
||||
else
|
||||
if [ "${TRUSTFENCE_SIGN}" = "1" ]; then
|
||||
if [ "${BOOTLOADER_IMAGE_RECIPE}" = "u-boot" ]; then
|
||||
SDIMG_BOOT="$(readlink -e ${SDIMG_BOOTLOADER} | sed -e 's,u-boot-,u-boot-signed-,g')"
|
||||
else
|
||||
SDIMG_BOOT="$(readlink -e ${SDIMG_BOOTLOADER} | sed -e 's,imx-boot-,imx-boot-signed-,g')"
|
||||
fi
|
||||
else
|
||||
SDIMG_BOOT="$(readlink -e ${SDIMG_BOOTLOADER})"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Decompress rootfs image
|
||||
gzip -d -k ${SDIMG_ROOTFS}.gz
|
||||
|
||||
# Burn bootloader, boot and rootfs partitions
|
||||
dd if=${SDIMG_BOOT} of=${SDIMG} conv=notrunc,fsync seek=${BOOTLOADER_SEEK_USERDATA} bs=1K
|
||||
dd if=${SDIMG_BOOTFS} of=${SDIMG} conv=notrunc,fsync seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024)
|
||||
dd if=${SDIMG_ROOTFS} of=${SDIMG} conv=notrunc,fsync seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024 + ${BOOT_SPACE_ALIGNED} \* 1024)
|
||||
|
||||
# Delete the decompressed rootfs image
|
||||
rm -f ${SDIMG_ROOTFS}
|
||||
}
|
||||
|
||||
# The sdcard image requires the boot and rootfs images to be built before
|
||||
IMAGE_TYPEDEP:sdcard = "${SDIMG_BOOTFS_TYPE} ${SDIMG_ROOTFS_TYPE}.gz"
|
||||
|
||||
|
|
|
|||
|
|
@ -8,13 +8,9 @@ MACHINEOVERRIDES =. "mx8:mx8m:mx8mm:${DIGI_FAMILY}:${DIGI_SOM}:"
|
|||
# Include the machine configuration for Digi's ConnectCore 8M module.
|
||||
include conf/machine/include/ccimx8m.inc
|
||||
|
||||
BOOTLOADER_SEEK_USERDATA = "33"
|
||||
BOOTLOADER_SEEK_BOOTPART = "33"
|
||||
|
||||
# U-Boot configurations
|
||||
#
|
||||
# At the moment config label should be "machine" because SDIMG_BOOTLOADER
|
||||
# expects a boot artifact named after machine to create the sdcard image.
|
||||
UBOOT_CONFIG ??= "ccimx8mm-dvk"
|
||||
UBOOT_CONFIG[ccimx8mm-dvk] = "ccimx8mm_dvk_defconfig"
|
||||
SPL_BINARY = "spl/u-boot-spl.bin"
|
||||
|
|
|
|||
|
|
@ -8,12 +8,7 @@ MACHINEOVERRIDES =. "mx8:mx8m:mx8mn:${DIGI_FAMILY}:${DIGI_SOM}:"
|
|||
# Include the machine configuration for Digi's ConnectCore 8M module.
|
||||
include conf/machine/include/ccimx8m.inc
|
||||
|
||||
BOOTLOADER_SEEK_USERDATA = "32"
|
||||
|
||||
# U-Boot configurations
|
||||
#
|
||||
# At the moment config label should be "machine" because SDIMG_BOOTLOADER
|
||||
# expects a boot artifact named after machine to create the sdcard image.
|
||||
UBOOT_CONFIG ??= "ccimx8mn-dvk"
|
||||
UBOOT_CONFIG[ccimx8mn-dvk] = "ccimx8mn_dvk_defconfig"
|
||||
SPL_BINARY = "spl/u-boot-spl.bin"
|
||||
|
|
|
|||
|
|
@ -13,8 +13,6 @@ BOOTLOADER_SEEK_BOOTPART = "1"
|
|||
# Platform u-boot settings
|
||||
UBOOT_PREFIX = "u-boot"
|
||||
UBOOT_SUFFIX = "imx"
|
||||
BOOTABLE_FILENAME = "${UBOOT_PREFIX}-${MACHINE}.${UBOOT_SUFFIX}"
|
||||
SDIMG_BOOTLOADER = "${DEPLOY_DIR_IMAGE}/${BOOTABLE_FILENAME}"
|
||||
|
||||
# Set InitRAMDisk load address to U-boot initramfs_addr
|
||||
UBOOT_RD_LOADADDRESS = "0x19000000"
|
||||
|
|
|
|||
|
|
@ -14,8 +14,6 @@ UBOOT_SUFFIX = "bin"
|
|||
# The bootloader image that gets flashed consists of U-Boot and several fw binaries
|
||||
EXTRA_IMAGEDEPENDS += "imx-boot"
|
||||
BOOTLOADER_IMAGE_RECIPE = "imx-boot"
|
||||
BOOTABLE_FILENAME = "${UBOOT_PREFIX}-${MACHINE}.bin"
|
||||
SDIMG_BOOTLOADER = "${DEPLOY_DIR_IMAGE}/${BOOTABLE_FILENAME}"
|
||||
|
||||
# Set InitRAMDisk load address to U-boot initramfs_addr
|
||||
UBOOT_RD_LOADADDRESS = "0x43800000"
|
||||
|
|
|
|||
|
|
@ -19,10 +19,6 @@ UBOOT_RD_LOADADDRESS = "0x8A100000"
|
|||
# The bootloader image that gets flashed consists of U-Boot and several fw binaries
|
||||
EXTRA_IMAGEDEPENDS += "imx-boot"
|
||||
BOOTLOADER_IMAGE_RECIPE = "imx-boot"
|
||||
# BOOTLOADER_SEEK_USERDATA is 33 for step A of the silicon and 32 for step B
|
||||
BOOTLOADER_SEEK_USERDATA = "32"
|
||||
BOOTABLE_FILENAME = "${UBOOT_PREFIX}-${MACHINE}.bin"
|
||||
SDIMG_BOOTLOADER = "${DEPLOY_DIR_IMAGE}/${BOOTABLE_FILENAME}"
|
||||
|
||||
# The original variable used by NXP to store the mkimage "REV" parameter,
|
||||
# REV_OPTION, has a format of "REV=X0". Since we are interested in building
|
||||
|
|
|
|||
|
|
@ -26,9 +26,6 @@ KERNEL_IMAGETYPE:ccimx9 = "${@oe.utils.vartrue('TRUSTFENCE_SIGN_ARTIFACTS', 'fit
|
|||
# The bootloader image that gets flashed consists of U-Boot and several fw binaries
|
||||
EXTRA_IMAGEDEPENDS += "imx-boot"
|
||||
BOOTLOADER_IMAGE_RECIPE = "imx-boot"
|
||||
BOOTABLE_FILENAME = "${UBOOT_PREFIX}-${MACHINE}.bin"
|
||||
SDIMG_BOOTLOADER = "${DEPLOY_DIR_IMAGE}/${BOOTABLE_FILENAME}"
|
||||
BOOTLOADER_SEEK_USERDATA = "32"
|
||||
|
||||
MACHINE_FEATURES += "pci wifi bluetooth"
|
||||
MACHINE_FEATURES:append:use-nxp-bsp = " optee jailhouse"
|
||||
|
|
|
|||
|
|
@ -191,9 +191,6 @@ do_deploy:ccimx8x () {
|
|||
done
|
||||
cd ${DEPLOYDIR}
|
||||
ln -sf ${UBOOT_PREFIX}-${MACHINE}-${rev}.bin-${IMAGE_IMXBOOT_TARGET} ${UBOOT_PREFIX}-${MACHINE}-${rev}.bin
|
||||
# Link to default bootable U-Boot filename. It gets overwritten
|
||||
# on every loop so the only last RAM_CONFIG will survive.
|
||||
ln -sf ${UBOOT_PREFIX}-${MACHINE}-${rev}.bin-${IMAGE_IMXBOOT_TARGET} ${BOOTABLE_FILENAME}
|
||||
cd -
|
||||
done
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue