$(use_enable ipv6)
$(use_enable privsep)
$(usex elibc_glibc '--with-hook=yp.conf' '')
- $(usex kernel_linux '--rundir=${EPREFIX}/run' '')
+ --rundir=$(usex kernel_linux "${EPREFIX}/run/dhcpcd" "${EPREFIX}/var/run/dhcpcd")
$(usex privsep '--privsepuser=dhcpcd' '')
$(usex udev '' '--without-dev --without-udev')
CC="$(tc-getCC)"
src_install() {
default
keepdir /var/lib/dhcpcd
- newinitd "${FILESDIR}"/${PN}.initd ${PN}
- systemd_dounit "${FILESDIR}"/${PN}.service
+ newinitd "${FILESDIR}"/dhcpcd.initd-r1 dhcpcd
+ systemd_newunit "${FILESDIR}"/dhcpcd.service-r1 dhcpcd.service
}
pkg_postinst() {
$(use_enable ipv6)
$(use_enable privsep)
$(usex elibc_glibc '--with-hook=yp.conf' '')
- $(usex kernel_linux '--rundir=${EPREFIX}/run' '')
+ --rundir=$(usex kernel_linux "${EPREFIX}/run/dhcpcd" "${EPREFIX}/var/run/dhcpcd")
$(usex privsep '--privsepuser=dhcpcd' '')
$(usex udev '' '--without-dev --without-udev')
CC="$(tc-getCC)"
src_install() {
default
keepdir /var/lib/dhcpcd
- newinitd "${FILESDIR}"/${PN}.initd ${PN}
- systemd_dounit "${FILESDIR}"/${PN}.service
+ newinitd "${FILESDIR}"/dhcpcd.initd-r1 dhcpcd
+ systemd_newunit "${FILESDIR}"/dhcpcd.service-r1 dhcpcd.service
}
pkg_postinst() {
--- /dev/null
+#!/sbin/openrc-run
+# Copyright 2007-2008 Roy Marples <roy@marples.name>
+# All rights reserved. Released under the 2-clause BSD license.
+
+command=${RC_PREFIX}/sbin/dhcpcd
+pidfile=${RC_PREFIX}/var/run/dhcpcd/pid
+command_args=-q
+name="DHCP Client Daemon"
+
+depend()
+{
+ provide net
+ need localmount
+ use logger network
+ after bootmisc modules
+ before dns
+}
--- /dev/null
+[Unit]
+Description=Lightweight DHCP client daemon
+Wants=network.target
+Before=network.target network-online.target
+
+[Service]
+Type=forking
+ExecStart=/sbin/dhcpcd -q
+PIDFile=/run/dhcpcd/pid
+# Avoid duplicate output on stderr/syslog
+StandardOutput=null
+StandardError=null
+
+[Install]
+WantedBy=multi-user.target