From: Andrew Gaffney Date: Sun, 7 Dec 2008 03:34:29 +0000 (-0600) Subject: Initial support for --netboot option X-Git-Tag: v3.4.10.903~44 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d781413d5a7c8fe2d48d4687a7ea62ca2135c2ea;p=genkernel.git Initial support for --netboot option integrate functionality from netboot udhcpc.scripts into default one --- diff --git a/ChangeLog b/ChangeLog index 63bbbf4..e2d45ad 100644 --- 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 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 genkernel: Bumping version for release. diff --git a/defaults/udhcpc.scripts b/defaults/udhcpc.scripts index aea403c..53aa2cc 100644 --- a/defaults/udhcpc.scripts +++ b/defaults/udhcpc.scripts @@ -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} diff --git a/gen_cmdline.sh b/gen_cmdline.sh index cd884ae..60a1ab9 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -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= Force to arch instead of autodetect" echo " --cachedir= 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}" diff --git a/gen_determineargs.sh b/gen_determineargs.sh index 0fd2e7d..6e9c259 100644 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -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 diff --git a/netboot/linuxrc.x b/netboot/linuxrc.x index 7a84634..0fe3cd9 100644 --- a/netboot/linuxrc.x +++ b/netboot/linuxrc.x @@ -84,7 +84,7 @@ StartUp() { syslogd #// Hostname - hostname netboot-@@RELVER@@ + hostname netboot #// Setup dropbear (sshd) echo -e ""