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;
|
[ -d /system_root/system/apex ] || return 1;
|
||||||
local apex dest loop minorx num var;
|
local apex dest loop minorx num var;
|
||||||
setup_mountpoint /apex;
|
setup_mountpoint /apex;
|
||||||
|
$BB mount -t tmpfs tmpfs /apex -o mode=755 && $BB touch /apex/apextmp;
|
||||||
minorx=1;
|
minorx=1;
|
||||||
[ -e /dev/block/loop1 ] && minorx=$($BB ls -l /dev/block/loop1 | $BB awk '{ print $6 }');
|
[ -e /dev/block/loop1 ] && minorx=$($BB ls -l /dev/block/loop1 | $BB awk '{ print $6 }');
|
||||||
num=0;
|
num=0;
|
||||||
@@ -89,6 +90,7 @@ mount_apex() {
|
|||||||
$($BB grep -o 'export .* /.*' /system_root/init.environ.rc | $BB sed 's; /;=/;'); unset export;
|
$($BB grep -o 'export .* /.*' /system_root/init.environ.rc | $BB sed 's; /;=/;'); unset export;
|
||||||
}
|
}
|
||||||
umount_apex() {
|
umount_apex() {
|
||||||
|
[ -d /apex ] || return 1;
|
||||||
local dest loop var;
|
local dest loop var;
|
||||||
for var in $($BB grep -o 'export .* /.*' /system_root/init.environ.rc 2>/dev/null | $BB awk '{ print $2 }'); do
|
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
|
if [ "$(eval echo \$OLD_$var)" ]; then
|
||||||
@@ -103,6 +105,7 @@ umount_apex() {
|
|||||||
$BB umount -l $dest;
|
$BB umount -l $dest;
|
||||||
[ "$loop" ] && $BB losetup -d $loop;
|
[ "$loop" ] && $BB losetup -d $loop;
|
||||||
done;
|
done;
|
||||||
|
[ -f /apex/apextmp ] && $BB umount /apex;
|
||||||
$BB rm -rf /apex 2>/dev/null;
|
$BB rm -rf /apex 2>/dev/null;
|
||||||
}
|
}
|
||||||
mount_all() {
|
mount_all() {
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
# Dummy file; update-binary is a shell script (DO NOT CHANGE)
|
# Dummy file; update-binary is a shell script (DO NOT CHANGE)
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# AK_BASE_VERSION=20211016
|
# AK_BASE_VERSION=20211018
|
||||||
Reference in new issue
Block a user