Skip to content

Commit

Permalink
installer/addon: Check A/B partitioning with ro.build.ab_update instead
Browse files Browse the repository at this point in the history
* As osm0sis suggested (opengapps#879 (comment))
  some weird A only devices, seem to report slot as _a.

* So check with ro.build.ab_update instead

* $system_as_root is unused elsewhere, so drop that as well

Reference:
 - https://android.googlesource.com/platform/build/+/refs/tags/android-7.1.1_r61/tools/buildinfo.sh#26
 - https://android.googlesource.com/platform/build/+/refs/tags/android-10.0.0_r41/tools/buildinfo.sh#28
  • Loading branch information
merothh committed Sep 5, 2020
1 parent 061bd6d commit 5631855
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
4 changes: 2 additions & 2 deletions scripts/bkup_tail.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ EOF
}

mount_generic() {
local active_slot=$(getprop ro.boot.slot_suffix)
local device_abpartition=$(getprop ro.build.ab_update)
local partitions="$*"
if [ -z "$active_slot" ]; then
if [ -z "$device_abpartition" ]; then
# We're on an A only device
local partition
for partition in $partitions; do
Expand Down
11 changes: 2 additions & 9 deletions scripts/templates/installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1063,15 +1063,8 @@ ui_print " "

# _____________________________________________________________________________________________________________________
# Detect A/B partition layout https://source.android.com/devices/tech/ota/ab_updates
# and system-as-root https://source.android.com/devices/bootloader/system-as-root
device_abpartition=false
system_as_root=`getprop ro.build.system_root_image`
if [ "$system_as_root" = "true" ]; then
active_slot=`getprop ro.boot.slot_suffix`
if [ ! -z "$active_slot" ]; then
device_abpartition=true
fi
fi
device_abpartition=$(getprop ro.build.ab_update)
[ "$device_abpartition" = "true" ] || device_abpartition=false

# _____________________________________________________________________________________________________________________
# Declare Variables
Expand Down

0 comments on commit 5631855

Please sign in to comment.