Backend: fix apex mounts on fastboot boot'd TWRP
- work around different /apex environment causing loop mounts to fail on TWRP only when it's initiated by `fastboot boot twrp.img`
This commit is contained in:
2 files changed
+4
-1
No files matched your search
@@ -52,6 +52,7 @@ mount_apex() {
|
||||
[ -d /system_root/system/apex ] || return 1;
|
||||
local apex dest loop minorx num var;
|
||||
setup_mountpoint /apex;
|
||||
$BB mount -t tmpfs tmpfs /apex -o mode=755 && $BB touch /apex/apextmp;
|
||||
minorx=1;
|
||||
[ -e /dev/block/loop1 ] && minorx=$($BB ls -l /dev/block/loop1 | $BB awk '{ print $6 }');
|
||||
num=0;
|
||||
@@ -89,6 +90,7 @@ mount_apex() {
|
||||
$($BB grep -o 'export .* /.*' /system_root/init.environ.rc | $BB sed 's; /;=/;'); unset export;
|
||||
}
|
||||
umount_apex() {
|
||||
[ -d /apex ] || return 1;
|
||||
local dest loop var;
|
||||
for var in $($BB grep -o 'export .* /.*' /system_root/init.environ.rc 2>/dev/null | $BB awk '{ print $2 }'); do
|
||||
if [ "$(eval echo \$OLD_$var)" ]; then
|
||||
@@ -103,6 +105,7 @@ umount_apex() {
|
||||
$BB umount -l $dest;
|
||||
[ "$loop" ] && $BB losetup -d $loop;
|
||||
done;
|
||||
[ -f /apex/apextmp ] && $BB umount /apex;
|
||||
$BB rm -rf /apex 2>/dev/null;
|
||||
}
|
||||
mount_all() {
|
||||
|
||||
Reference in new issue
Block a user