diff options
author | Joshua Kinard <kumba@gentoo.org> | 2006-01-07 19:14:28 +0000 |
---|---|---|
committer | Joshua Kinard <kumba@gentoo.org> | 2006-01-07 19:14:28 +0000 |
commit | 21dd79196da0b59c66ddb01a546177feab8aae46 (patch) | |
tree | fc7390af0294a05098377da74a6014088325cc82 /netboot/misc | |
parent | udev compile change from runtask to utils (diff) | |
download | genkernel-21dd79196da0b59c66ddb01a546177feab8aae46.tar.gz genkernel-21dd79196da0b59c66ddb01a546177feab8aae46.tar.bz2 genkernel-21dd79196da0b59c66ddb01a546177feab8aae46.zip |
Import the Genkernel-side of things for the catalyst2 netboot2 module
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@349 67a159dc-881f-0410-a524-ba9dfbe2cb84
Diffstat (limited to 'netboot/misc')
-rw-r--r-- | netboot/misc/bin/net-setup | 96 | ||||
-rw-r--r-- | netboot/misc/etc/fstab | 15 | ||||
-rw-r--r-- | netboot/misc/etc/group | 2 | ||||
-rw-r--r-- | netboot/misc/etc/inittab | 15 | ||||
-rw-r--r-- | netboot/misc/etc/passwd | 2 | ||||
-rw-r--r-- | netboot/misc/etc/profile | 1 | ||||
-rw-r--r-- | netboot/misc/etc/resolv.conf | 3 | ||||
-rw-r--r-- | netboot/misc/etc/shadow | 2 | ||||
-rw-r--r-- | netboot/misc/etc/shells | 2 | ||||
-rw-r--r-- | netboot/misc/usr/share/terminfo/p/putty | bin | 0 -> 1605 bytes | |||
-rw-r--r-- | netboot/misc/usr/share/udhcpc/default.script | 31 |
11 files changed, 169 insertions, 0 deletions
diff --git a/netboot/misc/bin/net-setup b/netboot/misc/bin/net-setup new file mode 100644 index 0000000..8c15386 --- /dev/null +++ b/netboot/misc/bin/net-setup @@ -0,0 +1,96 @@ +#!/bin/ash + +# Copyright 2001-2006 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later + +MYIP="" +MYGW="" + + +#// Modified Functions copied from Gentoo's /sbin/functions.sh +#//-------------------------------------------------------------------------------- + +# void einfo(char* message) +# show an informative message (with a newline) +einfo() { + echo -e " * ${*}" + return 0 +} + +#//-------------------------------------------------------------------------------- + + + +#// Setup networking +#//-------------------------------------------------------------------------------- + +SetupNetwork() { + #// DHCP or Static? + if [ "${1}" = "dhcp" ]; then + #// Do DHCP + udhcpc -i eth0 -q + else + + #// Check second param + if [ -z "${2}" ]; then + echo -e "" + einfo "Please specify a gateway address." + echo -e "" + exit + fi + + #// Get networking params + BROADCAST="$(ipcalc -b ${1} | cut -d\= -f2)" + NETMASK="$(ipcalc -m ${1} | cut -d\= -f2)" + + #// Enable static networking + /sbin/ifconfig eth0 ${1} broadcast ${BROADCAST} netmask ${NETMASK} + /sbin/route add -net default gw ${2} netmask 0.0.0.0 metric 1 + fi + + #// Setup the loopback + /sbin/ifconfig lo 127.0.0.1 + /sbin/route add -net 127.0.0.0 netmask 255.0.0.0 gw 127.0.0.1 dev lo + + #// Finish + MYIP="${1}" + MYGW="${2}" +} + +#//-------------------------------------------------------------------------------- + + + +#// Main Function +#//-------------------------------------------------------------------------------- + +#// Check first param +if [ -z "${1}" ]; then + echo -e "" + einfo "Please specify \"dhcp\" for setting up networking via dhcp or" + einfo "specify an IP Address and gateway address to configure static" + einfo "networking." + echo -e "" + exit 0 +fi + + +#// Setup the Network +SetupNetwork ${1} ${2} ${3} + + +#// Was the network setup? +if [ ! -z "$(ifconfig | grep "eth0")" ]; then + echo -e "" + einfo "Network interface eth0 has been started:" + einfo " IP Address: ${MYIP}" + einfo " Gateway: ${MYGW}" + echo -e "" + einfo "An sshd server is available on port 22. Please set a root" + einfo "password via \"passwd\" before using." + echo -e "" + echo -e "" +fi + +#//-------------------------------------------------------------------------------- + diff --git a/netboot/misc/etc/fstab b/netboot/misc/etc/fstab new file mode 100644 index 0000000..4f312cd --- /dev/null +++ b/netboot/misc/etc/fstab @@ -0,0 +1,15 @@ +# Copyright 1999-2006 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later + +# /etc/fstab: static file system information. +# <fs> <mountpoint> <type> <opts> <dump/pass> + + +#// Main Filesystems +none /tmp tmpfs defaults,rw 0 0 + + +#// Miscellaneous Filesystems +proc /proc proc defaults 0 0 +sysfs /sys sysfs defaults 0 0 +tmpfs /dev/shm tmpfs defaults 0 0 diff --git a/netboot/misc/etc/group b/netboot/misc/etc/group new file mode 100644 index 0000000..63d63ab --- /dev/null +++ b/netboot/misc/etc/group @@ -0,0 +1,2 @@ +root:x:0:root +nobody:x:65534: diff --git a/netboot/misc/etc/inittab b/netboot/misc/etc/inittab new file mode 100644 index 0000000..aee5028 --- /dev/null +++ b/netboot/misc/etc/inittab @@ -0,0 +1,15 @@ +# /etc/inittab init(8) configuration for BusyBox +# +# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> + + +::sysinit:/linuxrc +::askfirst:-/bin/ash +#tty2::askfirst:-/bin/ash +#tty3::askfirst:-/bin/ash +#tty4::askfirst:-/bin/ash +::restart:/sbin/init +::ctrlaltdel:/sbin/reboot +::shutdown:/bin/umount -a -r +::shutdown:/sbin/swapoff -a + diff --git a/netboot/misc/etc/passwd b/netboot/misc/etc/passwd new file mode 100644 index 0000000..394abe8 --- /dev/null +++ b/netboot/misc/etc/passwd @@ -0,0 +1,2 @@ +root:x:0:0:root:/root:/bin/ash +nobody:x:65534:65534:nobody:/:/bin/false diff --git a/netboot/misc/etc/profile b/netboot/misc/etc/profile new file mode 100644 index 0000000..8825c66 --- /dev/null +++ b/netboot/misc/etc/profile @@ -0,0 +1 @@ +export PATH="/usr/bin:/usr/sbin:/bin:/sbin" diff --git a/netboot/misc/etc/resolv.conf b/netboot/misc/etc/resolv.conf new file mode 100644 index 0000000..a3434c0 --- /dev/null +++ b/netboot/misc/etc/resolv.conf @@ -0,0 +1,3 @@ +nameserver 204.117.214.10 +nameserver 199.2.252.10 +nameserver 204.97.212.10 diff --git a/netboot/misc/etc/shadow b/netboot/misc/etc/shadow new file mode 100644 index 0000000..f3d078e --- /dev/null +++ b/netboot/misc/etc/shadow @@ -0,0 +1,2 @@ +root:*:10770:0::::: +nobody:*:9797:0::::: diff --git a/netboot/misc/etc/shells b/netboot/misc/etc/shells new file mode 100644 index 0000000..5f7a488 --- /dev/null +++ b/netboot/misc/etc/shells @@ -0,0 +1,2 @@ +/bin/sh +/bin/ash diff --git a/netboot/misc/usr/share/terminfo/p/putty b/netboot/misc/usr/share/terminfo/p/putty Binary files differnew file mode 100644 index 0000000..dd5a81a --- /dev/null +++ b/netboot/misc/usr/share/terminfo/p/putty diff --git a/netboot/misc/usr/share/udhcpc/default.script b/netboot/misc/usr/share/udhcpc/default.script new file mode 100644 index 0000000..246e7b7 --- /dev/null +++ b/netboot/misc/usr/share/udhcpc/default.script @@ -0,0 +1,31 @@ +#!/bin/sh + +# udhcpc script edited by Tim Riker <Tim@Rikers.org> + +[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1 + +[ -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 + ;; +esac + +exit 0 |