gluon/patches/lede/0017-fstools-snapshot-handle-jffs2-conversion-using-upgraded.patch
Matthias Schiffer 7bb6a775b1
modules: update LEDE
efb6ca189641 base-files: /lib/functions.sh: ignore errors in insert_modules
b5ba01a0d3f6 fstools: update to latest lede-17.01 branch
a9b607740273 kernel: bump kernel 4.4 to 4.4.126 for 17.01
09d95e44fc3d mbedtls: change libmbedcrypto.so soversion back to 0
4673a0bffc89 kernel: mtd: bcm47xxpart: improve handling TRX partition size

Also switch to the upstreamed version of "kernel: disable accept_ra by
default".
2018-04-17 22:23:26 +02:00

50 lines
1.5 KiB
Diff

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
index 6f1f511d387e900426832f40966012bc11d53075..f2e0580912ab7d475fab576bea4fd84f0dfe6a3d 100644
--- 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)" ] && {