Initial support for --netboot option
authorAndrew Gaffney <agaffney@gentoo.org>
Sun, 7 Dec 2008 03:34:29 +0000 (21:34 -0600)
committerAndrew Gaffney <agaffney@gentoo.org>
Sun, 7 Dec 2008 03:34:29 +0000 (21:34 -0600)
integrate functionality from netboot udhcpc.scripts into default one

ChangeLog
defaults/udhcpc.scripts
gen_cmdline.sh
gen_determineargs.sh
netboot/linuxrc.x

index 63bbbf4e0a0cbfd12b9d112a3ec8d9071111b548..e2d45ad29c68bcf604edb739ccf83087d4e2b9ef 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,11 @@
 # Copyright 1999-2008 Gentoo Foundation; 2008 Chris Gianelloni, Andrew Gaffney
 # Distributed under the GPL v2
 
+  07 Dec 2008; Andrew Gaffney <agaffney@gentoo.org> defaults/udhcpc.scripts,
+  gen_cmdline.sh, gen_determineargs.sh, netboot/linuxrc.x:
+  Initial support for --netboot option integrate functionality from netboot
+  udhcpc.scripts into default one
+
   04 Dec 2008; Chris Gianelloni <wolf31o2@wolf31o2.org> genkernel:
   Bumping version for release.
 
index aea403c8ad41cb10a320eb4bdd9469a51ef819e6..53aa2cc7cccb01cea398dea495a65c193afb3b67 100644 (file)
@@ -1,7 +1,9 @@
 #!/bin/sh
 
+[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
+
 case ${1} in
-       bound)
+       renew|bound)
                [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
                [ -n "$subnet" ] && NETMASK="netmask $subnet"
                [ -n "$rootpath" ] && echo "$rootpath" > /rootpath
@@ -10,6 +12,10 @@ case ${1} in
                busybox ifconfig $interface $ip $BROADCAST $NETMASK
                if [ -n "${router}" ]
                then
+                       while route del default gw 0.0.0.0 dev $interface; do
+                               :
+                       done
+
                        for i in ${router}
                        do
                                busybox route add default gw ${i}
index cd884aef3a3d1d4a288b3e4bc1d6eff8536c9295..60a1ab9401e0fb1e42240243570fdacbd74169b6 100755 (executable)
@@ -91,6 +91,7 @@ longusage() {
   echo "                               --> 'emerge cryptsetup-luks' with USE=-dynamic"
   echo "    --no-busybox    Do not include busybox in the initramfs."
   echo "    --unionfs       Include support for unionfs"
+  echo "    --netboot          Create a self-contained env in the initramfs"
   echo "  Internals"
   echo "       --arch-override=<arch>  Force to arch instead of autodetect"
   echo "       --cachedir=<dir>        Override the default cache location"
@@ -249,6 +250,10 @@ parse_cmdline() {
                        CMD_UNIONFS=1
                        print_info 2 "CMD_UNIONFS: ${CMD_UNIONFS}"
                        ;;
+               --netboot)
+                       CMD_NETBOOT=1
+                       print_info 2 "CMD_NETBOOT: ${CMD_NETBOOT}"
+                       ;;
                --slowusb)
                        CMD_SLOWUSB=1
                        print_info 2 "CMD_SLOWUSB: ${CMD_SLOWUSB}"
index 0fd2e7d13f3b6672c32b5ce6a2b8874976220a1e..6e9c259c65984ab4e5fff2e4e2454cdf1b882f3d 100644 (file)
@@ -104,6 +104,7 @@ determine_real_args() {
        set_config_with_override 1 DMRAID               CMD_DMRAID
        set_config_with_override 1 BUSYBOX              CMD_BUSYBOX              "yes"
        set_config_with_override 1 UNIONFS                              CMD_UNIONFS
+       set_config_with_override 1 NETBOOT                              CMD_NETBOOT
        set_config_with_override 1 DISKLABEL            CMD_DISKLABEL
        set_config_with_override 1 LUKS                 CMD_LUKS
        set_config_with_override 1 MDADM                CMD_MDADM
index 7a8463488e0fd1e92f38320835011a92a50fd6e3..0fe3cd9a7494fb803ca93c078a1af2094afaf1e2 100644 (file)
@@ -84,7 +84,7 @@ StartUp() {
                syslogd
 
                #// Hostname
-               hostname netboot-@@RELVER@@
+               hostname netboot
 
                #// Setup dropbear (sshd)
                echo -e ""