udhcpc service

This commit is contained in:
aliriza committed 2023-01-16 14:20:46 +00:00
1 parent 094e9fb2c2
commit aaeb35ffad
3 files changed
+45

No files matched your search

+28
View File
@@ -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
+9
View File
@@ -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
+8
View File
@@ -11,10 +11,14 @@ arch=(x86_64)
source=("https://busybox.net/downloads/busybox-$version.tar.bz2" source=("https://busybox.net/downloads/busybox-$version.tar.bz2"
"files/busybox.sysconf" "files/busybox.sysconf"
"files/busybox.initramfs" "files/busybox.initramfs"
"files/udhcpc.openrc"
"files/udhcpc.script"
) )
md5sums=("585949b1dd4292b604b7d199866e9913" md5sums=("585949b1dd4292b604b7d199866e9913"
"SKIP" "SKIP"
"SKIP" "SKIP"
"SKIP"
"SKIP"
) )
group=(sys.base) group=(sys.base)
@@ -36,5 +40,9 @@ package(){
install ../busybox.sysconf ${DESTDIR}/etc/sysconf.d/busybox install ../busybox.sysconf ${DESTDIR}/etc/sysconf.d/busybox
install ../busybox.initramfs ${DESTDIR}/usr/share/initramfs-tools/hooks/zz-busybox install ../busybox.initramfs ${DESTDIR}/usr/share/initramfs-tools/hooks/zz-busybox
echo "BUSYBOXDIR=/bin" > ${DESTDIR}/usr/share/initramfs-tools/conf-hooks.d/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
} }