2017-05-30 01:30:02 +00:00
|
|
|
From: Matthias Schiffer <mschiffer@universe-factory.net>
|
|
|
|
Date: Wed, 3 May 2017 08:29:55 +0200
|
|
|
|
Subject: fstools: snapshot: handle jffs2 conversion using upgraded
|
|
|
|
|
|
|
|
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>
|
|
|
|
|
|
|
|
diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile
|
2018-01-09 15:34:34 +00:00
|
|
|
index 16f2f7e77062b528a4e3b9d0b5b4f4072e3b5756..f0f6c3d7eec3e90ab1403ae766c95d03104a0d29 100644
|
2017-05-30 01:30:02 +00:00
|
|
|
--- a/package/system/fstools/Makefile
|
|
|
|
+++ b/package/system/fstools/Makefile
|
|
|
|
@@ -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
|
|
|
|
diff --git a/package/system/fstools/files/snapshot b/package/system/fstools/files/snapshot
|
|
|
|
index baf24f1e3e90fe7708e0f28c17ba270a35a2cd52..a495e3434523b7a4b1b2f1bc3f4c9298197fc745 100644
|
|
|
|
--- a/package/system/fstools/files/snapshot
|
|
|
|
+++ b/package/system/fstools/files/snapshot
|
|
|
|
@@ -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)" ] && {
|