another try in A/B support

merge-requests/23/head
Christopher Roy Bratusek 6 years ago
parent c97672289e
commit f95383942c

@ -7,6 +7,8 @@ ZIP=${3}
ZIPDIR=$(dirname "${ZIP}")
MODID=NanoDroid_FDroid
umount /system
mkdir /dev/tmp
unzip -o "${ZIP}" nanodroid-functions -d "/dev/tmp"
if [ ! -f /dev/tmp/nanodroid-functions ]; then
@ -21,7 +23,7 @@ detect_outfd
show_banner
mount_all_partitions
mount_partitions
unpack_zip
detect_arch

@ -7,6 +7,8 @@ ZIP=${3}
ZIPDIR=$(dirname "${ZIP}")
MODID=NanoDroid
umount /system
mkdir /dev/tmp
unzip -o "${ZIP}" nanodroid-functions -d "/dev/tmp"
if [ ! -f /dev/tmp/nanodroid-functions ]; then
@ -21,7 +23,7 @@ detect_outfd
show_banner
mount_all_partitions
mount_partitions
unpack_zip
detect_arch

@ -127,7 +127,7 @@ error () {
}
# taken from Magisk, with minor modifications for NanoDroid
mount_all_partitions () {
mount_partitions () {
SLOT=$(getprop ro.boot.slot_suffix)
if [ -z ${SLOT} ]; then
SLOT=$(getprop ro.boot.slot)
@ -138,31 +138,14 @@ mount_all_partitions () {
${BOOTMODE} || mount -o bind /dev/urandom /dev/random
is_mounted /system || [ -f /system/build.prop ] || mount -o ro /system 2>/dev/null
[ ! -f /system/build.prop ] && mount -o ro /system 2>/dev/null
if ! is_mounted /system && ! [ -f /system/build.prop ]; then
if [ ! -f /system/build.prop ]; then
SYSTEMBLOCK=$(find /dev/block -iname system${SLOT} | head -n 1)
mount -t ext4 -o ro $SYSTEMBLOCK /system
fi
is_mounted /system || [ -f /system/build.prop ] || error "failed to mount /system"
cat /proc/mounts | grep -E '/dev/root|/system_root' >/dev/null && SKIP_INITRAMFS=true || SKIP_INITRAMFS=false
if [ -f /system/init.rc ]; then
SKIP_INITRAMFS=true
mkdir /system_root 2>/dev/null
mount --move /system /system_root
mount -o bind /system_root/system /system
fi
if [ -L /system/vendor ]; then
is_mounted /vendor || mount -o ro /vendor 2>/dev/null
if ! is_mounted /vendor; then
VENDORBLOCK=$(find /dev/block -iname vendor${SLOT} | head -n 1)
mount -t ext4 -o ro ${VENDORLOCK} /vendor
fi
is_mounted /vendor || error "failed to mount /vendor"
fi
[ ! -f /system/build.prop ] && error "failed to mount /system"
}
detect_mode () {
@ -200,13 +183,8 @@ detect_mode () {
;;
esac
else
if is_mounted /system_root; then
mount -orw,remount /system_root 2>/dev/null || \
error " !! failed to re-mount /system read-write"
else
mount -orw,remount /system 2>/dev/null || \
mount -orw,remount /system 2>/dev/null || \
error " !! failed to re-mount /system read-write"
fi
unset MODPATH
fi
}

@ -7,6 +7,8 @@ ZIP=${3}
ZIPDIR=$(dirname "${ZIP}")
MODID=NanoDroid_microG
umount /system
mkdir /dev/tmp
unzip -o "${ZIP}" nanodroid-functions -d "/dev/tmp"
if [ ! -f /dev/tmp/nanodroid-functions ]; then
@ -21,7 +23,7 @@ detect_outfd
show_banner
mount_all_partitions
mount_partitions
unpack_zip
detect_arch

Loading…
Cancel
Save