mirror of
https://github.com/FriendlyNeighborhoodShane/MinMicroG
synced 2024-11-15 00:12:48 +00:00
update-binary: use a list for cleanup unmounting
This commit is contained in:
parent
7c40dd091c
commit
adb99b5fde
@ -48,10 +48,13 @@ file_getprop() {
|
|||||||
grep "^$2" "$1" | head -n1 | select_word 1 | cut -d= -f2;
|
grep "^$2" "$1" | head -n1 | select_word 1 | cut -d= -f2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
umountparts="";
|
||||||
cleanup() {
|
cleanup() {
|
||||||
rm -rf "$filedir" "$bbdir";
|
rm -rf "$filedir" "$bbdir";
|
||||||
$bootmode || {
|
$bootmode || {
|
||||||
if [ "$sysroot" ]; then umount "$sysroot"; else umount "/system"; fi;
|
for part in $umountparts; do
|
||||||
|
umount "$part";
|
||||||
|
done;
|
||||||
}
|
}
|
||||||
sync;
|
sync;
|
||||||
}
|
}
|
||||||
@ -79,10 +82,13 @@ log "Zip File is $zipfile";
|
|||||||
log "Bootmode is $bootmode";
|
log "Bootmode is $bootmode";
|
||||||
|
|
||||||
$bootmode || {
|
$bootmode || {
|
||||||
[ -e "/system" ] && mount -o ro /system;
|
for part in "/system" "/system_root" "/mnt/system"; do
|
||||||
[ -e "/system_root" ] && mount -o ro /system_root;
|
[ -e "$part" ] || continue;
|
||||||
[ -e "/mnt/system" ] && mount -o ro /mnt/system;
|
mount -o ro "$part";
|
||||||
|
umountparts="$umountparts $part";
|
||||||
|
done;
|
||||||
mount /data;
|
mount /data;
|
||||||
|
umountparts="$umountparts /data";
|
||||||
}
|
}
|
||||||
[ -e "/system/system/build.prop" ] && sysroot="system";
|
[ -e "/system/system/build.prop" ] && sysroot="system";
|
||||||
[ -e "/system_root/system/build.prop" ] && sysroot="system_root";
|
[ -e "/system_root/system/build.prop" ] && sysroot="system_root";
|
||||||
|
Loading…
Reference in New Issue
Block a user