From b854555a3d03ba7baa9074b8a5c4c4e801285d55 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 8 Jul 2017 22:57:27 +0200 Subject: [PATCH 1/5] modules: update LEDE --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 2842e1c3..c75392c8 100644 --- a/modules +++ b/modules @@ -2,7 +2,7 @@ GLUON_FEEDS='openwrt gluon routing luci' LEDE_REPO=https://git.lede-project.org/source.git LEDE_BRANCH=lede-17.01 -LEDE_COMMIT=3214e174a07f5b333ae6f3fe5a857c8324e9ae27 +LEDE_COMMIT=74d5c3e019599d0c2464671dc785d3445548d0dc PACKAGES_OPENWRT_REPO=https://github.com/openwrt/packages.git PACKAGES_OPENWRT_BRANCH=lede-17.01 From 1c1b5bdbc3c9e77e9c8269a64a97a4ebb6f2be17 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 13 Jul 2017 00:31:10 +0200 Subject: [PATCH 2/5] modules: update LEDE --- modules | 2 +- ...stools-snapshot-handle-jffs2-conversion-using-upgraded.patch | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules b/modules index c75392c8..72a9fc8a 100644 --- a/modules +++ b/modules @@ -2,7 +2,7 @@ GLUON_FEEDS='openwrt gluon routing luci' LEDE_REPO=https://git.lede-project.org/source.git LEDE_BRANCH=lede-17.01 -LEDE_COMMIT=74d5c3e019599d0c2464671dc785d3445548d0dc +LEDE_COMMIT=05643bd64d7a44632858b86da2761821e48f44d2 PACKAGES_OPENWRT_REPO=https://github.com/openwrt/packages.git PACKAGES_OPENWRT_BRANCH=lede-17.01 diff --git a/patches/lede/0019-fstools-snapshot-handle-jffs2-conversion-using-upgraded.patch b/patches/lede/0019-fstools-snapshot-handle-jffs2-conversion-using-upgraded.patch index 906f6732..235336c6 100644 --- a/patches/lede/0019-fstools-snapshot-handle-jffs2-conversion-using-upgraded.patch +++ b/patches/lede/0019-fstools-snapshot-handle-jffs2-conversion-using-upgraded.patch @@ -8,7 +8,7 @@ by upgraded. Signed-off-by: Matthias Schiffer diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile -index 28f68b57d6f82dd066410a577e84e32a3a54dc37..2789424c5f5fb50cc1f004d2ab5223a7fecbf53a 100644 +index 43febd4727b94bca1311987558b0363eb5319180..b73e8ad67da478d2b9b5fa7038d240372c618f97 100644 --- a/package/system/fstools/Makefile +++ b/package/system/fstools/Makefile @@ -8,7 +8,7 @@ From 808723b9fbd2aa05116ef4614d5f097987dc078f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 13 Jul 2017 00:37:56 +0200 Subject: [PATCH 3/5] Backport sysupgrade patches preventing hangs on certain sysupgrade failures --- ... 0012-procd-switch-to-latest-master.patch} | 14 ++++--- ...0016-procd-remove-procd-nand-package.patch | 2 +- ...rade-argument-passed-from-preupgrade.patch | 33 +++++++++++++++ ...oop-forever-trying-to-kill-processes.patch | 42 +++++++++++++++++++ 4 files changed, 84 insertions(+), 7 deletions(-) rename patches/lede/{0012-procd-switch-to-master-branch.patch => 0012-procd-switch-to-latest-master.patch} (57%) create mode 100644 patches/lede/0031-base-files-upgrade-correctly-handle-nand_do_upgrade-argument-passed-from-preupgrade.patch create mode 100644 patches/lede/0032-base-files-upgrade-don-t-loop-forever-trying-to-kill-processes.patch diff --git a/patches/lede/0012-procd-switch-to-master-branch.patch b/patches/lede/0012-procd-switch-to-latest-master.patch similarity index 57% rename from patches/lede/0012-procd-switch-to-master-branch.patch rename to patches/lede/0012-procd-switch-to-latest-master.patch index 0a239f9e..9c53c476 100644 --- a/patches/lede/0012-procd-switch-to-master-branch.patch +++ b/patches/lede/0012-procd-switch-to-latest-master.patch @@ -1,19 +1,21 @@ From: Matthias Schiffer Date: Sat, 8 Jul 2017 14:44:00 +0200 -Subject: procd: switch to master branch +Subject: procd: switch to latest master diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile -index 70515958cd5002841fd9698b7a7f4aec01ddfb3b..cead3b9b7a5f83879a1aee08ab0463049dd228f4 100644 +index 70515958cd5002841fd9698b7a7f4aec01ddfb3b..2a1fed4e6e2388806ee4230af2872b4bcc8f1613 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile -@@ -13,8 +13,8 @@ PKG_RELEASE:=1 +@@ -12,9 +12,9 @@ PKG_RELEASE:=1 + PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/procd.git - PKG_SOURCE_DATE:=2017-06-19 +-PKG_SOURCE_DATE:=2017-06-19 -PKG_SOURCE_VERSION:=89918c8cb78e651ee0922f13a96b7f25fc2f285a -PKG_MIRROR_HASH:=fad1a37227f85070f6a49a37ea1e98c22c066c91f16ad26898152972eb0c6a91 -+PKG_SOURCE_VERSION:=453116e08e6a9349374bbff427b75f57ce5387c9 -+PKG_MIRROR_HASH:=a0d5c1ddbd2ba63d52125fa5a815d48a3bfb1b1e0a6b85f3335af8a873ed58fc ++PKG_SOURCE_DATE:=2017-07-13 ++PKG_SOURCE_VERSION:=d749b2a3507517ff0fe39f7dac69f44ce20c56a2 ++PKG_MIRROR_HASH:=388c9f8ac28c922bb8f7889d5bfe11d9afd1bee96243bb5b77897dd1a13b3a43 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 diff --git a/patches/lede/0016-procd-remove-procd-nand-package.patch b/patches/lede/0016-procd-remove-procd-nand-package.patch index 80426eff..2fff4f39 100644 --- a/patches/lede/0016-procd-remove-procd-nand-package.patch +++ b/patches/lede/0016-procd-remove-procd-nand-package.patch @@ -435,7 +435,7 @@ index 0000000000000000000000000000000000000000..6bd2005344c081df20e5a330a69e49e3 + nand_upgrade_stage1 +} diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile -index cead3b9b7a5f83879a1aee08ab0463049dd228f4..2a42db1fc034b554860393cfd9b17ed8423d7bc4 100644 +index 2a1fed4e6e2388806ee4230af2872b4bcc8f1613..ac0e525aed8f72b52cac892b360b3be1edcd7e1d 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -22,11 +22,9 @@ PKG_LICENSE_FILES:= diff --git a/patches/lede/0031-base-files-upgrade-correctly-handle-nand_do_upgrade-argument-passed-from-preupgrade.patch b/patches/lede/0031-base-files-upgrade-correctly-handle-nand_do_upgrade-argument-passed-from-preupgrade.patch new file mode 100644 index 00000000..35b12879 --- /dev/null +++ b/patches/lede/0031-base-files-upgrade-correctly-handle-nand_do_upgrade-argument-passed-from-preupgrade.patch @@ -0,0 +1,33 @@ +From: Matthias Schiffer +Date: Mon, 10 Jul 2017 10:35:19 +0200 +Subject: base-files: upgrade: correctly handle nand_do_upgrade argument passed from preupgrade + +Fixes: 30f61a34b4cf "base-files: always use staged sysupgrade" +Signed-off-by: Matthias Schiffer + +diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh +index fc59bf2323498d332159b00eb7ab443bfe6b147e..c8b71015c2e44210696a4e28a5b7babbd0233184 100644 +--- a/package/base-files/files/lib/upgrade/common.sh ++++ b/package/base-files/files/lib/upgrade/common.sh +@@ -211,7 +211,7 @@ default_do_upgrade() { + do_upgrade_stage2() { + v "Performing system upgrade..." + if [ -n "$do_upgrade" ]; then +- $do_upgrade "$IMAGE" ++ eval "$do_upgrade" + elif type 'platform_do_upgrade' >/dev/null 2>/dev/null; then + platform_do_upgrade "$IMAGE" + else +diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh +index 1e69c8f9657b39adf2a2c33bd9bac9303bcbc3d7..72f0fe0e10312e74ce085ad53f0adceb921fd013 100644 +--- a/package/base-files/files/lib/upgrade/nand.sh ++++ b/package/base-files/files/lib/upgrade/nand.sh +@@ -289,7 +289,7 @@ nand_do_upgrade() { + # hook; this piece of code handles scripts that haven't been + # updated. All scripts should gradually move to call nand_do_upgrade + # from platform_do_upgrade instead. +- export do_upgrade=nand_do_upgrade ++ export do_upgrade="nand_do_upgrade '$1'" + return + fi + diff --git a/patches/lede/0032-base-files-upgrade-don-t-loop-forever-trying-to-kill-processes.patch b/patches/lede/0032-base-files-upgrade-don-t-loop-forever-trying-to-kill-processes.patch new file mode 100644 index 00000000..2dfe0ca6 --- /dev/null +++ b/patches/lede/0032-base-files-upgrade-don-t-loop-forever-trying-to-kill-processes.patch @@ -0,0 +1,42 @@ +From: Matthias Schiffer +Date: Thu, 13 Jul 2017 00:19:32 +0200 +Subject: base-files: upgrade: don't loop forever trying to kill processes + +When processes don't die on SIGKILL (usually because of kernel bugs), it's +better to give up instead of looping forever. + +upgraded will trigger a reboot in this case (and if this fails, a hardware +watchdog will eventually time out and reset the system, if present). + +Signed-off-by: Matthias Schiffer + +diff --git a/package/base-files/files/lib/upgrade/stage2 b/package/base-files/files/lib/upgrade/stage2 +index bdbb8926643287f48a4ae62c5d1d4b4a29130859..097ad63adfecdd70019acaa5b652d2056e774c3f 100755 +--- a/package/base-files/files/lib/upgrade/stage2 ++++ b/package/base-files/files/lib/upgrade/stage2 +@@ -87,6 +87,8 @@ switch_to_ramfs() { + } + + kill_remaining() { # [ [ ] ] ++ local loop_limit=10 ++ + local sig="${1:-TERM}" + local loop="${2:-0}" + local run=true +@@ -117,8 +119,15 @@ kill_remaining() { # [ [ ] ] + + [ $loop -eq 1 ] && run=true + done ++ ++ let loop_limit-- ++ [ $loop_limit -eq 0 ] && { ++ echo ++ echo "Failed to kill all processes." ++ exit 1 ++ } + done +- echo "" ++ echo + } + + From 145984eed93349e4fb332f00853287d21997225c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 13 Jul 2017 10:57:37 +0200 Subject: [PATCH 4/5] modules: update LEDE --- modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules b/modules index 72a9fc8a..fd8be03c 100644 --- a/modules +++ b/modules @@ -2,7 +2,7 @@ GLUON_FEEDS='openwrt gluon routing luci' LEDE_REPO=https://git.lede-project.org/source.git LEDE_BRANCH=lede-17.01 -LEDE_COMMIT=05643bd64d7a44632858b86da2761821e48f44d2 +LEDE_COMMIT=c047c344c696c1e62a09d4dfd319477556356534 PACKAGES_OPENWRT_REPO=https://github.com/openwrt/packages.git PACKAGES_OPENWRT_BRANCH=lede-17.01 From 4a756486580ceb240b5aae9aa4d161269213c0b9 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 13 Jul 2017 17:28:49 +0200 Subject: [PATCH 5/5] Backport a few more sysupgrade packages Improve error handling a bit, and fix upgrade for some (unsupported or broken) targets. --- .../0012-procd-switch-to-latest-master.patch | 8 +-- ...0016-procd-remove-procd-nand-package.patch | 2 +- ...0033-bcm53xx-upgrade-fix-RAMFS_COPY_.patch | 39 +++++++++++ ...0034-ipq806x-upgrade-fix-RAMFS_COPY_.patch | 68 +++++++++++++++++++ ...035-kirkwood-upgrade-fix-RAMFS_COPY_.patch | 60 ++++++++++++++++ 5 files changed, 172 insertions(+), 5 deletions(-) create mode 100644 patches/lede/0033-bcm53xx-upgrade-fix-RAMFS_COPY_.patch create mode 100644 patches/lede/0034-ipq806x-upgrade-fix-RAMFS_COPY_.patch create mode 100644 patches/lede/0035-kirkwood-upgrade-fix-RAMFS_COPY_.patch diff --git a/patches/lede/0012-procd-switch-to-latest-master.patch b/patches/lede/0012-procd-switch-to-latest-master.patch index 9c53c476..bb256138 100644 --- a/patches/lede/0012-procd-switch-to-latest-master.patch +++ b/patches/lede/0012-procd-switch-to-latest-master.patch @@ -1,9 +1,9 @@ From: Matthias Schiffer -Date: Sat, 8 Jul 2017 14:44:00 +0200 +Date: Thu, 13 Jul 2017 17:15:21 +0200 Subject: procd: switch to latest master diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile -index 70515958cd5002841fd9698b7a7f4aec01ddfb3b..2a1fed4e6e2388806ee4230af2872b4bcc8f1613 100644 +index 70515958cd5002841fd9698b7a7f4aec01ddfb3b..d78b4e0fe1b4cd12dd873ff55250ed833de50e05 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 @@ -14,8 +14,8 @@ index 70515958cd5002841fd9698b7a7f4aec01ddfb3b..2a1fed4e6e2388806ee4230af2872b4b -PKG_SOURCE_VERSION:=89918c8cb78e651ee0922f13a96b7f25fc2f285a -PKG_MIRROR_HASH:=fad1a37227f85070f6a49a37ea1e98c22c066c91f16ad26898152972eb0c6a91 +PKG_SOURCE_DATE:=2017-07-13 -+PKG_SOURCE_VERSION:=d749b2a3507517ff0fe39f7dac69f44ce20c56a2 -+PKG_MIRROR_HASH:=388c9f8ac28c922bb8f7889d5bfe11d9afd1bee96243bb5b77897dd1a13b3a43 ++PKG_SOURCE_VERSION:=76dcbee7fd3a90221619feb7e4c572e00b60af9b ++PKG_MIRROR_HASH:=61460e267fbc1e3269caac4b98d7d351c6ccfa0b4f3493b37dad83a6faad4b2e CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 diff --git a/patches/lede/0016-procd-remove-procd-nand-package.patch b/patches/lede/0016-procd-remove-procd-nand-package.patch index 2fff4f39..017784a8 100644 --- a/patches/lede/0016-procd-remove-procd-nand-package.patch +++ b/patches/lede/0016-procd-remove-procd-nand-package.patch @@ -435,7 +435,7 @@ index 0000000000000000000000000000000000000000..6bd2005344c081df20e5a330a69e49e3 + nand_upgrade_stage1 +} diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile -index 2a1fed4e6e2388806ee4230af2872b4bcc8f1613..ac0e525aed8f72b52cac892b360b3be1edcd7e1d 100644 +index d78b4e0fe1b4cd12dd873ff55250ed833de50e05..98cac395f9f60f581a384a51a5b2a0f03f16df25 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -22,11 +22,9 @@ PKG_LICENSE_FILES:= diff --git a/patches/lede/0033-bcm53xx-upgrade-fix-RAMFS_COPY_.patch b/patches/lede/0033-bcm53xx-upgrade-fix-RAMFS_COPY_.patch new file mode 100644 index 00000000..bd21e79e --- /dev/null +++ b/patches/lede/0033-bcm53xx-upgrade-fix-RAMFS_COPY_.patch @@ -0,0 +1,39 @@ +From: Matthias Schiffer +Date: Sat, 10 Jun 2017 16:14:54 +0200 +Subject: bcm53xx: upgrade: fix RAMFS_COPY_* + +Fixes: 30f61a34b4cf "base-files: always use staged sysupgrade" +Signed-off-by: Matthias Schiffer + +diff --git a/package/base-files/files/lib/upgrade/stage2 b/package/base-files/files/lib/upgrade/stage2 +index 097ad63adfecdd70019acaa5b652d2056e774c3f..8cc8c8b34e9f349f1d1283ac00f9782b52ab01c1 100755 +--- a/package/base-files/files/lib/upgrade/stage2 ++++ b/package/base-files/files/lib/upgrade/stage2 +@@ -48,7 +48,7 @@ switch_to_ramfs() { + /bin/sleep /bin/zcat /usr/bin/bzcat /usr/bin/printf /usr/bin/wc \ + /bin/cut /usr/bin/printf /bin/sync /bin/mkdir /bin/rmdir \ + /bin/rm /usr/bin/basename /bin/kill /bin/chmod /usr/bin/find \ +- /bin/mknod /bin/touch ++ /bin/mknod /bin/touch /bin/sed + + install_bin /sbin/mtd + install_bin /sbin/mount_root +diff --git a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh +index eb6dc823e3890497389716c32ec7e4caf8d30c45..a90a58299dc293afbe15a0b491ef6898402deca4 100644 +--- a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh ++++ b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh +@@ -1,3 +1,5 @@ ++RAMFS_COPY_BIN='/usr/bin/osafeloader /usr/bin/oseama' ++ + PART_NAME=firmware + + # $(1): file to read magic from +@@ -260,8 +262,6 @@ platform_pre_upgrade_seama() { + } + + platform_pre_upgrade() { +- export RAMFS_COPY_BIN="${RAMFS_COPY_BIN} /usr/bin/osafeloader /usr/bin/oseama /bin/sed" +- + local file_type=$(platform_identify "$1") + + [ "$(platform_flash_type)" != "nand" ] && return diff --git a/patches/lede/0034-ipq806x-upgrade-fix-RAMFS_COPY_.patch b/patches/lede/0034-ipq806x-upgrade-fix-RAMFS_COPY_.patch new file mode 100644 index 00000000..71b800fb --- /dev/null +++ b/patches/lede/0034-ipq806x-upgrade-fix-RAMFS_COPY_.patch @@ -0,0 +1,68 @@ +From: Matthias Schiffer +Date: Mon, 10 Jul 2017 18:03:39 +0200 +Subject: ipq806x: upgrade: fix RAMFS_COPY_* + +RAMFS_COPY_* are moved to platform.sh toplevel. The unneeded +linksys_preupgrade function is removed, and the nand_do_upgrade call is +moved to platform_do_upgrade. + +Fixes: 30f61a34b4cf "base-files: always use staged sysupgrade" +Signed-off-by: Matthias Schiffer + +diff --git a/target/linux/ipq806x/base-files/lib/upgrade/linksys.sh b/target/linux/ipq806x/base-files/lib/upgrade/linksys.sh +index 12f25efdae87979e79a252237f735932cb66d42f..0234ce0a51a0a92dcd719102f83e19686442574a 100644 +--- a/target/linux/ipq806x/base-files/lib/upgrade/linksys.sh ++++ b/target/linux/ipq806x/base-files/lib/upgrade/linksys.sh +@@ -99,12 +99,3 @@ platform_do_upgrade_linksys() { + fi + } + } +- +-linksys_preupgrade() { +- export RAMFS_COPY_BIN="${RAMFS_COPY_BIN} /usr/sbin/fw_printenv /usr/sbin/fw_setenv" +- export RAMFS_COPY_BIN="${RAMFS_COPY_BIN} /bin/mkdir /bin/touch" +- export RAMFS_COPY_DATA="${RAMFS_COPY_DATA} /etc/fw_env.config /var/lock/fw_printenv.lock" +- +-} +- +-append sysupgrade_pre_upgrade linksys_preupgrade +diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh +index c3741f9ff242cddb3c185c2f638c7b4dff781e1b..6455b57cfb1346b7cc9e103065080d8ae92edc19 100644 +--- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh ++++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh +@@ -3,11 +3,14 @@ + PART_NAME=firmware + REQUIRE_IMAGE_METADATA=1 + ++RAMFS_COPY_BIN='/usr/sbin/fw_printenv /usr/sbin/fw_setenv' ++RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock' ++ + platform_check_image() { + return 0; + } + +-platform_pre_upgrade() { ++platform_do_upgrade() { + local board=$(ipq806x_board_name) + + case "$board" in +@@ -17,18 +20,8 @@ platform_pre_upgrade() { + r7500 |\ + r7500v2 |\ + r7800) +- nand_do_upgrade "$1" +- ;; +- ea8500) +- linksys_preupgrade "$1" ++ nand_do_upgrade "$ARGV" + ;; +- esac +-} +- +-platform_do_upgrade() { +- local board=$(ipq806x_board_name) +- +- case "$board" in + c2600) + PART_NAME="os-image:rootfs" + MTD_CONFIG_ARGS="-s 0x200000" diff --git a/patches/lede/0035-kirkwood-upgrade-fix-RAMFS_COPY_.patch b/patches/lede/0035-kirkwood-upgrade-fix-RAMFS_COPY_.patch new file mode 100644 index 00000000..7c58d6ce --- /dev/null +++ b/patches/lede/0035-kirkwood-upgrade-fix-RAMFS_COPY_.patch @@ -0,0 +1,60 @@ +From: Matthias Schiffer +Date: Mon, 10 Jul 2017 18:16:23 +0200 +Subject: kirkwood: upgrade: fix RAMFS_COPY_* + +RAMFS_COPY_* are moved to platform.sh toplevel. The nand_do_upgrade call is +moved to platform_do_upgrade. + +Fixes: 30f61a34b4cf "base-files: always use staged sysupgrade" +Signed-off-by: Matthias Schiffer + +diff --git a/target/linux/kirkwood/base-files/lib/upgrade/linksys.sh b/target/linux/kirkwood/base-files/lib/upgrade/linksys.sh +index 13a8f1cb554462acf39a59c9d5c1e6cd4ec222f5..dde3bd1b2190d68ce54e6c2883a45032d58599b2 100644 +--- a/target/linux/kirkwood/base-files/lib/upgrade/linksys.sh ++++ b/target/linux/kirkwood/base-files/lib/upgrade/linksys.sh +@@ -69,11 +69,3 @@ platform_do_upgrade_linksys() { + fi + } + } +- +-linksys_preupgrade() { +- export RAMFS_COPY_BIN="${RAMFS_COPY_BIN} /usr/sbin/fw_printenv /usr/sbin/fw_setenv" +- export RAMFS_COPY_BIN="${RAMFS_COPY_BIN} /bin/mkdir /bin/touch" +- export RAMFS_COPY_DATA="${RAMFS_COPY_DATA} /etc/fw_env.config /var/lock/fw_printenv.lock" +-} +- +-append sysupgrade_pre_upgrade linksys_preupgrade +diff --git a/target/linux/kirkwood/base-files/lib/upgrade/platform.sh b/target/linux/kirkwood/base-files/lib/upgrade/platform.sh +index e7c6a1120a90147380f4fcf644eb7078c1bc1659..c8c66c1b9d67759305ee836f9d84b9a2968a9493 100644 +--- a/target/linux/kirkwood/base-files/lib/upgrade/platform.sh ++++ b/target/linux/kirkwood/base-files/lib/upgrade/platform.sh +@@ -1,5 +1,8 @@ + . /lib/kirkwood.sh + ++RAMFS_COPY_BIN='/usr/sbin/fw_printenv /usr/sbin/fw_setenv' ++RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock' ++ + platform_check_image() { + [ "$#" -gt 1 ] && return 1 + local board="$(kirkwood_board_name)" +@@ -33,19 +36,7 @@ platform_do_upgrade() { + platform_do_upgrade_linksys "$ARGV" + ;; + *) +- default_do_upgrade "$@" +- ;; +- esac +-} +- +-platform_pre_upgrade() { +- local board=$(kirkwood_board_name) +- +- case "$board" in +- "linksys-audi"|\ +- "linksys-viper") ;; +- *) +- nand_do_upgrade $1 ++ nand_do_upgrade "$ARGV" + ;; + esac + }