patcher: initial A/B partition scheme support

merge-requests/23/head
Christopher Roy Bratusek 6 years ago
parent 1a73733155
commit 429710af8f

@ -2,6 +2,10 @@
## 16.3 in-dev
* Full, microG, F-Droid packages
* improved A/B partition scheme support
* Patcher
* initial A/B parition scheme support
* Updates (automatic)
* AnySoftKeyboard (1.9.1117)
* Déjà Vu nlpBackend (1.1.3)

@ -81,6 +81,34 @@ mount_image() {
fi
}
# taken from Magisk, with minor modifications for NanoDroid
mount_partitions () {
SLOT=$(getprop ro.boot.slot_suffix)
if [ -z ${SLOT} ]; then
SLOT=$(getprop ro.boot.slot)
[ "${SLOT}" = "_" ] && SLOT=
fi
is_mounted /data || mount /data 2>/dev/null
${BOOTMODE} || mount -o bind /dev/urandom /dev/random
[ ! -f /system/build.prop ] && mount -o ro /system 2>/dev/null
if [ ! -f /system/build.prop ]; then
SYSTEMBLOCK=$(find /dev/block -iname system${SLOT} | head -n 1)
mount -t ext4 -o ro $SYSTEMBLOCK /system
fi
if [ -f /system/init.rc ]; then
mkdir /system_root 2>/dev/null
mount --move /system /system_root
mount -o bind /system_root/system /system
fi
[ ! -f /system/build.prop ] && error "failed to mount /system"
}
error () {
ui_print "${@}"
magisk_cleanup
@ -454,11 +482,7 @@ nanodroid_sigspoofui=0
get_config .nanodroid-setup
[ "$config_exists" -eq 1 ] && source ${config}
if ! (is_mounted /data); then
mount -orw /data || error " !! failed to mount /data"
else mount -orw,remount /data || \
error " !! failed to remount /data read-write"
fi
mount_partition
if [ -f /data/adb/.nanodroid-patcher ]; then
ui_print " !! /data/adb/.nanodroid-patcher exists"
@ -466,12 +490,6 @@ if [ -f /data/adb/.nanodroid-patcher ]; then
error " !! remove this file and try again"
fi
if ! (is_mounted /system); then
mount -orw /system || error " !! failed to mount /system"
else mount -orw,remount /system || \
error " !! failed to remount /system read-write"
fi
setup_patcher
detect_sdk

@ -68,6 +68,34 @@ mount_image() {
fi
}
# taken from Magisk, with minor modifications for NanoDroid
mount_partitions () {
SLOT=$(getprop ro.boot.slot_suffix)
if [ -z ${SLOT} ]; then
SLOT=$(getprop ro.boot.slot)
[ "${SLOT}" = "_" ] && SLOT=
fi
is_mounted /data || mount /data 2>/dev/null
${BOOTMODE} || mount -o bind /dev/urandom /dev/random
[ ! -f /system/build.prop ] && mount -o ro /system 2>/dev/null
if [ ! -f /system/build.prop ]; then
SYSTEMBLOCK=$(find /dev/block -iname system${SLOT} | head -n 1)
mount -t ext4 -o ro $SYSTEMBLOCK /system
fi
if [ -f /system/init.rc ]; then
mkdir /system_root 2>/dev/null
mount --move /system /system_root
mount -o bind /system_root/system /system
fi
[ ! -f /system/build.prop ] && error "failed to mount /system"
}
error () {
ui_print "${@}"
magisk_cleanup
@ -389,18 +417,11 @@ main () {
ui_print "*******************************"
ui_print " "
mount_partitions
[ -f /data/adb/.nanodroid-patcher ] && \
rm -f /data/adb/.nanodroid-patcher
if ! (is_mounted /data); then
mount -orw /data || error " !! failed to mount /data"
else mount -orw,remount /data || error " !! failed to remount /data read-write"
fi
if ! (is_mounted /system); then
mount -oro /system || error " !! failed to mount /system"
fi
get_config .nanodroid-setup
[ "$config_exists" -eq 1 ] && source ${config}

Loading…
Cancel
Save