aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/sysupgrade-tar.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/sysupgrade-tar.sh')
-rwxr-xr-xscripts/sysupgrade-tar.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/sysupgrade-tar.sh b/scripts/sysupgrade-tar.sh
index d1d627a96e..b93b2584bb 100755
--- a/scripts/sysupgrade-tar.sh
+++ b/scripts/sysupgrade-tar.sh
@@ -1,5 +1,7 @@
#!/bin/sh
+. $TOPDIR/scripts/functions.sh
+
board=""
kernel=""
rootfs=""
@@ -53,7 +55,16 @@ fi
mkdir -p "${tmpdir}/sysupgrade-${board}"
echo "BOARD=${board}" > "${tmpdir}/sysupgrade-${board}/CONTROL"
-[ -z "${rootfs}" ] || cp "${rootfs}" "${tmpdir}/sysupgrade-${board}/root"
+if [ -n "${rootfs}" ]; then
+ case "$( get_fs_type ${rootfs} )" in
+ "squashfs")
+ dd if="${rootfs}" of="${tmpdir}/sysupgrade-${board}/root" bs=1024 conv=sync
+ ;;
+ *)
+ cp "${rootfs}" "${tmpdir}/sysupgrade-${board}/root"
+ ;;
+ esac
+fi
[ -z "${kernel}" ] || cp "${kernel}" "${tmpdir}/sysupgrade-${board}/kernel"
mtime=""