0020-fstools-snapshot-handle-jffs2-conversion-using-upgraded.patch 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Wed, 3 May 2017 08:29:55 +0200
  3. Subject: fstools: snapshot: handle jffs2 conversion using upgraded
  4. We can reuse the kill_remaining and run_ramfs facilities of the stage2 run
  5. by upgraded.
  6. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
  7. diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile
  8. index 28f68b57d6f82dd066410a577e84e32a3a54dc37..2789424c5f5fb50cc1f004d2ab5223a7fecbf53a 100644
  9. --- a/package/system/fstools/Makefile
  10. +++ b/package/system/fstools/Makefile
  11. @@ -8,7 +8,7 @@
  12. include $(TOPDIR)/rules.mk
  13. PKG_NAME:=fstools
  14. -PKG_RELEASE:=1
  15. +PKG_RELEASE:=2
  16. PKG_SOURCE_PROTO:=git
  17. PKG_SOURCE_URL=$(LEDE_GIT)/project/fstools.git
  18. diff --git a/package/system/fstools/files/snapshot b/package/system/fstools/files/snapshot
  19. index baf24f1e3e90fe7708e0f28c17ba270a35a2cd52..a495e3434523b7a4b1b2f1bc3f4c9298197fc745 100644
  20. --- a/package/system/fstools/files/snapshot
  21. +++ b/package/system/fstools/files/snapshot
  22. @@ -64,14 +64,16 @@ do_convert_jffs2() {
  23. do_convert() {
  24. . /lib/functions.sh
  25. . /lib/upgrade/common.sh
  26. - ubus call system upgrade
  27. - touch /tmp/sysupgrade
  28. +
  29. cd /overlay/upper
  30. tar czf /tmp/snapshot.tar.gz *
  31. - kill_remaining TERM
  32. - sleep 3
  33. - kill_remaining KILL
  34. - run_ramfs '. /sbin/snapshot; do_convert_jffs2'
  35. +
  36. + install_bin /sbin/upgraded
  37. + ubus call system sysupgrade "{
  38. + \"prefix\": \"$RAM_ROOT\",
  39. + \"path\": \"\",
  40. + \"command\": \". /sbin/snapshot; do_convert_jffs2\"
  41. + }"
  42. }
  43. [ -n "$(cat /proc/mounts|grep /overlay|grep jffs2)" ] && {