diff options
author | David Cantrell <dcantrell@redhat.com> | 2008-08-25 10:19:19 -1000 |
---|---|---|
committer | David Cantrell <dcantrell@redhat.com> | 2008-08-25 10:19:19 -1000 |
commit | 57e7079052bec83c6aa0bb327b220d1de908d118 (patch) | |
tree | 4a4e0a548e489543cdb6152768e8800d43668ddf /command-stubs | |
parent | 2be503dd8da94df9979528594bc2a91db5e0cc96 (diff) | |
download | anaconda-57e7079052bec83c6aa0bb327b220d1de908d118.tar.gz anaconda-57e7079052bec83c6aa0bb327b220d1de908d118.tar.xz anaconda-57e7079052bec83c6aa0bb327b220d1de908d118.zip |
Use NetworkManager instead of libdhcp. (#458183)
Finally, no more libdhcp.
This is the first set of changes to take anaconda over to
the wonderful world of NetworkManager. We are no longer
linking with libdhcp to do interface configuration. NM
is started early in the installation and opens the door
to things like WPA installation support and things like
that.
Diffstat (limited to 'command-stubs')
-rw-r--r-- | command-stubs/Makefile | 2 | ||||
-rwxr-xr-x | command-stubs/dhcpclient-stub | 116 |
2 files changed, 1 insertions, 117 deletions
diff --git a/command-stubs/Makefile b/command-stubs/Makefile index e9db03916..1a0b5dea5 100644 --- a/command-stubs/Makefile +++ b/command-stubs/Makefile @@ -20,7 +20,7 @@ include ../Makefile.inc STUBS = raidstart-stub raidstop-stub list-harddrives-stub \ - loadkeys-stub losetup-stub dhcpclient-stub mknod-stub syslogd-stub + loadkeys-stub losetup-stub mknod-stub syslogd-stub all: @echo "Nothing to do" diff --git a/command-stubs/dhcpclient-stub b/command-stubs/dhcpclient-stub deleted file mode 100755 index b5ffdc78d..000000000 --- a/command-stubs/dhcpclient-stub +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/python -# -# dhcpclient-stub -# -# Copyright (C) 2007 Red Hat, Inc. All rights reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# - -import os -import sys -import getopt - -# for testing -if (os.path.exists('isys')): - sys.path.append('isys') - -sys.path.append('/usr/lib/anaconda') - -import isys -from sys import argv - -import network -from network import NetworkDevice - -def showusage(): - print "Usage: dhcpclient [-4] [-6] [-a] [-i device] [-c class]" - -def showhelp(): - showusage() - print "Options:" - print " -4 Configure IPv4 stack via DHCP" - print " -6 Configure IPv6 stack (DHCPv6 unless -a given)" - print " -a Use IPv6 auto neighbor discovery" - print " -i device Device to configure (e.g., eth0)" - print " -c class Optional DHCP class name" - print "Defaults:" - print " dhcpclient -4 -6 -a -i eth0" - -if __name__ == "__main__": - dev = NetworkDevice('eth0') - dev.set(('bootproto', 'dhcp')) - - auto = False - stacks = 0 - - help = False - unknown = False - - try: - opts, args = getopt.getopt(sys.argv[1:], '46ai:c:', - ['ipv4', 'ipv6', 'auto', 'interface', - 'class', 'help']) - except getopt.GetoptError: - help = True - - for o, a in opts: - if o in ('-4', '--ipv4'): - stacks += 4 - elif o in ('-6', '--ipv6'): - stacks += 6 - elif o in ('-a', '--auto'): - auto = True - elif o in ('-i', '--interface'): - dev.set(('device', a)) - elif o in ('-c', '--class'): - dev.set(('dhcpclass', a)) - elif o in ('--help'): - help = True - else: - unknown = True - - if help: - showhelp() - sys.exit(0) - - if unknown: - showusage() - sys.exit(1) - - if auto: - dev.set(('ipv6_autoconf', 'yes')) - else: - dev.set(('ipv6_autoconf', 'no')) - - if stacks == 10: - dev.set(('useipv4', True)) - dev.set(('useipv6', True)) - elif stacks == 6: - dev.set(('useipv4', False)) - dev.set(('useipv6', True)) - elif stacks == 4: - dev.set(('useipv4', True)) - dev.set(('useipv6', False)) - - try: - ns = isys.dhcpNetDevice(dev) - if ns: - f = open('/etc/resolv.conf', 'w') - f.write("nameserver %s\n" % ns) - f.close() - except: - print "Error configuring device %s." % (dev.get('device'),) - - sys.exit(0) |