aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Gaffney <agaffney@gentoo.org>2008-12-06 21:34:29 -0600
committerAndrew Gaffney <agaffney@gentoo.org>2008-12-06 21:34:29 -0600
commitd781413d5a7c8fe2d48d4687a7ea62ca2135c2ea (patch)
treecb6bdffbada020ab045d40cb89e83c818c3b6084
parentForgot to add genkernel. (diff)
downloadgenkernel-d781413d5a7c8fe2d48d4687a7ea62ca2135c2ea.tar.gz
genkernel-d781413d5a7c8fe2d48d4687a7ea62ca2135c2ea.tar.bz2
genkernel-d781413d5a7c8fe2d48d4687a7ea62ca2135c2ea.zip
Initial support for --netboot option
integrate functionality from netboot udhcpc.scripts into default one
-rw-r--r--ChangeLog5
-rw-r--r--defaults/udhcpc.scripts8
-rwxr-xr-xgen_cmdline.sh5
-rw-r--r--gen_determineargs.sh1
-rw-r--r--netboot/linuxrc.x2
5 files changed, 19 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 63bbbf4e..e2d45ad2 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 <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.
diff --git a/defaults/udhcpc.scripts b/defaults/udhcpc.scripts
index aea403c8..53aa2cc7 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 cd884aef..60a1ab94 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=<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}"
diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index 0fd2e7d1..6e9c259c 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 7a846348..0fe3cd9a 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 ""