openresolv: Bind to system as resolvconf(8) master
authorAaron LI <aly@aaronly.me>
Thu, 18 Oct 2018 17:23:51 +0000 (01:23 +0800)
committerAaron LI <aly@aaronly.me>
Fri, 19 Oct 2018 16:01:52 +0000 (00:01 +0800)
The resolvconf(8) will be used by dhcpcd(8), which will be imported
later to provide out-of-box IPv6 DHCP support, replacing the IPv4-only
dhclient(8) in base and the rtsold(8).

Thanks to swildner for reviewing and providing suggestions.

etc/Makefile
etc/mtree/BSD.usr.dist
etc/mtree/BSD.var.dist
sbin/Makefile
sbin/resolvconf/Makefile [new file with mode: 0644]

index a3d9c45..bf8bc5f 100644 (file)
@@ -16,7 +16,8 @@ BINUPDATE= devd.conf fbtab gettytab network.subr \
 BINUPDATE+=mail.rc locate.rc
 .else
 BINUPDATE+=${.CURDIR}/../usr.bin/mail/misc/mail.rc \
-       ${.CURDIR}/../usr.bin/locate/locate/locate.rc
+       ${.CURDIR}/../usr.bin/locate/locate/locate.rc \
+       ${.CURDIR}/../contrib/openresolv/resolvconf.conf
 .endif
 
 # Initial distribution files are installed read-write (644)
index a6b0b32..5dbe9ac 100644 (file)
             ru
             ..
         ..
+        resolvconf
+        ..
     ..
     local
     ..
index df35891..d230485 100644 (file)
@@ -54,6 +54,8 @@
     run
         ppp             gname=network mode=0770
         ..
+        resolvconf
+        ..
         wpa_supplicant
         ..
         sem             mode=01777
index f05fd14..bfad110 100644 (file)
@@ -80,6 +80,7 @@ SUBDIR=       adjkerntz \
        reboot \
        rconfig \
        rcorder \
+       resolvconf \
        restore \
        route \
        routed \
diff --git a/sbin/resolvconf/Makefile b/sbin/resolvconf/Makefile
new file mode 100644 (file)
index 0000000..8411ee5
--- /dev/null
@@ -0,0 +1,28 @@
+DISTDIR=       ${.CURDIR}/../../contrib/openresolv
+.PATH:         ${DISTDIR}
+
+SCRIPTS=       resolvconf
+
+FILES=         libc dnsmasq named pdnsd pdns_recursor unbound
+FILESDIR=      /usr/libexec/resolvconf
+
+MAN=           resolvconf.conf.5 resolvconf.8
+
+CLEANFILES=    ${SCRIPTS} ${FILES} ${MAN}
+
+.for f in ${SCRIPTS} ${FILES} ${MAN}
+${f}: ${f}.in
+       sed     -e 's:@SBINDIR@:${BINDIR}:g' \
+               -e 's:@SYSCONFDIR@:/etc:g' \
+               -e 's:@RCDIR@:/etc/rc.d:g' \
+               -e 's:@LIBEXECDIR@:${FILESDIR}:g' \
+               -e 's:@VARDIR@:/var/run/resolvconf:g' \
+               -e 's:@RESTARTCMD@::g' \
+               -e 's:@STATUSARG@::g' \
+               ${DISTDIR}/$@.in > $@
+.endfor
+
+# NOTE:
+# The configuration file 'resolvconf.conf' is installed by 'etc/Makefile'
+
+.include <bsd.prog.mk>