Esempio n. 1
0
def get_device_names(specs, disks_only=False, msg="{}", lineno=None):
    """Get device names from device specifications."""
    drives = []

    for spec in specs:
        matched = device_matches(spec, disks_only=disks_only)
        if not matched:
            raise KickstartParseError(msg.format(spec), lineno=lineno)
        else:
            drives.extend(matched)

    return drives
Esempio n. 2
0
def get_device_names(specs, disks_only=False, msg="{}", lineno=None):
    """Get device names from device specifications."""
    drives = []

    for spec in specs:
        matched = device_matches(spec, disks_only=disks_only)
        if not matched:
            raise KickstartParseError(msg.format(spec), lineno=lineno)
        else:
            drives.extend(matched)

    return drives
Esempio n. 3
0
        for (name, path) in name_path_pairs(opts.images):
            log.info("naming disk image '%s' '%s'", path, name)
            anaconda.storage.disk_images[name] = path
            image_count += 1
            flags.imageInstall = True
    except ValueError as e:
        stdout_log.error("error specifying image file: %s", e)
        iutil.ipmi_abort(scripts=ksdata.scripts)
        sys.exit(1)

    if image_count:
        anaconda.storage.setup_disk_images()

    # Ignore disks labeled OEMDRV
    from pyanaconda.storage_utils import device_matches
    matched = device_matches("LABEL=OEMDRV", disks_only=True)
    for oemdrv_disk in matched:
        if oemdrv_disk not in ksdata.ignoredisk.ignoredisk:
            ksdata.ignoredisk.ignoredisk.append(oemdrv_disk)
            log.info("Adding disk %s labeled OEMDRV to ignored disks",
                    oemdrv_disk)

    from pyanaconda.payload import payloadMgr
    from pyanaconda.timezone import time_initialize

    if not flags.dirInstall:
        threadMgr.add(AnacondaThread(name=constants.THREAD_STORAGE, target=storage_initialize,
                                     args=(anaconda.storage, ksdata, anaconda.protected)))

    if can_touch_runtime_system("initialize time", touch_live=True):
        threadMgr.add(AnacondaThread(name=constants.THREAD_TIME_INIT, target=time_initialize,
Esempio n. 4
0
            log.info("naming disk image '%s' '%s'", path, name)
            anaconda.storage.disk_images[name] = path
            image_count += 1
    except ValueError as e:
        stdout_log.error("error specifying image file: %s", e)
        util.ipmi_abort(scripts=ksdata.scripts)
        sys.exit(1)

    if image_count:
        anaconda.storage.setup_disk_images()

    # Ignore disks labeled OEMDRV
    from pyanaconda.modules.common.constants.services import STORAGE
    from pyanaconda.modules.common.constants.objects import DISK_SELECTION
    from pyanaconda.storage_utils import device_matches
    matched = device_matches("LABEL=OEMDRV", disks_only=True)
    for oemdrv_disk in matched:
        disk_select_proxy = STORAGE.get_proxy(DISK_SELECTION)
        ignored_disks = disk_select_proxy.IgnoredDisks

        if oemdrv_disk not in ignored_disks:
            log.info("Adding disk %s labeled OEMDRV to ignored disks", oemdrv_disk)
            ignored_disks.append(oemdrv_disk)
            disk_select_proxy.SetIgnoredDisks(ignored_disks)

    from pyanaconda.payload import payloadMgr
    from pyanaconda.timezone import time_initialize

    if not conf.target.is_directory:
        threadMgr.add(AnacondaThread(name=constants.THREAD_STORAGE, target=storage_initialize,
                                     args=(anaconda.storage, ksdata, anaconda.protected)))