customize default density
authorGuillaume Castagnino <casta@xwing.info>
Sun, 8 Sep 2019 18:45:54 +0000 (20:45 +0200)
committerGuillaume Castagnino <casta@xwing.info>
Sun, 8 Sep 2019 18:45:54 +0000 (20:45 +0200)
dist-pioneer/cm-data/99-perso-pioneer.sh.addon [new file with mode: 0755]
dist-pioneer/cm.sh [new file with mode: 0755]

diff --git a/dist-pioneer/cm-data/99-perso-pioneer.sh.addon b/dist-pioneer/cm-data/99-perso-pioneer.sh.addon
new file mode 100755 (executable)
index 0000000..bd341b8
--- /dev/null
@@ -0,0 +1,46 @@
+#!/sbin/sh
+#
+# ADDOND_VERSION=2
+#
+# /system/addon.d/99-perso-pioneer.sh
+#
+
+# we partially use the script at install, if so, $SYSTEM is allready defined
+if [ -z $SYSTEM ]; then
+  . /tmp/backuptool.functions
+else
+  S=$SYSTEM
+fi
+if [ -z $backuptool_ab ]; then
+  SYS=$S
+  TMP="/tmp"
+else
+  SYS="/postinstall/$S"
+  TMP="/postinstall/tmp"
+fi
+
+# path is needed when running from recovery (at install)
+export PATH="${PATH}:$S/bin:$S/xbin"
+
+case "$1" in
+  backup)
+    # Stub
+  ;;
+  restore)
+    # Stub
+  ;;
+  pre-backup)
+    # Stub
+  ;;
+  post-backup)
+    # Stub
+  ;;
+  pre-restore)
+    # Stub
+  ;;
+  post-restore)
+    # ensure there is a new line before appending our config
+    echo "" >> $SYS/build.prop
+    echo "ro.sf.lcd_density=361" >> $SYS/build.prop
+  ;;
+esac
diff --git a/dist-pioneer/cm.sh b/dist-pioneer/cm.sh
new file mode 100755 (executable)
index 0000000..8440b2d
--- /dev/null
@@ -0,0 +1,22 @@
+#!/sbin/sh
+
+set -e
+
+# $SYSTEM set by the caller
+
+cd "$(dirname $0)"
+
+export PATH="${PATH}:${SYSTEM}/bin:${SYSTEM}/xbin"
+
+# install restore script
+echo "Installing restore script"
+cp cm-data/99-perso-pioneer.sh.addon ${SYSTEM}/addon.d/99-perso-pioneer.sh
+chown root:root ${SYSTEM}/addon.d/99-perso-pioneer.sh
+chmod 755 ${SYSTEM}/addon.d/99-perso-pioneer.sh
+
+# call restore script post to run
+export SYSTEM
+${SYSTEM}/addon.d/99-perso-pioneer.sh post-restore
+
+echo "Done"
+