meta-somdevices: ppp: Add ppp@provider.service file to ppp recipe.
authorJosep Orga <jorga@somdevices.com>
Sat, 10 Apr 2021 08:57:31 +0000 (10:57 +0200)
committerJosep Orga <jorga@somdevices.com>
Sat, 10 Apr 2021 08:57:31 +0000 (10:57 +0200)
Signed-off-by: Josep Orga <jorga@somdevices.com>
recipes-connectivity/ppp/ppp/ppp@provider.service [new file with mode: 0644]
recipes-connectivity/ppp/ppp_2.4.7.bbappend

diff --git a/recipes-connectivity/ppp/ppp/ppp@provider.service b/recipes-connectivity/ppp/ppp/ppp@provider.service
new file mode 100644 (file)
index 0000000..604a2ac
--- /dev/null
@@ -0,0 +1,18 @@
+[Unit]
+Description=PPP link to %I
+#After=network.target network-online.target
+#Requires=network-online.target
+Before=multi-user.target
+Before=commuications.target
+
+
+[Service]
+ExecStartPre=/bin/bash /etc/ppp/reset_modem.sh
+#ExecStart=/usr/sbin/pppd call %I nodetach nolog
+ExecStart=/usr/sbin/pppd file /etc/ppp/options-mobile nodetach nolog connect "/usr/sbin/chat -v -t15 -f /etc/ppp/chatscripts/mobile-modem.chat"
+RestartSec=1min
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target
+Alias=ppp.service
\ No newline at end of file
index a35cb7c..157d71e 100644 (file)
@@ -32,8 +32,12 @@ SRC_URI += " \
        file://reset_modem.sh \
        file://resolv.conf \
        file://wait-dialup-hardware \
+       file://ppp@provider.service \
 "
 
+SYSTEMD_SERVICE_${PN} = "ppp@provider.service"
+SYSTEMD_AUTO_ENABLE_${PN} = "disable"
+
 do_install_append () {
        install -m 0664 ${WORKDIR}/chap-secrets ${D}${sysconfdir}/ppp/chap-secrets
        install -m 0664 ${WORKDIR}/pap-secrets ${D}${sysconfdir}/ppp/pap-secrets
@@ -70,5 +74,6 @@ do_install_append () {
        install -m 0664 ${WORKDIR}/resolv.conf ${D}${sysconfdir}/ppp/resolv.conf
        install -m 0775 ${WORKDIR}/wait-dialup-hardware ${D}${sysconfdir}/ppp/wait-dialup-hardware
        ln -s -r ${D}${sysconfdir}/ppp/options-mobile.base ${D}${sysconfdir}/ppp/options-mobile
+       install -m 0644 ${WORKDIR}/ppp@provider.service ${D}${systemd_unitdir}/system
 }