Commit Graph

9 Commits

Author SHA1 Message Date
Gabriele M 52996421a1 backuptool: Preserve the SELinux context of the files
Add a function that allows to copy files preserving their SELinux
context that is generic enough to work with both busybox and toybox.

Change-Id: If2c245863df5675c18dbf43b6bcedeb33383fc38
2017-02-27 23:33:02 -05:00
Gabriele M cf276aa7cd backuptool: Don't rely on the order of the elements in the list
We should not test symlinks using -e or -f, otherwise the order in
which the files are backed up and restored matters.

Change-Id: I9b87972b27a63ef562c0c5f46f943eafd0a08ce1
2017-02-27 23:33:02 -05:00
Michael Bestas eb83dba7ce Updates for cm-13.0
Change-Id: I6a0efff3bf6ea2e332cacd7cbb2f2b132b2c73dd
2015-10-07 21:15:52 +03:00
Michael Bestas 6399c8be4b Updates for cm-12.1
Change-Id: I3eefaadce417ed3802f31bd62ee57a3b18561839
2015-04-01 05:30:52 +03:00
Ricardo Cerqueira 49a30e7d17 Updates for CM12 2014-11-06 14:54:32 +00:00
Ricardo Cerqueira 50dda4c2a9 Updates for CM11
Change-Id: Icb527c5aefa0dd86cc91f42f4f691b5fdf7ead48
2013-11-05 15:26:20 +00:00
blunden 02d26cb1ae Update version in backuptool.functions too
Change-Id: Idbdf7ffbec037a78c2d3df4ca2a83c1058c19279
2013-08-25 05:37:19 +00:00
Chirayu Desai 700fc8f6c4 backuptool: only restore from same major.minor version
Change-Id: I63113fa9b3cbc6b0e1b3df75ef7dfb3160ee5062
2012-12-13 19:36:37 +05:30
Warren Togami b1637c8e2b Modular backuptool.sh. Executes backup and restore methods defined in arbitrary /system/addon.d/*.sh scripts.
Tips & Tricks
=============
* 50-cm.sh contains only a reference implementation.  You may customize the methods however you wish.
  For example, 20-foobar.sh pre-backup can use a loop with conditionals to generate a dynamic backup list in
  /tmp/foobar_file_list which is later printed by list_files() so the backup method will act on those files.
* Optional methods pre-backup, post-backup, pre-restore, or post-restore may be defined for special purposes.
* Inject new files into /tmp/addon.d/ prior to backuptool.sh backup if you want to act during the current CM upgrade.
* Delete files from /tmp/addon.d/ during post-restore if you want to permanently remove files from /system/addon.d/
  Addons may use this approach to run a script only once.
* Scripts run in sort -n order.  Prefix with numbers 00 through 99 if want to run in a particular order.
* You can have two separate scripts, implementing only backup in one, and only restore in the other with a different
  number prefix of each.  This allows even greater control the backup/restore order even further.
* You could use pre-backup to generate a one-time use backup script in /tmp/addon.d/ that deletes itself in
  post-restore.

Patch Series
============
http://review.cyanogenmod.com/#change,13265
CyanogenMod/android_build
  * edify generator
http://review.cyanogenmod.com/#change,13266
CyanogenMod/android_system_core
  * permissions on /system/addon.d
http://review.cyanogenmod.com/#change,13267
CyanogenMod/android_vendor_cm
  * 50-cm.sh reference backup script
  * modular backuptool.sh
  * support backuptool.functions used by /system/addon.d/*.sh scripts

Change-Id: Ifd5eaf9dcfd68d92e5043c21d1bae1dc0ad54860
2012-03-08 20:40:36 -10:00