Re: [PATCH] Mark live device as protected instead of ignoring it. (#517260)

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

 



On Thu, 2009-10-08 at 10:54 -0500, David Lehman wrote:
> ---
>  storage/devicetree.py |   13 +++++++++++++
>  storage/udev.py       |   11 -----------
>  2 files changed, 13 insertions(+), 11 deletions(-)
> 
> diff --git a/storage/devicetree.py b/storage/devicetree.py
> index a9b74eb..111e7e1 100644
> --- a/storage/devicetree.py
> +++ b/storage/devicetree.py
> @@ -21,6 +21,7 @@
>  #
>  
>  import os
> +import stat
>  import block
>  import re
>  
> @@ -1961,6 +1962,18 @@ class DeviceTree(object):
>              if name:
>                  self.protectedDevNames.append(name)
>  
> +        # FIXME: the backing dev for the live image can't be used as an
> +        # install target.  note that this is a little bit of a hack
> +        # since we're assuming that /dev/live will exist
> +        if os.path.exists("/dev/live") and \
> +           stat.S_ISBLK(os.stat("/dev/live")[stat.ST_MODE]):
> +            livetarget = os.path.realpath("/dev/live")
> +            if livetarget.startswith("/dev"):
> +                livetarget = livetarget[5:]
> +            log.info("%s looks to be the live device; marking as protected"
> +                     % (livetarget,))
> +            self.protectedDevNames.append(livetarget)
> +
>          # each iteration scans any devices that have appeared since the
>          # previous iteration
>          old_devices = {}
> diff --git a/storage/udev.py b/storage/udev.py
> index 2c41343..79e00e5 100644
> --- a/storage/udev.py
> +++ b/storage/udev.py
> @@ -77,17 +77,6 @@ def __is_blacklisted_blockdev(dev_name):
>      """Is this a blockdev we never want for an install?"""
>      if dev_name.startswith("loop") or dev_name.startswith("ram") or dev_name.startswith("fd"):
>          return True
> -    # FIXME: the backing dev for the live image can't be used as an
> -    # install target.  note that this is a little bit of a hack 
> -    # since we're assuming that /dev/live will exist
> -    if os.path.exists("/dev/live") and \
> -            stat.S_ISBLK(os.stat("/dev/live")[stat.ST_MODE]):
> -        livetarget = os.path.realpath("/dev/live")
> -        if livetarget.startswith("/dev"):
> -            livetarget = livetarget[5:]
> -        if livetarget.startswith(dev_name):
> -            log.info("%s looks to be the live device; ignoring" % (dev_name,))
> -            return True
>  
>      if os.path.exists("/sys/class/block/%s/device/model" %(dev_name,)):
>          model = open("/sys/class/block/%s/device/model" %(dev_name,)).read()

Can somebody review this?  It's supposed to be a beta blocker....

-- 
Jesse Keating
Fedora -- Freedom² is a feature!
identi.ca: http://identi.ca/jkeating

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
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