def reset(self): # Reset everything except: # # - The mouse # - The install language # - The keyboard self.langSupport = language.Language() self.instClass = None self.network = network.Network() self.firewall = firewall.Firewall() self.security = security.Security() self.timezone = timezone.Timezone() self.accounts = users.Accounts() self.rootPassword = users.RootPassword() self.auth = users.Authentication() self.desktop = desktop.Desktop() self.grpset = None self.upgrade = Boolean() # XXX move fsset and/or diskset into Partitions object? self.fsset.reset() self.diskset = partedUtils.DiskSet() self.partitions = partitions.Partitions() self.bootloader = bootloader.getBootloader() self.dependencies = [] self.handleDeps = CHECK_DEPS self.dbpath = None self.upgradeRoot = None self.rootParts = None self.upgradeSwapInfo = None self.upgradeDeps = "" self.upgradeRemove = [] self.upgradeInfoFound = None self.configFileData = self.tmpData self.firstboot = FIRSTBOOT_DEFAULT
def findExistingRoots(intf, id, chroot, upgradeany=0): if not flags.setupFilesystems: return [(chroot, 'ext2', "")] diskset = partedUtils.DiskSet() diskset.openDevices() win = intf.progressWindow( _("Searching"), _("Searching for %s installations...") % (productName, ), 5) rootparts = diskset.findExistingRootPartitions(intf, chroot, upgradeany=upgradeany) for i in range(1, 6): time.sleep(0.25) win.set(i) win.pop() # close the devices to make sure we don't leave things sitting open diskset.closeDevices() # this is a hack... need to clear the skipped disk list after this partedUtils.DiskSet.skippedDisks = [] return rootparts
def mountRootPartition(intf, rootInfo, oldfsset, instPath, allowDirty=0, raiseErrors=0, warnDirty=0, readOnly=0): (root, rootFs) = rootInfo diskset = partedUtils.DiskSet() diskset.openDevices() diskset.startAllRaid() lvm.vgscan() lvm.vgactivate() log("going to mount %s on %s as %s" % (root, instPath, rootFs)) isys.mount(root, instPath, rootFs) oldfsset.reset() newfsset = fsset.readFstab(instPath + '/etc/fstab', intf) for entry in newfsset.entries: oldfsset.add(entry) isys.umount(instPath) dirtyDevs = oldfsset.hasDirtyFilesystems(instPath) if not allowDirty and dirtyDevs != []: diskset.stopAllRaid() lvm.vgdeactivate() intf.messageWindow( _("Dirty File Systems"), _("The following file systems for your Linux system " "were not unmounted cleanly. Please boot your " "Linux installation, let the file systems be " "checked and shut down cleanly to upgrade.\n" "%s" % (getDirtyDevString(dirtyDevs), ))) sys.exit(0) elif warnDirty and dirtyDevs != []: rc = intf.messageWindow(_("Dirty File Systems"), _("The following file systems for your Linux " "system were not unmounted cleanly. Would " "you like to mount them anyway?\n" "%s" % (getDirtyDevString(dirtyDevs, ))), type="yesno") if rc == 0: return -1 if flags.setupFilesystems: oldfsset.mountFilesystems(instPath, readOnly=readOnly) # XXX we should properly support 'auto' at some point if (not oldfsset.getEntryByMountPoint("/") or not oldfsset.getEntryByMountPoint("/").fsystem or not oldfsset.getEntryByMountPoint("/").fsystem.isMountable()): raise RuntimeError, "/etc/fstab did not list a fstype for the root partition which we support"
def reset(self): # Reset everything except: # # - The mouse # - The install language # - The keyboard self.instClass = None self.network = network.Network() self.iscsi = iscsi.iscsi() self.zfcp = zfcp.ZFCP() self.firewall = firewall.Firewall() self.security = security.Security() self.timezone = timezone.Timezone() self.users = None self.rootPassword = {"isCrypted": False, "password": ""} self.auth = "--enableshadow --enablemd5" self.desktop = desktop.Desktop() self.upgrade = None # XXX move fsset and/or diskset into Partitions object? self.fsset.reset() self.diskset = partedUtils.DiskSet(self.anaconda) self.partitions = partitions.Partitions() self.bootloader = bootloader.getBootloader() self.dependencies = [] self.dbpath = None self.upgradeRoot = None self.rootParts = None self.upgradeSwapInfo = None self.upgradeDeps = "" self.upgradeRemove = [] self.upgradeInfoFound = None if rhpl.getArch() == "s390": self.firstboot = FIRSTBOOT_SKIP else: self.firstboot = FIRSTBOOT_DEFAULT # XXX I expect this to die in the future when we have a single data # class and translate ksdata into that instead. self.ksdata = None
def mountRootPartition(anaconda, rootInfo, oldfsset, allowDirty=0, warnDirty=0, readOnly=0): (root, rootFs) = rootInfo diskset = partedUtils.DiskSet(anaconda) encryptedDevices = anaconda.id.partitions.encryptedDevices diskset.openDevices() for cryptoDev in encryptedDevices.values(): cryptoDev.openDevice() diskset.startMPath() diskset.startDmRaid() diskset.startMdRaid() for cryptoDev in encryptedDevices.values(): cryptoDev.openDevice() lvm.vgscan() lvm.vgactivate() for cryptoDev in encryptedDevices.values(): if cryptoDev.openDevice(): log.warning("failed to open encrypted device %s" % (cryptoDev.getDevice(encrypted=True))) log.info("going to mount %s on %s as %s" % (root, anaconda.rootPath, rootFs)) isys.mount(root, anaconda.rootPath, rootFs) oldfsset.reset() newfsset = readFstab(anaconda) for entry in newfsset.entries: oldfsset.add(entry) isys.umount(anaconda.rootPath) dirtyDevs = oldfsset.hasDirtyFilesystems(anaconda.rootPath) if not allowDirty and dirtyDevs != []: lvm.vgdeactivate() diskset.stopMdRaid() diskset.stopDmRaid() diskset.stopMPath() anaconda.intf.messageWindow( _("Dirty File Systems"), _("The following file systems for your Linux system " "were not unmounted cleanly. Please boot your " "Linux installation, let the file systems be " "checked and shut down cleanly to upgrade.\n" "%s" % (getDirtyDevString(dirtyDevs), ))) sys.exit(0) elif warnDirty and dirtyDevs != []: rc = anaconda.intf.messageWindow( _("Dirty File Systems"), _("The following file systems for your Linux " "system were not unmounted cleanly. Would " "you like to mount them anyway?\n" "%s" % (getDirtyDevString(dirtyDevs, ))), type="yesno") if rc == 0: return -1 if flags.setupFilesystems: oldfsset.mountFilesystems(anaconda, readOnly=readOnly) if (not oldfsset.getEntryByMountPoint("/") or not oldfsset.getEntryByMountPoint("/").fsystem or not oldfsset.getEntryByMountPoint("/").fsystem.isMountable()): raise RuntimeError, "/etc/fstab did not list a fstype for the root partition which we support"