0110-fstools-snapshot-handle-jffs2-conversion-using-upgraded.patch 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  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/files/snapshot b/package/system/fstools/files/snapshot
  8. index eec7214032d1b147d5e989cd305c5c0cd1357a55..79be0d24bb68cc9b4ea8ce5b5d6b7558b2f0b0c5 100644
  9. --- a/package/system/fstools/files/snapshot
  10. +++ b/package/system/fstools/files/snapshot
  11. @@ -64,14 +64,16 @@ do_convert_jffs2() {
  12. do_convert() {
  13. . /lib/functions.sh
  14. . /lib/upgrade/common.sh
  15. - ubus call system upgrade
  16. - touch /tmp/sysupgrade
  17. +
  18. cd /overlay
  19. tar czf /tmp/snapshot.tar.gz *
  20. - kill_remaining TERM
  21. - sleep 3
  22. - kill_remaining KILL
  23. - run_ramfs '. /sbin/snapshot; do_convert_jffs2'
  24. +
  25. + install_bin /sbin/upgraded
  26. + ubus call system sysupgrade "{
  27. + \"prefix\": \"$RAM_ROOT\",
  28. + \"path\": \"\",
  29. + \"command\": \". /sbin/snapshot; do_convert_jffs2\"
  30. + }"
  31. }
  32. [ -n "$(cat /proc/mounts|grep /overlay|grep jffs2)" ] && {