From abb6ec58462064d9874945efb8215e1b6cd76d71 Mon Sep 17 00:00:00 2001 From: Jeremy Katz Date: Wed, 17 Jan 2007 22:49:50 +0000 Subject: 2007-01-17 Jeremy Katz * iw/progress_gui.py (InstallProgressWindow.completePackage): Quick and dirty way of handling-non rpm installs. This needs to be reworked more completely * timezone.py (Timezone.__init__): Add a default in case the step is skipped * instdata.py (InstallData.write): Ensure that network is written out rather than counting on our backend to do so in its preinstall * fsset.py (FileSystemType.isKernelFS): Add a method to determine if we're an in-kernel pseudo-filesystem (PsudoFileSystem.isKernelFS): And implement it (FileSystemSet.umountFilesystems): Allow unmounting filesystems without turning off swap. --- ChangeLog | 18 ++++++++++++++++++ fsset.py | 11 ++++++++++- instdata.py | 3 ++- iw/progress_gui.py | 6 +++++- timezone.py | 2 +- 5 files changed, 36 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7b1b85c39..3e5bfcd46 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2007-01-17 Jeremy Katz + + * iw/progress_gui.py (InstallProgressWindow.completePackage): + Quick and dirty way of handling-non rpm installs. This needs to + be reworked more completely + + * timezone.py (Timezone.__init__): Add a default in case the step + is skipped + + * instdata.py (InstallData.write): Ensure that network is written + out rather than counting on our backend to do so in its preinstall + + * fsset.py (FileSystemType.isKernelFS): Add a method to determine + if we're an in-kernel pseudo-filesystem + (PsudoFileSystem.isKernelFS): And implement it + (FileSystemSet.umountFilesystems): Allow unmounting filesystems + without turning off swap. + 2007-01-17 Dave Lehman * loader2/method.c (unpackCpioBall): new function to unpack a diff --git a/fsset.py b/fsset.py index a6b690454..5d407a0b1 100644 --- a/fsset.py +++ b/fsset.py @@ -176,6 +176,10 @@ class FileSystemType: self.maxLabelChars = 16 self.packages = [] + def isKernelFS(self): + """Returns True if this is an in-kernel pseudo-filesystem.""" + return False + def mount(self, device, mountpoint, readOnly=0, bindMount=0, instroot=""): if not self.isMountable(): @@ -966,6 +970,9 @@ class PsudoFileSystem(FileSystemType): self.name = name self.supported = 0 + def isKernelFS(self): + return True + class ProcFileSystem(PsudoFileSystem): def __init__(self): PsudoFileSystem.__init__(self, "proc") @@ -1870,7 +1877,7 @@ MAILADDR root return ret - def umountFilesystems(self, instPath, ignoreErrors = 0): + def umountFilesystems(self, instPath, ignoreErrors = 0, swapoff = True): # XXX remove special case try: isys.umount(instPath + '/proc/bus/usb', removeDir = 0) @@ -1884,6 +1891,8 @@ MAILADDR root reverse.reverse() for entry in reverse: + if entry.mountpoint == "swap" and not swapoff: + continue entry.umount(instPath) class FileSystemSetEntry: diff --git a/instdata.py b/instdata.py index 62f9f01d2..3ca42210a 100644 --- a/instdata.py +++ b/instdata.py @@ -149,7 +149,8 @@ class InstallData: log.error("Would have run: %s", args) except RuntimeError, msg: log.error("Error running %s: %s", args, msg) - + + self.network.write (anaconda.rootPath) self.firewall.write (anaconda.rootPath) self.security.write (anaconda.rootPath) diff --git a/iw/progress_gui.py b/iw/progress_gui.py index e4497ab5c..7e3827263 100644 --- a/iw/progress_gui.py +++ b/iw/progress_gui.py @@ -80,7 +80,7 @@ class InstallProgressWindow (InstallWindow): self.progress.set_fraction (newval) self.processEvents() - def completePackage(self, header, timer): + def completePackage(self, header = None, timer = None, pct = None): def formatTime(amt): hours = amt / 60 / 60 amt = amt % (60 * 60) @@ -90,6 +90,10 @@ class InstallProgressWindow (InstallWindow): return "%01d:%02d:%02d" % (int(hours) ,int(min), int(secs)) + if pct: + self.totalProgress.set_fraction(pct) + return + self.numComplete = self.numComplete + 1 self.sizeComplete = self.sizeComplete + (header[rpm.RPMTAG_SIZE]/1024) diff --git a/timezone.py b/timezone.py index f5285db17..e38a6b06e 100644 --- a/timezone.py +++ b/timezone.py @@ -59,6 +59,6 @@ class Timezone: self.arc = asArc def __init__(self): - self.tz = None + self.tz = "America/New_York" self.utc = 0 self.arc = 0 -- cgit