aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ipq806x/base-files
diff options
context:
space:
mode:
authorMathias Kresin <dev@kresin.me>2018-01-17 20:40:55 +0100
committerMathias Kresin <dev@kresin.me>2018-01-18 07:22:37 +0100
commitb6868e2f4703efe18d91c0422fb090d8a119c8fd (patch)
tree5494c2ae23a90f33d5cf02604e8a1b54e51e53df /target/linux/ipq806x/base-files
parentacafbac4b33a5273e6125cf2fcdf118f70cd23ec (diff)
downloadupstream-b6868e2f4703efe18d91c0422fb090d8a119c8fd.tar.gz
upstream-b6868e2f4703efe18d91c0422fb090d8a119c8fd.tar.bz2
upstream-b6868e2f4703efe18d91c0422fb090d8a119c8fd.zip
ipq806x: fix ZyXEL NBG6817 sysupgrade
Use the first found directory in the tar archive instead of relying on a directory named according to the userspace boardname. It allows to change the boardname without adding another compatibility layer to the zyxel sysupgrade. Fixes: 33f09cf15178 ("ipq806x: convert to dt-based board-detection") Signed-off-by: Mathias Kresin <dev@kresin.me>
Diffstat (limited to 'target/linux/ipq806x/base-files')
-rw-r--r--target/linux/ipq806x/base-files/lib/upgrade/zyxel.sh17
1 files changed, 10 insertions, 7 deletions
diff --git a/target/linux/ipq806x/base-files/lib/upgrade/zyxel.sh b/target/linux/ipq806x/base-files/lib/upgrade/zyxel.sh
index 466d8c616c..3efef8f0ba 100644
--- a/target/linux/ipq806x/base-files/lib/upgrade/zyxel.sh
+++ b/target/linux/ipq806x/base-files/lib/upgrade/zyxel.sh
@@ -19,9 +19,8 @@ zyxel_get_rootfs() {
zyxel_do_flash() {
local tar_file=$1
- local board=$2
- local kernel=$3
- local rootfs=$4
+ local kernel=$2
+ local rootfs=$3
# keep sure its unbound
losetup --detach-all || {
@@ -29,14 +28,18 @@ zyxel_do_flash() {
reboot -f
}
+ # use the first found directory in the tar archive
+ local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$')
+ board_dir=${board_dir%/}
+
echo "flashing kernel to /dev/${kernel}"
- tar xf $tar_file sysupgrade-$board/kernel -O >/dev/$kernel
+ tar xf $tar_file ${board_dir}/kernel -O >/dev/$kernel
echo "flashing rootfs to ${rootfs}"
- tar xf $tar_file sysupgrade-$board/root -O >"${rootfs}"
+ tar xf $tar_file ${board_dir}/root -O >"${rootfs}"
# a padded rootfs is needed for overlay fs creation
- local offset=$(tar xf $tar_file sysupgrade-$board/root -O | wc -c)
+ local offset=$(tar xf $tar_file ${board_dir}/root -O | wc -c)
[ $offset -lt 65536 ] && {
echo Wrong size for rootfs: $offset
sleep 10
@@ -92,7 +95,7 @@ zyxel_do_upgrade() {
;;
esac
- zyxel_do_flash $tar_file $board $kernel $rootfs
+ zyxel_do_flash $tar_file $kernel $rootfs
return 0
}