Skip to content

Commit

Permalink
Fix tmpfs mounts in avd_magisk.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
topjohnwu committed Feb 14, 2025
1 parent 442d533 commit 15b7c4c
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions scripts/avd_magisk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,15 @@
#
#####################################################################

mount_tmpfs() {
# If a file name 'magisk' is in current directory, mount will fail
mv magisk magisk.tmp
mount -t tmpfs -o 'mode=0755' magisk $1
mv magisk.tmp magisk
}

mount_sbin() {
mount -t tmpfs -o 'mode=0755' magisk /sbin
mount_tmpfs /sbin
chcon u:object_r:rootfs:s0 /sbin
}

Expand Down Expand Up @@ -114,10 +121,7 @@ elif [ -e /sbin ]; then
else
# Android Q+ without sbin
MAGISKTMP=/debug_ramdisk
# If a file name 'magisk' is in current directory, mount will fail
mv magisk magisk.tmp
mount -t tmpfs -o 'mode=0755' magisk /debug_ramdisk
mv magisk.tmp magisk
mount_tmpfs /debug_ramdisk
fi

# Magisk stuff
Expand All @@ -142,7 +146,7 @@ ln -s ./magiskpolicy $MAGISKTMP/supolicy

mkdir -p $MAGISKTMP/.magisk/device
mkdir -p $MAGISKTMP/.magisk/worker
mount -t tmpfs -o 'mode=0755' magisk $MAGISKTMP/.magisk/worker
mount_tmpfs $MAGISKTMP/.magisk/worker
mount --make-private $MAGISKTMP/.magisk/worker
touch $MAGISKTMP/.magisk/config

Expand Down

0 comments on commit 15b7c4c

Please sign in to comment.