addonsu: Fix package for modern devices

Recent devices (e.g. Pixel 2XL aka taimen) do not define any "system"
partition in their fstab, so a plain "mount /system" fails.

Furthermore, trying to get the entry from /etc/recovery.fstab also fails
because the partitions have slot suffixes (e.g. system_a).
So for these devices, we need to figure out the active slot, mount the
system partition (which really contains the whole root) and lastly mount
the actual system partition from the rootfs.

Change-Id: Ibb73a82896c1f6ce6af9c334b8d0908a183913b9
diff --git a/addonsu/mount-system.sh b/addonsu/mount-system.sh
index 2e209fb..5886f15 100644
--- a/addonsu/mount-system.sh
+++ b/addonsu/mount-system.sh
@@ -10,4 +10,19 @@
     exit 0
 fi
 
+# Modern devices use /system as root ("/")
+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
+    block=/dev/block/bootdevice/by-name/system$active_slot
+  else
+    block=/dev/block/bootdevice/by-name/system
+  fi
+  mkdir -p /system_root
+  if mount -o rw $block /system_root && mount /system_root/system /system; then
+    exit 0
+  fi
+fi
+
 exit 1