summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xanaconda21
-rwxr-xr-xisys/isys.py7
-rw-r--r--iw/welcome_gui.py21
-rw-r--r--textw/welcome_text.py16
4 files changed, 61 insertions, 4 deletions
diff --git a/anaconda b/anaconda
index 2731c43b9..ade122dc6 100755
--- a/anaconda
+++ b/anaconda
@@ -564,6 +564,27 @@ class Anaconda:
else:
self.methodstr = methodstr
+ def requiresNetworkInstall(self):
+ fail = False
+ numNetDevs = isys.getNetworkDeviceCount()
+
+ if self.methodstr is not None:
+ if (methodstr.startswith("http://") or \
+ methodstr.startswith("ftp://") or \
+ methodstr.startswith("nfs:")) and \
+ numNetDevs == 0:
+ fail = True
+ elif self.stage2 is not None:
+ if stage2.startswith("cdrom://") and \
+ not os.path.isdir("/mnt/source/Packages") and \
+ numNetDevs == 0:
+ fail = True
+
+ if fail:
+ log.error("network install required, but no network devices available")
+
+ return fail
+
if __name__ == "__main__":
anaconda = Anaconda()
diff --git a/isys/isys.py b/isys/isys.py
index 05e0806c9..c7cf25b77 100755
--- a/isys/isys.py
+++ b/isys/isys.py
@@ -873,6 +873,13 @@ def isIsoImage(file):
def fbinfo():
return _isys.fbinfo()
+# Return number of network devices
+def getNetworkDeviceCount():
+ bus = dbus.SystemBus()
+ nm = bus.get_object(NM_SERVICE, NM_MANAGER_PATH)
+ devlist = nm.get_dbus_method("GetDevices")()
+ return len(devlist)
+
# Get a D-Bus interface for the specified device's (e.g., eth0) properties.
# If dev=None, return a hash of the form 'hash[dev] = props_iface' that
# contains all device properties for all interfaces that NetworkManager knows
diff --git a/iw/welcome_gui.py b/iw/welcome_gui.py
index a12a2e104..8dc1a7ef6 100644
--- a/iw/welcome_gui.py
+++ b/iw/welcome_gui.py
@@ -25,16 +25,18 @@ from constants import *
import gettext
_ = lambda x: gettext.ldgettext("anaconda", x)
-class WelcomeWindow (InstallWindow):
+class WelcomeWindow (InstallWindow):
windowTitle = "" #N_("Welcome")
def __init__ (self, ics):
- InstallWindow.__init__ (self, ics)
+ InstallWindow.__init__ (self, ics)
ics.setGrabNext (1)
+ self.anaconda = None
# WelcomeWindow tag="wel"
def getScreen (self, anaconda):
+ self.anaconda = anaconda
# this is a bit ugly... but scale the image if we're not at 800x600
(w, h) = self.ics.cw.window.get_size_request()
if w >= 800:
@@ -48,3 +50,18 @@ class WelcomeWindow (InstallWindow):
box.add (pix)
return box
+ def getNext (self):
+ if self.anaconda.requiresNetworkInstall():
+ self.anaconda.intf.messageWindow(_("Network Install Required"),
+ _("Your installation source is set to "
+ "a network location, but no netork "
+ "devices were found on your "
+ "system. To avoid a network "
+ "installation, boot with the full "
+ "DVD, full CD set, or do not pass "
+ "a repo= parameter that specifies "
+ "a network source."),
+ type="custom",
+ custom_icon="error",
+ custom_buttons=[_("E_xit Installer")])
+ sys.exit(0)
diff --git a/textw/welcome_text.py b/textw/welcome_text.py
index c5fce5c70..c0f771d74 100644
--- a/textw/welcome_text.py
+++ b/textw/welcome_text.py
@@ -25,10 +25,22 @@ _ = lambda x: gettext.ldgettext("anaconda", x)
class WelcomeWindow:
def __call__(self, screen, anaconda):
- rc = ButtonChoiceWindow(screen, _("%s") % (productName,),
+ rc = ButtonChoiceWindow(screen, _("%s") % (productName,),
_("Welcome to %s!\n\n")
% (productName, ),
buttons = [TEXT_OK_BUTTON], width = 50,
- help = "welcome")
+ help = "welcome")
+
+ if anaconda.requiresNetworkInstall():
+ anaconda.intf.messageWindow(_("Network Install Required"),
+ _("Your installation source is set to "
+ "a network location, but no netork "
+ "devices were found on your "
+ "system. To avoid a network "
+ "installation, boot with the full "
+ "DVD, full CD set, or do not pass "
+ "a repo= parameter that specifies "
+ "a network source."))
+ sys.exit(0)
return INSTALL_OK