summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2009-12-03 09:27:29 -0500
committerChris Lumens <clumens@redhat.com>2009-12-03 15:04:35 -0500
commitfb19b46f3a8c23b58241bebf1579b3613cf7b51b (patch)
tree3561cfb31cf14d3a6f68771d588d03e21d0a969b
parenta6eb83c0b728a3ab38c8cae35a6096789cec5e8c (diff)
downloadanaconda-fb19b46f3a8c23b58241bebf1579b3613cf7b51b.tar.gz
anaconda-fb19b46f3a8c23b58241bebf1579b3613cf7b51b.tar.xz
anaconda-fb19b46f3a8c23b58241bebf1579b3613cf7b51b.zip
Nothing sets flags.setupFilesystems anymore, so it can go too.
-rwxr-xr-xanaconda3
-rw-r--r--backend.py22
-rw-r--r--bootloader.py18
-rw-r--r--flags.py1
-rw-r--r--iw/upgrade_swap_gui.py3
-rw-r--r--packages.py183
-rw-r--r--storage/__init__.py3
-rw-r--r--textw/upgrade_text.py3
-rw-r--r--upgrade.py162
-rw-r--r--yuminstall.py61
10 files changed, 210 insertions, 249 deletions
diff --git a/anaconda b/anaconda
index 5cce81bad..78e5fd198 100755
--- a/anaconda
+++ b/anaconda
@@ -71,8 +71,7 @@ def startMiniWM(root='/'):
def doStartupX11Actions(runres="800x600"):
global miniwm_pid
- if flags.setupFilesystems:
- setupGraphicalLinks()
+ setupGraphicalLinks()
# now start up mini-wm
try:
diff --git a/backend.py b/backend.py
index 08e3ce7b3..5c4232aec 100644
--- a/backend.py
+++ b/backend.py
@@ -107,8 +107,7 @@ class AnacondaBackend:
storage.writeEscrowPackets(anaconda)
sys.stdout.flush()
- if flags.setupFilesystems:
- syslog.stop()
+ syslog.stop()
def doInstall(self, anaconda):
log.warning("doInstall not implemented for backend!")
@@ -133,16 +132,12 @@ class AnacondaBackend:
self.instLog = open(instLogName, "w+")
- # dont start syslogd if we arent creating filesystems
- if flags.setupFilesystems:
- syslogname = "%s%s.syslog" % (instPath, logname)
- try:
- shutil.rmtree (syslogname)
- except OSError:
- pass
- syslog.start (instPath, syslogname)
- else:
- syslogname = None
+ syslogname = "%s%s.syslog" % (instPath, logname)
+ try:
+ shutil.rmtree (syslogname)
+ except OSError:
+ pass
+ syslog.start (instPath, syslogname)
if upgrade:
self.modeText = _("Upgrading %s\n")
@@ -150,9 +145,6 @@ class AnacondaBackend:
self.modeText = _("Installing %s\n")
def mountInstallImage(self, anaconda, installimg):
- if not flags.setupFilesystems:
- return
-
if self._loopbackFile and os.path.exists(self._loopbackFile):
return
diff --git a/bootloader.py b/bootloader.py
index 729fe2ca9..5ef6729d4 100644
--- a/bootloader.py
+++ b/bootloader.py
@@ -139,8 +139,6 @@ def writeBootloader(anaconda):
isys.sync()
isys.sync()
- justConfigFile = not flags.setupFilesystems
-
if anaconda.id.bootloader.defaultDevice == -1:
return
@@ -157,9 +155,7 @@ def writeBootloader(anaconda):
else:
anaconda.id.bootloader.doUpgradeOnly = 0
- # We don't need to let the user know if we're just doing the bootloader.
- if not justConfigFile:
- w = anaconda.intf.waitWindow(_("Bootloader"), _("Installing bootloader."))
+ w = anaconda.intf.waitWindow(_("Bootloader"), _("Installing bootloader."))
kernelList = []
otherList = []
@@ -185,8 +181,7 @@ def writeBootloader(anaconda):
if kernelLabel is None:
log.error("unable to find default image, bailing")
- if not justConfigFile:
- w.pop()
+ w.pop()
return
plainLabelUsed = 0
@@ -219,18 +214,15 @@ def writeBootloader(anaconda):
dosync()
try:
rc = anaconda.id.bootloader.write(anaconda.rootPath, anaconda.id.bootloader,
- kernelList, otherList, defaultDev,
- justConfigFile)
- if not justConfigFile:
- w.pop()
+ kernelList, otherList, defaultDev)
+ w.pop()
if rc and anaconda.intf:
anaconda.intf.messageWindow(_("Warning"),
_("There was an error installing the bootloader. "
"The system may not be bootable."))
except booty.BootyNoKernelWarning:
- if not justConfigFile:
- w.pop()
+ w.pop()
if anaconda.intf:
anaconda.intf.messageWindow(_("Warning"),
_("No kernel packages were installed on the "
diff --git a/flags.py b/flags.py
index 1aabe8e67..17bc2e098 100644
--- a/flags.py
+++ b/flags.py
@@ -72,7 +72,6 @@ class Flags:
self.__dict__['flags']['ibft'] = 1
self.__dict__['flags']['iscsi'] = 0
self.__dict__['flags']['serial'] = 0
- self.__dict__['flags']['setupFilesystems'] = 1
self.__dict__['flags']['autostep'] = 0
self.__dict__['flags']['autoscreenshot'] = 0
self.__dict__['flags']['usevnc'] = 0
diff --git a/iw/upgrade_swap_gui.py b/iw/upgrade_swap_gui.py
index 247137bcd..2dee9ba2e 100644
--- a/iw/upgrade_swap_gui.py
+++ b/iw/upgrade_swap_gui.py
@@ -65,8 +65,7 @@ class UpgradeSwapWindow (InstallWindow):
raise gui.StayOnScreen
else:
- if flags.setupFilesystems:
- self.storage.createSwapFile(dev, val)
+ self.storage.createSwapFile(dev, val)
self.dispatch.skipStep("addswap", 1)
return None
diff --git a/packages.py b/packages.py
index 61faede81..bf1b02ec5 100644
--- a/packages.py
+++ b/packages.py
@@ -87,100 +87,99 @@ def turnOnFilesystems(anaconda):
anaconda.id.storage.umountFilesystems()
return DISPATCH_NOOP
- if flags.setupFilesystems:
- if not anaconda.id.upgrade:
- if not anaconda.id.storage.fsset.active:
- # turn off any swaps that we didn't turn on
- # needed for live installs
- iutil.execWithRedirect("swapoff", ["-a"],
- stdout = "/dev/tty5", stderr="/dev/tty5",
- searchPath = 1)
- anaconda.id.storage.devicetree.teardownAll()
-
- upgrade_migrate = False
- if anaconda.id.upgrade:
- for d in anaconda.id.storage.migratableDevices:
- if d.format.migrate:
- upgrade_migrate = True
-
- title = None
- message = None
- details = None
+ if not anaconda.id.upgrade:
+ if not anaconda.id.storage.fsset.active:
+ # turn off any swaps that we didn't turn on
+ # needed for live installs
+ iutil.execWithRedirect("swapoff", ["-a"],
+ stdout = "/dev/tty5", stderr="/dev/tty5",
+ searchPath = 1)
+ anaconda.id.storage.devicetree.teardownAll()
+
+ upgrade_migrate = False
+ if anaconda.id.upgrade:
+ for d in anaconda.id.storage.migratableDevices:
+ if d.format.migrate:
+ upgrade_migrate = True
+
+ title = None
+ message = None
+ details = None
- try:
- anaconda.id.storage.doIt()
- except DeviceResizeError as (msg, device):
- # XXX does this make any sense? do we support resize of
- # devices other than partitions?
- title = _("Device Resize Failed")
- message = _("An error was encountered while "
- "resizing device %s.") % (device,)
- details = msg
- except DeviceCreateError as (msg, device):
- title = _("Device Creation Failed")
- message = _("An error was encountered while "
- "creating device %s.") % (device,)
- details = msg
- except DeviceDestroyError as (msg, device):
- title = _("Device Removal Failed")
- message = _("An error was encountered while "
- "removing device %s.") % (device,)
- details = msg
- except DeviceError as (msg, device):
- title = _("Device Setup Failed")
- message = _("An error was encountered while "
- "setting up device %s.") % (device,)
- details = msg
- except FSResizeError as (msg, device):
- title = _("Resizing Failed")
- message = _("There was an error encountered while "
- "resizing the device %s.") % (device,)
-
- if os.path.exists("/tmp/resize.out"):
- details = open("/tmp/resize.out", "r").read()
- else:
- details = "%s" %(msg,)
- except FSMigrateError as (msg, device):
- title = _("Migration Failed")
- message = _("An error was encountered while "
- "migrating filesystem on device %s.") % (device,)
- details = msg
- except FormatCreateError as (msg, device):
- title = _("Formatting Failed")
- message = _("An error was encountered while "
- "formatting device %s.") % (device,)
- details = msg
- except Exception as e:
- # catch-all
- title = _("Storage Activation Failed")
- message = _("An error was encountered while "
- "activating your storage configuration.")
- details = str(e)
-
- if title:
- rc = anaconda.intf.detailedMessageWindow(title, message, details,
- type = "custom",
- custom_buttons = [_("_File Bug"), _("_Exit installer")])
-
- if rc == 0:
- raise
- elif rc == 1:
- sys.exit(1)
-
- if not anaconda.id.upgrade:
- anaconda.id.storage.turnOnSwap()
- anaconda.id.storage.mountFilesystems(raiseErrors=False,
- readOnly=False,
- skipRoot=anaconda.backend.skipFormatRoot)
+ try:
+ anaconda.id.storage.doIt()
+ except DeviceResizeError as (msg, device):
+ # XXX does this make any sense? do we support resize of
+ # devices other than partitions?
+ title = _("Device Resize Failed")
+ message = _("An error was encountered while "
+ "resizing device %s.") % (device,)
+ details = msg
+ except DeviceCreateError as (msg, device):
+ title = _("Device Creation Failed")
+ message = _("An error was encountered while "
+ "creating device %s.") % (device,)
+ details = msg
+ except DeviceDestroyError as (msg, device):
+ title = _("Device Removal Failed")
+ message = _("An error was encountered while "
+ "removing device %s.") % (device,)
+ details = msg
+ except DeviceError as (msg, device):
+ title = _("Device Setup Failed")
+ message = _("An error was encountered while "
+ "setting up device %s.") % (device,)
+ details = msg
+ except FSResizeError as (msg, device):
+ title = _("Resizing Failed")
+ message = _("There was an error encountered while "
+ "resizing the device %s.") % (device,)
+
+ if os.path.exists("/tmp/resize.out"):
+ details = open("/tmp/resize.out", "r").read()
else:
- if upgrade_migrate:
- # we should write out a new fstab with the migrated fstype
- shutil.copyfile("%s/etc/fstab" % anaconda.rootPath,
- "%s/etc/fstab.anaconda" % anaconda.rootPath)
- anaconda.id.storage.fsset.write(anaconda.rootPath)
-
- # and make sure /dev is mounted so we can read the bootloader
- bindMountDevDirectory(anaconda.rootPath)
+ details = "%s" %(msg,)
+ except FSMigrateError as (msg, device):
+ title = _("Migration Failed")
+ message = _("An error was encountered while "
+ "migrating filesystem on device %s.") % (device,)
+ details = msg
+ except FormatCreateError as (msg, device):
+ title = _("Formatting Failed")
+ message = _("An error was encountered while "
+ "formatting device %s.") % (device,)
+ details = msg
+ except Exception as e:
+ # catch-all
+ title = _("Storage Activation Failed")
+ message = _("An error was encountered while "
+ "activating your storage configuration.")
+ details = str(e)
+
+ if title:
+ rc = anaconda.intf.detailedMessageWindow(title, message, details,
+ type = "custom",
+ custom_buttons = [_("_File Bug"), _("_Exit installer")])
+
+ if rc == 0:
+ raise
+ elif rc == 1:
+ sys.exit(1)
+
+ if not anaconda.id.upgrade:
+ anaconda.id.storage.turnOnSwap()
+ anaconda.id.storage.mountFilesystems(raiseErrors=False,
+ readOnly=False,
+ skipRoot=anaconda.backend.skipFormatRoot)
+ else:
+ if upgrade_migrate:
+ # we should write out a new fstab with the migrated fstype
+ shutil.copyfile("%s/etc/fstab" % anaconda.rootPath,
+ "%s/etc/fstab.anaconda" % anaconda.rootPath)
+ anaconda.id.storage.fsset.write(anaconda.rootPath)
+
+ # and make sure /dev is mounted so we can read the bootloader
+ bindMountDevDirectory(anaconda.rootPath)
def setupTimezone(anaconda):
diff --git a/storage/__init__.py b/storage/__init__.py
index ea8963367..6a24de1b5 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -1242,8 +1242,7 @@ def mountExistingSystem(anaconda, rootEnt,
if rc == 0:
return -1
- if flags.setupFilesystems:
- fsset.mountFilesystems(anaconda, readOnly=readOnly, skipRoot=True)
+ fsset.mountFilesystems(anaconda, readOnly=readOnly, skipRoot=True)
class BlkidTab(object):
diff --git a/textw/upgrade_text.py b/textw/upgrade_text.py
index 0d2fc031c..f944c72b2 100644
--- a/textw/upgrade_text.py
+++ b/textw/upgrade_text.py
@@ -189,8 +189,7 @@ class UpgradeSwapWindow:
"and 2000 MB in size."))
else:
screen.popWindow()
- if flags.setupFilesystems:
- anaconda.id.storage.createSwapFile(dev, val)
+ anaconda.id.storage.createSwapFile(dev, val)
anaconda.dispatch.skipStep("addswap", 1)
return INSTALL_OK
diff --git a/upgrade.py b/upgrade.py
index c751533b1..b56c0621c 100644
--- a/upgrade.py
+++ b/upgrade.py
@@ -91,12 +91,6 @@ def findRootParts(anaconda):
anaconda.dispatch.skipStep("installtype", skip = 0)
def findExistingRoots(anaconda, upgradeany=False):
- if not flags.setupFilesystems:
- (prod, ver) = getReleaseString (anaconda.rootPath)
- if flags.cmdline.has_key("upgradeany") or upgradeany or anaconda.id.instClass.productUpgradable(prod, ver):
- return [(anaconda.rootPath, "")]
- return []
-
rootparts = findExistingRootDevices(anaconda, upgradeany=upgradeany)
return rootparts
@@ -150,7 +144,7 @@ def upgradeSwapSuggestion(anaconda):
if not device.format:
continue
if device.format.mountable and device.format.linuxNative:
- if flags.setupFilesystems and not device.format.status:
+ if not device.format.status:
continue
space = isys.pathSpaceAvailable(anaconda.rootPath + device.format.mountpoint)
if space > 16:
@@ -174,90 +168,80 @@ def upgradeSwapSuggestion(anaconda):
def upgradeMountFilesystems(anaconda):
# mount everything and turn on swap
- if flags.setupFilesystems:
- try:
- mountExistingSystem(anaconda,
- anaconda.id.upgradeRoot[0],
- allowDirty = 0)
- except ValueError as e:
- log.error("Error mounting filesystem: %s" % e)
- anaconda.intf.messageWindow(_("Mount failed"),
- _("The following error occurred when mounting the file "
- "systems listed in /etc/fstab. Please fix this problem "
- "and try to upgrade again.\n%s" % e))
- sys.exit(0)
- except IndexError as e:
- # The upgrade root is search earlier but we give the message here.
- log.debug("No upgrade root was found.")
- if anaconda.isKickstart and anaconda.id.ksdata.upgrade.upgrade:
- anaconda.intf.messageWindow(_("Upgrade root not found"),
+ try:
+ mountExistingSystem(anaconda,
+ anaconda.id.upgradeRoot[0],
+ allowDirty = 0)
+ except ValueError as e:
+ log.error("Error mounting filesystem: %s" % e)
+ anaconda.intf.messageWindow(_("Mount failed"),
+ _("The following error occurred when mounting the file "
+ "systems listed in /etc/fstab. Please fix this problem "
+ "and try to upgrade again.\n%s" % e))
+ sys.exit(0)
+ except IndexError as e:
+ # The upgrade root is search earlier but we give the message here.
+ log.debug("No upgrade root was found.")
+ if anaconda.isKickstart and anaconda.id.ksdata.upgrade.upgrade:
+ anaconda.intf.messageWindow(_("Upgrade root not found"),
+ _("The root for the previously installed system was not "
+ "found."), type="custom",
+ custom_icon="info",
+ custom_buttons=[_("Exit installer")])
+ sys.exit(0)
+ else:
+ rc = anaconda.intf.messageWindow(_("Upgrade root not found"),
_("The root for the previously installed system was not "
- "found."), type="custom",
- custom_icon="info",
- custom_buttons=[_("Exit installer")])
+ "found. You can exit installer or backtrack to choose "
+ "installation instead of upgrade."),
+ type="custom",
+ custom_buttons = [ _("_Back"),
+ _("_Exit installer") ],
+ custom_icon="question")
+ if rc == 0:
+ return DISPATCH_BACK
+ elif rc == 1:
sys.exit(0)
- else:
- rc = anaconda.intf.messageWindow(_("Upgrade root not found"),
- _("The root for the previously installed system was not "
- "found. You can exit installer or backtrack to choose "
- "installation instead of upgrade."),
- type="custom",
- custom_buttons = [ _("_Back"),
- _("_Exit installer") ],
- custom_icon="question")
- if rc == 0:
- return DISPATCH_BACK
- elif rc == 1:
- sys.exit(0)
-
- checkLinks = ( '/etc', '/var', '/var/lib', '/var/lib/rpm',
- '/boot', '/tmp', '/var/tmp', '/root',
- '/bin/sh', '/usr/tmp')
- badLinks = []
- for n in checkLinks:
- if not os.path.islink(anaconda.rootPath + n): continue
- l = os.readlink(anaconda.rootPath + n)
- if l[0] == '/':
- badLinks.append(n)
-
- if badLinks:
- message = _("The following files are absolute symbolic "
- "links, which we do not support during an "
- "upgrade. Please change them to relative "
- "symbolic links and restart the upgrade.\n\n")
- for n in badLinks:
- message = message + '\t' + n + '\n'
- anaconda.intf.messageWindow(_("Absolute Symlinks"), message)
- sys.exit(0)
-
- # fix for 80446
- badLinks = []
- mustBeLinks = ( '/usr/tmp', )
- for n in mustBeLinks:
- if not os.path.islink(anaconda.rootPath + n):
- badLinks.append(n)
-
- if badLinks:
- message = _("The following are directories which should instead "
- "be symbolic links, which will cause problems with the "
- "upgrade. Please return them to their original state "
- "as symbolic links and restart the upgrade.\n\n")
- for n in badLinks:
- message = message + '\t' + n + '\n'
- anaconda.intf.messageWindow(_("Invalid Directories"), message)
- sys.exit(0)
- else:
- if not os.access (anaconda.rootPath + "/etc/fstab", os.R_OK):
- anaconda.intf.messageWindow(_("Warning"),
- _("%s not found")
- % (anaconda.rootPath + "/etc/fstab",),
- type="ok")
- return DISPATCH_BACK
-
- anaconda.id.storage.parseFSTab()
- if flags.setupFilesystems:
- anaconda.id.storage.turnOnSwap(upgrading=True)
- anaconda.id.storage.mkDevRoot()
+
+ checkLinks = ( '/etc', '/var', '/var/lib', '/var/lib/rpm',
+ '/boot', '/tmp', '/var/tmp', '/root',
+ '/bin/sh', '/usr/tmp')
+ badLinks = []
+ for n in checkLinks:
+ if not os.path.islink(anaconda.rootPath + n): continue
+ l = os.readlink(anaconda.rootPath + n)
+ if l[0] == '/':
+ badLinks.append(n)
+
+ if badLinks:
+ message = _("The following files are absolute symbolic "
+ "links, which we do not support during an "
+ "upgrade. Please change them to relative "
+ "symbolic links and restart the upgrade.\n\n")
+ for n in badLinks:
+ message = message + '\t' + n + '\n'
+ anaconda.intf.messageWindow(_("Absolute Symlinks"), message)
+ sys.exit(0)
+
+ # fix for 80446
+ badLinks = []
+ mustBeLinks = ( '/usr/tmp', )
+ for n in mustBeLinks:
+ if not os.path.islink(anaconda.rootPath + n):
+ badLinks.append(n)
+
+ if badLinks:
+ message = _("The following are directories which should instead "
+ "be symbolic links, which will cause problems with the "
+ "upgrade. Please return them to their original state "
+ "as symbolic links and restart the upgrade.\n\n")
+ for n in badLinks:
+ message = message + '\t' + n + '\n'
+ anaconda.intf.messageWindow(_("Invalid Directories"), message)
+ sys.exit(0)
+
+ anaconda.id.storage.turnOnSwap(upgrading=True)
+ anaconda.id.storage.mkDevRoot()
# Move /etc/rpm/platform out of the way.
if os.path.exists(anaconda.rootPath + "/etc/rpm/platform"):
diff --git a/yuminstall.py b/yuminstall.py
index a0c7203d3..4511c063a 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -1518,42 +1518,41 @@ reposdir=/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/tmp/product/anacon
self.initLog(anaconda.id, anaconda.rootPath)
- if flags.setupFilesystems:
- # setup /etc/rpm/ for the post-install environment
- iutil.writeRpmPlatform(anaconda.rootPath)
+ # setup /etc/rpm/ for the post-install environment
+ iutil.writeRpmPlatform(anaconda.rootPath)
+ try:
+ # FIXME: making the /var/lib/rpm symlink here is a hack to
+ # workaround db->close() errors from rpm
+ iutil.mkdirChain("/var/lib")
+ for path in ("/var/tmp", "/var/lib/rpm"):
+ if os.path.exists(path) and not os.path.islink(path):
+ shutil.rmtree(path)
+ if not os.path.islink(path):
+ os.symlink("%s/%s" %(anaconda.rootPath, path), "%s" %(path,))
+ else:
+ log.warning("%s already exists as a symlink to %s" %(path, os.readlink(path),))
+ except Exception, e:
+ # how this could happen isn't entirely clear; log it in case
+ # it does and causes problems later
+ log.error("error creating symlink, continuing anyway: %s" %(e,))
+
+ # SELinux hackery (#121369)
+ if flags.selinux:
try:
- # FIXME: making the /var/lib/rpm symlink here is a hack to
- # workaround db->close() errors from rpm
- iutil.mkdirChain("/var/lib")
- for path in ("/var/tmp", "/var/lib/rpm"):
- if os.path.exists(path) and not os.path.islink(path):
- shutil.rmtree(path)
- if not os.path.islink(path):
- os.symlink("%s/%s" %(anaconda.rootPath, path), "%s" %(path,))
- else:
- log.warning("%s already exists as a symlink to %s" %(path, os.readlink(path),))
+ os.mkdir(anaconda.rootPath + "/selinux")
except Exception, e:
- # how this could happen isn't entirely clear; log it in case
- # it does and causes problems later
- log.error("error creating symlink, continuing anyway: %s" %(e,))
-
- # SELinux hackery (#121369)
- if flags.selinux:
- try:
- os.mkdir(anaconda.rootPath + "/selinux")
- except Exception, e:
- pass
- try:
- isys.mount("/selinux", anaconda.rootPath + "/selinux", "selinuxfs")
- except Exception, e:
- log.error("error mounting selinuxfs: %s" %(e,))
-
- # For usbfs
+ pass
try:
- isys.mount("/proc/bus/usb", anaconda.rootPath + "/proc/bus/usb", "usbfs")
+ isys.mount("/selinux", anaconda.rootPath + "/selinux", "selinuxfs")
except Exception, e:
- log.error("error mounting usbfs: %s" %(e,))
+ log.error("error mounting selinuxfs: %s" %(e,))
+
+ # For usbfs
+ try:
+ isys.mount("/proc/bus/usb", anaconda.rootPath + "/proc/bus/usb", "usbfs")
+ except Exception, e:
+ log.error("error mounting usbfs: %s" %(e,))
# write out the fstab
if not upgrade: