From da856755eec4cdfe7229d0e66fc9bad0f1175008 Mon Sep 17 00:00:00 2001 From: Alexandru Costache Date: Mon, 18 Nov 2024 10:55:44 +0000 Subject: [PATCH 1/2] hostapp-update-hooks: Improve firmware update speed by reading/writing in larger chunks, ensure data is flushed to disk. This reduces the risk of the device not booting in case of an accidental power cut during the OS update. Also update logging to make use of the os logging helper functions. Signed-off-by: Alexandru Costache Changelog-entry: hostapp-update-hooks: Improve firmware update speed --- .../files/50-resin-bootfiles-jetson-tx2 | 63 +++++++++-------- .../files/99-resin-bootfiles-nano | 20 +++--- .../files/99-resin-bootfiles-xavier | 67 +++++++++---------- .../files/99-resin-bootfiles-xavier-nx-devkit | 58 ++++++++-------- 4 files changed, 97 insertions(+), 111 deletions(-) diff --git a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/50-resin-bootfiles-jetson-tx2 b/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/50-resin-bootfiles-jetson-tx2 index 4cb50865f..7f4634867 100644 --- a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/50-resin-bootfiles-jetson-tx2 +++ b/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/50-resin-bootfiles-jetson-tx2 @@ -1,6 +1,7 @@ #!/bin/sh . /usr/libexec/os-helpers-fs +. /usr/libexec/os-helpers-logging set -o errexit @@ -13,11 +14,6 @@ OFFS=(1659 5243 18043) BOOT_BLOB="${BIN_INSTALL_PATH}/boot0.img" DURING_UPDATE=${DURING_UPDATE:-0} -info_log() -{ - echo "[INFO] $@" -} - # Old 28.x based images are not able to re-write the # 28.x L4T partition layout with the offsets expected # by the tegra firmware at that revision. We therefore @@ -29,20 +25,20 @@ backport_rollback_health_fix() # On 32.x releases this file was renamed, there's no need to update it if [ -e ${inactive_hook} ]; then if grep -q "DURING_UPDATE" "${inactive_hook}"; then - info_log "No need to backport rollback-health fix to old hook" + info "No need to backport rollback-health fix to old hook" else # Extra check, new 32.X systems use a different name for the partition spec file old_part_spec=$(find /mnt/sysroot/active/ -name "partition_specification.txt") if [ -e ${old_part_spec} ]; then - info_log "Will backport rollback-health fix to old hostapp-update hook" + info "Will backport rollback-health fix to old hostapp-update hook" cp "${BIN_INSTALL_PATH}/tx2_28_x_hook_fix.sh" ${inactive_hook} - info_log "Applied rollback-health fix to old hostapp-update hook" + info "Applied rollback-health fix to old hostapp-update hook" else - info_log "Old partition specification file not found in current sysroot: ${old_part_spec}, hook will not be replaced!" + info "Old partition specification file not found in current sysroot: ${old_part_spec}, hook will not be replaced!" fi fi else - info_log "Upgrading from an L4T 32.X system, rollback-health fix is not needed" + info "Upgrading from an L4T 32.X system, rollback-health fix is not needed" fi } @@ -53,7 +49,7 @@ update_needed() { update_size=$(ls -al $current_update_file | awk '{print $5}') update_md5sum=$(md5sum $current_update_file | awk '{print $1'}) - existing_md5sum=$(dd if=$device bs=1 count=$update_size status=none | md5sum | awk '{print $1}') + existing_md5sum=$(dd if=$device count=1 bs=$update_size status=none | md5sum | awk '{print $1}') if [ ! "$existing_md5sum" = "$update_md5sum" ]; then echo 1 @@ -77,8 +73,8 @@ get_odm_value() { set_odm_value() { for offset in ${OFFS[@]} do - info_log "Writing ODM byte ${1} to ${2} at offset ${offset}" - echo -n -e "\\x${1}" | dd of=${2} seek=${offset} bs=1 count=1 conv=notrunc + info "Writing ODM byte ${1} to ${2} at offset ${offset}" + echo -n -e "\\x${1}" | dd of=${2} seek=${offset} bs=1 count=1 conv=notrunc,fsync done } @@ -114,23 +110,23 @@ update_partition_binaries() # any units running on 28.x should have been upgraded, and even so, we do backport_rollback_health_fix() while [ ! -L "$dst" ] do - info_log "Symlink $dst for $part_name not found, will retry in a second..." + info "Symlink $dst for $part_name not found, will retry in a second..." sleep 1; retries=$(( $retries + 1 )) if [ $retries -ge $max_retries ]; then - info_log "Retries limit reached and $dst is still not present, bail out!" + info "Retries limit reached and $dst is still not present, bail out!" exit 1 fi dst=$(get_state_path_from_label "$part_name") - info_log "State path after retry is $dst" + info "State path after retry is $dst" done if [ $(update_needed $src $dst) -eq 1 ]; then - info_log "Will update ${dst}" - dd if=${src} of=${dst} bs=1K - info_log "Updated ${dst}" + info "Will update ${dst}" + dd if=${src} of=${dst} bs=64K conv=fsync + info "Updated ${dst}" else - info_log "No need to update ${dst}" + info "No need to update ${dst}" fi done } @@ -138,15 +134,15 @@ update_partition_binaries() NUM_ADSP_PART=$(parted -s ${DEV_PATH} print | grep adsp | wc -l) if [ ${NUM_ADSP_PART} -lt 2 ]; then # adsp-fw partitions are mandatory only on L4T 32.2 - info_log "ADSP firmware partition NOT found:${NUM_ADSP_PART}. Will upgrade partition table to L4T 32.2" + info "ADSP firmware partition NOT found:${NUM_ADSP_PART}. Will upgrade partition table to L4T 32.2" UPGRADE_PARTITIONS=1 else - info_log "Found ${NUM_ADSP_PART} ADSP firmware partitions. No need to upgrade GPT" + info "Found ${NUM_ADSP_PART} ADSP firmware partitions. No need to upgrade GPT" fi if [ ${UPGRADE_PARTITIONS} -eq 1 ]; then backport_rollback_health_fix - info_log "Removing old L4T 28.X partitions" + info "Removing old L4T 28.X partitions" num_parts=$(sfdisk -l /dev/mmcblk0 | grep mmcblk0p | wc -l) for (( idx=1; idx <= ${num_parts}; ++idx )) @@ -158,7 +154,7 @@ if [ ${UPGRADE_PARTITIONS} -eq 1 ]; then fi done - info_log "Proceeding to create new L4T partitions" + info "Proceeding to create new L4T partitions" # If the partition table was rolled-back to 28.X due to rollback-health, # we first need to set the new (32.X) number of partitions in the MBR @@ -173,11 +169,11 @@ if [ ${UPGRADE_PARTITIONS} -eq 1 ]; then part_size=$(echo $n | cut -d ':' -f 3) end=$(expr ${start} \+ ${part_size} \- 1) parted -s ${DEV_PATH} unit s mkpart $part_name ${start} ${end} - dd if="${BIN_INSTALL_PATH}/${file_name}" of=${DEV_PATH} conv=notrunc seek=${start} + dd if="${BIN_INSTALL_PATH}/${file_name}" of=${DEV_PATH} conv=notrunc seek=${start} conv=fsync start=$(expr ${end} \+ 1) done - info_log "Created L4T 32.X partitions" + info "Created L4T 32.X partitions" elif [ ${UPGRADE_PARTITIONS} -eq 0 ]; then update_partition_binaries "${BIN_INSTALL_PATH}/partition_specification186.txt" @@ -187,11 +183,11 @@ bootpart_odm=$(get_odm_value ${BOOT_PART}); bootblob_odm=$(get_odm_value ${BOOT_BLOB}); if [[ ${bootpart_odm} != "unmatched"} ]] && [[ ${bootblob_odm} != "unmatched" ]] ; then - info_log "Valid ODMDATA values found in both ${BOOT_PART} and ${BOOT_BLOB}" + info "Valid ODMDATA values found in both ${BOOT_PART} and ${BOOT_BLOB}" if [[ ${bootpart_odm} == ${bootblob_odm} ]]; then - info_log "No need to transfer existing ODMDATA" + info "No need to transfer existing ODMDATA" else - info_log "Existing ODMDATA ${bootpart_odm} does not match HUP ODMDATA ${bootblob_odm}" + info "Existing ODMDATA ${bootpart_odm} does not match HUP ODMDATA ${bootblob_odm}" set_odm_value ${bootpart_odm} ${BOOT_BLOB} fi; else @@ -202,13 +198,14 @@ src=${BOOT_BLOB} dst=${BOOT_PART} if [ $(update_needed $src $dst) -eq 1 ]; then - info_log "Will update $dst" + info "Will update $dst" echo 0 > /sys/block/mmcblk0boot0/force_ro - dd if=${src} of=${dst} bs=1K + # 64K block size gives optimal performance, larger values show no speed-up + dd if=${src} of=${dst} bs=64K conv=fsync echo 1 > /sys/block/mmcblk0boot0/force_ro - info_log "Updated $dst" + info "Updated $dst" else - info_log "No need to update ${dst}" + info "No need to update ${dst}" fi sync diff --git a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-nano b/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-nano index 613f96d28..c211ee026 100644 --- a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-nano +++ b/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-nano @@ -3,19 +3,15 @@ set -o errexit . /usr/libexec/os-helpers-fs +. /usr/libexec/os-helpers-logging QSPI="/dev/mtd0" BOOTLOADER_DEVICE="/dev/mtdblock0" -info_log() -{ - echo "[INFO] $@" -} - # Jetson Nano SD has a qspi-nor, # Jetson Nano eMMC doesn't. if [ ! -e "${BOOTLOADER_DEVICE}" ]; then - info_log "This Nano module does not have a QSPI NOR, using hardware partition for boot blob" + info "This Nano module does not have a QSPI NOR, using hardware partition for boot blob" BOOTLOADER_DEVICE="/dev/mmcblk0boot0" fi @@ -52,10 +48,10 @@ for n in ${partitions}; do dst="$file_path" if [ $(update_needed $src $dst) -eq 1 ]; then - info_log "Will update ${dst}..." - dd if=${src} of=${dst} + info "Will update ${dst}..." + dd if=${src} of=${dst} bs=64K conv=fsync else - info_log "No need to update ${dst}" + info "No need to update ${dst}" fi done @@ -63,15 +59,15 @@ existing_bootloader_md5sum=$(dd if=${BOOTLOADER_DEVICE} bs=1M status=none | md5s update_bootloader_md5sum=$(md5sum ${BOOT_BLOB} | awk '{print $1}') if [ ! "$existing_bootloader_md5sum" = "$update_bootloader_md5sum" ]; then - info_log "Will update bootloader device ${BOOTLOADER_DEVICE}" + info "Will update bootloader device ${BOOTLOADER_DEVICE}" if [ -e "${QSPI}" ]; then flash_erase ${QSPI} 0 0 || true else echo 0 > /sys/block/mmcblk0boot0/force_ro fi - dd if=${BOOT_BLOB} of=${BOOTLOADER_DEVICE} bs=1M || true + dd if=${BOOT_BLOB} of=${BOOTLOADER_DEVICE} bs=1M conv=fsync else - info_log "No need to update bootloader device" + info "No need to update bootloader device" fi sync diff --git a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-xavier b/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-xavier index 77aca12f0..41ed2b31a 100644 --- a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-xavier +++ b/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-xavier @@ -7,6 +7,7 @@ set -o errexit # the rest of the bootloader binaries . /usr/libexec/os-helpers-fs +. /usr/libexec/os-helpers-logging DURING_UPDATE=${DURING_UPDATE:-0} bootloader_device="/dev/mmcblk0boot0" @@ -14,11 +15,6 @@ partspec="/resin-boot/bootfiles/partition_specification194.txt" bootloader_blob="/resin-boot/bootfiles/boot0_t194.bin.gz" bootpart_kernel="/mnt/boot/bootfiles/boot_sigheader.img.encrypt" -info_log() -{ - echo "[INFO] $@" -} - # Check if old release made use of # DURING_UPDATE flag and backport rollback-altboot # fix to old hook if necessary. @@ -26,19 +22,19 @@ backport_rollback_altboot_fix() { inactive_hook=$(find /mnt/sysroot/active/ | grep "99-resin-bootfiles-xavier") if grep -q "DURING_UPDATE" "${inactive_hook}"; then - info_log "No need to backport altboot fix to old hook" + info "No need to backport altboot fix to old hook" else - info_log "Will backport rollback-altboot fix to old hook" + info "Will backport rollback-altboot fix to old hook" sed -i 's/os-helpers-fs/os-helpers-fs \nDURING_UPDATE=${DURING_UPDATE:-0}\nif [ "$DURING_UPDATE" = "0" ]; then target_sysroot="active"; else target_sysroot="inactive"; fi; /g' ${inactive_hook} sed -i 's|/mnt/sysroot/inactive|/mnt/sysroot/${target_sysroot}|g' ${inactive_hook} - info_log "Applied rollback-altboot fix to old hostapp-update hook" + info "Applied rollback-altboot fix to old hostapp-update hook" fi if [ -e ${bootpart_kernel} ]; then rm ${bootpart_kernel} - info_log "Removed signed kernel binary from boot partition, it is now located in the rootfs" + info "Removed signed kernel binary from boot partition, it is now located in the rootfs" else - info_log "No need to remove kernel binary from boot partition" + info "No need to remove kernel binary from boot partition" fi } @@ -53,29 +49,29 @@ get_label_suffix_by_slot() if ! command -v tegra-boot-control &> /dev/null then - info_log "Could not find tegra-boot-control!" + info "Could not find tegra-boot-control!" exit 1 fi redundancy_state=$(/usr/bin/tegra-boot-control -s | awk -F 'Redundancy:' '{print $2}' | awk '{print $1}' | tr -d '\n') -info_log "Redundancy is currently ${redundancy_state}" +info "Redundancy is currently ${redundancy_state}" # Enable boot slot redundancy if not enabled already tegra-boot-control -e curr_slot=$(/usr/bin/tegra-boot-control -c) -info_log "Current active slot is ${curr_slot}" +info "Current active slot is ${curr_slot}" if [ "$DURING_UPDATE" = "1" ]; then backport_rollback_altboot_fix - info_log "Target active slot is $((target_slot = ! curr_slot))" + info "Target active slot is $((target_slot = ! curr_slot))" target_sysroot="inactive" else - info_log "Target active slot stays $((target_slot = curr_slot))" + info "Target active slot stays $((target_slot = curr_slot))" target_sysroot="active" fi target_part=$(findmnt --noheadings --canonicalize --output SOURCE "/mnt/sysroot/${target_sysroot}" -t ext4) -info_log "New rootfs partition is ${target_part}" +info "New rootfs partition is ${target_part}" target_label_suffix=$(get_label_suffix_by_slot ${target_slot}) rootstr=$(get_dev_label "${target_part}") @@ -107,7 +103,7 @@ case "$rootstr" in ;; esac -info_log "New root is resin-root${rootl}" +info "New root is resin-root${rootl}" dtbname=$(cat "$partspec" | grep "kernel-dtb_b" | cut -d ':' -f 2 | awk -F'_sigheader' '{print $1}') dtbfile="${dtbname}-root${rootl}_sigheader.dtb.encrypt" @@ -139,50 +135,51 @@ for n in ${partitions}; do src="/resin-boot/bootfiles/$file_name" if [ -e ${dst} ]; then if [ $(update_needed $src $dst) -eq 1 ]; then - info_log "Will update ${dst} ..." - dd if=${src} of="${dst}" - info_log "Updated ${dst}" + info "Will update ${dst} ..." + dd if=${src} of="${dst}" bs=64K conv=fsync + info "Updated ${dst}" else - info_log "No need to update ${dst}" + info "No need to update ${dst}" fi else - info_log "Partition ${dst} not found" + info "Partition ${dst} not found" fi done # DTB contains root partition label, update is mandatory on the new boot slot, before switching it to active -info_log "Writing ${dtbfile} to specific to bootloader-dtb partition." -dd if=/resin-boot/bootfiles/${dtbfile} of=$(get_state_path_from_label "bootloader-dtb") +info "Writing ${dtbfile} to specific to bootloader-dtb partition." +dd if=/resin-boot/bootfiles/${dtbfile} of=$(get_state_path_from_label "bootloader-dtb") bs=64K conv=fsync -info_log "Writing ${dtbfile} to specific to bootloader-dtb_b partition." -dd if=/resin-boot/bootfiles/${dtbfile} of=$(get_state_path_from_label "bootloader-dtb_b") +info "Writing ${dtbfile} to specific to bootloader-dtb_b partition." +dd if=/resin-boot/bootfiles/${dtbfile} of=$(get_state_path_from_label "bootloader-dtb_b") bs=64K conv=fsync -dd if=/resin-boot/bootfiles/${dtbfile} of=$(get_state_path_from_label "kernel-dtb${target_label_suffix}") +dd if=/resin-boot/bootfiles/${dtbfile} of=$(get_state_path_from_label "kernel-dtb${target_label_suffix}") bs=64K conv=fsync -info_log "Writing kernel ${kernel} to specific partitions..." +info "Writing kernel ${kernel} to specific partitions..." -dd if=/opt/tegra-binaries/${kernel} of=$(get_state_path_from_label "kernel${target_label_suffix}") -info_log "Updating boot image on hw partition mmcblk0boot0..." +dd if=/opt/tegra-binaries/${kernel} of=$(get_state_path_from_label "kernel${target_label_suffix}") bs=64K conv=fsync +info "Updating boot image on hw partition mmcblk0boot0..." existing_bootloader_md5sum=$(dd if=$bootloader_device bs=1M status=none | md5sum | awk '{print $1}') update_bootloader_md5sum=$(zcat $bootloader_blob | md5sum | awk '{print $1}') if [ ! "$existing_bootloader_md5sum" = "$update_bootloader_md5sum" ]; then echo 0 > /sys/block/mmcblk0boot0/force_ro - zcat $bootloader_blob > $bootloader_device - sync + zcat $bootloader_blob | dd of=$bootloader_device bs=64K conv=fsync echo 1 > /sys/block/mmcblk0boot0/force_ro fi # Update slot selection after the qspi was updated, otherwise # scratch register contents will be lost -info_log "Setting active slot to ${target_slot}" +info "Setting active slot to ${target_slot}" /usr/bin/tegra-boot-control -e /usr/bin/tegra-boot-control -a ${target_slot} if [ "$DURING_UPDATE" = "0" ]; then /usr/bin/tegra-boot-control -m - info_log "Running in rollback-altboot, next boot will be from the same slot. Marked boot as successful." + info "Running in rollback-altboot, next boot will be from the same slot. Marked boot as successful." fi -info_log "Done." +info "Done." + +sync diff --git a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-xavier-nx-devkit b/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-xavier-nx-devkit index 2db7e97da..d75139b5f 100644 --- a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-xavier-nx-devkit +++ b/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-xavier-nx-devkit @@ -7,6 +7,7 @@ set -o errexit # the rest of the bootloader binaries . /usr/libexec/os-helpers-fs +. /usr/libexec/os-helpers-logging DURING_UPDATE=${DURING_UPDATE:-0} declare -a UPDATED_PARTITIONS=() @@ -14,11 +15,6 @@ bootloader_device="/dev/mtdblock0" bootloader_blob="/opt/tegra-binaries/boot0.img" partspec=$(find "/opt/tegra-binaries/" | grep "partition_specification194_nx") -info_log() -{ - echo "[INFO] $@" -} - # Check if old hook made use of DURING_UPDATE # and if not, backport rollback-altboot fix # to it if necessary. @@ -26,12 +22,12 @@ backport_rollback_altboot_fix() { inactive_hook=$(find /mnt/sysroot/active/ | grep "99-resin-bootfiles-xavier-nx-devkit") if grep -q "DURING_UPDATE" "${inactive_hook}"; then - info_log "No need to backport altboot fix to old hook" + info "No need to backport altboot fix to old hook" else - info_log "Will backport rollback-altboot fix to old hook" + info "Will backport rollback-altboot fix to old hook" sed -i 's/os-helpers-fs/os-helpers-fs \nDURING_UPDATE=${DURING_UPDATE:-0}\nif [ "$DURING_UPDATE" = "0" ]; then target_sysroot="active"; else target_sysroot="inactive"; fi; /g' ${inactive_hook} sed -i 's|/mnt/sysroot/inactive|/mnt/sysroot/${target_sysroot}|g' ${inactive_hook} - info_log "Applied rollback-altboot fix to old hostapp-update hook" + info "Applied rollback-altboot fix to old hostapp-update hook" fi } @@ -46,29 +42,29 @@ get_label_suffix_by_slot() if ! command -v tegra-boot-control &> /dev/null then - info_log "Could not find tegra-boot-control!" + info "Could not find tegra-boot-control!" exit 1 fi redundancy_state=$(/usr/bin/tegra-boot-control -s | awk -F 'Redundancy:' '{print $2}' | awk '{print $1}' | tr -d '\n') -info_log "Redundancy is currently ${redundancy_state}" +info "Redundancy is currently ${redundancy_state}" # Enable boot slot redundancy if not enabled already tegra-boot-control -e curr_slot=$(/usr/bin/tegra-boot-control -c) -info_log "Current active slot is ${curr_slot}" +info "Current active slot is ${curr_slot}" if [ "$DURING_UPDATE" = "1" ]; then backport_rollback_altboot_fix - info_log "Target active slot is $((target_slot = ! curr_slot))" + info "Target active slot is $((target_slot = ! curr_slot))" target_sysroot="inactive" else - info_log "Target active slot stays $((target_slot = curr_slot))" + info "Target active slot stays $((target_slot = curr_slot))" target_sysroot="active" fi target_part=$(findmnt --noheadings --canonicalize --output SOURCE "/mnt/sysroot/${target_sysroot}" -t ext4) -info_log "New rootfs partition is ${target_part}" +info "New rootfs partition is ${target_part}" target_label_suffix=$(get_label_suffix_by_slot ${target_slot}) rootstr=$(get_dev_label "${target_part}") @@ -82,7 +78,7 @@ update_needed() { else update_size=$(ls -al $current_update_file | awk '{print $5}') update_md5sum=$(md5sum $current_update_file | awk '{print $1'}) - existing_md5sum=$(dd if=$device bs=1 count=$update_size status=none | md5sum | awk '{print $1}') + existing_md5sum=$(dd if=$device count=1 bs=$update_size status=none | md5sum | awk '{print $1}') if [ ! "$existing_md5sum" = "$update_md5sum" ]; then echo 1 @@ -104,7 +100,7 @@ case "$rootstr" in ;; esac -info_log "New root is resin-root${rootl}" +info "New root is resin-root${rootl}" dtbname=$(cat "$partspec" | grep "kernel-dtb_b" | cut -d ':' -f 2 | awk -F'_sigheader' '{print $1}') dtbfile="${dtbname}-root${rootl}_sigheader.dtb.encrypt" @@ -130,34 +126,34 @@ for n in ${partitions}; do if [ -e ${dst} ]; then if [ $(update_needed $src $dst) -eq 1 ]; then - info_log "Will update ${dst} ..." - dd if=${src} of="${dst}" + info "Will update ${dst} ..." + dd if=${src} of="${dst}" bs=64K conv=fsync UPDATED_PARTITIONS+=(${dst}) - info_log "Updated ${dst}" + info "Updated ${dst}" else - info_log "No need to update ${dst}" + info "No need to update ${dst}" fi else - info_log "Duplicate slot for target partition ${dst} not available, ignoring." + info "Duplicate slot for target partition ${dst} not available, ignoring." fi done # DTB contains root partition, update is mandatory on the new boot slot, before switching it to active -info_log "Writing ${dtbfile} to specific partitions..." -dd if=/opt/tegra-binaries/${dtbfile} of=$(get_state_path_from_label "kernel-dtb${target_label_suffix}") +info "Writing ${dtbfile} to specific partitions..." +dd if=/opt/tegra-binaries/${dtbfile} of=$(get_state_path_from_label "kernel-dtb${target_label_suffix}") bs=64K conv=fsync -info_log "Writing kernel ${kernel} to specific partitions..." -dd if=/opt/tegra-binaries/${kernel} of=$(get_state_path_from_label "kernel${target_label_suffix}") +info "Writing kernel ${kernel} to specific partitions..." +dd if=/opt/tegra-binaries/${kernel} of=$(get_state_path_from_label "kernel${target_label_suffix}") bs=64K conv=fsync existing_bootloader_md5sum=$(dd if=$bootloader_device bs=1M status=none | md5sum | awk '{print $1}') update_bootloader_md5sum=$(md5sum $bootloader_blob | awk '{print $1}') if [ ! "$existing_bootloader_md5sum" = "$update_bootloader_md5sum" ]; then - info_log "Will update bootloader device" + info "Will update bootloader device" flash_erase /dev/mtd0 0 0 || true - dd if=$bootloader_blob of=$bootloader_device bs=1M + dd if=$bootloader_blob of=$bootloader_device bs=1M conv=fsync else - info_log "No need to update bootloader device" + info "No need to update bootloader device" fi # Sync internal memory @@ -165,13 +161,13 @@ sync /dev/mmcblk0 # Update slot selection after the qspi was updated, otherwise # scratch register contents will be lost -info_log "Setting active slot to ${target_slot}" +info "Setting active slot to ${target_slot}" /usr/bin/tegra-boot-control -e /usr/bin/tegra-boot-control -a ${target_slot} if [ "$DURING_UPDATE" = "0" ]; then /usr/bin/tegra-boot-control -m - info_log "Running in rollback-altboot, next boot will be from the same slot. Marked boot as successful." + info "Running in rollback-altboot, next boot will be from the same slot. Marked boot as successful." fi -info_log "Done." +info "Done." From 790d140c394f6beff1e80766395680c10e5bcf78 Mon Sep 17 00:00:00 2001 From: Alexandru Costache Date: Fri, 22 Nov 2024 09:58:55 +0200 Subject: [PATCH 2/2] layers/meta-balena: Update to v6.1.10 Changelog-entry: layers/meta-balena: Update to v6.1.10 Signed-off-by: Alexandru Costache --- layers/meta-balena | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layers/meta-balena b/layers/meta-balena index 41a79d918..906083885 160000 --- a/layers/meta-balena +++ b/layers/meta-balena @@ -1 +1 @@ -Subproject commit 41a79d918e5a8b62b88b9e137ce7e47122ca6b28 +Subproject commit 9060838858c8461f42f88c344c8f63ab50c7707b