From 63792a8ed279b7a0c60f655fed08024d6cef8a44 Mon Sep 17 00:00:00 2001 From: ScottW514 Date: Sat, 8 Aug 2026 12:55:13 -0400 Subject: [PATCH] installer: select the fw_env config the way ffboot does Newer factory firmware's generic /etc/fw_env.config points at the wrong device; its per-device /etc/fw_env_mmcblk2.config is the correct one for the eMMC environment. The read-back verify caught the failed write and aborted before the flip, as designed. --- scripts/install-forgefirm.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/install-forgefirm.sh b/scripts/install-forgefirm.sh index e7c14e6..eee60b2 100644 --- a/scripts/install-forgefirm.sh +++ b/scripts/install-forgefirm.sh @@ -99,7 +99,14 @@ slot_probe () { # Verified atomic env flip (all four variables, classic u-boot-tools script # format first - that is what factory firmware ships - then libubootenv # format, then per-variable writes; read-back verified in every case). -FWCONFIG="/etc/fw_env.config" +# Config selection matches ffboot: newer factory firmware's generic +# fw_env.config points at the wrong device; its per-device +# fw_env_mmcblk2.config is the correct one for the eMMC environment. +if [ -f "/etc/fw_env_mmcblk2.config" ] && [ ! -d "/factory" ]; then + FWCONFIG="/etc/fw_env_mmcblk2.config" +else + FWCONFIG="/etc/fw_env.config" +fi env_get () { fw_printenv -c "$FWCONFIG" -n "$1" 2>/dev/null; }