Skip to content

Commit

Permalink
ppp: fix config for scarthgap
Browse files Browse the repository at this point in the history
- use /var/run/ppp/resolv.conf since /etc is not writable.
- use /var/run/lock for lock files, since the directory is not created.
  • Loading branch information
jhofstee committed Feb 21, 2025
1 parent b28f457 commit 8646c4f
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From 193b708083796b7fed96ff624565900b991daaa8 Mon Sep 17 00:00:00 2001
From: Jeroen Hofstee <jhofstee@victronenergy.com>
Date: Fri, 21 Feb 2025 11:52:37 +0100
Subject: [PATCH 1/2] move resolv.conf to /var/run/pppd

/etc/ppp can't be written to in case of a readonly rootfs.

Upstream-Status: Inappropriate [Venus specific]
---
pppd/pathnames.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pppd/pathnames.h b/pppd/pathnames.h
index de2fb68..5f9e248 100644
--- a/pppd/pathnames.h
+++ b/pppd/pathnames.h
@@ -105,7 +105,7 @@
#define PPP_PATH_AUTHDOWN PPP_PATH_CONFDIR "/auth-down"
#define PPP_PATH_TTYOPT PPP_PATH_CONFDIR "/options."
#define PPP_PATH_PEERFILES PPP_PATH_CONFDIR "/peers/"
-#define PPP_PATH_RESOLV PPP_PATH_CONFDIR "/resolv.conf"
+#define PPP_PATH_RESOLV _PATH_VARRUN "/ppp/resolv.conf"

#define PPP_PATH_CONNERRS PPP_PATH_VARLOG "/connect-errors"

--
2.43.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From cefd8bd3b2dd439c680710af6c75b53554636686 Mon Sep 17 00:00:00 2001
From: Jeroen Hofstee <jhofstee@victronenergy.com>
Date: Fri, 21 Feb 2025 11:55:31 +0100
Subject: [PATCH 2/2] make use of the common lock dir

Since pppd doesn't create the dir hierarchy, writing the lock files fails.

Upstream-Status: Inappropriate [Venus specific]
---
pppd/pathnames.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pppd/pathnames.h b/pppd/pathnames.h
index 5f9e248..d39f633 100644
--- a/pppd/pathnames.h
+++ b/pppd/pathnames.h
@@ -120,7 +120,7 @@
#define PPP_PATH_PPPDB PPP_PATH_VARRUN "/pppd2.tdb"

#ifdef __linux__
-#define PPP_PATH_LOCKDIR PPP_PATH_VARRUN "/lock"
+#define PPP_PATH_LOCKDIR _PATH_VARRUN "/lock"
#else
#ifdef SVR4
#define PPP_PATH_LOCKDIR LOCALSTATEDIR "/spool/locks"
--
2.43.0

2 changes: 2 additions & 0 deletions meta-venus/recipes-connectivity/ppp/ppp_%.bbappend
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ inherit daemontools

SRC_URI += "\
file://0002-pppd-clear-resolv.conf-on-link-down.patch \
file://0001-move-resolv.conf-to-var-run-pppd.patch \
file://0002-make-use-of-the-common-lock-dir.patch \
"

DAEMONTOOLS_RUN = "${sbindir}/pppd call provider nodetach"
Expand Down

0 comments on commit 8646c4f

Please sign in to comment.