Move dhcpcd.duid and dhcpcd.secret from /etc into /var/db/dhcpcd.
Move leases and RDM monotonc from /var/db into /var/db/dhcpcd.
All moves files have the dhcpcd{.-} prefix dropped.
_confinstall:
${INSTALL} -d ${DESTDIR}${SYSCONFDIR}
+ # Install a new default config if not present
test -e ${DESTDIR}${SYSCONFDIR}/dhcpcd.conf || \
${INSTALL} -m ${CONFMODE} dhcpcd.conf ${DESTDIR}${SYSCONFDIR}
+ # Attempt to move files from sysconfig to dbdir
+ if [ ! -e ${DESTDIR}${DBDIR}/duid -a \
+ -e ${DESTDIR}${SYSCONFDIR}/dhcpcd.duid ]; \
+ then \
+ mv ${DESTDIR}${SYSCONFDIR}/dhcpcd.duid \
+ ${DESTDIR}${DBDIR}/duid; \
+ fi
+ if [ ! -e ${DESTDIR}${DBDIR}/secret -a \
+ -e ${DESTDIR}${SYSCONFDIR}/dhcpcd.secret ]; \
+ then \
+ mv ${DESTDIR}${SYSCONFDIR}/dhcpcd.secret \
+ ${DESTDIR}${DBDIR}/secret; \
+ fi
+ # Move leases to new location
+ for lease in ${DESTDIR}${DBDIR}/../dhcpcd-*.lease*; do \
+ [ -f "$$lease" ] || continue; \
+ newlease=$$(basename "$$lease" | ${SED} -e "s/dhcpcd-//"); \
+ mv "$$lease" ${DESTDIR}${DBDIR}/"$$newlease"; \
+ done
+ # Move RDM monotonic to new location
+ if [ ! -e ${DESTDIR}${DBDIR}/rdm_monotonic -a \
+ -e ${DESTDIR}${DBDIR}/../dhcpcd-rdm.monotonic ]; \
+ then \
+ mv ${DESTDIR}${DBDIR}/../dhcpcd-rdm.monotonic \
+ ${DESTDIR}${DBDIR}/rdm_monotonic; \
+ fi
+
hooks:
cd dhcpcd-hooks; ${MAKE}; cd ..; done
Compatibility
-------------
-dhcpcd-5.0 is only fully command line compatible with dhcpcd-4.0
-For compatibility with older versions, use dhcpcd-4.0
+dhcpcd-5 is only fully command line compatible with dhcpcd-4
+For compatibility with older versions, use dhcpcd-4
+
+
+Upgrading
+---------
+dhcpcd-7 defaults the database directory to /var/db/dhcpcd instead of /var/db
+and now stores dhcpcd.duid and dhcpcd.secret in there instead of /etc.
+of /etc.
+The Makefile _confinstall target will attempt to move the files correctly from
+the old locations to the new locations.
+Of course this won't work if dhcpcd-7 is packaged up, so packagers will need to
+install similar logic into their dhcpcd package.
ChangeLog
: ${LIBDIR:=$PREFIX/lib}
: ${LIBEXECDIR:=$PREFIX/libexec}
: ${STATEDIR:=/var}
-: ${DBDIR:=$STATEDIR/db}
+: ${DBDIR:=$STATEDIR/db/dhcpcd}
: ${RUNDIR:=$STATEDIR/run}
: ${MANDIR:=${PREFIX:-/usr}/share/man}
: ${DATADIR:=${PREFIX:-/usr}/share}
# define DEVDIR LIBDIR "/" PACKAGE "/dev"
#endif
#ifndef DUID
-# define DUID SYSCONFDIR "/" PACKAGE ".duid"
+# define DUID DBDIR "/duid"
#endif
#ifndef SECRET
-# define SECRET SYSCONFDIR "/" PACKAGE ".secret"
+# define SECRET DBDIR "/secret"
#endif
#ifndef LEASEFILE
-# define LEASEFILE DBDIR "/" PACKAGE "-%s%s.lease"
+# define LEASEFILE DBDIR "/%s%s.lease"
#endif
#ifndef LEASEFILE6
# define LEASEFILE6 LEASEFILE "6"
# define UNPRIVSOCKET RUNDIR "/" PACKAGE ".unpriv.sock"
#endif
#ifndef RDM_MONOFILE
-# define RDM_MONOFILE DBDIR "/" PACKAGE "-rdm.monotonic"
+# define RDM_MONOFILE DBDIR "/rdm_monotonic"
#endif
#ifndef NO_SIGNALS
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd August 15, 2016
+.Dd November 8, 2016
.Dt DHCPCD 8
.Os
.Sh NAME
.It Pa @SYSCONFDIR@/dhcpcd.conf
Configuration file for dhcpcd.
If you always use the same options, put them here.
-.It Pa @SYSCONFDIR@/dhcpcd.duid
-Text file that holds the DUID used to identify the host.
-.It Pa @SYSCONFDIR@/dhcpcd.secret
-Text file that holds a secret key known only to the host.
.It Pa @SCRIPT@
Bourne shell script that is run to configure or de-configure an interface.
.It Pa @LIBDIR@/dhcpcd/dev
Each script can be disabled by using the
.Fl C , Fl Fl nohook
option described above.
-.It Pa @DBDIR@/dhcpcd\- Ns Ar interface Ns Ar -ssid Ns .lease
+.It Pa @DBDIR@/duid
+Text file that holds the DUID used to identify the host.
+.It Pa @DBDIR@/secret
+Text file that holds a secret key known only to the host.
+.It Pa @DBDIR@/ Ns Ar interface Ns Ar -ssid Ns .lease
The actual DHCP message sent by the server.
We use this when reading the last
lease and use the files mtime as when it was issued.
-.It Pa @DBDIR@/dhcpcd\- Ns Ar interface Ns Ar -ssid Ns .lease6
+.It Pa @DBDIR@/ Ns Ar interface Ns Ar -ssid Ns .lease6
The actual DHCPv6 message sent by the server.
We use this when reading the last
lease and use the files mtime as when it was issued.
-.It Pa @DBDIR@/dhcpcd-rdm.monotonic
+.It Pa @DBDIR@/rdm_monotonic
Stores the monotonic counter used in the
.Ar replay
field in Authentication Options.