Compare commits

...

242 Commits

Author SHA1 Message Date
Neal Gompa 93479b677f Add 's390-tools' Provides to all packages
The upstream name of this is 's390-tools', and nearly all
other Linux distributions ship it as such. Make life easier
for people by also providing this name.
2024-03-08 10:45:47 -05:00
Dan Horák 882b26e468 unconditionally build with rust 2024-02-05 11:25:21 +00:00
Dan Horák 0226a1b211 - rebased to 2.31.0 (rhbz#2262499) 2024-02-05 11:07:42 +00:00
Dan Horák 3eddb1a036 - add s390utils-se-data as a noarch subpackage with Secure Execution data files 2024-01-26 08:38:00 +00:00
Dan Horák ad9e1ad7a0 - rebased to 2.30.0 (rhbz#2252519) 2024-01-02 14:26:47 +00:00
Yaakov Selkowitz 0f03699129 Fix build with libxml2-2.12.0
https://github.com/ibm-s390-linux/s390-tools/pull/160
2023-12-12 19:50:01 -05:00
Fabio Valentini f00ff2ac55
Rebuild for openssl crate >= v0.10.60 (RUSTSEC-2023-0044, RUSTSEC-2023-0072) 2023-12-01 16:17:48 +01:00
Dan Horák 2c0b6d2ea2 enable multi-arch builds
Select tools are expected to be used on non-s390x platforms, so drop
ExclusiveArch and add a special %files section for this case. The tools
will be available in the s390utils binary rpm.
2023-11-13 10:10:17 +01:00
Dan Horák 8a3c26800a - fix upstream kernel installations
Apply changes from the grub2 kernel install helper script to the zipl
helper.

Related: rhbz#2239008
2023-11-10 12:11:25 +01:00
Dan Horák ca71fe340e let cp remove the destination files
clone of e1206cf45b?branch=rawhide
2023-11-10 11:59:34 +01:00
Dan Horák 7a5c89e84a do not preserve ownership or xattrs on copied files
clone of 8800efcb0b?branch=rawhide
2023-11-10 11:48:10 +01:00
Dan Horák 40db3a57ae rename installed kernel to match name used in boot entry
clone of af4f1536b6?branch=rawhide
2023-11-10 11:41:36 +01:00
Dan Horák 70bd1af9bd request a specific version of zerocopy as we have a newer one too 2023-11-09 11:20:35 +01:00
Dan Horák 51cd104ddd use %license for LICENSE 2023-11-09 09:46:07 +01:00
Dan Horák 5184801f0e switch to %autosetup 2023-10-24 13:40:29 +00:00
Yaakov Selkowitz 535cc10766 Use vendored dependencies in RHEL builds
RHEL does not package individual rust crate dependencies.  Instead,
rust-based packages must vendor these, and use the RHEL macros to
build them.
2023-10-23 20:50:30 -04:00
Jakub Čajka 3b4ba770c1
Move all package options to bconds 2023-09-06 11:00:23 +02:00
Jakub Čajka 702b044c20
Enable rust based tools 2023-09-01 12:44:40 +02:00
Jakub Čajka 3fa397e687
Fix missing semicolon
Resolves: BZ#2235734
2023-08-31 13:08:54 +02:00
Jakub Čajka 9e549c2e6c Convert to the SPDX 2023-08-08 08:51:16 +00:00
Dan Horák 087a10568c - rebased to 2.29.0 2023-08-07 08:50:46 +00:00
Fedora Release Engineering 262d603726 Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-22 00:55:06 +00:00
Dan Horák 4b655c64f1 add rpminspect.yaml 2023-07-14 10:04:29 +02:00
Dan Horák d81d4fd383 - rebased to 2.28.0 2023-07-13 15:10:59 +00:00
Dan Horák da9838c800 modernize %patch usage 2023-05-31 13:10:36 +00:00
Dan Horák b43bfd7eed - rebased to 2.27.0 2023-05-31 12:44:16 +00:00
Petr Písař a6e30a308a Unescape Patch100 definition
Broken with commit 9e98b44d8b.
2023-05-19 16:40:48 +02:00
Petr Písař 57b37fee1f Rebuild against rpm-4.19 (https://fedoraproject.org/wiki/Changes/RPM-4.19) 2023-05-19 16:25:40 +02:00
Dan Horák d6f3723e10 - rebased to 2.26.0 2023-03-03 10:01:46 +00:00
Dan Horák 9e98b44d8b - add post GA fixes 2023-01-31 15:24:52 +01:00
Dan Horák 607a6825f4 Revert "Generate /etc/kernel/cmdline if it does not exist"
This reverts commit 77693cd7eb.

Although it fixes the situation when a new kernel is being installed in
a %post script, it breaks the initial kernel installation, because the
BLS snippet doesn't exists yet.
2023-01-23 13:26:41 +00:00
Dan Horák 685ce32c07 - update kernel install script to write /etc/kernel/cmdline 2023-01-19 10:00:30 +01:00
Robbie Harwood 77693cd7eb Generate /etc/kernel/cmdline if it does not exist
Don't fall back to reading /proc/cmdline: that will likely reflect the
installer environment which will result in a non-booting kernel entry.

See-also: rhbz#1940288
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
2023-01-17 11:35:16 -05:00
Dan Horák c33643ba10 - rebased to 2.25.0 2022-12-09 13:54:52 +00:00
Dan Horák bef2b35dc9 - update for Transparent DASD PPRC (Peer-to-Peer Remote Copy) handling 2022-11-22 17:35:10 +00:00
Dan Horák af41c81d1b - rebased to 2.24.0 2022-11-10 16:45:34 +00:00
Dan Horák 473c14c9ab - rebased to 2.23.0 2022-08-19 09:04:27 +00:00
Fedora Release Engineering a7424a8ff0 Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-23 07:54:12 +00:00
Dan Horák 6f524eab5a add missing BR 2022-06-27 11:49:35 +00:00
Dan Horák ca6b193ac3 - rebased to 2.22.0 2022-06-27 10:20:07 +00:00
Dan Horák cc536faf67 - do not fail on emtpy /proc/cmdline when installing kernel (#1899759) 2022-05-31 11:54:12 +00:00
Dan Horák f7710610d8 chreipl-fcp-mpath man page is distributed pregenerated 2022-04-26 11:47:55 +02:00
Dan Horák 1c93647293 Revert "fix cpictl permissions (#2024102)"
This reverts commit 78ef6e86e5.
2022-04-26 11:15:46 +02:00
Dan Horák a2cb8e5beb - rebased to 2.21.0 2022-04-22 13:27:04 +00:00
Dan Horák 6dc91fa6ea - rebased to 2.20.0
- switch to fuse3
2022-02-07 09:53:18 +00:00
Fedora Release Engineering ad7942bd0c - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-22 00:14:49 +00:00
Dan Horák a483890884 - update ccw udev rules 2021-11-26 16:49:21 +01:00
Dan Horák 78ef6e86e5 fix cpictl permissions (#2024102) 2021-11-18 12:06:45 +00:00
Dan Horák b385215ded - rebased to 2.19.0
- cmsfs-fuse Requires glibc-gconv-extra (#2022652)
2021-11-16 15:38:15 +00:00
Dan Horák c69c48c992 - move vmcp to core (#1931287) 2021-10-21 13:13:40 +02:00
Dan Horák ea8f5ea852 - rebased to 2.18.0 2021-10-05 10:10:21 +00:00
Fedora Release Engineering 083020797b - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-23 16:57:00 +00:00
Dan Horák a8e761756e drop trailing slash when listing dirs with %dir in %files 2021-07-15 10:48:13 +02:00
Dan Horák 287377b414 base should own the /usr/lib64/zkey directory 2021-07-15 10:46:57 +02:00
Dan Horák c1e8b3a309 workaround a build issue with new ld (binutils >= 2.36)
The new ld doesn't ignore an unrecorgnized -no-pie option.

Related: https://github.com/ibm-s390-linux/s390-tools/pull/106
2021-07-14 14:26:27 +02:00
Dan Horák 0419550a2a remove a comment 2021-07-08 11:44:55 +02:00
Dan Horák 9e8e130a7c use URLs for RHEL/Fedora specific scripts and configs 2021-07-08 11:42:31 +02:00
Dan Horák 2a913049ee modernize ccw udev rules 2021-07-08 11:38:29 +02:00
Dan Horák ce7722eab4 - rebased to 2.17.0 2021-07-07 17:49:40 +00:00
Dan Horák e4da637a53 zfcpconf: set exit code explicitly (#1977434) 2021-06-30 11:36:03 +02:00
Dan Horák b2e74b0a3e mk-s390image script requires file 2021-06-22 21:31:28 +02:00
Dan Horák 2bf7d95c95 - drop obsolete setting from device_cio_free.service 2021-06-17 10:00:57 +02:00
Dan Horák 02409651fa - drop superfluous Require from s390utils-base 2021-03-01 10:54:27 +00:00
Dan Horák 3d1d949272 - rebased to 2.16.0 2021-02-24 18:05:21 +00:00
Fedora Release Engineering d792b32be1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-27 19:51:30 +00:00
Tom Stellard 7a34f7d689 Add BuildRequires: make
https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot
2021-01-08 21:02:58 +00:00
Dan Horák 6ce1f4d14f - move lszdev to core 2021-01-05 16:28:32 +00:00
Dan Horák 1409803b15 - move fdasd to core 2021-01-04 16:53:36 +01:00
Dan Horák a823de10da move cio_ignore man page to core too 2020-11-03 16:33:34 +01:00
Petr Šabata ab939b3c36 Fix the development package dependency by adding epoch
Signed-off-by: Petr Šabata <contyk@redhat.com>
2020-10-29 11:15:12 +01:00
Dan Horák 0450181b8e - rebased to 2.15.1 2020-10-29 07:38:46 +00:00
Dan Horák 4a5ecf837b - move mk-s390image to /usr/bin 2020-10-28 08:04:41 +00:00
Dan Horák 1cc3998852 - rebased to 2.15.0 2020-10-27 10:17:25 +00:00
Dan Horák 2ff6f78332 move cio_ignore to core
Seems dracut needs cio_ignore when creating initrd during kernel installation.
2020-10-26 11:16:40 +01:00
Dan Horák 1b35631849 - update scripts for https://fedoraproject.org/wiki/Changes/NetworkManager_keyfile_instead_of_ifcfg_rh 2020-10-07 15:09:59 +02:00
Dan Horák 2f9ebbc0ab bump release 2020-09-21 17:38:52 +02:00
Dan Horák 83bfc0e7d7 - rebuilt for net-snmp 5.9 2020-09-21 17:38:11 +02:00
Dan Horák cf1344b04d fix date in changelog 2020-08-26 10:50:18 +02:00
Dan Horák a895d0c8be - add support for auto LUN scan to zfcpconf.sh (#1552697) 2020-08-26 10:49:18 +02:00
Dan Horák a9bf2dafeb - rebased to 2.14.0 2020-08-25 09:44:19 +02:00
Fedora Release Engineering 1f19dda30e - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-29 10:09:21 +00:00
Javier Martinez Canillas 6f6a4deece - add a default entry in zipl.conf if there isn't one present (#1698363)
When a kernel-debug package is installed, it should only be set as default
if DEFAULTDEBUG=yes is set in /etc/sysconfig/kernel. But currently there's
no default field set in /etc/zipl.conf so the implicit order used to sort
boot entries is used.

The debug kernels contains a +debug suffix which makes them be sorted with
more precedence than non-debug kernels by the RPM sorting algorithm:

rpm --eval '%{lua: print(rpm.vercmp("4.18.0-193.el8.s390x+debug", "4.18.0-193.el8.s390x"))}'
1

So using the implicit order when a debug kernel is installed and a default
is not set leads to a wrong behavior.

The zipl kernel-install script attempts to set a default entry if has to,
but only if one is present in the zipl.conf file. Take also into account
the case when there isn't one to avoid using the implicit sorting and not
cover these corner cases like the one with the debug kernel.

Resolves: rhbz#1698363
2020-07-23 09:32:32 +02:00
Dan Horák b8f75bde3c move more stuff to core
- move {dasd,zfcp}.conf, the installer writes them
- move *_cio_free symlinks, used in initrd
- move dasdinfo, used in initrd
2020-06-11 13:22:27 +02:00
Dan Horák f9a139cce4 move man pages to core 2020-06-11 11:19:11 +02:00
Dan Horák 383f5e27aa update some texts 2020-06-11 11:15:55 +02:00
Jakub Čajka 0aa4b528e1 Clean up systemd post script macros 2020-06-11 11:11:36 +02:00
Jakub Čajka 365ca29316 - split off core package with basic functionalities and reduced deps from base sub-package 2020-06-11 11:11:36 +02:00
Dan Horák e477a92045 fix build with rpm 4.16 2020-06-04 09:44:27 +00:00
Dan Horák 6b21143baa - avoid dependency on network-scripts (part of PR #4) 2020-06-01 10:23:32 +02:00
Jakub Čajka 5e82789fe7 - avoid dependency on network-scrips 2020-06-01 10:21:28 +02:00
Dan Horák 1ec03967cb add missing BR 2020-05-11 07:22:29 -04:00
Dan Horák 974303a2f3 - rebased to 2.13.0 2020-05-11 06:46:04 -04:00
Dan Horák 58aa25016f - rebuilt for json-c soname bump 2020-04-22 18:56:19 +02:00
Fedora Release Engineering 78962171af - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-01-30 22:43:22 +00:00
Dan Horák 6e980e4fa1 - fix service order after switching to real root file system (#1790496, #1790790) 2020-01-14 13:20:20 +01:00
Dan Horák 920a9af392 - rebased to 2.12.0 2020-01-06 06:22:01 -05:00
Dan Horák 4295214706 - drop src_vipa (#1781683)
- kernel-install: skip BOOT_IMAGE param when copying the cmdline to BLS snippets
2019-12-13 13:32:12 +01:00
Javier Martinez Canillas 3e57fc3074 - skip BOOT_IMAGE param when copying the cmdline to BLS snippets
The bootloaders add a BOOT_IMAGE parameter that is present in the kernel
command line exposed via the /proc/cmdline virtual file. If this param
is added to the kernel cmdline in the BLS snippet, it will be duplicated.

Resolves: #1782321
2019-12-13 12:34:26 +01:00
Dan Horák 594bda140c update changelog 2019-12-02 15:52:42 +01:00
Jan Hlavac e0e6dde32f kernel-install: fix BLS-related decision logic
In the commit 63205a4dc4c400f75571869d87682c0cdb475830, there was
introduced a change in the decision logic of the 20-zipl-kernel.install
script. Specifically, whether the Boot Loader Specification (BLS) is
used. Instead of just checking the existence of the /sbin/new-kernel-pkg
file, the existence of the /boot/loader/entries directory is also
checked.

More thorough testing revealed that the above commit covers only the
case when a new kernel is added. However, the remaining cases should
also be covered. That means the case when a rescue kernel is added and
the case when some kernel is removed.

Resolves: #1778243
Fixes: #1755899

Signed-off-by: Jan Hlavac <jhlavac@redhat.com>
2019-12-02 15:52:42 +01:00
Javier Martinez Canillas b3e6ad36b4 - force a BLS config if /boot/loader/entries directory exists (#1755899)
The /usr/lib/kernel/install.d/20-zipl-kernel.install script checks if the
/sbin/new-kernel-pkg script exists to determine whether a BLS config has
to be used or not.

This file should not exist in RHEL8 but it does in some corner cases for
example when doing an in-place upgrade from RHEL7 to RHEL8 since it is
required by the LEAPP tool for the RPM transaction to succeeded.

To cover that, not only check if the /sbin/new-kernel-pkg is not present
but also if the /boot/loader/entries directory exists and use either of
these as a condition to use a BLS configuration.
2019-12-02 15:52:42 +01:00
Javier Martinez Canillas 2cd85a32d2 - remove 00-zipl-prepare.install plugin that is not needed anymore
The kernel-install plugin removed the "${BOOT_DIR_ABS%/*}" directory that
was created unconditionally by the kernel-install script. Since the other
plugins used the existence of this directory as the indication on whether
systemd-boot was used or not.

But now the kernel-install script doesn't unconditionally create this dir
anymore and if $BOOT/$MACHINE_ID exists, so there's no need anymore to do
any cleanup.
2019-12-02 15:52:37 +01:00
Dan Horák 87ca1f4032 update changelog 2019-12-02 13:38:45 +01:00
Dan Horák cb145202ea apply kernel install/update script fixes from #1600480, #1665060 2019-12-02 13:36:48 +01:00
Dan Horák 0379a19cd4 merge stage3 signing support from RHEL 2019-09-12 14:04:25 +02:00
Dan Horák 18c25ca8a6 - rebased to 2.11.0 2019-09-09 08:05:11 -04:00
Dan Horák b42105540f - rebased to 2.10.0 2019-08-05 10:22:13 -04:00
Fedora Release Engineering a8004b6c5b - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-26 22:35:18 +00:00
Dan Horák 4f95e67dc9 - fix /tmp being deleted when kernel-core is installed in a container (#1726286) (javierm) 2019-07-02 17:07:15 +02:00
Javier Martinez Canillas 5229fe4f01 - fix /tmp being deleted when kernel-core is installed in a container (#1726286)
The kernel-install script created unconditionally a $BOOT_DIR_ABS directory
that was used by the sd-boot bootloader. The kernel-install plugins checked
the existence of that directory to decide whether the BLS snippets would be
created in the path expected by sd-boot or the one expected by zipl.

But the $BOOT_DIR_ABS contains the machine ID that's set in the environment
variable $KERNEL_INSTALL_MACHINE_ID. If there's no machine ID set, then the
$BOOT_DIR_ABS is set to a temporary directory that's removed after all the
kernel-install plugins exit.

The $KERNEL_INSTALL_MACHINE_ID isn't set for example when kernel-install is
executed in a container since there won't be an /etc/machine-id file. This
causes 20-zipl-kernel.install script to wrongly remove the /tmp directory.

So if $KERNEL_INSTALL_MACHINE_ID isn't set, just exit the script since the
BLS snippets can't be installed anyways since their filename also contain
the machine ID.

Also, don't attempt to remove $BOOT_DIR_ABS because kernel-install doesn't
create this directory anymore and instead is created only when sd-boot is
installed.
2019-07-02 17:05:48 +02:00
Igor Gnatenko 81aaf37c09
Rebuild for RPM 4.15
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-06-11 17:22:19 +02:00
Dan Horák 61130fa91d - rebased to 2.9.0 2019-05-22 08:27:50 -04:00
Dan Horák 1a182b31d3 - dbginfo.sh needs tar (#1705628) 2019-05-02 19:03:28 +02:00
Dan Horák b1b957aaf0 - fix building zipl with gcc9 (#1687085) 2019-03-09 17:50:42 +01:00
Dan Horák bd0e3fb9c2 - rebased to 2.8.0 2019-02-18 07:31:45 -05:00
Fedora Release Engineering 6fa2feaf5b - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-02-02 14:41:20 +00:00
Igor Gnatenko 378300fbc7 Remove obsolete Group tag
References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag
2019-01-28 20:24:48 +01:00
Dan Horák 234b2c55c3 - create cpacfstats group needed by cpacfstatsd 2019-01-28 16:42:02 +01:00
Dan Horák 848b61ef39 switch to using %{buildroot} only 2019-01-10 10:21:37 +01:00
Dan Horák b45c50cd89 - load protected key support kernel module early on boot 2019-01-10 10:19:08 +01:00
Dan Horák f39b11e184 drop upstreamed patch 2019-01-04 11:25:06 +01:00
Dan Horák 51e189a385 - rebased to 2.7.1 2019-01-02 08:44:15 -05:00
Dan Horák 95b85f6150 - fix deps for dropped cmsfs subpackage 2018-12-05 14:42:09 +01:00
Dan Horák a8e0a7dfa6 - drop the original cmsfs subpackage 2018-11-19 10:22:54 -05:00
Dan Horák b0eb99190c - Make zipl to use the BLS title field as the IPL section name 2018-11-12 17:07:10 +01:00
Dan Horák 01b858f02d - rebased to 2.7.0 2018-10-31 07:21:30 -04:00
Dan Horák 2ff30e744f - don't relink the zkey tools 2018-10-22 15:05:00 +02:00
Peter Jones c301cb59af Make the blscfg sort order match what grub2 and grubby do.
Signed-off-by: Peter Jones <pjones@redhat.com>
2018-10-19 11:56:25 +02:00
Javier Martinez Canillas 2f4b67cd1e Fix kernel-install scripts issues (#1634803)
The 91-zipl.install kernel-install script attempts to execute zipl when a
kernel is installed, but this will fail if there isn't a zipl confg file.

Also, the kernel-install scripts are using ',' as the sed delimiter when
updating the kernel command line options in the BLS fragment file. But it
is valid to have that character in a cmdline so instead use '#' for that.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2018-10-01 19:19:00 +02:00
Dan Horák a8d596d27b - Makefile cleanups 2018-09-21 11:02:12 +02:00
Dan Horák 8473d5923b - drop redundant systemd services installation 2018-09-21 04:55:00 -04:00
Dan Horák 80686e380e fix patch application 2018-09-14 16:17:14 +02:00
Dan Horák 7ffae6dc71 - add FIEMAP support into zipl 2018-09-14 16:07:37 +02:00
Dan Horák 4b248d8445 - fix R:/BR: perl 2018-08-14 13:58:42 +02:00
Dan Horák e9f0a67862 - rebased to 2.6.0
- include zdev dracut module
2018-08-10 16:31:48 +02:00
Dan Horák 36ad014995 - add missing zkey infrastructure (#1610242) 2018-07-31 13:50:38 +02:00
Dan Horák 877da844b3 - don't override TERM for console 2018-07-27 12:13:49 +02:00
Dan Horák f25abae336 - network-scripts are required for network device initialization 2018-07-26 11:40:21 +02:00
Dan Horák 4238dfb8b8 add BR: gcc-c++ 2018-07-16 12:45:50 +02:00
Fedora Release Engineering 8a861db4e5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-07-14 05:39:06 +00:00
Dan Horák dbc645a2c4 - rebased to 2.5.0 2018-06-11 13:24:22 +02:00
Javier Martinez Canillas 6aab78b451
- add BLS support to zipl and add kernel-install scripts to create BLS files
Add patches to support population IPL sections using BootLoaderSpec files
instead of having them defined in the zipl.conf file. This allows to have
a static zipl.conf file, and update the boot entries by just dropping BLS
fragments files in a directory.

In this configuration the grubby tool isn't used, and instead all needed
tasks (copy kernel, generate an initramfs, copy BLS configs, etc) should
be made by kernel-install scripts.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2018-05-30 14:50:30 +02:00
Dan Horák fe78d02b5f - rebased to 2.4.0 2018-05-09 13:23:40 +02:00
Dan Horák 464c5cfccf - fix building zipl with PIE (#1566140) 2018-04-13 11:18:52 +02:00
Dan Horák 7b458c246c - fix LDFLAGS injection (#1552661) 2018-03-12 15:59:40 +01:00
Rafael Santos 00a29e6617 - rebased to 2.3.0 2018-02-21 16:08:09 +01:00
Fedora Release Engineering 6e58e0e033 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-02-09 15:59:48 +00:00
Dan Horák 732529cc93 - fix build with non-standard %dist 2018-01-22 16:51:08 +01:00
Dan Horák 2136cc04f3 - rebased to 2.2.0 2017-12-07 21:08:30 +01:00
Dan Horák a1273c9e55 - rebased to 2.1.0 2017-09-25 20:49:38 +02:00
Dan Horák eafdf584a3 - rebased to first public release on github, functionally same as 1.39.0
- relicensed to MIT
2017-08-23 12:31:20 +02:00
Dan Horák fca7af8cca - rebased to 1.39.0
- completed switch to systemd
- further cleanups and consolidation
2017-08-23 11:49:40 +02:00
Dan Horák 630487b266 - rebuild for librpm soname bump in rpm 4.13.90 2017-08-16 08:45:47 +02:00
Fedora Release Engineering 4436a3ae49 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild 2017-08-03 08:03:37 +00:00
Fedora Release Engineering 00742af605 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild 2017-07-27 18:03:39 +00:00
Dan Horák c05343e784 - rebased to 1.37.1
- removed chmem/lsmem as they are now provided by util-linux >= 2.30 (#1452792)
2017-05-19 19:19:18 +02:00
Fedora Release Engineering 6edd79ac77 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild 2017-02-11 13:00:31 +00:00
Dan Horák 3b8ed19f61 - rebased to 1.36.1 2016-12-01 13:39:09 +01:00
Dan Horák e9821c7327 fix cpuplugd unit file permissions 2016-10-20 16:36:53 +02:00
Dan Horák 19c274d2c1 - rebased to 1.36.0
- switch cpuplugd to systemd service
2016-09-07 14:22:34 +02:00
Dan Horák ab7d7190d9 UsrMove - convert device_cio_free systemd unit 2016-04-22 08:49:48 -04:00
Dan Horák e8b1d98fd9 UsrMove - convert udev rules and helpers 2016-04-22 08:39:09 -04:00
Dan Horák 0719e3d656 UsrMove - convert /sbin 2016-04-22 08:31:24 -04:00
Dan Horák be742c4d1e add changelog 2016-04-22 08:02:19 -04:00
Dan Horák a27744e717 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild 2016-04-22 08:01:18 -04:00
Fedora Release Engineering 0ecf7ba62d - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild 2016-02-04 23:31:28 +00:00
Dan Horák 5f6d5eeb14 - rebuild for librpm soname bump 2015-10-01 14:20:38 +02:00
Dan Horák 9ef764d5fa - rebased to 1.30.0 2015-07-17 16:42:23 +02:00
Dan Horák 056c251a8d - rebased to 1.29.0
- dropped daemon hardening patch as hardening is enabled globally
- added hmcdrvfs and cpacfstatsd subpackages
- install systemd units where available
2015-06-23 06:20:42 -04:00
Dennis Gilmore d7aa0839fa - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild 2015-06-19 00:11:12 +00:00
Dan Horák 417b9f047d - remove bashism from zfcpconf.sh 2015-04-07 14:04:00 +02:00
Dan Horák 52a75a97d6 - refresh from RHEL-7
- update patches
 - add zdsfs subpackage
 - rebase src_vipa to 2.1.0
2015-01-28 10:27:04 +01:00
Dan Horák 8161782040 - update device_cio_free script
- udpate Requires for ziomon subpackage
2014-10-09 15:34:45 +02:00
Dan Horák cb471f71a7 - update for -Werror=format-security 2014-06-11 09:52:44 +02:00
Dennis Gilmore 005a97d227 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild 2014-06-08 00:39:08 -05:00
Dan Horák a1d11a8050 - fix zFCP device discovery in anaconda GUI (#1054691) 2014-03-04 12:59:40 +01:00
Dan Horák 826b40fc84 - znetconf: Allow for 16-char network interface names (#1062285)
- qetharp: Allow for 16-char network interface names (#1062250)
2014-02-10 10:43:12 +01:00
Dan Horák d9a5b0a957 fix dates in changelog 2014-02-03 12:38:08 +01:00
Dan Horák eac4499021 - znetconf,lsqeth: Allow for 16-char network interface name (#1060303) 2014-02-03 09:57:59 +01:00
Dan Horák 26ce349f9f - zipl: Fix zfcpdump "struct job_ipl_data" initialization (#1058856) 2014-01-29 10:54:29 +01:00
Dan Horák c69f03294b - zipl: fix segmentation fault in automenu array (#1017541)
- zfcpconf.sh: check current online state before setting zfcp device online (#1042496)
2014-01-15 15:25:27 +01:00
Dan Horák ba2d5f1e1e - dbginfo.sh: enhancements for script execution and man page (#1031144)
- dbginfo.sh: avoid double data collection (#1032068)
2013-11-20 10:16:18 +01:00
Dan Horák b8434861eb - build daemons hardened (#881250)
- zipl: Use "possible_cpus" kernel parameter (#1016180)
2013-11-07 11:45:30 +01:00
Dan Horák d93a0307e6 - dbginfo.sh: Avoiding exclusion list for pipes in sysfs (#996732)
- zipl: Fix zipl "--force" option for DASD multi-volume dump (#997361)
2013-08-21 12:18:42 +02:00
Dennis Gilmore fac999b58c - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild 2013-08-04 08:15:56 -05:00
Dan Horák e9ac32a671 - rebased to 1.23 (#804774) 2013-07-24 21:43:43 +02:00
Dan Horák 92554497c5 - update with patches from RHEL-6
- rebase zIPL to 1.21 to fix booting from FBA DASD (#970859)
2013-06-05 16:43:28 +02:00
Dan Horák 02f5ea8199 - drop the libzfcphbaapi subpackage as it is moved to its own package (#963670)
- update the zfcp udev rules (#958197)
- fix runtime dependencies for osasnmpd (#965413)
2013-05-24 10:57:23 +02:00
Dan Horák 2497f58367 disable libzfcphbaapi subpackage, fails to build with recent kernels 2013-03-27 10:13:40 +01:00
Dennis Gilmore c4e809d860 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild 2013-02-14 17:23:20 -06:00
Dan Horák 8047935446 updated to 1.20.0 (#804774) 2012-12-19 12:05:48 +01:00
Dan Horák 8f75616a70 clean BuildRequires a bit 2012-11-22 14:40:53 +01:00
Dan Horák 88755424bf zipl: Flush disk buffers before installing IPL record (#857814) 2012-09-17 10:17:26 +02:00
Dan Horák bf8cdf527f add support fro CEX4 devices to chzcrypt/lszcrypt (#847092) 2012-08-27 16:37:41 +02:00
Dan Horák 6a9781520b - spec cleanup
- fix syntax in s390.sh
2012-08-27 12:19:53 +02:00
Dan Horák 010c710cde - spec cleanup
- move udev rules to /lib/udev
2012-08-27 12:10:15 +02:00
Dan Horák 74e0e0ad2b add updated patch 2012-08-27 11:54:37 +02:00
Dan Horák a087fe2085 updated to 1.19.0 (#804774) 2012-08-27 11:52:32 +02:00
Dan Horák 6fbd3578d3 fix sources 2012-08-21 10:34:49 +02:00
Dan Horák f1ed814c1e package new files 2012-08-21 10:27:23 +02:00
Dan Horák 24e8c7b06e updated to 1.17.0
- add support for new storage device on System z (#847086)
2012-08-21 10:18:36 +02:00
Dan Horák 189dbe41b5 fix libzfcphbaapi for recent kernels 2012-08-16 19:05:43 +02:00
Dennis Gilmore ca75beda49 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild 2012-07-21 13:46:50 -05:00
Dan Horák f42c8ffb83 fix build with kernel 3.x on the builder 2012-07-11 16:41:40 +02:00
Dan Horák 0355cd14d3 improve DASD parameters handling in normalize_dasd_arg (#824807) 2012-05-25 09:04:27 +02:00
Dan Horák 8c7c2bc4db add normalize_dasd_arg script (#823078) 2012-05-23 08:29:40 +02:00
Dan Horák 83347f5b69 ethtool is required by lsqeth (#821421) 2012-05-14 15:01:16 +02:00
Dan Horák b7bb250113 updated the Fedora patch set - no vol_id tool in udev (#819530) 2012-05-11 15:36:47 +02:00
Dan Horák 0a5f094516 zipl.conf must be owned by s390utils-base (#818877) 2012-05-07 10:25:15 +02:00
Dan Horák a3d1b97a2b fix file list 2012-04-17 10:12:01 +02:00
Dan Horák 0873b756e6 install the z90crypt udev rule (moved here from the udev package) 2012-04-17 10:00:09 +02:00
Dan Horák ca07d6e6f0 include fixed ccw_init and updated device_cio_free 2012-04-10 12:02:49 +02:00
Dennis Gilmore 36d50ba5f4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild 2012-01-13 21:31:24 -06:00
Dan Horák efa3adb0c7 add new files to the base subpackage 2012-01-02 12:24:39 +01:00
Dan Horák 0bac35f34d rebased to 1.16.0 2012-01-02 12:09:10 +01:00
Dan Horák 0f8ea96725 fix sources 2011-08-16 18:21:07 +02:00
Dan Horák 0425b960dc rebased to 1.14.0 2011-08-16 18:12:31 +02:00
Dan Horák e46958f573 disable the libzfcphbaapi subpackage 2011-04-27 10:59:58 +02:00
Dan Horák ffb1d0d0c7 fix installation of the device_cio_free systemd unit 2011-04-27 10:58:35 +02:00
Dan Horák c46bddaf55 updated ccw udev rules
converted cio_free_device from an upstart job to systemd unit (jstodola)
mon_statd: switch to using udevadm settle (#688140)
cpuplugd: Fix incorrect multiplication in rules evaluation (#693365)
cmsfs-fuse: Delete old file if renaming to an existing file (#690505)
cmsfs-fuse: Enlarge fsname string (#690506)
cmsfs-fuse: Unable to use cmsfs-fuse if $HOME is not set (#690514)
hyptop: Prevent interactive mode on s390 line mode terminals (#690810)
2011-04-27 10:41:28 +02:00
Dan Horák f7e20b2418 updated to recent RHEL-6 package 2011-03-25 14:59:32 +01:00
Dan Horák 0b15456cd5 Revert "Retire s390utils."
This reverts commit 6ab82307f5.
2011-03-09 18:23:34 +01:00
Bill Nottingham 6ab82307f5 Retire s390utils. 2011-02-23 16:55:16 -05:00
Dennis Gilmore c7db9ea9ed - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild 2011-02-09 05:20:24 -06:00
Fedora Release Engineering de4f3daca2 dist-git conversion 2010-07-29 11:59:15 +00:00
Dan Horák 32f454a29c - lsluns: uninitialized value on adapter offline (#611795)
- zfcpdbf: Fix 'Use of uninitialized value' and output issues (#612622)
2010-07-13 15:35:14 +00:00
Dan Horák 9e27916392 update to match the EL-6 version 2010-07-07 13:42:34 +00:00
Dan Horák c6b0da566c - fix linking with --no-add-needed 2010-06-10 07:13:42 +00:00
Dan Horák 3fd1d439f7 - fixed return codes in ziorep (#556849)
- fixed return code in lstape (#556910)
- fixed reading the size of /proc/sys/vm/cmm_pages in cpuplugd (#556911)
- support new attributes in lsqeth (#556915)
2010-01-20 08:22:59 +00:00
Dan Horák f1bcb16346 - updated device_cio_free script (#533494)
- fixed uppercase conversion in lscss (#554768)
2010-01-13 08:53:00 +00:00
Dan Horák 970848073e - updated device_cio_free script (#533494) 2010-01-08 11:15:27 +00:00
Dan Horák 2d050c5e5f - updated device_cio_free script (#533494) 2010-01-08 07:47:01 +00:00
Dan Horák aea23e74fb update the cpi initscript 2009-12-22 11:24:25 +00:00
Dan Horák 925b343a65 - fixed return value in cpi initscript (#541389)
- updated zfcpconf.sh script from dracut
- added device-mapper support into zipl (#546280)
- added missing check and print NSS name in case an NSS has been IPLed
    (#546297)
- added device_cio_free script and its symlinks
- added qualified return codes and further error handling in znetconf
    (#548487)
2009-12-22 11:00:08 +00:00
Bill Nottingham 9006f09f29 Fix typo that causes a failure to update the common directory. (releng
#2781)
2009-11-25 23:15:19 +00:00
Dan Horák b04575bb79 - added multiple fixes from IBM (#533955, #537142, #537144) 2009-11-13 10:22:21 +00:00
Dan Horák 74a9a67fe8 - added udev rules and script for dasd initialization (#536966)
- added ghosted zfcp and dasd config files, fixes their ownership on the
    system
- fixed upgrade path for libzfcphbaapi-devel subpackage
2009-11-12 14:42:40 +00:00
Dan Horák 7568a722ac - added files for the CPI feature (#463282)
- built lib-zfcp-hbaabi library as vendor lib, switched from -devel (no
    devel content now) to -docs subpackage (#532707)
2009-11-09 19:30:31 +00:00
Dan Horák 42fa73d556 - install dasd udev rules provided by the s390-tools
- added patch for setting readahead value
2009-10-30 11:39:29 +00:00
Dan Horák 3085ce2c4a - added patch for improving mon_statd behaviour
- rebased to 1.8.2
2009-10-08 13:55:38 +00:00
Dan Horák 50a7deb725 - really changed ramdisk load address (#526339)
- change the required and optional subpackages for the meta package
2009-10-04 16:01:13 +00:00
Dan Horák 4ea3cbdd49 - changed ramdisk load address (#526339)
- updated zfcpconf.sh script to new sysfs interface (#526324)
- added 1.8.1 fixes from IBM (#525495)
2009-09-30 20:09:33 +00:00
46 changed files with 2887 additions and 2588 deletions

View File

@ -1,4 +0,0 @@
s390-tools-1.8.1.tar.bz2
cmsfs-1.1.8c.tar.gz
lib-zfcp-hbaapi-2.0.tar.gz
src_vipa-2.0.4.tar.gz

9
.gitignore vendored Normal file
View File

@ -0,0 +1,9 @@
s390-tools-1.8.2.tar.bz2
cmsfs-1.1.8c.tar.gz
lib-zfcp-hbaapi-2.0.tar.gz
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-*.tar.gz
/s390-tools-*-rust-vendor.tar.xz

View File

@ -1,27 +0,0 @@
From 1536e0140cbce3c8837478cfc25ea45dc3681cce Mon Sep 17 00:00:00 2001
From: Dan Horak <dan@danny.cz>
Date: Sun, 20 Jul 2008 09:24:05 +0200
Subject: [PATCH] s390-tools-1.5.3-zipl-zfcpdump-2
---
common.mak | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/common.mak b/common.mak
index 62c17e2..3acb534 100644
--- a/common.mak
+++ b/common.mak
@@ -38,8 +38,8 @@ GROUP = $(shell id -gn)
export INSTROOT BINDIR LIBDIR MANDIR OWNER GROUP
# Special defines for zfcpdump
-ZFCPDUMP_DIR = /usr/local/share/zfcpdump
-ZFCPDUMP_IMAGE = zfcpdump.image
+ZFCPDUMP_DIR = /boot
+ZFCPDUMP_IMAGE = zfcpdump
ZFCPDUMP_RD = zfcpdump.rd
export ZFCPDUMP_DIR ZFCPDUMP_IMAGE ZFCPDUMP_RD
endif
--
1.6.0.6

View File

@ -1,423 +0,0 @@
From 1648e0dab246190c170e82244c790ef8e9144e40 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Thu, 23 Apr 2009 11:45:36 +0200
Subject: [PATCH] s390-tools-1.8.1-zipl-automenu
---
zipl/man/zipl.8 | 7 ++
zipl/src/job.c | 194 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
zipl/src/scan.c | 4 +-
zipl/src/zipl.c | 1 +
4 files changed, 197 insertions(+), 9 deletions(-)
diff --git a/zipl/man/zipl.8 b/zipl/man/zipl.8
index 8a83c01..6ebf240 100644
--- a/zipl/man/zipl.8
+++ b/zipl/man/zipl.8
@@ -249,6 +249,13 @@ whether they contain a dump signature or not.
This option can only be used together with
.BR \-\-mvdump .
+.TP
+.BR "\-x" " or " "\-\-no-automenu"
+Disables the automatic creation of a multiboot menu. Specifying a menu with the
+"-m <MENU>" option or a section disables this feature, too. This option was
+added for compatibility with previous versions of the multiboot version of
+zipl.
+
.SH EXAMPLE
1. Scenario: prepare disk for booting a Linux kernel image using the
following parameters:
diff --git a/zipl/src/job.c b/zipl/src/job.c
index 2f69104..1b7bcb2 100644
--- a/zipl/src/job.c
+++ b/zipl/src/job.c
@@ -43,6 +43,7 @@ static struct option options[] = {
{ "version", no_argument, NULL, 'v'},
{ "verbose", no_argument, NULL, 'V'},
{ "add-files", no_argument, NULL, 'a'},
+ { "no-automenu", no_argument, NULL, 'x'},
{ "tape", required_argument, NULL, 'T'},
{ "dry-run", no_argument, NULL, '0'},
{ "force", no_argument, NULL, 'f'},
@@ -50,7 +51,7 @@ static struct option options[] = {
};
/* Command line option abbreviations */
-static const char option_string[] = "-c:t:i:r:p:P:d:D:M:s:m:hHnVvaT:f";
+static const char option_string[] = "-c:t:i:r:p:P:d:D:M:s:m:hHnVvaxT:f";
struct command_line {
char* data[SCAN_KEYWORD_NUM];
@@ -62,11 +63,14 @@ struct command_line {
int version;
int verbose;
int add_files;
+ int automenu;
int dry_run;
int force;
enum scan_section_type type;
};
+/* Global variable for default boot target. Ugly but necessary... */
+static char *default_target;
static int
store_option(struct command_line* cmdline, enum scan_keyword_id keyword,
@@ -92,6 +96,7 @@ get_command_line(int argc, char* argv[], struct command_line* line)
int i;
memset((void *) &cmdline, 0, sizeof(struct command_line));
+ cmdline.automenu = 1;
cmdline.type = section_invalid;
is_keyword = 0;
/* Process options */
@@ -101,16 +106,22 @@ get_command_line(int argc, char* argv[], struct command_line* line)
switch (opt) {
case 'd':
is_keyword = 1;
+ cmdline.automenu = 0;
+ scan_key_table[1][8] = req;
rc = store_option(&cmdline, scan_keyword_dumpto,
optarg);
break;
case 'D':
is_keyword = 1;
+ cmdline.automenu = 0;
+ scan_key_table[1][8] = req;
rc = store_option(&cmdline, scan_keyword_dumptofs,
optarg);
break;
case 'M':
is_keyword = 1;
+ cmdline.automenu = 0;
+ scan_key_table[1][8] = req;
rc = store_option(&cmdline, scan_keyword_mvdump,
optarg);
#ifndef __s390x__
@@ -121,35 +132,49 @@ get_command_line(int argc, char* argv[], struct command_line* line)
break;
case 'i':
is_keyword = 1;
+ cmdline.automenu = 0;
+ scan_key_table[1][8] = req;
rc = store_option(&cmdline, scan_keyword_image,
optarg);
break;
case 'P':
+ cmdline.automenu = 0;
+ scan_key_table[1][8] = req;
rc = store_option(&cmdline, scan_keyword_parameters,
optarg);
break;
case 'p':
is_keyword = 1;
+ cmdline.automenu = 0;
+ scan_key_table[1][8] = req;
rc = store_option(&cmdline, scan_keyword_parmfile,
optarg);
break;
case 'r':
is_keyword = 1;
+ cmdline.automenu = 0;
+ scan_key_table[1][8] = req;
rc = store_option(&cmdline, scan_keyword_ramdisk,
optarg);
break;
case 's':
is_keyword = 1;
+ cmdline.automenu = 0;
+ scan_key_table[1][8] = req;
rc = store_option(&cmdline, scan_keyword_segment,
optarg);
break;
case 't':
is_keyword = 1;
+ cmdline.automenu = 0;
+ scan_key_table[1][8] = req;
rc = store_option(&cmdline, scan_keyword_target,
optarg);
break;
case 'T':
is_keyword = 1;
+ cmdline.automenu = 0;
+ scan_key_table[1][8] = req;
rc = store_option(&cmdline, scan_keyword_tape,
optarg);
break;
@@ -190,6 +215,10 @@ get_command_line(int argc, char* argv[], struct command_line* line)
case 'f':
cmdline.force = 1;
break;
+ case 'x':
+ cmdline.automenu = 0;
+ scan_key_table[1][8] = req;
+ break;
case 1:
/* Non-option is interpreted as section name */
if (cmdline.section != NULL) {
@@ -214,6 +243,9 @@ get_command_line(int argc, char* argv[], struct command_line* line)
if (cmdline.help || cmdline.version) {
/* Always accept --help and --version */
} else if ((cmdline.menu != NULL) || (cmdline.section != NULL)) {
+ /* If either menu or section has been selected disable
+ automenu generation */
+ cmdline.automenu = 0;
/* Config file mode */
if ((cmdline.menu != NULL) && (cmdline.section != NULL)) {
error_reason("Option 'menu' cannot be used when "
@@ -832,7 +864,14 @@ get_job_from_section_data(char* data[], struct job_data* job, char* section)
/* IPL job */
job->id = job_ipl;
/* Fill in name of bootmap directory */
- job->bootmap_dir = misc_strdup(data[(int) scan_keyword_target]);
+ if (data[(int) scan_keyword_target] == NULL) {
+ if (default_target == NULL) {
+ error_text("Unable to find default section in your config file.");
+ break;
+ }
+ job->bootmap_dir = misc_strdup(default_target);
+ } else
+ job->bootmap_dir = misc_strdup(data[(int) scan_keyword_target]);
if (job->bootmap_dir == NULL)
return -1;
/* Fill in name and address of image file */
@@ -1102,6 +1141,8 @@ get_menu_job(struct scan_token* scan, char* menu, struct job_data* job)
if (temp_job == NULL)
return -1;
memset((void *) temp_job, 0, sizeof(struct job_data));
+ if (data[(int) scan_keyword_target] == NULL)
+ data[(int) scan_keyword_target] = misc_strdup(job->bootmap_dir);
rc = get_job_from_section_data(data, temp_job,
job->data.menu.entry[current].name);
if (rc) {
@@ -1150,6 +1191,7 @@ get_default_section(struct scan_token* scan, char** section, int* is_menu)
i = scan_find_section(scan, DEFAULTBOOT_SECTION,
scan_id_section_heading, 0);
if (i<0) {
+ *section = NULL;
error_reason("No '" DEFAULTBOOT_SECTION "' section found and "
"no section specified on command line");
return -1;
@@ -1169,6 +1211,7 @@ get_default_section(struct scan_token* scan, char** section, int* is_menu)
}
}
/* Should not happen */
+ *section = NULL;
error_reason("No default section specified");
return -1;
}
@@ -1184,19 +1227,35 @@ get_section_job(struct scan_token* scan, char* section, struct job_data* job,
{
char* data[SCAN_KEYWORD_NUM];
char* buffer;
+ char* default_section;
int rc;
int i;
+ rc = get_default_section(scan, &default_section, &i);
+ if (rc)
+ return rc;
if (section == NULL) {
- rc = get_default_section(scan, &section, &i);
- if (rc)
- return rc;
+ section = default_section;
if (i) {
/* 'defaultmenu' was specified */
rc = get_menu_job(scan, section, job);
return rc;
}
}
+ else
+ {
+ char* name = NULL;
+
+ for (i = 0; (int) scan[i].id != 0; i++) {
+ if (scan[i].id == scan_id_section_heading) {
+ name = scan[i].content.section.name;
+ }
+ if (scan[i].id == scan_id_keyword_assignment &&
+ scan[i].content.keyword.keyword == scan_keyword_target &&
+ !strcmp(DEFAULTBOOT_SECTION, name))
+ default_target = misc_strdup(scan[i].content.keyword.value);
+ }
+ }
if (strcmp(section, DEFAULTBOOT_SECTION) == 0) {
error_reason("Special section '" DEFAULTBOOT_SECTION "' cannot "
"be used as target section");
@@ -1268,10 +1327,118 @@ get_section_job(struct scan_token* scan, char* section, struct job_data* job,
}
+/* Create a fake menu to simulate the old s390utils-1.1.7 multiboot
+ * behaviour. */
+static struct scan_token *
+create_fake_menu(struct scan_token *scan)
+{
+ int i, j, pos, numsec, size, defaultpos;
+ char *name;
+ char *target;
+ char *timeout;
+ char *seclist[1024];
+ char *defaultsection;
+ char buf[1024];
+ struct scan_token *tmp;
+
+ /* Count # of sections */
+ numsec = 0;
+ name = NULL;
+ target = NULL;
+ timeout = NULL;
+ for (i = 0; (int) scan[i].id != 0; i++) {
+ if (scan[i].id == scan_id_section_heading) {
+ name = scan[i].content.section.name;
+ if (strcmp(DEFAULTBOOT_SECTION, name))
+ seclist[numsec++] = name;
+ }
+ if (scan[i].id == scan_id_keyword_assignment &&
+ (scan[i].content.keyword.keyword == scan_keyword_dumpto ||
+ scan[i].content.keyword.keyword == scan_keyword_dumptofs)) {
+ numsec--;
+ continue;
+ }
+ if (scan[i].id == scan_id_keyword_assignment &&
+ scan[i].content.keyword.keyword == scan_keyword_target &&
+ !strcmp(DEFAULTBOOT_SECTION, name))
+ target = scan[i].content.keyword.value;
+
+ if (scan[i].id == scan_id_keyword_assignment &&
+ scan[i].content.keyword.keyword == scan_keyword_timeout)
+ timeout = scan[i].content.keyword.value;
+ }
+ get_default_section(scan, &defaultsection, &j);
+
+ if (defaultsection == NULL) {
+ error_text("Unable to find default section in your config file.");
+ return NULL;
+ }
+
+ if (target == NULL) {
+ error_text("Keyword target is missing in default section.");
+ return NULL;
+ }
+
+ default_target = misc_strdup(target);
+
+ size = i+6+numsec;
+ tmp = (struct scan_token *) misc_malloc(size * sizeof(struct scan_token));
+ if (tmp == NULL) {
+ error_text("Couldn't allocate memory for menu entries");
+ return NULL;
+ }
+
+ memset(tmp, 0, size * sizeof(struct scan_token));
+ memcpy(tmp, scan, i * sizeof(struct scan_token));
+ free(scan);
+ scan = tmp;
+
+ defaultpos = 0;
+ for (j = 0; j < numsec; j++) {
+ if (!strcmp(defaultsection, seclist[j]))
+ defaultpos = j+1;
+ }
+
+ snprintf(buf, 1024, "%d", defaultpos);
+
+ scan[i].id = scan_id_menu_heading;
+ scan[i].line = i;
+ scan[i++].content.menu.name = misc_strdup("rh-automatic-menu");
+ scan[i].id = scan_id_keyword_assignment;
+ scan[i].line = i;
+ scan[i].content.keyword.keyword = scan_keyword_target;
+ scan[i++].content.keyword.value = misc_strdup(target);
+ scan[i].id = scan_id_keyword_assignment;
+ scan[i].line = i;
+ scan[i].content.keyword.keyword = scan_keyword_default;
+ scan[i++].content.keyword.value = misc_strdup(buf);
+ scan[i].id = scan_id_keyword_assignment;
+ scan[i].line = i;
+ scan[i].content.keyword.keyword = scan_keyword_prompt;
+ scan[i++].content.keyword.value = misc_strdup("1");
+ scan[i].id = scan_id_keyword_assignment;
+ scan[i].line = i;
+ scan[i].content.keyword.keyword = scan_keyword_timeout;
+ if (timeout)
+ scan[i++].content.keyword.value = misc_strdup(timeout);
+ else
+ scan[i++].content.keyword.value = misc_strdup("15");
+
+ pos = i;
+ for (i = 0; i<numsec; i++) {
+ scan[pos].id = scan_id_number_assignment;
+ scan[pos].line = pos;
+ scan[pos].content.number.number = i+1;
+ scan[pos++].content.number.value = misc_strdup(seclist[i]);
+ }
+
+ return scan;
+}
+
static int
get_job_from_config_file(struct command_line* cmdline, struct job_data* job)
{
- struct scan_token* scan;
+ struct scan_token* scan, *nscan;
char* filename;
char* source;
int rc;
@@ -1303,9 +1470,22 @@ get_job_from_config_file(struct command_line* cmdline, struct job_data* job)
scan_free(scan);
return rc;
}
+
+ if (cmdline->automenu) {
+ nscan = create_fake_menu(scan);
+ if (nscan == NULL) {
+ scan_free(scan);
+ return -1;
+ }
+ scan = nscan;
+ }
+
/* Get job from config file data */
- if (cmdline->menu != NULL)
+ if (cmdline->menu != NULL || cmdline->automenu) {
+ if (cmdline->automenu)
+ cmdline->menu = misc_strdup("rh-automatic-menu");
rc = get_menu_job(scan, cmdline->menu, job);
+ }
else {
rc = get_section_job(scan, cmdline->section, job,
cmdline->data[(int) scan_keyword_parameters]);
diff --git a/zipl/src/scan.c b/zipl/src/scan.c
index 9948092..caca3cf 100644
--- a/zipl/src/scan.c
+++ b/zipl/src/scan.c
@@ -33,9 +33,9 @@ enum scan_key_state scan_key_table[SCAN_SECTION_NUM][SCAN_KEYWORD_NUM] = {
* rs enu
*/
/* defaultboot */
- {opt, inv, inv, inv, inv, inv, inv, inv, inv, inv, inv, opt, inv, inv},
+ {opt, inv, inv, inv, inv, inv, inv, inv, req, inv, opt, opt, inv, inv},
/* ipl */
- {inv, inv, inv, req, opt, opt, opt, inv, req, inv, inv, inv, inv, inv},
+ {inv, inv, inv, req, opt, opt, opt, inv, opt, inv, inv, inv, inv, inv},
/* segment load */
{inv, inv, inv, inv, inv, inv, inv, req, req, inv, inv, inv, inv, inv},
/* part dump */
diff --git a/zipl/src/zipl.c b/zipl/src/zipl.c
index f99177d..2a11404 100644
--- a/zipl/src/zipl.c
+++ b/zipl/src/zipl.c
@@ -71,6 +71,7 @@ static const char* usage_text[] = {
"-n, --noninteractive Answer all confirmation questions with 'yes'",
"-V, --verbose Provide more verbose output",
"-a, --add-files Add all referenced files to bootmap file",
+"-x, --no-automenu Don't autogenerate multiboot menu",
" --dry-run Simulate run but don't modify IPL records"
};
--
1.6.0.6

View File

@ -1,33 +0,0 @@
From 0ac6c456898d8c09908a35add45d018eb8f76613 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Thu, 23 Apr 2009 11:46:01 +0200
Subject: [PATCH] s390-tools-1.8.1-fdasd-su
---
fdasd/fdasd.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/fdasd/fdasd.c b/fdasd/fdasd.c
index ef01c9b..b6802f9 100644
--- a/fdasd/fdasd.c
+++ b/fdasd/fdasd.c
@@ -2005,10 +2005,12 @@ fdasd_get_geometry (fdasd_anchor_t *anc)
if (anc->verbose) printf("disk type check : ok\n");
if (dasd_info.FBA_layout != 0) {
- snprintf(err_str, ERROR_STRING_SIZE,
- "%s is not formatted with z/OS compatible "
- "disk layout!", options.device);
- fdasd_error(anc, wrong_disk_format, err_str);
+ if(!anc->silent) {
+ snprintf(err_str, ERROR_STRING_SIZE,
+ "%s is not formatted with z/OS compatible "
+ "disk layout!", options.device);
+ fdasd_error(anc, wrong_disk_format, err_str);
+ }
}
if (anc->verbose) printf("disk layout check : ok\n");
--
1.6.0.6

View File

@ -1,153 +0,0 @@
From 9c34968b40aa5fee679abf0056255510333ae9c3 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Thu, 23 Apr 2009 11:46:16 +0200
Subject: [PATCH] s390-tools-1.8.1-fdasd-raid-lvm
---
fdasd/fdasd.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 53 insertions(+), 12 deletions(-)
diff --git a/fdasd/fdasd.c b/fdasd/fdasd.c
index b6802f9..286b0bb 100644
--- a/fdasd/fdasd.c
+++ b/fdasd/fdasd.c
@@ -258,10 +258,10 @@ fdasd_error(fdasd_anchor_t *anc, enum fdasd_failure why, char *str)
static int
read_line(void)
{
- bzero(line_buffer, LINE_LENGTH);
line_ptr = line_buffer;
if (!fgets(line_buffer, LINE_LENGTH, stdin))
return 0;
+ line_buffer[LINE_LENGTH-1] = 0;
while (*line_ptr && !isgraph(*line_ptr))
line_ptr++;
return *line_ptr;
@@ -310,6 +310,10 @@ fdasd_partition_type (char *str)
strcpy(str, "Linux native");
else if (strncmp("SWAP ", str, 6) == 0)
strcpy(str, "Linux swap");
+ else if (strncmp("RAID ", str, 6) == 0)
+ strcpy(str, "Linux Raid");
+ else if (strncmp("LVM ", str, 6) == 0)
+ strcpy(str, "Linux LVM");
else
strcpy(str, "unknown");
@@ -1117,14 +1121,24 @@ fdasd_write_vtoc_labels (fdasd_anchor_t *anc)
strncpy(c1, s2, 31);
}
else {
+ char str[20];
char *tmp = strstr(ch, "SWAP");
+ char *tmp1 = strstr(ch, "RAID");
/* create a new data set name */
while (getpos(anc, k) > -1)
k++;
setpos(anc, k, i-1);
-
+
+ strncpy(s2, ch, 44);
+ s2[44]=0;
+ vtoc_ebcdic_dec(s2, s2, 44);
+ c2 = strstr(s2, "PART");
+ if (c2 != NULL) strncpy(str, c2+=9, 6);
+ str[6] = '\0';
+ fdasd_partition_type(str);
+
strncpy(ch, "LINUX.V "
" ", 44);
@@ -1140,10 +1154,21 @@ fdasd_write_vtoc_labels (fdasd_anchor_t *anc)
strncpy(c1, dsno, 4);
c1 += 4;
- if (tmp)
- strncpy(c1, ".SWAP", 5);
- else
- strncpy(c1, ".NATIVE", 7);
+ if (tmp || tmp1) {
+ if (tmp)
+ strncpy(c1, ".SWAP", 5);
+ if (tmp1)
+ strncpy(c1, ".RAID", 5);
+ } else {
+ if (strcmp("unknown", str) == 0) {
+ strncpy(c1, ".NATIVE", 7);
+ }
+ else {
+ strncpy(c1, ".", 1);
+ strncpy(c1+1, c2, 6);
+ }
+ }
+
}
vtoc_ebcdic_enc(ch, ch, 44);
if (anc->verbose) printf("%2x ", part_info->f1->DS1FMTID);
@@ -1429,9 +1454,10 @@ fdasd_change_part_type (fdasd_anchor_t *anc)
printf("current partition type is: %s\n\n", fdasd_partition_type(str));
printf(" 1 Linux native\n" \
- " 2 Linux swap\n\n");
+ " 2 Linux swap\n" \
+ " 3 Linux raid\n\n");
part_type = 0;
- while ((part_type < 1) || (part_type > 2)) {
+ while ((part_type < 1) || (part_type > 3)) {
while (!isdigit(part_type =
read_char("new partition type: ")));
part_type -= 48;
@@ -1444,6 +1470,9 @@ fdasd_change_part_type (fdasd_anchor_t *anc)
case 2:
strncpy(str, "SWAP ", 6);
break;
+ case 3:
+ strncpy(str, "RAID ", 6);
+ break;
default:
printf("'%d' is not supported!\n", part_type);
}
@@ -1621,7 +1650,7 @@ fdasd_process_invalid_vtoc(fdasd_anchor_t *anc)
static void
fdasd_process_valid_vtoc(fdasd_anchor_t *anc, unsigned long blk)
{
- int f1_counter = 0, f7_counter = 0, f5_counter = 0;
+ int f1_counter = 0, f7_counter = 0, f5_counter = 0, oldfmt = 0;
int i, part_no, f1_size = sizeof(format1_label_t);
partition_info_t *part_info = anc->first;
format1_label_t f1_label;
@@ -1673,14 +1702,26 @@ fdasd_process_valid_vtoc(fdasd_anchor_t *anc, unsigned long blk)
vtoc_ebcdic_enc(part_info->f1->DS1DSNAM,
part_info->f1->DS1DSNAM, 44);
- if ((part_no < 0) || (part_no >= USABLE_PARTITIONS))
+ /* this dasd has data set names 0000-0002
+ but we use now 0001-0003 */
+ if (part_no == -1)
+ oldfmt++;
+
+ if (((oldfmt == 0) && (part_no < 0))
+ || (part_no >= USABLE_PARTITIONS))
printf("WARNING: partition number (%i) found "
"in data set name of an existing "
"partition\ndoes not match range of "
"possible partition numbers (1-%d)\n\n",
part_no + 1, USABLE_PARTITIONS);
- else
- setpos(anc, part_no, f1_counter);
+ else {
+ if (oldfmt) /* correct +1 */ {
+ setpos(anc, part_no+1, f1_counter);
+ printf("Correcting f1 header number!\n");
+ }
+ else
+ setpos(anc, part_no, f1_counter);
+ }
part_info = part_info->next;
f1_counter++;
--
1.6.0.6

View File

@ -1,389 +0,0 @@
From afe16490113999868ff408ff303ac7df4b733ff5 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Thu, 23 Apr 2009 11:47:13 +0200
Subject: [PATCH] s390-tools-1.8.1-ziorep-fixes
---
ziomon/stats.h | 9 ++++---
ziomon/ziomon | 13 +++++++----
ziomon/ziorep_config | 23 +++++++++++----------
ziomon/ziorep_traffic.cpp | 31 +++++++++++++++++------------
ziomon/ziorep_utilization.cpp | 4 +-
ziomon/ziorep_utils.cpp | 43 +++++++++++++++++++++++++++++++++++-----
6 files changed, 82 insertions(+), 41 deletions(-)
diff --git a/ziomon/stats.h b/ziomon/stats.h
index 1003f91..a28d436 100644
--- a/ziomon/stats.h
+++ b/ziomon/stats.h
@@ -108,7 +108,7 @@ static inline int histlog2_index(__u64 val, struct histlog2 *h)
{
int i;
- for (i = 0; i < (h->num - 1) && val > histlog2_upper_limit(i, h); i++);
+ for (i = 0; i < h->num && val > histlog2_upper_limit(i, h); i++);
return i;
}
@@ -123,15 +123,16 @@ static inline void histlog2_merge(struct histlog2 *h, __u32 *dst, const __u32 *s
{
int i;
- for (i = 0; i < h->num - 1; i++)
+ for (i = 0; i < h->num; i++) {
dst[i] += src[i];
+ }
}
static inline void histlog2_swap(__u32 a[], struct histlog2 *h)
{
int i;
- for (i = 0; i < h->num - 1; i++)
+ for (i = 0; i < h->num; i++)
swap_32(a[i]);
}
@@ -141,7 +142,7 @@ static inline void histlog2_print(const char *s, const __u32 a[],
int i;
printf("%s:\n", s);
- for (i = 0; i < h->num - 1; i++) {
+ for (i = 0; i < h->num; i++) {
printf(" %10ld:%6d",
(unsigned long)(histlog2_upper_limit(i, h)), a[i]);
if (!((i + 1) % 4))
diff --git a/ziomon/ziomon b/ziomon/ziomon
index 30c8adf..aa1cf78 100755
--- a/ziomon/ziomon
+++ b/ziomon/ziomon
@@ -411,14 +411,14 @@ function check_for_multipath_devices() {
devices_basenames[$j]="";
clean_devices;
(( i+=3 ));
- while [ "${mp_arr[$i]:0:1}" == "_" ]; do
+ while [[ ! "${mp_arr[$i]:0:1}" =~ "[0-9a-zA-Z]" ]] && [ $i -lt ${#mp_arr[@]} ]; do
checked_devs[${#checked_devs[@]}]=`echo ${mp_arr[$i]} | awk '{print "/dev/"$3}'`;
ddebug " add ${checked_devs[${#checked_devs[@]}-1]}";
- line=${mp_arr[$i]#_*};
+ line=${mp_arr[$i]#* };
line=${line%%:*};
line=`echo $line | sed 's/ //g'`;
WRP_HOST_ADAPTERS[${#WRP_HOST_ADAPTERS[@]}]="host$line";
- WRP_LUNS[${#WRP_LUNS[@]}]=`echo ${mp_arr[$i]#_*} | awk '{print $1}'`;
+ WRP_LUNS[${#WRP_LUNS[@]}]=`echo ${mp_arr[$i]#* } | awk '{print $1}'`;
(( i++ ));
done;
(( --i ));
@@ -599,6 +599,7 @@ function check_size_requirements() {
local estimated_size;
local free_space;
local logpath=`dirname $WRP_LOGFILE`;
+ local num_uniq_devs;
set `ziomon_mgr -e`;
util_base_sz=$1;
@@ -610,10 +611,12 @@ function check_size_requirements() {
# NOTE: Since blktrace and ziomon_zfcpdd write messages only when there is
# traffic, the estimate is an upper boundary only
+ num_uniq_devs=`echo ${WRP_LUNS[@]} | sed 's/ /\n/g' | cut -d : -f 4 | sort | uniq | wc -l`;
+ debug "number of unique devices: $num_uniq_devs";
debug "disk space requirements:";
(( size_per_record = $util_base_sz + ${#WRP_HOST_ADAPTERS[@]} * $util_variable_sz + $ioerr_base_sz
- + ${#WRP_DEVICES[@]} * ( $ioerr_variable_sz + $blkiotrace_sz + $zfcpiotrace_sz )
- + ( 2 + ${#WRP_DEVICES[@]}) * 8 ));
+ + $num_uniq_devs * ( $ioerr_variable_sz + $blkiotrace_sz + $zfcpiotrace_sz )
+ + ( 2 + $num_uniq_devs) * 8 ));
debug " size per interval: $size_per_record Bytes";
(( total_num_records = $WRP_DURATION / $WRP_INTERVAL ));
debug " total number of intervals: $total_num_records";
diff --git a/ziomon/ziorep_config b/ziomon/ziorep_config
index 21094bf..de60379 100755
--- a/ziomon/ziorep_config
+++ b/ziomon/ziorep_config
@@ -84,9 +84,10 @@ sub get_sub_ch_data
$c_src = catdir($base_dir, S_DIR2, $sub_ch, $adapter);
$sub_ch{$adapter}{lic} = get_line("lic_version");
$sub_ch{$adapter}{gen} = get_line("card_version");
+ $sub_ch{$adapter}{state} = get_line("online") == 1 ? "Online" :
+ "Offline";
$c_src = catdir($base_dir, S_DIR2, $sub_ch);
$sub_ch{$adapter}{chpid} = substr(get_line("chpids"), 0, 2);
- $sub_ch{$adapter}{state} = get_line("port_state");
}
}
@@ -220,7 +221,7 @@ sub adapter_report
my @adapters = @_;
foreach my $a (sort keys %sub_ch) {
- next if (@adapters && "@adapters" !~ /$a/);
+ next if (@adapters && "@adapters" !~ /\b$a\b/);
my @out_str;
push @out_str, "Host: $sub_ch{$a}{host}\n";
push @out_str, "CHPID: $sub_ch{$a}{chpid}\n";
@@ -252,11 +253,11 @@ sub device_report
"===============================================\n";
}
foreach my $hctl (sort keys %devices) {
- next if (@$adapters && "@$adapters" !~ /$devices{$hctl}{hba_id}/);
- next if (@$ports && "@$ports" !~ /$devices{$hctl}{wwpn}/);
- next if (@$luns && "@$luns" !~ /$devices{$hctl}{lun}/);
- next if (@$s_devs && "@$s_devs" !~ /$devices{$hctl}{dev}/);
- next if (@$hosts && "@$hosts" !~ /$sub_ch{$devices{$hctl}{hba_id}}{host}/);
+ next if (@$adapters && "@$adapters" !~ /\b$devices{$hctl}{hba_id}\b/);
+ next if (@$ports && "@$ports" !~ /\b$devices{$hctl}{wwpn}\b/);
+ next if (@$luns && "@$luns" !~ /\b$devices{$hctl}{lun}\b/);
+ next if (@$s_devs && "@$s_devs" !~ /\b$devices{$hctl}{dev}\b/);
+ next if (@$hosts && "@$hosts" !~ /\b$sub_ch{$devices{$hctl}{hba_id}}{host}\b/);
my @out_str;
push @out_str, $devices{$hctl}{hba_id};
push @out_str, $devices{$hctl}{wwpn};
@@ -293,10 +294,10 @@ sub mapper_report
}
foreach my $hctl (sort keys %devices) {
next if (! $devices{$hctl}{mp_dev_mm});
- next if (@$adapters && "@$adapters" !~ /$devices{$hctl}{hba_id}/);
- next if (@$ports && "@$ports" !~ /$devices{$hctl}{wwpn}/);
- next if (@$s_devs && "@$s_devs" !~ /$devices{$hctl}{dev}/);
- next if (@$m_devs && "@$m_devs" !~ /$mapper_dev{$devices{$hctl}{mp_dev_mm}}/);
+ next if (@$adapters && "@$adapters" !~ /\b$devices{$hctl}{hba_id}\b/);
+ next if (@$ports && "@$ports" !~ /\b$devices{$hctl}{wwpn}\b/);
+ next if (@$s_devs && "@$s_devs" !~ /\b$devices{$hctl}{dev}\b/);
+ next if (@$m_devs && "@$m_devs" !~ /\b$mapper_dev{$devices{$hctl}{mp_dev_mm}}\b/);
my @line_str;
push @line_str, $devices{$hctl}{hba_id};
push @line_str, $devices{$hctl}{wwpn};
diff --git a/ziomon/ziorep_traffic.cpp b/ziomon/ziorep_traffic.cpp
index 40cbf47..1461e55 100644
--- a/ziomon/ziorep_traffic.cpp
+++ b/ziomon/ziorep_traffic.cpp
@@ -121,6 +121,7 @@ static int parse_params(int argc, char **argv, struct options *opts)
__u32 tmp32;
long long unsigned int tmp64;
long tmpl;
+ char mychar;
static struct option long_options[] = {
{ "version", no_argument, NULL, 'v'},
{ "help", no_argument, NULL, 'h'},
@@ -188,18 +189,22 @@ static int parse_params(int argc, char **argv, struct options *opts)
opts->print_summary = true;
break;
case 'c':
- rc = sscanf(optarg, "%x", &tmp32);
- if (rc != 1) {
- fprintf(stdout, "%s: Could"
+ rc = sscanf(optarg, "%x%c", &tmp32, &mychar);
+ if (rc < 1) {
+ fprintf(stderr, "%s: Could"
" not read chpid %s\n", toolname, optarg);
return -1;
}
+ if (rc > 1) {
+ fprintf(stderr, "%s: %s is not a valid chpid\n", toolname, optarg);
+ return -1;
+ }
opts->chpids.push_back(tmp32);
break;
case 'p':
rc = sscanf(optarg, "0x%Lx", &tmp64);
if (rc != 1) {
- fprintf(stdout, "%s: Could"
+ fprintf(stderr, "%s: Could"
" not read port number %s\n", toolname, optarg);
return -1;
}
@@ -208,7 +213,7 @@ static int parse_params(int argc, char **argv, struct options *opts)
case 'l':
rc = sscanf(optarg, "0x%Lx", &tmp64);
if (rc != 1) {
- fprintf(stdout, "%s: Could"
+ fprintf(stderr, "%s: Could"
" not read lun %s\n", toolname, optarg);
return -1;
}
@@ -217,11 +222,11 @@ static int parse_params(int argc, char **argv, struct options *opts)
case 'u':
rc = sscanf(optarg, "0.0.%x", &tmp32);
if (rc != 1) {
- fprintf(stdout, "%s: Could not read bus-ID"
+ fprintf(stderr, "%s: Could not read bus-ID"
" %s\n", toolname, optarg);
return -1;
}
- opts->wwpns.push_back(tmp32);
+ opts->devnos.push_back(tmp32);
break;
case 'd':
opts->devices.push_back(optarg);
@@ -313,7 +318,7 @@ static int check_opts(struct options *opts, ConfigReader **cfg)
for (list<__u32>::const_iterator i = opts->chpids.begin();
i != opts->chpids.end(); ++i) {
if (!(*cfg)->verify_chpid(*i)) {
- fprintf(stdout, "Error: Could not find chpid 0.0.%04x in"
+ fprintf(stderr, "Error: Could not find chpid %x in"
" configuration.\n", *i);
rc = -2;
}
@@ -321,7 +326,7 @@ static int check_opts(struct options *opts, ConfigReader **cfg)
for (list<__u32>::const_iterator i = opts->devnos.begin();
i != opts->devnos.end(); ++i) {
if (!(*cfg)->verify_devno(*i)) {
- fprintf(stdout, "Error: Could not find bus-ID 0.0.%04x in"
+ fprintf(stderr, "Error: Could not find bus-ID 0.0.%04x in"
" configuration.\n", *i);
rc = -3;
}
@@ -329,7 +334,7 @@ static int check_opts(struct options *opts, ConfigReader **cfg)
for (list<__u64>::const_iterator i = opts->wwpns.begin();
i != opts->wwpns.end(); ++i) {
if (!(*cfg)->verify_wwpn(*i)) {
- fprintf(stdout, "Error: Could not find WWPN %016Lx in"
+ fprintf(stderr, "Error: Could not find WWPN %016Lx in"
" configuration.\n", (long long unsigned int)*i);
rc = -4;
}
@@ -337,7 +342,7 @@ static int check_opts(struct options *opts, ConfigReader **cfg)
for (list<__u64>::const_iterator i = opts->luns.begin();
i != opts->luns.end(); ++i) {
if (!(*cfg)->verify_lun(*i)) {
- fprintf(stdout, "Error: Could not find LUN %016Lx in"
+ fprintf(stderr, "Error: Could not find LUN %016Lx in"
" configuration.\n", (long long unsigned int)*i);
rc = -5;
}
@@ -345,7 +350,7 @@ static int check_opts(struct options *opts, ConfigReader **cfg)
for (list<const char*>::iterator i = opts->devices.begin();
i != opts->devices.end(); ++i) {
if (!(*cfg)->verify_device(*i)) {
- fprintf(stdout, "Error: Could not find device %s in"
+ fprintf(stderr, "Error: Could not find device %s in"
" configuration.\n", *i);
rc = -6;
}
@@ -353,7 +358,7 @@ static int check_opts(struct options *opts, ConfigReader **cfg)
for (list<const char*>::iterator i = opts->mp_devices.begin();
i != opts->mp_devices.end(); ++i) {
if (!(*cfg)->verify_mp_device(*i)) {
- fprintf(stdout, "Error: Could not find multipath"
+ fprintf(stderr, "Error: Could not find multipath"
" device %s in configuration.\n", *i);
rc = -7;
}
diff --git a/ziomon/ziorep_utilization.cpp b/ziomon/ziorep_utilization.cpp
index a036a03..3f57a47 100644
--- a/ziomon/ziorep_utilization.cpp
+++ b/ziomon/ziorep_utilization.cpp
@@ -167,7 +167,7 @@ static int parse_params(int argc, char **argv, struct options *opts)
case 'c':
rc = sscanf(optarg, "%x", &tmp);
if (rc != 1) {
- fprintf(stdout, "Error: Could not read chpid"
+ fprintf(stderr, "Error: Could not read chpid"
" %s\n", optarg);
return -1;
}
@@ -237,7 +237,7 @@ static int check_opts(struct options *opts, ConfigReader **cfg)
for (list<__u32>::const_iterator i = opts->chpids.begin();
i != opts->chpids.end(); ++i) {
if (!(*cfg)->verify_chpid(*i)) {
- fprintf(stdout, "Error: Could not find chpid %x in"
+ fprintf(stderr, "Error: Could not find chpid %x in"
" configuration.\n", *i);
rc = -2;
}
diff --git a/ziomon/ziorep_utils.cpp b/ziomon/ziorep_utils.cpp
index 75a9578..715115e 100644
--- a/ziomon/ziorep_utils.cpp
+++ b/ziomon/ziorep_utils.cpp
@@ -303,8 +303,17 @@ int adjust_timeframe(const char *filename, __u64 *begin, __u64 *end,
verbose_msg("using original interval length: %lus\n",
(long unsigned int)*interval);
}
- // now check if the interval is correct
- if (*interval != UINT32_MAX && *interval % f_hdr.interval_length) {
+ /* the exact frame boundaries don't include the length of the very
+ first interval, so we have to add one more to our calculations */
+ if (*interval && (*end - *begin + f_hdr.interval_length) % *interval != 0) {
+ // cut off rest in case of user-set interval
+ *end -= (*end - *begin) % *interval + f_hdr.interval_length;
+ t = *end;
+ verbose_msg(" cut off at : %s", ctime(&t));
+ }
+
+ // check if the interval is correct
+ if (*interval % f_hdr.interval_length) {
fprintf(stderr, "%s: Data aggregation interval %lu"
" is incompatible with source data. Please use"
" a multiple of %lu and try again.\n", toolname,
@@ -392,7 +401,7 @@ int print_summary_report(FILE *fp, char *filename, ConfigReader &cfg)
rc += fprintf(fp, "Aggregated range: ");
if (a_hdr) {
rc += fprintf(fp, "%s to ",
- print_time_formatted(a_hdr->begin_time));
+ print_time_formatted(a_hdr->begin_time - f_hdr.interval_length));
rc += fprintf(fp, "%s\n",
print_time_formatted(a_hdr->end_time));
}
@@ -404,7 +413,7 @@ int print_summary_report(FILE *fp, char *filename, ConfigReader &cfg)
a_hdr = NULL;
rc += fprintf(fp, "Detailed range: %s to ",
- print_time_formatted(f_hdr.begin_time));
+ print_time_formatted(f_hdr.begin_time - f_hdr.interval_length));
rc += fprintf(fp, "%s\n", print_time_formatted(f_hdr.end_time));
rc += fprintf(fp, "Interval length: %d seconds\n",
f_hdr.interval_length);
@@ -446,16 +455,32 @@ int print_summary_report(FILE *fp, char *filename, ConfigReader &cfg)
return rc;
}
+/* Calculates seconds since 1970 _without_ caring for daylight
+ savings time (comtrary to mktime() et al).
+ It does not care for leap years and the like, which is OK,
+ since we use it in a very narrow scenario: To calculate any
+ daylight savings time related shifts.
+ Hence: Dont't use if you're not sure what you are doing... */
+static __u64 secs_since_1970(const struct tm *t) {
+ __u64 res = 0;
+ res += t->tm_sec;
+ res += 60 * t->tm_min;
+ res += 3600 * t->tm_hour;
+ res += 86400 * t->tm_yday;
+ res += 86400 * 365 * t->tm_year;
+
+ return res;
+}
+
int get_datetime_val(const char *str, __u64 *tgt)
{
- struct tm t;
+ struct tm t, t_old;
char *ret;
// strptime only sets
memset(&t, 0, sizeof(struct tm));
ret = strptime(str, "%Y-%m-%d %H:%M", &t);
-
if (ret == NULL || *ret != '\0') {
ret = strptime(str, "%Y-%m-%d %H:%M:%S", &t);
if (ret == NULL || *ret != '\0') {
@@ -465,7 +490,13 @@ int get_datetime_val(const char *str, __u64 *tgt)
return -1;
}
}
+ t_old = t;
*tgt = mktime(&t);
+ // if daylight savings time applies, 't' has been adjusted,
+ // so we have to correct
+ if (t_old.tm_hour != t.tm_hour)
+ *tgt -= secs_since_1970(&t) - secs_since_1970(&t_old);
+ verbose_msg("datetime value from user after translation: %s", ctime((const time_t *)tgt));
return 0;
}
--
1.6.0.6

View File

@ -1,27 +0,0 @@
From d2f00bb021508f8104a1d8164432e8f4d239d872 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Thu, 23 Apr 2009 11:47:29 +0200
Subject: [PATCH] s390-tools-1.8.1-cflags
---
common.mak | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/common.mak b/common.mak
index d57b854..f0252da 100644
--- a/common.mak
+++ b/common.mak
@@ -25,8 +25,8 @@ STRIP = $(CROSS_COMPILE)strip
OBJCOPY = $(CROSS_COMPILE)objcopy
OBJDUMP = $(CROSS_COMPILE)objdump
INSTALL = install # FIXME: We need s390-install (strip)
-CFLAGS = $(OPT_FLAGS) -Wall -O3 -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE)
-CXXFLAGS = $(OPT_FLAGS) -Wall -O3 -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE)
+CFLAGS = -Wall -O3 -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE) $(OPT_FLAGS)
+CXXFLAGS = -Wall -O3 -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE) $(OPT_FLAGS)
export AS LD CC CPP AR NM STRIP OBJCOPY OBJDUMP INSTALL CFLAGS
# Support alternate install root
--
1.6.0.6

View File

@ -1,59 +0,0 @@
From 486526858271c8ea890e8728a1cf1cceeceb9b1a Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Thu, 23 Apr 2009 15:28:06 +0200
Subject: [PATCH] don't create automenu when default menu exists
---
zipl/src/job.c | 25 +++++++++++++++----------
1 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/zipl/src/job.c b/zipl/src/job.c
index 1b7bcb2..9fc6c2d 100644
--- a/zipl/src/job.c
+++ b/zipl/src/job.c
@@ -1441,6 +1441,8 @@ get_job_from_config_file(struct command_line* cmdline, struct job_data* job)
struct scan_token* scan, *nscan;
char* filename;
char* source;
+ char* default_section;
+ int is_menu;
int rc;
/* Read configuration file */
@@ -1470,20 +1472,23 @@ get_job_from_config_file(struct command_line* cmdline, struct job_data* job)
scan_free(scan);
return rc;
}
-
- if (cmdline->automenu) {
- nscan = create_fake_menu(scan);
- if (nscan == NULL) {
- scan_free(scan);
- return -1;
- }
- scan = nscan;
- }
+
+ /* disable automenu iff default menu exists */
+ rc = get_default_section(scan, &default_section, &is_menu);
+ if (!rc && is_menu)
+ cmdline->automenu = 0;
/* Get job from config file data */
if (cmdline->menu != NULL || cmdline->automenu) {
- if (cmdline->automenu)
+ if (cmdline->automenu) {
+ nscan = create_fake_menu(scan);
+ if (nscan == NULL) {
+ scan_free(scan);
+ return -1;
+ }
+ scan = nscan;
cmdline->menu = misc_strdup("rh-automatic-menu");
+ }
rc = get_menu_job(scan, cmdline->menu, job);
}
else {
--
1.6.0.6

View File

@ -1,25 +0,0 @@
From 77f053260b9d2b4d683edfbed50a528d74620d4b Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 24 Apr 2009 14:05:29 +0200
Subject: [PATCH] remove the executable stack flag
---
zipl/src/Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/zipl/src/Makefile b/zipl/src/Makefile
index 16d5276..07b3b74 100644
--- a/zipl/src/Makefile
+++ b/zipl/src/Makefile
@@ -12,7 +12,7 @@ includes = $(wildcard ../include/*.h)
all: zipl
zipl: $(objects)
- $(CC) $(objects) ../boot/data.o -o zipl
+ $(CC) -Wl,-z,noexecstack $(objects) ../boot/data.o -o zipl
%.o: %.c $(includes) Makefile
$(CC) $(CFLAGS) -c -o $@ $<
--
1.6.0.6

View File

@ -1,197 +0,0 @@
From 1833f9dae371a48e3f52891262ad2d5fd75fc205 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 5 Jun 2009 14:12:52 +0200
Subject: [PATCH] s390-tools-1.8.1-ziomon-fixes
---
ziomon/stats.h | 2 +-
ziomon/ziomon | 84 ++++++++++++++++++++++++++++++++++++++++++++-----
ziomon/ziomon_util.c | 2 +-
3 files changed, 77 insertions(+), 11 deletions(-)
diff --git a/ziomon/stats.h b/ziomon/stats.h
index a28d436..0920b27 100644
--- a/ziomon/stats.h
+++ b/ziomon/stats.h
@@ -142,7 +142,7 @@ static inline void histlog2_print(const char *s, const __u32 a[],
int i;
printf("%s:\n", s);
- for (i = 0; i < h->num; i++) {
+ for (i = 0; i < h->num - 1; i++) {
printf(" %10ld:%6d",
(unsigned long)(histlog2_upper_limit(i, h)), a[i]);
if (!((i + 1) % 4))
diff --git a/ziomon/ziomon b/ziomon/ziomon
index aa1cf78..fe4d8ec 100755
--- a/ziomon/ziomon
+++ b/ziomon/ziomon
@@ -32,7 +32,7 @@ WRP_DEVICES=();
WRP_LUNS=();
WRP_LOGFILE="";
# limit of actual data in percent that need space on disk
-WRP_SIZE_THRESHOLD="25";
+WRP_SIZE_THRESHOLD="10";
WRP_FORCE=0;
function debug() {
@@ -234,6 +234,7 @@ function start_trace() {
local hosts_param;
local luns_param;
local i;
+ local len;
if [ $WRP_DEBUG -ne 0 ]; then
verbose="-V";
@@ -276,7 +277,7 @@ function start_trace() {
blkiomon_command="blkiomon --interval=$WRP_INTERVAL -Q $WRP_MSG_Q_PATH -q $WRP_MSG_Q_ID -m $WRP_MSG_Q_BLKIOMON_ID $verbose_blk -d -";
zfcpdd_command="ziomon_zfcpdd -Q $WRP_MSG_Q_PATH -q $WRP_MSG_Q_ID -m $WRP_MSG_Q_ZIOMON_ZFCPDD_ID -i $WRP_INTERVAL";
debug "starting blktrace: $blktrace_command | $blkiomon_command | $zfcpdd_command";
- $blktrace_command | $blkiomon_command | $zfcpdd_command > $WRP_MSG_Q_PATH/blktrace.log &
+ $blktrace_command 2>$WRP_MSG_Q_PATH/blktrace.err | $blkiomon_command | $zfcpdd_command > $WRP_MSG_Q_PATH/blktrace.log &
i=0;
# might take a moment to start all processes in the pipe if system under load
while [ $i -lt 60 ]; do
@@ -303,7 +304,17 @@ function start_trace() {
echo "done";
echo -n "Collecting data...";
- sleep $WRP_DURATION;
+ # pay extra attention to blktrace
+ for (( i=0; i<$WRP_DURATION; ++i )); do
+ len=`cat $WRP_MSG_Q_PATH/blktrace.err | wc -l`;
+ if [ $len -ne 0 ]; then
+ cat $WRP_MSG_Q_PATH/blktrace.err;
+ echo "Error: blktrace has errors, aborting";
+ return;
+ fi
+ sleep 1;
+ done
+
echo "done";
}
@@ -358,6 +369,58 @@ function emergency_shutdown() {
}
+function check_cpuplugd {
+ # check if cpuplugd is running
+ # If so, the whole per-cpu mechanism of blktrace gets corrupted, which
+ # results in the infamous 'bad trace magic' message
+ if [ -e /var/run/cpuplugd.pid ]; then
+ echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
+ echo "ziomon: Warning: cpuplugd is running which can corrupt the traces.";
+ echo " It is recommended to stop cpuplugd for the duration of the";
+ echo " trace using 'service cpuplugd stop'.";
+ echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
+ fi
+}
+
+
+# we need 2MB per device and CPU
+function check_vmalloc_space() {
+ local total;
+ local used;
+ local free;
+ local num_cpus;
+ local required;
+ local result;
+
+ num_cpus=`cat /proc/cpuinfo | grep processors | awk '{print $4}'`;
+ total=`cat /proc/meminfo | grep VmallocTotal | awk '{print $2}'`;
+ used=`cat /proc/meminfo | grep VmallocUsed | awk '{print $2}'`;
+
+ (( free=$total-$used ));
+ (( required=$num_cpus*${#WRP_DEVICES[@]}*2048 ));
+ (( result=$free-$required ));
+ debug "Required Vmalloc space: $required KBytes";
+ if [ $result -lt 0 ]; then
+ echo "$WRP_TOOLNAME: Not enough free Vmalloc space:";
+ echo " Required: $required KBytes";
+ echo " Free: $free KBytes";
+ exit 1;
+ fi
+
+ return 0;
+}
+
+
+function check_blkiomon() {
+ # check blkiomon version
+ ver=`blkiomon -V | awk '{print $3}'`;
+ if [ "$ver" != "0.2" ]; then
+ echo "$WRP_TOOLNAME: Unsupported blkiomon version $ver detected, aborting";
+ exit 1;
+ fi
+}
+
+
function setup() {
while [ -e $WRP_MSG_Q_PATH ]; do
WRP_MSG_Q_PATH="$WRP_MSG_Q_PATH$RANDOM";
@@ -476,7 +539,7 @@ function determine_host_adapters() {
local num_s_devs;
local s_dev_ratio;
- echo -n "check devices...";
+ echo -n "Check devices...";
# Estimate fraction of /dev/s* devices - if >50%, start with check for regular devices
num_s_devs=`echo ${WRP_DEVICES[@]} | sed "s/ /\n/g" | grep /dev/s | wc -l`;
@@ -599,7 +662,6 @@ function check_size_requirements() {
local estimated_size;
local free_space;
local logpath=`dirname $WRP_LOGFILE`;
- local num_uniq_devs;
set `ziomon_mgr -e`;
util_base_sz=$1;
@@ -611,12 +673,10 @@ function check_size_requirements() {
# NOTE: Since blktrace and ziomon_zfcpdd write messages only when there is
# traffic, the estimate is an upper boundary only
- num_uniq_devs=`echo ${WRP_LUNS[@]} | sed 's/ /\n/g' | cut -d : -f 4 | sort | uniq | wc -l`;
- debug "number of unique devices: $num_uniq_devs";
debug "disk space requirements:";
(( size_per_record = $util_base_sz + ${#WRP_HOST_ADAPTERS[@]} * $util_variable_sz + $ioerr_base_sz
- + $num_uniq_devs * ( $ioerr_variable_sz + $blkiotrace_sz + $zfcpiotrace_sz )
- + ( 2 + $num_uniq_devs) * 8 ));
+ + ${#WRP_DEVICES[@]} * ( $ioerr_variable_sz + $blkiotrace_sz + $zfcpiotrace_sz )
+ + ( 2 + ${#WRP_DEVICES[@]}) * 8 ));
debug " size per interval: $size_per_record Bytes";
(( total_num_records = $WRP_DURATION / $WRP_INTERVAL ));
debug " total number of intervals: $total_num_records";
@@ -653,10 +713,16 @@ setup;
parse_params $@;
+check_cpuplugd;
+
+check_blkiomon;
+
check_for_existing_output;
determine_host_adapters;
+check_vmalloc_space;
+
check_size_requirements;
[ $? -eq 0 ] && start_trace;
diff --git a/ziomon/ziomon_util.c b/ziomon/ziomon_util.c
index e3e0762..043d3d1 100644
--- a/ziomon/ziomon_util.c
+++ b/ziomon/ziomon_util.c
@@ -597,7 +597,7 @@ static int poll_ioerr_cnt(int init, struct ioerr_data *data,
for (i=0; i<opts->num_luns; ++i) {
/* read ioerr_cnt attribute */
if (read_attribute(opts->luns[i], line, NULL)) {
- fprintf(stderr, "%s: Warning: Could read %s\n",
+ fprintf(stderr, "%s: Warning: Could not read %s\n",
toolname, opts->luns[i]);
grc++;
continue;
--
1.6.0.6

View File

@ -1,54 +0,0 @@
From 38dfbc2642350aba44df80b41c91ab78891ba818 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Tue, 16 Jun 2009 11:10:47 +0200
Subject: [PATCH] s390-tools-1.8.1-zipl-fix-unsupported-device
Description: zipl: zipl does not exit for an unsupported device driver.
Symptom: zipl does not exit with an error when it is run against a
target device which is provided by an unsupported device driver
(e.g. device-mapper). The resulting IPL records might be
incorrect and filesystem corruption may occur.
Problem: The device driver name check does not cause an error when the
device driver name is unknown and the device is not a
partition.
Solution: Change the device driver name check to write an error message
and to exit when it finds an unknown device driver name.
Problem-ID: 53660
---
zipl/src/disk.c | 20 ++------------------
1 files changed, 2 insertions(+), 18 deletions(-)
diff --git a/zipl/src/disk.c b/zipl/src/disk.c
index 3a48e44..f1b98a7 100644
--- a/zipl/src/disk.c
+++ b/zipl/src/disk.c
@@ -190,24 +190,8 @@ disk_get_info(const char* device, struct disk_info** info)
data->device = stats.st_rdev & ~SCSI_PARTN_MASK;
} else {
/* Driver name is unknown */
- if (data->devno == -1) {
- if (data->geo.start) {
- /* Writing to the parent device of this
- * partition may not be safe so stop here. */
- error_reason("Unsupported device driver '%s'",
- data->drv_name);
- goto out_close;
- }
- /* Assume that the first block can be overwritten
- * even if we don't now the exact device type. */
- data->type = disk_type_scsi;
- data->partnum = 0;
- data->device = stats.st_rdev;
- } else {
- error_reason("Unsupported device driver '%s' "
- "for disk type DASD", data->drv_name);
- goto out_close;
- }
+ error_reason("Unsupported device driver '%s'", data->drv_name);
+ goto out_close;
}
/* Convert device size to size in physical blocks */
--
1.6.0.6

View File

@ -1,31 +0,0 @@
From 815064b5e73bdeb11e85e04fb691745b15d00e99 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 19 Jun 2009 10:01:30 +0200
Subject: [PATCH] s390-tools-1.8.1-zipl-kdump-man
Description: Add kdump kernel installation instruction to zipl man page.
Symptom: User wants to prepare SCSI disk for dump, but has not installed
the kdump kernel rpm.
Problem: The installation of the kdump kernel rpm is prereq for preparing
a SCSI dump disk for dump.
Solution: Document that in the zipl man page.
---
zipl/man/zipl.8 | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/zipl/man/zipl.8 b/zipl/man/zipl.8
index 8d2b42c..66b23eb 100644
--- a/zipl/man/zipl.8
+++ b/zipl/man/zipl.8
@@ -176,6 +176,8 @@ will be incomplete.
It is not possible to specify both this parameter and the name of a menu
or configuration section on the command line at the same time.
+.B Note that before using this option the "kernel-kdump" rpm has to be
+.B installed.
.TP
.BR "\-M <DUMPLIST[,SIZE]>" " or " "--mvdump=<DUMPLIST[,SIZE]>"
Install a multi-volume dump record on each device associated with one of the
--
1.6.0.6

View File

@ -1,70 +0,0 @@
From b76deacff693b951c2e5a01ed17e058379b9e00a Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Mon, 22 Jun 2009 12:47:02 +0200
Subject: [PATCH] s390-tools-1.8.1-iucvterm-getlogin-to-getpwuid
Description: iucvconn: Replace getlogin() with getpwuid(geteuid())
Symptom: The user name is not always logged to syslog.
Problem: The getlogin() function returns the name of the user that
is logged in. This user name is used to write syslog records.
getlogin() retrieves the user information from the utmp
database. However, the user information might not always be
available, for example, the screen program can remove utmp
records (logoff function).
Solution: The getpwuid() function is used to get the user name from the
passwd file (or any other NSS source, i.e. LDAP etc.).
Problem-ID: 54225
---
iucvterm/src/iucvconn.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/iucvterm/src/iucvconn.c b/iucvterm/src/iucvconn.c
index 61f536e..da7d08a 100644
--- a/iucvterm/src/iucvconn.c
+++ b/iucvterm/src/iucvconn.c
@@ -7,6 +7,7 @@
* Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
*/
#include <errno.h>
+#include <pwd.h>
#include <signal.h>
#include <stdlib.h>
#include <stdio.h>
@@ -237,6 +238,7 @@ int main(int argc, char *argv[])
struct sockaddr_iucv addr;
struct termios ios;
struct sigaction sigact;
+ struct passwd *passwd;
struct iucvtty_cfg conf;
@@ -266,6 +268,9 @@ int main(int argc, char *argv[])
/* syslog */
openlog(SYSLOG_IDENT, LOG_PID, LOG_AUTHPRIV);
+ /* get user information for syslog */
+ passwd = getpwuid(geteuid());
+
if (connect(server, (struct sockaddr *) &addr, sizeof(addr)) == -1) {
switch (errno) {
case EAGAIN:
@@ -286,12 +291,14 @@ int main(int argc, char *argv[])
break;
}
AUDIT("Connection to %s/%s failed for user %s (uid=%i)",
- conf.host, conf.service, getlogin(), geteuid());
+ conf.host, conf.service,
+ (passwd != NULL) ? passwd->pw_name : "n/a", geteuid());
rc = 2;
goto return_on_error;
}
AUDIT("Established connection to %s/%s for user %s (uid=%i)",
- conf.host, conf.service, getlogin(), geteuid());
+ conf.host, conf.service,
+ (passwd != NULL) ? passwd->pw_name : "n/a", geteuid());
/* send client params */
iucvtty_tx_termenv(server, DEFAULT_TERM);
--
1.6.0.6

View File

@ -1,184 +0,0 @@
From 263c0e5646ea3c81e570ec7e53c214cac8cb4412 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Mon, 22 Jun 2009 12:50:08 +0200
Subject: [PATCH] s390-tools-1.8.1-dumpconf-improve-error-checking
Description: dumpconf: Improve parameter checking and error messages.
Symptom: Ugly and confusing error messages on systems which do not support
the dump_reipl shutdown action.
Problem: Error handling is incomplete.
Solution: The dumpconf init script now validates the syntax of the device
specified in the config file.
---
etc/init.d/dumpconf | 98 +++++++++++++++++++++++++++++++++++----------------
1 files changed, 67 insertions(+), 31 deletions(-)
diff --git a/etc/init.d/dumpconf b/etc/init.d/dumpconf
index e97f76c..42a2242 100755
--- a/etc/init.d/dumpconf
+++ b/etc/init.d/dumpconf
@@ -119,18 +119,60 @@ verify_ccw_dump_device()
fi
}
-setup_ccw_device()
-{
- echo $DEVICE > $1/ccw/device || RETVAL=1
+#------------------------------------------------------------------------------
+# Helper function to check a device string.
+#------------------------------------------------------------------------------
+function CheckDeviceString() {
+ local X
+
+ X=$(
+ echo "$1" |
+ awk --posix -F. '
+ function PrintBusID(css, grp, devno) {
+ while(length(devno) < 4)
+ devno = "0" devno
+ print css "." grp "." devno
+ }
+ NF == 1 && $1 ~ /^[0-9a-fA-F]{1,4}$/ {
+ PrintBusID("0","0", $1)
+ next
+ }
+ NF != 3 || $1 !~ /^[0-9a-fA-F]{1,2}$/ {
+ next
+ }
+ $2 !~ /^[0-9a-fA-F]{1,2}$/ {
+ next
+ }
+ $3 !~ /^[0-9a-fA-F]{1,4}$/ {
+ next
+ }
+ {
+ PrintBusID($1, $2, $3)
+ }
+ '
+ )
+
+ if [ "$X" != "" ]; then
+ echo $X
+ return 0
+ fi
}
-setup_fcp_device()
+setup_device()
{
- echo $DEVICE > $1/fcp/device || RETVAL=1
- echo $WWPN > $1/fcp/wwpn || RETVAL=1
- echo $LUN > $1/fcp/lun || RETVAL=1
- echo $BOOTPROG > $1/fcp/bootprog || RETVAL=1
- echo $BR_LBA > $1/fcp/br_lba || RETVAL=1
+ DEV="$(CheckDeviceString $DEVICE)"
+ if [ "$DEV" != "" ]; then
+ echo $DEV > $1/$DUMP_TYPE/device || RETVAL=1
+ else
+ RETVAL=1
+ echo "ERROR: Invalid device '$DEVICE'" >&2
+ fi
+ if [ $DUMP_TYPE == "fcp" ] && [ $RETVAL -eq 0 ]; then
+ echo $WWPN > $1/fcp/wwpn || RETVAL=1
+ echo $LUN > $1/fcp/lun || RETVAL=1
+ echo $BOOTPROG > $1/fcp/bootprog || RETVAL=1
+ echo $BR_LBA > $1/fcp/br_lba || RETVAL=1
+ fi
}
setup_nss_device()
@@ -145,10 +187,8 @@ setup_reipl()
return
fi
- if [ "$REIPL_TYPE" == "ccw" ]; then
- setup_ccw_device $REIPL_CONFIG_DIR
- elif [ "$REIPL_TYPE" == "fcp" ]; then
- setup_fcp_device $REIPL_CONFIG_DIR
+ if [ "$REIPL_TYPE" == "ccw" ] || [ "$REIPL_TYPE" == "fcp" ]; then
+ setup_device $REIPL_CONFIG_DIR
elif [ "$REIPL_TYPE" == "nss" ]; then
setup_nss_device $REIPL_CONFIG_DIR
else
@@ -169,28 +209,23 @@ setup_reipl()
setup_dump()
{
- if [ "$DUMP_TYPE" == "ccw" ]; then
- setup_ccw_device $DUMP_CONFIG_DIR
- elif [ "$DUMP_TYPE" == "fcp" ]; then
- setup_fcp_device $DUMP_CONFIG_DIR
+ if [ "$DUMP_TYPE" == "ccw" ] || [ "$DUMP_TYPE" == "fcp" ]; then
+ setup_device $DUMP_CONFIG_DIR
elif [ "$DUMP_TYPE" != "none" ]; then
echo "ERROR: Unknown dump type '$DUMP_TYPE'" >&2
RETVAL=1
fi
- echo $DUMP_TYPE > $DUMP_CONFIG_DIR/dump_type || RETVAL=1
+ if [ $RETVAL -eq 0 ]; then
+ echo $DUMP_TYPE > $DUMP_CONFIG_DIR/dump_type || RETVAL=1
+ fi
if [ $RETVAL -eq 1 ]; then
- echo "ERROR: Setup of $DUMP_TYPE dump device failed." >&2
echo none > $DUMP_CONFIG_DIR/dump_type
return $RETVAL
fi
- if [ "$CONF_DUMP_TYPE" == "none" ]; then
- echo "No dump device configured. "
- else
- echo "$ON_PANIC on panic configured: Using $DUMP_TYPE dump device."
- fi
+ echo "Configuring $ON_PANIC on panic: Using $DUMP_TYPE dump device."
}
setup_on_panic_vmcmd()
@@ -260,7 +295,7 @@ status_dump()
echo "type....: fcp"
print_fcp_device $DUMP_CONFIG_DIR
else
- echo "ERROR: Unknown dump device type '$TYPE'!" >&2
+ echo "ERROR: Unknown dump device type '$CONF_DUMP_TYPE'!" >&2
echo " Please check if you have the latest dumpconf package!" >&2
fi
}
@@ -316,27 +351,28 @@ start()
if [ "$ON_PANIC" == "reipl" ]; then
setup_reipl
- elif [ "$ON_PANIC" == "dump" ]; then
+ elif [ "$ON_PANIC" == "dump" ] || [ "$ON_PANIC" == "dump_reipl" ]; then
setup_dump
elif [ "$ON_PANIC" == "vmcmd" ]; then
setup_on_panic_vmcmd
- elif [ "$ON_PANIC" == "dump_reipl" ]; then
- setup_dump
elif [ "$ON_PANIC" == "stop" ]; then
echo "stop on panic configured."
else
echo "ERROR: Unknown 'on panic' type '$ON_PANIC'" >&2
RETVAL=1
fi
+ if [ $RETVAL -eq 1 ]; then
+ echo "ERROR: Setup of $DUMP_TYPE dump device failed." >&2
+ return $RETVAL
+ fi
- echo $ON_PANIC > $ON_PANIC_CONFIG_FILE || RETVAL=1
+ echo $ON_PANIC > $ON_PANIC_CONFIG_FILE 2> /dev/null || RETVAL=1
# check for errors
if [ $RETVAL -eq 1 ]; then
- ERRMSG="\"on panic action\" configuration failed!"
echo stop > $ON_PANIC_CONFIG_FILE
- echo "ERROR: $ERRMSG Check $DUMP_CONFIG_FILE!" >&2
+ echo "ERROR: $ON_PANIC not supported by hardware!" >&2
return $RETVAL
fi
--
1.6.0.6

View File

@ -1,57 +0,0 @@
From 277fbeaa8cdd27e586d1d3d0f58242a0a40b3a48 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Mon, 22 Jun 2009 12:51:44 +0200
Subject: [PATCH] s390-tools-1.8.1-cpuplugd-memplug
Description: cpuplugd: Daemon does not work in an memplug only environment.
Symptom: When the cpuplugd daemon is executed with only the memory
configuration in cpuplugd.conf it does not start properly.
Problem: A bug in the configuration file parser prevents this valid
user specified setup.
Solution: Adjust the configuration file parser, to accept this type of
system configuration.
---
cpuplugd/config.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/cpuplugd/config.c b/cpuplugd/config.c
index 7f02c6c..93b31e5 100644
--- a/cpuplugd/config.c
+++ b/cpuplugd/config.c
@@ -66,6 +66,7 @@ void parse_configline(struct config *cfg, char *line)
rc = -1;
cmm_min = -1;
+ rvalue = NULL;
/* parse line by line */
for (token = strtok_r(line, "\n", &save);
token != NULL;
@@ -318,8 +319,7 @@ void check_config(struct config *cfg)
int lpar_status, error_counter;
lpar_status = check_lpar();
-
- if (cfg->cpu_max <= cfg->cpu_min && cfg->cpu_max != 0) {
+ if (cfg->cpu_max <= cfg->cpu_min && cfg->cpu_max != 0 && cpu != 0) {
if (foreground == 1)
fprintf(stderr, "cpu_max below or equal cpu_min,"
" aborting.\n");
@@ -328,7 +328,6 @@ void check_config(struct config *cfg)
"aborting\n");
clean_up();
}
-
if (cfg->cpu_max < 0 || cfg->cpu_min < 0 || cfg->update < 0
|| cfg->hotplug == NULL || cfg->hotunplug == NULL) {
if (foreground == 1)
@@ -337,6 +336,7 @@ void check_config(struct config *cfg)
if (foreground == 0)
syslog(LOG_INFO, "No valid CPU hotplug "
"configuration detected\n");
+ cpu = 0;
} else {
cpu = 1;
if (debug) {
--
1.6.0.6

View File

@ -1,118 +0,0 @@
From 65f317c463de53abf7a8bba3285a077dbaf42486 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Mon, 22 Jun 2009 12:53:22 +0200
Subject: [PATCH] s390-tools-1.8.1-ziomon-new-blkiomon
ziomon: Adjust to use blkiomon V0.3
Update the blkiomon header to the version packaged in RHEL 5.4, update
the version check appropriately and use the version number for .log files
to match what the proper, forthcoming version will use.
---
ziomon/blkiomon.h | 4 ++--
ziomon/ziomon | 2 +-
ziomon/ziomon_dacc.c | 12 ++++++------
ziomon/ziomon_dacc.h | 2 +-
4 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/ziomon/blkiomon.h b/ziomon/blkiomon.h
index da27d00..42b6b46 100644
--- a/ziomon/blkiomon.h
+++ b/ziomon/blkiomon.h
@@ -25,6 +25,7 @@ struct blkiomon_stat {
/* Histogram of dispatch to completion request times in u-secs.
Step-size is 8, starting at 0. */
__u32 d2c_hist[BLKIOMON_D2C_BUCKETS];
+ __u32 device; /* device identifier */
struct minmax size_r; /* stats of read request sizes in Bytes */
struct minmax size_w; /* stats of write request sizes in Bytes */
struct minmax d2c_r; /* stats of read request durations in u-secs */
@@ -33,8 +34,7 @@ struct blkiomon_stat {
struct minmax thrput_w; /* stats of write throughput in Kbytes per micro-sec */
__u64 bidir; /* number of bi-directional requests, is set exclusive
(ie. not implicitly adding 1 to rd and wrt as well) */
- __u32 device; /* device identifier */
-} __attribute__ ((packed));
+};
static struct histlog2 size_hist = {0, 1024, BLKIOMON_SIZE_BUCKETS};
diff --git a/ziomon/ziomon b/ziomon/ziomon
index fe4d8ec..297651c 100755
--- a/ziomon/ziomon
+++ b/ziomon/ziomon
@@ -414,7 +414,7 @@ function check_vmalloc_space() {
function check_blkiomon() {
# check blkiomon version
ver=`blkiomon -V | awk '{print $3}'`;
- if [ "$ver" != "0.2" ]; then
+ if [ "$ver" != "0.3" ]; then
echo "$WRP_TOOLNAME: Unsupported blkiomon version $ver detected, aborting";
exit 1;
fi
diff --git a/ziomon/ziomon_dacc.c b/ziomon/ziomon_dacc.c
index f2c34ac..0a17d9e 100644
--- a/ziomon/ziomon_dacc.c
+++ b/ziomon/ziomon_dacc.c
@@ -426,7 +426,7 @@ int add_msg(FILE *fp, struct message *msg, struct file_header *f_hdr,
int init_file(FILE *fp, struct file_header *f_hdr)
{
f_hdr->magic = DATA_MGR_MAGIC;
- f_hdr->version = DATA_MGR_V2;
+ f_hdr->version = DATA_MGR_V3;
f_hdr->first_msg_offset = 0;
f_hdr->end_time = 0;
f_hdr->begin_time = 0;
@@ -452,11 +452,11 @@ static int get_header(FILE *fp, struct file_header *hdr)
toolname);
return -2;
}
- if (hdr->version != DATA_MGR_V2) {
+ if (hdr->version != DATA_MGR_V3) {
fprintf(stderr, "%s: Wrong version: .log data is in version %u"
" format, while this tool only supports version %u."
" Get the matching tool version and try again.\n",
- toolname, hdr->version, DATA_MGR_V2);
+ toolname, hdr->version, DATA_MGR_V3);
return -2;
}
hdr->begin_time = 0;
@@ -557,11 +557,11 @@ static int read_aggr_file(FILE *fp, struct aggr_data *data)
toolname);
return -1;
}
- if (data->version != DATA_MGR_V2) {
+ if (data->version != DATA_MGR_V3) {
fprintf(stderr, "%s: Wrong version: .agg data is in version %u"
" format, while this tool only supports version %u."
" Get the matching tool version and try again.\n",
- toolname, data->version, DATA_MGR_V2);
+ toolname, data->version, DATA_MGR_V3);
return -1;
}
@@ -805,7 +805,7 @@ int write_aggr_file(FILE *fp, struct aggr_data *data)
void init_aggr_data_struct(struct aggr_data *data)
{
data->magic = DATA_MGR_MAGIC_AGGR;
- data->version = DATA_MGR_V2;
+ data->version = DATA_MGR_V3;
data->num_zfcpdd = 0;
data->num_blkiomon = 0;
data->end_time = 0;
diff --git a/ziomon/ziomon_dacc.h b/ziomon/ziomon_dacc.h
index f280c9b..8f301f4 100644
--- a/ziomon/ziomon_dacc.h
+++ b/ziomon/ziomon_dacc.h
@@ -17,7 +17,7 @@
#define DATA_MGR_MAGIC 0x64616d67
#define DATA_MGR_MAGIC_AGGR 0x61676772
-#define DATA_MGR_V2 2u
+#define DATA_MGR_V3 3u
/**
--
1.6.0.6

View File

@ -1,32 +0,0 @@
From 8384b80dac573a65de6610ff8dae753a0e2d6deb Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Mon, 13 Jul 2009 10:29:52 +0200
Subject: [PATCH] s390-tools-1.8.1-lsluns-disk-enc
Description: lsluns: fix byte check for disk encryption check.
Symptom: Encrypted disks are never displayed as encrypted.
Problem: The check was performed on the wrong bit.
Solution: Perform the check on the correct bit.
Problem-ID: 54517
---
zconf/lsluns | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/zconf/lsluns b/zconf/lsluns
index 08a11ba..164282e 100755
--- a/zconf/lsluns
+++ b/zconf/lsluns
@@ -216,8 +216,8 @@ sub show_attached_lun_info
(my $mod = substr($inq, 0x10, 0x10)) =~ s/\s*//g;
my $type = ord(substr($inq, 0x0, 0x1));
my $enc = ($mod =~ /2107/) ?
- ord(substr($inq, 0xa2, 0x80)) : 0;
- $l .= "(X)" if ($enc & 0x8);
+ ord(substr($inq, 0xa2, 0x1)) : 0;
+ $l .= "(X)" if ($enc & 0x80);
$txt[$type] = $type if (!defined($txt[$type]));
print("\t\tlun = $l\t$sg_dev\t$txt[$type]",
"\t$vend:$mod\n");
--
1.6.0.6

View File

@ -1,25 +0,0 @@
From af1d22ef04368fd201480959ad6647853d82a25e Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Wed, 26 Aug 2009 14:20:50 +0200
Subject: [PATCH 20/21] s390-tools-1.8.1-cpuplugd-cmminit
---
cpuplugd/config.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cpuplugd/config.c b/cpuplugd/config.c
index 93b31e5..c013a65 100644
--- a/cpuplugd/config.c
+++ b/cpuplugd/config.c
@@ -348,7 +348,7 @@ void check_config(struct config *cfg)
"configuration detected\n");
}
}
- if (cfg->cmm_max < 0 || cfg->cmm_min < -1
+ if (cfg->cmm_max < 0 || cfg->cmm_min < 0
|| cfg->cmm_inc < 0 || cfg->memplug == NULL || cfg->update < 0
|| cfg->memunplug == NULL) {
if (foreground == 1)
--
1.6.3.3

View File

@ -1,25 +0,0 @@
From ce6dabd2c97ae9ff589232f7ff95c699a9755267 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Wed, 26 Aug 2009 14:21:14 +0200
Subject: [PATCH 21/21] s390-tools-1.8.1-lszfcp-perf
---
zconf/lszfcp | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/zconf/lszfcp b/zconf/lszfcp
index e6fc94f..8ac66ea 100755
--- a/zconf/lszfcp
+++ b/zconf/lszfcp
@@ -231,7 +231,7 @@ show_devices()
# Differentiate old and new sysfs layout
if $FC_CLASS; then
SCSI_DEVICE_LIST=`ls -d \
- $SYSFS/devices/css0/*/*/host*/rport*/target*/*/ \
+ $SYSFS/bus/ccw/drivers/zfcp/*/host*/rport*/target*/*/ \
2>/dev/null |grep -P '\d+:\d+:\d+:\d+'`
else
SCSI_DEVICE_LIST=`ls -d $SYSFS/devices/css0/*/*/host*/*/`
--
1.6.3.3

View File

@ -1,28 +0,0 @@
From 664ab55f566e46c31806b25a976dea444a7976a3 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Thu, 24 Sep 2009 09:12:39 +0200
Subject: [PATCH] fix string overflow in vtoc_volume_label_init
Originaly it tries to copy a 84B string into 4B field and reset also
the other fields thru the overflow. This doesn't work with recent GCC
and the security-related compile flags that are used in Fedora.
---
libvtoc/vtoc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libvtoc/vtoc.c b/libvtoc/vtoc.c
index 62a02a0..cebd5a4 100644
--- a/libvtoc/vtoc.c
+++ b/libvtoc/vtoc.c
@@ -326,7 +326,7 @@ void vtoc_volume_label_init (volume_label_t *vlabel)
{
sprintf(buffer, "%84s", " ");
vtoc_ebcdic_enc(buffer, buffer, 84);
- strncpy(vlabel->volkey, buffer, 84);
+ memcpy(vlabel, buffer, 84);
}
--
1.6.3.3

183
20-zipl-kernel.install Executable file
View File

@ -0,0 +1,183 @@
#!/bin/bash
if ! [[ $KERNEL_INSTALL_MACHINE_ID ]]; then
exit 0
fi
[[ -f /etc/sysconfig/kernel ]] && . /etc/sysconfig/kernel
COMMAND="$1"
KERNEL_VERSION="$2"
BOOT_DIR_ABS="$3"
KERNEL_IMAGE="$4"
KERNEL_DIR="${KERNEL_IMAGE%/*}"
MACHINE_ID=$KERNEL_INSTALL_MACHINE_ID
BLS_DIR="/boot/loader/entries"
ZIPLCFG="/etc/zipl.conf"
CMDLINE_LINUX_DEBUG=" systemd.log_level=debug systemd.log_target=kmsg"
LINUX_DEBUG_VERSION_POSTFIX="_with_debugging"
LINUX_DEBUG_TITLE_POSTFIX=" with debugging"
mkbls() {
local kernelver=$1 && shift
local datetime=$1 && shift
local kernelopts=$1 && shift
local debugname=""
local flavor=""
if [[ "$kernelver" == *\+* ]] ; then
local flavor=-"${kernelver##*+}"
if [[ "${flavor}" == "-debug" ]]; then
local debugname=" with debugging"
local debugid="-debug"
fi
fi
cat <<EOF
title ${NAME} (${kernelver}) ${VERSION}${debugname}
version ${kernelver}${debugid}
linux /boot/vmlinuz-${kernelver}
initrd /boot/initramfs-${kernelver}.img
options ${kernelopts}
id ${ID}-${datetime}-${kernelver}${debugid}
grub_users \$grub_users
grub_arg --unrestricted
grub_class kernel${flavor}
EOF
}
[[ "$KERNEL_VERSION" == *\+* ]] && flavor=-"${KERNEL_VERSION##*+}"
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_DIR"/System.map \
"$KERNEL_DIR"/config \
"$KERNEL_DIR"/zImage.stub
do
[[ -e "$i" ]] || continue
cp --preserve=timestamps -T "$i" "/boot/${i##*/}-${KERNEL_VERSION}"
command -v restorecon &>/dev/null && \
restorecon -R "/boot/${i##*/}-${KERNEL_VERSION}"
done
# hmac is .vmlinuz-<version>.hmac so needs a special treatment
i="$KERNEL_DIR/.${KERNEL_IMAGE##*/}.hmac"
if [[ -e "$i" ]]; then
cp --preserve=timestamps "$i" "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac"
command -v restorecon &>/dev/null && \
restorecon "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac"
fi
fi
if [[ ! -f /sbin/new-kernel-pkg || -d "${BLS_DIR}" ]]; then
declare -a BOOT_OPTIONS
if [[ -f /etc/kernel/cmdline ]]; then
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
fi
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
read -r -d '' -a line < /proc/cmdline
for i in "${line[@]}"; do
[[ "${i#initrd=*}" != "$i" || "${i#BOOT_IMAGE=*}" != "$i" ]] && continue
BOOT_OPTIONS+=("$i")
done
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 --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}"
else
mkbls "${KERNEL_VERSION}" \
"$(date -u +%Y%m%d%H%M%S -d "$(stat -c '%y' "${KERNEL_DIR}")")" \
"${BOOT_OPTIONS[*]}" >"${BLS_TARGET}"
fi
if [[ "$KERNEL_VERSION" == *\+* ]] && [ "x$DEFAULTDEBUG" != "xyes" ]; then
UPDATEDEFAULT="no"
fi
if [[ "x$UPDATEDEFAULT" = "xyes" ]]; then
TITLE="$(grep '^title[ \t]' "${BLS_TARGET}" | sed -e 's/^title[ \t]*//')"
NEWDEFAULT="${TITLE}"
fi
if [ "x${MAKEDEBUG}" = "xyes" ]; then
BLS_DEBUG="$(echo ${BLS_TARGET} | sed -e "s/${KERNEL_VERSION}/${KERNEL_VERSION}~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/")"
sed -i -e "s/^title.*/title ${TITLE}${LINUX_DEBUG_TITLE_POSTFIX}/" "${BLS_DEBUG}"
sed -i -e "s/^version.*/version ${VERSION}${LINUX_DEBUG_VERSION_POSTFIX}/" "${BLS_DEBUG}"
sed -i -e "s/^id.*/${BLSID}/" "${BLS_DEBUG}"
sed -i -e "s#^options.*#options ${BOOT_OPTIONS[*]}${CMDLINE_LINUX_DEBUG}#" "${BLS_DEBUG}"
if [ -n "$NEWDEFAULT" -a "x$DEFAULTDEBUG" = "xyes" ]; then
TITLE="$(grep '^title[ \t]' "${BLS_DEBUG}" | sed -e 's/^title[ \t]*//')"
NEWDEFAULT="${TITLE}"
fi
fi
if [ -n "$NEWDEFAULT" ] && [ -f "${ZIPLCFG}" ]; then
if grep -q "^default=" "${ZIPLCFG}"; then
sed -i -e "s,^default=.*,default=${NEWDEFAULT}," "${ZIPLCFG}"
else
echo "default=${NEWDEFAULT}" >> "${ZIPLCFG}"
fi
fi
exit 0
fi
/sbin/new-kernel-pkg --package "kernel${flavor}" --install "$KERNEL_VERSION" || exit $?
/sbin/new-kernel-pkg --package "kernel${flavor}" --mkinitrd --dracut --depmod --update "$KERNEL_VERSION" || exit $?
/sbin/new-kernel-pkg --package "kernel${flavor}" --rpmposttrans "$KERNEL_VERSION" || exit $?
# If grubby is used there's no need to run other installation plugins
exit 77
;;
remove)
if [[ ! -f /sbin/new-kernel-pkg || -d "${BLS_DIR}" ]]; then
ARCH="$(uname -m)"
BLS_TARGET="${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf"
BLS_DEBUG="$(echo ${BLS_TARGET} | sed -e "s/${KERNEL_VERSION}/${KERNEL_VERSION}~debug/")"
if [ -f "${BLS_TARGET}" ] && [ -f "${ZIPLCFG}" ]; then
TITLE="$(grep '^title[ \t]' "${BLS_TARGET}" | sed -e 's/^title[ \t]*//')"
sed -i -e "/^default=${TITLE}/d" "${ZIPLCFG}"
fi
if [[ -f "${BLS_DEBUG}" ]]; then
TITLE="$(grep '^title[ \t]' "${BLS_DEBUG}" | sed -e 's/^title[ \t]*//')"
sed -i -e "/^default=${TITLE}/d" "${ZIPLCFG}"
fi
rm -f "${BLS_TARGET}" "${BLS_DEBUG}"
for i in vmlinuz System.map config zImage.stub dtb; do
rm -rf "/boot/${i}-${KERNEL_VERSION}"
done
# hmac is .vmlinuz-<version>.hmac so needs a special treatment
rm -f "/boot/.vmlinuz-${KERNEL_VERSION}.hmac"
exit 0
fi
/sbin/new-kernel-pkg --package "kernel${flavor+-$flavor}" --rminitrd --rmmoddep --remove "$KERNEL_VERSION" || exit $?
# If grubby is used there's no need to run other installation plugins
exit 77
;;
*)
;;
esac

42
52-zipl-rescue.install Executable file
View File

@ -0,0 +1,42 @@
#!/bin/bash
[[ -f /etc/os-release ]] && . /etc/os-release
[[ -f /etc/sysconfig/kernel ]] && . /etc/sysconfig/kernel
COMMAND="$1"
KERNEL_VERSION="$2"
BOOT_DIR_ABS="$3"
KERNEL_IMAGE="$4"
MACHINE_ID=$KERNEL_INSTALL_MACHINE_ID
BLS_DIR="/boot/loader/entries"
[[ "$KERNEL_VERSION" == *\+* ]] && flavor=-"${KERNEL_VERSION##*+}"
case "$COMMAND" in
add)
if [[ ! -f /sbin/new-kernel-pkg || -d "${BLS_DIR}" ]]; then
declare -a BOOT_OPTIONS
if [[ -f /etc/kernel/cmdline ]]; then
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
fi
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
read -r -d '' -a line < /proc/cmdline
for i in "${line[@]}"; do
[[ "${i#initrd=*}" != "$i" ]] && continue
BOOT_OPTIONS+=("$i")
done
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}"
sed -i -e "s,^initrd.*,initrd /boot/initramfs-0-rescue-${MACHINE_ID}.img,g" "${BLS_RESCUE}"
sed -i -e "s#^options.*#options ${BOOT_OPTIONS[*]}#g" "${BLS_RESCUE}"
fi
fi
;;
*)
;;
esac

15
91-zipl.install Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
if [[ ! -f /etc/zipl.conf ]]; then
exit 0
fi
COMMAND="$1"
case "$COMMAND" in
add|remove)
zipl > /dev/null
;;
*)
;;
esac

View File

@ -1,21 +0,0 @@
# Makefile for source rpm: s390utils
# $Id$
NAME := s390utils
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attept a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

4
ccw.udev Normal file
View File

@ -0,0 +1,4 @@
ACTION!="add|bind|change", GOTO="ccw_end"
SUBSYSTEM!="ccw", GOTO="ccw_end"
DRIVER=="ctcm|lcs|qeth", RUN+="ccw_init"
LABEL="ccw_end"

200
ccw_init Normal file
View File

@ -0,0 +1,200 @@
#! /bin/sh
[ -z "$DEVPATH" ] && exit 0
[ "$SUBSYSTEM" != "ccw" ] && exit 0
[ -e /etc/ccw.conf ] && MODE="dracut" || MODE="normal"
OLD_IFS="$IFS"
get_config_line_by_subchannel()
{
local CHANNEL
CHANNEL="$1"
while read line; do
IFS=","
set $line
IFS="$OLD_IFS"
for i in $@; do
if [ "$CHANNEL" = "$i" ]; then
echo $line
return 0
fi
done
done < /etc/ccw.conf
return 1
}
# borrowed from network-scrips, initscripts along with the get_config_by_subchannel
[ -z "$__sed_discard_ignored_files" ] && __sed_discard_ignored_files='/\(~\|\.bak\|\.old\|\.orig\|\.rpmnew\|\.rpmorig\|\.rpmsave\)$/d'
get_config_by_subchannel ()
{
LANG=C grep -E -i -l \
"^[[:space:]]*SUBCHANNELS=['\"]?([0-9]\.[0-9]\.[a-f0-9]+,){0,2}${1}(,[0-9]\.[0-9]\.[a-f0-9]+){0,2}['\"]?([[:space:]]+#|[[:space:]]*$)" \
/etc/sysconfig/network-scripts/ifcfg-* \
| LC_ALL=C sed -e "$__sed_discard_ignored_files"
}
get_config_by_subchannel_nm ()
{
LANG=C grep -E -i -l \
"^s390-subchannels=([0-9]\.[0-9]\.[a-f0-9]+;){0,2}${1};([0-9]\.[0-9]\.[a-f0-9]+;){0,2}$" \
/etc/NetworkManager/system-connections/*.nmconnection \
| LC_ALL=C sed -e "$__sed_discard_ignored_files"
}
CHANNEL=${DEVPATH##*/}
if [ $MODE = "dracut" ]; then
CONFIG_LINE=$(get_config_line_by_subchannel $CHANNEL)
[ $? -ne 0 -o -z "$CONFIG_LINE" ] && break
IFS=","
set $CONFIG_LINE
IFS="$OLD_IFS"
NETTYPE=$1
shift
SUBCHANNELS="$1"
OPTIONS=""
shift
while [ $# -gt 0 ]; do
case $1 in
*=*) OPTIONS="$OPTIONS $1";;
[0-9]*) SUBCHANNELS="$SUBCHANNELS,$1";;
esac
shift
done
elif [ $MODE = "normal" ]; then
NOLOCALE="yes"
CONFIG_FILE=$(get_config_by_subchannel $CHANNEL)
if [ -n "$CONFIG_FILE" ]; then
. $CONFIG_FILE
else
CONFIG_FILE=$(get_config_by_subchannel_nm $CHANNEL)
if [ -n "$CONFIG_FILE" ]; then
NETTYPE=$(sed -nr "/^\[ethernet\]/ { :l /^s390-nettype[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" $CONFIG_FILE)
SUBCHANNELS=$(sed -nr "/^\[ethernet\]/ { :l /^s390-subchannels[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" $CONFIG_FILE | sed -e "s/;/,/g" -e "s/,$//")
LAYER2=$(sed -nr "/^\[ethernet-s390-options\]/ { :l /^layer2[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" $CONFIG_FILE)
else
exit 1
fi
fi
else
echo "Unknown mode=$MODE"
exit 1
fi
# now we have extracted these variables from the config files:
# SUBCHANNELS
# OPTIONS
# put LAYER2 option into its own variable
set $OPTIONS
OPTIONS=""
while [ $# -gt 0 ]; do
case $1 in
layer2=*) LAYER2=${1##layer2=};;
*=*) OPTIONS="$OPTIONS $1";;
esac
shift
done
# translate variables from the interface config files to OPTIONS
if [ -n "$PORTNAME" ]; then
if [ "$NETTYPE" = "lcs" ]; then
OPTIONS="$OPTIONS portno=$PORTNAME"
else
OPTIONS="$OPTIONS portname=$PORTNAME"
fi
fi
if [ "$NETTYPE" = "ctc" -a -n "$CTCPROT" ]; then
OPTIONS="$OPTIONS protocol=$CTCPROT"
fi
# SUBCHANNELS is only set on mainframe ccwgroup devices
[ -z "$SUBCHANNELS" -o -z "$NETTYPE" ] && exit 0
if [ "$NETTYPE" = "ctc" ]; then
DIR="/sys/bus/ccwgroup/drivers/ctcm"
else
DIR="/sys/bus/ccwgroup/drivers/$NETTYPE"
fi
i=0
while [ $i -lt 20 ]; do
[ -e $DIR ] && break
sleep 0.1
i=$(($i+1))
done
# driver missing or not loaded
[ ! -e $DIR ] && exit 0
IFS=","
set $SUBCHANNELS
IFS="$OLD_IFS"
CHANNEL1=$1
CHANNEL2=$2
SYSDIR="$DIR/$CHANNEL1"
[ -e $SYSDIR ] && exit 0
# check if the interface is already online
if [ -e $SYSDIR/online ]; then
read on <$SYSDIR/online
[ "$on" = "1" ] && exit 0
fi
DRIVER=$(readlink $DEVPATH/driver)
DRIVER=${DRIVER##*/}
if [ "$DRIVER" = "lcs" -a "$NETTYPE" = "ctc" ]; then
echo "$CHANNEL" > /sys/bus/ccw/drivers/lcs/unbind
echo "$CHANNEL" > /sys/bus/ccw/drivers/ctcm/bind
echo "$CHANNEL2" > /sys/bus/ccw/drivers/lcs/unbind
echo "$CHANNEL2" > /sys/bus/ccw/drivers/ctcm/bind
fi
if [ "$DRIVER" = "ctcm" -a "$NETTYPE" = "lcs" ]; then
echo "$CHANNEL" > /sys/bus/ccw/drivers/ctcm/unbind
echo "$CHANNEL" > /sys/bus/ccw/drivers/lcs/bind
echo "$CHANNEL2" > /sys/bus/ccw/drivers/ctcm/unbind
echo "$CHANNEL2" > /sys/bus/ccw/drivers/lcs/bind
fi
if [ ! -e $SYSDIR ]; then
echo "$SUBCHANNELS" > $DIR/group
i=0
while [ $i -lt 20 ]; do
[ -e $SYSDIR ] && break
sleep 0.1
i=$(($i+1))
done
[ ! -e $SYSDIR ] && exit 1
fi
# check if the interface is already online
if [ -e $SYSDIR/online ]; then
read on <$SYSDIR/online
[ "$on" = "1" ] && exit 0
fi
# first set layer2, other options may depend on it
[ -n "$LAYER2" ] && echo $LAYER2 > $SYSDIR/layer2
if [ -n "$OPTIONS" ]; then
for i in $OPTIONS; do
OPT=${i%%=*}
VAL=${i##*=}
if [ -e "$SYSDIR/$OPT" ]; then
echo "$VAL" > "$SYSDIR/$OPT" || \
echo "Could not set value \"$VAL\" for OPTION \"$OPT\" with SUBCHANNELS \"$SUBCHANNELS\""
else
echo "OPTION \"$OPT\" does not exist for SUBCHANNELS \"$SUBCHANNELS\""
fi
done
fi
[ -e $SYSDIR/online ] && echo 1 > $SYSDIR/online

View File

@ -1,12 +0,0 @@
diff -urN cmsfs-1.1.8/cmsfssed.sh cmsfs-1.1.8_/cmsfssed.sh
--- cmsfs-1.1.8/cmsfssed.sh 2003-02-28 17:52:59.000000000 -0500
+++ cmsfs-1.1.8_/cmsfssed.sh 2004-05-28 16:36:22.000000000 -0400
@@ -85,7 +85,7 @@
DRIVER_SOURCE="cmsfs22x.c"
MODULES_DIRECTORY="/lib/modules/`uname -r`/fs"
;;
- 2.4*|2.5*)
+ 2.4*|2.5*|2.6*)
LINUX_RELEASE="2.4"
# ln -s cmsfs24x.c cmsfsvfs.c
INCLUDES="-I/lib/modules/`uname -r`/build/include"

View File

@ -1,11 +0,0 @@
--- cmsfs-1.1.8/cmsfsvol.c.warnings 2003-07-18 01:38:57.000000000 +0200
+++ cmsfs-1.1.8/cmsfsvol.c 2005-09-06 16:57:15.000000000 +0200
@@ -52,7 +52,7 @@
/* print a header; looks like CMS */
(void) printf("LABEL VDEV M STAT CYL TYPE \
-BLKSZ FILES BLKS USED-(%) BLKS LEFT BLK TOTAL\n");
+BLKSZ FILES BLKS USED-(%%) BLKS LEFT BLK TOTAL\n");
for ( ; i < argc ; i++)
{

View File

@ -1,2 +1,16 @@
KERNEL=="dasd*[a-z]", SUBSYSTEM=="block", PROGRAM=="/bin/sh -c 'cd /sys/block/$kernel/device;a=$$(pwd -P);echo $${a##*/}'", SYMLINK+="dasd/%c/disc"
KERNEL=="dasd*[0-9]", SUBSYSTEM=="block", PROGRAM=="/bin/sh -c 'cd /sys/block/$parent/device;a=$$(pwd -P);echo $${a##*/}'", SYMLINK+="dasd/%c/part%n"
ACTION=="add", SUBSYSTEM=="drivers", KERNEL=="dasd-eckd", RUN+="/sbin/dasdconf.sh"
ACTION=="add", SUBSYSTEM=="drivers", KERNEL=="dasd-fba", RUN+="/sbin/dasdconf.sh"
# This list should be autogenerated with "modinfo dasd_{eckd,fba}_mod"
ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t1750m*dt3380dm*", RUN+="/sbin/dasdconf.sh"
ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t1750m*dt3390dm*", RUN+="/sbin/dasdconf.sh"
ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t2107m*dt3380dm*", RUN+="/sbin/dasdconf.sh"
ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t2107m*dt3390dm*", RUN+="/sbin/dasdconf.sh"
ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t9343m*dt9345dm*", RUN+="/sbin/dasdconf.sh"
ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t2105m*dt3380dm*", RUN+="/sbin/dasdconf.sh"
ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t3990m*dt3380dm*", RUN+="/sbin/dasdconf.sh"
ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t3880m*dt3390dm*", RUN+="/sbin/dasdconf.sh"
ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t2105m*dt3390dm*", RUN+="/sbin/dasdconf.sh"
ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t3990m*dt3390dm*", RUN+="/sbin/dasdconf.sh"
ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t3880m*dt3370dm*", RUN+="/sbin/dasdconf.sh"
ACTION=="add", SUBSYSTEM=="ccw", ATTR{modalias}=="ccw:t6310m*dt9336dm*", RUN+="/sbin/dasdconf.sh"

94
dasdconf.sh Normal file
View File

@ -0,0 +1,94 @@
#!/bin/sh
# config file syntax:
# deviceno sysfs_opts...
#
# Examples:
# 0.0.0203 readonly=1 failfast=1
# 0.0.0204
# 0.0.0205 erplog=1
[ -z "$DEVPATH" ] && exit 0
[ "$ACTION" != "add" ] && exit 0
CHANNEL=${DEVPATH##*/}
CONFIG=/etc/dasd.conf
PATH=/sbin:/bin
export PATH
warn() {
[ -e /dev/kmsg ] && echo "<4>dasdconf.sh Warning: $@" > /dev/kmsg
echo "dasdconf.sh Warning: $@" >&2
}
if [ -f "$CONFIG" ]; then
if [ ! -d /sys/bus/ccw/drivers/dasd-eckd ] && [ ! -d /sys/bus/ccw/drivers/dasd-fba ]; then
#warn "No dasd-eckd or dasd-eckd loaded"
exit 0
fi
sed 'y/ABCDEF/abcdef/' < $CONFIG | while read line; do
case $line in
\#*) ;;
*)
[ -z "$line" ] && continue
set $line
# if we are in single add mode, only add the new CHANNEL
[ "$SUBSYSTEM" = "ccw" ] && [ "$1" != "$CHANNEL" ] && continue
DEVICE=$1
SYSFSPATH=
if [ -r "/sys/bus/ccw/drivers/dasd-eckd/$DEVICE" ]; then
SYSFSPATH="/sys/bus/ccw/drivers/dasd-eckd/$DEVICE"
elif [ -r "/sys/bus/ccw/drivers/dasd-fba/$DEVICE" ]; then
SYSFSPATH="/sys/bus/ccw/drivers/dasd-fba/$DEVICE"
else
# if we are in single add mode, this is a failure!
[ "$SUBSYSTEM" = "ccw" ] && warn "Could not find $DEVICE in sysfs"
continue
fi
# skip already onlined devices
if [ "$(cat $SYSFSPATH/online)" = "1" ]; then
if [ "$SUBSYSTEM" = "ccw" ]; then
# if we are in single add mode, we should not touch the device
warn "$DEVICE is already online, not configuring"
exit 0
fi
continue
fi
shift
while [ -n "$1" ]; do
(
attribute="$1"
IFS="="
set $attribute
if [ "$1" = "use_diag" ]; then
# this module better only returns after
# all sysfs entries have the "use_diag" file
modprobe dasd_diag_mod
fi
if [ -r "$SYSFSPATH/$1" ]; then
echo $2 > $SYSFSPATH/$1 || warn "Could not set $1=$2 for $DEVICE"
else
warn "$1 does not exist for $DEVICE"
fi
)
shift
done
# Now, put the device online
echo 1 > $SYSFSPATH/online || echo "Could not activate $DEVICE"
# if we are in single add mode, we are done
[ "$SUBSYSTEM" = "ccw" ] && exit 0
;;
esac
done
fi
exit 0

321
device_cio_free Normal file
View File

@ -0,0 +1,321 @@
#!/bin/sh
#
# Copyright 2009, 2010 Red Hat, Inc.
# License: GPLv2
# Author: Dan Horák <dhorak@redhat.com>
#
# unblock devices listed in various config files and wait until they are ready
#
# it uses dasd and zfcp config file
# config file syntax:
# deviceno options
# or
# deviceno WWPN FCPLUN
#
# also processes the system ccw config file and network interface configurations
#
# requires: echo, sleep, modprobe, grep, printf, sed.
#
# it is used in
# anaconda
# dracut generated initramfs
# normal system startup driven by upstart
#
DASDCONFIG=/etc/dasd.conf
ZFCPCONFIG=/etc/zfcp.conf
ZNETCONFIG=/etc/ccw.conf
BLACKLIST=/proc/cio_ignore
CIO_SETTLE=/proc/cio_settle
VERBOSE=
PATH=/bin:/sbin
DEVICE= # list of devices given on command line
ALL_DEVICES= # list of all unblocked devices
WAITING_TIMEOUT=60 # maximum time to wait for all devices to appear
WAITING_TOTAL=0 # actual time spent waiting for devices
usage()
{
echo "Usage: $CMD [-h|--help] [-V|--verbose] [-d|--device <deviceid>]"
echo " -h|--help print this message"
echo " -V|--verbose be verbose"
echo " -d|--device <deviceid> unblock and wait for specified device"
exit 1
}
# accepts single device, comma-separated lists and dash separated ranges and their combinations
# the comma separated list is split so we minimize the effect of unsuccessful freeing
free_device()
{
local DEV DEV_LIST
[ -z "$1" ] && return
DEV_LIST=$(echo "$1" | sed 'y/ABCDEF/abcdef/' | sed 's/,/ /g')
for DEV in $DEV_LIST; do
[ $VERBOSE ] && echo "Freeing device(s) $DEV"
if ! echo "free $DEV" > $BLACKLIST 2> /dev/null ; then
echo "Error: can't free device(s) $DEV"
else
if [ -z $ALL_DEVICES ]; then
ALL_DEVICES="$DEV"
else
ALL_DEVICES="$ALL_DEVICES,$DEV"
fi
fi
done
}
# wait until a device appears on the ccw bus
wait_on_single_device()
{
local DEVICE_ONLINE DEV
[ -z "$1" ] && return
DEV="$1"
DEVICE_ONLINE="/sys/bus/ccw/devices/$DEV/online"
[ $VERBOSE ] && echo "Waiting on device $DEV"
[ -f "$DEVICE_ONLINE" ] && return
for t in 1 2 3 4 5
do
if [ $WAITING_TOTAL -ge $WAITING_TIMEOUT ]; then
[ $VERBOSE ] && echo "Waiting timeout of $WAITING_TIMEOUT seconds reached"
break
fi
WAITING_TOTAL=$(($WAITING_TOTAL + $t))
[ $VERBOSE ] && echo "Waiting additional $t second(s) and $WAITING_TOTAL second(s) in total"
sleep $t
[ -f "$DEVICE_ONLINE" ] && return
done
echo "Error: device $DEV still not ready"
}
# wait until recently unblocked devices are ready
# at this point we know the content of ALL_DEVICES is syntacticly correct
wait_on_devices()
{
if [ -w $CIO_SETTLE ]; then
[ $VERBOSE ] && echo "Waiting until all pending CIO requests are processed"
echo 1 > $CIO_SETTLE
return
fi
OLD_IFS=$IFS
IFS=","
set $ALL_DEVICES
for DEV in $*
do
IFS="."
# get the lower bound for range or get the single device
LOWER=${DEV%%-*}
set $LOWER
if [ $# -eq 1 ]; then
L0=0
L1=0
L2=$(printf "%d" "0x$1")
else
L0=$(printf "%d" "0x$1")
L1=$(printf "%d" "0x$2")
L2=$(printf "%d" "0x$3")
fi
# get the upper bound for range or get the single device
UPPER=${DEV##*-}
set $UPPER
if [ $# -eq 1 ]; then
U0=0
U1=0
U2=$(printf "%d" "0x$1")
else
U0=$(printf "%d" "0x$1")
U1=$(printf "%d" "0x$2")
U2=$(printf "%d" "0x$3")
fi
IFS=$OLD_IFS
# iterate thru all devices
i=$L0
while [ $i -le $U0 ]; do
[ $i -eq $L0 ] && LJ=$L1 || LJ=0
[ $i -eq $U0 ] && UJ=$U1 || UJ=3
j=$LJ
while [ $j -le $UJ ]; do
[ $i -eq $L0 -a $j -eq $L1 ] && LK=$L2 || LK=0
[ $i -eq $U0 -a $j -eq $U1 ] && UK=$U2 || UK=65535
k=$LK
while [ $k -le $UK ]; do
wait_on_single_device "$(printf %x.%x.%04x $i $j $k)"
k=$(($k + 1))
done
j=$(($j + 1))
done
i=$(($i + 1))
done
done
}
process_config_file()
{
local CONFIG
[ -z "$1" ] && return
CONFIG="$1"
if [ -f "$CONFIG" ]; then
while read line; do
case $line in
\#*) ;;
*)
[ -z "$line" ] && continue
set $line
free_device $1
;;
esac
done < "$CONFIG"
fi
}
# check how we were called
CMD=${0##*/}
DIR=${0%/*}
ARGS=$@
case $CMD in
"dasd_cio_free")
MODE_DASD="yes"
;;
"zfcp_cio_free")
MODE_ZFCP="yes"
;;
"znet_cio_free")
MODE_ZNET="yes"
;;
"device_cio_free")
MODE_DASD="yes"
MODE_ZFCP="yes"
MODE_ZNET="yes"
;;
*)
echo "Error: unknown alias '$CMD'."
echo "Supported aliases are dasd_cio_free, zfcp_cio_free and znet_cio_free."
exit 1
;;
esac
# process command line options
while [ $# -gt 0 ]; do
case $1 in
-V|--verbose)
VERBOSE=yes
;;
-h|--help)
usage
;;
-d|--device)
shift
if [ "$1" ]; then
if [ "$DEVICE" ]; then
DEVICE="$DEVICE,$1"
else
DEVICE=$1
fi
else
echo "Error: no device given"
usage
fi
;;
*)
echo "Error: unknown option $1"
usage
;;
esac
shift
done
if [ ! -f $BLACKLIST ]; then
echo "Error: $BLACKLIST kernel interface doesn't exist"
exit 2
fi
if [ "$DEVICE" ]; then
[ $VERBOSE ] && echo "Freeing specific devices"
free_device $DEVICE
wait_on_devices
udevadm settle
exit 0
fi
if [ $VERBOSE ]; then
echo -n "Freeing devices:"
[ $MODE_DASD ] && echo -n " dasd"
[ $MODE_ZFCP ] && echo -n " zfcp"
[ $MODE_ZNET ] && echo -n " znet"
echo
fi
[ $MODE_DASD ] && process_config_file $DASDCONFIG
[ $MODE_ZFCP ] && process_config_file $ZFCPCONFIG
if [ $MODE_DASD ]; then
# process the device list defined as option for the dasd module
DEVICES=$(modprobe --showconfig | LANG=C grep "options[[:space:]]\+dasd_mod" | \
sed -e 's/.*[[:space:]]dasd=\([^[:space:]]*\).*/\1/' -e 's/([^)]*)//g' \
-e 's/nopav\|nofcx\|autodetect\|probeonly//g' -e 's/,,/,/g' -e 's/^,//' -e 's/,$//')
for DEVRANGE in $(echo $DEVICES | sed 's/,/ /g'); do
free_device $DEVRANGE
done
fi
if [ $MODE_ZNET ]; then
# process the config file
if [ -f "$ZNETCONFIG" ]; then
while read line; do
case $line in
\#*) ;;
*)
[ -z "$line" ] && continue
# grep 2 or 3 channels from each "<nettype>,<subchannels>,<options>" line
DEVICES=$(echo $line | LANG=C grep -E -i -o "([0-9]\.[0-9]\.[a-f0-9]+,){1,2}([0-9]\.[0-9]\.[a-f0-9]+)")
free_device $DEVICES
;;
esac
done < "$ZNETCONFIG"
fi
# process channels from network interface configurations
if [ -z "$__sed_discard_ignored_files" ]; then
if [ -f /etc/init.d/functions ]; then
. /etc/init.d/functions
else
# default value copied from initscripts 9.03.10
__sed_discard_ignored_files='/\(~\|\.bak\|\.orig\|\.rpmnew\|\.rpmorig\|\.rpmsave\)$/d'
fi
fi
for line in $(LANG=C grep -E -i -h \
"^[[:space:]]*SUBCHANNELS=['\"]?([0-9]\.[0-9]\.[a-f0-9]+,){1,2}([0-9]\.[0-9]\.[a-f0-9]+)['\"]?([[:space:]]+#|[[:space:]]*$)" \
$( (ls /etc/sysconfig/network-scripts/ifcfg-* 2> /dev/null || echo "__no_config_file") | \
LC_ALL=C sed -e "$__sed_discard_ignored_files") 2> /dev/null)
do
eval "$line"
free_device $SUBCHANNELS
done
for line in $(LANG=C grep -E -i -h \
"^s390-subchannels=([0-9]\.[0-9]\.[a-f0-9]+;){2,3}$" \
$( (ls /etc/NetworkManager/system-connections/*.nmconnection 2> /dev/null || echo "__no_config_file") | \
LC_ALL=C sed -e "$__sed_discard_ignored_files") 2> /dev/null)
do
SUBCHANNELS="$(echo $line | sed -e "s/s390-subchannels=//" -e "s/;/,/g")"
free_device $SUBCHANNELS
done
fi
[ -z "$ALL_DEVICES" ] && exit 0
wait_on_devices

12
device_cio_free.service Normal file
View File

@ -0,0 +1,12 @@
[Unit]
Description=Free all devices on startup
DefaultDependencies=no
Before=sysinit.target systemd-udev-trigger.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/device_cio_free
[Install]
WantedBy=sysinit.target

View File

@ -1,36 +0,0 @@
diff -Nrup lib-zfcp-hbaapi-2.0.orig/Makefile.am lib-zfcp-hbaapi-2.0/Makefile.am
--- lib-zfcp-hbaapi-2.0.orig/Makefile.am 2008-11-21 15:08:13.000000000 +0100
+++ lib-zfcp-hbaapi-2.0/Makefile.am 2009-09-25 12:30:07.000000000 +0200
@@ -60,7 +60,7 @@ lib_LTLIBRARIES = libzfcphbaapi.la
libzfcphbaapi_la_SOURCES = vlib.c vlib_callbacks.c vlib_aux.c vlib_sysfs.c \
vlib_sg.c
-libzfcphbaapi_la_LIBADD = -lsysfs -lsgutils
+libzfcphbaapi_la_LIBADD = -lsysfs -lsgutils2
libzfcphbaapi_la_LDFLAGS = \
-version-info $(LIB_CURRENT):$(LIB_REVISION):$(LIB_AGE) \
-lpthread -Wl,-init,_initvlib,-fini,_finivlib \
diff -Nrup lib-zfcp-hbaapi-2.0.orig/Makefile.in lib-zfcp-hbaapi-2.0/Makefile.in
--- lib-zfcp-hbaapi-2.0.orig/Makefile.in 2008-11-21 15:08:18.000000000 +0100
+++ lib-zfcp-hbaapi-2.0/Makefile.in 2009-09-25 13:22:04.000000000 +0200
@@ -248,7 +248,7 @@ lib_LTLIBRARIES = libzfcphbaapi.la
libzfcphbaapi_la_SOURCES = vlib.c vlib_callbacks.c vlib_aux.c vlib_sysfs.c \
vlib_sg.c
-libzfcphbaapi_la_LIBADD = -lsysfs -lsgutils
+libzfcphbaapi_la_LIBADD = -lsysfs -lsgutils2
libzfcphbaapi_la_LDFLAGS = \
-version-info $(LIB_CURRENT):$(LIB_REVISION):$(LIB_AGE) \
-lpthread -Wl,-init,_initvlib,-fini,_finivlib \
diff -Nrup lib-zfcp-hbaapi-2.0.orig/vlib_sg.c lib-zfcp-hbaapi-2.0/vlib_sg.c
--- lib-zfcp-hbaapi-2.0.orig/vlib_sg.c 2008-11-20 10:23:34.000000000 +0100
+++ lib-zfcp-hbaapi-2.0/vlib_sg.c 2009-09-25 13:21:52.000000000 +0200
@@ -19,6 +19,8 @@
* @brief All calls that use sg_utils library.
*/
+#include <scsi/sg_lib.h>
+#include <scsi/sg_cmds.h>
#include "vlib.h"
#define INTERVAL 10000000

120
normalize_dasd_arg Normal file
View File

@ -0,0 +1,120 @@
#!/bin/sh
#
# Copyright 2012 Red Hat, Inc.
# License: GPLv2
# Author: Jesse Keating <jkeating@redhat.com>
#
# Normalize DASD data into valid dasd.conf format
#
# Standard input should be the DASD argument
# Standard otuput is the properly formatted content
#
# it is used in
# dracut generated initramfs
#
# Much of this code was salvaged from linuxrc.s390 from Anaconda:
#
# License GPLv2+
#
# Copyright (C) 2000-2004 by
# Bernhard Rosenkraenzer <bero@redhat.com>
# Oliver Paukstadt <opaukstadt@millenux.com>
# Karsten Hopp <karsten@redhat.de>
# Florian La Roche <laroche@redhat.com>
# Nils Philippsen <nils@redhat.de>
# Helge Deller <hdeller@redhat.de>
# David Sainty <dsainty@redhat.com>
# Copyright (C) IBM Corp. 2008,2009
# Author: Steffen Maier <maier@de.ibm.com>
function canonicalize_devno()
{
case ${#1} in
3) echo "0.0.0${1}" ;;
4) echo "0.0.${1}" ;;
*) echo "${1}" ;;
esac
return 0
}
read DASD
# See if we've gotten a format like <dev>,feature or <dev>,<dev>,<dev>
[[ "$DASD" =~ (\,*=[[:digit:]]) ]]
case $? in
# case of 0 is features, just turn the comma into a space
0) echo $DASD |sed 's/,/ /g';;
*) # We've got no features, do things normally
for dasditem in $(echo $DASD |sed 's/,/ /g')
do
unset range features lo hi attrs devno lodevno hidevno devbusid sys
case $dasditem in
autodetect|probeonly|nopav|nofcx|"") continue ;; # these don't gen a config
*)
IFS='('
read range features <<< "$dasditem"
unset IFS
lo=${range%%-*}
[[ "$lo" =~ (^[[:xdigit:]]+\.[0-3]\.[[:xdigit:]]{4}$)|(^[[:xdigit:]]{3,4}$) ]]
case $? in
0) # string matched the pattern
lo=$(canonicalize_devno $lo) ;;
1) # string did not match the pattern
echo $"Incorrect format for lower bound of DASD range $range: $lo" 1>&2
exit 1
;;
2) echo "l.$LINENO: syntax error in regex of match operator =~, code needs to be fixed" 1>&2 ;;
*) echo "l.$LINENO: unexpected return code of regex match operator =~, code needs to be fixed" 1>&2 ;;
esac
if [ "${range//*-*/}" = "" ]; then
hi=${range##*-}
[[ "$hi" =~ (^[[:xdigit:]]+\.[0-3]\.[[:xdigit:]]{4}$)|(^[[:xdigit:]]{3,4}$) ]]
case $? in
0) # string matched the pattern
hi=$(canonicalize_devno $hi)
if [ "${lo%.*}" != "${hi%.*}" ]; then
echo $"Prefixes of DASD range $range do not match: ${lo%.*} != ${hi%.*}" 1>&2
exit 1
fi
;;
1) # string did not match the pattern
echo $"Incorrect format for upper bound of DASD range $range: $hi" 1>&2
exit 1
;;
2) echo "l.$LINENO: syntax error in regex of match operator =~, code needs to be fixed" 1>&2 ;;
*) echo "l.$LINENO: unexpected return code of regex match operator =~, code needs to be fixed" 1>&2 ;;
esac
fi
if [ "${features//*)/}" != "" ]; then
echo $"Missing closing parenthesis at features of DASD range $range: ($features" 1>&2
exit 1
fi
if [ -n "$features" ]; then
attrs=""
features="${features%)}"
for feature in $(echo $features |sed 's/:/\n/g'); do
case $feature in
ro) attrs=$attrs" readonly" ;;
diag) attrs=$attrs" use_diag" ;;
erplog|failfast) attrs=$attrs" "$feature ;;
*) echo $"Unknown DASD feature for device range $range: $feature" 1>&2
exit 1
;;
esac
done
fi
[ -z "$hi" ] && hi=$lo
lodevno=$((0x${lo##*.}))
hidevno=$((0x${hi##*.}))
for ((devno=$lodevno; $devno <= $hidevno; ++devno)); do
devbusid=$(printf "%s.%04x" ${lo%.*} $devno)
echo -n "$devbusid"
for attr in $attrs; do
echo -n " $attr=1"
done
echo
done
esac
done
;;
esac

8
rpminspect.yaml Normal file
View File

@ -0,0 +1,8 @@
---
pathmigration:
excluded_paths:
- /lib/s390-tools
badfuncs:
ignore:
- /usr/sbin/qethqoat

View File

@ -0,0 +1,348 @@
From b2daaa34776ba6afec879e362378f6f7563590a6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
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 @@
*
*/
-static const char *VERSION_KEYWORD = "version";
/* 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 <pjones@redhat.com>
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 <pjones@redhat.com>
Signed-off-by: Dan Horák <dan@danny.cz>
---
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"
+#include <rpm/rpmlib.h>
+
#include "boot.h"
#include "error.h"
#include "misc.h"
@@ -655,13 +657,103 @@ bls_filter(const struct dirent *ent)
return strncmp(ent->d_name + offset, ".conf", strlen(".conf")) == 0;
}
+/* returns name/version/release */
+/* NULL string pointer returned if nothing found */
+static void
+split_package_string (char *package_string, char **name,
+ char **version, char **release)
+{
+ char *package_version, *package_release;
+
+ /* Release */
+ package_release = strrchr (package_string, '-');
+
+ if (package_release != NULL)
+ *package_release++ = '\0';
+
+ *release = package_release;
+
+ /* Version */
+ package_version = strrchr(package_string, '-');
+
+ if (package_version != NULL)
+ *package_version++ = '\0';
+
+ *version = package_version;
+ /* Name */
+ *name = package_string;
+
+ /* Bubble up non-null values from release to name */
+ if (name != NULL && *name == NULL) {
+ *name = (*version == NULL ? *release : *version);
+ *version = *release;
+ *release = NULL;
+ }
+ if (*version == NULL) {
+ *version = *release;
+ *release = NULL;
+ }
+}
static int
-bls_sort(const struct dirent **ent_a, const struct dirent **ent_b)
+split_cmp(char *nvr0, char *nvr1, int has_name)
+{
+ int ret = 0;
+ char *name0, *version0, *release0;
+ char *name1, *version1, *release1;
+
+ split_package_string(nvr0, has_name ? &name0 : NULL, &version0, &release0);
+ split_package_string(nvr1, has_name ? &name1 : NULL, &version1, &release1);
+
+ if (has_name) {
+ ret = rpmvercmp(name0 == NULL ? "" : name0,
+ name1 == NULL ? "" : name1);
+ if (ret != 0)
+ return ret;
+ }
+
+ ret = rpmvercmp(version0 == NULL ? "" : version0,
+ version1 == NULL ? "" : version1);
+ if (ret != 0)
+ return ret;
+
+ ret = rpmvercmp(release0 == NULL ? "" : release0,
+ release1 == NULL ? "" : release1);
+ return ret;
+}
+
+/* return 1: filename0 is newer than filename1 */
+/* 0: filename0 and filename1 are the same version */
+/* -1: filename1 is newer than filename0 */
+static int bls_cmp(const char *filename0, const char *filename1)
{
- return strverscmp((*ent_a)->d_name, (*ent_b)->d_name);
+ char *id0, *id1;
+ int l, r;
+
+ id0 = strdup(filename0);
+ id1 = strdup(filename1);
+
+ l = strlen(id0);
+ if (l > 5 && strcmp(id0 + l - 5, ".conf"))
+ id0[l-5] = '\0';
+
+ l = strlen(id1);
+ if (l > 5 && strcmp(id1 + l - 5, ".conf"))
+ id1[l-5] = '\0';
+
+ r = split_cmp(id0, id1, 1);
+
+ free(id0);
+ free(id1);
+
+ return r;
}
+static int
+bls_sort(const struct dirent **ent_a, const struct dirent **ent_b)
+{
+ return bls_cmp((*ent_a)->d_name, (*ent_b)->d_name);
+}
static int
scan_append_section_heading(struct scan_token* scan, int* index, char* name);
--
2.39.2

View File

@ -0,0 +1,84 @@
From 2faae5cf51c49e3f166b8526eee276dab2fe7308 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javierm@redhat.com>
Date: Wed, 30 May 2018 14:33:25 +0200
Subject: [PATCH] zipl-switch-to-blscfg: invert ignore-default and
use-version-name options
These options were added because the zipl maintainers wanted a different
default behaviour for the migration script than the one we use. Instead
of requiring to always use these options, just invert the logic for us.
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
scripts/zipl-switch-to-blscfg | 16 +++++++++-------
scripts/zipl-switch-to-blscfg.1 | 8 ++++----
2 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/scripts/zipl-switch-to-blscfg b/scripts/zipl-switch-to-blscfg
index 871935c783f..d8d5eca5867 100755
--- a/scripts/zipl-switch-to-blscfg
+++ b/scripts/zipl-switch-to-blscfg
@@ -57,14 +57,14 @@ Options:
--backup-suffix=SUFFIX suffix used for backup files, defaults to .bak
--bls-directory=DIR path to generate BLS files, defaults to /boot/loader/entries
--config-file=FILE path to zipl configuration file, defaults to /etc/zipl.conf
- --ignore-default ignore the default option from the zipl configuration file
- --use-version-name use the section kernel version as the BLS file name
+ --leave-default leave the default option from the zipl configuration file
+ --use-section-name use the section name as the BLS file name
EOF
}
OPTS="$(getopt -o hv --long help,version,backup-suffix:,bls-directory:,config-file:,\
-ignore-default,use-version-name -n \'$SCRIPTNAME\' -- "$@")"
+leave-default,use-section-name -n \'$SCRIPTNAME\' -- "$@")"
eval set -- "$OPTS"
BACKUP_SUFFIX=.bak
@@ -73,6 +73,8 @@ CMDLINE_LINUX_DEBUG=" systemd.log_level=debug systemd.log_target=kmsg"
LINUX_DEBUG_VERSION_POSTFIX="_with_debugging"
LINUX_DEBUG_TITLE_POSTFIX=" with debugging"
CONFIG="/etc/zipl.conf"
+ignore_default=true
+version_name=true
while [ ${#} -gt 0 ]; do
case "$1" in
@@ -96,11 +98,11 @@ while [ ${#} -gt 0 ]; do
CONFIG=${2}
shift
;;
- --ignore-default)
- ignore_default=true
+ --leave-default)
+ ignore_default=false
;;
- --use-version-name)
- version_name=true
+ --use-section-name)
+ version_name=false
;;
--)
shift
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.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.
.TP
-\fB\-\-ignore-default\fP
-Ignore the default option from the zipl configuration file
+\fB\-\-leave-default\fP
+Leave the default option from the zipl configuration file
.TP
-\fB\-\-use-version-name\fP
-Use the section kernel version as the BLS file name
+\fB\-\-use-section-name\fP
+Use the section name as the BLS file name
--
2.17.0

View File

@ -1,5 +0,0 @@
# /etc/profile.d/s390.csh - set TERM variable
if ( `/sbin/consoletype stdout` == "serial" ) then
setenv TERM dumb
endif

View File

@ -1,6 +0,0 @@
# /etc/profile.d/s390.sh - set TERM variable
contype=`/sbin/consoletype stdout`
if [ "$contype" == "serial" ]; then
export TERM=dumb
fi

View File

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,2 @@
6a94c4655204a4ec7a2c64f42c9afed3 s390-tools-1.8.1.tar.bz2
71a8ee5918f2c44c385fcfe8350cdc98 cmsfs-1.1.8c.tar.gz
2cbfffca3f07c61420899f45d221d451 lib-zfcp-hbaapi-2.0.tar.gz
ba42772e5b305b5e147344442cd70826 src_vipa-2.0.4.tar.gz
SHA512 (s390-tools-2.31.0.tar.gz) = d05722dff760605baad92b25a7a9264b3c936ff851b87a02ab39604a74d02ae4e14632d9b3d83eb9cb82a14bfcbb0d40bb4797896051ed3dd36d7690abfb1c64
SHA512 (s390-tools-2.31.0-rust-vendor.tar.xz) = f9dc2887bb2502ba6f71ef7ea807380c322a46df8c65f0fc7993f3fb4eec4da120369d3e380dbcca9b6250307da0f6236a649504d542f44730e8009ace8ed450

View File

@ -1,74 +0,0 @@
From b2f1bf78400c686bbdbcf4c29fbbb93367abe409 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Wed, 25 Mar 2009 09:36:08 +0100
Subject: [PATCH] fix location of the library
---
Makefile | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index 669b6c6..d395fa8 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,8 @@ INSTALL=install
VERSION=2.0.4
# the path to the .so
-SRC_VIPA_PATH=$(INSTROOT)/usr/lib
+LIBDIR=/usr/lib
+SRC_VIPA_PATH=$(INSTROOT)$(LIBDIR)
# the path to the starter script
SRC_VIPA_STARTER_PATH=$(INSTROOT)/usr/sbin
# path to man page
@@ -34,8 +35,7 @@ src_vipa.so: src_vipa.c
src_vipa.sh:
echo '#!/bin/bash' > src_vipa.sh
- echo 'export LD_LIBRARY_PATH=$(SRC_VIPA_PATH):$$LD_LIBRARY_PATH' >> src_vipa.sh
- echo 'export LD_PRELOAD=$(SRC_VIPA_PATH)/src_vipa.so' >> src_vipa.sh
+ echo 'export LD_PRELOAD=$(LIBDIR)/src_vipa.so' >> src_vipa.sh
echo 'exec $$@' >> src_vipa.sh
chmod 755 src_vipa.sh
@@ -44,7 +44,6 @@ install: src_vipa.so src_vipa.sh
$(INSTALL) -m 755 src_vipa.so $(SRC_VIPA_PATH)
$(INSTALL) -m 755 src_vipa.sh $(SRC_VIPA_STARTER_PATH)
$(INSTALL) -m 644 src_vipa.8 $(SRC_VIPA_MANPAGE_PATH)/man8
- ldconfig
clean:
rm -f src_vipa.{i,s,o,sh,so} core src_vipa-$(VERSION).tar.gz
--
1.6.0.6
From 5c21f29f4d9e82942a997775c111280b85d01bb8 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Wed, 22 Apr 2009 12:53:55 +0200
Subject: [PATCH] make the man page path and script path configurable
---
Makefile | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index d395fa8..365472b 100644
--- a/Makefile
+++ b/Makefile
@@ -23,9 +23,11 @@ VERSION=2.0.4
LIBDIR=/usr/lib
SRC_VIPA_PATH=$(INSTROOT)$(LIBDIR)
# the path to the starter script
-SRC_VIPA_STARTER_PATH=$(INSTROOT)/usr/sbin
+SBINDIR=/usr/sbin
+SRC_VIPA_STARTER_PATH=$(INSTROOT)$(SBINDIR)
# path to man page
-SRC_VIPA_MANPAGE_PATH=$(INSTROOT)/usr/share/man
+MANDIR=/usr/share/man
+SRC_VIPA_MANPAGE_PATH=$(INSTROOT)$(MANDIR)
all: src_vipa.so src_vipa.sh
--
1.6.0.6

View File

@ -1 +1 @@
KERNEL=="zfcp_cfdc", RUN+="/sbin/zfcpconf.sh"
KERNEL=="zfcp", RUN+="/sbin/zfcpconf.sh"

View File

@ -1,46 +1,77 @@
#!/bin/bash
#!/bin/sh
# config file syntax:
# deviceno WWPN FCPLUN
# deviceno # allowed when auto LUN scan is enabled and port is in NPIV mode
#
# Example:
# 0.0.4000 0x5005076300C213e9 0x5022000000000000
# 0.0.4001 0x5005076300c213e9 0x5023000000000000
# 0.0.5000
#
#
# manual setup:
# modprobe zfcp
# echo WWPN > /sys/bus/ccw/drivers/zfcp/0.0.4000/port_add
# echo LUN > /sys/bus/ccw/drivers/zfcp/0.0.4000/WWPN/unit_add
# echo 1 > /sys/bus/ccw/drivers/zfcp/0.0.4000/online
# echo LUN > /sys/bus/ccw/drivers/zfcp/0.0.4000/WWPN/unit_add
#
# Example:
# modprobe zfcp
# echo 0x5005076300c213e9 > /sys/bus/ccw/drivers/zfcp/0.0.4000/port_add
# echo 0x5022000000000000 > /sys/bus/ccw/drivers/zfcp/0.0.4000/0x5005076300c213e9/unit_add
# echo 1 > /sys/bus/ccw/drivers/zfcp/0.0.4000/online
# echo 0x5022000000000000 > /sys/bus/ccw/drivers/zfcp/0.0.4000/0x5005076300c213e9/unit_add
CONFIG=/etc/zfcp.conf
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PATH=/bin:/sbin
set_online()
{
DEVICE=$1
[ `cat /sys/bus/ccw/drivers/zfcp/${DEVICE}/online` = "0" ] \
&& echo 1 > /sys/bus/ccw/drivers/zfcp/${DEVICE}/online
}
if [ -f "$CONFIG" ]; then
if [ ! -d /sys/bus/ccw/drivers/zfcp ]; then
modprobe zfcp
fi
if [ ! -d /sys/bus/ccw/drivers/zfcp ]; then
return
exit 1
fi
cat $CONFIG | grep -v "^#" | tr "A-Z" "a-z" | while read line; do
numparams=$(echo $line | wc -w)
if [ $numparams == 5 ]; then
read DEVICE SCSIID WWPN SCSILUN FCPLUN < <(echo $line)
echo "Warning: Deprecated values in /etc/zfcp.conf, ignoring SCSI ID $SCSIID and SCSI LUN $SCSILUN"
elif [ $numparams == 3 ]; then
read DEVICE WWPN FCPLUN < <(echo $line)
fi
[ ! -d /sys/bus/ccw/drivers/zfcp/${DEVICE/0x/}/$WWPN ] && echo $WWPN > /sys/bus/ccw/drivers/zfcp/${DEVICE/0x/}/port_add
[ ! -d /sys/bus/ccw/drivers/zfcp/${DEVICE/0x/}/$WWPN/$FCPLUN ] && echo $FCPLUN > /sys/bus/ccw/drivers/zfcp/${DEVICE/0x/}/$WWPN/unit_add
echo 1 > /sys/bus/ccw/drivers/zfcp/${DEVICE/0x/}/online
sed 'y/ABCDEF/abcdef/' < $CONFIG | while read line; do
case $line in
\#*) ;;
*)
[ -z "$line" ] && continue
set $line
if [ $# -eq 1 ]; then
DEVICE=${1##*0x}
if [ `cat /sys/module/zfcp/parameters/allow_lun_scan` = "Y" ]; then
set_online ${DEVICE}
grep -q NPIV /sys/bus/ccw/devices/${DEVICE}/host*/fc_host/host*/port_type || \
echo "Error: Only device ID (${DEVICE}) given, but port not in NPIV mode"
else
echo "Error: Only device ID (${DEVICE}) given, but LUN scan is disabled for the zfcp module"
fi
continue
fi
if [ $# -eq 5 ]; then
DEVICE=$1
SCSIID=$2
WWPN=$3
SCSILUN=$4
FCPLUN=$5
echo "Warning: Deprecated values in /etc/zfcp.conf, ignoring SCSI ID $SCSIID and SCSI LUN $SCSILUN"
elif [ $# -eq 3 ]; then
DEVICE=${1##*0x}
WWPN=$2
FCPLUN=$3
fi
set_online ${DEVICE}
[ ! -d /sys/bus/ccw/drivers/zfcp/${DEVICE}/${WWPN}/${FCPLUN} ] \
&& echo $FCPLUN > /sys/bus/ccw/drivers/zfcp/${DEVICE}/${WWPN}/unit_add
;;
esac
done
fi
exit 0