Skip to content

Commit

Permalink
remove hardcoded networking options
Browse files Browse the repository at this point in the history
  • Loading branch information
kfish authored and Conrad Parker committed Apr 20, 2008
1 parent 6888555 commit ba5f16d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 41 deletions.
22 changes: 2 additions & 20 deletions build-guest
Expand Up @@ -17,18 +17,6 @@ DISTRO="debian"
# Default release to install (blank for per-distro default)
RELEASE=""

# Default IP address
IP="10.1.0.100"

# Default netmask
NETMASK="255.255.0.0"

# Default gateway
GATEWAY="10.0.0.1"

# Default nameserver
NAMESERVER="10.0.0.1"

# Loop device
LOOP=$(losetup -f)

Expand Down Expand Up @@ -79,19 +67,13 @@ usage () {
echo >&2 " -s swap, --swap swap Specify swap device or filename"
echo >&2 " -S size, --swap-size size Set the swap size (MB)"
echo >&2
echo >&2 "Xen options"
echo >&2 "Virtualization options"
echo >&2 " -c, --console Create a running instance of the domain, and"
echo >&2 " attach to its console"
echo >&2 " --create Create a running instance of the domain"
echo >&2
echo >&2 "Networking options"
echo >&2 " -I, --ip address Set the IP address"
echo >&2 " -N, --netmask address Set the netmask"
echo >&2 " -G, --gateway address Set the gateway"
echo >&2 " -D, --nameserver address Set the DNS nameserver address"
echo >&2
echo >&2 "Removal options"
echo >&2 " -p, --purge Purge the filesystems and config for DomName"
echo >&2 " -p, --purge Purge the filesystems and config for hostname"
echo >&2
echo >&2 "Miscellaneous options"
echo >&2 " -h, --help Display this help and exit"
Expand Down
2 changes: 1 addition & 1 deletion distros/debian
Expand Up @@ -29,7 +29,7 @@ init_debian() {

try_run "Initializing Debian guest filesystem" \
"(cp initU.d/initU-debian $MOUNTPOINT/sbin && \
chroot $MOUNTPOINT /sbin/initU-debian -I $IP -N $NETMASK -G $GATEWAY -D $NAMESERVER $DOMNAME)"
chroot $MOUNTPOINT /sbin/initU-debian $DOMNAME)"

if test "x$DRY_RUN" = "x" ; then
cat > /etc/apt/sources.list << EOF
Expand Down
2 changes: 1 addition & 1 deletion distros/gentoo
Expand Up @@ -56,7 +56,7 @@ init_gentoo() {

try_run "Initializing Gentoo guest" \
"(cp initU.d/initU-gentoo $MOUNTPOINT/sbin && \
chroot $MOUNTPOINT /sbin/initU-gentoo -I $IP -N $NETMASK -G $GATEWAY -D $NAMESERVER $DOMNAME)"
chroot $MOUNTPOINT /sbin/initU-gentoo $DOMNAME)"

try_run "Unmounting $MOUNTPOINT" \
umount $MOUNTPOINT
Expand Down
2 changes: 1 addition & 1 deletion distros/ubuntu
Expand Up @@ -34,7 +34,7 @@ EOF

try_run "Initializing Ubuntu guest filesystem" \
"(cp initU.d/initU-debian $MOUNTPOINT/sbin && \
chroot $MOUNTPOINT /sbin/initU-debian -I $IP -N $NETMASK -G $GATEWAY -D $NAMESERVER $DOMNAME)"
chroot $MOUNTPOINT /sbin/initU-debian $DOMNAME)"

try_run "Unmounting $MOUNTPOINT" \
umount $MOUNTPOINT
Expand Down
18 changes: 0 additions & 18 deletions initU.d/initU-debian
Expand Up @@ -3,18 +3,6 @@
# Script name
THIS="initU-debian"

# Default IP address
IP="10.1.0.100"

# Default netmask
NETMASK="255.255.0.0"

# Default gateway
GATEWAY="10.0.0.1"

# Default nameserver
NAMESERVER="10.0.0.1"

############################################################
## No configurable variables past this point ##
############################################################
Expand All @@ -40,12 +28,6 @@ usage () {
echo >&2 "General options"
echo >&2 " -n, --dry-run Don't actually run any commands; just print them."
echo >&2
echo >&2 "Networking options"
echo >&2 " -I, --ip address Set the IP address"
echo >&2 " -N, --netmask address Set the netmask"
echo >&2 " -G, --gateway address Set the gateway"
echo >&2 " -D, --nameserver address Set the DNS nameserver address"
echo >&2
echo >&2 "Miscellaneous options"
echo >&2 " -h, --help Display this help and exit"
echo >&2 " -v, --verbose Print informative messages"
Expand Down

0 comments on commit ba5f16d

Please sign in to comment.