init script is a mess due to selinux
authorGuillaume Castagnino <casta@xwing.info>
Sun, 23 Jul 2017 15:30:14 +0000 (17:30 +0200)
committerGuillaume Castagnino <casta@xwing.info>
Sun, 23 Jul 2017 15:30:14 +0000 (17:30 +0200)
dist-std/cm-data/99-perso.sh.addon
dist-std/cm-data/oem-iptables-init.sh [new file with mode: 0755]
dist-std/cm-data/system-setup-runonce.sh [moved from dist-std/cm-data/10perso.init with 72% similarity]
dist-std/cm.sh

index 0b10694de6b2ab503776ea91a5162493a9b0123d..6b128a1cb576ff1bc8e0a5db9cd27c6eb4b34142 100755 (executable)
@@ -17,8 +17,7 @@ export PATH="${PATH}:$S/bin:$S/xbin"
 
 list_files() {
 cat <<EOF
-etc/init.d/10perso
-etc/init.d/afwallstart
+bin/oem-iptables-init.sh
 lib/libjni_latinimegoogle.so
 usr/share/zoneinfo/tzdata
 EOF
diff --git a/dist-std/cm-data/oem-iptables-init.sh b/dist-std/cm-data/oem-iptables-init.sh
new file mode 100755 (executable)
index 0000000..250038c
--- /dev/null
@@ -0,0 +1,7 @@
+#!/system/bin/sh
+
+export PATH=/system/bin
+
+iptables -t nat -A OUTPUT -p udp --dport 53 -j DNAT --to-destination 8.8.8.8
+iptables -t nat -A OUTPUT -p tcp --dport 53 -j DNAT --to-destination 8.8.8.8
+
similarity index 72%
rename from dist-std/cm-data/10perso.init
rename to dist-std/cm-data/system-setup-runonce.sh
index d0238bb75bf1d1531631f8e1fec638506c3365e8..8f55d495d512cf689571443ece43795d2cbbf0c4 100755 (executable)
@@ -14,7 +14,3 @@ settings put global ntp_server 127.0.0.1
 echo "Fix date format"
 settings put system date_format dd-MM-yyyy
 
-echo "Add iptables rules to redirect DNS"
-iptables -t nat -A OUTPUT -p udp --dport 53 -j DNAT --to-destination 8.8.8.8
-iptables -t nat -A OUTPUT -p tcp --dport 53 -j DNAT --to-destination 8.8.8.8
-
index ce541716c606b5f9679159669555e14e2e54acb7..d9593251fc68369d4c5908e17063a36192eba089 100755 (executable)
@@ -19,11 +19,17 @@ cp cm-data/tzdata /system/usr/share/zoneinfo/tzdata
 chown root:root /system/usr/share/zoneinfo/tzdata
 chmod 644 /system/usr/share/zoneinfo/tzdata
 
-# install init script
-echo "Installing init script"
-cp cm-data/10perso.init /system/etc/init.d/10perso
-chown root:shell /system/etc/init.d/10perso
-chmod 755 /system/etc/init.d/10perso
+# install setup script
+echo "Installing setup script"
+cp cm-data/cm-data/system-setup-runonce.sh /sdcard/system-setup-runonce.sh
+chown root:root /sdcard/system-setup-runonce.sh
+chmod 750 /sdcard/system-setup-runonce.sh
+
+# install iptables script
+echo "Installing iptablesscript"
+cp cm-data/cm-data/oem-iptables-init.sh /system/bin/oem-iptables-init.sh
+chown root:root /system/bin/oem-iptables-init.sh
+chmod 750 /system/bin/oem-iptables-init.sh
 
 # install restore script
 echo "Installing restore script"