fix system root
authorGuillaume Castagnino <casta@xwing.info>
Wed, 17 Apr 2019 15:31:03 +0000 (17:31 +0200)
committerGuillaume Castagnino <casta@xwing.info>
Wed, 17 Apr 2019 15:31:03 +0000 (17:31 +0200)
dist-google-more/cm-data/99-perso-google-clean-more.sh.addon
dist-google/cm-data/99-perso-google-clean.sh.addon
dist-std/cm-data/99-perso.sh.addon
dist-std/cm-data/oem-iptables-init.sh

index 0f4d1fda7541d7b3b64efcb5eeba9d54eb1d391b..a18b3b9d905efd36b760d4554559140fb5a73303 100755 (executable)
@@ -10,6 +10,21 @@ then
   . /tmp/backuptool.functions
 else
   S=/system
+  # _____________________________________________________________________________________________________________________
+  #                      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
+  if [ -n "$(cat /proc/cmdline | grep slot_suffix)" ];
+  then
+    device_abpartition=true
+    S=/system/system
+  elif [ -n "$(cat /proc/mounts | grep /system_root)" ];
+  then
+    device_abpartition=true
+    S=/system_root/system
+  else
+    device_abpartition=false
+    S=/system
+  fi
 fi
 
 # path is needed when running from recovery (at install)
index e8da135e31423e354ab8df17b4e4b631a33e0de0..86dec3821f24e3ae68e89ae7b09b4cabfd9f7664 100755 (executable)
@@ -10,6 +10,21 @@ then
   . /tmp/backuptool.functions
 else
   S=/system
+  # _____________________________________________________________________________________________________________________
+  #                      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
+  if [ -n "$(cat /proc/cmdline | grep slot_suffix)" ];
+  then
+    device_abpartition=true
+    S=/system/system
+  elif [ -n "$(cat /proc/mounts | grep /system_root)" ];
+  then
+    device_abpartition=true
+    S=/system_root/system
+  else
+    device_abpartition=false
+    S=/system
+  fi
 fi
 
 # path is needed when running from recovery (at install)
index 881e592a316bba9e4f4de8a19cd7abaa3a9652b8..89cc0134ef8a5f14cdad1e231f4b6d6cc5cefc9a 100755 (executable)
@@ -10,6 +10,21 @@ then
   . /tmp/backuptool.functions
 else
   S=/system
+  # _____________________________________________________________________________________________________________________
+  #                      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
+  if [ -n "$(cat /proc/cmdline | grep slot_suffix)" ];
+  then
+    device_abpartition=true
+    S=/system/system
+  elif [ -n "$(cat /proc/mounts | grep /system_root)" ];
+  then
+    device_abpartition=true
+    S=/system_root/system
+  else
+    device_abpartition=false
+    S=/system
+  fi
 fi
 
 # path is needed when running from recovery (at install)
index ed2ee0b3ad4e2b7a5f6cc21c35c49bceb90476a8..6ddf7c1f79cd9b178a649fa38deadabc09ca77c9 100755 (executable)
@@ -2,6 +2,6 @@
 
 export PATH=/system/bin
 
-iptables -t nat -A OUTPUT ! -o tun0 -p udp --dport 53 -j DNAT --to-destination 8.8.8.8
-iptables -t nat -A OUTPUT ! -o tun0 -p tcp --dport 53 -j DNAT --to-destination 8.8.8.8
+iptables -t nat -A OUTPUT ! -o tun0 -p udp --dport 53 -j DNAT --to-destination 9.9.9.9
+iptables -t nat -A OUTPUT ! -o tun0 -p tcp --dport 53 -j DNAT --to-destination 9.9.9.9