diff options
author | PaulW <paulw@hardmilk.com> | 2011-05-13 12:56:19 +0100 |
---|---|---|
committer | PaulW <paulwamp@gmail.com> | 2011-05-17 17:49:39 +0100 |
commit | cfe876cefba4b973b96718069e09aaafdd47d5fd (patch) | |
tree | 500385406a51dd3ed5d95186370d78a630e8317d /prebuilt | |
parent | 2769ff7ab89619263624108e8bc91832e5a8cb4f (diff) | |
download | vendor_replicant-cfe876cefba4b973b96718069e09aaafdd47d5fd.zip vendor_replicant-cfe876cefba4b973b96718069e09aaafdd47d5fd.tar.gz vendor_replicant-cfe876cefba4b973b96718069e09aaafdd47d5fd.tar.bz2 |
Update backuptool.sh to correctly process force_backuptool flag/file.
This is regarding the following patch:
https://github.com/CyanogenMod/android_vendor_cyanogen/commit/5cdb4ec653b06721dcc6f0b486943d62a1a4c8c2
The patch which was to allow custom_backup_list.txt to be maintained while flashing via ROMManager
WHILE the flag/file force_backuptool is set/present still has issues. There are 2 reasons for this.
1) The flag is only checked during the first pass (backuptool.sh backup), as once /etc/force_backuptool
is known to exist, all files are moved to /tmp/backupdir as designated, but when the script is
ran again once /system has been wiped and updated, the file /etc/force_backuptool no longer exists
as it was moved to /tmp/backupdir/force_backuptool, so the script fails as it is not checking that
location.
2) When the backuptool.sh script is called, the above function (checking for force_backuptool) is called
*before* the /system partition is mounted. This therefor ignores the file regardless of whether it
exists or not. This is caused by check_installscript being called at the wrong point of the script.
There are therefor 2(two) main changes to this script to allow the force_backuptool override to work.
The first being within the main function of check_installscript, and the second being the location of
where check_installscript is called (ie, I moved it to below check_prereq call in the case statement,
as mounting is called before the check_prereq function checks if the ROM version is the same).
This affects *all* devices.
Change-Id: Ia7438f396eaa91b0723e56bb32ce98725e2b2025
Diffstat (limited to 'prebuilt')
-rwxr-xr-x | prebuilt/common/bin/backuptool.sh | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/prebuilt/common/bin/backuptool.sh b/prebuilt/common/bin/backuptool.sh index dc4590a..39666ce 100755 --- a/prebuilt/common/bin/backuptool.sh +++ b/prebuilt/common/bin/backuptool.sh @@ -18,10 +18,18 @@ check_prereq() { } check_installscript() { - if [ -f "/tmp/.installscript" -a ! -f "$S/etc/force_backuptool" ]; + if [ -f "/tmp/.installscript" ] && [ $PROCEED -ne 0 ]; then - echo "/tmp/.installscript found. Skipping backuptool." - PROCEED=0; + # We have an install script, and ROM versions match! + # We now need to check and see if we have force_backup + # in either /etc or /tmp/backupdir + if [ -f "$S/etc/force_backuptool" ] || [ -f "$C/force_backuptool" ]; + then + echo "force_backuptool file found, Forcing backuptool." + else + echo "/tmp/.installscript found. Skipping backuptool." + PROCEED=0; + fi fi } @@ -132,12 +140,11 @@ restore_file() { fi } -check_installscript; - case "$1" in backup) mount $S check_prereq; + check_installscript; if [ $PROCEED -ne 0 ]; then rm -rf $C @@ -152,6 +159,7 @@ case "$1" in ;; restore) check_prereq; + check_installscript; if [ $PROCEED -ne 0 ]; then for file_list in get_files get_custom_files; do |