base-busybox: new systemd service for udhcpc, revbump.

This commit is contained in:
Juan RP 2012-01-30 10:26:21 +01:00
parent 93a469629b
commit 61ff17d8b4
3 changed files with 53 additions and 1 deletions

View File

@ -0,0 +1,39 @@
#!/bin/sh
# udhcpc script edited by Tim Riker <Tim@Rikers.org>
[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
RESOLV_CONF="/etc/resolv.conf"
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
[ -n "$subnet" ] && NETMASK="netmask $subnet"
case "$1" in
deconfig)
/sbin/ifconfig $interface 0.0.0.0
;;
renew|bound)
/sbin/ifconfig $interface $ip $BROADCAST $NETMASK
if [ -n "$router" ] ; then
echo "deleting routers"
while route del default gw 0.0.0.0 dev $interface ; do
:
done
for i in $router ; do
route add default gw $i dev $interface
done
fi
echo -n > $RESOLV_CONF
[ -n "$domain" ] && echo search $domain >> $RESOLV_CONF
for i in $dns ; do
echo adding dns $i
echo nameserver $i >> $RESOLV_CONF
done
;;
esac
exit 0

View File

@ -0,0 +1,10 @@
[Unit]
Description=Micro DHCP client on %I
Wants=network.target
Before=network.target
[Service]
ExecStart=/sbin/udhcpc -p /var/run/udhcpc-%I.pid -F -n %I
[Install]
Alias=multi-user.target.wants/dhcpcd@eth0.service

View File

@ -4,7 +4,7 @@ version=1.19.3
wrksrc="busybox-${version}"
homepage="http://www.busybox.net"
distfiles="${homepage}/downloads/busybox-$version.tar.bz2"
revision=2
revision=3
short_desc="The Swiss Army Knife of Embedded Linux - for base system"
maintainer="Juan RP <xtraeme@gmail.com>"
license="GPL-2"
@ -31,4 +31,7 @@ do_build() {
do_install() {
make CONFIG_PREFIX=${DESTDIR} install
vinstall ${FILESDIR}/udhcpc@.service 644 lib/systemd/system
vinstall ${FILESDIR}/udhcpc-default.script 755 \
usr/share/udhcpc default.script
}