Files
s390-tools/zdev/src/internal.c
Peter Oberparleiter 156450f359 zdev: Implement support for early device configuration
Enable user to specify that a device should be configured early, that is
during the initial RAM-disk boot phase. This may be necessary, e.g. to
override auto-configuration for a device which is also applied during
that boot phase. It may also be used to manually specify devices that
are required to access the root file system, such as networking devices.

Users can mark devices as requiring early configuration by specifying
a value of 1 for the newly added internal attribute zdev:early:

 # chzdev dasd-eckd 0.0.1234 -p zdev:early=1

This can be changed back by removing the attribute setting, or by
setting the attribute value to 0:

 # chzdev dasd-eckd 0.0.1234 -p -r zdev:early

or

 # chzdev dasd-eckd 0.0.1234 -p zdev:early=0

Signed-off-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2018-06-08 15:03:30 +02:00

39 lines
1.0 KiB
C

/*
* zdev - Modify and display the persistent configuration of devices
*
* Copyright IBM Corp. 2017
*
* s390-tools is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.
*/
#include <stdbool.h>
#include "attrib.h"
#include "internal.h"
#include "misc.h"
struct attrib internal_attr_early = {
.name = INTERNAL_ATTR_EARLY,
.title = "Activate device early during boot",
.desc = "Control the time of activation of a device:\n"
" 0: Device is activated normally during boot\n"
" 1: Device is activated early in the boot process, by the\n"
" initial RAM-disk\n",
.defval = "0",
.accept = ACCEPT_ARRAY(ACCEPT_RANGE(0, 1)),
.internal = 1,
};
/* Return identifier of internal attribute with specified @name. */
const char *internal_get_name(const char *name)
{
return name + sizeof(INTERNAL_ATTR_PREFIX) - 1;
}
/* Check if attribute is internal by name. */
bool internal_by_name(const char *name)
{
return starts_with(name, INTERNAL_ATTR_PREFIX);
}