From 78431965205eb0f1fe8a0e240dcc2c20940fb1dd Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Fri, 15 Nov 2002 02:55:17 +0000 Subject: [PATCH] Add udhcp, cleanup a few other loose ends. -Erik --- make/bash.mk | 1 + make/gcc_target.mk | 3 +- make/openssh.mk | 2 +- make/udhcp.mk | 38 +++++++++--------- sources/target_skeleton/etc/TZ | 1 + sources/target_skeleton/etc/inittab | 14 ++++--- .../usr/share/udhcpc/default.script | 39 +++++++++++++++++++ 7 files changed, 72 insertions(+), 26 deletions(-) create mode 100644 sources/target_skeleton/etc/TZ create mode 100755 sources/target_skeleton/usr/share/udhcpc/default.script diff --git a/make/bash.mk b/make/bash.mk index a5a9cff5fb..de9d61b5fb 100644 --- a/make/bash.mk +++ b/make/bash.mk @@ -33,6 +33,7 @@ $(BASH_DIR)/$(BASH_BINARY): $(BASH_DIR)/.configured $(TARGET_DIR)/$(BASH_TARGET_BINARY): $(BASH_DIR)/$(BASH_BINARY) $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC1) -C $(BASH_DIR) install mv $(TARGET_DIR)/usr/bin/bash* $(TARGET_DIR)/bin/ + (cd $(TARGET_DIR)/bin; ln -fs bash sh) rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/junk bash: ncurses uclibc $(TARGET_DIR)/$(BASH_TARGET_BINARY) diff --git a/make/gcc_target.mk b/make/gcc_target.mk index 532d77c310..ab940fe9d1 100644 --- a/make/gcc_target.mk +++ b/make/gcc_target.mk @@ -137,7 +137,8 @@ $(GCC_BUILD_DIR3)/.compiled: $(GCC_BUILD_DIR3)/.configured $(TARGET_DIR)/usr/bin/gcc: $(GCC_BUILD_DIR3)/.compiled PATH=$$PATH:$(STAGING_DIR)/bin $(MAKE) DESTDIR=$(TARGET_DIR) prefix=$(TARGET_DIR)/usr \ -C $(GCC_BUILD_DIR3) install; - rm -rf $(TARGET_DIR)/usr/info $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc + rm -rf $(TARGET_DIR)/usr/info $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc \ + $(TARGET_DIR)/usr/share/locale -$(STRIP) $(TARGET_DIR)/bin/* -$(STRIP) $(TARGET_DIR)/usr/bin/* diff --git a/make/openssh.mk b/make/openssh.mk index 3e4e5a5254..ff985dcfc3 100644 --- a/make/openssh.mk +++ b/make/openssh.mk @@ -34,7 +34,7 @@ $(OPENSSH_DIR)/ssh: $(OPENSSH_DIR)/.configured $(TARGET_DIR)/usr/bin/ssh: $(OPENSSH_DIR)/ssh make CC=$(TARGET_CC1) DESTDIR=$(TARGET_DIR) -C $(OPENSSH_DIR) install - rm -rf $(TARGET_DIR)/usr/share/doc/openssh + rm -rf $(TARGET_DIR)/usr/info $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc openssh: $(TARGET_DIR)/usr/bin/ssh diff --git a/make/udhcp.mk b/make/udhcp.mk index cd5ab2fd9e..1a98b1e17c 100644 --- a/make/udhcp.mk +++ b/make/udhcp.mk @@ -20,37 +20,37 @@ # License along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA -UDHCP_DIR:=$(BUILD_DIR)/udhcp -#UDHCP_SOURCE:=udhcp-0.9.6.tar.gz -#UDHCP_SITE:=http://udhcp.busybox.net/downloads/ -#$(DL_DIR)/$(UDHCP_SOURCE): -# wget -P $(DL_DIR) $(UDHCP_SITE)/$(UDHCP_SOURCE) +UDHCP_SOURCE:=udhcp-0.9.8.tar.gz +UDHCP_SITE:=http://udhcp.busybox.net/downloads/ +UDHCP_DIR:=$(BUILD_DIR)/udhcp-0.9.8 -#udhcp-source: $(DL_DIR)/$(UDHCP_SOURCE) +$(DL_DIR)/$(UDHCP_SOURCE): + wget -P $(DL_DIR) $(UDHCP_SITE)/$(UDHCP_SOURCE) -#$(UDHCP_DIR)/Makefile: $(DL_DIR)/$(UDHCP_SOURCE) -# zcat $(DL_DIR)/$(UDHCP_SOURCE) | tar -C $(BUILD_DIR) -xvf - -# touch $(UDHCP_DIR)/Makefile +udhcp-source: $(DL_DIR)/$(UDHCP_SOURCE) -$(UDHCP_DIR)/Makefile: - (cd $(BUILD_DIR); \ - cvs -z3 -d:pserver:anonymous@busybox.net:/var/cvs co udhcp ) +$(UDHCP_DIR)/.unpacked: $(DL_DIR)/$(UDHCP_SOURCE) + zcat $(DL_DIR)/$(UDHCP_SOURCE) | tar -C $(BUILD_DIR) -xvf - + touch $(UDHCP_DIR)/.unpacked -$(UDHCP_DIR)/udhcpc: $(UDHCP_DIR)/Makefile - make CROSS_COMPILE="$(TARGET_CROSS)" prefix="$(TARGET_DIR)" -C $(UDHCP_DIR) +#$(UDHCP_DIR)/.unpacked: +# (cd $(BUILD_DIR); \ +# CVS_PASSFILE=$(CVS_PASSFILE) \ +# cvs -z3 -d:pserver:anonymous@busybox.net:/var/cvs co udhcp ) +# touch $(UDHCP_DIR)/.unpacked + +$(UDHCP_DIR)/udhcpc: $(UDHCP_DIR)/.unpacked + $(MAKE) CROSS_COMPILE="$(TARGET_CROSS)" prefix="$(TARGET_DIR)" -C $(UDHCP_DIR) $(TARGET_DIR)/sbin/udhcpc: $(UDHCP_DIR)/udhcpc - perl -i -p -e 's/pump/udhcpc/' $(TARGET_DIR)/etc/pcmcia/network* - perl -i -p -e 's/PUMP/UDHCPC/' $(TARGET_DIR)/etc/pcmcia/network* - perl -i -p -e 's/DHCP="n"/DHCP="y"/' $(TARGET_DIR)/etc/pcmcia/network* cp $(UDHCP_DIR)/udhcpc $(TARGET_DIR)/sbin/ -udhcp: uclibc pcmcia $(TARGET_DIR)/sbin/udhcpc +udhcp: uclibc $(TARGET_DIR)/sbin/udhcpc udhcp-clean: rm -f $(TARGET_DIR)/sbin/udhcpc - -make -C $(UDHCP_DIR) clean + -$(MAKE) -C $(UDHCP_DIR) clean udhcp-dirclean: rm -rf $(UDHCP_DIR) diff --git a/sources/target_skeleton/etc/TZ b/sources/target_skeleton/etc/TZ new file mode 100644 index 0000000000..9fcb2a3c56 --- /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 8575ced997..f31089f137 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 0000000000..a52a7f8122 --- /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 -- 2.30.2