zdev: implement option to identify files created by zdev

Enhance the 'chzdev' tool by introducing a new option to discern
files created by 'zdev-tools.' The command usage is as follows:

$ chzdev --is-owner <file-name>

When executed, the command will return an exit code of 0 for all
files generated by zdev-tools. In the case of an unknown file, the
tool will return the exit code 'EXIT_UNKNOWN_FILE i.e 33.'

Signed-off-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Vineeth Vijayan
2024-02-01 16:27:41 +01:00
committed by Jan Höppner
parent 4c2bfb1d47
commit f1f80a8a20
5 changed files with 88 additions and 0 deletions

View File

@@ -601,6 +601,18 @@ Combining apparently inconsistent settings
.PP
.RE
.
.OD is-owner "" "FILENAME"
Detect if the file mentioned is generated by zdev tools.
Return 0 if the
.IR FILENAME
is generated by zdev tools and 33 otherwise.
.B Example:
.CL chzdev --is-owner /etc/udev/rules/41-dasd-0.0.1234.rules
.PP
.
.OD no-root-update "" ""
Skip root device update.
@@ -916,6 +928,14 @@ CCW group device: Grouping failed
CCW group device: Ungrouping failed
.PP
.TP
.B 33
The file specified by
.nh
\-\-is-owner
.hy
is not generated by zdev
.PP
.TP
.B 99
An internal error occurred
.PP