From 0d804af891d0bea61048b734da572d4cad271ccd Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Sat, 28 Apr 2012 02:46:10 +0200 Subject: [PATCH] anaconda: use packages from already mounted /mnt/stage2 if commanded so (#440) --- anaconda/backend.py | 2 +- anaconda/scripts/mk-images.x86 | 2 +- anaconda/yuminstall.py | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/anaconda/backend.py b/anaconda/backend.py index 2ec2109..713278b 100644 --- a/anaconda/backend.py +++ b/anaconda/backend.py @@ -188,7 +188,7 @@ class AnacondaBackend: return 1 isys.lochangefd("/dev/loop0", self._loopbackFile) - if os.path.ismount("/mnt/stage2"): + if os.path.ismount("/mnt/stage2") and not anaconda.methodstr.find("/mnt/stage2") >= 0: isys.umount("/mnt/stage2") def removeInstallImage(self): diff --git a/anaconda/scripts/mk-images.x86 b/anaconda/scripts/mk-images.x86 index 39fb142..228da60 100644 --- a/anaconda/scripts/mk-images.x86 +++ b/anaconda/scripts/mk-images.x86 @@ -100,7 +100,7 @@ makeBootImages() { # insert XEN boot options sed -i 's/kernel vmlinuz/kernel mboot.c32/' $MBD_BOOTTREE/isolinux.cfg - sed -i "s/append initrd=[^ ]*\(.*\)/append $xenimage --- $kernelimage stage2=hd:LABEL=\"$CDLABEL\"\1 --- $initrd/" $MBD_BOOTTREE/isolinux.cfg + sed -i "s/append initrd=[^ ]*\(.*\)/append $xenimage --- $kernelimage stage2=hd:LABEL=\"$CDLABEL\":\/images\/install.img repo=file:\/mnt\/stage2\1 --- $initrd/" $MBD_BOOTTREE/isolinux.cfg # copy in memtest if present if [ -f $IMGPATH/usr/lib/anaconda-runtime/boot/memtest* ]; then diff --git a/anaconda/yuminstall.py b/anaconda/yuminstall.py index ff9c7a3..478bbae 100644 --- a/anaconda/yuminstall.py +++ b/anaconda/yuminstall.py @@ -492,6 +492,10 @@ class AnacondaYum(YumSorter): self._switchCD(1) self.mediagrabber = self.mediaHandler self._baseRepoURL = "file://%s" % self.tree + elif m.startswith("file:"): + self.tree = m[5:] + self._baseRepoURL = "file://%s" % self.tree + else: # No methodstr was given. In order to find an installation source, # we should first check to see if there's a CD/DVD with packages