summaryrefslogtreecommitdiffstats
path: root/prebuilt/common/bin
diff options
context:
space:
mode:
authorRicardo Cerqueira <cyanogenmod@cerqueira.org>2012-12-19 01:11:21 +0000
committerRicardo Cerqueira <cyanogenmod@cerqueira.org>2012-12-19 01:16:17 +0000
commit129989b172c48d8937d7b104d2146b567b4c1dcc (patch)
treee018ad93e15e4a5c16882c01a54778e8da66d03e /prebuilt/common/bin
parent5ae470e24a6935c3d8e906dd676ad5771194835e (diff)
downloadvendor_replicant-129989b172c48d8937d7b104d2146b567b4c1dcc.zip
vendor_replicant-129989b172c48d8937d7b104d2146b567b4c1dcc.tar.gz
vendor_replicant-129989b172c48d8937d7b104d2146b567b4c1dcc.tar.bz2
backuptool: Disregard known bad backup scripts
Keep a blacklist of md5 sums for scripts known to cause issues, and ignore them when installing new builds Change-Id: I19a88b58194a32da5eb5fe278f2c5b9a145b57be
Diffstat (limited to 'prebuilt/common/bin')
-rwxr-xr-xprebuilt/common/bin/backuptool.sh13
-rw-r--r--prebuilt/common/bin/blacklist4
2 files changed, 17 insertions, 0 deletions
diff --git a/prebuilt/common/bin/backuptool.sh b/prebuilt/common/bin/backuptool.sh
index 68b1ff8..c576be3 100755
--- a/prebuilt/common/bin/backuptool.sh
+++ b/prebuilt/common/bin/backuptool.sh
@@ -28,6 +28,17 @@ if ( ! grep -q "^ro.cm.version=$V.*" /system/build.prop ); then
fi
}
+check_blacklist() {
+ if [ -f /system/addon.d/blacklist ];then
+ ## Discard any known bad backup scripts
+ cd /$1/addon.d/
+ for f in *sh; do
+ s=$(md5sum $f | awk {'print $1'})
+ grep -q $s /system/addon.d/blacklist && rm -f $f
+ done
+ fi
+}
+
# Execute /system/addon.d/*.sh scripts with $1 parameter
run_stage() {
for script in $(find /tmp/addon.d/ -name '*.sh' |sort -n); do
@@ -39,6 +50,7 @@ case "$1" in
backup)
mkdir -p $C
check_prereq
+ check_blacklist system
preserve_addon_d
run_stage pre-backup
run_stage backup
@@ -46,6 +58,7 @@ case "$1" in
;;
restore)
check_prereq
+ check_blacklist tmp
run_stage pre-restore
run_stage restore
run_stage post-restore
diff --git a/prebuilt/common/bin/blacklist b/prebuilt/common/bin/blacklist
new file mode 100644
index 0000000..03c36c4
--- /dev/null
+++ b/prebuilt/common/bin/blacklist
@@ -0,0 +1,4 @@
+80f99c594f7b82c4cbe533e3f5447729
+29f4bab6bae5959458678869350dc888
+77d73f73da664f3592e712b7e7c107c1
+a5019b358023a3a6ae8be3f3380ba5ca