[openwrt/openwrt] ramips: Cleanup Genexis EX400 upgrade script
LEDE Commits
lede-commits at lists.infradead.org
Sat Mar 15 02:20:34 PDT 2025
hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/a53417cc301f6b2cdcc7270d1b275acf49e6e64b
commit a53417cc301f6b2cdcc7270d1b275acf49e6e64b
Author: Mauri Sandberg <maukka at ext.kapsi.fi>
AuthorDate: Thu Jan 30 18:08:25 2025 +0200
ramips: Cleanup Genexis EX400 upgrade script
The code can be made more efficient by not extracting the sysupgrade.tar but
rather just querying for the filesize within the archive. Resorting to
manual update of UBI volume is extra work too, setting CI_KERNPART=rootfs_0
is enough.
Suggested-by: Andreas Gnau <andreas.gnau at iopsys.eu>
Signed-off-by: Mauri Sandberg <maukka at ext.kapsi.fi>
Link: https://github.com/openwrt/openwrt/pull/17806
Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
.../linux/ramips/mt7621/base-files/lib/upgrade/inteno.sh | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/inteno.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/inteno.sh
index 677000f6b1..ecaa1a808c 100644
--- a/target/linux/ramips/mt7621/base-files/lib/upgrade/inteno.sh
+++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/inteno.sh
@@ -17,15 +17,8 @@
. /lib/upgrade/nand.sh
inteno_do_upgrade () {
- local tar_file=$1
- local cmd=cat
- # WARNING: This fails if tar contains more than one 'sysupgrade-*' directory.
- local board_dir="$(tar tf "$tar_file" | grep -m 1 '^sysupgrade-.*/$')"
- board_dir="${board_dir%/}"
- tar -xaf "$tar_file"
-
# get the size of the new bootfs
- local _bootfs_size=$(wc -c < "$board_dir/kernel")
+ local _bootfs_size=$(tar -tvf $1 | grep kernel | awk '{print $3}')
[ -n "$_bootfs_size" -a "$_bootfs_size" -gt "0" ] || nand_do_upgrade_failed
# remove existing rootfses and recreate rootfs_0
@@ -35,15 +28,11 @@ inteno_do_upgrade () {
ubirmvol /dev/ubi0 --name=rootfs_data > /dev/null 2>&1
ubimkvol /dev/ubi0 --type=static --size=${_bootfs_size} --name=rootfs_0
- # update the rootfs_0 contents
- local _kern_ubivol=$( nand_find_volume "ubi0" "rootfs_0" )
- ubiupdatevol "/dev/$_kern_ubivol" "$board_dir/kernel"
-
fw_setenv root_vol rootfs_0
fw_setenv boot_cnt_primary 0
fw_setenv boot_cnt_alt 0
# proceed to upgrade the default way
- CI_KERNPART=none
+ CI_KERNPART=rootfs_0
nand_do_upgrade "$1"
}
More information about the lede-commits
mailing list