Re: PATCH fix 510970, 529551, 530541

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2009-11-22 at 15:48 -0600, Jerry Vonau wrote:
> On Sun, 2009-11-22 at 21:27 +0100, Hans de Goede wrote:
> > Hi,
> > 
> > On 11/22/2009 05:51 AM, Jerry Vonau wrote:
> > 
> > <snip>
> > 
<snip>

> > Here is a review of your latest set of patches:
> > 
> > 1freefix.diff:
> > See above
> > 
> > 2modcall.diff:
> > Please put the large comment in  a commit msg, it would be great if you
> > could learn to use git. (Drop by on #anaconda during CET office hours and
> > I'll help you). Otherwise atleast learn to write commit messages, in a
> > .patch  / .diff file you can put text above the
> > --- filename
> > +++ filename
> > 
> I'm getting the hang of git, slowly but surely..
> 
Using git is not really a problem, just have to get the hang of emailing
patches from git. 

> > Lines and patch (and other tools) will ignore this, please learn to put some
> > explanation of the patch there start with a single line summary, so for
> > example a good header for 2modcall.diff would be:
> > 
> > ###
> > Remove unneeded check from mountInstallImage()
> > 
> > This is a preparation patch for transferring install.img from /tmp to
> > disk in low memory network and hdiso install scenarios to free up
> > memory used by install.img under /tmp.
> > 
> > Currently mountInstallImage only gets called when using cd's, based on
> > yuminstall's run, mkeys.sort(mediasort), if len(mkeys) > 1.
> > mediaDevice has already  been validated in yuminstall.py and you can't
> > get here without mounting install.img, so there is no need for the
> > check this patch removes.
> > ###
> > 
> > The second hunk of this patch should be part of the 3th patch (or separate)
> > 
Once I have the email in git sorted out, that will become easier. Just
installed git-email, today.

> > 
> > 3setcall.diff:
> > 
> > 1) This does not belong in doConfigSetup(), setup() itself or a new method
> > called from setup() would be a better place.
> > 
> OK, I'll see what I come up with.
> 
> > 2) Even if the mountInstallImage() fails you still unlink /tmp/install.img
> > 
> Yea, rushed that part, should be checking for a return code before
> unlinking.
> 
> > 
> > 4boot.diff:
> > 
> > Ah a new trick upi your sleef (atleast to me), nice one. But will this
> > work ? Does the loader (stage1) copy install.img from /boot/upgrade to
> > /tmp ? I'm asking because if it does not, then we will still have the
> > loopback mounted and the unlink will not free up the diskspace.
> > 
> The harddrive method never used to until preupgrade came along, but it
> does now. 
> 
> > 
> > We are getting somewhere, I think this will greatly improve certain
> > types of installs on low memory machines, and it will help with some
> > pre-upgrade issues, thanks!
> > 
> At least if I don't have the time, the ideas are out there now.  
> 
I'm out of time for the day, but here are my latest round of patches,
from git this time.

Jerry


>From 20bb4c5ffb9092bb31f6111447b3273d45280504 Mon Sep 17 00:00:00 2001
From: Jerry <Jerry@xxxxxxxxxxx>
Date: Tue, 24 Nov 2009 19:04:16 -0600
Subject: [PATCH 1/5] clean install.img from /boot

---
 yuminstall.py |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/yuminstall.py b/yuminstall.py
index df34153..b2ff6ac 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -706,6 +706,13 @@ class AnacondaYum(YumSorter):
 
         self.repos.setCacheDir(self.conf.cachedir)
 
+        if os.path.exists("%s/boot/upgrade/install.img" % self.anaconda.rootPath):
+            log.info("REMOVING stage2 image from %s /boot/upgrade" self.anaconda.rootPath )
+            try:
+                os.unlink("%s/boot/upgrade/install.img" % self.anaconda.rootPath):
+            except:
+                log.warning("failed to clean /boot/upgrade")
+
     def downloadHeader(self, po):
         while True:
             # retrying version of download header
-- 
1.6.5.2

>From 2a523c7d2610781908104ead2bb641f5d9ce5e9c Mon Sep 17 00:00:00 2001
From: Jerry <Jerry@xxxxxxxxxxx>
Date: Tue, 24 Nov 2009 19:05:38 -0600
Subject: [PATCH 2/5] remove-mediaDevice-check

---
 backend.py |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/backend.py b/backend.py
index 5501ac8..6abc923 100644
--- a/backend.py
+++ b/backend.py
@@ -156,11 +156,9 @@ class AnacondaBackend:
         if self._loopbackFile and os.path.exists(self._loopbackFile):
             return
 
-        # If we've booted off the first CD/DVD (so, not the boot.iso) then
+        # If we've booted off the first CD (so, not the boot.iso or DVD) then
         # copy the install.img to the filesystem and switch loopback devices
         # to there.  Otherwise we won't be able to unmount and swap media.
-        if not anaconda.mediaDevice or not os.path.exists(installimg):
-            return
 
         free = anaconda.id.storage.fsFreeSpace
         self._loopbackFile = "%s%s/rhinstall-install.img" % (anaconda.rootPath,
-- 
1.6.5.2

>From 89a73faf06f70f8e10cec04bcef79203e3bfe14c Mon Sep 17 00:00:00 2001
From: Jerry <Jerry@xxxxxxxxxxx>
Date: Tue, 24 Nov 2009 19:06:21 -0600
Subject: [PATCH 3/5] check-if-mounted-before-unmount

---
 backend.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/backend.py b/backend.py
index 6abc923..f031f90 100644
--- a/backend.py
+++ b/backend.py
@@ -193,7 +193,8 @@ class AnacondaBackend:
             return 1
 
         isys.lochangefd("/dev/loop0", self._loopbackFile)
-        isys.umount("/mnt/stage2")
+        if os.path.ismount("/mnt/stage2"):
+            isys.umount("/mnt/stage2")
 
     def removeInstallImage(self):
         if self._loopbackFile:
-- 
1.6.5.2

>From 6649a90cc082576ec8e27f26901add85ac8e49dc Mon Sep 17 00:00:00 2001
From: Jerry <Jerry@xxxxxxxxxxx>
Date: Tue, 24 Nov 2009 19:07:03 -0600
Subject: [PATCH 4/5] create-freetmp

---
 yuminstall.py |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/yuminstall.py b/yuminstall.py
index b2ff6ac..3b5c842 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -1061,6 +1061,21 @@ reposdir=/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/tmp/product/anacon
         # unhappy (#496961)
         iutil.resetRpmDb(anaconda.rootPath)
 
+    def freetmp(self, anaconda):
+    # installs that don't use /mnt/stage2 hold the install.img on 
+    # a tmpfs, free this ram if things are tight.
+        stage2img = "/tmp/install.img"
+        if os.path.exists(stage2img) and iutil.memAvailable() < isys.MIN_GUI_RAM: 
+            log.info("%s exists and low memory" % stage2img )
+            # free up /tmp for more memory before yum is called, 
+            if anaconda.backend.mountInstallImage(anaconda, stage2img):
+                return DISPATCH_BACK
+            try:
+                os.unlink(stage2img)
+            except SystemError: 
+                log.info("clearing /tmp failed")
+                return DISPATCH_BACK
+
     def doBackendSetup(self, anaconda):
         if anaconda.dir == DISPATCH_BACK:
             return DISPATCH_BACK
-- 
1.6.5.2

>From 9378b97f017a555f69057f79ba0be3477d36e660 Mon Sep 17 00:00:00 2001
From: Jerry <Jerry@xxxxxxxxxxx>
Date: Tue, 24 Nov 2009 19:07:36 -0600
Subject: [PATCH 5/5] call freetmp

---
 yuminstall.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/yuminstall.py b/yuminstall.py
index 3b5c842..cd3540a 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -1083,8 +1083,8 @@ reposdir=/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/tmp/product/anacon
         if anaconda.id.getUpgrade():
            # FIXME: make sure that the rpmdb doesn't have stale locks :/
            iutil.resetRpmDb(anaconda.rootPath)
-
         iutil.writeRpmPlatform()
+        self.freetmp(anaconda)
         self.ayum = AnacondaYum(anaconda)
         self.ayum.setup()
 
-- 
1.6.5.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux