Add udhcp, cleanup a few other loose ends.
authorEric Andersen <andersen@codepoet.org>
Fri, 15 Nov 2002 02:55:17 +0000 (02:55 -0000)
committerEric Andersen <andersen@codepoet.org>
Fri, 15 Nov 2002 02:55:17 +0000 (02:55 -0000)
 -Erik

make/bash.mk
make/gcc_target.mk
make/openssh.mk
make/udhcp.mk
sources/target_skeleton/etc/TZ [new file with mode: 0644]
sources/target_skeleton/etc/inittab
sources/target_skeleton/usr/share/udhcpc/default.script [new file with mode: 0755]

index a5a9cff5fb38554dceab1581c5b4be4cde5d71bf..de9d61b5fbe64065c5122b486344693895916baa 100644 (file)
@@ -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)
index 532d77c310432c13c8fd4e16cceef8e7f2f00436..ab940fe9d16ec6893afbc5945551176811036047 100644 (file)
@@ -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/* 
 
index 3e4e5a5254d80861d250157defdc07e0c55f6a54..ff985dcfc38bcb4612153cd29008184edb4bd8fe 100644 (file)
@@ -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
 
index cd5ab2fd9ec48b3dffb88f7eb9606746fb148b67..1a98b1e17c0249bab1fa0961fb5aee69b3972d0a 100644 (file)
 # 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 (file)
index 0000000..9fcb2a3
--- /dev/null
@@ -0,0 +1 @@
+MST7MDT
index 8575ced997ffa06115ff7a13797ec6b4dfb35564..f31089f137dd45a1608a3f65c161e9ef3af65da4 100644 (file)
 ::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 (executable)
index 0000000..a52a7f8
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# udhcpc script edited by Tim Riker <Tim@Rikers.org>
+
+[ -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