Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,15 @@ Example: `make DESTDIR=/usr/src/contrib/dhcpcd import-src`

## Hooks
Not all the hooks in dhcpcd-hooks are installed by default.
By default we install `01-test`, `20-resolv.conf`and `30-hostname`.
The other hooks, `10-wpa_supplicant`, `15-timezone` and `29-lookup-hostname`
are installed to `$(datadir)/dhcpcd/hooks` by default and need to be
copied to `$(libexecdir)/dhcpcd-hooks` for use.
By default we install `01-test`, `20-resolv.conf` and `30-hostname`.
The other hooks, `10-wpa_supplicant`, `15-timezone` and `29-lookup-hostname`,
plus any example hooks configure resolves (such as YP-related hooks when opted in),
are installed to `$(datadir)/dhcpcd/hooks` only when you pass `--with-eghook` or
`--with-eghooks` and at least one such hook is found; copy them from there to
`$(libexecdir)/dhcpcd-hooks` for use.
The configure program attempts to find hooks for systems you have installed.
To add more simply
`./configure -with-hook=ntp.conf`
`./configure --with-hook=ntp.conf`

If using resolvconf, the `20-resolv.conf` hook now requires a version with the
`-C` and `-c` options to deprecate and activate interfaces to support wireless
Expand Down
20 changes: 17 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ exec 3>config.log

# Ensure that we do not inherit these from env
HOOKSET=false
EGHOOKSET=false
EGHOOKSCRIPTS=
INET=
ARP=
ARPING=
Expand Down Expand Up @@ -95,7 +97,7 @@ for x do
PKG_CONFIG) PKG_CONFIG=$var;;
--with-hook) HOOKSCRIPTS="$HOOKSCRIPTS${HOOKSCRIPTS:+ }$var";;
--with-hooks|HOOKSCRIPTS) HOOKSCRIPTS=$var; HOOKSET=true;;
--with-eghook) EGHOOKSCRIPTS="$EGHOOKSCRIPTS${EGHOOKSCRIPTS+ }$var";;
--with-eghook) EGHOOKSCRIPTS="$EGHOOKSCRIPTS${EGHOOKSCRIPTS+ }$var"; EGHOOKSET=true;;
--with-eghooks|EGHOOKSCRIPTS) EGHOOKSCRIPTS=$var; EGHOOKSET=true;;
--with-default-hostname) _DEFAULT_HOSTNAME=$var;;
--build) BUILD=$var;;
Expand Down Expand Up @@ -1756,7 +1758,9 @@ if ! $HOOKSET; then
echo "YPDOMAIN_SUFFIX=" >>$CONFIG_MK
fi
echo "$YPBIND ($YPHOOK${YPOS:+ }$YPOS)"
EGHOOKS="$EGHOOKS${EGHOOKS:+ }$YPHOOK"
if $EGHOOKSET; then
EGHOOKS="$EGHOOKS${EGHOOKS:+ }$YPHOOK"
fi
else
echo "not found"
YPHOOK="50-ypbind"
Expand Down Expand Up @@ -1786,7 +1790,9 @@ if ! $HOOKSET; then
esac
if [ -n "$YPHOOK" ]; then
echo "Assuming ypbind is $YPOS"
EGHOOKS="$EGHOOKS${EGHOOKS:+ }$YPHOOK"
if $EGHOOKSET; then
EGHOOKS="$EGHOOKS${EGHOOKS:+ }$YPHOOK"
fi
fi
fi
fi
Expand Down Expand Up @@ -1842,6 +1848,9 @@ if cd hooks; then
fi
echo "HOOKSCRIPTS= $HOOKS" >>$CONFIG_MK
echo "EGHOOKSCRIPTS= $EGHOOKS" >>$CONFIG_MK
if $EGHOOKSET && [ -n "$EGHOOKS" ]; then
echo "INSTALL_DATADIR_HOOKS= yes" >>$CONFIG_MK
fi

echo
echo " SYSCONFDIR = $SYSCONFDIR"
Expand All @@ -1854,6 +1863,11 @@ echo " MANDIR = $MANDIR"
echo " DATADIR = $DATADIR"
echo " HOOKSCRIPTS = $HOOKS"
echo " EGHOOKSCRIPTS = $EGHOOKS"
if $EGHOOKSET && [ -n "$EGHOOKS" ]; then
echo " INSTALL_DATADIR_HOOKS = yes"
else
echo " INSTALL_DATADIR_HOOKS = no"
fi
echo " STATUSARG = $STATUSARG"
if [ "$PRIVSEP" = yes ]; then
echo " PRIVSEPUSER = $PRIVSEP_USER"
Expand Down
14 changes: 10 additions & 4 deletions hooks/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ proginstall: ${PROG} ${SCRIPTS}
rm -f ${DESTDIR}${SCRIPTSDIR}/10-mtu

eginstall: ${FILES}
${INSTALL} -d ${DESTDIR}${FILESDIR}
${INSTALL} -m ${NONBINMODE} ${FILES} ${DESTDIR}${FILESDIR}
@if [ "${INSTALL_DATADIR_HOOKS}" = yes ]; then \
${INSTALL} -d ${DESTDIR}${FILESDIR}; \
${INSTALL} -m ${NONBINMODE} ${FILES} ${DESTDIR}${FILESDIR}; \
fi

maninstall: ${MAN8}
${INSTALL} -d ${DESTDIR}${MANDIR}/man8
Expand All @@ -64,12 +66,16 @@ install: proginstall eginstall maninstall
import: ${SCRIPTS} ${FILES}
${INSTALL} -d /tmp/${DISTPREFIX}/dhcpcd-hooks
${INSTALL} -m ${NONBINMODE} ${SCRIPTS} /tmp/${DISTPREFIX}/dhcpcd-hooks
${INSTALL} -m ${NONBINMODE} ${FILES} /tmp/${DISTPREFIX}/dhcpcd-hooks
@if [ "${INSTALL_DATADIR_HOOKS}" = yes ]; then \
${INSTALL} -m ${NONBINMODE} ${FILES} /tmp/${DISTPREFIX}/dhcpcd-hooks; \
fi

_import-src: all
${INSTALL} -d ${DESTDIR}/hooks
${INSTALL} -m ${NONBINMODE} ${PROG} ${MAN8} ${DESTDIR}/hooks
${INSTALL} -m ${NONBINMODE} ${SCRIPTS} ${DESTDIR}/hooks
${INSTALL} -m ${NONBINMODE} ${FILES} ${DESTDIR}/hooks
@if [ "${INSTALL_DATADIR_HOOKS}" = yes ]; then \
${INSTALL} -m ${NONBINMODE} ${FILES} ${DESTDIR}/hooks; \
fi

include ${TOP}/Makefile.inc
Loading