drop mount-magisk Script

merge-requests/23/head
Christopher Roy Bratusek 5 years ago
parent dcf14f5a3b
commit 98897580ba

@ -30,7 +30,6 @@ Table of Contents
* [Parallel Installations](#parallel-installations)
* [Extras](#extras)
* [F-Droid Repository](#f-droid-repository)
* [Scripts](#scripts)
* [Details](#details)
* [NanoDroid](#nanodroid-1)
* [NanoDroid-Overlay](#nanodroid-overlay)
@ -330,14 +329,6 @@ Extra packages, flashing trough TWRP recommended, flashing through Magisk Manage
In order to ease updating NanoDroid's custom application builds you can use it's companion [F-Droid Repository](https://www.nanolx.org/fdroid/repo)
### Scripts
Misc. Scripts for use from PC/Notebook, while device is in TWRP, they are found in this repository:
* **mount-magisk**
* script to mount or unmount Magisk in TWRP
* script toggles mount-state (read: will mount Magisk if unmounted and unmount Magisk if mounted)
## Details
### NanoDroid

@ -1,58 +0,0 @@
#!/sbin/sh
is_mounted() {
if [ ! -z "$2" ]; then
cat /proc/mounts | grep $1 | grep $2, >/dev/null
else
cat /proc/mounts | grep $1 >/dev/null
fi
return $?
}
mount_image() {
if [ ! -d "$2" ]; then
mount -o rw,remount rootfs /
mkdir -p "$2" 2>/dev/null
[ ! -d "$2" ] && return 1
fi
if ! is_mounted "$2"; then
LOOPDEVICE=
for LOOP in 0 1 2 3 4 5 6 7; do
if ! is_mounted "$2"; then
LOOPDEVICE=/dev/block/loop$LOOP
[ -e $LOOPDEVICE ] || mknod $LOOPDEVICE b 7 $LOOP 2>/dev/null
losetup $LOOPDEVICE "$1" && mount -t ext4 -o loop $LOOPDEVICE "$2"
if is_mounted "$2"; then
echo "$LOOPDEVICE" > /tmp/loopdevice
break;
fi
fi
done
fi
}
mount_magisk () {
mount /data &>/dev/null
if [ -f /data/adb/magisk.img ]; then
mount_image /data/adb/magisk.img /magisk
elif [ -f /data/magisk.img ]; then
mount_image /data/magisk.img /magisk
fi
}
umount_magisk () {
umount /magisk
losetup -d $(cat /tmp/loopdevice)
rm /tmp/loopdevice
}
if (is_mounted /magisk); then
if [ -f /tmp/loopdevice ]; then
umount_magisk
else echo "Magisk is mounted, but not using mount-magisk"
echo "not unmounting Magisk"
fi
else mount_magisk
fi
Loading…
Cancel
Save