diff --git a/.gitignore b/.gitignore index 29be767..4b33380 100644 --- a/.gitignore +++ b/.gitignore @@ -5,22 +5,5 @@ src_vipa-2.0.4.tar.gz /lib-zfcp-hbaapi-2.1.tar.gz /src_vipa-2.1.0.tar.gz /s390-tools-*.tar.bz2 -/s390-tools-2.0.0.tar.gz -/s390-tools-2.1.0.tar.gz -/s390-tools-2.2.0.tar.gz -/s390-tools-2.3.0.tar.gz -/s390-tools-2.4.0.tar.gz -/s390-tools-2.5.0.tar.gz -/s390-tools-2.6.0.tar.gz -/s390-tools-2.7.0.tar.gz -/s390-tools-2.7.1.tar.gz -/s390-tools-2.8.0.tar.gz -/s390-tools-2.9.0.tar.gz -/s390-tools-2.10.0.tar.gz -/s390-tools-2.11.0.tar.gz -/s390-tools-2.12.0.tar.gz -/s390-tools-2.13.0.tar.gz -/s390-tools-2.14.0.tar.gz -/s390-tools-2.15.0.tar.gz -/s390-tools-2.15.1.tar.gz -/s390-tools-2.16.0.tar.gz +/s390-tools-*.tar.gz +/s390-tools-*-rust-vendor.tar.xz diff --git a/20-zipl-kernel.install b/20-zipl-kernel.install index 3487aa2..8cb8d86 100755 --- a/20-zipl-kernel.install +++ b/20-zipl-kernel.install @@ -54,21 +54,25 @@ EOF case "$COMMAND" in add) if [[ "${KERNEL_DIR}" != "/boot" ]]; then + # rename to match the name used in the pseudo-BLS snippet above + cp --remove-destination --preserve=timestamps -T "${KERNEL_IMAGE}" "/boot/vmlinuz-${KERNEL_VERSION}" + command -v restorecon &>/dev/null && \ + restorecon -R "/boot/vmlinuz-${KERNEL_VERSION}" + for i in \ - "$KERNEL_IMAGE" \ "$KERNEL_DIR"/System.map \ "$KERNEL_DIR"/config \ "$KERNEL_DIR"/zImage.stub do [[ -e "$i" ]] || continue - cp -aT "$i" "/boot/${i##*/}-${KERNEL_VERSION}" + cp --preserve=timestamps -T "$i" "/boot/${i##*/}-${KERNEL_VERSION}" command -v restorecon &>/dev/null && \ restorecon -R "/boot/${i##*/}-${KERNEL_VERSION}" done # hmac is .vmlinuz-.hmac so needs a special treatment i="$KERNEL_DIR/.${KERNEL_IMAGE##*/}.hmac" if [[ -e "$i" ]]; then - cp -a "$i" "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac" + cp --preserve=timestamps "$i" "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac" command -v restorecon &>/dev/null && \ restorecon "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac" fi @@ -88,16 +92,10 @@ case "$COMMAND" in done fi - if ! [[ ${BOOT_OPTIONS[*]} ]]; then - echo "Could not determine the kernel command line parameters." >&2 - echo "Please specify the kernel command line in /etc/kernel/cmdline!" >&2 - exit 1 - fi - [[ -d "$BLS_DIR" ]] || mkdir -m 0700 -p "$BLS_DIR" BLS_TARGET="${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf" if [[ -f "${KERNEL_DIR}/bls.conf" ]]; then - cp -aT "${KERNEL_DIR}/bls.conf" "${BLS_TARGET}" || exit $? + cp --preserve=timestamps -T "${KERNEL_DIR}/bls.conf" "${BLS_TARGET}" || exit $? sed -i -e "s,^linux.*,linux /boot/vmlinuz-${KERNEL_VERSION},g" "${BLS_TARGET}" sed -i -e "s,^initrd.*,initrd /boot/initramfs-${KERNEL_VERSION}.img,g" "${BLS_TARGET}" sed -i -e "s#^options.*#options ${BOOT_OPTIONS[*]}#g" "${BLS_TARGET}" @@ -118,7 +116,7 @@ case "$COMMAND" in if [ "x${MAKEDEBUG}" = "xyes" ]; then BLS_DEBUG="$(echo ${BLS_TARGET} | sed -e "s/${KERNEL_VERSION}/${KERNEL_VERSION}~debug/")" - cp -aT "${BLS_TARGET}" "${BLS_DEBUG}" + cp --preserve=timestamps -T "${BLS_TARGET}" "${BLS_DEBUG}" TITLE="$(grep '^title[ \t]' "${BLS_DEBUG}" | sed -e 's/^title[ \t]*//')" VERSION="$(grep '^version[ \t]' "${BLS_DEBUG}" | sed -e 's/^version[ \t]*//')" BLSID="$(grep '^id[ \t]' "${BLS_DEBUG}" | sed -e "s/${KERNEL_VERSION}/${KERNEL_VERSION}~debug/")" diff --git a/52-zipl-rescue.install b/52-zipl-rescue.install index dbf0c1b..8acfbe0 100755 --- a/52-zipl-rescue.install +++ b/52-zipl-rescue.install @@ -29,12 +29,6 @@ case "$COMMAND" in done fi - if ! [[ ${BOOT_OPTIONS[*]} ]]; then - echo "Could not determine the kernel command line parameters." >&2 - echo "Please specify the kernel command line in /etc/kernel/cmdline!" >&2 - exit 1 - fi - BLS_RESCUE="${BLS_DIR}/${MACHINE_ID}-0-rescue.conf" if [[ -f "${BLS_RESCUE}" ]] && grep -q '^options.*$kernelopts' "${BLS_RESCUE}"; then sed -i -e "s,^linux.*,linux /boot/vmlinuz-0-rescue-${MACHINE_ID},g" "${BLS_RESCUE}" diff --git a/ccw.udev b/ccw.udev index a12ad05..c5db932 100644 --- a/ccw.udev +++ b/ccw.udev @@ -1,13 +1,4 @@ -ACTION!="add|change", GOTO="ccw_end" +ACTION!="add|bind|change", GOTO="ccw_end" SUBSYSTEM!="ccw", GOTO="ccw_end" -ATTRS{cutype}=="1731/01", RUN+="ccw_init" -ATTRS{cutype}=="1731/02", RUN+="ccw_init" -ATTRS{cutype}=="1731/05", RUN+="ccw_init" -ATTRS{cutype}=="1731/06", RUN+="ccw_init" -ATTRS{cutype}=="3088/01", RUN+="ccw_init" -ATTRS{cutype}=="3088/08", RUN+="ccw_init" -ATTRS{cutype}=="3088/60", RUN+="ccw_init" -ATTRS{cutype}=="3088/61", RUN+="ccw_init" -ATTRS{cutype}=="3088/1e", RUN+="ccw_init" -ATTRS{cutype}=="3088/1f", RUN+="ccw_init" +DRIVER=="ctcm|lcs|qeth", RUN+="ccw_init" LABEL="ccw_end" diff --git a/device_cio_free.service b/device_cio_free.service index f9564e1..b3c0f4d 100644 --- a/device_cio_free.service +++ b/device_cio_free.service @@ -7,7 +7,6 @@ Before=sysinit.target systemd-udev-trigger.service Type=oneshot RemainAfterExit=yes ExecStart=/usr/sbin/device_cio_free -StandardOutput=syslog [Install] WantedBy=sysinit.target diff --git a/rpminspect.yaml b/rpminspect.yaml new file mode 100644 index 0000000..7e19000 --- /dev/null +++ b/rpminspect.yaml @@ -0,0 +1,9 @@ +--- +pathmigration: + excluded_paths: + - /lib/s390-tools + +badfuncs: + allowed: + /usr/bin/qethqoat: + - inet_ntoa diff --git a/s390-tools-2.16.0-genprotimg.patch b/s390-tools-2.16.0-genprotimg.patch deleted file mode 100644 index 6f96a14..0000000 --- a/s390-tools-2.16.0-genprotimg.patch +++ /dev/null @@ -1,1021 +0,0 @@ -From b6bdd7744aba06d82f30b0c84012f0b06ccb01de Mon Sep 17 00:00:00 2001 -From: Marc Hartmayer -Date: Wed, 24 Feb 2021 15:04:11 +0000 -Subject: [PATCH] genprotimg: use `pv_` namespace for our Buffer implementation -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Use `pv_` namespace for our Buffer implementation so a symbol clash with other -libraries is less likely. - -Fixes: https://github.com/ibm-s390-linux/s390-tools/issues/109 -Reviewed-by: Jan Hoeppner -Signed-off-by: Marc Hartmayer -Signed-off-by: Jan Höppner ---- - genprotimg/src/pv/pv_comp.c | 26 +++++------ - genprotimg/src/pv/pv_comp.h | 4 +- - genprotimg/src/pv/pv_comps.c | 10 ++--- - genprotimg/src/pv/pv_comps.h | 4 +- - genprotimg/src/pv/pv_hdr.c | 24 +++++------ - genprotimg/src/pv/pv_hdr.h | 4 +- - genprotimg/src/pv/pv_image.c | 70 +++++++++++++++--------------- - genprotimg/src/pv/pv_image.h | 14 +++--- - genprotimg/src/pv/pv_ipib.c | 4 +- - genprotimg/src/pv/pv_ipib.h | 2 +- - genprotimg/src/pv/pv_stage3.c | 26 +++++------ - genprotimg/src/pv/pv_stage3.h | 10 ++--- - genprotimg/src/utils/buffer.c | 18 ++++---- - genprotimg/src/utils/buffer.h | 16 +++---- - genprotimg/src/utils/crypto.c | 72 +++++++++++++++---------------- - genprotimg/src/utils/crypto.h | 28 ++++++------ - genprotimg/src/utils/file_utils.c | 4 +- - genprotimg/src/utils/file_utils.h | 2 +- - 18 files changed, 169 insertions(+), 169 deletions(-) - -diff --git a/genprotimg/src/pv/pv_comp.c b/genprotimg/src/pv/pv_comp.c -index 1f64eea8..21879ae7 100644 ---- a/genprotimg/src/pv/pv_comp.c -+++ b/genprotimg/src/pv/pv_comp.c -@@ -73,12 +73,12 @@ PvComponent *pv_component_new_file(PvComponentType type, const gchar *path, - return pv_component_new(type, size, DATA_FILE, (void **)&file, err); - } - --PvComponent *pv_component_new_buf(PvComponentType type, const Buffer *buf, -+PvComponent *pv_component_new_buf(PvComponentType type, const PvBuffer *buf, - GError **err) - { - g_assert(buf); - -- g_autoptr(Buffer) dup_buf = buffer_dup(buf, FALSE); -+ g_autoptr(PvBuffer) dup_buf = pv_buffer_dup(buf, FALSE); - return pv_component_new(type, buf->size, DATA_BUFFER, (void **)&dup_buf, - err); - } -@@ -90,7 +90,7 @@ void pv_component_free(PvComponent *component) - - switch ((PvComponentDataType)component->d_type) { - case DATA_BUFFER: -- buffer_clear(&component->buf); -+ pv_buffer_clear(&component->buf); - break; - case DATA_FILE: - comp_file_free(component->file); -@@ -162,21 +162,21 @@ gint pv_component_align_and_encrypt(PvComponent *component, const gchar *tmp_pat - - switch ((PvComponentDataType)component->d_type) { - case DATA_BUFFER: { -- g_autoptr(Buffer) enc_buf = NULL; -+ g_autoptr(PvBuffer) enc_buf = NULL; - - if (!(IS_PAGE_ALIGNED(pv_component_size(component)))) { -- g_autoptr(Buffer) new = NULL; -+ g_autoptr(PvBuffer) new = NULL; - - /* create a page aligned copy */ -- new = buffer_dup(component->buf, TRUE); -- buffer_clear(&component->buf); -+ new = pv_buffer_dup(component->buf, TRUE); -+ pv_buffer_clear(&component->buf); - component->buf = g_steal_pointer(&new); - } - enc_buf = encrypt_buf(parms, component->buf, err); - if (!enc_buf) - return -1; - -- buffer_clear(&component->buf); -+ pv_buffer_clear(&component->buf); - component->buf = g_steal_pointer(&enc_buf); - return 0; - } -@@ -220,10 +220,10 @@ gint pv_component_align(PvComponent *component, const gchar *tmp_path, - - switch (component->d_type) { - case DATA_BUFFER: { -- g_autoptr(Buffer) buf = NULL; -+ g_autoptr(PvBuffer) buf = NULL; - -- buf = buffer_dup(component->buf, TRUE); -- buffer_clear(&component->buf); -+ buf = pv_buffer_dup(component->buf, TRUE); -+ pv_buffer_clear(&component->buf); - component->buf = g_steal_pointer(&buf); - return 0; - } break; -@@ -301,7 +301,7 @@ int64_t pv_component_update_pld(const PvComponent *comp, EVP_MD_CTX *ctx, - - switch (comp->d_type) { - case DATA_BUFFER: { -- const Buffer *buf = comp->buf; -+ const PvBuffer *buf = comp->buf; - - g_assert(buf->size <= INT64_MAX); - g_assert(buf->size == size); -@@ -425,7 +425,7 @@ gint pv_component_write(const PvComponent *component, FILE *f, GError **err) - - switch (component->d_type) { - case DATA_BUFFER: { -- const Buffer *buf = component->buf; -+ const PvBuffer *buf = component->buf; - - if (seek_and_write_buffer(f, buf, offset, err) < 0) - return -1; -diff --git a/genprotimg/src/pv/pv_comp.h b/genprotimg/src/pv/pv_comp.h -index aa1b5ae7..a4ffae81 100644 ---- a/genprotimg/src/pv/pv_comp.h -+++ b/genprotimg/src/pv/pv_comp.h -@@ -41,7 +41,7 @@ typedef struct { - gint d_type; /* PvComponentDataType */ - union { - struct comp_file *file; -- Buffer *buf; -+ PvBuffer *buf; - void *data; - }; - uint64_t src_addr; -@@ -51,7 +51,7 @@ typedef struct { - - PvComponent *pv_component_new_file(PvComponentType type, const gchar *path, - GError **err); --PvComponent *pv_component_new_buf(PvComponentType type, const Buffer *buf, -+PvComponent *pv_component_new_buf(PvComponentType type, const PvBuffer *buf, - GError **err); - void pv_component_free(PvComponent *component); - gint pv_component_type(const PvComponent *component); -diff --git a/genprotimg/src/pv/pv_comps.c b/genprotimg/src/pv/pv_comps.c -index 15d32f09..2d364fd0 100644 ---- a/genprotimg/src/pv/pv_comps.c -+++ b/genprotimg/src/pv/pv_comps.c -@@ -210,13 +210,13 @@ GSList *pv_img_comps_get_comps(const PvImgComps *comps) - return comps->comps; - } - --gint pv_img_comps_finalize(PvImgComps *comps, Buffer **pld_digest, -- Buffer **ald_digest, Buffer **tld_digest, -+gint pv_img_comps_finalize(PvImgComps *comps, PvBuffer **pld_digest, -+ PvBuffer **ald_digest, PvBuffer **tld_digest, - uint64_t *nep, GError **err) - { -- g_autoptr(Buffer) tmp_pld_digest = NULL; -- g_autoptr(Buffer) tmp_ald_digest = NULL; -- g_autoptr(Buffer) tmp_tld_digest = NULL; -+ g_autoptr(PvBuffer) tmp_pld_digest = NULL; -+ g_autoptr(PvBuffer) tmp_ald_digest = NULL; -+ g_autoptr(PvBuffer) tmp_tld_digest = NULL; - - comps->finalized = TRUE; - for (GSList *iterator = comps->comps; iterator; iterator = iterator->next) { -diff --git a/genprotimg/src/pv/pv_comps.h b/genprotimg/src/pv/pv_comps.h -index d555e36f..891ecdff 100644 ---- a/genprotimg/src/pv/pv_comps.h -+++ b/genprotimg/src/pv/pv_comps.h -@@ -32,8 +32,8 @@ gint pv_img_comps_add_component(PvImgComps *comps, PvComponent **comp, - GError **err); - PvComponent *pv_img_comps_get_nth_comp(PvImgComps *comps, guint n); - gint pv_img_comps_set_offset(PvImgComps *comps, gsize offset, GError **err); --gint pv_img_comps_finalize(PvImgComps *comps, Buffer **pld_digest, -- Buffer **ald_digest, Buffer **tld_digest, -+gint pv_img_comps_finalize(PvImgComps *comps, PvBuffer **pld_digest, -+ PvBuffer **ald_digest, PvBuffer **tld_digest, - uint64_t *nep, GError **err); - void pv_img_comps_free(PvImgComps *comps); - -diff --git a/genprotimg/src/pv/pv_hdr.c b/genprotimg/src/pv/pv_hdr.c -index 45e721dd..e46e1761 100644 ---- a/genprotimg/src/pv/pv_hdr.c -+++ b/genprotimg/src/pv/pv_hdr.c -@@ -76,17 +76,17 @@ uint64_t pv_hdr_get_nks(const PvHdr *hdr) - } - - /* In-place modification of ``buf`` */ --static gint pv_hdr_encrypt(const PvHdr *hdr, const PvImage *img, Buffer *buf, -+static gint pv_hdr_encrypt(const PvHdr *hdr, const PvImage *img, PvBuffer *buf, - GError **err) - { - uint32_t hdr_len = pv_hdr_size(hdr); - uint32_t aad_len = pv_hdr_aad_size(hdr); - guint tag_len = pv_hdr_tag_size(hdr); - uint32_t enc_len = pv_hdr_enc_size_casted(hdr); -- const Buffer aad_part = { .data = buf->data, .size = aad_len }; -- Buffer enc_part = { .data = (uint8_t *)buf->data + aad_len, -+ const PvBuffer aad_part = { .data = buf->data, .size = aad_len }; -+ PvBuffer enc_part = { .data = (uint8_t *)buf->data + aad_len, - .size = enc_len }; -- Buffer tag_part = { .data = (uint8_t *)buf->data + hdr_len - tag_len, -+ PvBuffer tag_part = { .data = (uint8_t *)buf->data + hdr_len - tag_len, - .size = tag_len }; - struct cipher_parms parms; - int64_t c_len; -@@ -119,9 +119,9 @@ static gint pv_hdr_aad_init(PvHdr *hdr, const PvImage *img, GError **err) - g_autofree union ecdh_pub_key *cust_pub_key = NULL; - struct pv_hdr_key_slot *hdr_slot = hdr->slots; - struct pv_hdr_head *head = &hdr->head; -- g_autoptr(Buffer) pld = NULL; -- g_autoptr(Buffer) ald = NULL; -- g_autoptr(Buffer) tld = NULL; -+ g_autoptr(PvBuffer) pld = NULL; -+ g_autoptr(PvBuffer) ald = NULL; -+ g_autoptr(PvBuffer) tld = NULL; - uint64_t nep = 0; - - g_assert(sizeof(head->iv) == img->gcm_iv->size); -@@ -250,7 +250,7 @@ PvHdr *pv_hdr_new(const PvImage *img, GError **err) - return g_steal_pointer(&ret); - } - --static void pv_hdr_memcpy(const PvHdr *hdr, const Buffer *dst) -+static void pv_hdr_memcpy(const PvHdr *hdr, const PvBuffer *dst) - { - uint64_t nks = pv_hdr_get_nks(hdr); - uint8_t *data; -@@ -270,13 +270,13 @@ static void pv_hdr_memcpy(const PvHdr *hdr, const Buffer *dst) - } - } - --Buffer *pv_hdr_serialize(const PvHdr *hdr, const PvImage *img, -- enum PvCryptoMode mode, GError **err) -+PvBuffer *pv_hdr_serialize(const PvHdr *hdr, const PvImage *img, -+ enum PvCryptoMode mode, GError **err) - { - uint32_t hdr_size = pv_hdr_size(hdr); -- g_autoptr(Buffer) ret = NULL; -+ g_autoptr(PvBuffer) ret = NULL; - -- ret = buffer_alloc(hdr_size); -+ ret = pv_buffer_alloc(hdr_size); - pv_hdr_memcpy(hdr, ret); - - if (mode == PV_ENCRYPT) { -diff --git a/genprotimg/src/pv/pv_hdr.h b/genprotimg/src/pv/pv_hdr.h -index 8df7a6f1..fbcc9e9e 100644 ---- a/genprotimg/src/pv/pv_hdr.h -+++ b/genprotimg/src/pv/pv_hdr.h -@@ -23,8 +23,8 @@ - PvHdr *pv_hdr_new(const PvImage *img, GError **err); - void pv_hdr_free(PvHdr *hdr); - G_GNUC_UNUSED gboolean pv_hdr_uses_encryption(const PvHdr *hdr); --Buffer *pv_hdr_serialize(const PvHdr *hdr, const PvImage *img, -- enum PvCryptoMode mode, GError **err); -+PvBuffer *pv_hdr_serialize(const PvHdr *hdr, const PvImage *img, -+ enum PvCryptoMode mode, GError **err); - uint32_t pv_hdr_size(const PvHdr *hdr); - uint32_t pv_hdr_aad_size(const PvHdr *hdr); - uint64_t pv_hdr_enc_size(const PvHdr *hdr); -diff --git a/genprotimg/src/pv/pv_image.c b/genprotimg/src/pv/pv_image.c -index 59eca5e3..375e40f6 100644 ---- a/genprotimg/src/pv/pv_image.c -+++ b/genprotimg/src/pv/pv_image.c -@@ -56,7 +56,7 @@ static gint pv_img_prepare_component(const PvImage *img, PvComponent *comp, - GError **err) - { - struct cipher_parms parms = { 0 }; -- g_autoptr(Buffer) tweak = NULL; -+ g_autoptr(PvBuffer) tweak = NULL; - prepare_func func = NULL; - void *opaque = NULL; - gint rc; -@@ -76,7 +76,7 @@ static gint pv_img_prepare_component(const PvImage *img, PvComponent *comp, - EVP_CIPHER_iv_length(cipher)); - g_assert(img->xts_key->size <= UINT_MAX); - -- tweak = buffer_alloc(sizeof(comp->tweak.data)); -+ tweak = pv_buffer_alloc(sizeof(comp->tweak.data)); - memcpy(tweak->data, comp->tweak.data, tweak->size); - func = pv_component_align_and_encrypt; - parms.cipher = cipher; -@@ -93,11 +93,11 @@ static gint pv_img_prepare_component(const PvImage *img, PvComponent *comp, - return 0; - } - --static Buffer *pv_img_read_key(const gchar *path, guint key_size, -- GError **err) -+static PvBuffer *pv_img_read_key(const gchar *path, guint key_size, -+ GError **err) - { -- g_autoptr(Buffer) tmp_ret = NULL; -- Buffer *ret = NULL; -+ g_autoptr(PvBuffer) tmp_ret = NULL; -+ PvBuffer *ret = NULL; - gsize bytes_read; - FILE *f = NULL; - gsize size; -@@ -116,7 +116,7 @@ static Buffer *pv_img_read_key(const gchar *path, guint key_size, - if (!f) - return NULL; - -- tmp_ret = buffer_alloc(size); -+ tmp_ret = pv_buffer_alloc(size); - if (file_read(f, tmp_ret->data, 1, tmp_ret->size, &bytes_read, err) < 0) - goto err; - -@@ -160,8 +160,8 @@ static HostKeyList *pv_img_get_host_keys(GSList *host_keys_with_path, gint nid, - return g_steal_pointer(&ret); - } - --static Buffer *pv_img_get_key(const EVP_CIPHER *cipher, const gchar *path, -- GError **err) -+static PvBuffer *pv_img_get_key(const EVP_CIPHER *cipher, const gchar *path, -+ GError **err) - { - gint key_len = EVP_CIPHER_key_length(cipher); - -@@ -173,8 +173,8 @@ static Buffer *pv_img_get_key(const EVP_CIPHER *cipher, const gchar *path, - return generate_aes_key((guint)key_len, err); - } - --static Buffer *pv_img_get_iv(const EVP_CIPHER *cipher, const gchar *path, -- GError **err) -+static PvBuffer *pv_img_get_iv(const EVP_CIPHER *cipher, const gchar *path, -+ GError **err) - { - gint iv_len = EVP_CIPHER_iv_length(cipher); - -@@ -485,23 +485,23 @@ static void pv_hdr_key_slot_free(PvHdrKeySlot *slot) - WRAPPED_G_DEFINE_AUTOPTR_CLEANUP_FUNC(PvHdrKeySlot, pv_hdr_key_slot_free) - - static PvHdrKeySlot *pv_hdr_key_slot_new(const EVP_CIPHER *gcm_cipher, -- const Buffer *cust_root_key, -+ const PvBuffer *cust_root_key, - EVP_PKEY *cust_key, EVP_PKEY *host_key, - GError **err) - { - g_autoptr(PvHdrKeySlot) ret = g_new0(PvHdrKeySlot, 1); - g_autofree union ecdh_pub_key *pub = NULL; -- g_autoptr(Buffer) exchange_key = NULL; -- g_autoptr(Buffer) digest_key = NULL; -- g_autoptr(Buffer) iv = NULL; -- Buffer pub_buf; -+ g_autoptr(PvBuffer) exchange_key = NULL; -+ g_autoptr(PvBuffer) digest_key = NULL; -+ g_autoptr(PvBuffer) iv = NULL; -+ PvBuffer pub_buf; - /* No AAD data is used */ -- Buffer aad = { .data = NULL, .size = 0 }; -+ PvBuffer aad = { .data = NULL, .size = 0 }; - /* Set the output buffers for the encrypted data and the - * generated GCM tag - */ -- Buffer enc = { .data = ret->wrapped_key, .size = sizeof(ret->wrapped_key) }; -- Buffer tag = { .data = ret->tag, .size = sizeof(ret->tag) }; -+ PvBuffer enc = { .data = ret->wrapped_key, .size = sizeof(ret->wrapped_key) }; -+ PvBuffer tag = { .data = ret->tag, .size = sizeof(ret->tag) }; - struct cipher_parms parms; - int64_t c_len = 0; - -@@ -530,7 +530,7 @@ static PvHdrKeySlot *pv_hdr_key_slot_new(const EVP_CIPHER *gcm_cipher, - g_assert(exchange_key->size == (guint)EVP_CIPHER_key_length(gcm_cipher)); - - /* create zero IV */ -- iv = buffer_alloc((guint)EVP_CIPHER_iv_length(gcm_cipher)); -+ iv = pv_buffer_alloc((guint)EVP_CIPHER_iv_length(gcm_cipher)); - parms.iv_or_tweak = iv; - parms.key = exchange_key; - parms.cipher = gcm_cipher; -@@ -637,13 +637,13 @@ void pv_img_free(PvImage *img) - g_slist_free_full(img->key_slots, (GDestroyNotify)pv_hdr_key_slot_free); - g_slist_free_full(img->host_pub_keys, (GDestroyNotify)EVP_PKEY_free); - EVP_PKEY_free(img->cust_pub_priv_key); -- buffer_clear(&img->stage3a); -+ pv_buffer_clear(&img->stage3a); - pv_img_comps_free(img->comps); - g_free(img->tmp_dir); -- buffer_free(img->xts_key); -- buffer_free(img->cust_root_key); -- buffer_free(img->gcm_iv); -- buffer_free(img->cust_comm_key); -+ pv_buffer_free(img->xts_key); -+ pv_buffer_free(img->cust_root_key); -+ pv_buffer_free(img->gcm_iv); -+ pv_buffer_free(img->cust_comm_key); - g_free(img); - } - -@@ -684,13 +684,13 @@ gint pv_img_add_component(PvImage *img, const PvArg *arg, GError **err) - return 0; - } - --gint pv_img_calc_pld_ald_tld_nep(const PvImage *img, Buffer **pld, Buffer **ald, -- Buffer **tld, uint64_t *nep, GError **err) -+gint pv_img_calc_pld_ald_tld_nep(const PvImage *img, PvBuffer **pld, PvBuffer **ald, -+ PvBuffer **tld, uint64_t *nep, GError **err) - { - return pv_img_comps_finalize(img->comps, pld, ald, tld, nep, err); - } - --static gint pv_img_build_stage3b(PvImage *img, Buffer *stage3b, GError **err) -+static gint pv_img_build_stage3b(PvImage *img, PvBuffer *stage3b, GError **err) - { - g_autofree struct stage3b_args *args = NULL; - -@@ -708,7 +708,7 @@ static gint pv_img_build_stage3b(PvImage *img, Buffer *stage3b, GError **err) - gint pv_img_add_stage3b_comp(PvImage *img, const gchar *path, GError **err) - { - g_autoptr(PvComponent) comp = NULL; -- g_autoptr(Buffer) stage3b = NULL; -+ g_autoptr(PvBuffer) stage3b = NULL; - - stage3b = stage3b_getblob(path, err); - if (!stage3b) -@@ -825,7 +825,7 @@ static gint get_stage3a_data_size(const PvImage *img, gsize *data_size, - - gint pv_img_load_and_set_stage3a(PvImage *img, const gchar *path, GError **err) - { -- g_autoptr(Buffer) stage3a = NULL; -+ g_autoptr(PvBuffer) stage3a = NULL; - gsize bin_size, data_size = 0; - - if (get_stage3a_data_size(img, &data_size, err) < 0) -@@ -845,8 +845,8 @@ gint pv_img_load_and_set_stage3a(PvImage *img, const gchar *path, GError **err) - } - - /* Creates the PV IPIB and sets the stage3a arguments */ --static gint pv_img_build_stage3a(Buffer *stage3a, gsize stage3a_bin_size, -- GSList *comps, const Buffer *hdr, GError **err) -+static gint pv_img_build_stage3a(PvBuffer *stage3a, gsize stage3a_bin_size, -+ GSList *comps, const PvBuffer *hdr, GError **err) - { - g_autofree struct ipl_parameter_block *ipib = NULL; - -@@ -866,9 +866,9 @@ static gint pv_img_build_stage3a(Buffer *stage3a, gsize stage3a_bin_size, - } - - /* Creates the actual PV header (serialized and AES-GCM encrypted) */ --static Buffer *pv_img_create_pv_hdr(PvImage *img, GError **err) -+static PvBuffer *pv_img_create_pv_hdr(PvImage *img, GError **err) - { -- g_autoptr(Buffer) hdr_buf = NULL; -+ g_autoptr(PvBuffer) hdr_buf = NULL; - g_autoptr(PvHdr) hdr = NULL; - - hdr = pv_hdr_new(img, err); -@@ -887,7 +887,7 @@ static Buffer *pv_img_create_pv_hdr(PvImage *img, GError **err) - */ - gint pv_img_finalize(PvImage *pv, const gchar *stage3b_path, GError **err) - { -- g_autoptr(Buffer) hdr = NULL; -+ g_autoptr(PvBuffer) hdr = NULL; - - /* load stage3b template into memory and add it to the list of - * components. This must be done before calling -diff --git a/genprotimg/src/pv/pv_image.h b/genprotimg/src/pv/pv_image.h -index 7c624e24..116fb1a9 100644 ---- a/genprotimg/src/pv/pv_image.h -+++ b/genprotimg/src/pv/pv_image.h -@@ -25,7 +25,7 @@ - - typedef struct { - gchar *tmp_dir; /* directory used for temporary files */ -- Buffer *stage3a; /* stage3a containing IPIB and PV header */ -+ PvBuffer *stage3a; /* stage3a containing IPIB and PV header */ - gsize stage3a_bin_size; /* size of stage3a.bin */ - struct psw_t stage3a_psw; /* (short) PSW that is written to - * location 0 of the created image -@@ -35,15 +35,15 @@ typedef struct { - GSList *host_pub_keys; /* public host keys */ - gint nid; /* Elliptic Curve used for the key derivation */ - /* keys and cipher used for the AES-GCM encryption */ -- Buffer *cust_root_key; -- Buffer *gcm_iv; -+ PvBuffer *cust_root_key; -+ PvBuffer *gcm_iv; - const EVP_CIPHER *gcm_cipher; - /* Information for the IPIB and PV header */ - uint64_t pcf; - uint64_t scf; -- Buffer *cust_comm_key; -+ PvBuffer *cust_comm_key; - const EVP_CIPHER *cust_comm_cipher; -- Buffer *xts_key; -+ PvBuffer *xts_key; - const EVP_CIPHER *xts_cipher; - GSList *key_slots; - GSList *optional_items; -@@ -54,8 +54,8 @@ PvImage *pv_img_new(PvArgs *args, const gchar *stage3a_path, GError **err); - void pv_img_free(PvImage *img); - gint pv_img_add_component(PvImage *img, const PvArg *arg, GError **err); - gint pv_img_finalize(PvImage *img, const gchar *stage3b_path, GError **err); --gint pv_img_calc_pld_ald_tld_nep(const PvImage *img, Buffer **pld, Buffer **ald, -- Buffer **tld, uint64_t *nep, GError **err); -+gint pv_img_calc_pld_ald_tld_nep(const PvImage *img, PvBuffer **pld, PvBuffer **ald, -+ PvBuffer **tld, uint64_t *nep, GError **err); - gint pv_img_load_and_set_stage3a(PvImage *img, const gchar *path, GError **err); - const PvComponent *pv_img_get_stage3b_comp(const PvImage *img, GError **err); - gint pv_img_add_stage3b_comp(PvImage *img, const gchar *path, GError **err); -diff --git a/genprotimg/src/pv/pv_ipib.c b/genprotimg/src/pv/pv_ipib.c -index 2517e548..59fe0086 100644 ---- a/genprotimg/src/pv/pv_ipib.c -+++ b/genprotimg/src/pv/pv_ipib.c -@@ -35,7 +35,7 @@ uint64_t pv_ipib_get_size(uint32_t num_comp) - } - - static gint pv_ipib_init(IplParameterBlock *ipib, GSList *comps, -- const Buffer *hdr) -+ const PvBuffer *hdr) - { - g_assert(sizeof(struct ipl_pl_hdr) <= UINT32_MAX); - g_assert(sizeof(struct ipl_pb0_pv_comp) <= UINT32_MAX); -@@ -100,7 +100,7 @@ static gint pv_ipib_init(IplParameterBlock *ipib, GSList *comps, - return 0; - } - --IplParameterBlock *pv_ipib_new(GSList *comps, const Buffer *hdr, GError **err) -+IplParameterBlock *pv_ipib_new(GSList *comps, const PvBuffer *hdr, GError **err) - { - uint64_t ipib_size = pv_ipib_get_size(g_slist_length(comps)); - g_autoptr(IplParameterBlock) ret = NULL; -diff --git a/genprotimg/src/pv/pv_ipib.h b/genprotimg/src/pv/pv_ipib.h -index 93317901..4b66643d 100644 ---- a/genprotimg/src/pv/pv_ipib.h -+++ b/genprotimg/src/pv/pv_ipib.h -@@ -19,7 +19,7 @@ - typedef struct ipl_parameter_block IplParameterBlock; - - uint64_t pv_ipib_get_size(uint32_t num_comp); --IplParameterBlock *pv_ipib_new(GSList *comps, const Buffer *hdr, GError **err); -+IplParameterBlock *pv_ipib_new(GSList *comps, const PvBuffer *hdr, GError **err); - void pv_ipib_free(IplParameterBlock *ipib); - - WRAPPED_G_DEFINE_AUTOPTR_CLEANUP_FUNC(IplParameterBlock, pv_ipib_free) -diff --git a/genprotimg/src/pv/pv_stage3.c b/genprotimg/src/pv/pv_stage3.c -index a1e5b164..bff9db7d 100644 ---- a/genprotimg/src/pv/pv_stage3.c -+++ b/genprotimg/src/pv/pv_stage3.c -@@ -24,12 +24,12 @@ - ((struct stage3a_args *)((uint64_t)data_ptr + loader_size - \ - sizeof(struct stage3a_args))) - --static Buffer *loader_getblob(const gchar *filename, gsize *loader_size, -- gsize args_size, gsize data_size, -- gboolean data_aligned, GError **err) -+static PvBuffer *loader_getblob(const gchar *filename, gsize *loader_size, -+ gsize args_size, gsize data_size, -+ gboolean data_aligned, GError **err) - { - g_autoptr(GMappedFile) mapped_file = NULL; -- g_autoptr(Buffer) ret = NULL; -+ g_autoptr(PvBuffer) ret = NULL; - gsize size, tmp_loader_size; - gchar *loader_data; - -@@ -60,7 +60,7 @@ static Buffer *loader_getblob(const gchar *filename, gsize *loader_size, - size = (data_aligned ? PAGE_ALIGN(tmp_loader_size) : tmp_loader_size) + - data_size; - -- ret = buffer_alloc(size); -+ ret = pv_buffer_alloc(size); - - /* copy the loader "template" */ - memcpy(ret->data, loader_data, tmp_loader_size); -@@ -71,8 +71,8 @@ static Buffer *loader_getblob(const gchar *filename, gsize *loader_size, - return g_steal_pointer(&ret); - } - --Buffer *stage3a_getblob(const gchar *filename, gsize *loader_size, -- gsize data_size, GError **err) -+PvBuffer *stage3a_getblob(const gchar *filename, gsize *loader_size, -+ gsize data_size, GError **err) - { - return loader_getblob(filename, loader_size, - sizeof(struct stage3a_args), data_size, TRUE, -@@ -83,8 +83,8 @@ Buffer *stage3a_getblob(const gchar *filename, gsize *loader_size, - /* Set the right offsets and sizes in the stage3a template + add - * the IPIB block with the PV header - */ --static gint stage3a_set_data(Buffer *loader, gsize loader_size, -- const Buffer *hdr, struct ipl_parameter_block *ipib, -+static gint stage3a_set_data(PvBuffer *loader, gsize loader_size, -+ const PvBuffer *hdr, struct ipl_parameter_block *ipib, - GError **err) - { - uint32_t ipib_size = GUINT32_FROM_BE(ipib->hdr.len); -@@ -126,15 +126,15 @@ static gint stage3a_set_data(Buffer *loader, gsize loader_size, - return 0; - } - --gint build_stage3a(Buffer *loader, gsize loader_size, const Buffer *hdr, -+gint build_stage3a(PvBuffer *loader, gsize loader_size, const PvBuffer *hdr, - struct ipl_parameter_block *ipib, GError **err) - { - return stage3a_set_data(loader, loader_size, hdr, ipib, err); - } - --Buffer *stage3b_getblob(const gchar *filename, GError **err) -+PvBuffer *stage3b_getblob(const gchar *filename, GError **err) - { -- g_autoptr(Buffer) ret = NULL; -+ g_autoptr(PvBuffer) ret = NULL; - gsize rb_size; - - ret = loader_getblob(filename, &rb_size, sizeof(struct stage3b_args), 0, -@@ -146,7 +146,7 @@ Buffer *stage3b_getblob(const gchar *filename, GError **err) - return g_steal_pointer(&ret); - } - --void build_stage3b(Buffer *stage3b, const struct stage3b_args *args) -+void build_stage3b(PvBuffer *stage3b, const struct stage3b_args *args) - { - g_assert(stage3b->size > sizeof(*args)); - -diff --git a/genprotimg/src/pv/pv_stage3.h b/genprotimg/src/pv/pv_stage3.h -index baaf921b..364408ee 100644 ---- a/genprotimg/src/pv/pv_stage3.h -+++ b/genprotimg/src/pv/pv_stage3.h -@@ -19,12 +19,12 @@ - #include "boot/stage3b.h" - #include "utils/buffer.h" - --Buffer *stage3a_getblob(const gchar *filename, gsize *loader_size, -- gsize data_size, GError **err); --gint build_stage3a(Buffer *dc, gsize dc_size, const Buffer *hdr, -+PvBuffer *stage3a_getblob(const gchar *filename, gsize *loader_size, -+ gsize data_size, GError **err); -+gint build_stage3a(PvBuffer *dc, gsize dc_size, const PvBuffer *hdr, - struct ipl_parameter_block *ipib, GError **err); --Buffer *stage3b_getblob(const gchar *filename, GError **err); --void build_stage3b(Buffer *stage3b, const struct stage3b_args *args); -+PvBuffer *stage3b_getblob(const gchar *filename, GError **err); -+void build_stage3b(PvBuffer *stage3b, const struct stage3b_args *args); - void memblob_init(struct memblob *arg, uint64_t src, uint64_t size); - - #endif -diff --git a/genprotimg/src/utils/buffer.c b/genprotimg/src/utils/buffer.c -index 35aed742..509dc0de 100644 ---- a/genprotimg/src/utils/buffer.c -+++ b/genprotimg/src/utils/buffer.c -@@ -17,18 +17,18 @@ - #include "common.h" - #include "file_utils.h" - --Buffer *buffer_alloc(gsize size) -+PvBuffer *pv_buffer_alloc(gsize size) - { -- Buffer *ret = g_new0(Buffer, 1); -+ PvBuffer *ret = g_new0(PvBuffer, 1); - - ret->data = g_malloc0(size); - ret->size = size; - return ret; - } - --Buffer *buffer_dup(const Buffer *buf, gboolean page_aligned) -+PvBuffer *pv_buffer_dup(const PvBuffer *buf, gboolean page_aligned) - { -- Buffer *ret; -+ PvBuffer *ret; - gsize size; - - if (!buf) -@@ -38,19 +38,19 @@ Buffer *buffer_dup(const Buffer *buf, gboolean page_aligned) - if (page_aligned) - size = PAGE_ALIGN(size); - -- ret = buffer_alloc(size); -+ ret = pv_buffer_alloc(size); - - /* content will be 0-right-padded */ - memcpy(ret->data, buf->data, buf->size); - return ret; - } - --gint buffer_write(const Buffer *buf, FILE *file, GError **err) -+gint pv_buffer_write(const PvBuffer *buf, FILE *file, GError **err) - { - return file_write(file, buf->data, buf->size, 1, NULL, err); - } - --void buffer_free(Buffer *buf) -+void pv_buffer_free(PvBuffer *buf) - { - if (!buf) - return; -@@ -59,11 +59,11 @@ void buffer_free(Buffer *buf) - g_free(buf); - } - --void buffer_clear(Buffer **buf) -+void pv_buffer_clear(PvBuffer **buf) - { - if (!buf || !*buf) - return; - -- buffer_free(*buf); -+ pv_buffer_free(*buf); - *buf = NULL; - } -diff --git a/genprotimg/src/utils/buffer.h b/genprotimg/src/utils/buffer.h -index 7239d5c9..824b72cb 100644 ---- a/genprotimg/src/utils/buffer.h -+++ b/genprotimg/src/utils/buffer.h -@@ -15,17 +15,17 @@ - - #include "common.h" - --typedef struct Buffer { -+typedef struct PvBuffer { - void *data; - gsize size; /* in bytes */ --} Buffer; -+} PvBuffer; - --Buffer *buffer_alloc(gsize size); --void buffer_free(Buffer *buf); --void buffer_clear(Buffer **buf); --gint buffer_write(const Buffer *buf, FILE *file, GError **err); --Buffer *buffer_dup(const Buffer *buf, gboolean page_aligned); -+PvBuffer *pv_buffer_alloc(gsize size); -+void pv_buffer_free(PvBuffer *buf); -+void pv_buffer_clear(PvBuffer **buf); -+gint pv_buffer_write(const PvBuffer *buf, FILE *file, GError **err); -+PvBuffer *pv_buffer_dup(const PvBuffer *buf, gboolean page_aligned); - --WRAPPED_G_DEFINE_AUTOPTR_CLEANUP_FUNC(Buffer, buffer_free) -+WRAPPED_G_DEFINE_AUTOPTR_CLEANUP_FUNC(PvBuffer, pv_buffer_free) - - #endif -diff --git a/genprotimg/src/utils/crypto.c b/genprotimg/src/utils/crypto.c -index 44facc28..05c3e832 100644 ---- a/genprotimg/src/utils/crypto.c -+++ b/genprotimg/src/utils/crypto.c -@@ -89,15 +89,15 @@ EVP_MD_CTX *digest_ctx_new(const EVP_MD *md, GError **err) - return g_steal_pointer(&ctx); - } - --Buffer *digest_ctx_finalize(EVP_MD_CTX *ctx, GError **err) -+PvBuffer *digest_ctx_finalize(EVP_MD_CTX *ctx, GError **err) - { - gint md_size = EVP_MD_size(EVP_MD_CTX_md(ctx)); -- g_autoptr(Buffer) ret = NULL; -+ g_autoptr(PvBuffer) ret = NULL; - guint digest_size; - - g_assert(md_size > 0); - -- ret = buffer_alloc((guint)md_size); -+ ret = pv_buffer_alloc((guint)md_size); - if (EVP_DigestFinal_ex(ctx, ret->data, &digest_size) != 1) { - g_set_error(err, PV_CRYPTO_ERROR, PV_CRYPTO_ERROR_INTERNAL, - _("EVP_DigestFinal_ex failed")); -@@ -110,10 +110,10 @@ Buffer *digest_ctx_finalize(EVP_MD_CTX *ctx, GError **err) - } - - /* Returns the digest of @buf using the hash algorithm @md */ --static Buffer *digest_buffer(const EVP_MD *md, const Buffer *buf, GError **err) -+static PvBuffer *digest_buffer(const EVP_MD *md, const PvBuffer *buf, GError **err) - { - g_autoptr(EVP_MD_CTX) md_ctx = NULL; -- g_autoptr(Buffer) ret = NULL; -+ g_autoptr(PvBuffer) ret = NULL; - g_assert(buf); - - md_ctx = digest_ctx_new(md, err); -@@ -134,9 +134,9 @@ static Buffer *digest_buffer(const EVP_MD *md, const Buffer *buf, GError **err) - } - - /* Returns the SHA256 digest of @buf */ --Buffer *sha256_buffer(const Buffer *buf, GError **err) -+PvBuffer *sha256_buffer(const PvBuffer *buf, GError **err) - { -- g_autoptr(Buffer) ret = NULL; -+ g_autoptr(PvBuffer) ret = NULL; - - ret = digest_buffer(EVP_sha256(), buf, err); - if (!ret) -@@ -207,10 +207,10 @@ union ecdh_pub_key *evp_pkey_to_ecdh_pub_key(EVP_PKEY *key, GError **err) - return g_steal_pointer(&ret); - } - --static Buffer *derive_key(EVP_PKEY *cust, EVP_PKEY *host, GError **err) -+static PvBuffer *derive_key(EVP_PKEY *cust, EVP_PKEY *host, GError **err) - { - g_autoptr(EVP_PKEY_CTX) ctx = NULL; -- g_autoptr(Buffer) ret = NULL; -+ g_autoptr(PvBuffer) ret = NULL; - gsize key_size; - - ctx = EVP_PKEY_CTX_new(cust, NULL); -@@ -236,7 +236,7 @@ static Buffer *derive_key(EVP_PKEY *cust, EVP_PKEY *host, GError **err) - return NULL; - } - -- ret = buffer_alloc(key_size); -+ ret = pv_buffer_alloc(key_size); - if (EVP_PKEY_derive(ctx, ret->data, &key_size) != 1) { - g_set_error(err, PV_CRYPTO_ERROR, PV_CRYPTO_ERROR_DERIVE, - _("Key derivation failed")); -@@ -247,11 +247,11 @@ static Buffer *derive_key(EVP_PKEY *cust, EVP_PKEY *host, GError **err) - return g_steal_pointer(&ret); - } - --Buffer *compute_exchange_key(EVP_PKEY *cust, EVP_PKEY *host, GError **err) -+PvBuffer *compute_exchange_key(EVP_PKEY *cust, EVP_PKEY *host, GError **err) - { -- g_autoptr(Buffer) raw = buffer_alloc(70); -- g_autoptr(Buffer) ret = NULL; -- g_autoptr(Buffer) key = NULL; -+ g_autoptr(PvBuffer) raw = pv_buffer_alloc(70); -+ g_autoptr(PvBuffer) ret = NULL; -+ g_autoptr(PvBuffer) key = NULL; - guchar *data; - - key = derive_key(cust, host, err); -@@ -290,10 +290,10 @@ gint generate_tweak(union tweak *tweak, uint16_t i, GError **err) - return 0; - } - --static Buffer *generate_rand_data(guint size, const gchar *err_msg, -- GError **err) -+static PvBuffer *generate_rand_data(guint size, const gchar *err_msg, -+ GError **err) - { -- g_autoptr(Buffer) buf = buffer_alloc(size); -+ g_autoptr(PvBuffer) buf = pv_buffer_alloc(size); - - g_assert(size <= INT_MAX); - -@@ -307,14 +307,14 @@ static Buffer *generate_rand_data(guint size, const gchar *err_msg, - return g_steal_pointer(&buf); - } - --Buffer *generate_aes_iv(guint size, GError **err) -+PvBuffer *generate_aes_iv(guint size, GError **err) - { - return generate_rand_data(size, - _("Generating a IV failed because the required amount of random data is not available"), - err); - } - --Buffer *generate_aes_key(guint size, GError **err) -+PvBuffer *generate_aes_key(guint size, GError **err) - { - return generate_rand_data(size, - _("Generating a key failed because the required amount of random data is not available"), -@@ -1756,8 +1756,8 @@ static gint __encrypt_decrypt_bio(const struct cipher_parms *parms, BIO *b_in, - gint cipher_block_size = EVP_CIPHER_block_size(cipher); - guchar in_buf[PAGE_SIZE], - out_buf[PAGE_SIZE + (guint)cipher_block_size]; -- const Buffer *key = parms->key; -- const Buffer *tweak = parms->iv_or_tweak; -+ const PvBuffer *key = parms->key; -+ const PvBuffer *tweak = parms->iv_or_tweak; - g_autofree guchar *tmp_tweak = NULL; - gint out_len, tweak_size; - gsize tmp_size_in = 0, tmp_size_out = 0; -@@ -1895,11 +1895,11 @@ static gint __encrypt_decrypt_bio(const struct cipher_parms *parms, BIO *b_in, - return 0; - } - --static Buffer *__encrypt_decrypt_buffer(const struct cipher_parms *parms, -- const Buffer *in, gboolean encrypt, -- GError **err) -+static PvBuffer *__encrypt_decrypt_buffer(const struct cipher_parms *parms, -+ const PvBuffer *in, gboolean encrypt, -+ GError **err) - { -- g_autoptr(Buffer) ret = NULL; -+ g_autoptr(PvBuffer) ret = NULL; - g_autoptr(BIO) b_out = NULL; - g_autoptr(BIO) b_in = NULL; - gsize in_size, out_size; -@@ -1927,19 +1927,19 @@ static Buffer *__encrypt_decrypt_buffer(const struct cipher_parms *parms, - return NULL; - } - -- ret = buffer_alloc((unsigned long)data_size); -+ ret = pv_buffer_alloc((unsigned long)data_size); - memcpy(ret->data, data, ret->size); - return g_steal_pointer(&ret); - } - --Buffer *encrypt_buf(const struct cipher_parms *parms, const Buffer *in, -- GError **err) -+PvBuffer *encrypt_buf(const struct cipher_parms *parms, const PvBuffer *in, -+ GError **err) - { - return __encrypt_decrypt_buffer(parms, in, TRUE, err); - } - --Buffer *decrypt_buf(const struct cipher_parms *parms, const Buffer *in, -- GError **err) -+PvBuffer *decrypt_buf(const struct cipher_parms *parms, const PvBuffer *in, -+ GError **err) - { - return __encrypt_decrypt_buffer(parms, in, FALSE, err); - } -@@ -1993,16 +1993,16 @@ G_GNUC_UNUSED static gint decrypt_file(const struct cipher_parms *parms, - } - - /* GCM mode uses (zero-)padding */ --static int64_t gcm_encrypt_decrypt(const Buffer *in, const Buffer *aad, -+static int64_t gcm_encrypt_decrypt(const PvBuffer *in, const PvBuffer *aad, - const struct cipher_parms *parms, -- Buffer *out, Buffer *tag, -+ PvBuffer *out, PvBuffer *tag, - enum PvCryptoMode mode, GError **err) - { - g_autoptr(EVP_CIPHER_CTX) ctx = NULL; - const EVP_CIPHER *cipher = parms->cipher; -- const Buffer *iv = parms->iv_or_tweak; -+ const PvBuffer *iv = parms->iv_or_tweak; - gboolean encrypt = mode == PV_ENCRYPT; -- const Buffer *key = parms->key; -+ const PvBuffer *key = parms->key; - int64_t ret = -1; - gint len = -1; - -@@ -2097,8 +2097,8 @@ static int64_t gcm_encrypt_decrypt(const Buffer *in, const Buffer *aad, - return ret; - } - --int64_t gcm_encrypt(const Buffer *in, const Buffer *aad, -- const struct cipher_parms *parms, Buffer *out, Buffer *tag, -+int64_t gcm_encrypt(const PvBuffer *in, const PvBuffer *aad, -+ const struct cipher_parms *parms, PvBuffer *out, PvBuffer *tag, - GError **err) - { - return gcm_encrypt_decrypt(in, aad, parms, out, tag, PV_ENCRYPT, err); -diff --git a/genprotimg/src/utils/crypto.h b/genprotimg/src/utils/crypto.h -index 286cf457..3cda4507 100644 ---- a/genprotimg/src/utils/crypto.h -+++ b/genprotimg/src/utils/crypto.h -@@ -117,8 +117,8 @@ union tweak { - - struct cipher_parms { - const EVP_CIPHER *cipher; -- const Buffer *key; -- const Buffer *iv_or_tweak; -+ const PvBuffer *key; -+ const PvBuffer *iv_or_tweak; - }; - - int check_crl_valid_for_cert(X509_CRL *crl, X509 *cert, -@@ -152,24 +152,24 @@ X509_CRL *get_first_valid_crl(X509_STORE_CTX *ctx, X509 *cert, GError **err); - void store_setup_crl_download(X509_STORE *st); - EVP_PKEY *read_ec_pubkey_cert(X509 *cert, gint nid, GError **err); - --Buffer *compute_exchange_key(EVP_PKEY *cust, EVP_PKEY *host, GError **err); --Buffer *generate_aes_key(guint size, GError **err); --Buffer *generate_aes_iv(guint size, GError **err); -+PvBuffer *compute_exchange_key(EVP_PKEY *cust, EVP_PKEY *host, GError **err); -+PvBuffer *generate_aes_key(guint size, GError **err); -+PvBuffer *generate_aes_iv(guint size, GError **err); - EVP_PKEY *generate_ec_key(gint nid, GError **err); - gint generate_tweak(union tweak *tweak, uint16_t i, GError **err); - union ecdh_pub_key *evp_pkey_to_ecdh_pub_key(EVP_PKEY *key, GError **err); - EVP_MD_CTX *digest_ctx_new(const EVP_MD *md, GError **err); --Buffer *digest_ctx_finalize(EVP_MD_CTX *ctx, GError **err); --Buffer *sha256_buffer(const Buffer *buf, GError **err); --int64_t gcm_encrypt(const Buffer *in, const Buffer *aad, -- const struct cipher_parms *parms, Buffer *out, -- Buffer *tag, GError **err); -+PvBuffer *digest_ctx_finalize(EVP_MD_CTX *ctx, GError **err); -+PvBuffer *sha256_buffer(const PvBuffer *buf, GError **err); -+int64_t gcm_encrypt(const PvBuffer *in, const PvBuffer *aad, -+ const struct cipher_parms *parms, PvBuffer *out, -+ PvBuffer *tag, GError **err); - gint encrypt_file(const struct cipher_parms *parms, const gchar *in_path, - const gchar *path_out, gsize *in_size, gsize *out_size, - GError **err); --Buffer *encrypt_buf(const struct cipher_parms *parms, const Buffer *in, -- GError **err); --G_GNUC_UNUSED Buffer *decrypt_buf(const struct cipher_parms *parms, -- const Buffer *in, GError **err); -+PvBuffer *encrypt_buf(const struct cipher_parms *parms, const PvBuffer *in, -+ GError **err); -+G_GNUC_UNUSED PvBuffer *decrypt_buf(const struct cipher_parms *parms, -+ const PvBuffer *in, GError **err); - - #endif -diff --git a/genprotimg/src/utils/file_utils.c b/genprotimg/src/utils/file_utils.c -index 1d6fc370..ba33400f 100644 ---- a/genprotimg/src/utils/file_utils.c -+++ b/genprotimg/src/utils/file_utils.c -@@ -171,13 +171,13 @@ gint seek_and_write_file(FILE *o, const CompFile *ifile, uint64_t offset, - return ret; - } - --gint seek_and_write_buffer(FILE *o, const Buffer *buf, uint64_t offset, -+gint seek_and_write_buffer(FILE *o, const PvBuffer *buf, uint64_t offset, - GError **err) - { - if (file_seek(o, offset, err) < 0) - return -1; - -- if (buffer_write(buf, o, err) < 0) -+ if (pv_buffer_write(buf, o, err) < 0) - return -1; - - return 0; -diff --git a/genprotimg/src/utils/file_utils.h b/genprotimg/src/utils/file_utils.h -index 47df1148..456e7aca 100644 ---- a/genprotimg/src/utils/file_utils.h -+++ b/genprotimg/src/utils/file_utils.h -@@ -26,7 +26,7 @@ gint file_write(FILE *out, const void *ptr, gsize size, gsize count, - gsize *count_written, GError **err); - gint pad_file_right(const gchar *path_out, const gchar *path_in, - gsize *size_out, guint padding, GError **err); --gint seek_and_write_buffer(FILE *out, const Buffer *buf, uint64_t offset, -+gint seek_and_write_buffer(FILE *out, const PvBuffer *buf, uint64_t offset, - GError **err); - gint seek_and_write_file(FILE *o, const CompFile *ifile, uint64_t offset, - GError **err); diff --git a/s390-tools-2.16.0-zkey.patch b/s390-tools-2.16.0-zkey.patch deleted file mode 100644 index 42b2014..0000000 --- a/s390-tools-2.16.0-zkey.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 3f3f063c98278f53ad3b34e68b70fca62eaea8fb Mon Sep 17 00:00:00 2001 -From: Ingo Franzki -Date: Tue, 23 Feb 2021 08:52:26 +0100 -Subject: [PATCH] zkey: Fix build error when the compiler flags are overridden -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When the compiler flags are overridden, the build of zkey may fail with: - -kms.c:44:2: error: #error KMS_PLUGIN_LOCATION must be defined - 44 | #error KMS_PLUGIN_LOCATION must be defined - | ^~~~~ - -The Makefile uses CFLAGS variable for defining the KMS_PLUGIN_LOCATION, -but it should rather use ALL_CFLAGS. - -Also use ALL_CPPFLAGS for defining HAVE_LUKS2_SUPPORT. - -Fixes: https://github.com/ibm-s390-linux/s390-tools/issues/108 - -Signed-off-by: Ingo Franzki -Reviewed-by: Jan Hoeppner -Signed-off-by: Jan Höppner ---- - zkey/Makefile | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/zkey/Makefile b/zkey/Makefile -index 41129bcf..f74e2091 100644 ---- a/zkey/Makefile -+++ b/zkey/Makefile -@@ -18,7 +18,7 @@ ifneq (${HAVE_CRYPTSETUP2},0) - ifneq (${HAVE_OPENSSL},0) - BUILD_TARGETS += zkey-cryptsetup - INSTALL_TARGETS += install-zkey-cryptsetup -- CPPFLAGS += -DHAVE_LUKS2_SUPPORT -+ ALL_CPPFLAGS += -DHAVE_LUKS2_SUPPORT - else - BUILD_TARGETS += zkey-cryptsetup-skip-openssl - INSTALL_TARGETS += zkey-cryptsetup-skip-openssl -@@ -34,7 +34,7 @@ endif - - libs = $(rootdir)/libutil/libutil.a - --CFLAGS += -DKMS_PLUGIN_LOCATION=\"$(ZKEYKMSPLUGINDIR)\" -+ALL_CFLAGS += -DKMS_PLUGIN_LOCATION=\"$(ZKEYKMSPLUGINDIR)\" - - detect-libcryptsetup.dep: - echo "#include " > detect-libcryptsetup.dep diff --git a/s390-tools-zipl-blscfg-rpm-nvr-sort.patch b/s390-tools-zipl-blscfg-rpm-nvr-sort.patch index d69192f..366efba 100644 --- a/s390-tools-zipl-blscfg-rpm-nvr-sort.patch +++ b/s390-tools-zipl-blscfg-rpm-nvr-sort.patch @@ -1,19 +1,234 @@ -diff -up s390-tools-2.9.0/zipl/src/Makefile.blscfg-rpm-nvr-sort s390-tools-2.9.0/zipl/src/Makefile ---- s390-tools-2.9.0/zipl/src/Makefile.blscfg-rpm-nvr-sort 2019-05-22 08:16:17.317273801 -0400 -+++ s390-tools-2.9.0/zipl/src/Makefile 2019-05-22 08:18:02.947273801 -0400 -@@ -7,7 +7,7 @@ ALL_CPPFLAGS += -I../include -I../boot \ - -D_FILE_OFFSET_BITS=64 $(NO_PIE_CFLAGS) - ALL_LDFLAGS += -Wl,-z,noexecstack $(NO_PIE_LDFLAGS) +From b2daaa34776ba6afec879e362378f6f7563590a6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20Hor=C3=A1k?= +Date: Mon, 20 Jun 2022 17:43:05 +0200 +Subject: [PATCH 1/2] Revert "zipl/src: Implement sorting bls entries by + versions" + +This reverts commit a0dba6bfdb50ff373fa710ffe2a307cc0748f18b. +--- + zipl/src/scan.c | 139 ++---------------------------------------------- + 1 file changed, 3 insertions(+), 136 deletions(-) + +diff --git a/zipl/src/scan.c b/zipl/src/scan.c +index 0cea1d4..9352f76 100644 +--- a/zipl/src/scan.c ++++ b/zipl/src/scan.c +@@ -10,7 +10,6 @@ + * + */ --libs = $(rootdir)/libutil/libutil.a -+libs = $(rootdir)/libutil/libutil.a -lrpmio -lrpm +-static const char *VERSION_KEYWORD = "version"; - objects = misc.o error.o scan.o job.o boot.o bootmap.o disk.o \ - install.o zipl.o $(rootdir)/zipl/boot/data.o -diff -up s390-tools-2.9.0/zipl/src/scan.c.blscfg-rpm-nvr-sort s390-tools-2.9.0/zipl/src/scan.c ---- s390-tools-2.9.0/zipl/src/scan.c.blscfg-rpm-nvr-sort 2019-05-21 09:13:36.000000000 -0400 -+++ s390-tools-2.9.0/zipl/src/scan.c 2019-05-22 08:16:17.317273801 -0400 -@@ -33,6 +33,8 @@ + /* Need ISOC99 function isblank() in ctype.h */ + #ifndef __USE_ISOC99 +@@ -646,7 +645,7 @@ scan_file(const char* filename, struct scan_token** token) + + + static int +-bls_filter_by_names(const struct dirent *ent) ++bls_filter(const struct dirent *ent) + { + int offset = strlen(ent->d_name) - strlen(".conf"); + +@@ -656,111 +655,13 @@ bls_filter_by_names(const struct dirent *ent) + return strncmp(ent->d_name + offset, ".conf", strlen(".conf")) == 0; + } + +-struct version { +- char *line; /* pointer to a line with version keyword */ +- int offset; /* offset of version value in the line */ +-}; +- +-/* +- * Locate version in bls file represented by ENT +- */ +-static void get_version(const struct dirent *ent, struct version *v) +-{ +- char *line = NULL; +- size_t len = 0; +- char *d_name; +- FILE *stream; +- ssize_t read; +- +- memset(v, 0, sizeof(*v)); +- d_name = misc_make_path((char *)blsdir, (char *)ent->d_name); +- if (!d_name) +- return; +- +- stream = fopen(d_name, "r"); +- free(d_name); +- if (!stream) +- return; +- +- while ((read = getline(&line, &len, stream)) != -1) { +- if (line[read - 1] == '\n') { +- line[read - 1] = '\0'; +- read--; +- } +- if ((size_t)read <= strlen(VERSION_KEYWORD) + 1) +- continue; +- if (strcmp(VERSION_KEYWORD, line) > 0) +- continue; +- if (!isblank(line[strlen(VERSION_KEYWORD)])) +- continue; +- /* skip blanks */ +- v->offset = strlen(VERSION_KEYWORD) + 1; +- while (v->offset < read - 1 && isblank(line[v->offset])) +- v->offset++; +- if (isblank(line[v->offset])) +- /* +- * all characters after the keyword +- * are blanks. Invalid version +- */ +- continue; +- v->line = line; +- fclose(stream); +- return; +- } +- free(line); +- fclose(stream); +-} +- +-static void put_version(struct version *v) +-{ +- free(v->line); +-} +- +-/** +- * Check version in bls file represented by ENT. +- * Return 1 if version is valid. Otherwise return 0 +- */ +-static int bls_filter_by_versions(const struct dirent *ent) +-{ +- struct version v; +- +- if (bls_filter_by_names(ent) == 0) +- return 0; +- +- get_version(ent, &v); +- if (v.line) { +- put_version(&v); +- return 1; +- } +- return 0; +-} +- + + static int +-bls_sort_by_names(const struct dirent **ent_a, const struct dirent **ent_b) ++bls_sort(const struct dirent **ent_a, const struct dirent **ent_b) + { + return strverscmp((*ent_a)->d_name, (*ent_b)->d_name); + } + +-static int +-bls_sort_by_versions(const struct dirent **ent_a, const struct dirent **ent_b) +-{ +- struct version v1, v2; +- int ret; +- +- get_version(*ent_a, &v1); +- get_version(*ent_b, &v2); +- /* +- * Both versions are valid. +- * It is guaranteed by bls_filter_by_versions() +- */ +- ret = strverscmp(v1.line + v1.offset, v2.line + v2.offset); +- +- put_version(&v1); +- put_version(&v2); +- +- return ret; +-} + + static int + scan_append_section_heading(struct scan_token* scan, int* index, char* name); +@@ -1110,40 +1011,6 @@ scan_count_target_keywords(char* keyword[]) + return num; + } + +-static int bls_scandir(struct dirent ***bls_entries) +-{ +- struct dirent **entries1; +- struct dirent **entries2; +- int n1, n2; +- +- /* arrange by names */ +- n1 = scandir(blsdir, &entries1, +- bls_filter_by_names, bls_sort_by_names); +- if (n1 <= 0) +- return n1; +- /* arrange by versions */ +- n2 = scandir(blsdir, &entries2, +- bls_filter_by_versions, bls_sort_by_versions); +- +- if (n2 <= 0 || n2 < n1) { +- /* +- * failed to sort by versions, +- * fall back to sorting by filenames +- */ +- *bls_entries = entries1; +- while (n2--) +- free(entries2[n2]); +- free(entries2); +- return n1; +- } +- /* use arrangement by versions */ +- *bls_entries = entries2; +- while (n1--) +- free(entries1[n1]); +- free(entries1); +- return n2; +-} +- + int + scan_check_target_data(char* keyword[], int* line) + { +@@ -1464,7 +1331,7 @@ int scan_bls(struct scan_token **token, int scan_size) + if (!(stat(blsdir, &sb) == 0 && S_ISDIR(sb.st_mode))) + return 0; + +- n = bls_scandir(&bls_entries); ++ n = scandir(blsdir, &bls_entries, bls_filter, bls_sort); + if (n <= 0) + return n; + +-- +2.39.2 + + +From 692e70bcfc32a05e30146bd7077c41e0eaceff03 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Mon, 20 Jun 2022 17:46:59 +0200 +Subject: [PATCH 2/2] blscfg: sort like rpm nvr, not like a single version +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Peter Jones +Signed-off-by: Dan Horák +--- + zipl/src/Makefile | 1 + + zipl/src/scan.c | 96 ++++++++++++++++++++++++++++++++++++++++++++++- + 2 files changed, 95 insertions(+), 2 deletions(-) + +diff --git a/zipl/src/Makefile b/zipl/src/Makefile +index cab5655..7ec215d 100644 +--- a/zipl/src/Makefile ++++ b/zipl/src/Makefile +@@ -9,6 +9,7 @@ ALL_LDFLAGS += -Wl,-z,noexecstack $(NO_PIE_LDFLAGS) + + libs = $(rootdir)/libutil/libutil.a \ + $(rootdir)/libvtoc/libvtoc.a \ ++ -lrpmio -lrpm + + objects = misc.o error.o scan.o job.o boot.o bootmap.o fs-map.o disk.o \ + bootmap_header.o envblk.o install.o zipl.o +diff --git a/zipl/src/scan.c b/zipl/src/scan.c +index 9352f76..3327e2d 100644 +--- a/zipl/src/scan.c ++++ b/zipl/src/scan.c +@@ -35,6 +35,8 @@ #include "lib/util_base.h" @@ -22,7 +237,7 @@ diff -up s390-tools-2.9.0/zipl/src/scan.c.blscfg-rpm-nvr-sort s390-tools-2.9.0/z #include "boot.h" #include "error.h" #include "misc.h" -@@ -653,13 +655,103 @@ bls_filter(const struct dirent *ent) +@@ -655,13 +657,103 @@ bls_filter(const struct dirent *ent) return strncmp(ent->d_name + offset, ".conf", strlen(".conf")) == 0; } @@ -128,3 +343,6 @@ diff -up s390-tools-2.9.0/zipl/src/scan.c.blscfg-rpm-nvr-sort s390-tools-2.9.0/z static int scan_append_section_heading(struct scan_token* scan, int* index, char* name); +-- +2.39.2 + diff --git a/s390-tools-zipl-invert-script-options.patch b/s390-tools-zipl-invert-script-options.patch index 93d5cc7..d7d936f 100644 --- a/s390-tools-zipl-invert-script-options.patch +++ b/s390-tools-zipl-invert-script-options.patch @@ -61,10 +61,10 @@ index 871935c783f..d8d5eca5867 100755 ;; --) shift -diff --git a/scripts/zipl-switch-to-blscfg.1 b/scripts/zipl-switch-to-blscfg.1 +diff --git a/scripts/zipl-switch-to-blscfg.8 b/scripts/zipl-switch-to-blscfg.8 index 6bd14d00d14..71b904ffd1c 100644 ---- a/scripts/zipl-switch-to-blscfg.1 -+++ b/scripts/zipl-switch-to-blscfg.1 +--- a/scripts/zipl-switch-to-blscfg.8 ++++ b/scripts/zipl-switch-to-blscfg.8 @@ -37,9 +37,9 @@ The DIRECTORY where the BLS fragments will be generated. The directory is create The FILE used for zipl configuration file, defaults to /etc/zipl.conf. diff --git a/s390utils-2.40.0-fedora.patch b/s390utils-2.40.0-fedora.patch new file mode 100644 index 0000000..e69de29 diff --git a/s390utils.spec b/s390utils.spec index 0dfc069..7da6a02 100644 --- a/s390utils.spec +++ b/s390utils.spec @@ -1,33 +1,71 @@ # secure boot support is for RHEL only %if 0%{?rhel} >= 8 -%global signzipl 1 +%bcond_without signzipl +%else +%bcond_with signzipl %endif +%if 0%{?fedora} +%bcond_without pandoc +%else +%bcond_with pandoc +%endif + +# Also controls whether %%cargo_generate_buildrequires generates dev-dependencies +%bcond_without check + Name: s390utils Summary: Utilities and daemons for IBM z Systems -Version: 2.16.0 -Release: 2%{?dist} +Version: 2.40.0 +Release: 1%{?dist} Epoch: 2 -License: MIT -ExclusiveArch: s390 s390x -#URL: http://www.ibm.com/developerworks/linux/linux390/s390-tools.html -URL: https://github.com/ibm-s390-tools/s390-tools -Source0: https://github.com/ibm-s390-tools/s390-tools/archive/v%{version}.tar.gz#/s390-tools-%{version}.tar.gz -Source5: zfcpconf.sh -Source7: zfcp.udev -# files for DASD initialization -Source12: dasd.udev -Source13: dasdconf.sh -Source14: device_cio_free -Source15: device_cio_free.service -Source16: ccw_init -Source17: ccw.udev -Source21: normalize_dasd_arg +# MIT covers nearly all the files, except init files (LGPL-2.1-or-later) +# +# Statically-linked Rust dependencies contribute additional license terms, +# listed in the output of %%{cargo_license_summary}: +# +# (MIT OR Apache-2.0) AND Unicode-DFS-2016 +# Apache-2.0 +# Apache-2.0 OR BSL-1.0 +# Apache-2.0 OR MIT +# Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT +# BSD-2-Clause OR Apache-2.0 OR MIT +# MIT +# MIT OR Apache-2.0 +# Unlicense OR MIT +%global extra_licenses_from_rust_deps %{shrink: +Apache-2.0 AND +(Apache-2.0 OR BSL-1.0) AND +(Apache-2.0 OR MIT) AND +(Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND +(BSD-2-Clause OR Apache-2.0 OR MIT) AND +Unicode-DFS-2016 AND +(Unlicense OR MIT) +} +License: MIT AND LGPL-2.1-or-later AND %{extra_licenses_from_rust_deps} +URL: https://github.com/ibm-s390-linux/s390-tools +Source0: https://github.com/ibm-s390-linux/s390-tools/archive/v%{version}.tar.gz#/s390-tools-%{version}.tar.gz +# To create the vendor tarball: +# tar xf s390-tools-%%{version}.tar.gz ; pushd s390-tools-%%{version}/rust ; \ +# rm -f Cargo.lock && cargo vendor && \ +# tar Jvcf ../../s390-tools-%%{version}-rust-vendor.tar.xz vendor/ ; popd +%if 0%{?rhel} +Source1: s390-tools-%{version}-rust-vendor.tar.xz +%endif +Source5: https://fedorapeople.org/cgit/sharkcz/public_git/utils.git/tree/zfcpconf.sh +Source7: https://fedorapeople.org/cgit/sharkcz/public_git/utils.git/tree/zfcp.udev +Source12: https://fedorapeople.org/cgit/sharkcz/public_git/utils.git/tree/dasd.udev +Source13: https://fedorapeople.org/cgit/sharkcz/public_git/utils.git/tree/dasdconf.sh +Source14: https://fedorapeople.org/cgit/sharkcz/public_git/utils.git/tree/device_cio_free +Source15: https://fedorapeople.org/cgit/sharkcz/public_git/utils.git/tree/device_cio_free.service +Source16: https://fedorapeople.org/cgit/sharkcz/public_git/utils.git/tree/ccw_init +Source17: https://fedorapeople.org/cgit/sharkcz/public_git/utils.git/tree/ccw.udev +Source21: https://fedorapeople.org/cgit/sharkcz/public_git/utils.git/tree/normalize_dasd_arg Source23: 20-zipl-kernel.install Source24: 52-zipl-rescue.install Source25: 91-zipl.install -%if 0%{?signzipl} +%if %{with signzipl} %define pesign_name redhatsecureboot302 %endif @@ -35,12 +73,19 @@ Source25: 91-zipl.install Patch0: s390-tools-zipl-invert-script-options.patch Patch1: s390-tools-zipl-blscfg-rpm-nvr-sort.patch -# upstream fixes -# https://github.com/ibm-s390-linux/s390-tools/commit/3f3f063c98278f53ad3b34e68b70fca62eaea8fb -Patch100: s390-tools-2.16.0-zkey.patch -# https://github.com/ibm-s390-linux/s390-tools/commit/b6bdd7744aba06d82f30b0c84012f0b06ccb01de -Patch101: s390-tools-2.16.0-genprotimg.patch +# upstream fixes/updates +#Patch100: s390utils-%%{version}-fedora.patch +# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval +ExcludeArch: %{ix86} + +# Add Provides for upstream name +Provides: s390-tools = %{epoch}:%{version}-%{release} + +%ifarch s390x +# +# s390x/native package structure +# Requires: s390utils-core = %{epoch}:%{version}-%{release} Requires: s390utils-base = %{epoch}:%{version}-%{release} Requires: s390utils-osasnmpd = %{epoch}:%{version}-%{release} @@ -48,9 +93,23 @@ Requires: s390utils-cpuplugd = %{epoch}:%{version}-%{release} Requires: s390utils-mon_statd = %{epoch}:%{version}-%{release} Requires: s390utils-iucvterm = %{epoch}:%{version}-%{release} Requires: s390utils-ziomon = %{epoch}:%{version}-%{release} +%else +# +# multiarch package structure +# +Requires: s390utils-se-data = %{epoch}:%{version}-%{release} +%endif -BuildRequires: make +BuildRequires: make BuildRequires: gcc-c++ +BuildRequires: glib2-devel +%if 0%{?rhel} +BuildRequires: libcurl-devel +BuildRequires: openssl-devel +BuildRequires: rust-toolset +%else +BuildRequires: cargo-rpm-macros >= 24 +%endif %description This is a meta package for installing the default s390-tools sub packages. @@ -61,39 +120,81 @@ The s390utils packages contain a set of user space utilities that should to be used together with the zSeries (s390) Linux kernel and device drivers. %prep -%setup -q -n s390-tools-%{version} +%autosetup -n s390-tools-%{version} -p1 -# Fedora/RHEL changes -%patch0 -p1 -b .zipl-invert-script-options -%patch1 -p1 -b .blscfg-rpm-nvr-sort +%if 0%{?rhel} +pushd rust +tar xf %{SOURCE1} +%cargo_prep -v vendor +popd +%else +%cargo_prep +%endif +rm ./rust/Cargo.lock -# upstream fixes -%patch100 -p1 -%patch101 -p1 +# Create sysusers config files +echo 'g zkeyadm' > s390utils-base.conf.usr +echo 'g ts-shell' > s390utils-iucvterm.conf.usr +echo 'g cpacfstats' > s390utils-cpacfstatsd.conf.usr -# remove --strip from install -find . -name Makefile | xargs sed -i 's/$(INSTALL) -s/$(INSTALL)/g' +# Create tmpfiles config files +echo 'd /var/log/ts-shell 2770 root ts-shell' > s390utils-iucvterm.conf.tmp +%if !0%{?rhel} +%generate_buildrequires +pushd rust >/dev/null +%cargo_generate_buildrequires +popd >/dev/null +%endif %build make \ - CFLAGS="%{build_cflags}" CXXFLAGS="%{build_cflags}" LDFLAGS="%{build_ldflags}" \ + CFLAGS="%{build_cflags}" CXXFLAGS="%{build_cxxflags}" LDFLAGS="%{build_ldflags}" \ + HAVE_DRACUT=1 \ +%if %{with pandoc} + ENABLE_DOC=1 \ +%endif + NO_PIE_LDFLAGS="" \ +%if "%{_sbindir}" == "%{_bindir}" + BINDIR=/usr/bin \ + USRSBINDIR=/usr/bin \ +%else BINDIR=/usr/sbin \ +%endif DISTRELEASE=%{release} \ V=1 +pushd rust +%cargo_license_summary +%{cargo_license} > LICENSE.dependencies +%if 0%{?rhel} +%cargo_vendor_manifest +%endif +popd + %install -make install \ +%make_install \ HAVE_DRACUT=1 \ - DESTDIR=%{buildroot} \ +%if %{with pandoc} + ENABLE_DOC=1 \ +%endif +%if "%{_sbindir}" == "%{_bindir}" + BINDIR=/usr/bin \ + USRSBINDIR=/usr/bin \ +%else BINDIR=/usr/sbin \ +%endif SYSTEMDSYSTEMUNITDIR=%{_unitdir} \ DISTRELEASE=%{release} \ V=1 +%ifarch s390x +# +# s390x/native specific %%install section +# # sign the stage3 bootloader -%if 0%{?signzipl} +%if %{with signzipl} if [ -x /usr/bin/rpm-sign ]; then pushd %{buildroot}/lib/s390-tools/ rpm-sign --key "%{pesign_name}" --lkmsign stage3.bin --output stage3.signed @@ -106,6 +207,7 @@ fi # move tools to searchable dir mv %{buildroot}%{_datadir}/s390-tools/netboot/mk-s390image %{buildroot}%{_bindir} +mv %{buildroot}%{_datadir}/s390-tools/netboot/mk-s390image.1 %{buildroot}%{_mandir}/man1 mkdir -p %{buildroot}{/boot,%{_udevrulesdir},%{_sysconfdir}/{profile.d,sysconfig},%{_prefix}/lib/modules-load.d} install -p -m 644 zipl/boot/tape0.bin %{buildroot}/boot/tape0 @@ -152,17 +254,88 @@ install -p -m 644 %{SOURCE17} %{buildroot}%{_udevrulesdir}/81-ccw.rules # zipl.conf to be ghosted touch %{buildroot}%{_sysconfdir}/zipl.conf +# install systemd sysusers and tmpfiles +mkdir -p %{buildroot}{%{_sysusersdir},%{_tmpfilesdir}}/ +for f in s390utils-*.conf.usr; do + install -p -m 644 $f %{buildroot}%{_sysusersdir}/$(basename -s .usr $f) +done +for f in s390utils-*.conf.tmp; do + install -p -m 644 $f %{buildroot}%{_tmpfilesdir}/$(basename -s .tmp $f) +done +%endif + +%ifarch s390x +# +# s390x/native main %%files section +# %files %doc README.md +%else +# +# multiarch %%files section +# + +%files +%doc README.md +%license LICENSE +%license rust/LICENSE.dependencies +%if 0%{?rhel} +%license rust/cargo-vendor.txt +%endif +%{_bindir}/genprotimg +%{_bindir}/pvattest +%{_bindir}/pvextract-hdr +%{_bindir}/pvimg +%{_bindir}/pvsecret +%{_bindir}/pvverify +%{_mandir}/man1/genprotimg.1* +%{_mandir}/man1/pvattest.1* +%{_mandir}/man1/pvattest-check.1* +%{_mandir}/man1/pvattest-create.1* +%{_mandir}/man1/pvattest-perform.1* +%{_mandir}/man1/pvattest-verify.1* +%{_mandir}/man1/pvimg.1* +%{_mandir}/man1/pvimg-create.1* +%{_mandir}/man1/pvimg-info.1* +%{_mandir}/man1/pvimg-test.1* +%{_mandir}/man1/pvsecret-add.1* +%{_mandir}/man1/pvsecret-create-association.1* +%{_mandir}/man1/pvsecret-create-meta.1* +%{_mandir}/man1/pvsecret-create-retrievable.1* +%{_mandir}/man1/pvsecret-create-update-cck.1* +%{_mandir}/man1/pvsecret-create.1* +%{_mandir}/man1/pvsecret-list.1* +%{_mandir}/man1/pvsecret-lock.1* +%{_mandir}/man1/pvsecret-retrieve.1* +%{_mandir}/man1/pvsecret-verify.1* +%{_mandir}/man1/pvsecret.1* +%{_mandir}/man1/pvverify.1* +%dir %{_datadir}/s390-tools +%{_datadir}/s390-tools/netboot/ +%{_datadir}/s390-tools/pvimg/ +%{bash_completions_dir}/*.bash +%{zsh_completions_dir}/_* + +# +# enf of multi-arch section +# +%endif + +%ifarch s390x +# +# s390x specific sub-packages +# # # ************************* s390-tools core package ************************* # %package core License: MIT Summary: S390 core tools +Provides: s390-tools-core = %{epoch}:%{version}-%{release} Requires: coreutils +Requires: makedumpfile %{?systemd_requires} # BRs are covered via the base package @@ -183,7 +356,7 @@ This package provides minimal set of tools needed to system to boot. %files core %doc README.md zdev/src/chzdev_usage.txt -%doc LICENSE +%license LICENSE %{_sbindir}/chreipl %{_sbindir}/chzdev %{_sbindir}/cio_ignore @@ -191,17 +364,25 @@ This package provides minimal set of tools needed to system to boot. %{_sbindir}/dasdinfo %{_sbindir}/fdasd %{_sbindir}/lszdev +%{_sbindir}/vmcp %{_sbindir}/zipl -%dir /lib/s390-tools/ +%{_sbindir}/zipl-editenv +%dir /lib/s390-tools /lib/s390-tools/{zipl,chreipl}_helper.* /lib/s390-tools/cpictl /lib/s390-tools/stage3.bin +/lib/s390-tools/zdev_id +/lib/s390-tools/zdev-from-dasd_mod.dasd /lib/s390-tools/zdev-root-update +/lib/s390-tools/zdev-to-dasd_mod.dasd +/lib/s390-tools/zdev-to-rd.znet /lib/s390-tools/zipl.conf %ghost %config(noreplace) %{_sysconfdir}/zipl.conf +%config(noreplace) %{_sysconfdir}/ziplenv %{_unitdir}/cpi.service %config(noreplace) %{_sysconfdir}/sysconfig/cpi /usr/lib/dracut/modules.d/95zdev/ +/usr/lib/dracut/modules.d/95zdev-kdump/ %{_mandir}/man5/zipl.conf.5* %{_mandir}/man8/chreipl.8* %{_mandir}/man8/chzdev.8* @@ -210,7 +391,9 @@ This package provides minimal set of tools needed to system to boot. %{_mandir}/man8/dasdinfo.8* %{_mandir}/man8/fdasd.8* %{_mandir}/man8/lszdev.8* +%{_mandir}/man8/vmcp.8* %{_mandir}/man8/zipl.8* +%{_mandir}/man8/zipl-editenv.8* # Additional Fedora/RHEL specific stuff %ghost %config(noreplace) %{_sysconfdir}/dasd.conf @@ -228,9 +411,12 @@ This package provides minimal set of tools needed to system to boot. %{_udevrulesdir}/56-dasd.rules %{_udevrulesdir}/56-zfcp.rules %{_udevrulesdir}/59-dasd.rules +%{_udevrulesdir}/59-virtio-blk.rules %{_udevrulesdir}/60-readahead.rules %{_udevrulesdir}/81-ccw.rules +%{_udevrulesdir}/81-dpm.rules %{_udevrulesdir}/90-cpi.rules +%{_udevrulesdir}/80-hotplug-cpu.rules %{_sysconfdir}/kernel/install.d/20-grubby.install %{_prefix}/lib/kernel/install.d/10-zfcpdump.install %{_prefix}/lib/kernel/install.d/20-zipl-kernel.install @@ -243,13 +429,18 @@ This package provides minimal set of tools needed to system to boot. # %package base -License: MIT +License: MIT AND LGPL-2.1-or-later AND %{extra_licenses_from_rust_deps} Summary: S390 base tools -Requires: gawk sed coreutils -Requires: sg3_utils +Provides: s390-tools-base = %{epoch}:%{version}-%{release} +Requires: coreutils Requires: ethtool +Requires: file +Requires: gawk +Requires: sed +Requires: sg3_utils Requires: tar Requires: s390utils-core = %{epoch}:%{version}-%{release} +Requires: s390utils-se-data = %{epoch}:%{version}-%{release} %{?systemd_requires} BuildRequires: perl-generators BuildRequires: ncurses-devel @@ -257,7 +448,8 @@ BuildRequires: glibc-static BuildRequires: cryptsetup-devel >= 2.0.3 BuildRequires: json-c-devel BuildRequires: rpm-devel -BuildRequires: glib2-devel +BuildRequires: libxml2-devel +BuildRequires: libnl3-devel %description base @@ -322,11 +514,6 @@ s390 base tools. This collection provides the following utilities: * tunedasd: Adjust tunable parameters on DASD devices. - * vmconvert: - Convert system dumps created by the z/VM VMDUMP command into dumps with - LKCD format. These LKCD dumps can then be analyzed with the dump analysis - tool lcrash. - * vmcp: Allows Linux users to send commands to the z/VM control program (CP). The normal usage is to invoke vmcp with the command you want to @@ -340,9 +527,6 @@ s390 base tools. This collection provides the following utilities: feature. Those traces are filtered with the zfcpdbf script, i.e. merge several traces, make it more readable etc. - * scsi_logging_level: - Create, get or set the logging level for the SCSI logging facility. - * zconf: Set of scripts to configure and list status information of Linux for zSeries IO devices. @@ -394,10 +578,6 @@ For more information refer to the following publications: * "Device Drivers, Features, and Commands" chapter "Useful Linux commands" * "Using the dump tools" -%pre base -# check for zkeyadm group and create it -getent group zkeyadm > /dev/null || groupadd -r zkeyadm - %post base %systemd_post dumpconf.service @@ -409,14 +589,20 @@ getent group zkeyadm > /dev/null || groupadd -r zkeyadm %files base %doc README.md zdev/src/lszdev_usage.txt +%license rust/LICENSE.dependencies +%if 0%{?rhel} +%license rust/cargo-vendor.txt +%endif %{_sbindir}/chccwdev %{_sbindir}/chchp %{_sbindir}/chcpumf +%{_sbindir}/chpstat %{_sbindir}/chshut %{_sbindir}/chzcrypt %{_sbindir}/dasdstat %{_sbindir}/dasdview %{_sbindir}/dbginfo.sh +%{_sbindir}/hsavmcore %{_sbindir}/hsci %{_sbindir}/hyptop %{_sbindir}/ip_watcher.pl @@ -424,8 +610,10 @@ getent group zkeyadm > /dev/null || groupadd -r zkeyadm %{_sbindir}/lscpumf %{_sbindir}/lscss %{_sbindir}/lsdasd -%{_sbindir}/lsqeth +%{_sbindir}/lshwc %{_sbindir}/lsluns +%{_sbindir}/lsqeth +%{_sbindir}/lspai %{_sbindir}/lsreipl %{_sbindir}/lsscm %{_sbindir}/lsshut @@ -433,16 +621,17 @@ getent group zkeyadm > /dev/null || groupadd -r zkeyadm %{_sbindir}/lstape %{_sbindir}/lszcrypt %{_sbindir}/lszfcp +%{_sbindir}/opticsmon +%{_sbindir}/pai %{_sbindir}/qetharp %{_sbindir}/qethconf %{_sbindir}/qethqoat -%{_sbindir}/scsi_logging_level +%{_sbindir}/sclpdbf %{_sbindir}/start_hsnc.sh %{_sbindir}/tape390_crypt %{_sbindir}/tape390_display %{_sbindir}/ttyrun %{_sbindir}/tunedasd -%{_sbindir}/vmcp %{_sbindir}/vmur %{_sbindir}/xcec-bridge %{_sbindir}/zcryptctl @@ -450,49 +639,99 @@ getent group zkeyadm > /dev/null || groupadd -r zkeyadm %{_sbindir}/zfcpdbf %{_sbindir}/zgetdump %{_sbindir}/zipl-switch-to-blscfg +%{_sbindir}/zmemtopo %{_sbindir}/znetconf %{_sbindir}/zpcictl +%{_bindir}/cpacfinfo %{_bindir}/dump2tar %{_bindir}/genprotimg %{_bindir}/mk-s390image -%{_bindir}/vmconvert +%{_bindir}/pvapconfig +%{_bindir}/pvimg +%{_bindir}/pvinfo +%{_bindir}/pvattest +%{_bindir}/pvextract-hdr +%{_bindir}/pvsecret +%{_bindir}/pvverify %{_bindir}/zkey %{_bindir}/zkey-cryptsetup +%{_bindir}/zpwr %{_unitdir}/dumpconf.service +%{_unitdir}/opticsmon.service %ghost %config(noreplace) %{_sysconfdir}/zipl.conf %config(noreplace) %{_sysconfdir}/sysconfig/dumpconf +%{_sysconfdir}/mdevctl.d/* +%{_sysusersdir}/s390utils-base.conf +/usr/lib/dracut/modules.d/99ngdump/ +/usr/lib/dracut/dracut.conf.d/99-pkey.conf +# own the mdevctl dirs until new release is available +%dir /usr/lib/mdevctl +%dir /usr/lib/mdevctl/scripts.d +%dir /usr/lib/mdevctl/scripts.d/callouts +/usr/lib/mdevctl/scripts.d/callouts/ap-check /lib/s390-tools/dumpconf /lib/s390-tools/lsznet.raw %dir /lib/s390-tools/zfcpdump /lib/s390-tools/zfcpdump/zfcpdump-initrd /lib/s390-tools/znetcontrolunits %{_libdir}/libekmfweb.so.* +%{_libdir}/libkmipclient.so.* +%dir %{_libdir}/zkey %{_libdir}/zkey/zkey-ekmfweb.so -%{_mandir}/man1/dbginfo.sh.1* +%{_libdir}/zkey/zkey-kmip.so +%{_mandir}/man1/cpacfinfo.1* %{_mandir}/man1/dump2tar.1* -%{_mandir}/man1/lscpumf.1* -%{_mandir}/man1/vmconvert.1* -%{_mandir}/man1/zfcpdbf.1* -%{_mandir}/man1/zipl-switch-to-blscfg.1* +%{_mandir}/man1/genprotimg.1* +%{_mandir}/man1/mk-s390image.1* +%{_mandir}/man1/pvapconfig.1* +%{_mandir}/man1/pvattest.1* +%{_mandir}/man1/pvattest-check.1* +%{_mandir}/man1/pvattest-create.1* +%{_mandir}/man1/pvattest-perform.1* +%{_mandir}/man1/pvattest-verify.1* +%{_mandir}/man1/pvimg.1* +%{_mandir}/man1/pvimg-create.1* +%{_mandir}/man1/pvimg-info.1* +%{_mandir}/man1/pvimg-test.1* +%{_mandir}/man1/pvsecret-add.1* +%{_mandir}/man1/pvsecret-create-association.1* +%{_mandir}/man1/pvsecret-create-meta.1* +%{_mandir}/man1/pvsecret-create-retrievable.1* +%{_mandir}/man1/pvsecret-create-update-cck.1* +%{_mandir}/man1/pvsecret-create.1* +%{_mandir}/man1/pvsecret-list.1* +%{_mandir}/man1/pvsecret-lock.1* +%{_mandir}/man1/pvsecret-retrieve.1* +%{_mandir}/man1/pvsecret-verify.1* +%{_mandir}/man1/pvsecret.1* +%{_mandir}/man1/pvverify.1* %{_mandir}/man1/zkey.1* %{_mandir}/man1/zkey-cryptsetup.1* %{_mandir}/man1/zkey-ekmfweb.1* +%{_mandir}/man1/zkey-kmip.1* +%{_mandir}/man1/zpwr.1* %{_mandir}/man4/prandom.4* +%{_mandir}/man5/hsavmcore.conf.5* %{_mandir}/man8/chccwdev.8* %{_mandir}/man8/chchp.8* %{_mandir}/man8/chcpumf.8* +%{_mandir}/man8/chpstat.8* %{_mandir}/man8/chshut.8* %{_mandir}/man8/chzcrypt.8* %{_mandir}/man8/dasdstat.8* %{_mandir}/man8/dasdview.8* +%{_mandir}/man8/dbginfo.sh.8* %{_mandir}/man8/dumpconf.8* -%{_mandir}/man8/genprotimg.8.* +%{_mandir}/man8/hsavmcore.8* %{_mandir}/man8/hsci.8* %{_mandir}/man8/hyptop.8* %{_mandir}/man8/lschp.8* +%{_mandir}/man8/lscpumf.8* %{_mandir}/man8/lscss.8* %{_mandir}/man8/lsdasd.8* +%{_mandir}/man8/lshwc.8* %{_mandir}/man8/lsluns.8* +%{_mandir}/man8/lspai.8* %{_mandir}/man8/lsqeth.8* %{_mandir}/man8/lsreipl.8* %{_mandir}/man8/lsscm.8* @@ -501,6 +740,8 @@ getent group zkeyadm > /dev/null || groupadd -r zkeyadm %{_mandir}/man8/lstape.8* %{_mandir}/man8/lszcrypt.8* %{_mandir}/man8/lszfcp.8* +%{_mandir}/man8/opticsmon.8* +%{_mandir}/man8/pai.8* %{_mandir}/man8/qetharp.8* %{_mandir}/man8/qethconf.8* %{_mandir}/man8/qethqoat.8* @@ -508,28 +749,48 @@ getent group zkeyadm > /dev/null || groupadd -r zkeyadm %{_mandir}/man8/tape390_display.8* %{_mandir}/man8/ttyrun.8* %{_mandir}/man8/tunedasd.8* -%{_mandir}/man8/vmcp.8* %{_mandir}/man8/vmur.8* %{_mandir}/man8/zcryptctl.8* %{_mandir}/man8/zcryptstats.8* +%{_mandir}/man8/zfcpdbf.8* %{_mandir}/man8/zgetdump.8* +%{_mandir}/man8/zipl-switch-to-blscfg.8* +%{_mandir}/man8/zmemtopo.8* %{_mandir}/man8/znetconf.8* %{_mandir}/man8/zpcictl.8* -%dir %{_datadir}/s390-tools/ -%{_datadir}/s390-tools/genprotimg/ +%dir %{_datadir}/s390-tools %{_datadir}/s390-tools/netboot/ +%{bash_completions_dir}/*.bash +%{zsh_completions_dir}/_* %dir %attr(0770,root,zkeyadm) %{_sysconfdir}/zkey +%dir %attr(0770,root,zkeyadm) %{_sysconfdir}/zkey/kmip +%dir %attr(0770,root,zkeyadm) %{_sysconfdir}/zkey/kmip/profiles +%config(noreplace) %attr(0660,root,zkeyadm)%{_sysconfdir}/zkey/kmip/profiles/*.profile %dir %attr(0770,root,zkeyadm) %{_sysconfdir}/zkey/repository %config(noreplace) %attr(0660,root,zkeyadm)%{_sysconfdir}/zkey/kms-plugins.conf # Additional Fedora/RHEL specific stuff /boot/tape0 +%package se-data +License: MIT +Summary: Data for Secure Execution +Provides: s390-tools-se-data = %{epoch}:%{version}-%{release} +BuildArch: noarch + +%description se-data +%{summary}. + +%files se-data +%dir %{_datadir}/s390-tools +%{_datadir}/s390-tools/pvimg/ + # # *********************** s390-tools osasnmpd package *********************** # %package osasnmpd Summary: SNMP sub-agent for OSA-Express cards +Provides: s390-tools-osasnmpd = %{epoch}:%{version}-%{release} Requires: net-snmp Requires: psmisc BuildRequires: net-snmp-devel @@ -549,6 +810,7 @@ ATM Ethernet LAN Emulation in QDIO mode. # %package mon_statd Summary: Monitoring daemons for Linux in z/VM +Provides: s390-tools-mon_statd = %{epoch}:%{version}-%{release} Requires: coreutils %{?systemd_requires} @@ -588,6 +850,7 @@ Monitoring daemons for Linux in z/VM: # %package cpuplugd Summary: Daemon that manages CPU and memory resources +Provides: s390-tools-cpuplugd = %{epoch}:%{version}-%{release} %{?systemd_requires} BuildRequires: systemd @@ -617,6 +880,7 @@ memory can be increased or decreased exploiting the CMM1 feature. # %package ziomon Summary: S390 ziomon tools +Provides: s390-tools-ziomon = %{epoch}:%{version}-%{release} Requires: blktrace Requires: coreutils Requires: device-mapper-multipath @@ -655,6 +919,7 @@ Tool set to collect data for zfcp performance analysis and report. # %package iucvterm Summary: z/VM IUCV terminal applications +Provides: s390-tools-iucvterm = %{epoch}:%{version}-%{release} Requires(pre): shadow-utils Requires(post): grep Requires(postun): grep @@ -671,10 +936,6 @@ active TCP/IP connection between two Linux guest operating systems. - ts-shell: Terminal server shell to authorize and control IUCV terminal connections for individual Linux users. -%pre iucvterm -# check for ts-shell group and create it -getent group ts-shell > /dev/null || groupadd -r ts-shell - %post iucvterm # /etc/shells is provided by "setup" grep -q '^/usr/bin/ts-shell$' /etc/shells \ @@ -700,13 +961,16 @@ fi %{_bindir}/ts-shell %{_sbindir}/chiucvallow %{_sbindir}/lsiucvallow -%dir %attr(2770,root,ts-shell) /var/log/ts-shell +%{_sysusersdir}/s390utils-iucvterm.conf +%{_tmpfilesdir}/s390utils-iucvterm.conf +%ghost %dir %attr(2770,root,ts-shell) /var/log/ts-shell %doc iucvterm/doc/ts-shell %{_mandir}/man1/iucvconn.1* %{_mandir}/man1/iucvtty.1* %{_mandir}/man1/ts-shell.1* %{_mandir}/man7/af_iucv.7* %{_mandir}/man8/chiucvallow.8* +%{_mandir}/man8/lsiucvallow.8* %{_mandir}/man9/hvc_iucv.9* %{_unitdir}/iucvtty-login@.service %{_unitdir}/ttyrun-getty@.service @@ -717,8 +981,10 @@ fi # %package cmsfs-fuse Summary: CMS file system based on FUSE -BuildRequires: fuse-devel -Requires: fuse +BuildRequires: fuse3-devel +Requires: fuse3 +Provides: s390-tools-cmsfs-fuse = %{epoch}:%{version}-%{release} +Requires: glibc-gconv-extra Obsoletes: %{name}-cmsfs < 2:2.7.0-3 %description cmsfs-fuse @@ -735,9 +1001,10 @@ This package contains the CMS file system based on FUSE. # %package zdsfs Summary: z/OS data set access based on FUSE -BuildRequires: fuse-devel +BuildRequires: fuse3-devel BuildRequires: libcurl-devel -Requires: fuse +Requires: fuse3 +Provides: s390-tools-zdsfs = %{epoch}:%{version}-%{release} %description zdsfs This package contains the z/OS data set access based on FUSE. @@ -751,8 +1018,9 @@ This package contains the z/OS data set access based on FUSE. # %package hmcdrvfs Summary: HMC drive file system based on FUSE -BuildRequires: fuse-devel -Requires: fuse +BuildRequires: fuse3-devel +Requires: fuse3 +Provides: s390-tools-hmcdrvfs = %{epoch}:%{version}-%{release} %description hmcdrvfs This package contains a HMC drive file system based on FUSE and a tool @@ -769,11 +1037,13 @@ to list files and directories. # %package cpacfstatsd Summary: Monitor and maintain CPACF activity counters +Provides: s390-tools-cpacfstatsd = %{epoch}:%{version}-%{release} Requires(post): systemd Requires(preun): systemd Requires(postun): systemd Requires(pre): shadow-utils BuildRequires: systemd +BuildRequires: systemd-devel %description cpacfstatsd The cpacfstats tools provide a client/server application set to monitor @@ -788,22 +1058,64 @@ and maintain CPACF activity counters. %postun cpacfstatsd %systemd_postun_with_restart cpacfstatsd.service -%pre cpacfstatsd -getent group cpacfstats >/dev/null || groupadd -r cpacfstats - %files cpacfstatsd %{_bindir}/cpacfstats %{_sbindir}/cpacfstatsd %{_mandir}/man1/cpacfstats.1* %{_mandir}/man8/cpacfstatsd.8* %{_unitdir}/cpacfstatsd.service +%{_sysusersdir}/s390utils-cpacfstatsd.conf + +# +# *********************** chreipl-fcp-mpath package *********************** +# +%package chreipl-fcp-mpath +Summary: Use multipath information for re-IPL path failover +BuildRequires: make +BuildRequires: bash +BuildRequires: coreutils +%if %{with pandoc} +BuildRequires: pandoc +%endif +BuildRequires: gawk +BuildRequires: gzip +BuildRequires: sed +Provides: s390-tools-chreipl-fcp-mpath = %{epoch}:%{version}-%{release} +Requires: bash +Requires: coreutils +Requires: util-linux +Requires: systemd-udev +Requires: device-mapper-multipath +Requires: dracut + +%description chreipl-fcp-mpath +The chreipl-fcp-mpath toolset monitors udev events about paths to the re-IPL +volume. If the currently configured FCP re-IPL path becomes unavailable, the +toolset checks for operational paths to the same volume. If available, it +reconfigures the FCP re-IPL settings to use an operational path. + +%files chreipl-fcp-mpath +%doc chreipl-fcp-mpath/README.md +%if %{with pandoc} +%doc chreipl-fcp-mpath/README.html +%endif +%dir %{_prefix}/lib/chreipl-fcp-mpath/ +%{_prefix}/lib/chreipl-fcp-mpath/* +%{_prefix}/lib/dracut/dracut.conf.d/70-chreipl-fcp-mpath.conf +%{_prefix}/lib/udev/chreipl-fcp-mpath-is-ipl-tgt +%{_prefix}/lib/udev/chreipl-fcp-mpath-is-ipl-vol +%{_prefix}/lib/udev/chreipl-fcp-mpath-is-reipl-zfcp +%{_prefix}/lib/udev/chreipl-fcp-mpath-record-volume-identifier +%{_prefix}/lib/udev/chreipl-fcp-mpath-try-change-ipl-path +%{_udevrulesdir}/70-chreipl-fcp-mpath.rules +%{_mandir}/man7/chreipl-fcp-mpath.7* # # *********************** devel package *********************** # %package devel Summary: Development files - +Provides: s390-tools-devel = %{epoch}:%{version}-%{release} Requires: %{name}-base%{?_isa} = %{epoch}:%{version}-%{release} %description devel @@ -812,10 +1124,184 @@ User-space development files for the s390/s390x architecture. %files devel %{_includedir}/%{name}/ %{_includedir}/ekmfweb/ +%{_includedir}/kmipclient/ %{_libdir}/libekmfweb.so +%{_libdir}/libkmipclient.so + +# +# end of s390x specific sub-packages +# +%endif %changelog +* Tue Jan 06 2026 Dan Horák - 2:2.40.0-1 +- rebased to 2.40.0 (rhbz#2421447) + +* Thu Nov 13 2025 Dan Horák - 2:2.39.0-1 +- rebased to 2.39.0 (rhbz#2403755) + +* Fri Jul 25 2025 Fedora Release Engineering - 2:2.38.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Fri Jun 27 2025 Dan Horák - 2:2.38.0-1 +- rebased to 2.38.0 (rhbz#2374765) + +* Thu Mar 13 2025 Benjamin A. Beasley - 2:2.37.0-2 +- Properly generate Rust BuildRequires on Fedora +- Update License (for s390utils/s390utils-base) to reflect Rust deps. + +* Thu Feb 27 2025 Jakub Čajka - 2:2.37.0-1 +- rebased to 2.37.0 (rhbz#2330787) + +* Mon Feb 24 2025 Dan Horák - 2:2.36.0-1 +- rebased to 2.36.0 (rhbz#2330787) + +* Thu Feb 06 2025 Fabio Valentini - 2:2.35.0-5 +- Rebuild for openssl crate >= v0.10.70 (RUSTSEC-2025-0004) + +* Mon Jan 20 2025 Dan Horák - 2:2.35.0-4 +- fix build with gcc15 +- Resolves: rhbz#2338176 + +* Wed Jan 15 2025 Zbigniew Jedrzejewski-Szmek - 2:2.35.0-3 +- Add sysusers.d config + +* Tue Jan 14 2025 Dan Horák - 2:2.35.0-2 +- updated for https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin + +* Thu Oct 03 2024 Dan Horák - 2:2.35.0-1 +- rebased to 2.35.0 (rhbz#2316232) + +* Mon Aug 26 2024 Dan Horák - 2:2.34.0-2 +- don't make Rust warnings fatal + +* Mon Aug 12 2024 Dan Horák - 2:2.34.0-1 +- rebased to 2.34.0 (rhbz#2302462) + +* Sat Jul 20 2024 Fedora Release Engineering - 2:2.33.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Mon Jul 15 2024 Dan Horák - 2:2.33.1-3 +- "which" is not required any more +- Revert "zipl/src: Fix problems when target parameters are specified by user" + +* Thu Jun 20 2024 Dan Horák - 2:2.33.1-2 +- add which as a dependency for base and ziomon subpackages (RHEL-38488) + +* Tue May 28 2024 Dan Horák - 2:2.33.1-1 +- rebased to 2.33.1 (rhbz#2283542) + +* Thu Apr 04 2024 Dan Horák - 2:2.32.0-1 +- rebased to 2.32.0 (rhbz#2273003) + +* Fri Mar 08 2024 Neal Gompa - 2:2.31.0-2 +- Add 's390-tools' Provides to all packages + +* Mon Feb 05 2024 Dan Horák - 2:2.31.0-1 +- rebased to 2.31.0 (rhbz#2262499) + +* Thu Jan 25 2024 Dan Horák - 2:2.30.0-2 +- add s390utils-se-data as a noarch subpackage with Secure Execution data files + +* Tue Jan 02 2024 Dan Horák - 2:2.30.0-1 +- rebased to 2.30.0 (rhbz#2252519) + +* Fri Dec 01 2023 Fabio Valentini - 2:2.29.0-6 +- Rebuild for openssl crate >= v0.10.60 (RUSTSEC-2023-0044, RUSTSEC-2023-0072) + +* Fri Nov 10 2023 Dan Horák - 2:2.29.0-5 +- enable multi-arch build + +* Fri Nov 10 2023 Dan Horák - 2:2.29.0-4 +- fix upstream kernel installations + +* Mon Oct 23 2023 Yaakov Selkowitz - 2:2.29.0-3 +- Use vendored dependencies in RHEL builds + +* Thu Aug 31 2023 Jakub Čajka - 2:2.29.0-2 +- enable rust based tools + +* Mon Aug 07 2023 Dan Horák - 2:2.29.0-1 +- rebased to 2.29.0 + +* Sat Jul 22 2023 Fedora Release Engineering - 2:2.28.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Tue Jul 11 2023 Dan Horák - 2:2.28.0-1 +- rebased to 2.28.0 + +* Wed May 31 2023 Dan Horák - 2:2.27.0-1 +- rebased to 2.27.0 + +* Fri May 19 2023 Petr Pisar - 2:2.26.0-2 +- Rebuild against rpm-4.19 (https://fedoraproject.org/wiki/Changes/RPM-4.19) + +* Fri Mar 03 2023 Dan Horák - 2:2.26.0-1 +- rebased to 2.26.0 + +* Tue Jan 31 2023 Dan Horák - 2:2.25.0-4 +- add post GA fixes + +* Mon Jan 23 2023 Dan Horák - 2:2.25.0-3 +- revert the kernel install script change + +* Thu Jan 19 2023 Dan Horák - 2:2.25.0-2 +- update kernel install script to write /etc/kernel/cmdline + +* Fri Dec 09 2022 Dan Horák - 2:2.25.0-1 +- rebased to 2.25.0 + +* Tue Nov 22 2022 Dan Horák - 2:2.24.0-2 +- update for Transparent DASD PPRC (Peer-to-Peer Remote Copy) handling + +* Thu Nov 10 2022 Dan Horák - 2:2.24.0-1 +- rebased to 2.24.0 + +* Fri Aug 19 2022 Dan Horák - 2:2.23.0-1 +- rebased to 2.23.0 + +* Sat Jul 23 2022 Fedora Release Engineering - 2:2.22.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Mon Jun 20 2022 Dan Horák - 2:2.22.0-1 +- rebased to 2.22.0 + +* Tue May 31 2022 Dan Horák - 2:2.21.0-2 +- do not fail on emtpy /proc/cmdline when installing kernel (#1899759) + +* Fri Apr 22 2022 Dan Horák - 2:2.21.0-1 +- rebased to 2.21.0 + +* Mon Feb 07 2022 Dan Horák - 2:2.20.0-1 +- rebased to 2.20.0 +- switch to fuse3 + +* Sat Jan 22 2022 Fedora Release Engineering - 2:2.19.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Fri Nov 26 2021 Dan Horák - 2:2.19.0-2 +- update ccw udev rules + +* Fri Nov 12 2021 Dan Horák - 2:2.19.0-1 +- rebased to 2.19.0 +- cmsfs-fuse Requires glibc-gconv-extra (#2022652) + +* Wed Oct 20 2021 Dan Horák - 2:2.18.0-2 +- move vmcp to core (#1931287) + +* Tue Oct 05 2021 Dan Horák - 2:2.18.0-1 +- rebased to 2.18.0 + +* Fri Jul 23 2021 Fedora Release Engineering - 2:2.17.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Wed Jul 07 2021 Dan Horák - 2:2.17.0-1 +- rebased to 2.17.0 +- zfcpconf: set exit code explicitly (#1977434) +- mk-s390image script requires file (#1973239) +- drop obsolete setting from device_cio_free.service (#1972449) + * Mon Mar 01 2021 Dan Horák - 2:2.16.0-2 - drop superfluous Require from s390utils-base diff --git a/sources b/sources index 404b75d..8572938 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ -SHA512 (s390-tools-2.16.0.tar.gz) = d0866e2f372ba2938ccab264846d6cfe3db1b760cff6645fbefcd33a8ce8e7d971e442ccefda7e8e4d59818293147caa57fa593a3e66cd77e1e661928336793c +SHA512 (s390-tools-2.40.0.tar.gz) = 1943429581b280bf9ea370da3700a234d509837cb45b2354cdf79b38db87d2183010d18d9132defd77b9d8e11b7e002c447ffd7c912e20a50da4cb6877758c0e +SHA512 (s390-tools-2.40.0-rust-vendor.tar.xz) = fd1894c4e950a3c51054432731a3aeef4318e794aa4af2dc5fed31da16dce2020f014a64241e44766fb40b0fd6c1ac5943366e38dcfebf264875220ecf1285b5 diff --git a/zfcpconf.sh b/zfcpconf.sh index 8dc05ad..c3c6bf4 100644 --- a/zfcpconf.sh +++ b/zfcpconf.sh @@ -36,7 +36,7 @@ if [ -f "$CONFIG" ]; then modprobe zfcp fi if [ ! -d /sys/bus/ccw/drivers/zfcp ]; then - return + exit 1 fi sed 'y/ABCDEF/abcdef/' < $CONFIG | while read line; do case $line in @@ -74,3 +74,4 @@ if [ -f "$CONFIG" ]; then esac done fi +exit 0