[PATCH] Only use mounted media that has repodata

David Lehman dlehman at redhat.com
Fri Aug 24 14:35:50 UTC 2012


On Thu, 2012-08-23 at 17:55 -0700, Jesse Keating wrote:
> This recovers some logic from yuminstall.py, only use /run/install/repo
> if there is metadata there.
> 
> This is related to bug 851274 , but only fixes part of it.  It gets
> booting from boot.iso working again, but leaves booting from DVD broken.
> ---
>  pyanaconda/packaging/yumpayload.py | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
> index 28f728d..c62e926 100644
> --- a/pyanaconda/packaging/yumpayload.py
> +++ b/pyanaconda/packaging/yumpayload.py
> @@ -553,10 +553,11 @@ reposdir=%s
>              # Did dracut leave the DVD mounted for us?
>              device = get_mount_device("/run/install/repo")
>              if device:
> -                self.install_device = storage.devicetree.getDeviceByPath(device)
> -                url = "file:///run/install/repo"
> -                if not method.method:
> -                    method.method = "cdrom"
> +                if os.path.isdir("/run/install/repo/os/repodata"):
> +                    self.install_device = storage.devicetree.getDeviceByPath(device)
> +                    url = "file:///run/install/repo"
> +                    if not method.method:
> +                        method.method = "cdrom"
>              else:
>                  # cdrom or no method specified -- check for media
>                  device = opticalInstallMedia(storage.devicetree)

I'm pretty sure there's a more direct solution to the problem. Right
below this code we'll attempt to set up a yum repo using the method
we've set up. If that fails (it will if there's no repodata/), we'll
fall back to using the mirrorlists, so that check you're adding is
extraneous. The thing that might need changing is that we don't unset
self.install_device if adding the repo based on the method fails, which
could lead to us trying to either mount or unmount it later on.



More information about the anaconda-patches mailing list