def _unpack_version(tag_data):
    """Parse a packed version info struct into tag and major.minor version.

    The tag and version are parsed out according to 20 bits for tag and
    6 bits each for major and minor.  The more interesting part is the
    blacklisting performed for tags that are known to be untrustworthy.

    In particular, the following applies to tags.

    - tags < 1024 are reserved for development and have only locally defined
      meaning.  They are not for use in production.
    - tags in [1024, 2048) are production tags but were used inconsistently
      in the early days of Arch and hence cannot be trusted to correspond with
      an actual device model.
    - tags >= 2048 are reserved for supported production device variants.
    - the tag and version 0 (0.0) is reserved for an unknown wildcard that
      does not convey any information except that the tag and version are
      not known.
    """
    tag = tag_data & (1 << 20) - 1
    version_data = tag_data >> 20
    major = version_data >> 6 & (1 << 6) - 1
    minor = version_data >> 0 & (1 << 6) - 1
    return tag, '{}.{}'.format(major, minor)
