mirror of https://github.com/hak5/openwrt.git
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>openwrt-18.06
parent
6bbb3a2b0a
commit
218af1957e
|
@ -8,7 +8,7 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=fstools
|
PKG_NAME:=fstools
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_URL=$(LEDE_GIT)/project/fstools.git
|
PKG_SOURCE_URL=$(LEDE_GIT)/project/fstools.git
|
||||||
|
|
|
@ -64,14 +64,16 @@ do_convert_jffs2() {
|
||||||
do_convert() {
|
do_convert() {
|
||||||
. /lib/functions.sh
|
. /lib/functions.sh
|
||||||
. /lib/upgrade/common.sh
|
. /lib/upgrade/common.sh
|
||||||
ubus call system upgrade
|
|
||||||
touch /tmp/sysupgrade
|
|
||||||
cd /overlay/upper
|
cd /overlay/upper
|
||||||
tar czf /tmp/snapshot.tar.gz *
|
tar czf /tmp/snapshot.tar.gz *
|
||||||
kill_remaining TERM
|
|
||||||
sleep 3
|
install_bin /sbin/upgraded
|
||||||
kill_remaining KILL
|
ubus call system sysupgrade "{
|
||||||
run_ramfs '. /sbin/snapshot; do_convert_jffs2'
|
\"prefix\": \"$RAM_ROOT\",
|
||||||
|
\"path\": \"\",
|
||||||
|
\"command\": \". /sbin/snapshot; do_convert_jffs2\"
|
||||||
|
}"
|
||||||
}
|
}
|
||||||
|
|
||||||
[ -n "$(cat /proc/mounts|grep /overlay|grep jffs2)" ] && {
|
[ -n "$(cat /proc/mounts|grep /overlay|grep jffs2)" ] && {
|
||||||
|
|
Loading…
Reference in New Issue