[rhinstaller/blivet/pulls/233 master] Try to make EDD support actually recognize things other than by the MBR matching...

vpodzime installerbot-noreply at redhat.com
Tue Oct 6 05:44:23 UTC 2015


> @@ -32,66 +32,193 @@
>  
>  log = logging.getLogger("blivet")
>  
> -re_host_bus = re.compile(r'^PCI\s*(\S*)\s*channel: (\S*)\s*$')
> -re_interface_scsi = re.compile(r'^SCSI\s*id: (\S*)\s*lun: (\S*)\s*$')
> +re_host_bus_pci = re.compile(r'^(PCIX|PCI|XPRS|HTPT)\s*(\S*)\s*channel: (\S*)\s*$')
> +re_interface_atapi = re.compile(r'^ATAPI\s*device: (\S*)\s*lun: (\S*)\s*$')
>  re_interface_ata = re.compile(r'^ATA\s*device: (\S*)\s*$')
> +re_interface_scsi = re.compile(r'^SCSI\s*id: (\S*)\s*lun: (\S*)\s*$')
> +re_interface_usb = re.compile(r'^USB\s*serial_number: (\S*)\s*$')
> +re_interface_1394 = re.compile(r'^1394\s*eui: (\S*)\s*$')
> +re_interface_fibre = re.compile(r'^FIBRE\s*wwid: (\S*)\s*lun: (\S*)\s*$')
> +re_interface_i2o = re.compile(r'^I2O\s*identity_tag: (\S*)\s*$')
> +# pretty sure the RAID definition using "identity_tag" is basically a kernel
> +# bug, but it's part of the ABI now, so it sticks.  The format of the
> +# scnprintf() is at least correct.
> +re_interface_raid = re.compile(r'^RAID\s*identity_tag: (\S*)\s*$')
> +re_interface_edd3_sata = re.compile(r'^SATA\s*device: (\S*)\s*$')
> +# EDD 4 features from 2010 and later.  Awesomely, the "version" output from
> +# int 13 AH=41h says: AH Version of extensions. Shall be set to 30h,
> +# so there's no way to distinguish these from EDD 3, even thuogh SATA does
> +# differ.  In theory, if we're on <4.0, pmp should always be all 0's.
> +re_interface_edd4_sata = re.compile(r'^SATA\s*device: (\S*)\s*pmp: (\S*)\s*$')
> +re_interface_sas = re.compile(r'^SAS\s*sas_address: (\S*)\s*lun: \(\S*\)\s*$')
> +# to make life difficult, when it finds an unknown interface type string,
> +# the kernel prints the values without the string.  But it does print the
> +# anchoring tab that would go between them...
> +re_interface_unknown = re.compile(r'^(\S*)\s*unknown: (\S*) (\S*)\s*$')
>  
>  class EddEntry(object):
>      """ This object merely collects what the /sys/firmware/edd/* entries can
>          provide.
>      """
>      def __init__(self, sysfspath):
> +        # the path we're probing
> +        self.sysfspath = sysfspath
> +
> +        # data used for logging later
> +        self.interface = None
> +
> +        # data from edd/int13_devXX/version
> +        self.version = util.get_sysfs_attr(sysfspath, "version")
> +
> +        # data from edd/int13_devXX/mbr_signature
> +        self.mbr_sig = None
> +
> +        # data from edd/int13_devXX/sectors
> +        self.sectors = None
> +
> +        # data from edd/int13_devXX/host_bus
> +        self.host_bus = None
> +        self.pci_dev = None
> +        self.channel = None
> +
> +        # data from edd/int13_devXX/interface in (nearly) all cases
>          self.type = None
>  
> +        # data from edd/int13_devXX/interface when type is ATAPI
> +        self.atapi_device = None
> +        self.atapi_lun = None
> +
> +        # data from edd/int13_devXX/interface when type is ATA or SATA
>          self.ata_device = None
> -        self.channel = None
> -        self.mbr_signature = None
> -        self.pci_dev = None
> +        self.ata_pmp = None
> +
> +        # data from edd/int13_devXX/interface when type is SCSI
>          self.scsi_id = None
>          self.scsi_lun = None
> -        self.sectors = None
>  
> -        self.load(sysfspath)
> +        # data from edd/int13_devXX/interface when type is USB
> +        self.usb_serial = None
> +
> +        # data from edd/int13_devXX/interface when type is 1394
> +        self.ieee1394_eui64 = None
> +
> +        # data from edd/int13_devXX/interface when type is FIBRE
> +        self.fibre_wwid = None
> +        self.fibre_lun = None
> +
> +        # data from edd/int13_devXX/interface when type is I2O
> +        self.i2o_identity = None
> +
> +        # data from edd/int13_devXX/interface when type is SAS
> +        self.sas_address = None
> +        self.sas_lun = None
> +
> +        # data we may get as the result of the search
> +        self.sysfslink = None
> +
> +        self.load()
>  
>      def __str__(self):
> -        return \
> -            "\ttype: %(type)s, ata_device: %(ata_device)s\n" \
> -            "\tchannel: %(channel)s, mbr_signature: %(mbr_signature)s\n" \
> -            "\tpci_dev: %(pci_dev)s, scsi_id: %(scsi_id)s\n" \
> -            "\tscsi_lun: %(scsi_lun)s, sectors: %(sectors)s" % self.__dict__
> +        s = "\tpath: %(sysfspath)s, version: %(version)s\n" \
> +            "\ttype: %(type)s, mbr_signature: %(mbr_sig)s, " \
> +            "sectors: %(sectors)s"
> +        if self.sysfslink != None:
> +            s += "\n\tsysfs pci path: %(sysfslink)s"
> +        if self.host_bus !=None or self.pci_dev != None or self.channel != None:

Missing space after the first ``!=``

-- 
To view this pull request on github, visit https://github.com/rhinstaller/blivet/pull/233#discussion_r41227602


More information about the anaconda-patches mailing list