Skip to content

Commit aabdc6b

Browse files
author
Igor Opaniuk
committed
Add network configuration scripts
Reviewed-by: Joakim Bech <[email protected]> Signed-off-by: Igor Opaniuk <[email protected]>
1 parent 6173dea commit aabdc6b

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

etc/init.d/udhcpc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@
22
#
33
# /etc/init.d/udhcpc
44
#
5+
6+
IFACE=eth0
7+
58
case "$1" in
69
start)
10+
if [ ! /sbin/ifconfig $IFACE 2>/dev/null ]; then
11+
echo "No $IFACE interface found"
12+
fi
713
if [ -e /sbin/udhcpc ]; then
8-
ip link set eth0 up
9-
/sbin/udhcpc -i eth0 -s /etc/udhcp/simple.script
14+
ip link set $IFACE up
15+
/sbin/udhcpc -i $IFACE -s /etc/udhcp/simple.script
1016
else
1117
echo "No DHCP client found"
1218
fi

filelist.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ file /etc/init.d/rc.init etc/init.d/rc.init 755 0 0
2323
file /etc/init.d/telnetd etc/init.d/telnetd 755 0 0
2424
file /etc/init.d/splash etc/init.d/splash 755 0 0
2525
file /etc/init.d/ledflash etc/init.d/ledflash 755 0 0
26+
file /etc/init.d/udhcpc etc/init.d/udhcpc 755 0 0
2627
file /etc/rpc etc/rpc 644 0 0
2728
file /etc/se.kmap etc/se.kmap 644 0 0
2829
dir /etc/rc.d 755 0 0
@@ -48,6 +49,8 @@ file /etc/gshadow etc/gshadow 644 0 0
4849
file /etc/fstab etc/fstab 644 0 0
4950
file /etc/hosts etc/hosts 644 0 0
5051
slink /etc/mtab /proc/mounts 755 0 0
52+
dir /etc/udhcp 755 0 0
53+
file /etc/udhcp/simple.script stage/etc/udhcp/simple.script 755 0 0
5154
dir /proc 755 0 0
5255
dir /sys 755 0 0
5356
dir /mnt 755 0 0

generate-cpio-rootfs.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ mkdir -p ${STAGEDIR}
156156
mkdir -p ${STAGEDIR}/lib
157157
mkdir -p ${STAGEDIR}/sbin
158158
mkdir -p ${BUILDDIR}
159+
mkdir -p ${STAGEDIR}/etc/udhcp
159160

160161
# For using the git version
161162
cd ${BUSYBOXDIR}
@@ -174,6 +175,10 @@ if [ ! -e ${BUILDDIR}/.config ]; then
174175
fi
175176
make -j${_NPROCESSORS_ONLN} O=${BUILDDIR}
176177
make O=${BUILDDIR} install
178+
179+
# copy udhcp simple script to the stage
180+
cp ${BUSYBOXDIR}/examples/udhcp/simple.script ${STAGEDIR}/etc/udhcp/
181+
177182
cd ${CURDIR}
178183

179184
# First the flat library where arch-independent stuff will

0 commit comments

Comments
 (0)