[PATCH] If dracut left the DVD mounted, don't try to remount it (#849152).

Vratislav Podzimek vpodzime at redhat.com
Mon Aug 20 08:19:35 UTC 2012


Looks good to me.

On Fri, 2012-08-17 at 16:04 -0400, Chris Lumens wrote:
> Trying to remount was causing an exception which meant the DVD got thrown
> out as a possible installation source, so we were trying to use the network.
> ---
>  pyanaconda/packaging/yumpayload.py | 22 +++++++++++++++-------
>  1 file changed, 15 insertions(+), 7 deletions(-)
> 
> diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
> index 5720e4c..64f91e8 100644
> --- a/pyanaconda/packaging/yumpayload.py
> +++ b/pyanaconda/packaging/yumpayload.py
> @@ -550,16 +550,24 @@ reposdir=%s
>              url = method.url
>              sslverify = not (method.noverifyssl or flags.noverifyssl)
>          elif method.method == "cdrom" or not method.method:
> -            # cdrom or no method specified -- check for media
> -            device = opticalInstallMedia(storage.devicetree)
> +            # Did dracut leave the DVD mounted for us?
> +            device = get_mount_device("/run/install/repo")
>              if device:
> -                self._setUpMedia(device)
> -                self.install_device = device
> -                url = "file://" + INSTALL_TREE
> +                self.install_device = storage.devicetree.getDeviceByPath(device)
> +                url = "file:///run/install/repo"
>                  if not method.method:
>                      method.method = "cdrom"
> -            elif method.method == "cdrom":
> -                raise PayloadSetupError("no usable optical media found")
> +            else:
> +                # cdrom or no method specified -- check for media
> +                device = opticalInstallMedia(storage.devicetree)
> +                if device:
> +                    self._setUpMedia(device)
> +                    self.install_device = device
> +                    url = "file://" + INSTALL_TREE
> +                    if not method.method:
> +                        method.method = "cdrom"
> +                elif method.method == "cdrom":
> +                    raise PayloadSetupError("no usable optical media found")
>  
>          if method.method:
>              self._yum.preconf.releasever = self._getReleaseVersion(url)

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list