SHA256
1
0
forked from pool/s390-tools

Compare commits

..

31 Commits

Author SHA256 Message Date
285c259e2b Accepting request 1248000 from Base:System
OBS-URL: https://build.opensuse.org/request/show/1248000
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/s390-tools?expand=0&rev=92
2025-02-24 14:49:05 +00:00
Nikolay Gueorguiev
2ef34f199d - Applied additional patches (jsc#PED-10303 (IBM-1575))
* s390-tools-01-Add-zpwr-tool.patch
 * s390-tools-02-zpwr-Add-man-page-for-zpwr-tool.patch

OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=251
2025-02-24 07:12:17 +00:00
Ana Guerrero
7beb12b52b Accepting request 1244692 from Base:System
OBS-URL: https://build.opensuse.org/request/show/1244692
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/s390-tools?expand=0&rev=91
2025-02-10 16:29:18 +00:00
Nikolay Gueorguiev
d7162287c1 - Upgrade s390-tools to 2.37 (jsc#PED-9591, jsc#PED-10303, jesc#PED-11870 (jsc#IBM-1062))
* Changes of existing tools:
    dbginfo.sh: Add details on CPU-measurement
    dbginfo.sh: Add new crypto command
    dbginfo.sh: Add overview commands and crypto update
    dbginfo.sh: Adding kdump info
    dbginfo.sh: Removing outdated email references
    dbginfo.sh: Rework network section
    dbginfo.sh: Update copyright 2nd year
    pvimg: Add '--(enable|disable)-image-encryption' flags to 'pvimg create'
    pvimg: Add '--cck ' command line option and make '--comm-key' an alias
    pvimg: Add '--hdr-key' command line option to 'pvimg create'
    pvimg: Rename '--key' into '--hdr-key' and use '--key' as an alias (for 'pvimg info')
    pvsecret: Add support for retrievable secrets
    ziorep_config: Add PCHID field to adapter report
    ziorep_traffic: Add DEVBUSID column to traffic report
    ziorep_utilization: Add --fcp-device parameter to print virtual adapter report
    ziorep_utilization: Add PCHID column to physical adapter report
    ziorep_utilization: Now prints only physical adapter report by default
    ziorep_utilization: Swap Bus-ID and CHPID columns in virtual adapter report
    zipl/boot: Increase section size for eckd_mv dumper
    zkey: Add support for listing and importing protected virtualization secrets
  * Bug Fixes:
    chpstat: Fix invalid utilization data on older kernels
    opticsmon: Fix runaway loop in on_link_change()
    zipl: Update inline assembly for GCC 15
    zipl_helper.device-mapper: Add missed step in logical device resolution
- Revendored vendor.tar.gz
- Removed obsolete patches:
  * s390-tools-01-zipl_helper.device-mapper-add-missed-step-in-logical.patch
  * s390-tools-02-zipl-src-fix-imprecise-check-that-file-is-on-specifi.patch
  * s390-tools-General-update-01.patch
  * s390-tools-General-update-02.patch
  * s390-tools-General-update-03.patch
  * s390-tools-General-update-04.patch
  * s390-tools-General-update-05.patch
  * s390-tools-General-update-06.patch
  * s390-tools-General-update-07.patch
  * s390-tools-General-update-08.patch
  * s390-tools-General-update-09.patch
  * s390-tools-General-update-10.patch
  * s390-tools-General-update-11.patch
  * s390-tools-General-update-12.patch
  * s390-tools-Additional-update-01.patch
  * s390-tools-Additional-update-02.patch
  * s390-tools-pvimg-info-command-01.patch
  * s390-tools-pvimg-info-command-02.patch
  * s390-tools-pvimg-info-command-03.patch
  * s390-tools-Support-unencrypted-SE-images-01.patch
  * s390-tools-pvimg-info-command-04.patch
  * s390-tools-pvimg-additional-01.patch
  * s390-tools-01-zkey-Add-support-for-retrieving-a-list-of-ultravisor-secrets.patch
  * s390-tools-02-zkey-Add-the--pvsecrets-list-command.patch
  * s390-tools-03-zkey-Add-PVSECRETS-AES-key-type.patch
  * s390-tools-04-zkey-Add-the-pvsecrets-import-command.patch
  * s390-tools-05-zkey-Reject-key-generation-and-APQN-association-for-PVSECRET-AES-keys.patch
  * s390-tools-06-zkey-Reject-re-enciphering-of-PVSECRET-AES-keys.patch
  * s390-tools-07-zkey-Support-validation-of-key-of-type-PVSECRET-AES.patch
  * s390-tools-08-rust-pvimg-Fix-flag-parsing-for-allowing-dump.patch
  * s390-tools-09-rust-pvimg-Document-the-change-from--comm-key-to--cck.patch

OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=249
2025-02-10 08:51:00 +00:00
Ana Guerrero
c130ce67d2 Accepting request 1242320 from Base:System
OBS-URL: https://build.opensuse.org/request/show/1242320
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/s390-tools?expand=0&rev=90
2025-02-03 20:44:37 +00:00
Nikolay Gueorguiev
27cc4620be - Applied more additional patches (jsc#PED-11870, jec#PED-11958)
* s390-tools-08-rust-pvimg-Fix-flag-parsing-for-allowing-dump.patch
  * s390-tools-09-rust-pvimg-Document-the-change-from--comm-key-to--cck.patch

OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=247
2025-02-03 08:20:55 +00:00
Ana Guerrero
8474887a05 Accepting request 1241295 from Base:System
OBS-URL: https://build.opensuse.org/request/show/1241295
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/s390-tools?expand=0&rev=89
2025-01-30 13:52:54 +00:00
Nikolay Gueorguiev
7869bc9d34 - Applied additional patches ( jsc#PED-9561 ( jsc#IBM-1447 ) )
* s390-tools-01-zkey-Add-support-for-retrieving-a-list-of-ultravisor-secrets.patch
  * s390-tools-02-zkey-Add-the--pvsecrets-list-command.patch
  * s390-tools-03-zkey-Add-PVSECRETS-AES-key-type.patch
  * s390-tools-04-zkey-Add-the-pvsecrets-import-command.patch
  * s390-tools-05-zkey-Reject-key-generation-and-APQN-association-for-PVSECRET-AES-keys.patch
  * s390-tools-06-zkey-Reject-re-enciphering-of-PVSECRET-AES-keys.patch
  * s390-tools-07-zkey-Support-validation-of-key-of-type-PVSECRET-AES.patch
- Revendored vendor.tar.gz

OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=245
2025-01-30 08:40:14 +00:00
Ana Guerrero
201c253b02 Accepting request 1236146 from Base:System
OBS-URL: https://build.opensuse.org/request/show/1236146
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/s390-tools?expand=0&rev=88
2025-01-12 10:14:00 +00:00
Nikolay Gueorguiev
a45e3d9c5b - Applied backport patches from s390-tools 2.37 to 2.36 ( jsc#PED-11870 )
( jsc#IBM-1447, jsc#IBM-1062 )
  * s390-tools-General-update-01.patch
  * s390-tools-General-update-02.patch
  * s390-tools-General-update-03.patch
  * s390-tools-General-update-04.patch
  * s390-tools-General-update-05.patch
  * s390-tools-General-update-06.patch
  * s390-tools-General-update-07.patch
  * s390-tools-General-update-08.patch
  * s390-tools-General-update-09.patch
  * s390-tools-General-update-10.patch
  * s390-tools-General-update-11.patch
  * s390-tools-General-update-12.patch
  * s390-tools-Additional-update-01.patch
  * s390-tools-Additional-update-02.patch
    ( jsc#IBM-1570, jsc#IBM-1571 )
  * s390-tools-Support-unencrypted-SE-images-01.patch
    ( jsc#IBM-1572, jsc#IBM-1573 )
  * s390-tools-pvimg-info-command-01.patch
  * s390-tools-pvimg-info-command-02.patch
  * s390-tools-pvimg-info-command-03.patch
  * s390-tools-pvimg-info-command-04.patch
    ( jsc#IBM-1576, jsc#IBM-1577 )
  * s390-tools-pvimg-additional-01.patch
- Renamed patches from - to
  * s390-tools-01-opticsmon-Fix-runaway-loop-in-on_link_change.patch 
      to
      s390-tools-Additional-update-01.patch
  * s390-tools-02-libzpci-opticsmon-Refactor-on_link_change-using-new.patch
      to
      s390-tools-Additional-update-02.patch
  * s390-tools-03-rust-pvimg-Add-enable-disable-image-encryption-flags-to-pvimg-create.patch
      to
      s390-tools-Support-unencrypted-SE-images-01.patch
- Revendored vendor.tar.gz

OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=243
2025-01-09 11:12:54 +00:00
Ana Guerrero
f40487aa79 Accepting request 1235532 from Base:System
OBS-URL: https://build.opensuse.org/request/show/1235532
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/s390-tools?expand=0&rev=87
2025-01-07 19:54:01 +00:00
Nikolay Gueorguiev
263ba1bd7b - Applied a patch for '--(enable|disable)-image-encryption' flags for 'pvimg create' (jsc#PED-11870)
* s390-tools-03-rust-pvimg-Add-enable-disable-image-encryption-flags-to-pvimg-create.patch

OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=241
2025-01-07 09:33:50 +00:00
Ana Guerrero
1aca340a15 Accepting request 1234126 from Base:System
OBS-URL: https://build.opensuse.org/request/show/1234126
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/s390-tools?expand=0&rev=86
2025-01-01 22:07:53 +00:00
Nikolay Gueorguiev
51403030c6 - Applied patches (jsc#PED-9591, jsc#PED-10303)
* s390-tools-01-opticsmon-Fix-runaway-loop-in-on_link_change.patch 
  * s390-tools-02-libzpci-opticsmon-Refactor-on_link_change-using-new.patch

OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=239
2024-12-31 10:13:14 +00:00
Ana Guerrero
f226d43bc0 Accepting request 1229339 from Base:System
OBS-URL: https://build.opensuse.org/request/show/1229339
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/s390-tools?expand=0&rev=85
2024-12-09 20:12:51 +00:00
Nikolay Gueorguiev
e553b3bcf0 - Upgrade s390-tools to version 2.36 (jsc#PED-10303, jsc#PED-9591)
* s390-tools: Define Rust MSRV as 1.75.0
  * Add new tools / libraries:
    - cpacfinfo: Tool to provide CPACF information
    - opticsmon: Tools to monitor optical modules for directly attached PCI based NICs
    - pvimg: Rust rewrite of genprotimg
  * Changes of existing tools:
    - chpstat: Add data bandwidth utilization column
    - chpstat: Add support for full CMCB
    - chpstat: Add support for new CMG types
    - dbginfo.sh: add overview commands and crypto update
    - hyptop: Support for structured output (json, json-seq, csv)
    - lszfcp: Add missing fallback marker for non-good fc_host port_state
    - lszfcp: Improve speed with many SCSI devices
    - pvattest: Add attestation policy check command
    - zipl: Add support of partitions of mirror md-devices
  * Bug Fixes:
    - lszcrypt: Fix wrong state showing up for removed AP queue within SE guest
    - lszfcp: Show device names line for zfcp_units without SCSI device
- Revendored vendor.tar.gz
- Applied additional patch (bsc#1233889, bsc#1233079)
  * s390-tools-02-zipl-src-fix-imprecise-check-that-file-is-on-specifi.patch
- Applied a patch (bsc#1233889)
  * s390-tools-01-zipl_helper.device-mapper-add-missed-step-in-logical.patch
- Amended the /usr/lib/modules-load.d/pkey.conf (bsc#1233233). Added
  * pkey_cca
  * pkey_ep11
  * pkey_pckmo

OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=237
2024-12-09 12:14:57 +00:00
Nikolay Gueorguiev
1aa732b1b1 Upgrade to version 2.36
OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=236
2024-12-09 11:03:58 +00:00
Nikolay Gueorguiev
989dd03b90 Upgrade to 2.36
OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=235
2024-12-09 10:57:39 +00:00
Nikolay Gueorguiev
a05add60ad Upgrade to 2.36
OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=234
2024-12-09 10:50:09 +00:00
Nikolay Gueorguiev
549859fb33 Upgrade to version 2.36
OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=233
2024-12-09 10:35:11 +00:00
Nikolay Gueorguiev
37e471ec3d - Upgrade s390-tools to version 2.36 (jsc#PED-10303, jsc#PED-9591)
* s390-tools: Define Rust MSRV as 1.75.0
  * Add new tools / libraries:
    - cpacfinfo: Tool to provide CPACF information
    - opticsmon: Tools to monitor optical modules for directly attached PCI based NICs
    - pvimg: Rust rewrite of genprotimg
  * Changes of existing tools:
    - chpstat: Add data bandwidth utilization column
    - chpstat: Add support for full CMCB
    - chpstat: Add support for new CMG types
    - dbginfo.sh: add overview commands and crypto update
    - hyptop: Support for structured output (json, json-seq, csv)
    - lszfcp: Add missing fallback marker for non-good fc_host port_state
    - lszfcp: Improve speed with many SCSI devices
    - pvattest: Add attestation policy check command
    - zipl: Add support of partitions of mirror md-devices
  * Bug Fixes:
    - lszcrypt: Fix wrong state showing up for removed AP queue within SE guest
    - lszfcp: Show device names line for zfcp_units without SCSI device
- Revendored vendor.tar.gz

OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=232
2024-12-09 10:05:08 +00:00
Ana Guerrero
88b4cf9a55 Accepting request 1228553 from Base:System
OBS-URL: https://build.opensuse.org/request/show/1228553
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/s390-tools?expand=0&rev=84
2024-12-06 13:25:31 +00:00
Nikolay Gueorguiev
d2403fb3d3 - Applied a patch (bsc#1233889)
* s390-tools-01-zipl_helper.device-mapper-add-missed-step-in-logical.patch
- Amended the /usr/lib/modules-load.d/pkey.conf (bsc#1233233). Added
  * pkey_cca
  * pkey_ep11
  * pkey_pckmo

OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=230
2024-12-05 15:15:36 +00:00
Ana Guerrero
512d2a1762 Accepting request 1221334 from Base:System
OBS-URL: https://build.opensuse.org/request/show/1221334
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/s390-tools?expand=0&rev=83
2024-11-05 14:41:44 +00:00
Nikolay Gueorguiev
e0449582f8 - Amended the *_configure scripts to update again the SUSE's specific file
'/boot/zipl/active_devices.txt' (bsc#1232474, bsc#1216257)
  * ctc_configure
  * dasd_configure
  * qeth_configure
  * zfcp_host_configure

OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=228
2024-11-05 08:08:43 +00:00
Ana Guerrero
9e3bfc4f53 Accepting request 1206300 from Base:System
OBS-URL: https://build.opensuse.org/request/show/1206300
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/s390-tools?expand=0&rev=82
2024-10-08 15:25:14 +00:00
Nikolay Gueorguiev
5f5c63d1e2 * Upgrade s390-tools to version 2.35 (jsc#PED-9591, jsc#PED-10303)
* Changes of existing tools:
  - cpacfstats: Add support for FULL XTS (MSA 10) and HMAC (MSA 11) PAI counter
  - cpuplugd: Make cpuplugd compatible with hiperdispatch
  - dbginfo.sh: Add network sockstat info
  - pvapconfig: s390x exclusive build
  - zdev: Add option to select IPL device
  - zdump/dfo_s390: Support s390 DFO for vr-kernel dumps
  - zipl: Add support of mirror devices
* Bug Fixes:
  - (genprotimg|zipl)/boot: discard .note.package ELF section to save memory
  - netboot/mk-s390image: Fix size when argument is a symlink
  - ziorep_config: Fix warning message when multipath device is not there.
  - zipl: Fix problems when target parameters are specified by user
  - zipl: Fix segfault when creating device-based dumps with '--dry-run'
* Removed obsolete patches
  - s390-tools-2.34-Fix-Rust-compilation-errors.patch
  - s390-tools-01-zipl-src-add-basic-support-for-multiple-target-base-disks.patch
  - s390-tools-02-zipl-src-add-basic-support-for-multiple-target-base-disks.patch
* Revendored vendor.tar.gz

OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=226
2024-10-08 10:45:41 +00:00
Ana Guerrero
f85aac9036 Accepting request 1201422 from Base:System
* Applied patches (bsc#1230345)
  - zipl/src: add basic support for multiple target base disks
  - s390-tools-01-zipl-src-add-basic-support-for-multiple-target-base-disks.patch
  - s390-tools-02-zipl-src-add-basic-support-for-multiple-target-base-disks.patch

OBS-URL: https://build.opensuse.org/request/show/1201422
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/s390-tools?expand=0&rev=81
2024-09-16 15:46:06 +00:00
Nikolay Gueorguiev
e47d5e3f02 * Applied patches (bsc#1230345)
- zipl/src: add basic support for multiple target base disks
  - s390-tools-01-zipl-src-add-basic-support-for-multiple-target-base-disks.patch
  - s390-tools-02-zipl-src-add-basic-support-for-multiple-target-base-disks.patch

OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=224
2024-09-16 12:53:06 +00:00
Nikolay Gueorguiev
a5e2fe96bd Restore
OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=223
2024-09-10 14:51:22 +00:00
Nikolay Gueorguiev
aaa3221da7 - Applied a patch to fix 'zdev warning about failed ATTR writes by udev'
(bsc#1224211)
 * s390-tools-zdev-fix-warning-about-failed-ATTR-writes-by-udev.patch

OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=222
2024-09-10 14:11:05 +00:00
14 changed files with 1166 additions and 84 deletions

View File

@ -44,6 +44,14 @@ debug_mesg () {
esac
}
add_cio_channel() {
echo "$* # ${DATE}" >> /boot/zipl/active_devices.txt
}
remove_cio_channel() {
[ -w /boot/zipl/active_devices.txt ] && sed -i -e "/^${1}/d" /boot/zipl/active_devices.txt
}
usage(){
echo "Usage: ${0} <read channel> <write channel> <online> [<protocol>]"
echo " read/write channel = x.y.ssss where"
@ -112,3 +120,9 @@ RC=${?}
if [ ${RC} -ne 0 ]; then
exit ${RC}
fi
if [ ${ON_OFF} == 1 ]; then
add_cio_channel "${CTC_READ_CHAN},${CTC_WRITE_CHAN}"
else remove_cio_channel "${CTC_READ_CHAN}"
remove_cio_channel "${CTC_WRITE_CHAN}"
fi

View File

@ -43,6 +43,14 @@ debug_mesg () {
esac
}
add_cio_channel() {
echo "$* # ${DATE}" >> /boot/zipl/active_devices.txt
}
remove_cio_channel() {
[ -w /boot/zipl/active_devices.txt ] && sed -i -e "/^${1}/d" /boot/zipl/active_devices.txt
}
usage(){
echo "Usage: ${0} [-f -t <dasd_type> ] <ccwid> <online> [use_diag]"
echo
@ -157,4 +165,9 @@ elif [ ${ON_OFF} == 1 ]; then
fi
fi
if [ ${ON_OFF} == 1 ]; then
add_cio_channel "${CCW_CHAN_ID}"
else remove_cio_channel "${CCW_CHAN_ID}"
fi
exit ${exitcode}

View File

@ -43,6 +43,14 @@ debug_mesg () {
esac
}
add_cio_channel() {
echo "$* # ${DATE}" >> /boot/zipl/active_devices.txt
}
remove_cio_channel() {
[ -w /boot/zipl/active_devices.txt ] && sed -i -e "/^${1}/d" /boot/zipl/active_devices.txt
}
usage(){
echo "Usage: ${0} [-f -t <dasd_type> ] <ccwid> <online> [use_diag]"
echo
@ -157,4 +165,9 @@ elif [ ${ON_OFF} == 1 ]; then
fi
fi
if [ ${ON_OFF} == 1 ]; then
add_cio_channel "${CCW_CHAN_ID}"
else remove_cio_channel "${CCW_CHAN_ID}"
fi
exit ${exitcode}

View File

@ -1,7 +1,10 @@
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2018-2024 SUSE LINUX GmbH, Nuernberg, Germany.
# All rights reserved.
#
# load pkey module at boot time
pkey
pkey_cca
pkey_ep11
pkey_pckmo

View File

@ -48,6 +48,14 @@ debug_mesg () {
esac
}
add_cio_channel() {
echo "$* # ${DATE}" >> /boot/zipl/active_devices.txt
}
remove_cio_channel() {
[ -w /boot/zipl/active_devices.txt ] && sed -i -e "/^${1}/d" /boot/zipl/active_devices.txt
}
usage(){
echo "Usage: ${0} [options] <read chan> <write chan> <data chan> <online>"
echo " -i Configure IP takeover"
@ -157,3 +165,10 @@ RC=${?}
if [ ${RC} -ne 0 ]; then
exit ${RC}
fi
if [ ${ON_OFF} == 1 ]; then
add_cio_channel "${QETH_READ_CHAN},${QETH_WRITE_CHAN},${QETH_DATA_CHAN}"
else remove_cio_channel "${QETH_READ_CHAN}"
remove_cio_channel "${QETH_WRITE_CHAN}"
remove_cio_channel "${QETH_DATA_CHAN}"
fi

View File

@ -0,0 +1,566 @@
From 6004a7029cbd839eb5eaeff2276f81c57e068b74 Mon Sep 17 00:00:00 2001
From: Sumanth Korikkar <sumanthk@linux.ibm.com>
Date: Wed, 8 Jan 2025 08:57:02 +0100
Subject: [PATCH] s390-tools: Add zpwr tool
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
zpwr displays power readings of a partition and central processing
complex (CPC) from power information block (pib). pib is retrieved by
issuing diag324 ioctl to /dev/diag device.
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>
---
.gitignore | 1 +
Makefile | 3 +-
zpwr/Makefile | 23 +++
zpwr/zpwr.c | 430 ++++++++++++++++++++++++++++++++++++++++++++++++++
zpwr/zpwr.h | 46 ++++++
5 files changed, 502 insertions(+), 1 deletion(-)
create mode 100644 zpwr/Makefile
create mode 100644 zpwr/zpwr.c
create mode 100644 zpwr/zpwr.h
diff --git a/.gitignore b/.gitignore
index a0a01d93..23a8c5df 100644
--- a/.gitignore
+++ b/.gitignore
@@ -138,3 +138,4 @@ zkey/kmip/zkey-kmip.so
zkey/zkey
zkey/zkey-cryptsetup
zpcictl/zpcictl
+zpwr/zpwr
diff --git a/Makefile b/Makefile
index e1a23058..3fa6eabd 100644
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,8 @@ TOOL_DIRS = zipl zdump fdasd dasdfmt dasdview tunedasd \
vmcp man mon_tools dasdinfo vmur cpuplugd ipl_tools \
ziomon iucvterm hyptop cmsfs-fuse qethqoat zfcpdump zdsfs cpumf \
systemd hmcdrvfs cpacfstats zdev dump2tar zkey netboot etc zpcictl \
- lsstp hsci hsavmcore chreipl-fcp-mpath ap_tools rust opticsmon
+ lsstp hsci hsavmcore chreipl-fcp-mpath ap_tools rust opticsmon \
+ zpwr
else
BASELIB_DIRS =
diff --git a/zpwr/Makefile b/zpwr/Makefile
new file mode 100644
index 00000000..02581a68
--- /dev/null
+++ b/zpwr/Makefile
@@ -0,0 +1,23 @@
+#
+# Copyright IBM Corp. 2025
+#
+# 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 ../common.mak
+
+all: zpwr
+
+OBJECTS = zpwr.o
+
+zpwr: $(OBJECTS) $(rootdir)/libutil/libutil.a -lm
+
+install: all
+ $(INSTALL) -d -m 755 $(DESTDIR)$(USRBINDIR)
+ $(INSTALL) -g $(GROUP) -o $(OWNER) -m 755 zpwr $(DESTDIR)$(USRBINDIR)
+
+clean:
+ rm -f *.o *~ zpwr core
+
+.PHONY: all install clean
diff --git a/zpwr/zpwr.c b/zpwr/zpwr.c
new file mode 100644
index 00000000..40d19dbf
--- /dev/null
+++ b/zpwr/zpwr.c
@@ -0,0 +1,430 @@
+/*
+ * zpwr - Display power readings of s390 computing environment.
+ *
+ * Display power readings for resources in s390 computing environment from
+ * power information block (pib).
+ *
+ * Copyright IBM Corp. 2025
+ *
+ * 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 <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <iconv.h>
+#include <math.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <time.h>
+
+#include "lib/util_base.h"
+#include "lib/util_fmt.h"
+#include "lib/util_opt.h"
+#include "lib/util_prg.h"
+#include "zpwr.h"
+
+#define DIAG "/dev/diag"
+#define NANO 1000000000ULL
+#define NUMUNIT 5
+#define NAMELEN 8
+#define COMPWIDTH 27
+#define OPT_FORMAT 256
+
+enum part_power {
+ CPU,
+ STORAGE,
+ IO,
+ MAX_PM_PARTITION,
+};
+
+enum cpc_power {
+ TOTAL,
+ UNASSIGNED,
+ INFRA,
+ MAX_PM_CPC,
+};
+
+struct zpwrinfo {
+ u64 part[MAX_PM_PARTITION];
+ u64 cpc[MAX_PM_CPC];
+ bool pvalid;
+ bool cvalid;
+};
+
+static const char *simplefmt_part[MAX_PM_PARTITION] = {
+ "LPAR CPU:",
+ "LPAR Storage:",
+ "LPAR I/O:",
+};
+
+static const char *simplefmt_cpc[MAX_PM_CPC] = {
+ "CPC Total:",
+ "CPC Unassigned Resources:",
+ "CPC Infrastructure:",
+};
+
+static const char *complexfmt_part[MAX_PM_PARTITION] = {
+ "cpu",
+ "storage",
+ "io",
+};
+
+static const char *complexfmt_cpc[MAX_PM_CPC] = {
+ "total",
+ "unassigned_resources",
+ "infrastructure",
+};
+
+static const struct util_prg prg = {
+ .desc = "Power readings of s390 computing environment",
+ .copyright_vec = {
+ {
+ .owner = "IBM Corp.",
+ .pub_first = 2025,
+ .pub_last = 2025,
+ },
+ UTIL_PRG_COPYRIGHT_END
+ }
+};
+
+static struct util_opt opt_vec[] = {
+ UTIL_OPT_SECTION("OPTIONS"),
+ {
+ .option = { "format", required_argument, NULL, OPT_FORMAT },
+ .argument = "FORMAT",
+ .flags = UTIL_OPT_FLAG_NOSHORT,
+ .desc = "List data in specified FORMAT (" FMT_TYPE_NAMES ")",
+ },
+ {
+ .option = { "delay", required_argument, NULL, 'd' },
+ .argument = "NUMBER",
+ .desc = "Power readings after delay (seconds)",
+ },
+ {
+ .option = { "count", required_argument, NULL, 'c' },
+ .argument = "NUMBER",
+ .desc = "Number of power readings",
+ },
+ {
+ .option = { "stream", no_argument, NULL, 's' },
+ .desc = "Power readings in stream mode",
+ },
+ UTIL_OPT_HELP,
+ UTIL_OPT_VERSION,
+ UTIL_OPT_END
+};
+
+static int get_max_column_width(struct zpwrinfo *pinfo)
+{
+ u64 max = 0;
+ int i, col;
+
+ for (i = 0; i < MAX_PM_PARTITION; i++) {
+ if (pinfo->part[i] > max)
+ max = pinfo->part[i];
+ }
+ for (i = 0; i < MAX_PM_CPC; i++) {
+ if (pinfo->cpc[i] > max)
+ max = pinfo->cpc[i];
+ }
+ col = (int)log10((double)max) + 1;
+ /* power unit and space consideration */
+ col += 3;
+ return col;
+}
+
+static char *get_human_readable_unit(u64 val)
+{
+ const char *unitstr[NUMUNIT] = { "uW", "mW", " W", "kW", "MW" };
+ int exponent[NUMUNIT] = { 1, 3, 6, 9, 12 }, unitindex = 0, i;
+ double res, smallestres = (double)val;
+ char *buf;
+
+ for (i = 1; i < NUMUNIT; i++) {
+ res = (double)val / pow(10, exponent[i]);
+ if ((u64)res && res < smallestres) {
+ smallestres = res;
+ unitindex = i;
+ }
+ }
+ util_asprintf(&buf, "%.2f %s", smallestres, unitstr[unitindex]);
+ return buf;
+}
+
+static double get_human_readable_interval(u64 val, bool *seconds)
+{
+ double res;
+
+ res = (double)val / pow(10, 9);
+ if ((u64)res)
+ *seconds = true;
+ else
+ *seconds = false;
+ return *seconds ? res : (double)val;
+}
+
+/* From linux arch/s390/include/asm/timex.h */
+static unsigned long tod_to_ns(unsigned long todval)
+{
+ return ((todval >> 9) * 125) + (((todval & 0x1ff) * 125) >> 9);
+}
+
+static void reset_zpwrinfo(struct zpwrinfo *pinfo, struct pib *pib,
+ unsigned long buffersize)
+{
+ memset(pinfo, 0, sizeof(*pinfo));
+ memset(pib, 0, buffersize);
+}
+
+static void print_zpwrinfo(struct zpwrinfo *pinfo, u64 iteration,
+ int fmt_specified, u64 interval)
+{
+ enum util_fmt_mflags_t fmt_mflags = FMT_DEFAULT;
+ bool secondflag = false;
+ struct timespec ts;
+ char timestr[30];
+ char *simplestr;
+ int i, colwidth;
+ struct tm *tm;
+
+ if (!fmt_specified) {
+ colwidth = get_max_column_width(pinfo);
+ for (i = 0; i < MAX_PM_PARTITION; i++) {
+ if (!pinfo->pvalid)
+ break;
+ printf("%-*s", COMPWIDTH, simplefmt_part[i]);
+ simplestr = get_human_readable_unit(pinfo->part[i]);
+ printf("%*s\n", colwidth, simplestr);
+ free(simplestr);
+ }
+ printf("\n");
+ for (i = 0; i < MAX_PM_CPC; i++) {
+ if (!pinfo->cvalid)
+ break;
+ printf("%-*s", COMPWIDTH, simplefmt_cpc[i]);
+ simplestr = get_human_readable_unit(pinfo->cpc[i]);
+ printf("%*s\n", colwidth, simplestr);
+ free(simplestr);
+ }
+ printf("\n");
+ printf("Update interval: %.2f %s\n",
+ get_human_readable_interval(interval, &secondflag),
+ secondflag ? "s" : "ns");
+ return;
+ }
+ clock_gettime(CLOCK_REALTIME, &ts);
+ tm = localtime(&ts.tv_sec);
+ strftime(timestr, sizeof(timestr), "%F %T%z", tm);
+ util_fmt_obj_start(FMT_ROW, "iteration");
+ util_fmt_pair(fmt_mflags, "iteration", "%llu", iteration);
+ util_fmt_pair(fmt_mflags, "time", "%s", timestr);
+ util_fmt_pair(fmt_mflags, "time_epoch_sec", "%lld", ts.tv_sec);
+ util_fmt_pair(fmt_mflags, "time_epoch_nsec", "%ld", ts.tv_nsec);
+ util_fmt_pair(fmt_mflags, "update_interval", "%llu", interval);
+ util_fmt_obj_start(FMT_LIST, "lpar");
+ for (i = 0; i < MAX_PM_PARTITION; i++)
+ util_fmt_pair(pinfo->pvalid ? fmt_mflags : fmt_mflags | FMT_INVAL,
+ complexfmt_part[i], "%llu", pinfo->part[i]);
+ util_fmt_obj_end(); /* End of lpar list */
+ util_fmt_obj_start(FMT_LIST, "cpc");
+ for (i = 0; i < MAX_PM_CPC; i++)
+ util_fmt_pair(pinfo->cvalid ? fmt_mflags : fmt_mflags | FMT_INVAL,
+ complexfmt_cpc[i], "%llu", pinfo->cpc[i]);
+ util_fmt_obj_end(); /* End of cpc list */
+ util_fmt_obj_end(); /* End of iteration row */
+}
+
+static int read_zpwrinfo(struct zpwrinfo *pinfo, struct pib *pib)
+{
+ struct pib_prologue *prologue;
+ int i, comp, max = 0, rc = 0;
+ u64 *curr_zpwrinfo;
+ u8 *metrics;
+ void *ptr;
+
+ ptr = (u8 *)pib + pib->hlen;
+ prologue = ptr;
+ for (i = 0; i < pib->num; i++) {
+ metrics = (u8 *)prologue + sizeof(*prologue);
+ if (prologue->format == 0) {
+ curr_zpwrinfo = pinfo->part;
+ max = MAX_PM_PARTITION;
+ pinfo->pvalid = true;
+ } else if (prologue->format == 1) {
+ curr_zpwrinfo = pinfo->cpc;
+ max = MAX_PM_CPC;
+ pinfo->cvalid = true;
+ } else {
+ rc = -EINVAL;
+ warnx("Unknown format detected:%d\n", prologue->format);
+ break;
+ }
+ metrics += NAMELEN;
+ for (comp = 0; comp < max; comp++) {
+ memcpy(&curr_zpwrinfo[comp], metrics, sizeof(u64));
+ metrics += sizeof(u64);
+ }
+ ptr = (u8 *)prologue + prologue->len;
+ prologue = ptr;
+ }
+ return rc;
+}
+
+static void fmt_start(enum util_fmt_t fmt, unsigned int fmt_flags,
+ int fmt_specified)
+{
+ if (!fmt_specified)
+ return;
+ util_fmt_init(stdout, fmt, fmt_flags, 1);
+ if (fmt != FMT_JSONSEQ)
+ util_fmt_obj_start(FMT_LIST, "zpwr");
+}
+
+static void fmt_end(enum util_fmt_t fmt, int fmt_specified)
+{
+ if (!fmt_specified)
+ return;
+ if (fmt != FMT_JSONSEQ)
+ util_fmt_obj_end(); /* zpwr[] */
+ util_fmt_exit();
+}
+
+int main(int argc, char *argv[])
+{
+ enum util_fmt_flags_t fmt_flags = FMT_HANDLEINT | FMT_QUOTEALL | FMT_KEEPINVAL;
+ int ch, fd, rc = EXIT_FAILURE, fmt_specified = 0;
+ bool stream = false, init = true;
+ enum util_fmt_t fmt = FMT_JSON;
+ u64 init_seq, interval = 0;
+ long count = 0, delay = 0;
+ struct diag324_pib data;
+ struct zpwrinfo *pinfo;
+ struct timespec ts;
+ size_t buffersize;
+ struct pib *pib;
+ struct stat st;
+
+ util_prg_init(&prg);
+ util_opt_init(opt_vec, NULL);
+ while (1) {
+ ch = util_opt_getopt_long(argc, argv);
+ if (ch == -1)
+ break;
+ switch (ch) {
+ case 'c':
+ errno = 0;
+ count = strtoul(optarg, NULL, 0);
+ if (errno || count <= 0)
+ errx(EXIT_FAILURE, "Positive number expected for option -%c", ch);
+ break;
+ case 'd':
+ errno = 0;
+ delay = strtoul(optarg, NULL, 0);
+ if (errno || delay <= 0)
+ errx(EXIT_FAILURE, "Positive number expected for option -%c", ch);
+ break;
+ case 's':
+ stream = true;
+ break;
+ case OPT_FORMAT:
+ if (!util_fmt_name_to_type(optarg, &fmt)) {
+ errx(EXIT_FAILURE, "Supported formats: %s", FMT_TYPE_NAMES);
+ } else {
+ if (fmt == FMT_CSV)
+ fmt_flags |= FMT_NOMETA;
+ else
+ fmt_flags |= FMT_DEFAULT;
+ fmt_specified = 1;
+ }
+ break;
+ case 'h':
+ util_prg_print_help();
+ util_opt_print_help();
+ return EXIT_SUCCESS;
+ case 'v':
+ util_prg_print_version();
+ return EXIT_SUCCESS;
+ default:
+ util_opt_print_parse_error(ch, argv);
+ return EXIT_FAILURE;
+ }
+ }
+ if (stream && delay)
+ errx(EXIT_FAILURE, "-s and -d option are mutually exclusive");
+ if (count && !delay && !stream)
+ errx(EXIT_FAILURE, "-c option can only be used in conjunction with -d or -s");
+ if (stat(DIAG, &st) == -1)
+ errx(EXIT_FAILURE, "Missing kernel support to retrieve power readings");
+ fd = open(DIAG, O_RDONLY);
+ if (fd < 0)
+ err(EXIT_FAILURE, "Open failed: %s", DIAG);
+ rc = ioctl(fd, DIAG324_GET_PIBLEN, &buffersize);
+ if (rc && errno == EOPNOTSUPP) {
+ warnx("The machine does not support retrieving power readings");
+ goto out;
+ } else if (rc) {
+ warn("Ioctl (DIAG324_GET_PIBLEN) failed");
+ goto out;
+ }
+ pinfo = calloc(1, sizeof(*pinfo));
+ if (!pinfo) {
+ warnx("Allocation of pinfo failed");
+ goto out;
+ }
+ pib = calloc(1, buffersize);
+ if (!pib) {
+ free(pinfo);
+ warnx("Allocation of pib failed");
+ goto out;
+ }
+ data.address = (u64)pib;
+ fmt_start(fmt, fmt_flags, fmt_specified);
+ while (true) {
+ rc = ioctl(fd, DIAG324_GET_PIBBUF, &data);
+ if (rc != 0 && errno != EBUSY) {
+ warn("Ioctl (DIAG324_GET_PIBBUF) failed");
+ goto out_free;
+ }
+ rc = read_zpwrinfo(pinfo, pib);
+ if (rc)
+ goto out_free;
+ if (init) {
+ init_seq = data.sequence;
+ init = false;
+ }
+ interval = tod_to_ns(pib->intv);
+ print_zpwrinfo(pinfo, data.sequence - init_seq, fmt_specified, interval);
+ reset_zpwrinfo(pinfo, pib, buffersize);
+ if (stream) {
+ ts.tv_sec = interval / NANO;
+ ts.tv_nsec = interval % NANO;
+ } else {
+ ts.tv_sec = delay;
+ ts.tv_nsec = 0;
+ }
+ if ((stream || delay) && !count) {
+ nanosleep(&ts, NULL);
+ continue;
+ } else if (--count > 0) {
+ nanosleep(&ts, NULL);
+ continue;
+ } else {
+ break;
+ }
+ }
+ fmt_end(fmt, fmt_specified);
+out_free:
+ free(pinfo);
+ free(pib);
+out:
+ close(fd);
+ return rc ? EXIT_FAILURE : EXIT_SUCCESS;
+}
diff --git a/zpwr/zpwr.h b/zpwr/zpwr.h
new file mode 100644
index 00000000..00052723
--- /dev/null
+++ b/zpwr/zpwr.h
@@ -0,0 +1,46 @@
+/*
+ * zpwr - display power readings of s390 computing environment.
+ *
+ * ioctls for diag324 and structures definitions.
+ *
+ * Copyright IBM Corp. 2025
+ *
+ * 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 ZPWR_H
+#define ZPWR_H
+
+#include <linux/types.h>
+
+#define DIAG_MAGIC_STR 'D'
+
+struct pib {
+ __u32 : 8;
+ __u32 num : 8;
+ __u32 len : 16;
+ __u32 : 24;
+ __u32 hlen : 8;
+ __u64 : 64;
+ __u64 intv;
+ __u8 r[];
+} __packed;
+
+struct pib_prologue {
+ __u64 format : 4;
+ __u64 : 20;
+ __u64 len : 8;
+ __u64 : 32;
+};
+
+struct diag324_pib {
+ __u64 address;
+ __u64 sequence;
+};
+
+/* Diag ioctl definitions */
+#define DIAG324_GET_PIBBUF _IOWR(DIAG_MAGIC_STR, 0x77, struct diag324_pib)
+#define DIAG324_GET_PIBLEN _IOR(DIAG_MAGIC_STR, 0x78, size_t)
+
+#endif /* ZPWR_H */

View File

@ -0,0 +1,271 @@
From 05f0aeb61e511dc4048105593b2e980acc4dbf6a Mon Sep 17 00:00:00 2001
From: Sumanth Korikkar <sumanthk@linux.ibm.com>
Date: Wed, 8 Jan 2025 08:57:03 +0100
Subject: [PATCH] zpwr: Add man page for zpwr tool
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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>
---
zpwr/Makefile | 2 +
zpwr/man/zpwr.1 | 232 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 234 insertions(+)
create mode 100644 zpwr/man/zpwr.1
diff --git a/zpwr/Makefile b/zpwr/Makefile
index 02581a68..c56dee26 100644
--- a/zpwr/Makefile
+++ b/zpwr/Makefile
@@ -15,7 +15,9 @@ zpwr: $(OBJECTS) $(rootdir)/libutil/libutil.a -lm
install: all
$(INSTALL) -d -m 755 $(DESTDIR)$(USRBINDIR)
+ $(INSTALL) -d -m 755 $(DESTDIR)$(MANDIR)/man1
$(INSTALL) -g $(GROUP) -o $(OWNER) -m 755 zpwr $(DESTDIR)$(USRBINDIR)
+ $(INSTALL) -g $(GROUP) -o $(OWNER) -m 644 man/zpwr.1 $(DESTDIR)$(MANDIR)/man1
clean:
rm -f *.o *~ zpwr core
diff --git a/zpwr/man/zpwr.1 b/zpwr/man/zpwr.1
new file mode 100644
index 00000000..deaceafe
--- /dev/null
+++ b/zpwr/man/zpwr.1
@@ -0,0 +1,232 @@
+.\" Copyright 2025 IBM Corp.
+.\" s390-tools is free software; you can redistribute it and/or modify
+.\" it under the terms of the MIT license. See LICENSE for details.
+.\"
+.ds c \fBzpwr\fP
+.TH zpwr 1 "Feb 2025" "s390-tools" zpwr
+.SH NAME
+zpwr \- Display power readings of a partition and central processor complex
+(CPC) on an IBM Z or LinuxONE server.
+.SH SYNOPSIS
+.sp
+.nf
+\fIzpwr\fR
+ [\-d <NUMBER> | \-\-delay=<NUMBER>] [\-c <NUMBER> | \-\-count=<NUMBER>]
+ [\-\-format=<STRING>]
+ [\-s | \-\-stream]
+ [\-v | \-\-version]
+ [\-h | \-\-help]
+.fi
+.SH DESCRIPTION
+.sp
+zpwr displays power readings of a partition and central processor complex
+(CPC) on an IBM Z or LinuxONE server.
+.sp
+Partition readings include CPU, storage and I/O power readings. It specifies
+the number of units allocated to the configuration at the time the reading was
+taken.
+.sp
+CPC readings include total, unassigned resources and infrastructure power
+readings.
+.sp
+Power reading units are automatically presented in a human readable format,
+whereas complex formats like json, csv, json-seq, pairs display the power
+readings in microwatts.
+.sp
+CPC power readings can be retrieved only when the required authorization was
+set for the LPAR. Enable the required authorization by setting "Global
+Performance Data" in LPAR's activation profile.
+.sp
+If the power readings cannot be retrieved, the power readings return an empty
+string or null in complex formats, and the power readings are not displayed in
+human readable format.
+.SH OPTIONS
+.PP
+\-\-format=<STRING>
+.RS 4
+Retrieve power readings in the following formats: json, csv,
+json-seq or pairs. If no format is specified in the command, the output will
+default to the human readable format.
+.sp
+When the format is json, csv, json-seq or pairs, the power readings are
+displayed in microwatts.
+.RE
+.PP
+\-d, \-\-delay
+.RS 4
+Retrieve power readings after specified delay in seconds has elapsed.
+.RE
+.PP
+\-c <NUMBER>, \-\-count=<NUMBER>
+.RS 4
+Required number of power readings.
+.sp
+The \-\-count option can only be used in conjunction with \-\-stream or
+\-\-delay option.
+.RE
+.PP
+\-s, \-\-stream
+.RS 4
+Retrieve power readings in stream mode. A new power reading will be displayed
+only after an interval has elapsed since the last power reading request.
+The interval is automatically calculated in stream mode.
+.sp
+The \-\-stream and \-\-delay options are mutually exclusive.
+.RE
+.PP
+\-v, \-\-version
+.RS 4
+Print version information.
+.RE
+.PP
+\-h, \-\-help
+.RS 4
+Print usage information.
+.RE
+.SH OUTPUT
+.B Iteration
+.RS 4
+Iteration number of the current power readings. If the power reading is
+requested before the time interval has elapsed, cached power readings might be
+returned. The iteration number helps to determine if the cached power readings
+are provided.
+.RE
+.PP
+.B Time
+.RS 4
+The time at which power readings were taken, expressed in human readable format.
+.RE
+.PP
+.B Time epoch
+.RS 4
+The time at which power readings were taken, expressed in epoch time.
+.PP
+.B sec
+.RS 4
+The number of seconds elapsed since the Unix epoch.
+.RE
+.PP
+.B nsec
+.RS 4
+The number of nanoseconds elapsed since the last full seconds.
+.RE
+.RE
+.PP
+.B Update interval
+.RS 4
+Indicates the time interval in nanoseconds after which new power readings are
+available. If the power readings is requested before the time interval has
+elapsed, cached power readings might be returned.
+.RE
+.PP
+.B CPU
+.RS 4
+CPU power reading of a partition.
+.RE
+.PP
+.B Storage
+.RS 4
+Storage power reading of a partition.
+.RE
+.PP
+.B I/O
+.RS 4
+I/O power reading of a partition.
+.RE
+.PP
+.B Total
+.RS 4
+Specifies number of units for all electrical and mechanical components of the
+system.
+.RE
+.PP
+.B Unassigned Resources
+.RS 4
+Specifies number of units for all types of resources in the standby state or
+reserved state at the time the reading was taken.
+.RE
+.PP
+.B Infrastructure
+.RS 4
+Specifies number of units for all subsystems in the CPC which do not provide
+CPU, storage or I/O resources to partitions.
+.RE
+.SH "EXAMPLES"
+1. Display power readings in human readable format.
+.nf
+.ft CW
+# zpwr
+LPAR CPU: 140.00 W
+LPAR Storage: 1.72 W
+LPAR I/O: 40.00 W
+
+CPC Total: 15.40 kW
+CPC Unassigned Resources: 7.48 kW
+CPC Infrastructure: 5.31 kW
+
+Update interval: 10.00 s
+.ft
+.fi
+.sp 1
+2. Perform two power measurements with a delay of 10 seconds and output the
+data in json format.
+.nf
+.ft CW
+# zpwr --format json --delay 10 --count 2
+{
+ "meta": {
+ "api_level": "1",
+ "version": "2.36.0-build-20250107",
+ "host": "lpar001",
+ "time_epoch": "1736316898",
+ "time": "2025-01-08 07:14:58+0100"
+ },
+ "zpwr": [
+ {
+ "iteration": "0",
+ "time": "2025-01-08 07:14:58+0100",
+ "time_epoch_sec": "1736316898",
+ "time_epoch_nsec": "10935887",
+ "update_interval": "10000000000",
+ "lpar": [
+ "cpu": "140000000",
+ "storage": "1719200",
+ "io": "40000000"
+ ],
+ "cpc": [
+ "total": "15406000000",
+ "unassigned_resources": "7578848100",
+ "infrastructure": "5283946300"
+ ]
+ },
+ {
+ "iteration": "1",
+ "time": "2025-01-08 07:15:08+0100",
+ "time_epoch_sec": "1736316908",
+ "time_epoch_nsec": "11113153",
+ "update_interval": "10000000000",
+ "lpar": [
+ "cpu": "140000000",
+ "storage": "1719200",
+ "io": "40000000"
+ ],
+ "cpc": [
+ "total": "15401000000",
+ "unassigned_resources": "7569928400",
+ "infrastructure": "5284866000"
+ ]
+ }
+ ]
+}
+.ft
+.fi
+.sp 1
+3. Display power readings in csv format and in stream mode.
+.nf
+.ft CW
+# zpwr --format csv --stream
+"iteration","time","time_epoch_sec","time_epoch_nsec","update_interval","cpu","storage","io","total","unassigned_resources","infrastructure"
+"0","2025-01-08 07:17:05+0100","1736317025","592784684","10000000000","143000000","1708200","40000000","15550000000","7659162700","5337186700"
+"1","2025-01-08 07:17:15+0100","1736317035","592937261","10000000000","143000000","1708200","40000000","15533000000","7650389100","5328960300"
+.ft
+.fi

View File

@ -1,51 +0,0 @@
From 6a55d0c2e57952600164822dd100e8247b4b010f Mon Sep 17 00:00:00 2001
From: Steffen Eiden <seiden@linux.ibm.com>
Date: Fri, 23 Aug 2024 09:16:26 +0200
Subject: [PATCH] rust/pv: Lower most lints to warn
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Lower the lint level to warn for the styling lints.
This avoids compile issues during packaging for newer tooling with
potential more lint findings.
Still deny compiling if a public symbol has no documentation.
Fixes: https://github.com/ibm-s390-linux/s390-tools/issues/173
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
---
rust/pv/src/lib.rs | 4 ++--
rust/pv_core/src/lib.rs | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/rust/pv/src/lib.rs b/rust/pv/src/lib.rs
index 9a647617..1084f8e8 100644
--- a/rust/pv/src/lib.rs
+++ b/rust/pv/src/lib.rs
@@ -2,8 +2,8 @@
//
// Copyright IBM Corp. 2023, 2024
-#![deny(
- missing_docs,
+#![deny(missing_docs)]
+#![warn(
missing_debug_implementations,
trivial_numeric_casts,
unstable_features,
diff --git a/rust/pv_core/src/lib.rs b/rust/pv_core/src/lib.rs
index 1356c1b7..b617b8f9 100644
--- a/rust/pv_core/src/lib.rs
+++ b/rust/pv_core/src/lib.rs
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
//
// Copyright IBM Corp. 2023, 2024
-#![deny(
- missing_docs,
+#![deny(missing_docs)]
+#![warn(
missing_debug_implementations,
trivial_numeric_casts,
unstable_features,

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ea4758c4e460d7f7e040e6aedf68b1be32d63fecb733358b08182f6b9b7440a2
size 2114507

BIN
s390-tools-2.37.0.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -1,3 +1,225 @@
-------------------------------------------------------------------
Mon Feb 24 06:51:08 UTC 2025 - Nikolay Gueorguiev <nikolay.gueorguiev@suse.com>
- Applied additional patches (jsc#PED-10303 (IBM-1575))
* s390-tools-01-Add-zpwr-tool.patch
* s390-tools-02-zpwr-Add-man-page-for-zpwr-tool.patch
-------------------------------------------------------------------
Mon Feb 10 07:36:08 UTC 2025 - Nikolay Gueorguiev <nikolay.gueorguiev@suse.com>
- Upgrade s390-tools to 2.37 (jsc#PED-9591, jsc#PED-10303, jesc#PED-11870 (jsc#IBM-1062))
* Changes of existing tools:
dbginfo.sh: Add details on CPU-measurement
dbginfo.sh: Add new crypto command
dbginfo.sh: Add overview commands and crypto update
dbginfo.sh: Adding kdump info
dbginfo.sh: Removing outdated email references
dbginfo.sh: Rework network section
dbginfo.sh: Update copyright 2nd year
pvimg: Add '--(enable|disable)-image-encryption' flags to 'pvimg create'
pvimg: Add '--cck ' command line option and make '--comm-key' an alias
pvimg: Add '--hdr-key' command line option to 'pvimg create'
pvimg: Rename '--key' into '--hdr-key' and use '--key' as an alias (for 'pvimg info')
pvsecret: Add support for retrievable secrets
ziorep_config: Add PCHID field to adapter report
ziorep_traffic: Add DEVBUSID column to traffic report
ziorep_utilization: Add --fcp-device parameter to print virtual adapter report
ziorep_utilization: Add PCHID column to physical adapter report
ziorep_utilization: Now prints only physical adapter report by default
ziorep_utilization: Swap Bus-ID and CHPID columns in virtual adapter report
zipl/boot: Increase section size for eckd_mv dumper
zkey: Add support for listing and importing protected virtualization secrets
* Bug Fixes:
chpstat: Fix invalid utilization data on older kernels
opticsmon: Fix runaway loop in on_link_change()
zipl: Update inline assembly for GCC 15
zipl_helper.device-mapper: Add missed step in logical device resolution
- Revendored vendor.tar.gz
- Removed obsolete patches:
* s390-tools-01-zipl_helper.device-mapper-add-missed-step-in-logical.patch
* s390-tools-02-zipl-src-fix-imprecise-check-that-file-is-on-specifi.patch
* s390-tools-General-update-01.patch
* s390-tools-General-update-02.patch
* s390-tools-General-update-03.patch
* s390-tools-General-update-04.patch
* s390-tools-General-update-05.patch
* s390-tools-General-update-06.patch
* s390-tools-General-update-07.patch
* s390-tools-General-update-08.patch
* s390-tools-General-update-09.patch
* s390-tools-General-update-10.patch
* s390-tools-General-update-11.patch
* s390-tools-General-update-12.patch
* s390-tools-Additional-update-01.patch
* s390-tools-Additional-update-02.patch
* s390-tools-pvimg-info-command-01.patch
* s390-tools-pvimg-info-command-02.patch
* s390-tools-pvimg-info-command-03.patch
* s390-tools-Support-unencrypted-SE-images-01.patch
* s390-tools-pvimg-info-command-04.patch
* s390-tools-pvimg-additional-01.patch
* s390-tools-01-zkey-Add-support-for-retrieving-a-list-of-ultravisor-secrets.patch
* s390-tools-02-zkey-Add-the--pvsecrets-list-command.patch
* s390-tools-03-zkey-Add-PVSECRETS-AES-key-type.patch
* s390-tools-04-zkey-Add-the-pvsecrets-import-command.patch
* s390-tools-05-zkey-Reject-key-generation-and-APQN-association-for-PVSECRET-AES-keys.patch
* s390-tools-06-zkey-Reject-re-enciphering-of-PVSECRET-AES-keys.patch
* s390-tools-07-zkey-Support-validation-of-key-of-type-PVSECRET-AES.patch
* s390-tools-08-rust-pvimg-Fix-flag-parsing-for-allowing-dump.patch
* s390-tools-09-rust-pvimg-Document-the-change-from--comm-key-to--cck.patch
-------------------------------------------------------------------
Mon Feb 3 07:51:27 UTC 2025 - Nikolay Gueorguiev <nikolay.gueorguiev@suse.com>
- Applied more additional patches (jsc#PED-11870, jec#PED-11958)
* s390-tools-08-rust-pvimg-Fix-flag-parsing-for-allowing-dump.patch
* s390-tools-09-rust-pvimg-Document-the-change-from--comm-key-to--cck.patch
-------------------------------------------------------------------
Thu Jan 30 08:19:47 UTC 2025 - Nikolay Gueorguiev <nikolay.gueorguiev@suse.com>
- Applied additional patches ( jsc#PED-9561 ( jsc#IBM-1447 ) )
* s390-tools-01-zkey-Add-support-for-retrieving-a-list-of-ultravisor-secrets.patch
* s390-tools-02-zkey-Add-the--pvsecrets-list-command.patch
* s390-tools-03-zkey-Add-PVSECRETS-AES-key-type.patch
* s390-tools-04-zkey-Add-the-pvsecrets-import-command.patch
* s390-tools-05-zkey-Reject-key-generation-and-APQN-association-for-PVSECRET-AES-keys.patch
* s390-tools-06-zkey-Reject-re-enciphering-of-PVSECRET-AES-keys.patch
* s390-tools-07-zkey-Support-validation-of-key-of-type-PVSECRET-AES.patch
- Revendored vendor.tar.gz
-------------------------------------------------------------------
Thu Jan 9 07:05:53 UTC 2025 - Nikolay Gueorguiev <nikolay.gueorguiev@suse.com>
- Applied backport patches from s390-tools 2.37 to 2.36 ( jsc#PED-11870 )
( jsc#IBM-1447, jsc#IBM-1062 )
* s390-tools-General-update-01.patch
* s390-tools-General-update-02.patch
* s390-tools-General-update-03.patch
* s390-tools-General-update-04.patch
* s390-tools-General-update-05.patch
* s390-tools-General-update-06.patch
* s390-tools-General-update-07.patch
* s390-tools-General-update-08.patch
* s390-tools-General-update-09.patch
* s390-tools-General-update-10.patch
* s390-tools-General-update-11.patch
* s390-tools-General-update-12.patch
* s390-tools-Additional-update-01.patch
* s390-tools-Additional-update-02.patch
( jsc#IBM-1570, jsc#IBM-1571 )
* s390-tools-Support-unencrypted-SE-images-01.patch
( jsc#IBM-1572, jsc#IBM-1573 )
* s390-tools-pvimg-info-command-01.patch
* s390-tools-pvimg-info-command-02.patch
* s390-tools-pvimg-info-command-03.patch
* s390-tools-pvimg-info-command-04.patch
( jsc#IBM-1576, jsc#IBM-1577 )
* s390-tools-pvimg-additional-01.patch
- Renamed patches from - to
* s390-tools-01-opticsmon-Fix-runaway-loop-in-on_link_change.patch
to
s390-tools-Additional-update-01.patch
* s390-tools-02-libzpci-opticsmon-Refactor-on_link_change-using-new.patch
to
s390-tools-Additional-update-02.patch
* s390-tools-03-rust-pvimg-Add-enable-disable-image-encryption-flags-to-pvimg-create.patch
to
s390-tools-Support-unencrypted-SE-images-01.patch
- Revendored vendor.tar.gz
-------------------------------------------------------------------
Tue Jan 7 08:59:16 UTC 2025 - Nikolay Gueorguiev <nikolay.gueorguiev@suse.com>
- Applied a patch for '--(enable|disable)-image-encryption' flags for 'pvimg create' (jsc#PED-11870)
* s390-tools-03-rust-pvimg-Add-enable-disable-image-encryption-flags-to-pvimg-create.patch
-------------------------------------------------------------------
Tue Dec 31 09:59:27 UTC 2024 - Nikolay Gueorguiev <nikolay.gueorguiev@suse.com>
- Applied patches (jsc#PED-9591, jsc#PED-10303)
* s390-tools-01-opticsmon-Fix-runaway-loop-in-on_link_change.patch
* s390-tools-02-libzpci-opticsmon-Refactor-on_link_change-using-new.patch
-------------------------------------------------------------------
Mon Dec 9 09:49:52 UTC 2024 - Nikolay Gueorguiev <nikolay.gueorguiev@suse.com>
- Upgrade s390-tools to version 2.36 (jsc#PED-10303, jsc#PED-9591)
* s390-tools: Define Rust MSRV as 1.75.0
* Add new tools / libraries:
- cpacfinfo: Tool to provide CPACF information
- opticsmon: Tools to monitor optical modules for directly attached PCI based NICs
- pvimg: Rust rewrite of genprotimg
* Changes of existing tools:
- chpstat: Add data bandwidth utilization column
- chpstat: Add support for full CMCB
- chpstat: Add support for new CMG types
- dbginfo.sh: add overview commands and crypto update
- hyptop: Support for structured output (json, json-seq, csv)
- lszfcp: Add missing fallback marker for non-good fc_host port_state
- lszfcp: Improve speed with many SCSI devices
- pvattest: Add attestation policy check command
- zipl: Add support of partitions of mirror md-devices
* Bug Fixes:
- lszcrypt: Fix wrong state showing up for removed AP queue within SE guest
- lszfcp: Show device names line for zfcp_units without SCSI device
- Revendored vendor.tar.gz
- Applied additional patch (bsc#1233889, bsc#1233079)
* s390-tools-02-zipl-src-fix-imprecise-check-that-file-is-on-specifi.patch
-------------------------------------------------------------------
Thu Dec 5 15:13:49 UTC 2024 - Nikolay Gueorguiev <nikolay.gueorguiev@suse.com>
- Applied a patch (bsc#1233889)
* s390-tools-01-zipl_helper.device-mapper-add-missed-step-in-logical.patch
- Amended the /usr/lib/modules-load.d/pkey.conf (bsc#1233233). Added
* pkey_cca
* pkey_ep11
* pkey_pckmo
-------------------------------------------------------------------
Tue Nov 5 07:39:58 UTC 2024 - Nikolay Gueorguiev <nikolay.gueorguiev@suse.com>
- Amended the *_configure scripts to update again the SUSE's specific file
'/boot/zipl/active_devices.txt' (bsc#1232474, bsc#1216257)
* ctc_configure
* dasd_configure
* qeth_configure
* zfcp_host_configure
-------------------------------------------------------------------
Tue Oct 8 10:35:04 UTC 2024 - Nikolay Gueorguiev <nikolay.gueorguiev@suse.com>
* Upgrade s390-tools to version 2.35 (jsc#PED-9591, jsc#PED-10303)
* Changes of existing tools:
- cpacfstats: Add support for FULL XTS (MSA 10) and HMAC (MSA 11) PAI counter
- cpuplugd: Make cpuplugd compatible with hiperdispatch
- dbginfo.sh: Add network sockstat info
- pvapconfig: s390x exclusive build
- zdev: Add option to select IPL device
- zdump/dfo_s390: Support s390 DFO for vr-kernel dumps
- zipl: Add support of mirror devices
* Bug Fixes:
- (genprotimg|zipl)/boot: discard .note.package ELF section to save memory
- netboot/mk-s390image: Fix size when argument is a symlink
- ziorep_config: Fix warning message when multipath device is not there.
- zipl: Fix problems when target parameters are specified by user
- zipl: Fix segfault when creating device-based dumps with '--dry-run'
* Removed obsolete patches
- s390-tools-2.34-Fix-Rust-compilation-errors.patch
- s390-tools-01-zipl-src-add-basic-support-for-multiple-target-base-disks.patch
- s390-tools-02-zipl-src-add-basic-support-for-multiple-target-base-disks.patch
* Revendored vendor.tar.gz
-------------------------------------------------------------------
Mon Sep 16 12:49:55 UTC 2024 - Nikolay Gueorguiev <nikolay.gueorguiev@suse.com>
* Applied patches (bsc#1230345)
- zipl/src: add basic support for multiple target base disks
- s390-tools-01-zipl-src-add-basic-support-for-multiple-target-base-disks.patch
- s390-tools-02-zipl-src-add-basic-support-for-multiple-target-base-disks.patch
-------------------------------------------------------------------
Mon Aug 26 09:17:17 UTC 2024 - Nikolay Gueorguiev <nikolay.gueorguiev@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package s390-tools
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -33,7 +33,7 @@
%endif
Name: s390-tools
Version: 2.34.0
Version: 2.37.0
Release: 0
Summary: S/390 tools like zipl and dasdfmt for s390x (plus selected tools for x86_64)
License: MIT
@ -153,20 +153,24 @@ Patch910: s390-tools-sles15sp1-11-zdev-Do-not-call-zipl-on-initrd-update.p
Patch911: s390-tools-sles15sp5-remove-no-pie-link-arguments.patch
Patch912: s390-tools-ALP-zdev-live.patch
Patch913: s390-tools-sles15sp6-kdump-initrd-59-zfcp-compat-rules.patch
Patch914: s390-tools-slfo-01-parse-ipl-device-for-activation.patch
Patch915: s390-tools-2.34-Fix-Rust-compilation-errors.patch
###
Patch920: s390-tools-01-Add-zpwr-tool.patch
Patch921: s390-tools-02-zpwr-Add-man-page-for-zpwr-tool.patch
###
Patch990: s390-tools-slfo-01-parse-ipl-device-for-activation.patch
###
BuildRequires: curl-devel
BuildRequires: dracut
BuildRequires: fuse3-devel
BuildRequires: gcc13
BuildRequires: gcc13-c++
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: gettext-tools
BuildRequires: glib2-devel
BuildRequires: glibc-devel-static
BuildRequires: libcryptsetup-devel > 2.0.3
BuildRequires: libjson-c-devel
BuildRequires: libnl3-devel
BuildRequires: libxml2-devel
BuildRequires: mdevctl
BuildRequires: ncurses-devel
@ -225,12 +229,13 @@ zipl - boot loader and dump DASD initializer
zgetdump - tool to get linux system dumps from DASD
- x86_64
genprotimg - create a protected virtualization image
pvimg - create a protected virtualization image (genprotimg)
pvattest - create, perform, and verify protected virtualization attestation measurements
pvsecret - manage secrets for IBM Secure Execution guests.
pvapconfig - used to automatically set up the AP configuration within an IBM Secure Execution guest.
Note: Auxiliary data package - s390-tools-genprotimg-data
Warning: There is an auxiliary data package - s390-tools-genprotimg-data.
To install s390-tools properly, please use:
'sudo zypper install s390-tools s390-tools-genprotimg-data'
%package -n osasnmpd
Summary: OSA-Express SNMP subagent
@ -349,11 +354,11 @@ BuildArch: noarch
Requires(pre): filesystem
%description genprotimg-data
The genprotimg allows preparing and analyzing boot images
The pvimg (genprotimg) allows preparing and analyzing boot images
in the realm of IBM Secure Execution on a trusted environment,
such as the laptop of an admin by limiting the build targets
depending on the defined or detected host architecture.
This package provides auxiliary data used by genprotimg.
This package provides auxiliary data used by pvimg(genprotimg).
### *** s390x ************************************************************************* ###
%ifarch s390x
@ -363,7 +368,7 @@ This package provides auxiliary data used by genprotimg.
cp -vi %{SOURCE22} CAUTION
install -D -m 0644 %{SOURCE200} .cargo/config
install -D -m 0644 %{SOURCE200} .cargo/config.toml
tar -xzf %{SOURCE201}
%build
@ -380,11 +385,9 @@ export KERNELIMAGE_MAKEFLAGS="%%{?_smp_mflags}"
DISTRELEASE=%{release} \
UDEVRUNDIR=/run/udev \
HAVE_CARGO=1 \
HAVE_DRACUT=1 \
CC=gcc-13 \
CXX=g++-13
HAVE_DRACUT=1
### all
gcc-13 -static -o read_values ${OPT_FLAGS} %{SOURCE86} -lqc
gcc -static -o read_values ${OPT_FLAGS} %{SOURCE86} -lqc
%install
mkdir -p %{buildroot}/boot/zipl
@ -395,9 +398,7 @@ mkdir -p %{buildroot}%{_sysconfdir}/zkey/repository
SYSTEMDSYSTEMUNITDIR=%{_unitdir} \
UDEVRUNDIR=/run/udev \
HAVE_CARGO=1 \
HAVE_DRACUT=1 \
CC=gcc-13 \
CXX=g++-13
HAVE_DRACUT=1
### all
# The make install command puts things in /etc/sysconfig and not the
@ -719,7 +720,6 @@ done
%dir %{_prefix}/lib/systemd/scripts
%dir %{_datadir}/s390-tools
%dir %{_datadir}/s390-tools/netboot
%dir %{_datadir}/s390-tools/genprotimg
%dir %{_prefix}/lib/dracut/modules.d/95zdev
%dir %{_prefix}/lib/dracut/modules.d/95zdev-kdump
%dir %{_prefix}/lib/dracut/modules.d/96zdev-live
@ -742,8 +742,8 @@ done
%dir /etc/mdevctl.d/scripts.d/callouts/
###
%exclude /lib/s390-tools/stage3.bin
%exclude %{_datadir}/s390-tools/genprotimg/stage3a.bin
%exclude %{_datadir}/s390-tools/genprotimg/stage3b_reloc.bin
%exclude %{_datadir}/s390-tools/pvimg/stage3a.bin
%exclude %{_datadir}/s390-tools/pvimg/stage3b_reloc.bin
###
%files -n osasnmpd -f %{_builddir}/%{name}.osasnmp
@ -794,8 +794,9 @@ done
### genprotimg
%files genprotimg-data
/lib/s390-tools/stage3.bin
%{_datadir}/s390-tools/genprotimg/stage3a.bin
%{_datadir}/s390-tools/genprotimg/stage3b_reloc.bin
%dir %{_datadir}/s390-tools/pvimg
%{_datadir}/s390-tools/pvimg/stage3a.bin
%{_datadir}/s390-tools/pvimg/stage3b_reloc.bin
### _endif
### *** !s390x ************************************************************************* ###
@ -805,12 +806,13 @@ done
%prep
%autosetup -p1
install -D -m 0644 %{SOURCE200} .cargo/config
install -D -m 0644 %{SOURCE200} .cargo/config.toml
tar -xzf %{SOURCE201}
%build
export OPT_FLAGS="%{optflags}"
export KERNELIMAGE_MAKEFLAGS="%%{?_smp_mflags}"
%make_build \
DISTRELEASE=%{release} \
UDEVRUNDIR=/run/udev \
@ -818,6 +820,7 @@ export KERNELIMAGE_MAKEFLAGS="%%{?_smp_mflags}"
HAVE_DRACUT=1
%install
%make_install \
DISTRELEASE=%{release} \
SYSTEMDSYSTEMUNITDIR=%{_unitdir} \
@ -828,8 +831,8 @@ export KERNELIMAGE_MAKEFLAGS="%%{?_smp_mflags}"
%files
%{_prefix}/bin/*
%dir %{_datadir}/s390-tools
%dir %{_datadir}/s390-tools/genprotimg
%{_datadir}/s390-tools/genprotimg/check_hostkeydoc
%dir %{_datadir}/s390-tools/pvimg
%{_datadir}/s390-tools/pvimg/check_hostkeydoc
%{_mandir}/man1/*
%endif

BIN
vendor.tar.gz (Stored with Git LFS)

Binary file not shown.

View File

@ -38,6 +38,14 @@ debug_mesg () {
esac
}
add_cio_channel() {
echo "$* # ${DATE}" >> /boot/zipl/active_devices.txt
}
remove_cio_channel() {
[ -w /boot/zipl/active_devices.txt ] && sed -i -e "/^${1}/d" /boot/zipl/active_devices.txt
}
usage(){
echo "Usage: ${0} <ccwid> <online>"
echo " ccwid = x.y.ssss where"
@ -80,3 +88,8 @@ RC=${?}
if [ ${RC} -ne 0 ]; then
exit ${RC}
fi
if [ ${ON_OFF} == 1 ]; then
add_cio_channel "${CCW_CHAN_ID}"
else remove_cio_channel "${CCW_CHAN_ID}"
fi