mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
The udev-rules must be modified to make it site-specific. The site specific part of the rule should be executed only on the sites where the devices belong. Change the generic udev rule to support the site-specific udev-rule. During boot, the current site-id is read from the LOADPARM which is located at /sys/firmware/ipl. The zdev_id command reads this LOADPARM and prints the SITE_ID based on the value. This SITE_ID is the current site where the udev-rule is executing. Based on this assumption, the rule is divided in to multiple blocks where each site block is executed only for the corresponding sites. The rule executes based on the value read from the LOADPARM. 1. When the LOADPARM specifies a site-id and if the current device has an associated configuration settings, it will be used. 2. When the LOADPARM specifies a site, and the current device does not have any associated configuration set, the udev rule uses the fallback configuration settings. 3. If the device does not have a fallback-configuration settings or any site-specific settings, no configurations will be used. Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com> Signed-off-by: Vineeth Vijayan <vneethv@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
76 lines
2.4 KiB
C
76 lines
2.4 KiB
C
/*
|
|
* zdev - Modify and display the persistent configuration of devices
|
|
*
|
|
* Copyright IBM Corp. 2016, 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.
|
|
*/
|
|
|
|
#ifndef PATH_H
|
|
#define PATH_H PATH_H
|
|
|
|
#include "lib/zt_common.h"
|
|
|
|
#include "exit_code.h"
|
|
#include "misc.h"
|
|
|
|
#define MODPROBE_PREFIX "s390x"
|
|
#define UDEV_PREFIX "41"
|
|
#define UDEV_SUFFIX ".rules"
|
|
#define ZDEV_PREFIX "40"
|
|
|
|
#define PATH_MODPROBE_CONF "/etc/modprobe.d"
|
|
#define PATH_MODPROBE "/sbin/modprobe"
|
|
#define PATH_CCW_BUS "/sys/bus/ccw"
|
|
#define PATH_CCWGROUP_BUS "/sys/bus/ccwgroup"
|
|
#define PATH_UDEV_RULES "/etc/udev/rules.d"
|
|
#define PATH_UDEV_RULES_VOLATILE "/run/udev/rules.d"
|
|
#define PATH_PROC "/proc"
|
|
|
|
#define PATH_UDEVADM "udevadm"
|
|
#define PATH_VMCP TOOLS_BINDIR "/vmcp"
|
|
#define PATH_IP "ip"
|
|
|
|
#define PATH_ROOT "/"
|
|
#define PATH_ROOT_SCRIPT TOOLS_LIBDIR "/zdev-root-update"
|
|
|
|
struct devtype;
|
|
struct zfcp_lun_devid;
|
|
struct util_list;
|
|
|
|
void path_exit(void);
|
|
void path_set_base(struct util_list *);
|
|
|
|
exit_code_t path_create(const char *);
|
|
char *path_get(const char *, ...);
|
|
char *path_get_modprobe_conf(struct devtype *);
|
|
char *path_get_sys_module(const char *);
|
|
char *path_get_sys_module_param(const char *, const char *);
|
|
char *path_get_sys_block_dev(const char *);
|
|
char *path_get_sys_dev_block(unsigned int, unsigned int);
|
|
char *path_get_sys_dev_char(unsigned int, unsigned int);
|
|
char *path_get_sys_dev_char_devices(void);
|
|
char *path_get_sys_class(const char *, const char *);
|
|
char *path_get_modprobe(void);
|
|
char *path_get_ccw_device(const char *, const char *);
|
|
char *path_get_ccw_devices(const char *);
|
|
char *path_get_ccwgroup_device(const char *, const char *);
|
|
char *path_get_ccwgroup_devices(const char *);
|
|
char *path_get_udev_rule(const char *type, const char *id, bool vol);
|
|
char *path_get_udev_rules(bool vol);
|
|
char *path_get_proc(const char *);
|
|
char *path_get_sys_bus_dev(const char *, const char *);
|
|
char *path_get_sys_bus_drv(const char *, const char *);
|
|
char *path_get_zfcp_lun_dev(struct zfcp_lun_devid *);
|
|
char *path_get_zfcp_port_dev(struct zfcp_lun_devid *);
|
|
char *path_get_scsi_hctl_dev(const char *);
|
|
char *path_get_bus_attr(const char *, const char *);
|
|
char *path_get_zdev_rule(const char *name);
|
|
|
|
exit_code_t path_for_each(const char *,
|
|
exit_code_t (*callback)(const char *, const char *,
|
|
void *), void *);
|
|
|
|
#endif /* PATH_H */
|