From f95383942c1f0b22fb826466bf4790d39d148739 Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Sun, 25 Feb 2018 14:26:55 +0100 Subject: [PATCH] another try in A/B support --- .../META-INF/com/google/android/update-binary | 4 ++- .../META-INF/com/google/android/update-binary | 4 ++- Full/nanodroid-functions | 32 +++---------------- .../META-INF/com/google/android/update-binary | 4 ++- 4 files changed, 14 insertions(+), 30 deletions(-) diff --git a/F-Droid/META-INF/com/google/android/update-binary b/F-Droid/META-INF/com/google/android/update-binary index a1fbab9..04c32db 100644 --- a/F-Droid/META-INF/com/google/android/update-binary +++ b/F-Droid/META-INF/com/google/android/update-binary @@ -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 diff --git a/Full/META-INF/com/google/android/update-binary b/Full/META-INF/com/google/android/update-binary index bf6eb11..cbf970c 100644 --- a/Full/META-INF/com/google/android/update-binary +++ b/Full/META-INF/com/google/android/update-binary @@ -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 diff --git a/Full/nanodroid-functions b/Full/nanodroid-functions index e516899..c4f36ba 100644 --- a/Full/nanodroid-functions +++ b/Full/nanodroid-functions @@ -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 } diff --git a/microG/META-INF/com/google/android/update-binary b/microG/META-INF/com/google/android/update-binary index d07e655..b5dc5e6 100644 --- a/microG/META-INF/com/google/android/update-binary +++ b/microG/META-INF/com/google/android/update-binary @@ -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