fstools: snapshot: handle jffs2 conversion using upgraded
authorMatthias Schiffer <mschiffer@universe-factory.net>
Wed, 3 May 2017 06:29:55 +0000 (08:29 +0200)
committerMatthias Schiffer <mschiffer@universe-factory.net>
Mon, 29 May 2017 21:50:33 +0000 (23:50 +0200)
We can reuse the kill_remaining and run_ramfs facilities of the stage2 run
by upgraded.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
package/system/fstools/Makefile
package/system/fstools/files/snapshot

index 1cdf6cd15328e7d90ce59afb2307d4973177a15f..dc012673084a293b3d466800e37452a27a15e2f1 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fstools
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(LEDE_GIT)/project/fstools.git
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)" ] && {