diff --git a/meta-lmp-base/classes/kernel-lmp-fitimage.bbclass b/meta-lmp-base/classes/kernel-lmp-fitimage.bbclass index b97434fe96..0ca0a9500c 100644 --- a/meta-lmp-base/classes/kernel-lmp-fitimage.bbclass +++ b/meta-lmp-base/classes/kernel-lmp-fitimage.bbclass @@ -1,18 +1,159 @@ -# Linux microPlatform extensions to the upstream OE-core kernel-fitimage class +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + +inherit kernel-uboot kernel-artifact-names uboot-config + +def get_fit_replacement_type(d): + kerneltypes = d.getVar('KERNEL_IMAGETYPES') or "" + replacementtype = "" + if 'fitImage' in kerneltypes.split(): + uarch = d.getVar("UBOOT_ARCH") + if uarch == "arm64": + replacementtype = "Image" + elif uarch == "riscv": + replacementtype = "Image" + elif uarch == "mips": + replacementtype = "vmlinuz.bin" + elif uarch == "x86": + replacementtype = "bzImage" + elif uarch == "microblaze": + replacementtype = "linux.bin" + else: + replacementtype = "zImage" + return replacementtype + +KERNEL_IMAGETYPE_REPLACEMENT ?= "${@get_fit_replacement_type(d)}" +DEPENDS:append = " ${@'u-boot-tools-native dtc-native' if 'fitImage' in (d.getVar('KERNEL_IMAGETYPES') or '').split() else ''}" -inherit kernel-fitimage +python __anonymous () { + # Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal + # to kernel.bbclass . We have to override it, since we pack zImage + # (at least for now) into the fitImage . + typeformake = d.getVar("KERNEL_IMAGETYPE_FOR_MAKE") or "" + if 'fitImage' in typeformake.split(): + d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake.replace('fitImage', d.getVar('KERNEL_IMAGETYPE_REPLACEMENT'))) + + image = d.getVar('INITRAMFS_IMAGE') + if image: + d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' ${INITRAMFS_IMAGE}:do_image_complete') + + ubootenv = d.getVar('UBOOT_ENV') + if ubootenv: + d.appendVarFlag('do_assemble_fitimage', 'depends', ' virtual/bootloader:do_populate_sysroot') + + #check if there are any dtb providers + providerdtb = d.getVar("PREFERRED_PROVIDER_virtual/dtb") + if providerdtb: + d.appendVarFlag('do_assemble_fitimage', 'depends', ' virtual/dtb:do_populate_sysroot') + d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' virtual/dtb:do_populate_sysroot') + d.setVar('EXTERNAL_KERNEL_DEVICETREE', "${RECIPE_SYSROOT}/boot/devicetree") +} # Default value for deployment filenames FIT_LOADABLES ?= "" -# Recovery -INITRAMFS_RECOVERY_IMAGE ?= "" -INITRAMFS_RECOVERY_IMAGE_NAME ?= "${@['${INITRAMFS_RECOVERY_IMAGE}-${MACHINE}', ''][d.getVar('INITRAMFS_RECOVERY_IMAGE') == '']}" +# Description string +FIT_DESC ?= "Kernel fitImage for ${DISTRO_NAME}/${PV}/${MACHINE}" -python __anonymous () { - recovery = d.getVar('INITRAMFS_RECOVERY_IMAGE') - if recovery: - d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' ${INITRAMFS_RECOVERY_IMAGE}:do_image_complete') +# Kernel fitImage Hash Algo +FIT_HASH_ALG ?= "sha256" + +# Kernel fitImage Signature Algo +FIT_SIGN_ALG ?= "rsa2048" + +# Kernel / U-Boot fitImage Padding Algo +FIT_PAD_ALG ?= "pkcs-1.5" + +# Generate keys for signing Kernel fitImage +FIT_GENERATE_KEYS ?= "0" + +# Size of private keys in number of bits +FIT_SIGN_NUMBITS ?= "2048" + +# args to openssl genrsa (Default is just the public exponent) +FIT_KEY_GENRSA_ARGS ?= "-F4" + +# args to openssl req (Default is -batch for non interactive mode and +# -new for new certificate) +FIT_KEY_REQ_ARGS ?= "-batch -new" + +# Standard format for public key certificate +FIT_KEY_SIGN_PKCS ?= "-x509" + +# Sign individual images as well +FIT_SIGN_INDIVIDUAL ?= "0" + +FIT_CONF_PREFIX ?= "conf-" +FIT_CONF_PREFIX[doc] = "Prefix to use for FIT configuration node name" + +FIT_SUPPORTED_INITRAMFS_FSTYPES ?= "cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.zst cpio.gz ext2.gz cpio" + +# Allow user to select the default DTB for FIT image when multiple dtb's exists. +FIT_CONF_DEFAULT_DTB ?= "" + +# length of address in number of cells +# ex: 1 32bits address, 2 64bits address +FIT_ADDRESS_CELLS ?= "1" + +# Keys used to sign individually image nodes. +# The keys to sign image nodes must be different from those used to sign +# configuration nodes, otherwise the "required" property, from +# UBOOT_DTB_BINARY, will be set to "conf", because "conf" prevails on "image". +# Then the images signature checking will not be mandatory and no error will be +# raised in case of failure. +# UBOOT_SIGN_IMG_KEYNAME = "dev2" # keys name in keydir (eg. "dev2.crt", "dev2.key") + +# +# Emit the fitImage ITS header +# +# $1 ... .its filename +fitimage_emit_fit_header() { + cat << EOF >> $1 +/dts-v1/; + +/ { + description = "${FIT_DESC}"; + #address-cells = <${FIT_ADDRESS_CELLS}>; +EOF +} + +# +# Emit the fitImage section bits +# +# $1 ... .its filename +# $2 ... Section bit type: imagestart - image section start +# confstart - configuration section start +# sectend - section end +# fitend - fitimage end +# +fitimage_emit_section_maint() { + case $2 in + imagestart) + cat << EOF >> $1 + + images { +EOF + ;; + confstart) + cat << EOF >> $1 + + configurations { +EOF + ;; + sectend) + cat << EOF >> $1 + }; +EOF + ;; + fitend) + cat << EOF >> $1 +}; +EOF + ;; + esac } # @@ -34,28 +175,28 @@ fitimage_emit_section_kernel() { awk '$3=="${UBOOT_ENTRYSYMBOL}" {print "0x"$1;exit}'` fi - cat << EOF >> ${1} - kernel-${2} { + cat << EOF >> $1 + kernel-$2 { description = "Linux kernel"; - data = /incbin/("${3}"); - type = "kernel"; + data = /incbin/("$3"); + type = "${UBOOT_MKIMAGE_KERNEL_TYPE}"; arch = "${UBOOT_ARCH}"; os = "linux"; - compression = "${4}"; + compression = "$4"; load = <${UBOOT_LOADADDRESS}>; - entry = <${ENTRYPOINT}>; + entry = <$ENTRYPOINT>; hash-1 { - algo = "${kernel_csum}"; + algo = "$kernel_csum"; }; }; EOF - if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${FIT_SIGN_INDIVIDUAL}" = "1" -a -n "${kernel_sign_keyname}" ] ; then - sed -i '$ d' ${1} - cat << EOF >> ${1} + if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${FIT_SIGN_INDIVIDUAL}" = "1" -a -n "$kernel_sign_keyname" ] ; then + sed -i '$ d' $1 + cat << EOF >> $1 signature-1 { - algo = "${kernel_csum},${kernel_sign_algo}"; - key-name-hint = "${kernel_sign_keyname}"; + algo = "$kernel_csum,$kernel_sign_algo"; + key-name-hint = "$kernel_sign_keyname"; }; }; EOF @@ -83,32 +224,33 @@ fitimage_emit_section_dtb() { elif [ -n "${UBOOT_DTB_LOADADDRESS}" ]; then dtb_loadline="load = <${UBOOT_DTB_LOADADDRESS}>;" fi - cat << EOF >> ${1} - fdt-${2} { + cat << EOF >> $1 + fdt-$2 { description = "Flattened Device Tree blob"; - data = /incbin/("${3}"); + data = /incbin/("$3"); type = "flat_dt"; arch = "${UBOOT_ARCH}"; compression = "none"; - ${dtb_loadline} + $dtb_loadline hash-1 { - algo = "${dtb_csum}"; + algo = "$dtb_csum"; }; }; EOF - if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${FIT_SIGN_INDIVIDUAL}" = "1" -a -n "${dtb_sign_keyname}" ] ; then - sed -i '$ d' ${1} - cat << EOF >> ${1} + if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${FIT_SIGN_INDIVIDUAL}" = "1" -a -n "$dtb_sign_keyname" ] ; then + sed -i '$ d' $1 + cat << EOF >> $1 signature-1 { - algo = "${dtb_csum},${dtb_sign_algo}"; - key-name-hint = "${dtb_sign_keyname}"; + algo = "$dtb_csum,$dtb_sign_algo"; + key-name-hint = "$dtb_sign_keyname"; }; }; EOF fi } +# # Emit the fitImage ITS u-boot script section # # $1 ... .its filename @@ -120,25 +262,25 @@ fitimage_emit_section_boot_script() { bootscr_sign_algo="${FIT_SIGN_ALG}" bootscr_sign_keyname="${UBOOT_SIGN_IMG_KEYNAME}" - cat << EOF >> ${1} - bootscr-${2} { + cat << EOF >> $1 + bootscr-$2 { description = "U-boot script"; - data = /incbin/("${3}"); + data = /incbin/("$3"); type = "script"; arch = "${UBOOT_ARCH}"; compression = "none"; hash-1 { - algo = "${bootscr_csum}"; + algo = "$bootscr_csum"; }; }; EOF - if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${FIT_SIGN_INDIVIDUAL}" = "1" -a -n "${bootscr_sign_keyname}" ] ; then - sed -i '$ d' ${1} - cat << EOF >> ${1} + if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${FIT_SIGN_INDIVIDUAL}" = "1" -a -n "$bootscr_sign_keyname" ] ; then + sed -i '$ d' $1 + cat << EOF >> $1 signature-1 { - algo = "${bootscr_csum},${bootscr_sign_algo}"; - key-name-hint = "${bootscr_sign_keyname}"; + algo = "$bootscr_csum,$bootscr_sign_algo"; + key-name-hint = "$bootscr_sign_keyname"; }; }; EOF @@ -155,10 +297,10 @@ fitimage_emit_section_setup() { setup_csum="${FIT_HASH_ALG}" - cat << EOF >> ${1} - setup-${2} { + cat << EOF >> $1 + setup-$2 { description = "Linux setup.bin"; - data = /incbin/("${3}"); + data = /incbin/("$3"); type = "x86_setup"; arch = "${UBOOT_ARCH}"; os = "linux"; @@ -166,7 +308,7 @@ fitimage_emit_section_setup() { load = <0x00090000>; entry = <0x00090000>; hash-1 { - algo = "${setup_csum}"; + algo = "$setup_csum"; }; }; EOF @@ -177,8 +319,7 @@ EOF # # $1 ... .its filename # $2 ... Image counter -# $3 ... Ramdisk image name -# $4 ... Path to ramdisk image +# $3 ... Path to ramdisk image fitimage_emit_section_ramdisk() { ramdisk_csum="${FIT_HASH_ALG}" @@ -194,34 +335,55 @@ fitimage_emit_section_ramdisk() { ramdisk_entryline="entry = <${UBOOT_RD_ENTRYPOINT}>;" fi - cat << EOF >> ${1} - ramdisk-${2} { - description = "${3}"; - data = /incbin/("${4}"); + cat << EOF >> $1 + ramdisk-$2 { + description = "${INITRAMFS_IMAGE}"; + data = /incbin/("$3"); type = "ramdisk"; arch = "${UBOOT_ARCH}"; os = "linux"; compression = "none"; - ${ramdisk_loadline} - ${ramdisk_entryline} + $ramdisk_loadline + $ramdisk_entryline hash-1 { - algo = "${ramdisk_csum}"; + algo = "$ramdisk_csum"; }; }; EOF - if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${FIT_SIGN_INDIVIDUAL}" = "1" -a -n "${ramdisk_sign_keyname}" ] ; then - sed -i '$ d' ${1} - cat << EOF >> ${1} + if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${FIT_SIGN_INDIVIDUAL}" = "1" -a -n "$ramdisk_sign_keyname" ] ; then + sed -i '$ d' $1 + cat << EOF >> $1 signature-1 { - algo = "${ramdisk_csum},${ramdisk_sign_algo}"; - key-name-hint = "${ramdisk_sign_keyname}"; + algo = "$ramdisk_csum,$ramdisk_sign_algo"; + key-name-hint = "$ramdisk_sign_keyname"; }; }; EOF fi } +# +# echoes symlink destination if it points below directory +# +# $1 ... file that's a potential symlink +# $2 ... expected parent directory +symlink_points_below() { + file="$2/$1" + dir=$2 + + if ! [ -L "$file" ]; then + return + fi + + realpath="$(realpath --relative-to=$dir $file)" + if [ -z "${realpath%%../*}" ]; then + return + fi + + echo "$realpath" +} + # # Emit the fitImage ITS configuration section # @@ -231,77 +393,97 @@ EOF # $4 ... ramdisk ID # $5 ... u-boot script ID # $6 ... config ID -# $7 ... loadable ID (LmP specific) -# $8 ... default flag +# $7 ... default flag +# $8 ... default DTB image name +# $9 ... loadable ID fitimage_emit_section_config() { conf_csum="${FIT_HASH_ALG}" conf_sign_algo="${FIT_SIGN_ALG}" + conf_padding_algo="${FIT_PAD_ALG}" if [ "${UBOOT_SIGN_ENABLE}" = "1" ] ; then conf_sign_keyname="${UBOOT_SIGN_KEYNAME}" fi - its_file="${1}" - kernel_id="${2}" - dtb_image="${3}" - ramdisk_id="${4}" - bootscr_id="${5}" - config_id="${6}" - loadable_id="${7}" - default_flag="${8}" + its_file="$1" + kernel_id="$2" + dtb_image="$3" + ramdisk_id="$4" + bootscr_id="$5" + config_id="$6" + default_flag="$7" + default_dtb_image="$8" + loadable_id="$9" # Test if we have any DTBs at all sep="" conf_desc="" - conf_node="conf-" + conf_node="${FIT_CONF_PREFIX}" kernel_line="" fdt_line="" ramdisk_line="" bootscr_line="" setup_line="" - loadable_line="" default_line="" + compatible_line="" + loadable_line="" + + dtb_image_sect=$(symlink_points_below $dtb_image "${EXTERNAL_KERNEL_DEVICETREE}") + if [ -z "$dtb_image_sect" ]; then + dtb_image_sect=$dtb_image + fi + + dtb_path="${EXTERNAL_KERNEL_DEVICETREE}/${dtb_image_sect}" + if [ -f "$dtb_path" ] || [ -L "$dtb_path" ]; then + compat=$(fdtget -t s "$dtb_path" / compatible | sed 's/ /", "/g') + if [ -n "$compat" ]; then + compatible_line="compatible = \"$compat\";" + fi + fi + + dtb_image=$(echo $dtb_image | tr '/' '_') + dtb_image_sect=$(echo "${dtb_image_sect}" | tr '/' '_') # conf node name is selected based on dtb ID if it is present, - # otherwise no index is used (differs from kernel-fitimage, which - # uses kernel ID, but then breaks current qemu boot.cmds) - if [ -n "${dtb_image}" ]; then - conf_node=$conf_node${dtb_image} + # otherwise its selected based on kernel ID + if [ -n "$dtb_image" ]; then + conf_node=$conf_node$dtb_image + else + conf_node=$conf_node$kernel_id fi - if [ -n "${kernel_id}" ]; then + if [ -n "$kernel_id" ]; then conf_desc="Linux kernel" sep=", " - kernel_line="kernel = \"kernel-${kernel_id}\";" + kernel_line="kernel = \"kernel-$kernel_id\";" fi - if [ -n "${dtb_image}" ]; then - conf_desc="${conf_desc}${sep}FDT blob" + if [ -n "$dtb_image" ]; then + conf_desc="$conf_desc${sep}FDT blob" sep=", " - fdt_line="fdt = \"fdt-${dtb_image}\";" + fdt_line="fdt = \"fdt-$dtb_image_sect\";" fi - if [ -n "${ramdisk_id}" ]; then - conf_desc="${conf_desc}${sep}ramdisk" + if [ -n "$ramdisk_id" ]; then + conf_desc="$conf_desc${sep}ramdisk" sep=", " - ramdisk_line="ramdisk = \"ramdisk-${ramdisk_id}\";" + ramdisk_line="ramdisk = \"ramdisk-$ramdisk_id\";" fi - if [ -n "${bootscr_id}" ]; then - conf_desc="${conf_desc}${sep}u-boot script" + if [ -n "$bootscr_id" ]; then + conf_desc="$conf_desc${sep}u-boot script" sep=", " - bootscr_line="bootscr = \"bootscr-${bootscr_id}\";" + bootscr_line="bootscr = \"bootscr-$bootscr_id\";" fi - if [ -n "${config_id}" ]; then - conf_desc="${conf_desc}${sep}setup" - sep=", " - setup_line="setup = \"setup-${config_id}\";" + if [ -n "$config_id" ]; then + conf_desc="$conf_desc${sep}setup" + setup_line="setup = \"setup-$config_id\";" fi - if [ -n "${loadable_id}" ]; then + if [ -n "$loadable_id" ]; then loadable_counter=0 - for LOADABLE in ${loadable_id}; do + for LOADABLE in $loadable_id; do if [ -e ${DEPLOY_DIR_IMAGE}/${LOADABLE} ]; then loadable_counter=`expr ${loadable_counter} + 1` if [ -z "${loadable_line}" ]; then @@ -312,85 +494,95 @@ fitimage_emit_section_config() { done fi - if [ "${default_flag}" = "1" ]; then - # default node is selected based on dtb ID if it is present - if [ -n "${dtb_image}" ]; then - default_line="default = \"conf-${dtb_image}\";" + if [ "$default_flag" = "1" ]; then + # default node is selected based on dtb ID if it is present, + # otherwise its selected based on kernel ID + if [ -n "$dtb_image" ]; then + # Select default node as user specified dtb when + # multiple dtb exists. + if [ -n "$default_dtb_image" ]; then + default_line="default = \"${FIT_CONF_PREFIX}$default_dtb_image\";" + else + default_line="default = \"${FIT_CONF_PREFIX}$dtb_image\";" + fi else - default_line="default = \"conf-\";" + default_line="default = \"${FIT_CONF_PREFIX}$kernel_id\";" fi fi - cat << EOF >> ${its_file} - ${default_line} + cat << EOF >> $its_file + $default_line $conf_node { - description = "${default_flag} ${conf_desc}"; - ${kernel_line} - ${fdt_line} - ${ramdisk_line} - ${bootscr_line} - ${setup_line} - ${loadable_line} + description = "$default_flag $conf_desc"; + $compatible_line + $kernel_line + $fdt_line + $ramdisk_line + $bootscr_line + $setup_line + $loadable_line hash-1 { - algo = "${conf_csum}"; + algo = "$conf_csum"; }; EOF - if [ ! -z "${conf_sign_keyname}" ] ; then + if [ -n "$conf_sign_keyname" ] ; then sign_line="sign-images = " sep="" - if [ -n "${kernel_id}" ]; then - sign_line="${sign_line}${sep}\"kernel\"" + if [ -n "$kernel_id" ]; then + sign_line="$sign_line${sep}\"kernel\"" sep=", " fi - if [ -n "${dtb_image}" ]; then - sign_line="${sign_line}${sep}\"fdt\"" + if [ -n "$dtb_image" ]; then + sign_line="$sign_line${sep}\"fdt\"" sep=", " fi - if [ -n "${ramdisk_id}" ]; then - sign_line="${sign_line}${sep}\"ramdisk\"" + if [ -n "$ramdisk_id" ]; then + sign_line="$sign_line${sep}\"ramdisk\"" sep=", " fi - if [ -n "${bootscr_id}" ]; then - sign_line="${sign_line}${sep}\"bootscr\"" + if [ -n "$bootscr_id" ]; then + sign_line="$sign_line${sep}\"bootscr\"" sep=", " fi - if [ -n "${config_id}" ]; then - sign_line="${sign_line}${sep}\"setup\"" + if [ -n "$config_id" ]; then + sign_line="$sign_line${sep}\"setup\"" fi - if [ -n "${loadable_id}" ]; then + if [ -n "$loadable_id" ]; then loadable_counter=0 - for LOADABLE in ${loadable_id}; do + for LOADABLE in $loadable_id; do if [ -e ${DEPLOY_DIR_IMAGE}/${LOADABLE} ]; then loadable_counter=`expr ${loadable_counter} + 1` - sign_line="${sign_line}${sep}\"loadable_${loadable_counter}\"" + sign_line="$sign_line${sep}\"loadable_${loadable_counter}\"" fi done fi - sign_line="${sign_line};" + sign_line="$sign_line;" - cat << EOF >> ${its_file} + cat << EOF >> $its_file signature-1 { - algo = "${conf_csum},${conf_sign_algo}"; - key-name-hint = "${conf_sign_keyname}"; - ${sign_line} + algo = "$conf_csum,$conf_sign_algo"; + key-name-hint = "$conf_sign_keyname"; + padding = "$conf_padding_algo"; + $sign_line }; EOF fi - cat << EOF >> ${its_file} + cat << EOF >> $its_file }; EOF } + # # Emit the fitImage ITS loadables section # @@ -401,10 +593,10 @@ fitimage_emit_section_loadable() { loadable_csum="${FIT_HASH_ALG}" - cat << EOF >> ${1} - loadable-${2} { + cat << EOF >> $1 + loadable-$2 { description = "Loadable"; - data = /incbin/("${3}"); + data = /incbin/("$3"); type = "loadable"; arch = "${UBOOT_ARCH}"; compression = "none"; @@ -414,54 +606,35 @@ fitimage_emit_section_loadable() { }; EOF } - # # Assemble fitImage # # $1 ... .its filename # $2 ... fitImage name # $3 ... include ramdisk -# $4 ... ramdisk name -# $5 ... ramdisk bundle flag fitimage_assemble() { kernelcount=1 dtbcount="" DTBS="" - ramdiskcount=${3} - ramdisk_image_name=${4} - ramdisk_bundle=${5} + ramdiskcount=$3 setupcount="" bootscr_id="" - rm -f ${1} arch/${ARCH}/boot/${2} + default_dtb_image="" + rm -f $1 arch/${ARCH}/boot/$2 - if [ ! -z "${UBOOT_SIGN_IMG_KEYNAME}" -a "${UBOOT_SIGN_KEYNAME}" = "${UBOOT_SIGN_IMG_KEYNAME}" ]; then + if [ -n "${UBOOT_SIGN_IMG_KEYNAME}" -a "${UBOOT_SIGN_KEYNAME}" = "${UBOOT_SIGN_IMG_KEYNAME}" ]; then bbfatal "Keys used to sign images and configuration nodes must be different." fi - fitimage_emit_fit_header ${1} + fitimage_emit_fit_header $1 # # Step 1: Prepare a kernel image section. # - fitimage_emit_section_maint ${1} imagestart + fitimage_emit_section_maint $1 imagestart uboot_prep_kimage - - if [ "${ramdisk_bundle}" = "1" ]; then - initramfs_bundle_path="arch/"${UBOOT_ARCH}"/boot/"${KERNEL_IMAGETYPE_REPLACEMENT}".initramfs" - if [ -e "${initramfs_bundle_path}" ]; then - - # - # Include the kernel/rootfs bundle. - # - - fitimage_emit_section_kernel ${1} "${kernelcount}" "${initramfs_bundle_path}" "${linux_comp}" - else - bbwarn "${initramfs_bundle_path} not found." - fi - else - fitimage_emit_section_kernel ${1} "${kernelcount}" linux.bin "${linux_comp}" - fi + fitimage_emit_section_kernel $1 $kernelcount linux.bin "$linux_comp" # # Step 2: Prepare a DTB image section @@ -470,9 +643,9 @@ fitimage_assemble() { if [ -n "${KERNEL_DEVICETREE}" ]; then dtbcount=1 for DTB in ${KERNEL_DEVICETREE}; do - if echo ${DTB} | grep -q '/dts/'; then - bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used." - DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'` + if echo $DTB | grep -q '/dts/'; then + bbwarn "$DTB contains the full path to the the dts file, but only the dtb name should be used." + DTB=`basename $DTB | sed 's,\.dts$,.dtb,g'` fi # Skip ${DTB} if it's also provided in ${EXTERNAL_KERNEL_DEVICETREE} @@ -480,26 +653,60 @@ fitimage_assemble() { continue fi - DTB_PATH="arch/${ARCH}/boot/dts/${DTB}" - if [ ! -e "${DTB_PATH}" ]; then - DTB_PATH="arch/${ARCH}/boot/${DTB}" + DTB_PATH="${KERNEL_OUTPUT_DIR}/dts/$DTB" + if [ ! -e "$DTB_PATH" ]; then + DTB_PATH="${KERNEL_OUTPUT_DIR}/$DTB" + fi + + # Strip off the path component from the filename + if "${@'false' if oe.types.boolean(d.getVar('KERNEL_DTBVENDORED')) else 'true'}"; then + DTB=`basename $DTB` fi - DTB=$(echo "${DTB}" | tr '/' '_') - DTBS="${DTBS} ${DTB}" - fitimage_emit_section_dtb ${1} ${DTB} ${DTB_PATH} + # Set the default dtb image if it exists in the devicetree. + if [ ${FIT_CONF_DEFAULT_DTB} = $DTB ];then + default_dtb_image=$(echo "$DTB" | tr '/' '_') + fi + + DTB=$(echo "$DTB" | tr '/' '_') + + # Skip DTB if we've picked it up previously + echo "$DTBS" | tr ' ' '\n' | grep -xq "$DTB" && continue + + DTBS="$DTBS $DTB" + DTB=$(echo $DTB | tr '/' '_') + fitimage_emit_section_dtb $1 $DTB $DTB_PATH done fi if [ -n "${EXTERNAL_KERNEL_DEVICETREE}" ]; then dtbcount=1 - for DTB in $(find "${EXTERNAL_KERNEL_DEVICETREE}" \( -name '*.dtb' -o -name '*.dtbo' \) -printf '%P\n' | sort); do - DTB=$(echo "${DTB}" | tr '/' '_') - DTBS="${DTBS} ${DTB}" - fitimage_emit_section_dtb ${1} ${DTB} "${EXTERNAL_KERNEL_DEVICETREE}/${DTB}" + for DTB in $(find "${EXTERNAL_KERNEL_DEVICETREE}" -name '*.dtb' -printf '%P\n' | sort) \ + $(find "${EXTERNAL_KERNEL_DEVICETREE}" -name '*.dtbo' -printf '%P\n' | sort); do + # Set the default dtb image if it exists in the devicetree. + if [ ${FIT_CONF_DEFAULT_DTB} = $DTB ];then + default_dtb_image=$(echo "$DTB" | tr '/' '_') + fi + + DTB=$(echo "$DTB" | tr '/' '_') + + # Skip DTB/DTBO if we've picked it up previously + echo "$DTBS" | tr ' ' '\n' | grep -xq "$DTB" && continue + + DTBS="$DTBS $DTB" + + # Also skip if a symlink. We'll later have each config section point at it + [ $(symlink_points_below $DTB "${EXTERNAL_KERNEL_DEVICETREE}") ] && continue + + DTB=$(echo $DTB | tr '/' '_') + fitimage_emit_section_dtb $1 $DTB "${EXTERNAL_KERNEL_DEVICETREE}/$DTB" done fi + if [ -n "${FIT_CONF_DEFAULT_DTB}" ] && [ -z $default_dtb_image ]; then + bbwarn "${FIT_CONF_DEFAULT_DTB} is not available in the list of device trees." + fi + # # Step 3: Prepare a u-boot script section # @@ -508,7 +715,7 @@ fitimage_assemble() { if [ -e "${STAGING_DIR_HOST}/boot/${UBOOT_ENV_BINARY}" ]; then cp ${STAGING_DIR_HOST}/boot/${UBOOT_ENV_BINARY} ${B} bootscr_id="${UBOOT_ENV_BINARY}" - fitimage_emit_section_boot_script ${1} "${bootscr_id}" ${UBOOT_ENV_BINARY} + fitimage_emit_section_boot_script $1 "$bootscr_id" ${UBOOT_ENV_BINARY} else bbwarn "${STAGING_DIR_HOST}/boot/${UBOOT_ENV_BINARY} not found." fi @@ -517,9 +724,9 @@ fitimage_assemble() { # # Step 4: Prepare a setup section. (For x86) # - if [ -e arch/${ARCH}/boot/setup.bin ]; then + if [ -e ${KERNEL_OUTPUT_DIR}/setup.bin ]; then setupcount=1 - fitimage_emit_section_setup ${1} "${setupcount}" arch/${ARCH}/boot/setup.bin + fitimage_emit_section_setup $1 $setupcount ${KERNEL_OUTPUT_DIR}/setup.bin fi # @@ -528,7 +735,7 @@ fitimage_assemble() { if [ -n "${FIT_LOADABLES}" ]; then for LOADABLE in ${FIT_LOADABLES}; do if [ -e ${DEPLOY_DIR_IMAGE}/${LOADABLE} ]; then - fitimage_emit_section_loadable ${1} "${LOADABLE}" ${DEPLOY_DIR_IMAGE}/${LOADABLE} + fitimage_emit_section_loadable $1 "${LOADABLE}" ${DEPLOY_DIR_IMAGE}/${LOADABLE} fi done fi @@ -536,30 +743,38 @@ fitimage_assemble() { # # Step 6: Prepare a ramdisk section. # - if [ "${ramdiskcount}" = "1" ] && [ "${ramdisk_bundle}" != "1" ]; then + if [ "x${ramdiskcount}" = "x1" ] && [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then # Find and use the first initramfs image archive type we find - for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.zst cpio.gz ext2.gz cpio; do - initramfs_path="${DEPLOY_DIR_IMAGE}/${ramdisk_image_name}.${img}" - echo "Using $initramfs_path" - if [ -e "${initramfs_path}" ]; then - fitimage_emit_section_ramdisk ${1} "${ramdiskcount}" "${ramdisk_image_name}" "${initramfs_path}" + found= + for img in ${FIT_SUPPORTED_INITRAMFS_FSTYPES}; do + initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.$img" + if [ -e "$initramfs_path" ]; then + bbnote "Found initramfs image: $initramfs_path" + found=true + fitimage_emit_section_ramdisk $1 "$ramdiskcount" "$initramfs_path" break + else + bbnote "Did not find initramfs image: $initramfs_path" fi done + + if [ -z "$found" ]; then + bbfatal "Could not find a valid initramfs type for ${INITRAMFS_IMAGE_NAME}, the supported types are: ${FIT_SUPPORTED_INITRAMFS_FSTYPES}" + fi fi - fitimage_emit_section_maint ${1} sectend + fitimage_emit_section_maint $1 sectend # Force the first Kernel and DTB in the default config kernelcount=1 - if [ -n "${dtbcount}" ]; then + if [ -n "$dtbcount" ]; then dtbcount=1 fi # # Step 7: Prepare a configurations section # - fitimage_emit_section_maint ${1} confstart + fitimage_emit_section_maint $1 confstart # kernel-fitimage.bbclass currently only supports a single kernel (no less or # more) to be added to the FIT image along with 0 or more device trees and @@ -570,85 +785,160 @@ fitimage_assemble() { # the default configuration to be used is based on the dtbcount. If there is # no dtb present than select the default configuation to be based on # the kernelcount. - if [ -n "${DTBS}" ]; then - dtb_idx=1 + if [ -n "$DTBS" ]; then + i=1 for DTB in ${DTBS}; do dtb_ext=${DTB##*.} - if [ "${dtb_ext}" = "dtbo" ]; then - fitimage_emit_section_config ${1} "" "${DTB}" "" "" "" "" "" "`expr ${dtb_idx} = ${dtbcount}`" + if [ "$dtb_ext" = "dtbo" ]; then + fitimage_emit_section_config $1 "" "$DTB" "" "$bootscr_id" "" "`expr $i = $dtbcount`" "$default_dtb_image" else - fitimage_emit_section_config ${1} "${kernelcount}" "${DTB}" "${ramdiskcount}" "${bootscr_id}" "${setupcount}" "${FIT_LOADABLES}" "`expr ${dtb_idx} = ${dtbcount}`" + fitimage_emit_section_config $1 $kernelcount "$DTB" "$ramdiskcount" "$bootscr_id" "$setupcount" "`expr $i = $dtbcount`" "$default_dtb_image" fi - dtb_idx=`expr ${dtb_idx} + 1` + i=`expr $i + 1` done - unset dtb_idx else defaultconfigcount=1 - fitimage_emit_section_config ${1} "${kernelcount}" "" "${ramdiskcount}" "${bootscr_id}" "${setupcount}" "${FIT_LOADABLES}" "${defaultconfigcount}" + fitimage_emit_section_config $1 $kernelcount "" "$ramdiskcount" "$bootscr_id" "$setupcount" $defaultconfigcount "$default_dtb_image" fi - fitimage_emit_section_maint ${1} sectend + fitimage_emit_section_maint $1 sectend - fitimage_emit_section_maint ${1} fitend + fitimage_emit_section_maint $1 fitend # - # Step 8: Assemble the image + # Step 7: Assemble the image # ${UBOOT_MKIMAGE} \ ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \ - -f ${1} \ - arch/${ARCH}/boot/${2} + -f $1 \ + ${KERNEL_OUTPUT_DIR}/$2 # - # Step 9: Sign the image and add public key to U-Boot dtb + # Step 8: Sign the image # - if [ "${UBOOT_SIGN_ENABLE}" = "1" ] ; then - add_key_to_u_boot="" - if [ -n "${UBOOT_DTB_BINARY}" ]; then - # The u-boot.dtb is a symlink to UBOOT_DTB_IMAGE, so we need copy - # both of them, and don't dereference the symlink. - cp -P ${STAGING_DATADIR}/u-boot*.dtb ${B} - add_key_to_u_boot="-K ${B}/${UBOOT_DTB_BINARY}" - fi + if [ "x${UBOOT_SIGN_ENABLE}" = "x1" ] ; then ${UBOOT_MKIMAGE_SIGN} \ ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \ -F -k "${UBOOT_SIGN_KEYDIR}" \ - $add_key_to_u_boot \ - -r arch/${ARCH}/boot/${2} \ + -r ${KERNEL_OUTPUT_DIR}/$2 \ ${UBOOT_MKIMAGE_SIGN_ARGS} fi } +do_assemble_fitimage() { + if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage"; then + cd ${B} + fitimage_assemble fit-image.its fitImage-none "" + if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then + ln -sf fitImage-none ${B}/${KERNEL_OUTPUT_DIR}/fitImage + fi + fi +} + +addtask assemble_fitimage before do_install after do_compile + +SYSROOT_DIRS:append = " /sysroot-only" +do_install:append() { + if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage" && \ + [ "${UBOOT_SIGN_ENABLE}" = "1" ]; then + install -D ${B}/${KERNEL_OUTPUT_DIR}/fitImage-none ${D}/sysroot-only/fitImage + fi +} + do_assemble_fitimage_initramfs() { - if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage" ; then + if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage" && \ + test -n "${INITRAMFS_IMAGE}" ; then cd ${B} - if test -n "${INITRAMFS_IMAGE}" ; then - if [ "${INITRAMFS_IMAGE_BUNDLE}" = "1" ]; then - fitimage_assemble fit-image-${INITRAMFS_IMAGE}.its fitImage "" "" ${INITRAMFS_IMAGE_BUNDLE} - else - fitimage_assemble fit-image-${INITRAMFS_IMAGE}.its fitImage-${INITRAMFS_IMAGE} 1 ${INITRAMFS_IMAGE_NAME} 0 - fi + if [ "${INITRAMFS_IMAGE_BUNDLE}" = "1" ]; then + fitimage_assemble fit-image-${INITRAMFS_IMAGE}.its fitImage-bundle "" + ln -sf fitImage-bundle ${B}/${KERNEL_OUTPUT_DIR}/fitImage + else + fitimage_assemble fit-image-${INITRAMFS_IMAGE}.its fitImage-${INITRAMFS_IMAGE} 1 fi + fi +} + +addtask assemble_fitimage_initramfs before do_deploy after do_bundle_initramfs + +do_kernel_generate_rsa_keys() { + if [ "${UBOOT_SIGN_ENABLE}" = "0" ] && [ "${FIT_GENERATE_KEYS}" = "1" ]; then + bbwarn "FIT_GENERATE_KEYS is set to 1 even though UBOOT_SIGN_ENABLE is set to 0. The keys will not be generated as they won't be used." + fi + + if [ "${UBOOT_SIGN_ENABLE}" = "1" ] && [ "${FIT_GENERATE_KEYS}" = "1" ]; then + + # Generate keys to sign configuration nodes, only if they don't already exist + if [ ! -f "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_KEYNAME}".key ] || \ + [ ! -f "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_KEYNAME}".crt ]; then + + # make directory if it does not already exist + mkdir -p "${UBOOT_SIGN_KEYDIR}" + + bbnote "Generating RSA private key for signing fitImage" + openssl genrsa ${FIT_KEY_GENRSA_ARGS} -out \ + "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_KEYNAME}".key \ + "${FIT_SIGN_NUMBITS}" - if test -n "${INITRAMFS_RECOVERY_IMAGE}" ; then - fitimage_assemble fit-image-${INITRAMFS_RECOVERY_IMAGE}.its fitImage-${INITRAMFS_RECOVERY_IMAGE} 1 ${INITRAMFS_RECOVERY_IMAGE_NAME} 0 + bbnote "Generating certificate for signing fitImage" + openssl req ${FIT_KEY_REQ_ARGS} "${FIT_KEY_SIGN_PKCS}" \ + -key "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_KEYNAME}".key \ + -out "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_KEYNAME}".crt fi - fi + + # Generate keys to sign image nodes, only if they don't already exist + if [ ! -f "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_IMG_KEYNAME}".key ] || \ + [ ! -f "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_IMG_KEYNAME}".crt ]; then + + # make directory if it does not already exist + mkdir -p "${UBOOT_SIGN_KEYDIR}" + + bbnote "Generating RSA private key for signing fitImage" + openssl genrsa ${FIT_KEY_GENRSA_ARGS} -out \ + "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_IMG_KEYNAME}".key \ + "${FIT_SIGN_NUMBITS}" + + bbnote "Generating certificate for signing fitImage" + openssl req ${FIT_KEY_REQ_ARGS} "${FIT_KEY_SIGN_PKCS}" \ + -key "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_IMG_KEYNAME}".key \ + -out "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_IMG_KEYNAME}".crt + fi + fi } +addtask kernel_generate_rsa_keys before do_assemble_fitimage after do_compile + +kernel_do_deploy[vardepsexclude] = "DATETIME" kernel_do_deploy:append() { + # Update deploy directory if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage"; then - if [ -n "${INITRAMFS_RECOVERY_IMAGE}" ]; then - bbnote "Copying fit-image-${INITRAMFS_RECOVERY_IMAGE}.its source file..." - install -m 0644 ${B}/fit-image-${INITRAMFS_RECOVERY_IMAGE}.its "$deployDir/fitImage-its-${INITRAMFS_RECOVERY_IMAGE_NAME}-${KERNEL_FIT_NAME}.its" + + if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then + bbnote "Copying fit-image.its source file..." + install -m 0644 ${B}/fit-image.its "$deployDir/fitImage-its-${KERNEL_FIT_NAME}.its" if [ -n "${KERNEL_FIT_LINK_NAME}" ] ; then - ln -snf fitImage-its-${INITRAMFS_RECOVERY_IMAGE_NAME}-${KERNEL_FIT_NAME}.its "$deployDir/fitImage-its-${INITRAMFS_RECOVERY_IMAGE_NAME}-${KERNEL_FIT_LINK_NAME}" + ln -snf fitImage-its-${KERNEL_FIT_NAME}.its "$deployDir/fitImage-its-${KERNEL_FIT_LINK_NAME}" fi - bbnote "Copying fitImage-${INITRAMFS_RECOVERY_IMAGE} file..." - install -m 0644 ${B}/arch/${ARCH}/boot/fitImage-${INITRAMFS_RECOVERY_IMAGE} "$deployDir/fitImage-${INITRAMFS_RECOVERY_IMAGE_NAME}-${KERNEL_FIT_NAME}${KERNEL_FIT_BIN_EXT}" + bbnote "Copying linux.bin file..." + install -m 0644 ${B}/linux.bin $deployDir/fitImage-linux.bin-${KERNEL_FIT_NAME}${KERNEL_FIT_BIN_EXT} if [ -n "${KERNEL_FIT_LINK_NAME}" ] ; then - ln -snf fitImage-${INITRAMFS_RECOVERY_IMAGE_NAME}-${KERNEL_FIT_NAME}${KERNEL_FIT_BIN_EXT} "$deployDir/fitImage-${INITRAMFS_RECOVERY_IMAGE_NAME}-${KERNEL_FIT_LINK_NAME}" + ln -snf fitImage-linux.bin-${KERNEL_FIT_NAME}${KERNEL_FIT_BIN_EXT} "$deployDir/fitImage-linux.bin-${KERNEL_FIT_LINK_NAME}" + fi + fi + + if [ -n "${INITRAMFS_IMAGE}" ]; then + bbnote "Copying fit-image-${INITRAMFS_IMAGE}.its source file..." + install -m 0644 ${B}/fit-image-${INITRAMFS_IMAGE}.its "$deployDir/fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.its" + if [ -n "${KERNEL_FIT_LINK_NAME}" ] ; then + ln -snf fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.its "$deployDir/fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_LINK_NAME}" + fi + + if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then + bbnote "Copying fitImage-${INITRAMFS_IMAGE} file..." + install -m 0644 ${B}/${KERNEL_OUTPUT_DIR}/fitImage-${INITRAMFS_IMAGE} "$deployDir/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}${KERNEL_FIT_BIN_EXT}" + if [ -n "${KERNEL_FIT_LINK_NAME}" ] ; then + ln -snf fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}${KERNEL_FIT_BIN_EXT} "$deployDir/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_LINK_NAME}" + fi fi fi fi diff --git a/meta-lmp-base/classes/lmp.bbclass b/meta-lmp-base/classes/lmp.bbclass index 98e3ce3e58..a5acb850af 100644 --- a/meta-lmp-base/classes/lmp.bbclass +++ b/meta-lmp-base/classes/lmp.bbclass @@ -201,23 +201,22 @@ IMAGE_CMD:ota-ext4:append () { if [ -z "${OSTREE_OTA_EXT4_LUKS_PASSPHRASE}" ]; then bbfatal "Unable to find passphrase for LUKS-based ota-ext4 (define OSTREE_OTA_EXT4_LUKS_PASSPHRASE)" fi - cp ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.ota-ext4 ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.ota-ext4-orig - block_size=`dumpe2fs -h ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.ota-ext4 | grep "^Block size" | cut -d ':' -f 2 | tr -d ' '` - block_count=`dumpe2fs -h ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.ota-ext4 | grep "^Block count" | cut -d ':' -f 2 | tr -d ' '` + block_size=`dumpe2fs -h ${IMGDEPLOYDIR}/${IMAGE_NAME}.ota-ext4 | grep "^Block size" | cut -d ':' -f 2 | tr -d ' '` + block_count=`dumpe2fs -h ${IMGDEPLOYDIR}/${IMAGE_NAME}.ota-ext4 | grep "^Block count" | cut -d ':' -f 2 | tr -d ' '` luks_size=33554432 # 32m new_block_count=$(expr ${block_count} - $(expr ${luks_size} / ${block_size})) bbdebug 1 "Rootfs: block size: $block_size, block count: $block_count" bbdebug 1 "Resizing Rootfs: old block count: $block_count, new block count: $new_block_count" - resize2fs -p ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.ota-ext4 ${new_block_count} + resize2fs -p ${IMGDEPLOYDIR}/${IMAGE_NAME}.ota-ext4 ${new_block_count} # Error codes 0-3 indicate successfull operation of fsck (no errors or errors corrected) - fsck.ext4 -pvfD ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.ota-ext4 || [ $? -le 3 ] + fsck.ext4 -pvfD ${IMGDEPLOYDIR}/${IMAGE_NAME}.ota-ext4 || [ $? -le 3 ] # After resize2fs we need to make sure the file size (simulating the block device) stays the same - dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.ota-ext4 seek=$ROOTFS_SIZE count=0 bs=1024 + dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}.ota-ext4 seek=$ROOTFS_SIZE count=0 bs=1024 - echo ${OSTREE_OTA_EXT4_LUKS_PASSPHRASE} | cryptsetup reencrypt --encrypt --key-slot 31 --pbkdf-memory ${OSTREE_OTA_EXT4_LUKS_PBKDF2_MEM} --disable-locks --reduce-device-size 32m ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.ota-ext4 - cryptsetup config --label otaroot ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.ota-ext4 - cryptsetup luksDump ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.ota-ext4 + echo ${OSTREE_OTA_EXT4_LUKS_PASSPHRASE} | cryptsetup reencrypt --encrypt --key-slot 31 --pbkdf-memory ${OSTREE_OTA_EXT4_LUKS_PBKDF2_MEM} --disable-locks --reduce-device-size 32m ${IMGDEPLOYDIR}/${IMAGE_NAME}.ota-ext4 + cryptsetup config --label otaroot ${IMGDEPLOYDIR}/${IMAGE_NAME}.ota-ext4 + cryptsetup luksDump ${IMGDEPLOYDIR}/${IMAGE_NAME}.ota-ext4 fi } OSTREE_OTA_EXT4_LUKS ?= "0" diff --git a/meta-lmp-base/classes/uboot-fitimage.bbclass b/meta-lmp-base/classes/uboot-fitimage.bbclass index 3ea9ec5965..4c81733990 100644 --- a/meta-lmp-base/classes/uboot-fitimage.bbclass +++ b/meta-lmp-base/classes/uboot-fitimage.bbclass @@ -126,7 +126,7 @@ uboot_fitimage_assemble() { # u-boot dtb location depends on sign enable if [ "${UBOOT_SIGN_ENABLE}" = "1" -a -n "${UBOOT_DTB_BINARY}" ]; then - uboot_dtb="${DEPLOY_DIR_IMAGE}/${UBOOT_DTB_IMAGE}" + uboot_dtb="${UBOOT_DTB_SIGNED}" else uboot_dtb="u-boot.dtb" fi diff --git a/meta-lmp-base/conf/distro/include/lmp.inc b/meta-lmp-base/conf/distro/include/lmp.inc index 3e56f31bb3..5f13456d00 100644 --- a/meta-lmp-base/conf/distro/include/lmp.inc +++ b/meta-lmp-base/conf/distro/include/lmp.inc @@ -1,4 +1,4 @@ -DISTRO_VERSION = "4.0.20" +DISTRO_VERSION = "5.0.4" # These default to 'oecore' and 'nodistro' SDK_NAME_PREFIX = "${DISTRO}" @@ -65,6 +65,7 @@ PACKAGECONFIG:remove:pn-cryptsetup = "ssh-token" PACKAGECONFIG:append:pn-cryptsetup = " luks2" PACKAGECONFIG:append:pn-cryptsetup-native = " luks2" PACKAGECONFIG:pn-tpm2-tss = "policy" +PACKAGECONFIG:append:pn-systemd = "${@bb.utils.contains('DISTRO_FEATURES', 'lmpdebug', ' coredump', '', d)}" # Alternatives used by nss-altfiles NSS_ALT_TYPES ?= "hosts,pwd,grp,spwd,sgrp" diff --git a/meta-lmp-base/dynamic-layers/meta-arm/recipes-bsp/uefi/edk2-firmware/0001-CryptoPkg-Increase-ScratchMemory-buffer-for-openssl-.patch b/meta-lmp-base/dynamic-layers/meta-arm/recipes-bsp/uefi/edk2-firmware/0001-CryptoPkg-Increase-ScratchMemory-buffer-for-openssl-.patch new file mode 100644 index 0000000000..e9595c10c3 --- /dev/null +++ b/meta-lmp-base/dynamic-layers/meta-arm/recipes-bsp/uefi/edk2-firmware/0001-CryptoPkg-Increase-ScratchMemory-buffer-for-openssl-.patch @@ -0,0 +1,41 @@ +From 46e407d9654d5c8986b0f7b61de3aa223b1df399 Mon Sep 17 00:00:00 2001 +From: Jorge Ramirez-Ortiz +Date: Thu, 31 Oct 2024 15:12:04 +0100 +Subject: [PATCH] CryptoPkg: Increase ScratchMemory buffer for openssl 3.0.15 + +Openssl 3.0.15 has a larger memory footprint. + +Updating from EDK 2022.2 (openssl 1.1.j) to 2024.2 (openssl 3.0.15) +causes our EFI provisioning application[1] to fail due to an out of +memory condition. + +On inspection, at the time of that fault, 2022.2 had an additional 900 +pages. This is why this patch proposes the increase of the ScratchMemory +buffer by that same ammount. + +[1] https://git.kernel.org/pub/scm/linux/kernel/git/jejb/efitools.git + +Upstream-Status: Submitted [https://github.com/tianocore/edk2/pull/6394] + +Signed-off-by: Jorge Ramirez-Ortiz +Signed-off-by: Jose Quaresma +--- + CryptoPkg/Library/BaseCryptLib/SysCall/RuntimeMemAllocation.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/RuntimeMemAllocation.c b/CryptoPkg/Library/BaseCryptLib/SysCall/RuntimeMemAllocation.c +index 0d2ca604ea..bb066f0dd0 100644 +--- a/CryptoPkg/Library/BaseCryptLib/SysCall/RuntimeMemAllocation.c ++++ b/CryptoPkg/Library/BaseCryptLib/SysCall/RuntimeMemAllocation.c +@@ -33,7 +33,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent + #define RT_PAGE_FREE 0x00000000 + #define RT_PAGE_USED 0x00000001 + +-#define MIN_REQUIRED_BLOCKS 600 ++#define MIN_REQUIRED_BLOCKS 1100 + + // + // Memory Page Table +-- +2.25.1 + diff --git a/meta-lmp-base/dynamic-layers/meta-arm/recipes-bsp/uefi/edk2-firmware_%.bbappend b/meta-lmp-base/dynamic-layers/meta-arm/recipes-bsp/uefi/edk2-firmware_%.bbappend index c81474e6a8..8146a83580 100644 --- a/meta-lmp-base/dynamic-layers/meta-arm/recipes-bsp/uefi/edk2-firmware_%.bbappend +++ b/meta-lmp-base/dynamic-layers/meta-arm/recipes-bsp/uefi/edk2-firmware_%.bbappend @@ -1,5 +1,9 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + do_install:append:qemuarm64-secureboot-ebbr() { install ${B}/Build/${EDK2_PLATFORM}/${EDK2_BUILD_MODE}_${EDK_COMPILER}/FV/QEMU*.fd ${D}/firmware/ # QEMU requires that the images be minimum of 64M in size truncate -s 64M ${D}/firmware/QEMU*.fd } + +SRC_URI += "file://0001-CryptoPkg-Increase-ScratchMemory-buffer-for-openssl-.patch" diff --git a/meta-lmp-base/recipes-bsp/efitools/efitools/lockdown.conf b/meta-lmp-base/recipes-bsp/efitools/efitools/lockdown.conf index 7a4e881d15..3ae8286b3b 100644 --- a/meta-lmp-base/recipes-bsp/efitools/efitools/lockdown.conf +++ b/meta-lmp-base/recipes-bsp/efitools/efitools/lockdown.conf @@ -1,2 +1,3 @@ title UEFI Secure Boot Provisioning efi /LockDown.efi +sort-key 99 diff --git a/meta-lmp-base/recipes-bsp/efitools/efitools/unlock.conf b/meta-lmp-base/recipes-bsp/efitools/efitools/unlock.conf index 0fa5acd9be..bdb72d90a5 100644 --- a/meta-lmp-base/recipes-bsp/efitools/efitools/unlock.conf +++ b/meta-lmp-base/recipes-bsp/efitools/efitools/unlock.conf @@ -1,2 +1,3 @@ title UEFI Secure Boot PK Clear efi /UnLock-signed.efi +sort-key 99 \ No newline at end of file diff --git a/meta-lmp-base/recipes-bsp/u-boot/u-boot-fio-mfgtool/lmp-base-common.cfg b/meta-lmp-base/recipes-bsp/u-boot/u-boot-fio-mfgtool/lmp-base-common.cfg new file mode 100644 index 0000000000..f1e779055c --- /dev/null +++ b/meta-lmp-base/recipes-bsp/u-boot/u-boot-fio-mfgtool/lmp-base-common.cfg @@ -0,0 +1,106 @@ +# CONFIG_ANDROID_BOOT_IMAGE is not set +CONFIG_BOOTCOMMAND="reset" +CONFIG_BOOTDELAY=-2 +# CONFIG_BOOTM_NETBSD is not set +# CONFIG_BOOTM_PLAN9 is not set +# CONFIG_BOOTM_RTEMS is not set +# CONFIG_BOOTM_VXWORKS is not set +# CONFIG_CMD_BDI is not set +# CONFIG_CMD_BMODE is not set +# CONFIG_CMD_BOOTD is not set +# CONFIG_CMD_BOOTP is not set +# CONFIG_CMD_BOOTZ is not set +# CONFIG_CMD_DEKBLOB is not set +# CONFIG_CMD_DFU is not set +# CONFIG_CMD_DHCP is not set +# CONFIG_CMD_EDITENV is not set +# CONFIG_CMD_ELF is not set +# CONFIG_CMD_EXPORTENV is not set +CONFIG_CMD_FIOVB=y +# CONFIG_CMD_FLASH is not set +# CONFIG_CMD_GETTIME is not set +# CONFIG_CMD_IMI is not set +# CONFIG_CMD_IMPORTENV is not set +# CONFIG_CMD_LOADB is not set +# CONFIG_CMD_LOADS is not set +# CONFIG_CMD_NET is not set +# CONFIG_CMD_NFS is not set +# CONFIG_CMD_POWEROFF is not set +# CONFIG_CMD_PXE is not set +# CONFIG_CMD_RTC is not set +# CONFIG_CMD_SATA is not set +# CONFIG_CMD_SAVEENV is not set +# CONFIG_CMD_SNTP is not set +# CONFIG_CMD_SYSBOOT is not set +# CONFIG_CMD_TFTPBOOT is not set +# CONFIG_CMD_TIME is not set +# CONFIG_CMD_TIMER is not set +# CONFIG_CMD_USB_MASS_STORAGE is not set +CONFIG_CMD_XIMG=y +# CONFIG_DFU is not set +# CONFIG_DISTRO_DEFAULTS is not set +# CONFIG_DM_SCSI is not set +CONFIG_DM_USB=y +# CONFIG_DM_VIDEO is not set +# CONFIG_DWC_AHSATA is not set +# CONFIG_EFI_LOADER is not set +# CONFIG_ENV_IS_IN_MMC is not set +# CONFIG_ENV_IS_IN_SPI_FLASH is not set +CONFIG_ENV_IS_NOWHERE=y +CONFIG_FASTBOOT_FLASH=y +CONFIG_FASTBOOT_UUU_SUPPORT=y +CONFIG_FIOVB=y +CONFIG_FIT_SIGNATURE_STRICT=y +CONFIG_FIT_VERBOSE=y +CONFIG_FIT=y +CONFIG_FSL_FASTBOOT_BOOTLOADER2=y +CONFIG_FSL_FASTBOOT_BOOTLOADER_SECONDARY=y +CONFIG_HASH=y +# CONFIG_WATCHDOG is not set +# CONFIG_IMX_WATCHDOG is not set +# CONFIG_LEGACY_IMAGE_FORMAT is not set +# CONFIG_NET is not set +CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_OPTEE_LIB=y +CONFIG_OPTEE=y +CONFIG_PARTITION_UUIDS=y +CONFIG_RSA=y +# CONFIG_SATA is not set +# CONFIG_SHA_HW_ACCEL is not set +# CONFIG_SPL_BLK is not set +CONFIG_SPL_CRYPTO=y +# CONFIG_SPL_DM_USB is not set +CONFIG_SPL_DM=y +# CONFIG_SPL_DOS_PARTITION is not set +# CONFIG_SPL_EFI_PARTITION is not set +# CONFIG_SPL_FIT_IMAGE_TINY is not set +CONFIG_SPL_FIT_SIGNATURE_STRICT=y +CONFIG_SPL_FIT_SIGNATURE=y +CONFIG_SPL_FIT=y +CONFIG_SPL_HASH=y +# CONFIG_SPL_IMX_HAB is not set +# CONFIG_SPL_LEGACY_IMAGE_FORMAT is not set +# CONFIG_SPL_LEGACY_IMAGE_SUPPORT is not set +CONFIG_SPL_LOAD_FIT=y +# CONFIG_SPL_MMC is not set +CONFIG_SPL_OF_CONTROL=y +# CONFIG_SPL_PARTITION_UUIDS is not set +CONFIG_SPL_SHA256=y +CONFIG_SPL_USB_GADGET=y +CONFIG_SPL_USB_SDP_SUPPORT=y +CONFIG_SUPPORT_EMMC_BOOT=y +CONFIG_SUPPORT_EMMC_RPMB=y +CONFIG_TEE=y +CONFIG_USB_FUNCTION_FASTBOOT=y +CONFIG_USB_GADGET_MANUFACTURER="FSL" +CONFIG_USB_GADGET_MASS_STORAGE=y +CONFIG_USB_GADGET_PRODUCT_NUM=0x0152 +CONFIG_USB_GADGET_VENDOR_NUM=0x1fc9 +# CONFIG_USB_HOST_ETHER is not set +# CONFIG_USB_KEYBOARD is not set +# CONFIG_USB_STORAGE is not set +CONFIG_USB=y +CONFIG_USE_BOOTCOMMAND=y +# CONFIG_VIDEO is not set +# CONFIG_BOOTSTD is not set +CONFIG_SHA256=y diff --git a/meta-lmp-base/recipes-bsp/u-boot/u-boot-fio-mfgtool/lmp-base.cfg b/meta-lmp-base/recipes-bsp/u-boot/u-boot-fio-mfgtool/lmp-base.cfg new file mode 100644 index 0000000000..e69de29bb2 diff --git a/meta-lmp-base/recipes-bsp/u-boot/u-boot-fio-mfgtool_2023.04.bb b/meta-lmp-base/recipes-bsp/u-boot/u-boot-fio-mfgtool_2024.04.bb similarity index 84% rename from meta-lmp-base/recipes-bsp/u-boot/u-boot-fio-mfgtool_2023.04.bb rename to meta-lmp-base/recipes-bsp/u-boot/u-boot-fio-mfgtool_2024.04.bb index 45684f5d6c..0adc55ba55 100644 --- a/meta-lmp-base/recipes-bsp/u-boot/u-boot-fio-mfgtool_2023.04.bb +++ b/meta-lmp-base/recipes-bsp/u-boot/u-boot-fio-mfgtool_2024.04.bb @@ -2,7 +2,7 @@ SUMMARY = "Produces a Manufacturing Tool compatible U-Boot" DESCRIPTION = "U-Boot recipe that produces a Manufacturing Tool compatible \ binary to be used in updater environment" -require recipes-bsp/u-boot/u-boot-fio_2023.04.bb +require recipes-bsp/u-boot/u-boot-fio_${PV}.bb # Environment config is not required for mfgtool SRC_URI:remove = "file://fw_env.config" diff --git a/meta-lmp-base/recipes-bsp/u-boot/u-boot-fio_2023.04.bb b/meta-lmp-base/recipes-bsp/u-boot/u-boot-fio_2024.04.bb similarity index 58% rename from meta-lmp-base/recipes-bsp/u-boot/u-boot-fio_2023.04.bb rename to meta-lmp-base/recipes-bsp/u-boot/u-boot-fio_2024.04.bb index 8a1996a52b..a9df5f5524 100644 --- a/meta-lmp-base/recipes-bsp/u-boot/u-boot-fio_2023.04.bb +++ b/meta-lmp-base/recipes-bsp/u-boot/u-boot-fio_2024.04.bb @@ -1,5 +1,5 @@ require u-boot-fio-common.inc -SRCREV = "349b9c93a6f7218d7988caab249f4ad1196f3c30" -SRCBRANCH = "2023.04+fio" +SRCREV = "30cd2b39fb4989dc0e4c69bc5c73b1f169951bf1" +SRCBRANCH = "2024.04+fio" LIC_FILES_CHKSUM = "file://Licenses/README;md5=2ca5f2c35c8cc335f0a19756634782f1" diff --git a/meta-lmp-base/recipes-bsp/u-boot/u-boot-fio_imx-2022.04.bb b/meta-lmp-base/recipes-bsp/u-boot/u-boot-fio_imx-2022.04.bb index d80761d9db..35b58cc87f 100644 --- a/meta-lmp-base/recipes-bsp/u-boot/u-boot-fio_imx-2022.04.bb +++ b/meta-lmp-base/recipes-bsp/u-boot/u-boot-fio_imx-2022.04.bb @@ -1,5 +1,10 @@ require u-boot-fio-common.inc +UUU_BOOTLOADER = "uuu_bootloader_tag" +UUU_BOOTLOADER:mx8-generic-bsp = "" +UUU_BOOTLOADER:mx9-generic-bsp = "" +inherit_defer ${UUU_BOOTLOADER} + SRCREV = "605d0aa5c016915058c7b19051f76d592e103b32" SRCBRANCH = "2022.04+lf-6.1.1-1.0.0-fio" LIC_FILES_CHKSUM = "file://Licenses/README;md5=5a7450c57ffe5ae63fd732446b988025" diff --git a/meta-lmp-base/recipes-bsp/u-boot/u-boot-fio_imx-2023.04.bb b/meta-lmp-base/recipes-bsp/u-boot/u-boot-fio_imx-2023.04.bb index 8e6d009f52..ec664ce356 100644 --- a/meta-lmp-base/recipes-bsp/u-boot/u-boot-fio_imx-2023.04.bb +++ b/meta-lmp-base/recipes-bsp/u-boot/u-boot-fio_imx-2023.04.bb @@ -1,5 +1,10 @@ require u-boot-fio-common.inc +UUU_BOOTLOADER = "uuu_bootloader_tag" +UUU_BOOTLOADER:mx8-generic-bsp = "" +UUU_BOOTLOADER:mx9-generic-bsp = "" +inherit_defer ${UUU_BOOTLOADER} + SRCREV = "d5bf13df210018527f8b0c136ce0b8be6b0d76f5" SRCBRANCH = "2023.04+lf-6.1.55-2.2.0-fio" LIC_FILES_CHKSUM = "file://Licenses/README;md5=2ca5f2c35c8cc335f0a19756634782f1" diff --git a/meta-lmp-base/recipes-core/systemd/systemd/systemd-networkd-wait-online.service.in-use-any-by-d.patch b/meta-lmp-base/recipes-core/systemd/systemd/systemd-networkd-wait-online.service.in-use-any-by-d.patch index c10d0f2d09..b432ecc7d1 100644 --- a/meta-lmp-base/recipes-core/systemd/systemd/systemd-networkd-wait-online.service.in-use-any-by-d.patch +++ b/meta-lmp-base/recipes-core/systemd/systemd/systemd-networkd-wait-online.service.in-use-any-by-d.patch @@ -1,4 +1,4 @@ -From 42a417bfb62227d83bbcc1232ced1d0ddb0431d6 Mon Sep 17 00:00:00 2001 +From cb1df2c39effacd4ec86a06b3b9fcafaceb38814 Mon Sep 17 00:00:00 2001 From: Ricardo Salveti Date: Tue, 2 Jul 2019 21:01:15 -0300 Subject: [PATCH] systemd-networkd-wait-online.service.in: use --any by default @@ -10,23 +10,24 @@ in the configured state. Upstream-Status: Inappropriate [lmp specific] Signed-off-by: Ricardo Salveti +Signed-off-by: Jose Quaresma --- units/systemd-networkd-wait-online.service.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/units/systemd-networkd-wait-online.service.in b/units/systemd-networkd-wait-online.service.in -index 10d8b08c8e..6dd5f79377 100644 +index 7768121f5f..7d26e04fe3 100644 --- a/units/systemd-networkd-wait-online.service.in +++ b/units/systemd-networkd-wait-online.service.in -@@ -18,7 +18,7 @@ Before=network-online.target shutdown.target +@@ -19,7 +19,7 @@ Before=network-online.target shutdown.target [Service] Type=oneshot --ExecStart={{ROOTLIBEXECDIR}}/systemd-networkd-wait-online -+ExecStart={{ROOTLIBEXECDIR}}/systemd-networkd-wait-online --any +-ExecStart={{LIBEXECDIR}}/systemd-networkd-wait-online ++ExecStart={{LIBEXECDIR}}/systemd-networkd-wait-online --any RemainAfterExit=yes [Install] -- -2.25.1 +2.47.0 diff --git a/meta-lmp-base/recipes-core/systemd/systemd/systemd-timesyncd-update.service b/meta-lmp-base/recipes-core/systemd/systemd/systemd-timesyncd-update.service deleted file mode 100644 index 28624c2c26..0000000000 --- a/meta-lmp-base/recipes-core/systemd/systemd/systemd-timesyncd-update.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Systemd Timesync Update Fixes -After=local-fs.target -Before=systemd-timesyncd.service -DefaultDependencies=no - -[Service] -ExecStart=/bin/sh -c 'if [ -L /var/lib/systemd/timesync ]; then /bin/rm -fv /var/lib/systemd/timesync && /bin/mv /var/lib/private/systemd/timesync /var/lib/systemd/timesync; fi' - -[Install] -WantedBy=sysinit.target diff --git a/meta-lmp-base/recipes-core/systemd/systemd_%.bbappend b/meta-lmp-base/recipes-core/systemd/systemd_%.bbappend index 9fbaf82082..a510f36e36 100644 --- a/meta-lmp-base/recipes-core/systemd/systemd_%.bbappend +++ b/meta-lmp-base/recipes-core/systemd/systemd_%.bbappend @@ -55,7 +55,6 @@ EXTRA_OEMESON += ' \ SRC_URI:append = " \ file://0001-tmpfiles-tmp.conf-reduce-cleanup-age-to-half.patch \ file://systemd-networkd-wait-online.service.in-use-any-by-d.patch \ - file://systemd-timesyncd-update.service \ " # Depend on systemd-boot as the efi payload is provided by a different recipe @@ -76,10 +75,6 @@ do_install:append() { (cd ${D}${localstatedir}; rmdir -v --parents log/journal) fi - # Workaround for https://github.com/systemd/systemd/issues/11329 - install -m 0644 ${WORKDIR}/systemd-timesyncd-update.service ${D}${systemd_system_unitdir} - ln -sf ../systemd-timesyncd-update.service ${D}${systemd_system_unitdir}/sysinit.target.wants/systemd-timesyncd-update.service - # Remove systemd-boot as it is provided by a separated recipe and we can't disable via pkgconfig if ${@bb.utils.contains('PACKAGECONFIG', 'efi', 'true', 'false', d)}; then rm -r ${D}${nonarch_libdir}/systemd/boot diff --git a/meta-lmp-base/recipes-extended/ostree/ostree/0006-Add-support-systemd-boot-automatic-boot-assesment.patch b/meta-lmp-base/recipes-extended/ostree/ostree/0006-Add-support-systemd-boot-automatic-boot-assesment.patch new file mode 100644 index 0000000000..331f0327ec --- /dev/null +++ b/meta-lmp-base/recipes-extended/ostree/ostree/0006-Add-support-systemd-boot-automatic-boot-assesment.patch @@ -0,0 +1,148 @@ +From a9e35b76fd5e47b9bc29a7113d97a4d98a973e75 Mon Sep 17 00:00:00 2001 +From: Igor Opaniuk +Date: Wed, 11 Sep 2024 18:03:10 +0200 +Subject: [PATCH] Add support systemd-boot automatic boot assesment + +Add support for Automatic Boot Assessment [1]. +Boot entries are now created with an additional suffix, which +represents the amount of maximum tries for boot counting. + +[1] https://systemd.io/AUTOMATIC_BOOT_ASSESSMENT/ +Upstream-Status: Inappropriate [lmp specific] +Signed-off-by: Igor Opaniuk +--- + src/libostree/ostree-sysroot-deploy.c | 66 +++++++++++++++++++++++---- + 1 file changed, 58 insertions(+), 8 deletions(-) + +diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c +index 99c894a..f9c496d 100644 +--- a/src/libostree/ostree-sysroot-deploy.c ++++ b/src/libostree/ostree-sysroot-deploy.c +@@ -62,6 +62,8 @@ + SD_ID128_MAKE (e8, 64, 6c, d6, 3d, ff, 46, 25, b7, 79, 09, a8, e7, a4, 09, 94) + #endif + ++#define SYSTEMD_BOOT_MAX_RETRIES 3 ++ + /* How much additional space we require available on top of what we accounted + * during the early prune fallocate space check. This accounts for anything not + * captured directly by `get_kernel_layout_size()` like writing new BLS entries. +@@ -1907,12 +1909,12 @@ parse_os_release (const char *contents, const char *split) + return ret; + } + +-/* Generate the filename we will use in /boot/loader/entries for this deployment. ++/* Generate the entry name we will use in /boot/loader/entries for this deployment. + * The provided n_deployments should be the total number of target deployments (which + * might be different from the cached value in the sysroot). + */ + static char * +-bootloader_entry_filename (OstreeSysroot *sysroot, guint n_deployments, ++bootloader_entry_name (OstreeSysroot *sysroot, guint n_deployments, + OstreeDeployment *deployment) + { + guint index = n_deployments - ostree_deployment_get_index (deployment); +@@ -1923,14 +1925,52 @@ bootloader_entry_filename (OstreeSysroot *sysroot, guint n_deployments, + if (use_old_naming) + { + const char *stateroot = ostree_deployment_get_osname (deployment); +- return g_strdup_printf ("ostree-%d-%s.conf", index, stateroot); ++ return g_strdup_printf ("ostree-%d-%s", index, stateroot); + } + else + { +- return g_strdup_printf ("ostree-%d.conf", index); ++ return g_strdup_printf ("ostree-%d", index); + } + } + ++/* Drop all temporary entries in /boot/loader/entries for this deployment, ++ * which were created during automatic boot assesment ++ * https://systemd.io/AUTOMATIC_BOOT_ASSESSMENT/ ++ */ ++static gboolean ++bootloader_remove_tmp_entries (int dfd, const char *entry_name, GCancellable *cancellable, ++ GError **error) ++{ ++ g_auto(GLnxDirFdIterator) dfd_iter = { 0, }; ++ g_autofree char *entry_name_init = g_strdup_printf ("%s+%d", entry_name, SYSTEMD_BOOT_MAX_RETRIES); ++ ++ if (!glnx_dirfd_iterator_init_at (dfd, ".", FALSE, &dfd_iter, error)) ++ return FALSE; ++ ++ while (TRUE) ++ { ++ struct dirent *dent = NULL; ++ ++ if (!glnx_dirfd_iterator_next_dent_ensure_dtype (&dfd_iter, &dent, cancellable, error)) ++ return FALSE; ++ if (dent == NULL) ++ break; ++ ++ /* Don't remove default boot entry (with +3 suffix) */ ++ if (g_str_has_prefix (dent->d_name, entry_name_init)) ++ continue; ++ ++ if (g_str_has_prefix (dent->d_name, entry_name)) ++ { ++ if (!glnx_shutil_rm_rf_at (dfd_iter.fd, dent->d_name, cancellable, error)) ++ return FALSE; ++ } ++ ++ } ++ ++ return TRUE; ++} ++ + /* Given @deployment, prepare it to be booted; basically copying its + * kernel/initramfs into /boot/ostree (if needed) and writing out an entry in + * /boot/loader/entries. +@@ -1966,7 +2006,7 @@ install_deployment_kernel (OstreeSysroot *sysroot, int new_bootversion, + const char *bootcsum = ostree_deployment_get_bootcsum (deployment); + g_autofree char *bootcsumdir = g_strdup_printf ("ostree/%s-%s", osname, bootcsum); + g_autofree char *bootconfdir = g_strdup_printf ("loader.%d/entries", new_bootversion); +- g_autofree char *bootconf_name = bootloader_entry_filename (sysroot, n_deployments, deployment); ++ g_autofree char *bootconf_name = bootloader_entry_name (sysroot, n_deployments, deployment); + + if (!glnx_shutil_mkdir_p_at (sysroot->boot_fd, bootcsumdir, 0775, cancellable, error)) + return FALSE; +@@ -2348,8 +2388,13 @@ install_deployment_kernel (OstreeSysroot *sysroot, int new_bootversion, + if (!glnx_opendirat (sysroot->boot_fd, bootconfdir, TRUE, &bootconf_dfd, error)) + return FALSE; + ++ g_autofree char *bootconf_filename = g_strdup_printf ("%s+%d.conf", bootconf_name, SYSTEMD_BOOT_MAX_RETRIES); ++ ++ if (!bootloader_remove_tmp_entries(bootconf_dfd, bootconf_name, cancellable, error)) ++ return FALSE; ++ + if (!ostree_bootconfig_parser_write_at (ostree_deployment_get_bootconfig (deployment), +- bootconf_dfd, bootconf_name, cancellable, error)) ++ bootconf_dfd, bootconf_filename, cancellable, error)) + return FALSE; + + return TRUE; +@@ -4464,14 +4509,19 @@ ostree_sysroot_deployment_set_kargs_in_place (OstreeSysroot *self, OstreeDeploym + ostree_bootconfig_parser_set (new_bootconfig, "options", kargs_str); + + g_autofree char *bootconf_name +- = bootloader_entry_filename (self, self->deployments->len, deployment); ++ = bootloader_entry_name (self, self->deployments->len, deployment); + + g_autofree char *bootconfdir = g_strdup_printf ("loader.%d/entries", self->bootversion); + glnx_autofd int bootconf_dfd = -1; + if (!glnx_opendirat (self->boot_fd, bootconfdir, TRUE, &bootconf_dfd, error)) + return FALSE; + +- if (!ostree_bootconfig_parser_write_at (new_bootconfig, bootconf_dfd, bootconf_name, ++ g_autofree char *bootconf_filename = g_strdup_printf ("%s+%d.conf", bootconf_name, SYSTEMD_BOOT_MAX_RETRIES); ++ ++ if (!bootloader_remove_tmp_entries(bootconf_dfd, bootconf_name, cancellable, error)) ++ return FALSE; ++ ++ if (!ostree_bootconfig_parser_write_at (new_bootconfig, bootconf_dfd, bootconf_filename, + cancellable, error)) + return FALSE; + } +-- +2.34.1 + diff --git a/meta-lmp-base/recipes-extended/ostree/ostree/0007-sort-key.patch b/meta-lmp-base/recipes-extended/ostree/ostree/0007-sort-key.patch new file mode 100644 index 0000000000..3fa5a4c419 --- /dev/null +++ b/meta-lmp-base/recipes-extended/ostree/ostree/0007-sort-key.patch @@ -0,0 +1,46 @@ +From 17b91cfdf0299535dcb82e3e4f2201c0bd77d6db Mon Sep 17 00:00:00 2001 +From: Jorge Ramirez-Ortiz +Date: Tue, 12 Nov 2024 21:32:36 +0100 +Subject: [PATCH] systemd-boot display order + +Use sort-key to display ostree deployments at the top. Other factors +might alter the position but they should always be above the secure boot +uefi EFI applications. + +Signed-off-by: Jorge Ramirez-Ortiz +--- + src/libostree/ostree-bootconfig-parser.c | 2 +- + src/libostree/ostree-sysroot-deploy.c | 5 +++++ + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/libostree/ostree-bootconfig-parser.c b/libostree/ostree-bootconfig-parser.c +index 4c3e80d..d3fb6b3 100644 +--- a/src/libostree/ostree-bootconfig-parser.c ++++ b/src/libostree/ostree-bootconfig-parser.c +@@ -210,7 +210,7 @@ ostree_bootconfig_parser_write_at (OstreeBootconfigParser *self, int dfd, const + * in the bootconfig example of the BootLoaderspec document: + * https://systemd.io/BOOT_LOADER_SPECIFICATION + */ +- const char *fields[] = { "title", "version", "options", "devicetree", "linux", "initrd" }; ++ const char *fields[] = { "title", "version", "options", "devicetree", "linux", "initrd", "sort-key" }; + g_autoptr (GHashTable) keys_written = g_hash_table_new (g_str_hash, g_str_equal); + g_autoptr (GString) buf = g_string_new (""); + +diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c +index f9c496d..0df24df 100644 +--- a/src/libostree/ostree-sysroot-deploy.c ++++ b/src/libostree/ostree-sysroot-deploy.c +@@ -2290,6 +2290,11 @@ install_deployment_kernel (OstreeSysroot *sysroot, int new_bootversion, + g_autofree char *version_key + = g_strdup_printf ("%d", n_deployments - ostree_deployment_get_index (deployment)); + ostree_bootconfig_parser_set (bootconfig, OSTREE_COMMIT_META_KEY_VERSION, version_key); ++ ++g_autofree char *sort_key ++ = g_strdup_printf ("%d", 0); ++ ostree_bootconfig_parser_set (bootconfig, "sort-key", sort_key); ++ + g_autofree char *boot_relpath + = g_strconcat (bootprefix, bootcsumdir, "/", kernel_layout->kernel_namever, NULL); + ostree_bootconfig_parser_set (bootconfig, "linux", boot_relpath); +-- +2.34.1 diff --git a/meta-lmp-base/recipes-extended/ostree/ostree_%.bbappend b/meta-lmp-base/recipes-extended/ostree/ostree_%.bbappend index 0ec5e6cea9..9f8ad1be0a 100644 --- a/meta-lmp-base/recipes-extended/ostree/ostree_%.bbappend +++ b/meta-lmp-base/recipes-extended/ostree/ostree_%.bbappend @@ -10,6 +10,8 @@ SRC_URI:append = " \ file://0003-Add-support-for-directories-instead-of-symbolic-link.patch \ file://0004-Add-support-for-systemd-boot-bootloader.patch \ file://0005-ostree-decrease-default-grub.cfg-timeout-and-set-def.patch \ + file://0006-Add-support-systemd-boot-automatic-boot-assesment.patch \ + file://0007-sort-key.patch \ " PACKAGECONFIG:remove = "static" diff --git a/meta-lmp-base/recipes-kernel/linux/kmeta-linux-lmp-6.6.y.inc b/meta-lmp-base/recipes-kernel/linux/kmeta-linux-lmp-6.6.y.inc index f439cec996..b0dffc9fe5 100644 --- a/meta-lmp-base/recipes-kernel/linux/kmeta-linux-lmp-6.6.y.inc +++ b/meta-lmp-base/recipes-kernel/linux/kmeta-linux-lmp-6.6.y.inc @@ -1,4 +1,4 @@ KERNEL_META_REPO ?= "git://github.com/foundriesio/lmp-kernel-cache.git" KERNEL_META_REPO_PROTOCOL ?= "https" KERNEL_META_BRANCH ?= "linux-v6.6.y" -KERNEL_META_COMMIT ?= "71eca07f3eaeb261e3f194f246d27a508ba0443d" +KERNEL_META_COMMIT ?= "16feae8a4ea6595371ff285c89648c196fe35ccf" diff --git a/meta-lmp-base/recipes-security/optee/optee-client_3.21.0.bb b/meta-lmp-base/recipes-security/optee/optee-client_4.2.0.bb similarity index 70% rename from meta-lmp-base/recipes-security/optee/optee-client_3.21.0.bb rename to meta-lmp-base/recipes-security/optee/optee-client_4.2.0.bb index 4fba709b53..9468369d4a 100644 --- a/meta-lmp-base/recipes-security/optee/optee-client_3.21.0.bb +++ b/meta-lmp-base/recipes-security/optee/optee-client_4.2.0.bb @@ -1,6 +1,6 @@ require optee-client-fio.inc -SRCREV = "8533e0e6329840ee96cf81b6453f257204227e6c" +SRCREV = "3eac340a781c00ccd61b151b0e9c22a8c6e9f9f0" SRC_URI += " \ file://0001-FIO-extras-pkcs11-change-UUID-to-avoid-conflict-with.patch \ diff --git a/meta-lmp-base/recipes-security/optee/optee-examples_3.21.0.bb b/meta-lmp-base/recipes-security/optee/optee-examples_4.2.0.bb similarity index 100% rename from meta-lmp-base/recipes-security/optee/optee-examples_3.21.0.bb rename to meta-lmp-base/recipes-security/optee/optee-examples_4.2.0.bb diff --git a/meta-lmp-base/recipes-security/optee/optee-os-fio-mfgtool_3.21.0.bb b/meta-lmp-base/recipes-security/optee/optee-os-fio-mfgtool_4.2.0.bb similarity index 100% rename from meta-lmp-base/recipes-security/optee/optee-os-fio-mfgtool_3.21.0.bb rename to meta-lmp-base/recipes-security/optee/optee-os-fio-mfgtool_4.2.0.bb diff --git a/meta-lmp-base/recipes-security/optee/optee-os-fio-se05x.inc b/meta-lmp-base/recipes-security/optee/optee-os-fio-se05x.inc index 533cca068c..d52e09b848 100644 --- a/meta-lmp-base/recipes-security/optee/optee-os-fio-se05x.inc +++ b/meta-lmp-base/recipes-security/optee/optee-os-fio-se05x.inc @@ -10,6 +10,8 @@ SRC_URI:append = " \ " SRCREV_plug-and-trust ?= "1b8fa0caf728859c429e306d081af030620e0e4d" +SRCREV_FORMAT ?= "optee-os-fio_plug-and-trust" + # To be replaced based on the actual board OEFID SE05X_OEFID ?= "0xA1F4" diff --git a/meta-lmp-base/recipes-security/optee/optee-os-fio.inc b/meta-lmp-base/recipes-security/optee/optee-os-fio.inc index 084c3533cd..2b2b64b815 100644 --- a/meta-lmp-base/recipes-security/optee/optee-os-fio.inc +++ b/meta-lmp-base/recipes-security/optee/optee-os-fio.inc @@ -22,7 +22,7 @@ PROVIDES = "virtual/optee-os" SRCBRANCH ?= "master" OPTEE_OS_REPO ?= "git://git.codelinaro.org/clo/foundriesio/optee_os.git" -SRC_URI = "${OPTEE_OS_REPO};protocol=https;branch=${SRCBRANCH}" +SRC_URI = "${OPTEE_OS_REPO};protocol=https;name=optee-os-fio;branch=${SRCBRANCH}" S = "${WORKDIR}/git" B = "${WORKDIR}/build" diff --git a/meta-lmp-base/recipes-security/optee/optee-os-fio_3.21.0.bb b/meta-lmp-base/recipes-security/optee/optee-os-fio_3.21.0.bb deleted file mode 100644 index 146f53f118..0000000000 --- a/meta-lmp-base/recipes-security/optee/optee-os-fio_3.21.0.bb +++ /dev/null @@ -1,4 +0,0 @@ -require optee-os-fio.inc - -SRCREV = "9048d3d2873b7d7d9f2b5594ce55c342b4cb6049" -SRCBRANCH = "3.21+fio" diff --git a/meta-lmp-base/recipes-security/optee/optee-os-fio_4.2.0.bb b/meta-lmp-base/recipes-security/optee/optee-os-fio_4.2.0.bb new file mode 100644 index 0000000000..4e70bf6590 --- /dev/null +++ b/meta-lmp-base/recipes-security/optee/optee-os-fio_4.2.0.bb @@ -0,0 +1,4 @@ +require optee-os-fio.inc + +SRCREV = "a88bd7ef912657e9a73bf87ef7c0a0f76db1cbd4" +SRCBRANCH = "4.2.0+fio-wip" diff --git a/meta-lmp-base/recipes-security/optee/optee-os-tadevkit_3.21.0.bb b/meta-lmp-base/recipes-security/optee/optee-os-tadevkit_4.2.0.bb similarity index 100% rename from meta-lmp-base/recipes-security/optee/optee-os-tadevkit_3.21.0.bb rename to meta-lmp-base/recipes-security/optee/optee-os-tadevkit_4.2.0.bb diff --git a/meta-lmp-base/recipes-security/optee/optee-test/0001-regression-1000-disable-1039.patch b/meta-lmp-base/recipes-security/optee/optee-test/0001-regression-1000-disable-1039.patch index 7be63fac2b..448d086e94 100644 --- a/meta-lmp-base/recipes-security/optee/optee-test/0001-regression-1000-disable-1039.patch +++ b/meta-lmp-base/recipes-security/optee/optee-test/0001-regression-1000-disable-1039.patch @@ -1,6 +1,6 @@ -From 9cdaa16531f91c28621d8d8592560df817860eb0 Mon Sep 17 00:00:00 2001 +From 9c6fd3bba91930deaf7d86f4af1739999e805934 Mon Sep 17 00:00:00 2001 From: Jorge Ramirez-Ortiz -Date: Wed, 29 Mar 2023 14:16:55 +0200 +Date: Wed, 20 Nov 2024 17:43:27 +0100 Subject: [PATCH] regression 1000: disable 1039 This test requires the TA to be signed with a key located @@ -17,10 +17,10 @@ Signed-off-by: Jorge Ramirez-Ortiz 1 file changed, 2 insertions(+) diff --git a/host/xtest/regression_1000.c b/host/xtest/regression_1000.c -index de32c41..1aa2e8b 100644 +index 9981d01..226e5dc 100644 --- a/host/xtest/regression_1000.c +++ b/host/xtest/regression_1000.c -@@ -3197,6 +3197,7 @@ out: +@@ -3269,6 +3269,7 @@ out: ADBG_CASE_DEFINE(regression, 1038, xtest_tee_test_1038, "Test MTE (Memory Tag Extension)"); @@ -28,11 +28,14 @@ index de32c41..1aa2e8b 100644 static void xtest_tee_test_1039(ADBG_Case_t *c) { TEEC_Session session = { }; -@@ -3221,3 +3222,4 @@ static void xtest_tee_test_1039(ADBG_Case_t *c) - +@@ -3291,6 +3292,7 @@ static void xtest_tee_test_1039(ADBG_Case_t *c) + } ADBG_CASE_DEFINE(regression, 1039, xtest_tee_test_1039, "Test subkey verification"); +#endif + + struct test_1040_thread_arg { + TEEC_Result res; -- 2.34.1 diff --git a/meta-lmp-base/recipes-security/optee/optee-test_3.21.0.bb b/meta-lmp-base/recipes-security/optee/optee-test_4.2.0.bb similarity index 68% rename from meta-lmp-base/recipes-security/optee/optee-test_3.21.0.bb rename to meta-lmp-base/recipes-security/optee/optee-test_4.2.0.bb index 6697608b4f..3a18853cba 100644 --- a/meta-lmp-base/recipes-security/optee/optee-test_3.21.0.bb +++ b/meta-lmp-base/recipes-security/optee/optee-test_4.2.0.bb @@ -1,6 +1,6 @@ require optee-test-fio.inc -SRCREV = "9c872638bc38324d8c65b9296ebec3d124e19466" +SRCREV = "526d5bac1b65f907f67c05cd07beca72fbab88dd" # Due OpenSSL 3.0 deprecated warnings CFLAGS += "-Wno-error=deprecated-declarations" diff --git a/meta-lmp-base/recipes-support/lvm2/libdevmapper_2.03.22.bbappend b/meta-lmp-base/recipes-support/lvm2/libdevmapper_2.03.22.bbappend new file mode 100644 index 0000000000..1b1e1e0e1f --- /dev/null +++ b/meta-lmp-base/recipes-support/lvm2/libdevmapper_2.03.22.bbappend @@ -0,0 +1 @@ +inherit nopackages diff --git a/meta-lmp-base/recipes-support/mfgtool-files/mfgtool-files/full_image.uuu.in b/meta-lmp-base/recipes-support/mfgtool-files/mfgtool-files/full_image.uuu.in index e7a3d569ce..c78592390f 100644 --- a/meta-lmp-base/recipes-support/mfgtool-files/mfgtool-files/full_image.uuu.in +++ b/meta-lmp-base/recipes-support/mfgtool-files/mfgtool-files/full_image.uuu.in @@ -22,7 +22,7 @@ uuu_version 1.0.1 # Rootfs #FBK: acmd mmc=`cat /tmp/mmcdev`; gunzip -c | dd of=/dev/mmcblk${mmc} bs=4M iflag=fullblock oflag=direct status=progress -#FBK: ucp ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.wic.gz t:- +#FBK: ucp ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.rootfs.wic.gz t:- #FBK: Sync #FBK: DONE diff --git a/meta-lmp-bsp/conf/machine/include/lmp-machine-custom.inc b/meta-lmp-bsp/conf/machine/include/lmp-machine-custom.inc index c0bb74a3f4..4381aceeda 100644 --- a/meta-lmp-bsp/conf/machine/include/lmp-machine-custom.inc +++ b/meta-lmp-bsp/conf/machine/include/lmp-machine-custom.inc @@ -35,10 +35,12 @@ ENABLE_UART:rpi = "1" ## Mimic meta-raspberrypi behavior KERNEL_SERIAL:rpi ?= "${@oe.utils.conditional("ENABLE_UART", "1", "console=ttyS0,115200", "", d)}" KERNEL_SERIAL:raspberrypi-cm3 ?= "console=ttyAMA0,115200" +KERNEL_SERIAL:raspberrypi5 ?= "console=ttyAMA10,115200" OSTREE_KERNEL_ARGS_COMMON_RPI ?= "coherent_pool=1M 8250.nr_uarts=1 console=tty1 cgroup_enable=memory ${KERNEL_SERIAL} ${OSTREE_KERNEL_ARGS_COMMON}" OSTREE_KERNEL_ARGS:raspberrypi3 ?= "vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 ${OSTREE_KERNEL_ARGS_COMMON_RPI}" OSTREE_KERNEL_ARGS:raspberrypi-cm3 ?= "vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 ${OSTREE_KERNEL_ARGS_COMMON_RPI}" OSTREE_KERNEL_ARGS:raspberrypi4 ?= "vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 ${OSTREE_KERNEL_ARGS_COMMON_RPI}" +OSTREE_KERNEL_ARGS:raspberrypi5 ?= "pci=pcie_bus_safe vc_mem.mem_base=0x3fc00000 vc_mem.mem_size=0x40000000 ${OSTREE_KERNEL_ARGS_COMMON_RPI}" ## U-Boot entrypoints for rpi UBOOT_ENTRYPOINT:rpi = "0x00200000" UBOOT_DTB_LOADADDRESS:rpi = "0x02600000" @@ -77,7 +79,8 @@ UBOOT_ENTRYPOINT:qemuarm64 = "0x40080000" MACHINE_FEATURES:append:qemuarm64-secureboot = " optee" OSTREE_SPLIT_BOOT:qemuarm64-secureboot = "1" OSTREE_DEPLOY_USR_OSTREE_BOOT:qemuarm64-secureboot = "1" -INITRAMFS_RECOVERY_IMAGE:qemuarm64-secureboot = "initramfs-ostree-lmp-recovery" +# https://github.com/foundriesio/meta-lmp/pull/663/commits/a2adf25f3894f1dcd53a5ab641f68be7eb0330a5 +#INITRAMFS_RECOVERY_IMAGE:qemuarm64-secureboot = "initramfs-ostree-lmp-recovery" WKS_FILE:sota:qemuarm64-secureboot = "sdimage-split-boot-sota.wks.in" ## Use same minimal memory amount as suggested by op-tee QB_MEM:qemuarm64-secureboot = "-m 1057" @@ -150,6 +153,8 @@ OSTREE_KERNEL_ARGS:mx6-generic-bsp ?= "console=tty1 console=ttymxc0,115200 ${OST OSTREE_KERNEL_ARGS:mx6ull-generic-bsp ?= "console=tty1 console=ttymxc0,115200 ${OSTREE_KERNEL_ARGS_COMMON}" OSTREE_KERNEL_ARGS:mx7d-generic-bsp ?= "console=tty1 console=ttymxc0,115200 ${OSTREE_KERNEL_ARGS_COMMON}" OSTREE_KERNEL_ARGS:mx7ulp-generic-bsp ?= "console=tty1 console=ttyLP0,115200 ${OSTREE_KERNEL_ARGS_COMMON}" +FIT_CONF_PREFIX:mx8-nxp-bsp = "conf-freescale_" +FIT_CONF_PREFIX:mx9-nxp-bsp = "conf-freescale_" # Embedded Artists i.MX7ULP COM UBOOT_SIGN_ENABLE:sota:imx7ulpea-ucom ?= "1" @@ -220,6 +225,16 @@ UBOOT_SIGN_ENABLE:sota:imx6ullevk ?= "1" SOTA_CLIENT_FEATURES:append:imx6ullevk = " ubootenv" KERNEL_DEVICETREE:imx6ullevk = "imx6ull-14x14-evk.dtb" BOOTSCR_LOAD_ADDR:imx6ullevk = "0x85000000" +# conf/machine/imx6ullevk.conf +KERNEL_DEVICETREE:remove:imx6ullevk = " \ + nxp/imx/imx6ull-14x14-evk-btwifi.dtb \ + nxp/imx/imx6ull-14x14-evk-emmc.dtb \ + nxp/imx/imx6ull-14x14-evk-gpmi-weim.dtb \ + nxp/imx/imx6ull-14x14-evk-reve.dtb \ + nxp/imx/imx6ull-14x14-evk-reve-btwifi.dtb \ + nxp/imx/imx6ull-14x14-evk-reve-emmc.dtb \ + nxp/imx/imx6ull-14x14-evk-reve-gpmi-weim.dtb \ +" # iMX8QM SOTA_CLIENT_FEATURES:append:mx8qm-generic-bsp = " ubootenv" @@ -273,9 +288,9 @@ PREFERRED_PROVIDER_u-boot-default-script:mx8ulp-generic-bsp = "u-boot-base-scr" PREFERRED_PROVIDER_u-boot-default-script:sota:mx8ulp-generic-bsp = "u-boot-ostree-scr-fit" SOTA_CLIENT_FEATURES:append:mx8ulp-generic-bsp = " ubootenv" LMP_BOOT_FIRMWARE_FILES:mx8ulp-nxp-bsp = "imx-boot u-boot.itb" -PREFERRED_VERSION_optee-os-fio:mx8ulp-nxp-bsp = "3.21.0-imx" -PREFERRED_VERSION_optee-os-fio-mfgtool:mx8ulp-nxp-bsp = "3.21.0-imx" -PREFERRED_VERSION_optee-os-tadevkit:mx8ulp-nxp-bsp = "3.21.0-imx" +PREFERRED_VERSION_optee-os-fio:mx8ulp-nxp-bsp = "4.2.0-imx" +PREFERRED_VERSION_optee-os-fio-mfgtool:mx8ulp-nxp-bsp = "4.2.0-imx" +PREFERRED_VERSION_optee-os-tadevkit:mx8ulp-nxp-bsp = "4.2.0-imx" PREFERRED_VERSION_u-boot-fio:mx8ulp-nxp-bsp ?= "imx-2023.04" ## iMX8ULP LPDDR4 EVK UBOOT_SIGN_ENABLE:sota:imx8ulp-lpddr4-evk ?= "1" @@ -491,11 +506,13 @@ PREFERRED_PROVIDER_u-boot-default-script:mx93-generic-bsp = "u-boot-base-scr" PREFERRED_PROVIDER_u-boot-default-script:sota:mx93-generic-bsp = "u-boot-ostree-scr-fit" SOTA_CLIENT_FEATURES:append:mx93-generic-bsp = " ubootenv" LMP_BOOT_FIRMWARE_FILES:mx93-nxp-bsp = "imx-boot u-boot.itb" -PREFERRED_VERSION_optee-os-fio:mx93-nxp-bsp = "3.21.0-imx" -PREFERRED_VERSION_optee-os-fio-mfgtool:mx93-nxp-bsp = "3.21.0-imx" -PREFERRED_VERSION_optee-os-tadevkit:mx93-nxp-bsp = "3.21.0-imx" +PREFERRED_VERSION_optee-os-fio:mx93-nxp-bsp = "4.2.0-imx" +PREFERRED_VERSION_optee-os-fio-mfgtool:mx93-nxp-bsp = "4.2.0-imx" +PREFERRED_VERSION_optee-os-tadevkit:mx93-nxp-bsp = "4.2.0-imx" PREFERRED_PROVIDER_virtual/kernel:mx93-nxp-bsp ?= "linux-lmp-fslc-imx" PREFERRED_VERSION_u-boot-fio:mx93-nxp-bsp ?= "imx-2023.04" +# linux-lmp-fslc-imx_6.1 does't have this devicetrees +KERNEL_DEVICETREE:remove:mx93-nxp-bsp = "freescale/${KERNEL_DEVICETREE_BASENAME}-i2c-spi-slave.dtb freescale/${KERNEL_DEVICETREE_BASENAME}-iw612-otbr.dtb" ## iMX93 DDR4 EVK UBOOT_SIGN_ENABLE:sota:imx93-11x11-lpddr4x-evk ?= "1" OSTREE_KERNEL_ARGS:imx93-11x11-lpddr4x-evk ?= "console=tty1 console=ttyLP0,115200 earlycon rootfstype=ext4" @@ -714,6 +731,7 @@ MACHINE_ESSENTIAL_EXTRA_RDEPENDS:remove:k3 = "kernel-image-image" KERNEL_DEVICETREE:beaglebone-yocto = "${DTB_FILES}" # TI AM62x +FIT_CONF_PREFIX:am62xx = "conf-ti_" MACHINE_FEATURES:append:am62xx = " optee" PREFERRED_PROVIDER_u-boot-fw-utils:am62xx = "libubootenv" PREFERRED_RPROVIDER_u-boot-fw-utils:am62xx = "libubootenv" @@ -733,10 +751,12 @@ LMP_BOOT_FIRMWARE_FILES:append:sota:am62xx = " boot.itb" SOTA_CLIENT_FEATURES:append:am62xx-evm = " ubootenv" ## beagleplay SOTA_CLIENT_FEATURES:append:beagleplay = " ubootenv" -KERNEL_DEVICETREE:beagleplay = "ti/k3-am625-beagleplay.dtb ti/k3-am625-beagleplay-csi2-ov5640.dtbo ti/k3-am625-beagleplay-csi2-tevi-ov5640.dtbo" MACHINE_EXTRA_RRECOMMENDS:append:beagleplay = " wl18xx-calibrator wl18xx-target-scripts wl18xx-fw wlconf" +LMP_BOOT_FIRMWARE_FILES:beagleplay = "tispl.bin u-boot.img tiboot3.bin" +LMP_BOOT_FIRMWARE_FILES:append:sota:beagleplay = " boot.itb" # TI AM64x +FIT_CONF_PREFIX:am64xx = "conf-ti_" MACHINE_FEATURES:append:am64xx = " optee" PREFERRED_PROVIDER_u-boot-fw-utils:am64xx = "libubootenv" PREFERRED_RPROVIDER_u-boot-fw-utils:am64xx = "libubootenv" @@ -794,12 +814,14 @@ OSTREE_KERNEL_ARGS:sun8i ?= "earlycon console=ttyS0,115200 ${OSTREE_KERNEL_ARGS_ ## iMX targets should use the u-boot release based on the NXP BSP PREFERRED_VERSION_u-boot-fio:imx-nxp-bsp ?= "imx-2022.04" ## Prefer OP-TEE releases from our layer instead of using the .imx fork -PREFERRED_VERSION_optee-client:mx8-nxp-bsp = "3.21.0" -PREFERRED_VERSION_optee-client:mx9-nxp-bsp = "3.21.0" -PREFERRED_VERSION_optee-examples:mx8-nxp-bsp = "3.21.0" -PREFERRED_VERSION_optee-examples:mx9-nxp-bsp = "3.21.0" -PREFERRED_VERSION_optee-test:mx8-nxp-bsp = "3.21.0" -PREFERRED_VERSION_optee-test:mx9-nxp-bsp = "3.21.0" +PREFERRED_VERSION_optee-client:mx8-nxp-bsp = "4.2.0" +PREFERRED_VERSION_optee-client:mx9-nxp-bsp = "4.2.0" +PREFERRED_VERSION_optee-examples:mx8-nxp-bsp = "4.2.0" +PREFERRED_VERSION_optee-examples:mx9-nxp-bsp = "4.2.0" +PREFERRED_VERSION_optee-test:mx8-nxp-bsp = "4.2.0" +PREFERRED_VERSION_optee-test:mx9-nxp-bsp = "4.2.0" +## We don't use imx-boot-container just yet +UBOOT_PROVIDES_BOOT_CONTAINER:mx8m-generic-bsp = "0" ## No need to install u-boot, already a WKS dependency MACHINE_ESSENTIAL_EXTRA_RDEPENDS:remove:imx-generic-bsp = "u-boot-fslc" ## OP-TEE is a dependency of u-boot (fit), no need for WKS_FILE_DEPENDS diff --git a/meta-lmp-bsp/conf/machine/include/lmp-mfgtool-machine-custom.inc b/meta-lmp-bsp/conf/machine/include/lmp-mfgtool-machine-custom.inc index 0c83601a80..3d7ae79ef9 100644 --- a/meta-lmp-bsp/conf/machine/include/lmp-mfgtool-machine-custom.inc +++ b/meta-lmp-bsp/conf/machine/include/lmp-mfgtool-machine-custom.inc @@ -139,8 +139,13 @@ EXTRA_IMAGEDEPENDS:remove:k3 = "u-boot-default-script" PREFERRED_PROVIDER_virtual/optee-os:k3 = "optee-os-fio-mfgtool" KERNEL_IMAGETYPE:k3 = "fitImage" KERNEL_CLASSES:k3 = " kernel-lmp-fitimage " +UBOOT_SIGN_ENABLE:k3 = "0" # TI AM62XX EVM -UBOOT_MACHINE:am62xx-evm-k3r5 = "am62x_evm_r5_usbdfu_defconfig" +UBOOT_CONFIG_FRAGMENTS:am62xx-evm-k3r5 = "am62x_r5_usbdfu.config" # Cross machines / BSPs PREFERRED_VERSION_u-boot-fio-mfgtool:imx-nxp-bsp ?= "imx-2022.04" +FIT_CONF_PREFIX:mx8-nxp-bsp = "conf-freescale_" +FIT_CONF_PREFIX:mx9-nxp-bsp = "conf-freescale_" +FIT_CONF_PREFIX:am62xx = "conf-ti_" +FIT_CONF_PREFIX:am64xx = "conf-ti_" diff --git a/meta-lmp-bsp/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/imx-boot_%.bbappend b/meta-lmp-bsp/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/imx-boot_%.bbappend index 702b44b0ab..988367ad33 100644 --- a/meta-lmp-bsp/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/imx-boot_%.bbappend +++ b/meta-lmp-bsp/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/imx-boot_%.bbappend @@ -61,7 +61,7 @@ do_compile:prepend:mx93-nxp-bsp() { do_compile:append() { for type in ${UBOOT_CONFIG}; do UBOOT_CONFIG_EXTRA="$type" - BOOT_CONFIG_MACHINE_EXTRA="${BOOT_NAME}-${MACHINE}-${UBOOT_CONFIG_EXTRA}.bin" + BOOT_CONFIG_MACHINE_EXTRA="imx-boot-${MACHINE}-${UBOOT_CONFIG_EXTRA}.bin" for target in ${IMXBOOT_TARGETS}; do if [ -e "${BOOT_STAGING}/flash.bin-nohdmi" ]; then cp ${BOOT_STAGING}/flash.bin-nohdmi ${S}/${BOOT_CONFIG_MACHINE_EXTRA}-${target}-nohdmi @@ -73,7 +73,7 @@ do_compile:append() { do_install:append() { for type in ${UBOOT_CONFIG}; do UBOOT_CONFIG_EXTRA="$type" - BOOT_CONFIG_MACHINE_EXTRA="${BOOT_NAME}-${MACHINE}-${UBOOT_CONFIG_EXTRA}.bin" + BOOT_CONFIG_MACHINE_EXTRA="imx-boot-${MACHINE}-${UBOOT_CONFIG_EXTRA}.bin" for target in ${IMXBOOT_TARGETS}; do if [ -e "${S}/${BOOT_CONFIG_MACHINE_EXTRA}-${target}-nohdmi" ]; then install -m 0644 ${S}/${BOOT_CONFIG_MACHINE_EXTRA}-${target}-nohdmi ${D}/boot/ @@ -85,20 +85,20 @@ do_install:append() { do_deploy:append() { for type in ${UBOOT_CONFIG}; do UBOOT_CONFIG_EXTRA="$type" - BOOT_CONFIG_MACHINE_EXTRA="${BOOT_NAME}-${MACHINE}-${UBOOT_CONFIG_EXTRA}.bin" + BOOT_CONFIG_MACHINE_EXTRA="imx-boot-${MACHINE}-${UBOOT_CONFIG_EXTRA}.bin" for target in ${IMXBOOT_TARGETS}; do if [ -e "${S}/${BOOT_CONFIG_MACHINE_EXTRA}-${target}-nohdmi" ]; then install -m 0644 ${S}/${BOOT_CONFIG_MACHINE_EXTRA}-${target}-nohdmi ${DEPLOYDIR} - if [ ! -e "${DEPLOYDIR}/${BOOT_NAME}-${MACHINE}-nohdmi" ]; then - ln -sf ${BOOT_CONFIG_MACHINE_EXTRA}-${IMAGE_IMXBOOT_TARGET}-nohdmi ${DEPLOYDIR}/${BOOT_NAME}-nohdmi - ln -sf ${BOOT_CONFIG_MACHINE_EXTRA}-${IMAGE_IMXBOOT_TARGET}-nohdmi ${DEPLOYDIR}/${BOOT_NAME}-${MACHINE}-nohdmi + if [ ! -e "${DEPLOYDIR}/imx-boot-${MACHINE}-nohdmi" ]; then + ln -sf ${BOOT_CONFIG_MACHINE_EXTRA}-${IMAGE_IMXBOOT_TARGET}-nohdmi ${DEPLOYDIR}/imx-boot-nohdmi + ln -sf ${BOOT_CONFIG_MACHINE_EXTRA}-${IMAGE_IMXBOOT_TARGET}-nohdmi ${DEPLOYDIR}/imx-boot-${MACHINE}-nohdmi fi fi done # Also create imx-boot link with the machine name (with the default IMXBOOT_TARGET) - if [ ! -e "${DEPLOYDIR}/${BOOT_NAME}-${MACHINE}" ]; then - ln -sf ${BOOT_CONFIG_MACHINE_EXTRA}-${IMAGE_IMXBOOT_TARGET} ${DEPLOYDIR}/${BOOT_NAME}-${MACHINE} + if [ ! -e "${DEPLOYDIR}/imx-boot-${MACHINE}" ]; then + ln -sf ${BOOT_CONFIG_MACHINE_EXTRA}-${IMAGE_IMXBOOT_TARGET} ${DEPLOYDIR}/imx-boot-${MACHINE} fi done } diff --git a/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-bsp/u-boot/u-boot-bb.org_%.bbappend b/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-bsp/u-boot/u-boot-bb.org_%.bbappend deleted file mode 100644 index 1f6a632487..0000000000 --- a/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-bsp/u-boot/u-boot-bb.org_%.bbappend +++ /dev/null @@ -1,3 +0,0 @@ -FILESEXTRAPATHS:prepend := "${THISDIR}/u-boot-ti-staging:${THISDIR}/${PN}:" - -include u-boot-ti-staging.inc diff --git a/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-staging.inc b/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-staging.inc index fda872c315..56a3989e62 100644 --- a/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-staging.inc +++ b/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-staging.inc @@ -1,9 +1,8 @@ include recipes-bsp/u-boot/u-boot-lmp-common.inc SRC_URI:append = " \ - file://lib-zlib-Fix-a-bug-when-getting-a-gzip-header-extra-field.patch \ - file://k3-accept-filesystem-path-to-the-RoT-key.patch \ - file://k3-set-env-variable-device_type.patch \ + file://0001-k3-accept-filesystem-path-to-the-RoT-key.patch \ + file://0002-k3-set-env-variable-device_type.patch \ " SRC_URI:append:am64xx-evm = " \ diff --git a/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-staging/k3-accept-filesystem-path-to-the-RoT-key.patch b/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-staging/0001-k3-accept-filesystem-path-to-the-RoT-key.patch similarity index 63% rename from meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-staging/k3-accept-filesystem-path-to-the-RoT-key.patch rename to meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-staging/0001-k3-accept-filesystem-path-to-the-RoT-key.patch index f67da685e1..d773ac9502 100644 --- a/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-staging/k3-accept-filesystem-path-to-the-RoT-key.patch +++ b/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-staging/0001-k3-accept-filesystem-path-to-the-RoT-key.patch @@ -1,11 +1,12 @@ -From 7afececd745b26a68822fe6c37addb0492356714 Mon Sep 17 00:00:00 2001 +From 708ff470fb3a70d38ec3bb6c0bf65ae4d143b6ff Mon Sep 17 00:00:00 2001 From: Jorge Ramirez-Ortiz Date: Wed, 28 Jun 2023 10:09:03 +0200 -Subject: [PATCH] k3: accept filesystem path to the RoT key +Subject: [PATCH 1/2] k3: accept filesystem path to the RoT key Upstream-Status: Pending Signed-off-by: Jorge Ramirez-Ortiz +Signed-off-by: Jose Quaresma --- arch/arm/dts/Makefile | 10 ++++++++-- arch/arm/dts/k3-binman.dtsi | 4 ++-- @@ -13,12 +14,12 @@ Signed-off-by: Jorge Ramirez-Ortiz 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile -index 1b9c5f04c3..01b5ae36fe 100644 +index 4d03a0f5b30..d1edd03a922 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile -@@ -1375,8 +1375,14 @@ targets += $(dtb-y) - # Add any required device tree compiler flags here - DTC_FLAGS += -a 0x8 +@@ -1553,8 +1553,14 @@ DTC_FLAGS += -a 0x8 + + DTC_FLAGS_imx8mp-dhcom-pdk3-overlay-rev100 += -Wno-avoid_default_addr_size -Wno-reg_format -PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y)) @@ -34,41 +35,41 @@ index 1b9c5f04c3..01b5ae36fe 100644 clean-files := *.dtb *.dtbo *_HS diff --git a/arch/arm/dts/k3-binman.dtsi b/arch/arm/dts/k3-binman.dtsi -index 97a3573bdb..c595203e9b 100644 +index 621653e9471..a92815da185 100644 --- a/arch/arm/dts/k3-binman.dtsi +++ b/arch/arm/dts/k3-binman.dtsi -@@ -13,14 +13,14 @@ +@@ -15,14 +15,14 @@ custMpk { filename = "custMpk.pem"; - blob-ext { -- filename = "../keys/custMpk.pem"; + custmpk_pem: blob-ext { +- filename = "arch/arm/mach-k3/keys/custMpk.pem"; + filename = "TI_KEYS/custMpk.pem"; }; }; ti-degenerate-key { filename = "ti-degenerate-key.pem"; - blob-ext { -- filename = "../keys/ti-degenerate-key.pem"; + dkey_pem: blob-ext { +- filename = "arch/arm/mach-k3/keys/ti-degenerate-key.pem"; + filename = "TI_KEYS/ti-degenerate-key.pem"; }; }; }; diff --git a/board/ti/common/Kconfig b/board/ti/common/Kconfig -index 49edd98014..4ff12d6c5b 100644 +index 821f02b09fc..f63bb94523c 100644 --- a/board/ti/common/Kconfig +++ b/board/ti/common/Kconfig -@@ -49,3 +49,10 @@ config TI_COMMON_CMD_OPTIONS - imply CMD_SPI - imply CMD_TIME - imply CMD_USB if USB +@@ -62,3 +62,10 @@ config TI_FDT_FOLDER_PATH + Folder path for kernel device tree default. + This is used along with fdtfile path to locate the kernel + device tree blob. + +config SIGN_KEY_PATH + string "Path to the sign key" + depends on ARCH_K3 -+ default "../keys" ++ default "arch/arm/mach-k3/keys" + help + Path to the folder containing the sign keys -- -2.34.1 +2.47.0 diff --git a/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-staging/0002-k3-set-env-variable-device_type.patch b/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-staging/0002-k3-set-env-variable-device_type.patch new file mode 100644 index 0000000000..00a397524e --- /dev/null +++ b/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-staging/0002-k3-set-env-variable-device_type.patch @@ -0,0 +1,48 @@ +From 3a8de682fe0e8b773eaf42c940f7de00b8aee192 Mon Sep 17 00:00:00 2001 +From: Igor Opaniuk +Date: Fri, 21 Jul 2023 18:08:03 +0200 +Subject: [PATCH 2/2] k3: set env variable device_type + +Set environment variable "device_type", which stores device +sec state: gp, hs-fs, hs-se. + +Changed to swicth to simplify the updates. +The same functionality is implemented very similar with the +CONFIG_DISPLAY_CPUINFO and we should use this instead. +Reworked-by: Jose Quaresma + +Upstream-Status: Inappropriate [lmp specific] +Signed-off-by: Igor Opaniuk +Signed-off-by: Jose Quaresma +--- + arch/arm/mach-k3/common.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c +index a371b002863..8405dca28c2 100644 +--- a/arch/arm/mach-k3/common.c ++++ b/arch/arm/mach-k3/common.c +@@ -703,6 +703,20 @@ int misc_init_r(void) + env_set("secure_rprocs", "1"); + } + ++ enum k3_device_type type = get_device_type(); ++ ++ switch (type) { ++ case K3_DEVICE_TYPE_HS_SE: ++ env_set("device_type", "hs-se"); ++ break; ++ case K3_DEVICE_TYPE_HS_FS: ++ env_set("device_type", "hs-fs"); ++ break; ++ case K3_DEVICE_TYPE_GP: ++ env_set("device_type", "gp"); ++ break; ++ } ++ + return 0; + } + +-- +2.47.0 + diff --git a/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-staging/k3-set-env-variable-device_type.patch b/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-staging/k3-set-env-variable-device_type.patch deleted file mode 100644 index 97f4e42f81..0000000000 --- a/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-staging/k3-set-env-variable-device_type.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 0b638ece826c816a2387834975c9b5854dc94f6b Mon Sep 17 00:00:00 2001 -From: Igor Opaniuk -Date: Fri, 21 Jul 2023 18:08:03 +0200 -Subject: [PATCH] k3: set env variable device_type - -Set environment variable "device_type", which stores device -sec state: gp, hs-fs, hs-se. - -Upstream-Status: Inappropriate [lmp specific] -Signed-off-by: Igor Opaniuk ---- - arch/arm/mach-k3/common.c | 12 +++++++++++- - 1 file changed, 11 insertions(+), 1 deletion(-) - -diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c -index c04f898a55..14619fabdb 100644 ---- a/arch/arm/mach-k3/common.c -+++ b/arch/arm/mach-k3/common.c -@@ -600,6 +600,8 @@ void spl_board_prepare_for_linux(void) - - int misc_init_r(void) - { -+ int device_type; -+ - if (IS_ENABLED(CONFIG_TI_AM65_CPSW_NUSS)) { - struct udevice *dev; - int ret; -@@ -611,12 +613,20 @@ int misc_init_r(void) - printf("Failed to probe am65_cpsw_nuss driver\n"); - } - -+ device_type = get_device_type(); - /* Default FIT boot on HS-SE devices */ -- if (get_device_type() == K3_DEVICE_TYPE_HS_SE) { -+ if (device_type == K3_DEVICE_TYPE_HS_SE) { - env_set("boot_fit", "1"); - env_set("secure_rprocs", "1"); -+ env_set("device_type", "hs-se"); - } else { -+ if (device_type == K3_DEVICE_TYPE_HS_FS) { -+ env_set("device_type", "hs-fs"); -+ } else { -+ env_set("device_type", "gp"); -+ } - env_set("secure_rprocs", "0"); -+ - } - - return 0; --- -2.34.1 - diff --git a/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-staging/lib-zlib-Fix-a-bug-when-getting-a-gzip-header-extra-field.patch b/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-staging/lib-zlib-Fix-a-bug-when-getting-a-gzip-header-extra-field.patch deleted file mode 100644 index 576264cf1f..0000000000 --- a/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-staging/lib-zlib-Fix-a-bug-when-getting-a-gzip-header-extra-field.patch +++ /dev/null @@ -1,154 +0,0 @@ -From patchwork Thu Jun 15 14:54:34 2023 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Oleksandr Suvorov -X-Patchwork-Id: 1795485 -Return-Path: -X-Original-To: incoming@patchwork.ozlabs.org -Delivered-To: patchwork-incoming@legolas.ozlabs.org -Authentication-Results: legolas.ozlabs.org; - spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de - (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; - envelope-from=u-boot-bounces@lists.denx.de; receiver=) -Authentication-Results: legolas.ozlabs.org; - dkim=pass (2048-bit key; - unprotected) header.d=foundries.io header.i=@foundries.io header.a=rsa-sha256 - header.s=google header.b=CSyLLo1n; - dkim-atps=neutral -Received: from phobos.denx.de (phobos.denx.de - [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature ECDSA (P-384)) - (No client certificate requested) - by legolas.ozlabs.org (Postfix) with ESMTPS id 4Qhlh10XPPz20Wy - for ; Fri, 16 Jun 2023 00:54:57 +1000 (AEST) -Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) - by phobos.denx.de (Postfix) with ESMTP id 42B6B8631D; - Thu, 15 Jun 2023 16:54:52 +0200 (CEST) -Authentication-Results: phobos.denx.de; - dmarc=none (p=none dis=none) header.from=foundries.io -Authentication-Results: phobos.denx.de; - spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de -Authentication-Results: phobos.denx.de; - dkim=pass (2048-bit key; - unprotected) header.d=foundries.io header.i=@foundries.io - header.b="CSyLLo1n"; - dkim-atps=neutral -Received: by phobos.denx.de (Postfix, from userid 109) - id E8C218631F; Thu, 15 Jun 2023 16:54:50 +0200 (CEST) -X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de -X-Spam-Level: -X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, - DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, - T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 -Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com - [IPv6:2a00:1450:4864:20::32e]) - (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) - (No client certificate requested) - by phobos.denx.de (Postfix) with ESMTPS id C8D34862AA - for ; Thu, 15 Jun 2023 16:54:47 +0200 (CEST) -Authentication-Results: phobos.denx.de; - dmarc=none (p=none dis=none) header.from=foundries.io -Authentication-Results: phobos.denx.de; - spf=pass smtp.mailfrom=oleksandr.suvorov@foundries.io -Received: by mail-wm1-x32e.google.com with SMTP id - 5b1f17b1804b1-3f7ebb2b82cso19538235e9.2 - for ; Thu, 15 Jun 2023 07:54:47 -0700 (PDT) -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=foundries.io; s=google; t=1686840887; x=1689432887; - h=content-transfer-encoding:mime-version:message-id:date:subject:cc - :to:from:from:to:cc:subject:date:message-id:reply-to; - bh=ZlcZ/TvSHRdVMgcEyiYYvZoSkkmQihHQknCJfDU7dXU=; - b=CSyLLo1nTyuw0pHvCEkGQmkL1dQmaKLnQuf6ADthH1ZO6Var7o0sF94pAH/ZHT+NUy - EsEzQ71hHkuxv4Kig5gX6tASmoGYPtyRsLT8OgiFMGKTPYsbM/ald0MJgSO37xD0OTRg - atIPxO04aVYHPpHw+tLhWMjJlQ/xG52NPAKD6031RUIPb31aLkZ1Qm1ePJYpDHASWb0G - BihW+2SLV4fddKGko+F5loREzS56cFBCodVPydT4Jv6r9mZZB/zAELMa7zC6yzSbOZTK - kDk3Ipkvgx2P1ePSqZxE3bsQYH0sZMGsXx69Sayap75DgWpWfG6JNHLykqf6CR1/J5AF - bVnQ== -X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=1e100.net; s=20221208; t=1686840887; x=1689432887; - h=content-transfer-encoding:mime-version:message-id:date:subject:cc - :to:from:x-gm-message-state:from:to:cc:subject:date:message-id - :reply-to; - bh=ZlcZ/TvSHRdVMgcEyiYYvZoSkkmQihHQknCJfDU7dXU=; - b=ERbykPOQJDOHGQhnfs26hT8AtIzb/1J9Y0AzyoM+yxKxnofc4kOq16HB98yzSbbv8B - g2QXsfxHCysvG9SgIG9hQSsfhG/4GW4ATwZrgGx3C0BAe8l7K4FhrK9IRfQWgztMC9QN - 8cUbabeNzQaa9w1shRIuQaJrthkg9/GqE2GdaassqtTfPnM+AUrUrEFVwG6sgjs5zwZw - 7rfBz3/k+4hbB8UjqQsM77YfwqXG495cN5ENfPrdeC6YWEIeMVhop4knbzdoCLAfSjbd - 0uT0WPxrrWtcM99FZuqaFVUtFjhP1yauIjkZRjLrd5rHiWCj2e7ns/pA0OASS3P+Q8Co - nTMw== -X-Gm-Message-State: AC+VfDyPc9oFK6n9Mzw6zdmejxbO2SeZJtBMOZ9f5XxzZfEFUBIOilO7 - Dum6u/M5ISm22SW9judHyAEgDP/Q9h0yajN/Qt8fvw== -X-Google-Smtp-Source: - ACHHUZ5Y3bCKlS9IjeXX4/fZEmVixhD/VdCyBxetYirrE2WP+nIselSwtBGxaL8AwojYk7/8Z1K8AQ== -X-Received: by 2002:adf:db03:0:b0:311:17c5:3a9a with SMTP id - s3-20020adfdb03000000b0031117c53a9amr1286227wri.38.1686840886786; - Thu, 15 Jun 2023 07:54:46 -0700 (PDT) -Received: from localhost.localdomain ([194.104.22.162]) - by smtp.gmail.com with ESMTPSA id - b1-20020a5d5501000000b0030ae69920c9sm21323856wrv.53.2023.06.15.07.54.45 - (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); - Thu, 15 Jun 2023 07:54:46 -0700 (PDT) -From: Oleksandr Suvorov -To: u-boot@lists.denx.de -Cc: Oleksandr Suvorov -Subject: [PATCH] lib/zlib: Fix a bug when getting a gzip header extra field -Date: Thu, 15 Jun 2023 17:54:34 +0300 -Message-Id: <20230615145434.103140-1-oleksandr.suvorov@foundries.io> -X-Mailer: git-send-email 2.40.1 -MIME-Version: 1.0 -X-BeenThere: u-boot@lists.denx.de -X-Mailman-Version: 2.1.39 -Precedence: list -List-Id: U-Boot discussion -List-Unsubscribe: , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: , - -Errors-To: u-boot-bounces@lists.denx.de -Sender: "U-Boot" -X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de -X-Virus-Status: Clean - -This fixes CVE-2022-37434 [1] and bases on 2 commits from Mark -Adler's zlib master repo - the original fix of CVE bug [2] and -the fix for the fix [3]. - -[1] -https://github.com/advisories/GHSA-cfmr-vrgj-vqwv -[2] -https://github.com/madler/zlib/commit/eff308af425b67093bab25f80f1ae950166bece1 -[3] -https://github.com/madler/zlib/commit/1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d - -CVE: CVE-2022-37434 - -Fixes: e89516f031d ("zlib: split up to match original source tree") - -Upstream-Status: Submitted [https://patchwork.ozlabs.org/project/uboot/patch/20230615145434.103140-1-oleksandr.suvorov@foundries.io/] -Signed-off-by: Oleksandr Suvorov ---- - - lib/zlib/inflate.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/lib/zlib/inflate.c b/lib/zlib/inflate.c -index 30dfe155995..8f767b7b9d2 100644 ---- a/lib/zlib/inflate.c -+++ b/lib/zlib/inflate.c -@@ -455,8 +455,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) - if (copy > have) copy = have; - if (copy) { - if (state->head != Z_NULL && -- state->head->extra != Z_NULL) { -- len = state->head->extra_len - state->length; -+ state->head->extra != Z_NULL && -+ (len = state->head->extra_len - state->length) < -+ state->head->extra_max) { - zmemcpy(state->head->extra + len, next, - len + copy > state->head->extra_max ? - state->head->extra_max - len : copy); diff --git a/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-kernel/linux/linux-lmp-ti-staging_git.bb b/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-kernel/linux/linux-lmp-ti-staging_6.6.bb similarity index 56% rename from meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-kernel/linux/linux-lmp-ti-staging_git.bb rename to meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-kernel/linux/linux-lmp-ti-staging_6.6.bb index e9798f5a0e..4fd2b7ec0f 100644 --- a/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-kernel/linux/linux-lmp-ti-staging_git.bb +++ b/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-kernel/linux/linux-lmp-ti-staging_6.6.bb @@ -1,21 +1,15 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" -include recipes-kernel/linux/kmeta-linux-lmp-6.1.y.inc +include recipes-kernel/linux/kmeta-linux-lmp-${PV}.y.inc KERNEL_REPO ?= "git://git.ti.com/git/ti-linux-kernel/ti-linux-kernel.git" KERNEL_REPO_PROTOCOL ?= "https" -KERNEL_BRANCH ?= "ti-linux-6.1.y" +KERNEL_BRANCH ?= "ti-linux-6.6.y" -LINUX_VERSION ?= "6.1.69" -SRCREV_machine ?= "2233af66faf7b81b6c286285e50cda5595dc410d" +LINUX_VERSION ?= "6.6.44" +SRCREV_machine ?= "541c20281af79a7df96bb94b4e3a923092d7ceff" SRCREV_meta ?= "${KERNEL_META_COMMIT}" -# Beagleplay (has its own repo) -KERNEL_REPO:beagleplay ?= "git://github.com/beagleboard/linux.git" -KERNEL_BRANCH:beagleplay ?= "v6.1.46-ti-arm64-r13" -LINUX_VERSION:beagleplay ?= "6.1.46" -SRCREV_machine:beagleplay ?= "f47f74d11b19d8ae2f146de92c258f40e0930d86" - LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46" SRC_URI = "${KERNEL_REPO};protocol=${KERNEL_REPO_PROTOCOL};branch=${KERNEL_BRANCH};name=machine; \ @@ -31,3 +25,20 @@ module_conf_rpmsg_client_sample = "blacklist rpmsg_client_sample" module_conf_ti_k3_r5_remoteproc = "softdep ti_k3_r5_remoteproc pre: virtio_rpmsg_bus" module_conf_ti_k3_dsp_remoteproc = "softdep ti_k3_dsp_remoteproc pre: virtio_rpmsg_bus" KERNEL_MODULE_PROBECONF += "rpmsg_client_sample ti_k3_r5_remoteproc ti_k3_dsp_remoteproc" + +# not found in linux-lmp-ti-staging-6.6.44 +# meta-ti-bsp/conf/machine/am62xx-evm.conf +# meta-ti-bsp/conf/machine/beagleplay.conf +KERNEL_DEVICETREE:remove:am62xx = " \ + ti/k3-am625-phyboard-lyra-1-4-ghz-opp.dtbo \ +" + +# not found in linux-lmp-ti-staging-6.6.44 +# meta-ti-bsp/conf/machine/include/am64xx.inc +KERNEL_DEVICETREE:remove:am64xx = " \ + ti/k3-am642-hummingboard-t-pcie.dtbo \ + ti/k3-am642-hummingboard-t-usb3.dtbo \ + ti/k3-am642-hummingboard-t.dtb \ + ti/k3-am642-phyboard-electra-gpio-fan.dtbo \ + ti/k3-am642-phyboard-electra-pcie-usb2.dtbo \ +" diff --git a/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-support/ti-mfgtool-files/ti-mfgtool-files_0.1.bb b/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-support/ti-mfgtool-files/ti-mfgtool-files_0.1.bb index e8b051fa08..5d75352155 100644 --- a/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-support/ti-mfgtool-files/ti-mfgtool-files_0.1.bb +++ b/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-support/ti-mfgtool-files/ti-mfgtool-files_0.1.bb @@ -36,5 +36,7 @@ do_deploy() { # Make sure the fitImage and u-boot are deployed do_deploy[depends] += "virtual/bootloader:do_deploy" +# for tiboot3*.bin +do_deploy[mcdepends] += "mc::k3r5:virtual/bootloader:do_deploy" addtask deploy after do_compile before do_build diff --git a/meta-lmp-bsp/dynamic-layers/tegra/recipes-bsp/tegra-binaries/tegra-configs_35.5.0.bbappend b/meta-lmp-bsp/dynamic-layers/tegra/recipes-bsp/tegra-binaries/tegra-configs_35.6.0.bbappend similarity index 100% rename from meta-lmp-bsp/dynamic-layers/tegra/recipes-bsp/tegra-binaries/tegra-configs_35.5.0.bbappend rename to meta-lmp-bsp/dynamic-layers/tegra/recipes-bsp/tegra-binaries/tegra-configs_35.6.0.bbappend diff --git a/meta-lmp-bsp/dynamic-layers/tegra/recipes-bsp/tegra-binaries/tegra-helper-scripts-native_35.5.0.bbappend b/meta-lmp-bsp/dynamic-layers/tegra/recipes-bsp/tegra-binaries/tegra-helper-scripts-native_35.5.0.bbappend deleted file mode 100644 index 5a789ac091..0000000000 --- a/meta-lmp-bsp/dynamic-layers/tegra/recipes-bsp/tegra-binaries/tegra-helper-scripts-native_35.5.0.bbappend +++ /dev/null @@ -1 +0,0 @@ -FILESEXTRAPATHS:prepend := "${THISDIR}/tegra-helper-scripts:" diff --git a/meta-lmp-bsp/dynamic-layers/tegra/recipes-bsp/tegra-binaries/tegra-helper-scripts/initrd-flash.sh b/meta-lmp-bsp/dynamic-layers/tegra/recipes-bsp/tegra-binaries/tegra-helper-scripts/initrd-flash.sh deleted file mode 100644 index 9d3fc27b8d..0000000000 --- a/meta-lmp-bsp/dynamic-layers/tegra/recipes-bsp/tegra-binaries/tegra-helper-scripts/initrd-flash.sh +++ /dev/null @@ -1,596 +0,0 @@ -#!/bin/bash - -set -o pipefail - -me=$(basename "$0") -here=$(readlink -f $(dirname "$0")) - -declare -A DEFAULTS - -usage() { - cat <&2 - exit 1 -fi - -. .env.initrd-flash - -# The .presigning-vars file is generated when binaries -# are signed during the build -PRESIGNED= -if [ -e .presigning-vars ]; then - . .presigning-vars - PRESIGNED=yes -fi - -usb_instance= -instance_args= -keyfile= -sbk_keyfile= -skip_bootloader=0 -format_mmc_part= -early_final_status=0 -erase_nvme=0 - -ARGS=$(getopt -n $(basename "$0") -l "usb-instance:,format-mmc-part:,help,skip-bootloader,erase-nvme" -o "u:v:h" -- "$@") -if [ $? -ne 0 ]; then - usage >&2 - exit 1 -fi -eval set -- "$ARGS" -unset ARGS - -while true; do - case "$1" in - --usb-instance) - usb_instance="$2" - shift 2 - ;; - --skip-bootloader) - skip_bootloader=1 - shift - ;; - --format-mmc-part) - format_mmc_part="$2" - shift 2 - ;; - --erase-nvme) - erase_nvme=1 - shift - ;; - -u) - keyfile="$2" - shift 2 - ;; - -v) - sbk_keyfile="$2" - shift 2 - ;; - -h|--help) - usage - exit 0 - ;; - --) - shift - break - ;; - *) - echo "Error processing options" >&2 - usage - exit 1 - ;; - esac -done - -# When the secureboot package is not installed, we have -# to handle signing/RCM booting a bit differently, due to -# the way the NVIDIA flashing scripts work -have_odmsign_func=0 -if [ -e "$here/odmsign.func" ]; then - have_odmsign_func=1 -fi -if [ -n "$PRESIGNED" ]; then - if [ -n "$keyfile" -o -n "$sbk_keyfile" ]; then - echo "WARN: binaries already signed; ignoring signing options" >&2 - keyfile= - sbk_keyfile= - fi -elif [ -n "$keyfile" -o -n "$sbk_keyfile" ] && [ $have_odmsign_func -eq 0 ]; then - echo "ERR: missing odmsign.func from secureboot package, cannot sign binaries" >&2 - exit 1 -fi - -wait_for_rcm() { - "$here/find-jetson-usb" --wait "$usb_instance" -} - -copy_signed_binaries() { - local signdir="${1:-signed}" - local xmlfile="${2:-flash.xml.tmp}" - local destdir="${3:-.}" - local blksize partnumber partname partsize partfile partguid parttype partfilltoend - local line - - while read line; do - eval "$line" - [ -n "$partfile" ] || continue - if [ ! -e "$signdir/$partfile" ]; then - if [ ! -e "$destdir/$partfile" ] && ! echo "$partfile" | grep -q "FILE"; then - echo "ERR: could not copy $partfile from $signdir" >&2 - return 1 - fi - else - cp "$signdir/$partfile" "$destdir" - fi - done < <("$here/nvflashxmlparse" -t boot "$signdir/$xmlfile"; "$here/nvflashxmlparse" -t rootfs "$signdir/$xmlfile") -} - -sign_binaries() { - if [ -n "$PRESIGNED" ]; then - cp doflash.sh flash_signed.sh - if ! copy_bootloader_files bootloader_staging; then - return 1 - fi - return 0 - fi - if [ -z "$BOARDID" -o -z "$FAB" ]; then - wait_for_rcm - fi - if [ -e external-flash.xml.in ]; then - "$here/nvflashxmlparse" --extract --type rootfs --change-device-type=sdmmc_user -o external-flash.xml.tmp external-flash.xml.in - if MACHINE=$MACHINE BOARDID=$BOARDID FAB=$FAB BOARDSKU=$BOARDSKU BOARDREV=$BOARDREV CHIPREV=$CHIPREV CHIP_SKU=$CHIP_SKU \ - "$here/$FLASH_HELPER" --no-flash --sign -u "$keyfile" -v "$sbk_keyfile" $instance_args \ - external-flash.xml.tmp $DTBFILE $EMMC_BCTS $ODMDATA $LNXFILE $ROOTFS_IMAGE; then - if [ $have_odmsign_func -eq 0 ]; then - cp signed/flash.xml.tmp external-secureflash.xml - copy_signed_binaries - else - mv secureflash.xml external-secureflash.xml - fi - else - return 1 - fi - . ./boardvars.sh - fi - if MACHINE=$MACHINE BOARDID=$BOARDID FAB=$FAB BOARDSKU=$BOARDSKU BOARDREV=$BOARDREV CHIPREV=$CHIPREV CHIP_SKU=$CHIP_SKU \ - "$here/$FLASH_HELPER" --no-flash --sign -u "$keyfile" -v "$sbk_keyfile" $instance_args \ - flash.xml.in $DTBFILE $EMMC_BCTS $ODMDATA $LNXFILE $ROOTFS_IMAGE; then - if [ $have_odmsign_func -eq 0 ]; then - cp signed/flash.xml.tmp secureflash.xml - cp signed/flash.idx flash.idx - copy_signed_binaries - else - cp flashcmd.txt flash_signed.sh - fi - else - return 1 - fi - if ! copy_bootloader_files bootloader_staging; then - return 1 - fi - . ./boardvars.sh - return 0 -} - -prepare_for_rcm_boot() { - if [ $have_odmsign_func -eq 1 ]; then - local dtbfile_for_rcmboot=kernel_$DTBFILE - if [ "$CHIPID" = "0x19" ]; then - cp kernel_$DTBFILE rcm_kernel_$DTBFILE - dtbfile_for_rcmboot=rcm_kernel_$DTBFILE - fi - "$here/rewrite-tegraflash-args" -o rcm-boot.sh --bins kernel=initrd-flash.img,kernel_dtb=$dtbfile_for_rcmboot --cmd rcmboot --add="--securedev" flash_signed.sh || return 1 - if [ "$CHIPID" = "0x23" ]; then - sed -i -e's,mb2_t234_with_mb2_bct_MB2,mb2_t234_with_mb2_cold_boot_bct_MB2,' -e's, uefi_jetson, rcmboot_uefi_jetson,' rcm-boot.sh || return 1 - fi - chmod +x rcm-boot.sh - fi -} - -run_rcm_boot() { - if [ $have_odmsign_func -eq 1 ]; then - if [ -z "$BR_CID" ]; then - if ./rcm-boot.sh | tee rcm-boot.output; then - BR_CID=$(grep BR_CID: rcm-boot.output | cut -d: -f2) - return 0 - else - return 1 - fi - fi - ./rcm-boot.sh || return 1 - else - MACHINE=$MACHINE BOARDID=$BOARDID FAB=$FAB BOARDSKU=$BOARDSKU BOARDREV=$BOARDREV CHIPREV=$CHIPREV CHIP_SKU=$CHIP_SKU \ - "$here/$FLASH_HELPER" --rcm-boot -u "$keyfile" -v "$sbk_keyfile" \ - flash.xml.in $DTBFILE $EMMC_BCTS $ODMDATA initrd-flash.img $ROOTFS_IMAGE || return 1 - fi -} - -mount_partition() { - local dev="$1" - local mnt=$(cat /proc/mounts | grep "^$dev" | cut -d' ' -f2) - local i=$(echo $mnt|awk -F' ' '{print NF}') - while [ $i -ne 0 ]; do - local mnt=$(echo ${mnt} | cut -d' ' -f$i) - if ! umount "${mnt}" > /dev/null 2>&1; then - echo "ERR: unmount ${mnt} on device $dev failed" >&2 - return 1 - fi - i=$(expr $i - 1) - done - if udisksctl mount -b "$dev" > /dev/null; then - cat /proc/mounts | grep "^$dev" | cut -d' ' -f2 - return 0 - fi - echo "" - return 1 -} - -unmount_and_release() { - local mnt="$1" - local dev="$2" - local remain=3 - if [ -n "$mnt" ]; then - udisksctl unmount --force -b "$dev" - fi - while [ $remain -gt 0 ]; do - if udisksctl power-off -b "$dev"; then - return 0 - fi - sleep 1 - remain=$(expr $remain - 1) - done - return 1 -} - -wait_for_usb_storage() { - local sessid="$1" - local name="$2" - local count=0 - local output candidate cand_model cand_vendor - - echo -n "Waiting for USB storage device $name from $sessid..." >&2 - while [ -z "$output" ]; do - for candidate in /dev/sd[a-z]; do - [ -b "$candidate" ] || continue - cand_model=$(udevadm info --query=property $candidate | grep '^ID_MODEL=' | cut -d= -f2) - if [ "$cand_model" = "$sessid" ]; then - cand_vendor=$(udevadm info --query=property $candidate | grep '^ID_VENDOR=' | cut -d= -f2) - if [ "$cand_vendor" = "$name" ]; then - echo "[$candidate]" >&2 - output="$candidate" - break - elif [ "$name" != "flashpkg" -a "$cand_vendor" = "flashpkg" ]; then - # This could happen if there was a failure on the device side - echo "[got flashpkg when expecting $name]" >&2 - echo "" - early_final_status=1 - return 1 - fi - fi - done - if [ -z "$output" ]; then - sleep 1 - count=$(expr $count \+ 1) - if [ $count -ge 5 ]; then - echo -n "." >&2 - count=0 - fi - fi - done - echo "$output" - return 0 -} - -copy_bootloader_files() { - local dest="$1" - local partnumber partloc partname start_location partsize partfile partattrs partsha - local devnum instnum - local is_spi is_mmcboot - rm -f "$dest/partitions.conf" - while IFS=", " read partnumber partloc start_location partsize partfile partattrs partsha; do - # Need to trim off leading blanks - devnum=$(echo "$partloc" | cut -d':' -f 1) - instnum=$(echo "$partloc" | cut -d':' -f 2) - partname=$(echo "$partloc" | cut -d':' -f 3) - # SPI is 3:0 - # eMMC boot blocks (boot0/boot1) are 0:3 - # eMMC user is 1:3 - # NVMe (any external device) is 9:0 - if [ $devnum -eq 3 -a $instnum -eq 0 ] || [ $devnum -eq 0 -a $instnum -eq 3 ]; then - if [ -n "$partfile" ]; then - cp "$partfile" "$dest/" - fi - if [ $devnum -eq 3 -a $instnum -eq 0 ]; then - is_spi=yes - elif [ $devnum -eq 0 -a $instnum -eq 3 ]; then - is_mmcboot=yes - fi - echo "$partname:$start_location:$partsize:$partfile" >> "$dest/partitions.conf" - fi - done < flash.idx - if [ -n "$is_spi" ]; then - if [ -n "$is_mmcboot" ]; then - echo "ERR: found bootloader entries for both SPI flash and eMMC boot partitions" >&2 - return 1 - fi - echo "spi" > "$dest/boot_device_type" - elif [ -n "$is_mmcboot" ]; then - echo "mmcboot" > "$dest/boot_device_type" - else - echo "ERR: no SPI or eMMC boot partition entries found" >&2 - return 1 - fi - return 0 -} - -generate_flash_package() { - local dev=$(wait_for_usb_storage "$session_id" "flashpkg") - local exports - - if [ -z "$dev" ]; then - echo "ERR: could not locate USB storage device for sending flashing commands" >&2 - return 1 - fi - local devsize=$(cat /sys/block/$(basename $dev)/size 2>/dev/null) - echo "Device size in blocks: $devsize" >&2 - local mnt=$(mount_partition "$dev") - if [ -z "$mnt" ]; then - echo "ERR: could not mount USB storage for writing flashing commands" >&2 - return 1 - fi - - mkdir "$mnt/flashpkg/conf" - rm -f "$mnt/flashpkg/conf/command_sequence" - touch "$mnt/flashpkg/conf/command_sequence" - if [ $skip_bootloader -eq 0 ]; then - echo "bootloader" >> "$mnt/flashpkg/conf/command_sequence" - mkdir "$mnt/flashpkg/bootloader" - cp bootloader_staging/* "$mnt/flashpkg/bootloader" - fi - - if [ -n "$format_mmc_part" ]; then - echo "format-mmc-part $format_mmc_part" >> "$mnt/flashpkg/conf/command_sequence" - fi - if [ $erase_nvme -eq 1 ]; then - echo "erase-nvme" >> "$mnt/flashpkg/conf/command_sequence" - fi - if [ $EXTERNAL_ROOTFS_DRIVE -eq 1 -a $BOOT_PARTITIONS_ON_EMMC -eq 1 ]; then - echo "export-devices mmcblk0 $ROOTFS_DEVICE" >> "$mnt/flashpkg/conf/command_sequence" - else - [ $EXTERNAL_ROOTFS_DRIVE -eq 0 -o $NO_INTERNAL_STORAGE -eq 1 ] || echo "erase-mmc" >> "$mnt/flashpkg/conf/command_sequence" - echo "export-devices $ROOTFS_DEVICE" >> "$mnt/flashpkg/conf/command_sequence" - fi - - echo "extra" >> "$mnt/flashpkg/conf/command_sequence" - echo "reboot" >> "$mnt/flashpkg/conf/command_sequence" - - unmount_and_release "$mnt" "$dev" || return 1 -} - -write_wic_to_device() { - local devname="$1" - local dev=$(wait_for_usb_storage "$session_id" "$devname") - local rc=0 - - if [ -z "$dev" ]; then - echo "ERR: could not find $devname" >&2 - return 1 - fi - - # Flash the actual wic - bmaptool copy --nobmap $ROOTFS_IMAGE $dev - - if ! unmount_and_release "" "$dev"; then - rc=1 - fi - return $rc -} - -write_to_device() { - local devname="$1" - local flashlayout="$2" - local dev=$(wait_for_usb_storage "$session_id" "$devname") - local opts="$3" - local rewritefiles="secureflash.xml" - local datased simgname rc=1 - local extraarg - - if [ -z "$dev" ]; then - echo "ERR: could not find $devname" >&2 - return 1 - fi - if [ -e external-secureflash.xml ]; then - rewritefiles="external-secureflash.xml,$rewritefiles" - fi - "$here/nvflashxmlparse" --rewrite-contents-from=$rewritefiles -o initrd-flash.xml "$flashlayout" - if [ -n "$DATAFILE" ]; then - datased="-es,DATAFILE,$DATAFILE," - else - datased="-e/DATAFILE/d" - fi - if [ "$devname" = "mmcblk0" -a $BOOT_PARTITIONS_ON_EMMC -eq 1 ]; then - extraarg="--honor-start-locations" - fi - - # Drop rootfs flashing when required via external wic - if [ $EXTERNAL_ROOTFS_WIC_FLASH -eq 1 ]; then - sed -i -e"s,APPFILE_b,," -e"s,APPFILE,," $datased initrd-flash.xml - else - # XXX - # For the pre-signed case, the flash layout will contain the - # name of the sparseimage file, and we need to convert it back to - # the raw image name. - # XXX - simgname="${ROOTFS_IMAGE%.*}.img" - sed -i -e"s,$simgname,$ROOTFS_IMAGE," -e"s,APPFILE_b,$ROOTFS_IMAGE," -e"s,APPFILE,$ROOTFS_IMAGE," -e"s,DTB_FILE,kernel_$DTBFILE," $datased initrd-flash.xml - fi - if "$here/make-sdcard" -y $opts $extraarg initrd-flash.xml "$dev"; then - rc=0 - fi - if ! unmount_and_release "" "$dev"; then - rc=1 - fi - return $rc -} - -get_final_status() { - local dtstamp="$1" - local dev=$(wait_for_usb_storage "$session_id" "flashpkg") - local mnt final_status logdir logfile - if [ -z "$dev" ]; then - echo "ERR: could not get final status from device" >&2 - return 1 - fi - mnt=$(mount_partition "$dev") - if [ -z "$mnt" ]; then - echo "ERR: could not mount USB device to get final status from device" >&2 - return 1 - fi - final_status=$(cat $mnt/flashpkg/status) - if [ -d "$mnt/flashpkg/logs" ]; then - logdir="device-logs-$dtstamp" - if [ -d "$logdir" ]; then - echo "Logs directory $logdir already exists, replacing" >&2 - rm -rf "$logdir" - fi - mkdir "$logdir" - for logfile in "$mnt"/flashpkg/logs/*; do - [ -f "$logfile" ] || continue - cp "$logfile" "$logdir/" - done - fi - unmount_and_release "$mnt" "$dev" || return 1 - echo "Final status: $final_status" - return 0 -} - -dtstamp=$(date +"%Y-%m-%d-%H.%M.%S") -logfile="log.initrd-flash.$dtstamp" -stepnumber=1 - -step_banner() { - local msg="$1" - echo "== Step $stepnumber: $msg at $(date -Is) ==" | tee -a "$logfile" - stepnumber=$(expr $stepnumber \+ 1) -} - -echo "Starting at $(date -Is)" | tee "$logfile" -echo "Machine: ${MACHINE}" | tee "$logfile" -echo "Rootfs device: ${BOOTDEV}" | tee "$logfile" -if ! wait_for_rcm 2>&1 | tee -a "$logfile"; then - echo "ERR: Device not found at $(date -Is)" | tee -a "$logfile" - exit 1 -fi -if [ -z "$usb_instance" -a -e ".found-jetson" ]; then - . .found-jetson -fi -if [ -n "$usb_instance" ]; then - instance_args="--usb-instance $usb_instance" -fi -step_banner "Signing binaries" -rm -rf bootloader_staging -mkdir bootloader_staging -if ! sign_binaries 2>&1 >>"$logfile"; then - echo "ERR: signing failed at $(date -Is)" | tee -a "$logfile" - exit 1 -fi -if [ -z "$PRESIGNED" ]; then - [ ! -f ./boardvars.sh ] || . ./boardvars.sh -fi -step_banner "Boot Jetson via RCM" -if ! prepare_for_rcm_boot 2>&1 >>"$logfile"; then - echo "ERR: Preparing RCM boot command failed at $(date -Is)" | tee -a "$logfile" - exit 1 -fi -if ! wait_for_rcm 2>&1 | tee -a "$logfile"; then - echo "ERR: Device not found at $(date -Is)" | tee -a "$logfile" - exit 1 -fi -if ! run_rcm_boot 2>&1 >>"$logfile"; then - echo "ERR: RCM boot failed at $(date -Is)" | tee -a "$logfile" - exit 1 -fi -[ ! -f ./boardvars.sh ] || . ./boardvars.sh - -if [ -z "$BR_CID" ]; then - echo "ERR: did not get unique ID at $(date -Is)" | tee -a "$logfile" - exit 1 -fi - -session_id=$("$here/brcid-to-uid" $BR_CID) -session_id=$(echo -n "$session_id" | tail -c8) - -# Boot device flashing -step_banner "Sending flash sequence commands" -if ! generate_flash_package 2>&1 | tee -a "$logfile"; then - echo "ERR: could not create command package at $(date -Is)" | tee -a "$logfile" - exit 1 -fi -if [ $EXTERNAL_ROOTFS_DRIVE -eq 1 ]; then - keep_going=1 - if [ $BOOT_PARTITIONS_ON_EMMC -eq 1 ]; then - step_banner "Writing boot partitions to internal storage device" - if ! write_to_device mmcblk0 flash.xml.in --no-final-part 2>&1 | tee -a "$logfile"; then - echo "ERR: write failure to internal storage at $(date -Is)" | tee -a "$logfile" - if [ $early_final_status -eq 0 ]; then - exit 1 - fi - fi - fi - if [ $early_final_status -eq 0 ]; then - step_banner "Writing partitions on external storage device" - if [ $EXTERNAL_ROOTFS_WIC_FLASH -eq 1 ]; then - if ! write_wic_to_device $ROOTFS_DEVICE 2>&1 | tee -a "$logfile"; then - echo "ERR: wic write failure to external storage at $(date -Is)" | tee -a "$logfile" - if [ $early_final_status -eq 0 ]; then - exit 1 - fi - fi - else - if ! write_to_device $ROOTFS_DEVICE external-flash.xml.in 2>&1 | tee -a "$logfile"; then - echo "ERR: write failure to external storage at $(date -Is)" | tee -a "$logfile" - if [ $early_final_status -eq 0 ]; then - exit 1 - fi - fi - fi - fi -else - step_banner "Writing partitions on internal storage device" - if ! write_to_device $ROOTFS_DEVICE flash.xml.in 2>&1 | tee -a "$logfile"; then - echo "ERR: write failure to internal storage at $(date -Is)" | tee -a "$logfile" - if [ $early_final_status -eq 0 ]; then - exit 1 - fi - fi -fi -step_banner "Waiting for final status from device" -if ! get_final_status "$dtstamp" 2>&1 | tee -a "$logfile"; then - echo "ERR: failed to retrieve device status at $(date -Is)" | tee -a "$logfile" - echo "Host-side log: $logfile" - echo "Device-side logs stored in: device-logs-$dtstamp" - exit 1 -fi -echo "Successfully finished at $(date -Is)" | tee -a "$logfile" -echo "Host-side log: $logfile" -echo "Device-side logs stored in: device-logs-$dtstamp" -exit 0 diff --git a/meta-lmp-bsp/dynamic-layers/tegra/recipes-core/initrdscripts/tegra-flash-init/add-format-mmc-support.patch b/meta-lmp-bsp/dynamic-layers/tegra/recipes-core/initrdscripts/tegra-flash-init/add-format-mmc-support.patch deleted file mode 100644 index bd5c97cfac..0000000000 --- a/meta-lmp-bsp/dynamic-layers/tegra/recipes-core/initrdscripts/tegra-flash-init/add-format-mmc-support.patch +++ /dev/null @@ -1,23 +0,0 @@ -Add support for formating mmc partitions. - -Upstream-Status: Pending - -diff --git a/init-flash.sh b/init-flash.sh -index dd4ebc9c..eb130086 100644 ---- a/init-flash.sh -+++ b/init-flash.sh -@@ -158,6 +158,14 @@ else - echo "/dev/mmcblk0 does not exist, skipping" > /tmp/flashpkg/flashpkg/logs/erase-mmc.log - fi - ;; -+ format-mmc-part) -+ mmcpart=$args -+ if [ -b /dev/$mmcpart ]; then -+ mkfs.ext4 /dev/$mmcpart 2>&1 > /tmp/flashpkg/flashpkg/logs/format-mmc-part.log -+ else -+ echo "$mmcpart does not exist, skipping" > /tmp/flashpkg/flashpkg/logs/format-mmc-part.log -+ fi -+ ;; - erase-nvme) - if [ -b /dev/nvme0n1 ]; then - blkdiscard -f /dev/nvme0n1 2>&1 > /tmp/flashpkg/flashpkg/logs/erase-nvme.log diff --git a/meta-lmp-bsp/dynamic-layers/tegra/recipes-core/initrdscripts/tegra-flash-init_%.bbappend b/meta-lmp-bsp/dynamic-layers/tegra/recipes-core/initrdscripts/tegra-flash-init_%.bbappend deleted file mode 100644 index c180cb3115..0000000000 --- a/meta-lmp-bsp/dynamic-layers/tegra/recipes-core/initrdscripts/tegra-flash-init_%.bbappend +++ /dev/null @@ -1,3 +0,0 @@ -FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" - -SRC_URI += "file://add-format-mmc-support.patch" diff --git a/meta-lmp-bsp/dynamic-layers/tegra/recipes-security/optee/optee-os_3.21.0-l4t-r35.5.0.bbappend b/meta-lmp-bsp/dynamic-layers/tegra/recipes-security/optee/optee-os_3.21.0-l4t-r35.6.0.bbappend similarity index 100% rename from meta-lmp-bsp/dynamic-layers/tegra/recipes-security/optee/optee-os_3.21.0-l4t-r35.5.0.bbappend rename to meta-lmp-bsp/dynamic-layers/tegra/recipes-security/optee/optee-os_3.21.0-l4t-r35.6.0.bbappend diff --git a/meta-lmp-bsp/dynamic-layers/tegra/recipes-security/optee/optee-test_3.21.0-l4t-r35.5.0.bbappend b/meta-lmp-bsp/dynamic-layers/tegra/recipes-security/optee/optee-test_3.21.0-l4t-r35.6.0.bbappend similarity index 100% rename from meta-lmp-bsp/dynamic-layers/tegra/recipes-security/optee/optee-test_3.21.0-l4t-r35.5.0.bbappend rename to meta-lmp-bsp/dynamic-layers/tegra/recipes-security/optee/optee-test_3.21.0-l4t-r35.6.0.bbappend diff --git a/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-fio-bsp-common.inc b/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-fio-bsp-common.inc index 8999fd1ffd..f7ef8e4300 100644 --- a/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-fio-bsp-common.inc +++ b/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-fio-bsp-common.inc @@ -24,7 +24,7 @@ deploy_nxp_imx() { if [ ! -f "${DEPLOYDIR}/${BOOT_TOOLS}/${dtb_name}" ]; then # When sign is enabled the final DTB should be copied from deploy dir if [ "${UBOOT_SIGN_ENABLE}" = "1" ]; then - install -m 0644 ${DEPLOY_DIR_IMAGE}/${UBOOT_DTB_IMAGE} ${DEPLOYDIR}/${BOOT_TOOLS}/${dtb_name} + install -m 0644 ${DEPLOYDIR}/${UBOOT_DTB_IMAGE} ${DEPLOYDIR}/${BOOT_TOOLS}/${dtb_name} else install -m 0644 ${B}/${config}/arch/arm/dts/${dtb_name} ${DEPLOYDIR}/${BOOT_TOOLS}/${dtb_name} fi @@ -47,7 +47,7 @@ deploy_nxp_imx() { install -d ${DEPLOYDIR}/${BOOT_TOOLS} # When sign is enabled the final DTB should be copied from deploy dir if [ "${UBOOT_SIGN_ENABLE}" = "1" ]; then - install -m 0644 ${DEPLOY_DIR_IMAGE}/${UBOOT_DTB_IMAGE} ${DEPLOYDIR}/${BOOT_TOOLS}/${UBOOT_DTB_NAME} + install -m 0644 ${DEPLOYDIR}/${UBOOT_DTB_IMAGE} ${DEPLOYDIR}/${BOOT_TOOLS}/${UBOOT_DTB_NAME} else install -m 0644 ${B}/arch/arm/dts/${UBOOT_DTB_NAME} ${DEPLOYDIR}/${BOOT_TOOLS} fi diff --git a/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-fio/rpi/lmp.cfg b/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-fio/rpi/lmp.cfg index e77749b27f..a56df58626 100644 --- a/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-fio/rpi/lmp.cfg +++ b/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-fio/rpi/lmp.cfg @@ -5,3 +5,4 @@ CONFIG_BOOTCOUNT_BOOTLIMIT=3 CONFIG_OF_BOARD=y # CONFIG_USE_PREBOOT is not set CONFIG_BOOTCOMMAND="fatload mmc 0:1 ${loadaddr} /boot.itb; setenv verify 1; source ${loadaddr}; env default -a; saveenv; reset" +CONFIG_VIDEO=y diff --git a/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-ostree-scr-fit/qemuarm/boot.cmd b/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-ostree-scr-fit/qemuarm/boot.cmd index e571afa01c..413a03a47e 100644 --- a/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-ostree-scr-fit/qemuarm/boot.cmd +++ b/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-ostree-scr-fit/qemuarm/boot.cmd @@ -6,7 +6,7 @@ setenv devnum 0 setenv bootcmd_resetvars 'setenv kernel_image; setenv bootargs; setenv kernel_image2; setenv bootargs2' setenv bootcmd_otenv 'run bootcmd_resetvars; ext4load ${devtype} ${devnum}:2 ${scriptaddr} /boot/loader/uEnv.txt; env import -t ${scriptaddr} ${filesize} kernel_image bootargs kernel_image2 bootargs2' setenv bootcmd_load_f 'ext4load ${devtype} ${devnum}:2 ${ramdisk_addr_r} "/boot"${kernel_image}' -setenv bootcmd_run 'bootm ${ramdisk_addr_r}#conf- ${ramdisk_addr_r}#conf- ${fdt_addr}' +setenv bootcmd_run 'bootm ${ramdisk_addr_r}#conf-1 ${ramdisk_addr_r}#conf-1 ${fdt_addr}' setenv bootcmd_rollbackenv 'setenv kernel_image ${kernel_image2}; setenv bootargs ${bootargs2}' setenv bootcmd_set_rollback 'if test ! "${rollback}" = "1"; then setenv rollback 1; setenv upgrade_available 0; saveenv; fi' setenv bootostree 'run bootcmd_load_f; run bootcmd_run' diff --git a/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-ostree-scr-fit/qemuarm64/boot.cmd b/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-ostree-scr-fit/qemuarm64/boot.cmd index a01578ee63..97e686dcd5 100644 --- a/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-ostree-scr-fit/qemuarm64/boot.cmd +++ b/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-ostree-scr-fit/qemuarm64/boot.cmd @@ -9,7 +9,7 @@ setenv bootcmd_resetvars 'setenv kernel_image; setenv bootdir; setenv bootargs; setenv bootcmd_otenv 'run bootcmd_resetvars; ext4load ${devtype} ${devnum}:2 ${scriptaddr} /boot/loader/uEnv.txt; env import -t ${scriptaddr} ${filesize} kernel_image bootdir bootargs kernel_image2 bootdir2 bootargs2' setenv bootcmd_load_f 'ext4load ${devtype} ${devnum}:2 ${ramdisk_addr_r} ${kernel_image}' setenv bootcmd_load_r 'ext4load ${devtype} ${devnum}:2 ${ramdisk_addr_r} ${bootdir}/recovery.img' -setenv bootcmd_run 'bootm ${ramdisk_addr_r}#conf- ${ramdisk_addr_r}#conf- ${fdt_addr}' +setenv bootcmd_run 'bootm ${ramdisk_addr_r}#conf-1 ${ramdisk_addr_r}#conf-1 ${fdt_addr}' setenv bootcmd_rollbackenv 'setenv kernel_image ${kernel_image2}; setenv bootdir ${bootdir2}; setenv bootargs ${bootargs2}' setenv bootcmd_set_rollback 'if test ! "${rollback}" = "1"; then setenv rollback 1; setenv upgrade_available 0; saveenv; fi' setenv bootostree 'if test "${recovery}" = "1"; then run bootcmd_load_r; setenv recovery; saveenv; else run bootcmd_load_f; fi; run bootcmd_run' diff --git a/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-ostree-scr-fit/qemuriscv64/boot.cmd b/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-ostree-scr-fit/qemuriscv64/boot.cmd index b31d925817..d0f9fc3ad9 100644 --- a/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-ostree-scr-fit/qemuriscv64/boot.cmd +++ b/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-ostree-scr-fit/qemuriscv64/boot.cmd @@ -11,7 +11,7 @@ setenv bootcmd_updfdt 'cp ${fdtcontroladdr} ${fdt_addr_r} 1000' setenv bootcmd_resetvars 'setenv kernel_image; setenv bootargs; setenv kernel_image2; setenv bootargs2' setenv bootcmd_otenv 'run bootcmd_resetvars; ext4load ${devtype} ${devnum}:2 ${scriptaddr} /boot/loader/uEnv.txt; env import -t ${scriptaddr} ${filesize} kernel_image bootargs kernel_image2 bootargs2' setenv bootcmd_load_f 'ext4load ${devtype} ${devnum}:2 ${ramdisk_addr_r} "/boot"${kernel_image}' -setenv bootcmd_run 'bootm ${ramdisk_addr_r}#conf- ${ramdisk_addr_r}#conf- ${fdt_addr_r}' +setenv bootcmd_run 'bootm ${ramdisk_addr_r}#conf-1 ${ramdisk_addr_r}#conf-1 ${fdt_addr_r}' setenv bootcmd_rollbackenv 'setenv kernel_image ${kernel_image2}; setenv bootargs ${bootargs2}' setenv bootcmd_set_rollback 'if test ! "${rollback}" = "1"; then setenv rollback 1; setenv upgrade_available 0; saveenv; fi' setenv bootostree 'run bootcmd_load_f; run bootcmd_run' diff --git a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-rpi_git.bb b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-rpi_git.bb index 7a0b6bf911..1193d14c2a 100644 --- a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-rpi_git.bb +++ b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-rpi_git.bb @@ -1,8 +1,8 @@ -include recipes-kernel/linux/kmeta-linux-lmp-6.1.y.inc +include recipes-kernel/linux/kmeta-linux-lmp-6.6.y.inc -LINUX_VERSION ?= "6.1.77" -KBRANCH = "rpi-6.1.y" -SRCREV_machine = "77fc1fbcb5c013329af9583307dd1ff3cd4752aa" +LINUX_VERSION ?= "6.6.22" +KBRANCH = "rpi-6.6.y" +SRCREV_machine = "c04af98514c26014a4f29ec87b3ece95626059bd" SRCREV_meta = "${KERNEL_META_COMMIT}" LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46" diff --git a/meta-lmp-bsp/recipes-security/optee/optee-client_3.21.0.bbappend b/meta-lmp-bsp/recipes-security/optee/optee-client_4.2.0.bbappend similarity index 100% rename from meta-lmp-bsp/recipes-security/optee/optee-client_3.21.0.bbappend rename to meta-lmp-bsp/recipes-security/optee/optee-client_4.2.0.bbappend diff --git a/meta-lmp-bsp/recipes-security/optee/optee-os-fio-mfgtool_3.21.0%.bbappend b/meta-lmp-bsp/recipes-security/optee/optee-os-fio-mfgtool_4.2.0%.bbappend similarity index 100% rename from meta-lmp-bsp/recipes-security/optee/optee-os-fio-mfgtool_3.21.0%.bbappend rename to meta-lmp-bsp/recipes-security/optee/optee-os-fio-mfgtool_4.2.0%.bbappend diff --git a/meta-lmp-bsp/recipes-security/optee/optee-os-fio-mfgtool_3.21.0-imx.bb b/meta-lmp-bsp/recipes-security/optee/optee-os-fio-mfgtool_4.2.0-imx.bb similarity index 100% rename from meta-lmp-bsp/recipes-security/optee/optee-os-fio-mfgtool_3.21.0-imx.bb rename to meta-lmp-bsp/recipes-security/optee/optee-os-fio-mfgtool_4.2.0-imx.bb diff --git a/meta-lmp-bsp/recipes-security/optee/optee-os-fio_3.21.0-imx.bb b/meta-lmp-bsp/recipes-security/optee/optee-os-fio_3.21.0-imx.bb deleted file mode 100644 index 99301a0404..0000000000 --- a/meta-lmp-bsp/recipes-security/optee/optee-os-fio_3.21.0-imx.bb +++ /dev/null @@ -1,6 +0,0 @@ -require recipes-security/optee/optee-os-fio.inc - -SRCREV = "380f236654c9fb3221848bc50ad9c4b759ac848d" -SRCBRANCH = "3.21+fio-imx" - -DEFAULT_PREFERENCE = "-1" diff --git a/meta-lmp-bsp/recipes-security/optee/optee-os-fio_3.21.0%.bbappend b/meta-lmp-bsp/recipes-security/optee/optee-os-fio_4.2.0%.bbappend similarity index 100% rename from meta-lmp-bsp/recipes-security/optee/optee-os-fio_3.21.0%.bbappend rename to meta-lmp-bsp/recipes-security/optee/optee-os-fio_4.2.0%.bbappend diff --git a/meta-lmp-bsp/recipes-security/optee/optee-os-fio_4.2.0-imx.bb b/meta-lmp-bsp/recipes-security/optee/optee-os-fio_4.2.0-imx.bb new file mode 100644 index 0000000000..1251fb7b5d --- /dev/null +++ b/meta-lmp-bsp/recipes-security/optee/optee-os-fio_4.2.0-imx.bb @@ -0,0 +1,6 @@ +require recipes-security/optee/optee-os-fio.inc + +SRCREV = "5891192fbbc290cab0567744dec5be784b72b311" +SRCBRANCH = "4.2.0+fio-imx-wip" + +DEFAULT_PREFERENCE = "-1" diff --git a/meta-lmp-bsp/recipes-security/optee/optee-os-tadevkit_3.21.0%.bbappend b/meta-lmp-bsp/recipes-security/optee/optee-os-tadevkit_4.2.0%.bbappend similarity index 100% rename from meta-lmp-bsp/recipes-security/optee/optee-os-tadevkit_3.21.0%.bbappend rename to meta-lmp-bsp/recipes-security/optee/optee-os-tadevkit_4.2.0%.bbappend diff --git a/meta-lmp-bsp/recipes-security/optee/optee-os-tadevkit_3.21.0-imx.bb b/meta-lmp-bsp/recipes-security/optee/optee-os-tadevkit_4.2.0-imx.bb similarity index 53% rename from meta-lmp-bsp/recipes-security/optee/optee-os-tadevkit_3.21.0-imx.bb rename to meta-lmp-bsp/recipes-security/optee/optee-os-tadevkit_4.2.0-imx.bb index 67feec1f62..7c75deb03d 100644 --- a/meta-lmp-bsp/recipes-security/optee/optee-os-tadevkit_3.21.0-imx.bb +++ b/meta-lmp-bsp/recipes-security/optee/optee-os-tadevkit_4.2.0-imx.bb @@ -1,6 +1,6 @@ # Needed an explicit PV setting due the require/include chain -PV = "3.21.0-imx" +PV = "4.2.0-imx" -require recipes-security/optee/optee-os-tadevkit_3.21.0.bb +require recipes-security/optee/optee-os-tadevkit_4.2.0.bb DEFAULT_PREFERENCE = "-1" diff --git a/meta-lmp-bsp/recipes-security/optee/optee-test_3.21.0.bbappend b/meta-lmp-bsp/recipes-security/optee/optee-test_4.2.0.bbappend similarity index 100% rename from meta-lmp-bsp/recipes-security/optee/optee-test_3.21.0.bbappend rename to meta-lmp-bsp/recipes-security/optee/optee-test_4.2.0.bbappend diff --git a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx6ulevk/full_image.uuu.in b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx6ulevk/full_image.uuu.in index e3fbe5895e..bcd2bee464 100644 --- a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx6ulevk/full_image.uuu.in +++ b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx6ulevk/full_image.uuu.in @@ -9,7 +9,7 @@ SDPV: jump FB: ucmd if mmc dev 0; then setenv flash_dev 0; setenv emmc_partconf "mmc partconf ${flash_dev} ${emmc_ack} 1 0"; else setenv flash_dev 1; setenv emmc_partconf "true"; fi; FB: ucmd setenv fastboot_dev mmc FB: ucmd mmc dev ${flash_dev} -FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.wic.gz/* +FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.rootfs.wic.gz/* FB: ucmd mmc dev ${flash_dev} 1; mmc erase 2 0x1FFE FB: flash bootloader ../SPL-@@MACHINE@@ FB: flash bootloader2 ../u-boot-@@MACHINE@@.itb diff --git a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx6ullevk/full_image.uuu.in b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx6ullevk/full_image.uuu.in index e3fbe5895e..bcd2bee464 100644 --- a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx6ullevk/full_image.uuu.in +++ b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx6ullevk/full_image.uuu.in @@ -9,7 +9,7 @@ SDPV: jump FB: ucmd if mmc dev 0; then setenv flash_dev 0; setenv emmc_partconf "mmc partconf ${flash_dev} ${emmc_ack} 1 0"; else setenv flash_dev 1; setenv emmc_partconf "true"; fi; FB: ucmd setenv fastboot_dev mmc FB: ucmd mmc dev ${flash_dev} -FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.wic.gz/* +FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.rootfs.wic.gz/* FB: ucmd mmc dev ${flash_dev} 1; mmc erase 2 0x1FFE FB: flash bootloader ../SPL-@@MACHINE@@ FB: flash bootloader2 ../u-boot-@@MACHINE@@.itb diff --git a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mm-lpddr4-evk-sec/full_image.uuu.in b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mm-lpddr4-evk-sec/full_image.uuu.in index f65933a94a..3a3491b265 100644 --- a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mm-lpddr4-evk-sec/full_image.uuu.in +++ b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mm-lpddr4-evk-sec/full_image.uuu.in @@ -21,7 +21,7 @@ FB[-t 50000]: ucmd if test -n "${fiovb_rpmb}"; then fiovb delete_pvalue bootfirm FB[-t 50000]: ucmd if test -n "${fiovb_rpmb}"; then fiovb write_pvalue debug 0; else true; fi FB[-t 50000]: ucmd if test -n "${fiovb_rpmb}"; then fiovb write_pvalue is_secondary_boot 0; else true; fi -FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.wic.gz/* +FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.rootfs.wic.gz/* FB: flash bootloader ../imx-boot-@@MACHINE@@.signed FB: flash bootloader2 ../u-boot-@@MACHINE@@.itb FB: flash bootloader_s ../imx-boot-@@MACHINE@@.signed diff --git a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mm-lpddr4-evk/full_image.uuu.in b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mm-lpddr4-evk/full_image.uuu.in index 1102fa9fc6..5818dd5a43 100644 --- a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mm-lpddr4-evk/full_image.uuu.in +++ b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mm-lpddr4-evk/full_image.uuu.in @@ -9,7 +9,7 @@ SDPV: jump FB: ucmd setenv fastboot_dev mmc FB: ucmd setenv mmcdev ${emmc_dev} FB: ucmd mmc dev ${emmc_dev} 1; mmc erase 0 0x2000 -FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.wic.gz/* +FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.rootfs.wic.gz/* FB: flash bootloader ../imx-boot-@@MACHINE@@ FB: flash bootloader2 ../u-boot-@@MACHINE@@.itb FB: flash bootloader_s ../imx-boot-@@MACHINE@@ diff --git a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mn-ddr4-evk-sec/full_image.uuu.in b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mn-ddr4-evk-sec/full_image.uuu.in index 5841a41044..18f55cf0a2 100644 --- a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mn-ddr4-evk-sec/full_image.uuu.in +++ b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mn-ddr4-evk-sec/full_image.uuu.in @@ -17,7 +17,7 @@ FB[-t 50000]: ucmd if test -n "${fiovb_rpmb}"; then fiovb delete_pvalue bootfirm FB[-t 50000]: ucmd if test -n "${fiovb_rpmb}"; then fiovb write_pvalue debug 0; else true; fi FB[-t 50000]: ucmd if test -n "${fiovb_rpmb}"; then fiovb write_pvalue is_secondary_boot 0; else true; fi -FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.wic.gz/* +FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.rootfs.wic.gz/* FB: flash bootloader ../imx-boot-@@MACHINE@@.signed FB: flash bootloader2 ../u-boot-@@MACHINE@@.itb FB: flash bootloader_s ../imx-boot-@@MACHINE@@.signed diff --git a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mn-ddr4-evk/full_image.uuu.in b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mn-ddr4-evk/full_image.uuu.in index af249037ae..38d9f3c1e8 100644 --- a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mn-ddr4-evk/full_image.uuu.in +++ b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mn-ddr4-evk/full_image.uuu.in @@ -5,7 +5,7 @@ SDPS: boot -f imx-boot-mfgtool FB: ucmd setenv fastboot_dev mmc FB: ucmd setenv mmcdev ${emmc_dev} FB: ucmd mmc dev ${emmc_dev} 1; mmc erase 0 0x2000 -FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.wic.gz/* +FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.rootfs.wic.gz/* FB: flash bootloader ../imx-boot-@@MACHINE@@ FB: flash bootloader2 ../u-boot-@@MACHINE@@.itb FB: flash bootloader_s ../imx-boot-@@MACHINE@@ diff --git a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mn-lpddr4-evk-sec/full_image.uuu.in b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mn-lpddr4-evk-sec/full_image.uuu.in index 5841a41044..18f55cf0a2 100644 --- a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mn-lpddr4-evk-sec/full_image.uuu.in +++ b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mn-lpddr4-evk-sec/full_image.uuu.in @@ -17,7 +17,7 @@ FB[-t 50000]: ucmd if test -n "${fiovb_rpmb}"; then fiovb delete_pvalue bootfirm FB[-t 50000]: ucmd if test -n "${fiovb_rpmb}"; then fiovb write_pvalue debug 0; else true; fi FB[-t 50000]: ucmd if test -n "${fiovb_rpmb}"; then fiovb write_pvalue is_secondary_boot 0; else true; fi -FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.wic.gz/* +FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.rootfs.wic.gz/* FB: flash bootloader ../imx-boot-@@MACHINE@@.signed FB: flash bootloader2 ../u-boot-@@MACHINE@@.itb FB: flash bootloader_s ../imx-boot-@@MACHINE@@.signed diff --git a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mn-lpddr4-evk/full_image.uuu.in b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mn-lpddr4-evk/full_image.uuu.in index af249037ae..38d9f3c1e8 100644 --- a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mn-lpddr4-evk/full_image.uuu.in +++ b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mn-lpddr4-evk/full_image.uuu.in @@ -5,7 +5,7 @@ SDPS: boot -f imx-boot-mfgtool FB: ucmd setenv fastboot_dev mmc FB: ucmd setenv mmcdev ${emmc_dev} FB: ucmd mmc dev ${emmc_dev} 1; mmc erase 0 0x2000 -FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.wic.gz/* +FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.rootfs.wic.gz/* FB: flash bootloader ../imx-boot-@@MACHINE@@ FB: flash bootloader2 ../u-boot-@@MACHINE@@.itb FB: flash bootloader_s ../imx-boot-@@MACHINE@@ diff --git a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mp-lpddr4-evk-sec/full_image.uuu.in b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mp-lpddr4-evk-sec/full_image.uuu.in index 85cb0b7ea4..b018b27f19 100644 --- a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mp-lpddr4-evk-sec/full_image.uuu.in +++ b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mp-lpddr4-evk-sec/full_image.uuu.in @@ -17,7 +17,7 @@ FB[-t 50000]: ucmd if test -n "${fiovb_rpmb}"; then fiovb delete_pvalue bootfirm FB[-t 50000]: ucmd if test -n "${fiovb_rpmb}"; then fiovb write_pvalue debug 0; else true; fi FB[-t 50000]: ucmd if test -n "${fiovb_rpmb}"; then fiovb write_pvalue is_secondary_boot 0; else true; fi -FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.wic.gz/* +FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.rootfs.wic.gz/* FB: flash bootloader ../imx-boot-@@MACHINE@@.signed FB: flash bootloader2 ../u-boot-@@MACHINE@@.itb FB: flash bootloader_s ../imx-boot-@@MACHINE@@.signed diff --git a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mp-lpddr4-evk/full_image.uuu.in b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mp-lpddr4-evk/full_image.uuu.in index 209bcaaa5d..3c8227d5c8 100644 --- a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mp-lpddr4-evk/full_image.uuu.in +++ b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mp-lpddr4-evk/full_image.uuu.in @@ -5,7 +5,7 @@ SDPS: boot -f imx-boot-mfgtool FB: ucmd setenv fastboot_dev mmc FB: ucmd setenv mmcdev ${emmc_dev} FB: ucmd mmc dev ${emmc_dev} 1; mmc erase 0 0x2000 -FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.wic.gz/* +FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.rootfs.wic.gz/* FB: flash bootloader ../imx-boot-@@MACHINE@@ FB: flash bootloader2 ../u-boot-@@MACHINE@@.itb FB: flash bootloader_s ../imx-boot-@@MACHINE@@ diff --git a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mq-evk/full_image.uuu.in b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mq-evk/full_image.uuu.in index ced1f9143d..6470d470e3 100644 --- a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mq-evk/full_image.uuu.in +++ b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8mq-evk/full_image.uuu.in @@ -16,7 +16,7 @@ SDPV: jump FB: ucmd setenv fastboot_dev mmc FB: ucmd setenv mmcdev ${emmc_dev} FB: ucmd mmc dev ${mmcdev} 1; mmc erase 0 0x2000 -FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.wic.gz/* +FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.rootfs.wic.gz/* FB: flash bootloader ../imx-boot-@@MACHINE@@ FB: flash bootloader2 ../u-boot-@@MACHINE@@.itb # secondary boot image should not contain HDMI FW diff --git a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8qm-mek-sec/full_image.uuu.in b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8qm-mek-sec/full_image.uuu.in index acd6fa5fe2..96e78a2726 100644 --- a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8qm-mek-sec/full_image.uuu.in +++ b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8qm-mek-sec/full_image.uuu.in @@ -37,5 +37,5 @@ FB[-t 50000]: ucmd if test -n "${fiovb_rpmb}"; then fiovb delete_pvalue bootfirm FB[-t 50000]: ucmd if test -n "${fiovb_rpmb}"; then fiovb write_pvalue debug 0; else true; fi FB[-t 50000]: ucmd if test -n "${fiovb_rpmb}"; then fiovb write_pvalue is_secondary_boot 0; else true; fi -FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.wic.gz/* +FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.rootfs.wic.gz/* FB: done diff --git a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8qm-mek/full_image.uuu.in b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8qm-mek/full_image.uuu.in index 25dbaee600..6189ec874c 100644 --- a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8qm-mek/full_image.uuu.in +++ b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8qm-mek/full_image.uuu.in @@ -17,7 +17,7 @@ SDPV: jump FB: ucmd setenv fastboot_dev mmc FB: ucmd setenv mmcdev 0 FB: ucmd mmc dev ${mmcdev} 1; mmc erase 0 0x3FFE -FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.wic.gz/* +FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.rootfs.wic.gz/* FB: flash bootloader ../imx-boot-@@MACHINE@@ FB: flash bootloader_s ../imx-boot-@@MACHINE@@ FB: flash bootloader2 ../u-boot-@@MACHINE@@.itb diff --git a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8ulp-lpddr4-evk/full_image.uuu.in b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8ulp-lpddr4-evk/full_image.uuu.in index f152bfb8a6..5027b0930f 100644 --- a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8ulp-lpddr4-evk/full_image.uuu.in +++ b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx8ulp-lpddr4-evk/full_image.uuu.in @@ -5,7 +5,7 @@ SDPS: boot -f imx-boot-mfgtool FB: ucmd setenv fastboot_dev mmc FB: ucmd setenv mmcdev 0 FB: ucmd mmc dev ${mmcdev} 1; mmc erase 0 0x3C00 -FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.wic.gz/* +FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.rootfs.wic.gz/* FB: flash bootloader ../imx-boot-@@MACHINE@@ FB: flash bootloader2 ../u-boot-@@MACHINE@@.itb FB: flash bootloader_s ../imx-boot-@@MACHINE@@ diff --git a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx93-11x11-lpddr4x-evk/full_image.uuu.in b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx93-11x11-lpddr4x-evk/full_image.uuu.in index f152bfb8a6..5027b0930f 100644 --- a/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx93-11x11-lpddr4x-evk/full_image.uuu.in +++ b/meta-lmp-bsp/recipes-support/mfgtool-files/mfgtool-files/imx93-11x11-lpddr4x-evk/full_image.uuu.in @@ -5,7 +5,7 @@ SDPS: boot -f imx-boot-mfgtool FB: ucmd setenv fastboot_dev mmc FB: ucmd setenv mmcdev 0 FB: ucmd mmc dev ${mmcdev} 1; mmc erase 0 0x3C00 -FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.wic.gz/* +FB: flash -raw2sparse all ../@@MFGTOOL_FLASH_IMAGE@@-@@MACHINE@@.rootfs.wic.gz/* FB: flash bootloader ../imx-boot-@@MACHINE@@ FB: flash bootloader2 ../u-boot-@@MACHINE@@.itb FB: flash bootloader_s ../imx-boot-@@MACHINE@@