udhcpc service
This commit is contained in:
1 parent
094e9fb2c2
commit
aaeb35ffad
3 files changed
+45
No files matched your search
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
NAME="udhcpc"
|
||||
|
||||
depend()
|
||||
{
|
||||
need localmount
|
||||
keyword -vserver -lxc
|
||||
}
|
||||
|
||||
start()
|
||||
{
|
||||
ebegin "Starting busybox networking"
|
||||
for DEVICE in /sys/class/net/* ; do
|
||||
ip link set ${DEVICE##*/} up
|
||||
[ ${DEVICE##*/} != lo ] && udhcpc -b -i ${DEVICE##*/}
|
||||
done
|
||||
}
|
||||
|
||||
stop()
|
||||
{
|
||||
return 0
|
||||
}
|
||||
|
||||
# vim:ts=4
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This script gets called by udhcpc to setup the network interfaces
|
||||
|
||||
ip addr add $ip/$mask dev $interface
|
||||
|
||||
if [ "$router" ]; then
|
||||
ip route add default via $router dev $interface
|
||||
fi
|
||||
@@ -11,10 +11,14 @@ arch=(x86_64)
|
||||
source=("https://busybox.net/downloads/busybox-$version.tar.bz2"
|
||||
"files/busybox.sysconf"
|
||||
"files/busybox.initramfs"
|
||||
"files/udhcpc.openrc"
|
||||
"files/udhcpc.script"
|
||||
)
|
||||
md5sums=("585949b1dd4292b604b7d199866e9913"
|
||||
"SKIP"
|
||||
"SKIP"
|
||||
"SKIP"
|
||||
"SKIP"
|
||||
)
|
||||
group=(sys.base)
|
||||
|
||||
@@ -36,5 +40,9 @@ package(){
|
||||
install ../busybox.sysconf ${DESTDIR}/etc/sysconf.d/busybox
|
||||
install ../busybox.initramfs ${DESTDIR}/usr/share/initramfs-tools/hooks/zz-busybox
|
||||
echo "BUSYBOXDIR=/bin" > ${DESTDIR}/usr/share/initramfs-tools/conf-hooks.d/busybox
|
||||
# install udhcpc script and service
|
||||
mkdir -p ${DESTDIR}/usr/share/udhcpc/ ${DESTDIR}/etc/init.d/
|
||||
install ../udhcpc.script ${DESTDIR}/usr/share/udhcpc/default.script
|
||||
install ../udhcpc.openrc ${DESTDIR}/etc/init.d/udhcpc
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user