From 78431965205eb0f1fe8a0e240dcc2c20940fb1dd Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Fri, 15 Nov 2002 02:55:17 +0000 Subject: Add udhcp, cleanup a few other loose ends. -Erik --- sources/target_skeleton/etc/TZ | 1 + sources/target_skeleton/etc/inittab | 14 +++++--- .../usr/share/udhcpc/default.script | 39 ++++++++++++++++++++++ 3 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 sources/target_skeleton/etc/TZ create mode 100755 sources/target_skeleton/usr/share/udhcpc/default.script (limited to 'sources') diff --git a/sources/target_skeleton/etc/TZ b/sources/target_skeleton/etc/TZ new file mode 100644 index 000000000..9fcb2a3c5 --- /dev/null +++ b/sources/target_skeleton/etc/TZ @@ -0,0 +1 @@ +MST7MDT diff --git a/sources/target_skeleton/etc/inittab b/sources/target_skeleton/etc/inittab index 8575ced99..f31089f13 100644 --- a/sources/target_skeleton/etc/inittab +++ b/sources/target_skeleton/etc/inittab @@ -17,20 +17,24 @@ ::sysinit:/etc/init.d/rcS # Set up a couple of getty's -tty1::respawn:/sbin/getty 38400 tty1 -tty2::respawn:/sbin/getty 38400 tty2 +tty1::respawn:/sbin/getty 38400 tty2 +tty2::respawn:/sbin/getty 38400 tty3 # Put a getty on the serial port #ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100 # Logging junk -tty3::once:/bin/touch /var/log/messages -tty3::respawn:/usr/bin/tail -f /var/log/messages -::respawn:/sbin/klogd -n +null::sysinit:/bin/touch /var/log/messages +null::respawn:/sbin/syslogd -n -m 0 +null::respawn:/sbin/klogd -n +tty4::respawn:/usr/bin/tail -f /var/log/messages # Stuff to do for the 3-finger salute ::ctrlaltdel:/sbin/reboot # Stuff to do before rebooting +null::shutdown:/usr/bin/killall klogd +null::shutdown:/usr/bin/killall syslogd null::shutdown:/bin/umount -a -r null::shutdown:/sbin/swapoff -a + diff --git a/sources/target_skeleton/usr/share/udhcpc/default.script b/sources/target_skeleton/usr/share/udhcpc/default.script new file mode 100755 index 000000000..a52a7f812 --- /dev/null +++ b/sources/target_skeleton/usr/share/udhcpc/default.script @@ -0,0 +1,39 @@ +#!/bin/sh + +# udhcpc script edited by Tim Riker + +[ -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 -- cgit v1.2.3