treewide: use -n for fw_[saveprint]env

Using awk and cut to simulate -n is pointless.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22806
Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
Rosen Penev 2026-04-04 16:12:49 -07:00 committed by Robert Marko
parent 56be1d1530
commit a031f16348
2 changed files with 3 additions and 6 deletions

View File

@ -12,8 +12,7 @@ boot() {
fw_setenv fwr_verify 0
;;
qihoo,c301)
local n=$(fw_printenv activeregion | cut -d = -f 2)
fw_setenv "image${n}trynum" 0
fw_setenv $(printf "image%strynum" $(fw_printenv -n activeregion)) 0
;;
esac
}

View File

@ -97,11 +97,9 @@ define Device/kernel-size-migration-linksys
2. Run folowing commands in console (ssh or serial): \n$\
\t fw_printenv \n$\
\t fw_setenv nandboot \
"$$$$(fw_printenv nandboot | awk -F= '{sub(/^nandboot=/, "");print}' \
| sed 's/0x300000/0x400000/g')"\n$\
"$$$$(fw_printenv -n nandboot | sed 's/0x300000/0x400000/g')"\n$\
\t fw_setenv altnandboot \
"$$$$(fw_printenv altnandboot | awk -F= '{sub(/^altnandboot=/, "");print}' \
| sed 's/0x300000/0x400000/g')"\n$\
"$$$$(fw_printenv -n altnandboot | sed 's/0x300000/0x400000/g')"\n$\
3. Test if envs are ok by 'fw_printenv'. \
It should be the same except last argument of\
'nand read.e' in 'nandboot' and 'altnandboot'.\n$\