Commit Graph

2139 Commits

Author SHA1 Message Date
Thomas Richter
718907d9ba cpumf/lswhc: Add short names to lshwc output
Add option -s or --short to display the header using a short
counter name. With this option the counter symbol names, which can be
very long as in IDCW_ON_DRAWER_DRAWER_HIT are replaced by a shorter
name. That name consists of an abbrevation for the counter set
this counter belongs to and the counter number in that set.

The abbrevations are:
B --> Basic counter set
P --> Problem state counter set
C --> Crypto counter set
E --> Extended counter set
M --> MT_Diagnostic counter set
U --> Undefined counter.

Display E165 for counter name IDCW_ON_DRAWER_DRAWER_HIT
which is counter number 165 from the extended counter set.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-04-07 17:42:18 +02:00
Thomas Richter
26cf3ec769 cpumf: Move defines from source to header files
Move defines from a source file lscpumf.c to the header
file in the include directory to be reused in a follow on
patch. Also reshuffle the list of defines in proper
sequence of increasing numbers.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Reviewed-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-04-07 17:42:18 +02:00
Thomas Richter
7150da3e4f cpumf/lshwc: Add flags to display counter values in hex
Add flags to display all counter values in hexadecimal
format with and without leading 0x indicator.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Reviewed-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-04-07 17:42:18 +02:00
Joern Siglen
f946ce27f7 dbginfo.sh: Add missing config data and logs
Get a summary of chrony ntp info.
Add config directories for audit and selinux.
Get dmesg log from crash directories.

Reviewed-by: Michael Storzer <MSTORZER@de.ibm.com>
Signed-off-by: Joern Siglen <siglen@de.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-04-07 17:42:18 +02:00
Jakob Naucke
4942504a9a rust/pv*: Split pvapconfig::ap to pv_core::apdevice
Move appropriate parts into new pv_core::ap module.

Signed-off-by: Jakob Naucke <naucke@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-24 16:31:45 +01:00
Jakob Naucke
e1245ed4e5 rust/pv*: Use pv_core::Error in pvapconfig
For the parts of pvapconfig::ap to be moved to pv_core, use
pv_core::Result<a>, i.e. Result<a, pv_core::Error>, instead of
Result<a, String>.

Signed-off-by: Jakob Naucke <naucke@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-24 16:31:45 +01:00
Jakob Naucke
272eb5ad8c rust/pvapconfig: Implement TryFrom for Apqn
Move assembling APQN struct out of gather_apqns and print non-fatal
warnings afterwards. Allows for moving Apqn to pv_core including this
TryFrom.

Signed-off-by: Jakob Naucke <naucke@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-24 16:31:45 +01:00
Jakob Naucke
543d41cb59 rust/pvapconfig: No stderr in ApqnInfo
ApqnInfo is to be moved to pv_core. Move warnings about missing
master/wrapping keys to gather_apqns to avoid stderr output in library
code.

Signed-off-by: Jakob Naucke <naucke@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-24 16:31:45 +01:00
Jakob Naucke
8619f14c0a rust/pvapconfig: Add doc-strings to ap
Add doc-strings and Debug derives.

Signed-off-by: Jakob Naucke <naucke@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-24 16:31:45 +01:00
Jakob Naucke
56aa3e2d26 rust/pv_core: Use file_error!
Macro already exists, but wasn't used in some places where it can
reduce lines.

Signed-off-by: Jakob Naucke <naucke@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-24 16:31:45 +01:00
Jakob Naucke
a9fbfcc7ae rust/pv_core: Fix error type of misc::read_file
Was Write, should be Read.

Fixes: 9b51b8b882 ("rust/pv: Refactor pv crate")
Signed-off-by: Jakob Naucke <naucke@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-24 16:31:45 +01:00
Jakob Naucke
a32adbf5d8 rust/pvapconfig: Remove sysfs_{read,write}_*
Remove sysfs_{read,write}_{i32,string} in favor of pv_core tools,
which support error contexts, making longer error handlings unnecessary.

Signed-off-by: Jakob Naucke <naucke@linux.ibm.com>
Acked-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-24 16:31:45 +01:00
Jakob Naucke
f9050799bb rust/pv_core: Add misc::read_file_string
Like read_file, this is a function that reads from a file with error
handling conveniences, but that reads to a trimmed string instead of a
byte vector.

Signed-off-by: Jakob Naucke <naucke@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-24 16:31:45 +01:00
Jakob Naucke
66a10d5e3e rust/pv*: Move u8_to_hexstring to pv_core
Move pvapconfig::helper::u8_to_hexstring to pv_core::utils::encode_hex.
Discard pvapconfig::helper::hexstring_to_u8 in favor of
pv_core::utils::decode_hex.

Signed-off-by: Jakob Naucke <naucke@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-24 16:31:44 +01:00
Jakob Naucke
152f446d76 rust: Fix cargo clippy findings
Fix the new `cargo clippy` findings for updated 1.84 toolchain.

Signed-off-by: Jakob Naucke <naucke@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-24 16:31:44 +01:00
Joern Siglen
646e080217 dbginfo.sh: Fix typos in console messages
Signed-off-by: Joern Siglen <siglen@de.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:35:05 +01:00
Jan Höppner
3fd8c48245 pvsecret: Fix incorrect font escape sequences in man page
There are a couple place with incorrectly used font escape sequences.

$ man --warnings -E UTF-8 -l -Tutf8 -Z rust/pvsecret/man/pvsecret.1

troff:<standard input>:107: warning: cannot select font 'F'
troff:<standard input>:107: warning: cannot select font 'E'

$ man --warnings -E UTF-8 -l -Tutf8 -Z rust/pvsecret/man/pvsecret-verify.1
troff:<standard input>:119: warning: cannot select font 'F'
troff:<standard input>:119: warning: cannot select font 'F'
troff:<standard input>:119: warning: cannot select font 'F'
troff:<standard input>:119: warning: cannot select font 'F'
troff:<standard input>:119: warning: cannot select font 'F'
troff:<standard input>:131: warning: cannot select font 'F'

Use the correct escape sequences and regenerate the man pages.

Github-ID: https://github.com/ibm-s390-linux/s390-tools/issues/170
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:35:05 +01:00
Jan Höppner
c93b74b527 pvattest: Fix various man page issues
The pvattest man pages are generated mostly from the rust doc entries
within the tool. Some escape sequences and whatis-entries are incorrect
as found by different linter:

$ man --warnings -E UTF-8 -l -Tutf8 -Z ./rust/pvattest/man/pvattest-create.1
troff:<standard input>:23: warning: macro 'create'' not defined

$ lexgrog -w -m rust/pvattest/man/pvattest-verify.1
rust/pvattest/man/pvattest-verify.1: parse failed

Fix this by regenerating the man pages with correct escape sequences and
whatis-entries.

Github-ID: https://github.com/ibm-s390-linux/s390-tools/issues/170
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:35:05 +01:00
Jan Höppner
4fe6025b18 chreipl-fcp-mpath: Regenerate man page with new pandoc version
Older versions of pandoc (<3.1.7) can sometimes produce incorrect man
page macros [1][2]. The chreipl-fcp-mpath man page had a few of those:

$ man --warnings -E UTF-8 -l -Tutf8 -Z chreipl-fcp-mpath/chreipl-fcp-mpath.7
troff:<standard input>:5: warning: cannot select font 'CB'
troff:<standard input>:160: warning: cannot select font 'C'
troff:<standard input>:174: warning: cannot select font 'C'
troff:<standard input>:183: warning: cannot select font 'C'

Regenerate the man page using pandoc 3.1.11 to fix those issues.

[1] https://github.com/jgm/pandoc/issues/9020
[2] https://github.com/bin-cli/bin-cli/issues/44
Github-ID: https://github.com/ibm-s390-linux/s390-tools/issues/170
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:35:05 +01:00
Jan Höppner
73b6a684ec vmur: Remove undefined macro SP from man page
The vmur man page uses the .SP macro a lot. This is not a valid macro
and it is not defined anywhere.

$ man --warnings -E UTF-8 -l -Tutf8 -Z vmur/vmur.8
troff:<standard input>:92: warning: macro 'SP' not defined

Remove it entirely as the initial intention is unclear and the rendered
man page doesn't change.

Github-ID: https://github.com/ibm-s390-linux/s390-tools/issues/170
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:35:05 +01:00
Jan Höppner
40d9df5cc8 opticsmon: Add missing macro definition in man page
The .CL macro was copied from another man page but it is not defined in
the opticsmon man page:

$ man --warnings -E UTF-8 -l -Tutf8 -Z opticsmon/opticsmon.8
troff:<standard input>:70: warning: macro 'CL' not defined

Add the missing definition to fix this.

Github-ID: https://github.com/ibm-s390-linux/s390-tools/issues/170
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:35:05 +01:00
Jan Höppner
9ebb8da624 zdev: Fix spelling error in man page italic macro
The SITE-ID parameter in the --site section is supposed to be formatted
as italic. Instead of .I .ID is used leading to misinterpretation and
the mentioning of the parameter missing in the rendered man page.

Found via:
$ man --warnings -E UTF-8 -l -Tutf8 -Z zdev/man/lszdev.8
troff:<standard input>:455: warning: macro 'ID' not defined

Use .I correctly to fix the issue.

Github-ID: https://github.com/ibm-s390-linux/s390-tools/issues/170
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:35:05 +01:00
Jan Höppner
589ce29d41 lsqeth: Fix incorrectly used font change sequence in man page
The lsqeth man page uses the font change sequence \f without a
parameter, which is not allow:

$ man --warnings -E UTF-8 -l -Tutf8 -Z zconf/qeth/lsqeth.8
troff:<standard input>:13: error: a space character is not allowed in an escape sequence parameter
troff:<standard input>:13: error: a space character is not allowed in an escape sequence parameter
troff:<standard input>:13: error: a space character is not allowed in an escape sequence parameter
troff:<standard input>:13: error: a space character is not allowed in an escape sequence parameter
troff:<standard input>:13: error: a newline character is not allowed in an escape sequence parameter

Fix it by using proper espace sequence to format the specific parts of
the text correctly. This also brings the synopsis a bit more in line
with other qeth tools.

Github-ID: https://github.com/ibm-s390-linux/s390-tools/issues/170
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:35:05 +01:00
Jan Höppner
b343672eb8 cpacfinfo: Fix missing escape sequence in man page
For the --available option the description contains a line starting with
". If", which is intended to be a punctuation and start of a new
sentence but is misinterpreted by groff as a macro. As a result, the
rendered paragraph is incorrectly displayed.

$ man --warnings -E UTF-8 -l -Tutf8 -Z rust/cpacfinfo/man/cpacfinfo.1
troff:<standard input>:128: warning: macro 'If' not defined

Even though it's not consistent with the rest of the man page, use the
font change escape sequence and surround the specific bold formatted
parts to fix this issue and correctly display the sentence.

Github-ID: https://github.com/ibm-s390-linux/s390-tools/issues/170
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:35:05 +01:00
Jan Höppner
df47036f01 zcryptstats: Remove beginning paragraph in man page
A single paragraph opening .TP macro at the end of the man page is
causing errors found with:
$ man --warnings -E UTF-8 -l -Tutf8 -Z zconf/zcrypt/zcryptstats.8
troff: error: automatically ending diversion 'an-div' on exit

It also causes the footer of the man page not rendering correctly.
Remove the macro. While at it, remove whitespace damage as well.

Github-ID: https://github.com/ibm-s390-linux/s390-tools/issues/170
Reviewed-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:35:04 +01:00
Jan Polensky
5febec5f44 zkey/kmip/zkey-kmip.1: Fix typos in man page
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:35:04 +01:00
Jan Polensky
84f44dd20f rust/pvapconfig/man/pvapconfig.1: Fix typos in man page
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:35:04 +01:00
Jan Polensky
d86dd0658f zpcictl/zpcictl.8: Fix typo in man page
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:35:04 +01:00
Jan Polensky
00c36baee0 zconf/lsluns.8: Fix typo in man page
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:35:04 +01:00
Jan Polensky
a40519fd16 scripts/dbginfo.sh.8: Fix typos in man page
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:35:04 +01:00
Jan Polensky
b836b4fb83 cpumf/man/lscpumf.8: Fix typo in man page
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:35:04 +01:00
Mete Durlu
1ab819cd81 zmemtopo: Add man page
Add man page with tool description and usage examples.

Signed-off-by: Mete Durlu <meted@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:35:04 +01:00
Mete Durlu
ee50f20c11 zmemtopo: Add parseable format
Allow users to fetch zmemtopo data in parse-able formats, such as
csv, json, json-seq and pairs.

Signed-off-by: Mete Durlu <meted@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:35:04 +01:00
Mete Durlu
0f17fe5183 s390-tools: Introduce new tool zmemtopo
s390 is able to provide memory topology information of the current CEC
via a new userspace-kernel interface. zmemtopo is a tool to convert the
raw data into human readable form.

Usage: zmemtopo [OPTIONS]

Display CEC memory topology of allocated memory increments.

OUTPUT FORMAT OPTIONS
 -l, --level NESTING_LEVEL  Set the topology display depth to NESTING_LEVEL
 -f, --full                 Display tree view with padded elements
 -r, --reverse              Reverse tree view hierarchy direction
 -t, --table                Use table view to display topology
 -s, --sort FIELD           Sort view by field
                            (nr, lpar, size)
 -i, --ascii                Use only ASCII characters

GENERAL OPTIONS
 -h, --help                 Print this help, then exit
 -v, --version              Print version information, then exit

Upon calling zmemtopo displays available topology level's structure
and memory increments defined on each topology location.

Ex:
$ zmemtopo
LPAR/LEVEL     SIZE
LPAR003          8G
└LEVEL4_0        8G
  ├LEVEL3_0      2G
  ├LEVEL3_1      2G
  ├LEVEL3_2      2G
  └LEVEL3_3      2G
LPAR005          8G
└LEVEL4_1        8G
  ├LEVEL3_0      2G
  ├LEVEL3_1      2G
  ├LEVEL3_2      2G
  └LEVEL3_3      2G
LPAR006          8G
└LEVEL4_3        8G
...

Signed-off-by: Mete Durlu <meted@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:35:04 +01:00
Jan Polensky
650e2da843 ipl_tools/cmd_lsreipl.c: Add secure boot state to output
The actual secure boot state ensures that a Linux instance has loaded
only trusted, signed software. During boot component signatures are
verified. If secure boot is enabled, unsigned or unverifiable components
prevent booting. Since Secure Boot on IBM Z is always triggered by the
hypervisor, its state is merely observable by the active system.

Secure boot: 1 - Linux booted secure (only trusted sources)
Secure boot: 0 - Booted from any source without verification

	$ dmesg -t | grep Secure-IPL
	setup: Linux is running with Secure-IPL enabled

	$ cat /sys/kernel/security/lockdown
	none [integrity] confidentiality

	$ lsreipl
	Re-IPL type: fcp
	WWPN:        0x500507630710572c
	LUN:         0x4022409600000000
	Device:      0.0.1908
	bootprog:    0
	br_lba:      0
	Loadparm:    ""
	Bootparms:   ""
	Secure boot: 1

References:
* https://www.ibm.com/docs/en/linux-on-systems?topic=using-verifying-secure-boot
* https://www.ibm.com/docs/en/linux-on-systems?topic=introduction-requirements
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:34:52 +01:00
Jan Polensky
426311f440 ipl_tools/cmd_chreipl.c: Replace /sys mount point with util_path_sysfs
The default sysfs path is always set to '/sys' unless the SYSFS_ROOT
environment variable is defined.

To address security concerns, secure_getenv() is used within
util_path_sysfs() to protect against malicious values in SYSFS_ROOT.
Additionally, constructing the sysfs path dynamically in an allocated
buffer, rather than using a fixed-size buffer, helps prevent potential
buffer overflows.

These modifications also significantly improve testability by allowing
sysfs read and write operations to be redirected to an alternative file
path, which enables testing without affecting the active system state.

Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:34:52 +01:00
Jan Polensky
5333085c55 ipl_tools/ccw.c: Cleanup obsolete ccw_busid_get_sysfs_old()
The function is no longer required since the removal of the PHYSDEVPATH
entry in /sys/block/%s/uevent with commit 39aba963d937 ("driver core:
remove CONFIG_SYSFS_DEPRECATED_V2 but keep it for block devices") in
2010.

Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:34:52 +01:00
Jan Polensky
4c301d47dd ipl_tools/cmd_lsshut.c: Replace /sys mount point with util_path_sysfs
The default sysfs path is always set to '/sys' unless the SYSFS_ROOT
environment variable is defined.

To address security concerns, secure_getenv() is used within
util_path_sysfs() to protect against malicious values in SYSFS_ROOT.
Additionally, constructing the sysfs path dynamically in an allocated
buffer, rather than using a fixed-size buffer, helps prevent potential
buffer overflows.

These modifications also significantly improve testability by allowing
sysfs read operations to be redirected to an alternative file path,
which enables testing without affecting the active system state.

Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:34:52 +01:00
Jan Polensky
aea2ba8728 ipl_tools/cmd_lsreipl.c: Construct sysfs paths with util_path_sysfs()
The default sysfs path is always set to '/sys' unless the SYSFS_ROOT
environment variable is defined.

To address security concerns, secure_getenv() is used within
util_path_sysfs() to protect against malicious values in SYSFS_ROOT.
Additionally, constructing the sysfs path dynamically in an allocated
buffer, rather than using a fixed-size buffer, helps prevent potential
buffer overflows.

These modifications also significantly improve testability by allowing
sysfs read operations to be redirected to an alternative file path,
which enables testing without affecting the active system state.

Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:34:52 +01:00
Jan Polensky
594a554e56 ipl_tools/cmd_chreipl.c: Fix typo errrors->error
Fix typo in comment also helps to prevent pre-commit hook issues, w/o
functional changes or changes in behavior.

Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:34:52 +01:00
Jan Polensky
a0c3a74019 ipl_tools: Remove empty lines
Remove unnecessary empty lines to prevent pre-commit hook issues, w/o
functional changes or changes in behavior.

Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:34:52 +01:00
Ingo Franzki
efdd34a56c zkey-cryptsetup: Add new 'convert' command
The 'convert' command converts a LUKS2 volume that uses a clear volume key
and the 'aes' cipher to use a secure volume key and the 'paes' cipher.

Optionally, the volume can use the integrity option with LUKS2 using a
clear key integrity key.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Jorg Schmidbauer <jschmidb@de.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:34:52 +01:00
Ingo Franzki
c80a0c8af0 zkey-cryptsetup: Add '--volume-key-file' as alias for '--master-key-file'
Starting with cryptsetup version 2.5.0 the luksFormat command accepts
option '--volume-key-file' to specify the volume key file. Option
'--master-key-file' is still accepted as an alias to '--volume-key-file'.

Follow this pattern with the zkey-cryptsetup tool and also accept both
options '--volume-key-file' and '--master-key-file'. The short option
form stays '-m' for compatibility reasons (cryptsetup does not have a
short option for that).

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Jorg Schmidbauer <jschmidb@de.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:34:52 +01:00
Ingo Franzki
d98a10f67f zkey-cryptsetup: Fix logging of libcryptsetup debug messages
Messages from libcryptsetup for logging level CRYPT_LOG_DEBUG
may or may not include an EOL, dependent on the cryptsetup version:
Between libcryptsetup version 2.1 and 2.2 debug messages do not
include an EOL character, but since 2.2 they do.

Append an EOL only if the message does not already end with EOL.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Jorg Schmidbauer <jschmidb@de.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:34:52 +01:00
Steffen Eiden
fb6e7e70c6 rust/pvsecret: Update man page for retrieve secret
Clarify the Output format in the man files.

Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:34:52 +01:00
Ingo Franzki
e49569db60 rust/pvsecret: Update man page for clarifying the creation of HMAC secrets
The key supplied in the plain bytes file with 'pvsecret create retrievable'
with type 'hmac-sha' is they key 'K_0' as of FIPS-198-1, i.e. the key 'K'
after any necessary pre-processing. The pre-processing must be performed
by the user prior to creating the retrievable secret.

Describe in detail how that pre-processing must be performed.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:34:52 +01:00
Marc Hartmayer
b3055154db rust/Makefile: Add 'install-(bash|zsh)-completion' targets
Add installation targets for bash and zsh autocompletions for the PV
related tools. Do not use them by default.

Acked-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:34:52 +01:00
Marc Hartmayer
6718c0edc9 common.mak: Introduce 'DATADIR'
This makes it easier to reuse. Stick to the conventions used by Meson [1].

[1] https://mesonbuild.com/Builtin-options.html#directories

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:34:52 +01:00
Joern Siglen
28d9405f73 dbginfo.sh: Updating info for disks and lvm
Adding some different views on disk and file system setup.
Getting more details on lvm setup.

Suggested-by: Mohamed AbouRehab <mohamed.abou.rehab@ibm.com>
Reviewed-by: Michael Storzer <MSTORZER@de.ibm.com>
Signed-off-by: Joern Siglen <siglen@de.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-03-19 16:34:52 +01:00
Sumanth Korikkar
05f0aeb61e zpwr: Add man page for zpwr tool
Add man page for zpwr tool and its usage.

Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2025-02-14 14:38:58 +01:00