mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
The currently active site can be found from the loadparm attribute which is located at /sys/firmware/ipl/loadparm. Read the value of loadparm and extract the site_id. The loadparm is an 8 byte alphanumerical IPL parameter. The content of loadparm can be of different forms to indicate different boot menu options, which are used by Linux for selecting the respective boot menu entries. To indicate the site-id, loadparm adds a 'S' character. Where, the following character after 'S' indicates either the site-id or indivcation to derive the site-id from SSID. For example, If the loadparm value is Sn,'n' is the integer which could be one of the valid site_ids from 0 to 9; i.e when booted on site-1, loadparm value will be S1. If loadparm value is "SS", zdev_id extracts the site_id from the SSID of the current ipl device. For ccw and zfcp devices, the current ipl device-id can be found at /sys/firmware/ipl/device. In any case, if the loadparm contains invalid value, or empty, the site_id will be default to the common-site. After the first invocation of the zdev_id from udev-rule, the site-id information is stored in /run/zdev_id.env file. This will reduce the number of further invocation of zdev_id from within udev-rules. 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>
16 lines
357 B
C
16 lines
357 B
C
/*
|
|
* zdev - Modify and display the persistent configuration of devices
|
|
*
|
|
* Copyright IBM Corp. 2022
|
|
*
|
|
* 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 ZDEV_ID_H
|
|
#define ZDEV_ID_H
|
|
|
|
#define ZDEV_SITE_ID_FILE "/run/zdev_id.env"
|
|
|
|
#endif /* ZDEV_ID_H */
|