Files
wlan-ap/patches-24.10/0019-base-files-add-CI_FWSETENV-support.patch
John Crispin affead153e patches: carry forward CI_FWSETENV support (0019)
Adds support for CI_FWSETENV environment variable for firmware environment manipulation.

Renumbered from patches/0018.

Signed-off-by: John Crispin <john@phrozen.org>
2025-10-19 00:00:00 +02:00

38 lines
1.2 KiB
Diff

From ed925eac6477838cb37fd668264feebb5e176925 Mon Sep 17 00:00:00 2001
From: John Crispin <john@phrozen.org>
Date: Sat, 27 Apr 2024 12:04:31 +0200
Subject: [PATCH 19/55] base-files: add CI_FWSETENV support
This allows sysupgrade scripts to automatically call fw_setenv once the upgrade succeded.
Signed-off-by: John Crispin <john@phrozen.org>
---
package/base-files/files/lib/upgrade/nand.sh | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh
index ca302557c8..a2fce5aa81 100644
--- a/package/base-files/files/lib/upgrade/nand.sh
+++ b/package/base-files/files/lib/upgrade/nand.sh
@@ -14,6 +14,9 @@ CI_UBIPART="${CI_UBIPART:-ubi}"
# 'rootfs' UBI volume on NAND contains the rootfs
CI_ROOTPART="${CI_ROOTPART:-rootfs}"
+# update uboot-env if upgrade suceeded
+CI_FWSETENV=
+
ubi_mknod() {
local dir="$1"
local dev="/dev/$(basename $dir)"
@@ -446,6 +449,7 @@ nand_do_upgrade() {
nand_do_upgrade_success() {
if nand_do_restore_config && sync; then
+ [ -n "$CI_FWSETENV" ] && fw_setenv $CI_FWSETENV
echo "sysupgrade successful"
umount -a
reboot -f
--
2.34.1