fstools: snapshot: handle jffs2 conversion using upgraded
[openwrt/staging/chunkeey.git] / package / system / fstools / files / snapshot
index baf24f1e3e90fe7708e0f28c17ba270a35a2cd52..a495e3434523b7a4b1b2f1bc3f4c9298197fc745 100644 (file)
@@ -64,14 +64,16 @@ do_convert_jffs2() {
 do_convert() {
        . /lib/functions.sh
        . /lib/upgrade/common.sh
-       ubus call system upgrade
-       touch /tmp/sysupgrade
+
        cd /overlay/upper
        tar czf /tmp/snapshot.tar.gz *
-       kill_remaining TERM
-       sleep 3
-       kill_remaining KILL
-       run_ramfs '. /sbin/snapshot; do_convert_jffs2'
+
+       install_bin /sbin/upgraded
+       ubus call system sysupgrade "{
+               \"prefix\": \"$RAM_ROOT\",
+               \"path\": \"\",
+               \"command\": \". /sbin/snapshot; do_convert_jffs2\"
+       }"
 }
 
 [ -n "$(cat /proc/mounts|grep /overlay|grep jffs2)" ] && {