From 4529d91e8698147e2e08e491c96d2fd8b2b32d37 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Wed, 29 Dec 2021 15:19:31 +0100 Subject: [PATCH] ODROID XU4: Update U-Boot on eMMC boot partition (#1699) * ODROID XU4: Update U-Boot on eMMC boot partition Update the U-Boot on the eMMC boot partition if present. Only write the first megabyte as the eMMC boot partition might be smaller than the SPL image and only the first megabyte is occupied by FW/BL1/BL2/TZSW (see https://wiki.odroid.com/odroid-xu4/software/partition_table#tab__odroid-xu341). --- buildroot-external/ota/rauc-hook | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/buildroot-external/ota/rauc-hook b/buildroot-external/ota/rauc-hook index 92410492c..e43a42ba7 100755 --- a/buildroot-external/ota/rauc-hook +++ b/buildroot-external/ota/rauc-hook @@ -72,6 +72,14 @@ if [ "${RAUC_SLOT_CLASS}" = "spl" ]; then dd if="${RAUC_IMAGE_NAME}" of="${DEVICE_ROOT}" conv=notrunc oflag=direct bs=1 count=440 dd if="${RAUC_IMAGE_NAME}" of="${DEVICE_ROOT}" conv=notrunc oflag=direct bs=512 seek=1 skip=1 fi + + # Flash to eMMC boot partition if necessary + if [ "$RAUC_SYSTEM_COMPATIBLE" = "haos-odroid-xu4" ] && [ -b "${DEVICE_ROOT}boot0" ]; then + echo "Updating eMMC boot partition" + echo 0 > /sys/block/"$(basename "${DEVICE_ROOT}boot0")"/force_ro + dd if="${RAUC_IMAGE_NAME}" of="${DEVICE_ROOT}boot0" conv=notrunc ${FLAGS} bs=512 skip=1 count=2047 + echo 1 > /sys/block/"$(basename "${DEVICE_ROOT}boot0")"/force_ro + fi fi ##