pppd: Add an option to not to overwrite /etc/resolv.conf
authorMaksim Salau <msalau@iotecha.com>
Tue, 17 Oct 2017 09:54:14 +0000 (12:54 +0300)
committerArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Sat, 21 Oct 2017 14:59:49 +0000 (16:59 +0200)
By default pppd built by buildroot writes the list of nameservers to
/etc/resolv.conf instead of /etc/ppp/resolv.conf
This is not the default behavior of pppd and breaks name resolution
if several network interfaces are used. The change makes this optional
and enabled by default, to be backward compatible and to add a possibility
to turn this behavior off, if required.

Signed-off-by: Maksim Salau <msalau@iotecha.com>
[Arnout: extend the help text to explain that it won't work on readonly
 rootfs]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
package/pppd/Config.in
package/pppd/pppd.mk

index 8c56421c0d6df5af9af94f17ad8302cbd6f47a8e..ee89a577f22f4cf567c0b5fe242ddfc9ce543e8f 100644 (file)
@@ -23,6 +23,18 @@ config BR2_PACKAGE_PPPD_RADIUS
        help
          Install RADIUS support for pppd
 
+config BR2_PACKAGE_PPPD_OVERWRITE_RESOLV_CONF
+       bool "overwrite /etc/resolv.conf"
+       default y
+       help
+         Overwrite /etc/resolv.conf instead of maintaining the
+         separate list of nameservers in /etc/ppp/resolv.conf
+
+         Note that the pppd default of writing to /etc/ppp/resolv.conf
+         does not work on a read-only rootfs unless you make it
+         writable in your rootfs customizations (e.g. by linking it to
+         a file in tmpfs or by mounting a writable filesystem on it).
+
 endif
 
 comment "pppd needs a uClibc or glibc toolchain w/ dynamic library"
index 6139c5b085e8672b6e8a9c2a37b572221842137f..6b86a4d3dc90b91b93822257fcfe3066c665c5b4 100644 (file)
@@ -41,7 +41,9 @@ PPPD_POST_EXTRACT_HOOKS += PPPD_DROP_INTERNAL_IF_PPOL2TP_H
 define PPPD_SET_RESOLV_CONF
        $(SED) 's,ppp/resolv.conf,resolv.conf,' $(@D)/pppd/pathnames.h
 endef
+ifeq ($(BR2_PACKAGE_PPPD_OVERWRITE_RESOLV_CONF),y)
 PPPD_POST_EXTRACT_HOOKS += PPPD_SET_RESOLV_CONF
+endif
 
 define PPPD_CONFIGURE_CMDS
        $(SED) 's/FILTER=y/#FILTER=y/' $(PPPD_DIR)/pppd/Makefile.linux