Compare commits

...

217 Commits
f15 ... rawhide

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
2023-11-10 11:59:34 +01:00
Dan Horák
7a5c89e84a do not preserve ownership or xattrs on copied files
clone of 8800efcb0b
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
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
102 changed files with 2017 additions and 35585 deletions

4
.gitignore vendored
View File

@ -3,3 +3,7 @@ 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 2b8336a93376953ba0ed84223264be55243ac7f8 Mon Sep 17 00:00:00 2001
From: Dan Horak <dan@danny.cz>
Date: Sun, 20 Jul 2008 09:24:05 +0200
Subject: [PATCH 1/9] 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 8b248f1..0a7916e 100644
--- a/common.mak
+++ b/common.mak
@@ -63,8 +63,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
--
1.6.3.3

View File

@ -1,423 +0,0 @@
From 2513c0f8096c681f962d77420dac731f7bb33e44 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 2/9] 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 c5c85d8..6a526e4 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 9cb764c..4d9fd36 100644
--- a/zipl/src/zipl.c
+++ b/zipl/src/zipl.c
@@ -73,6 +73,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.3.3

View File

@ -1,33 +0,0 @@
From f8acd63e169cdec39c47ac0d8c1b98e115cf24a1 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 3/9] 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 aa16659..3a54968 100644
--- a/fdasd/fdasd.c
+++ b/fdasd/fdasd.c
@@ -2009,10 +2009,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.3.3

View File

@ -1,153 +0,0 @@
From 35298f5f9512835071b8c08e843731bbfbb15b7e 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 4/9] 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 3a54968..a526d7f 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;
@@ -312,6 +312,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");
@@ -1122,14 +1126,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);
@@ -1145,10 +1159,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);
@@ -1433,9 +1458,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;
@@ -1448,6 +1474,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);
}
@@ -1625,7 +1654,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;
@@ -1677,14 +1706,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.3.3

View File

@ -1,59 +0,0 @@
From 1efcfe8d7ad20f7a3f584628375da60682b4579c 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 5/9] 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 6a526e4..89c8c23 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.3.3

View File

@ -1,31 +0,0 @@
From 894de5382653e4389dc8490f2ee4a2a9c59eb86d 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 6/9] 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 6ebf240..6df6026 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.3.3

View File

@ -1,25 +0,0 @@
From 80e1e88e108b774c7aa7c201326f1a92cf1b7e35 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 7/9] 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 d0bf84f..a872d05 100755
--- a/zconf/lszfcp
+++ b/zconf/lszfcp
@@ -233,7 +233,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 d0c06736586d8f85f2e7c64291f3f289c12a0caa 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 8/9] 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

View File

@ -1,27 +0,0 @@
From 1697d4f40be133c78cd09fb0af14af22e8c6219e Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Sun, 4 Oct 2009 17:46:16 +0200
Subject: [PATCH 9/9] change default load address for ramdisk
The default load address for the initial ramdisk is changed from
0x800000 to 0x2000000 to allow larger kernels to be loaded.
---
zipl/include/zipl.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/zipl/include/zipl.h b/zipl/include/zipl.h
index 1f70e48..d2d26dd 100644
--- a/zipl/include/zipl.h
+++ b/zipl/include/zipl.h
@@ -22,7 +22,7 @@
#define DEFAULT_PARMFILE_ADDRESS 0x1000LL
#define DEFAULT_STAGE3_ADDRESS 0xa000LL
#define DEFAULT_IMAGE_ADDRESS 0x10000LL
-#define DEFAULT_RAMDISK_ADDRESS 0x800000LL
+#define DEFAULT_RAMDISK_ADDRESS 0x2000000LL
#define PSW_ADDRESS_MASK 0x000000007fffffffLL
#define PSW_LOAD 0x0008000080000000LL
--
1.6.3.3

View File

@ -1,189 +0,0 @@
From 7cd1f2254e27cae8e061d1b42fa6c78bc10a5f39 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Thu, 8 Oct 2009 10:29:23 +0200
Subject: [PATCH] improve mon_statd init script
- stop: do not print error messages if a daemon is not configured
- start: do not load module if no daemon is configured
- remove useless newlines
---
etc/init.d/mon_statd | 113 ++++++++++++++++++++++++++++----------------------
1 files changed, 64 insertions(+), 49 deletions(-)
diff --git a/etc/init.d/mon_statd b/etc/init.d/mon_statd
index 4d84b5b..60bcf00 100755
--- a/etc/init.d/mon_statd
+++ b/etc/init.d/mon_statd
@@ -22,7 +22,6 @@ PROCD_PATH=/usr/sbin/$PROCD
CONFIG_FILE=/etc/sysconfig/$DAEMON
FSSTATD_PID_FILE=/var/run/$FSSTATD.pid
PROCD_PID_FILE=/var/run/$PROCD.pid
-RETVAL=0
# source function library
. /lib/lsb/init-functions
@@ -32,68 +31,81 @@ if [ -f $CONFIG_FILE ]; then
. $CONFIG_FILE
fi
-start()
+load_kernel_module()
{
if [ ! -e /dev/monwriter ]; then
echo "Loading monwriter module..."
modprobe monwriter 2>&1
- if [ "$?" -ne 0 ]; then
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+ udevsettle
+ if [ $? -ne 0 ]; then
exit 1
fi
- while [ ! -e /dev/monwriter ]; do
- sleep 0
- done
fi
+}
- if [ ! -f $FSSTATD_PID_FILE -a "$FSSTAT" = "yes" ]; then
- echo -n $"Starting $FSSTATD:"
- $FSSTATD_PATH -i $FSSTAT_INTERVAL
- if [ $? == 0 ]; then
+start_daemon()
+{
+ local daemon_name=$1
+ local daemon_interval=$2
+ local daemon_pid_file=$3
+ local daemon_path=$4
+
+ if [ ! -f $daemon_pid_file ]; then
+ load_kernel_module
+ echo -n "Starting $daemon_name:"
+ $daemon_path -i $daemon_interval
+ if [ $? -eq 0 ]; then
touch /var/lock/subsys/mon_statd
log_success_msg
else
log_failure_msg
fi
- elif [ "$FSSTAT" = "yes" ]; then
- echo "$FSSTATD (pid $(cat $FSSTATD_PID_FILE)) is already running..."
+ else
+ echo "$daemon_name (pid $(cat $daemon_pid_file)) is already running..."
+ fi
+}
+
+start()
+{
+ if [ "$FSSTAT" = "yes" ]; then
+ start_daemon $FSSTATD $FSSTAT_INTERVAL $FSSTATD_PID_FILE \
+ $FSSTATD_PATH
fi
- if [ ! -f $PROCD_PID_FILE -a "$PROC" = "yes" ]; then
- echo -n $"Starting $PROCD:"
- $PROCD_PATH -i $PROC_INTERVAL
- if [ $? == 0 ]; then
- touch /var/lock/subsys/mon_statd
- log_success_msg
- else
- log_failure_msg
- fi
- elif [ "$PROC" = "yes" ]; then
- echo "$PROCD (pid $(cat $PROCD_PID_FILE)) is already running..."
+ if [ "$PROC" = "yes" ]; then
+ start_daemon $PROCD $PROC_INTERVAL $PROCD_PID_FILE \
+ $PROCD_PATH
fi
- echo
}
-stop()
+stop_daemon()
{
- echo -n $"Stopping $FSSTATD:"
- if [ -f $FSSTATD_PID_FILE ]; then
- killproc $FSSTATD_PATH -TERM
+ local daemon_name=$1
+ local daemon_pid_file=$2
+ local daemon_path=$3
+
+ echo -n "Stopping $daemon_name:"
+ if [ -f $daemon_pid_file ]; then
+ killproc $daemon_path -TERM
log_success_msg
- rm -f $FSSTATD_PID_FILE
+ rm -f $daemon_pid_file
else
log_failure_msg
fi
+}
- echo -n $"Stopping $PROCD:"
- if [ -f $PROCD_PID_FILE ]; then
- killproc $PROCD_PATH -TERM
- log_success_msg
- rm -f $PROCD_PID_FILE
- else
- log_failure_msg
+stop()
+{
+ if [ "$FSSTAT" = "yes" ]; then
+ stop_daemon $FSSTATD $FSSTATD_PID_FILE $FSSTATD_PATH
+ fi
+ if [ "$PROC" = "yes" ]; then
+ stop_daemon $PROCD $PROCD_PID_FILE $PROCD_PATH
fi
rm -f /var/lock/subsys/mon_statd
- echo
}
restart() {
@@ -101,20 +113,23 @@ restart() {
start
}
-status()
+status_daemon()
{
- if [ ! -f $FSSTATD_PID_FILE ]; then
- echo "$FSSTATD is not running."
- else
- echo "$FSSTATD (pid $(cat $FSSTATD_PID_FILE), interval: $FSSTAT_INTERVAL) is running."
- fi
+ local daemon_name=$1
+ local daemon_pid_file=$2
+ local daemon_interval=$3
- if [ ! -f $PROCD_PID_FILE ]; then
- echo "$PROCD is not running."
+ if [ ! -f $daemon_pid_file ]; then
+ echo "$daemon_name is not running."
else
- echo "$PROCD (pid $(cat $PROCD_PID_FILE), interval: $PROC_INTERVAL) is running."
+ echo "$daemon_name (pid $(cat $daemon_pid_file), interval: $daemon_interval) is running."
fi
- echo
+}
+
+status()
+{
+ status_daemon $FSSTATD $FSSTATD_PID_FILE $FSSTAT_INTERVAL
+ status_daemon $PROCD $PROCD_PID_FILE $PROC_INTERVAL
}
# How are we called?
@@ -133,7 +148,7 @@ case "$1" in
;;
*)
echo "Usage: $DAEMON {start|stop|status|restart|reload}"
- RETVAL=1
+ exit 1
esac
-exit $RETVAL
+exit 0
--
1.6.3.3

View File

@ -1,38 +0,0 @@
From 5707bfdf0aac985e8e82c9a5004eb458d1d79801 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 30 Oct 2009 11:23:08 +0100
Subject: [PATCH] update readahead value for better performance
Description: dasd,zfcp: Add udev rule to set increased "default max readahead"
Symptom: Sequential read performance on disks is not as good as it could be.
Problem: The current "default max readahead" defined by the kernel is too
small for s390 (128 kb).
Solution: Add udev rule to set a better default value (512 kb). This will
increase sequential read performance up to 40%.
---
etc/udev/rules.d/60-readahead.rules | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
create mode 100644 etc/udev/rules.d/60-readahead.rules
diff --git a/etc/udev/rules.d/60-readahead.rules b/etc/udev/rules.d/60-readahead.rules
new file mode 100644
index 0000000..3133c66
--- /dev/null
+++ b/etc/udev/rules.d/60-readahead.rules
@@ -0,0 +1,13 @@
+#
+# Rules to set an increased default max readahead size for s390 disk devices
+# This file should be installed in /etc/udev/rules.d
+#
+
+SUBSYSTEM!="block", GOTO="ra_end"
+
+ACTION!="add", GOTO="ra_end"
+# on device add set initial readahead to 512 (instead of in kernel 128)
+KERNEL=="sd*[!0-9]", ATTR{queue/read_ahead_kb}="512"
+KERNEL=="dasd*[!0-9]", ATTR{queue/read_ahead_kb}="512"
+
+LABEL="ra_end"
--
1.6.3.3

View File

@ -1,33 +0,0 @@
From e9c5f5e15122b143f5f202e9782773321f8cf6b9 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 13 Nov 2009 10:46:57 +0100
Subject: [PATCH 12/14] fix multipath device detection in ziomon
Description: ziomon: Fix multipath device detection
Symptom: Running ziomon with a valid multipath device like
/dev/mapper/36005076303ffc56200000000000010cc
fails with "ziomon: The following devices do not seem
to exist:".
Problem: The output from multipath -l is not appended correctly to
the mp_arr array.
Solution: Properly initializing mp_arr to an empty array fixes this.
---
ziomon/ziomon | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/ziomon/ziomon b/ziomon/ziomon
index 7449843..924c1dd 100755
--- a/ziomon/ziomon
+++ b/ziomon/ziomon
@@ -471,7 +471,7 @@ function clean_devices() {
function check_for_multipath_devices() {
local i;
local j;
- local mp_arr;
+ local mp_arr=();
local line;
local devices_basenames;
local tmp;
--
1.6.3.3

View File

@ -1,119 +0,0 @@
From 4770ba2827a5c582c6376139f1ec2d10519779e2 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 13 Nov 2009 10:48:17 +0100
Subject: [PATCH 13/14] zipl - handle status during ipl
Description: zipl: handle status during ipl
Symptom: You encounter an error during IPL with "disabled wait" message.
Problem: During the IPL sequence the subchannel of the IPL device has
to be enabled. If there is a status pending or busy condition
on the subchannel the IPL code abborts the IPL and goes into
disabled wait.
Solution: To resolve the problem the IPL code accepts the status pending
or busy condition on the subchannel and does up to 256 retries.
---
zipl/boot/common.S | 65 ++++++++++++++++++++++++++++++++++-----------------
1 files changed, 43 insertions(+), 22 deletions(-)
diff --git a/zipl/boot/common.S b/zipl/boot/common.S
index 620fed9..fa45e5a 100644
--- a/zipl/boot/common.S
+++ b/zipl/boot/common.S
@@ -6,6 +6,7 @@
#
# some definitions from kernel land
+__LC_IRB = 0x0300
__LC_IPLDEV = 0xC6C
__LC_PANIC_MAGIC= 0xE00
@@ -186,23 +187,33 @@ _load_blocklist:
_enable_device:
stm %r6,%r15,24(%r15)
basr %r13,0 # base register
-0: s %r15,1f-0b(%r13)
+0: s %r15,4f-0b(%r13)
lr %r1,%r2
- l %r2,4f-0b(%r13) # set panik code early
- stsch 2f-0b(%r13)
- oi 2f-0b+5(%r13),0x84 # enable ssch and multipath mode
- msch 2f-0b(%r13)
- bnz _panik-0b(%r13) # subchannel busy or in error ?
- lctl %c6,%c6,3f-0b(%r13) # enable all interrupt classes
+ l %r2,7f-0b(%r13) # set panik code early
+ stsch 5f-0b(%r13)
+ brc 1,3f # panic if not operational
+ oi 5f-0b+5(%r13),0x80 # enable subchannel
+ lhi %r6,256 # r6 retry counter
+1: # modify subchannel
+ msch 5f-0b(%r13)
+ brc 6,2f # status pending or busy
+ brc 1,3f # panic if not operational
+ lctl %c6,%c6,6f-0b(%r13) # enable all interrupt classes
sr %r2,%r2
- ic %r2,10+2f-0b(%r13) # return lpum in r2
+ ic %r2,10+5f-0b(%r13) # return lpum in r2
lm %r6,%r15,120(%r15)
br %r14
-1: .long 96
+2: # clear status and retry
+ tsch __LC_IRB
+ brc 1,3f # panic if not operational
+ brct %r6,1b # retry
+3: # panic
+ b _panik-0b(%r13) # panic
+4: .long 96
.align 8
-2: .fill 64,1,0
-3: .long 0xff000000 # CR6 initial value
-4: .long EENABLE_DEV
+5: .fill 64,1,0
+6: .long 0xff000000 # CR6 initial value
+7: .long EENABLE_DEV
#
# Disable I/O on the ipl device.
@@ -211,20 +222,30 @@ _enable_device:
_disable_device:
stm %r6,%r15,24(%r15)
basr %r13,0 # base register
-0: s %r15,1f-0b(%r13)
+0: s %r15,4f-0b(%r13)
lr %r1,%r2
- l %r2,3f-0b(%r13) # set panik code early
- lctl %c6,%c6,2f-0b(%r13) # disable all interrupt classes
- stsch 2f-0b(%r13)
- ni 2f-0b+5(%r13),0x7B # disable ssch and multipath mode
- msch 2f-0b(%r13)
- bnz _panik-0b(%r13) # subchannel busy or in error ?
+ l %r2,6f-0b(%r13) # set panik code early
+ lctl %c6,%c6,5f-0b(%r13) # disable all interrupt classes
+ stsch 5f-0b(%r13)
+ brc 1,3f # panic if not operational
+ ni 5f-0b+5(%r13),0x7F # disable subchannel
+ lhi %r6,256 # r6 retry counter
+1: # modify subchannel
+ msch 5f-0b(%r13)
+ brc 6,2f # status pending or busy
+ brc 1,3f # panic if not operational
lm %r6,%r15,120(%r15)
br %r14
-1: .long 96
+2: # clear status and retry
+ tsch __LC_IRB
+ brc 1,3f # panic if not operational
+ brct %r6,1b
+3: # panic
+ b _panik-0b(%r13) # panic
+4: .long 96
.align 8
-2: .long 0x00000000 # CR6 (all interrupts classes disabled)
-3: .long EDISABLE_DEV
+5: .long 0x00000000 # CR6 (all interrupts classes disabled)
+6: .long EDISABLE_DEV
.endm
.macro io_subroutines
--
1.6.3.3

View File

@ -1,285 +0,0 @@
From 72168f2269dac94d25112e0ad548bd3fcdf907d9 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 13 Nov 2009 10:49:37 +0100
Subject: [PATCH 14/14] dasdview, fdasd: fix floating point error for unformatted devices
When executed on an unformatted device the tools dasdview and fdasd
will end with an floating point exception error.
The reason for the error lies in the fact that we cannot rely on the
HDIO_GETGEO ioctl to report a correct number of cylinders and so we
compute the number of cylinders from the device size. However,
for unformatted devices the device size is zero and thus our
computation ends with a floating point exception.
To solve this issue read the correct number of cylinders from
the DASD device characteristics, which can be found in the data
returned by the BIODASDINFO ioctl.
---
dasdview/dasdview.c | 22 +++++++-------
dasdview/dasdview.h | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++
fdasd/fdasd.c | 18 ++++++------
fdasd/fdasd.h | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 168 insertions(+), 20 deletions(-)
diff --git a/dasdview/dasdview.c b/dasdview/dasdview.c
index a74ae33..2909b16 100644
--- a/dasdview/dasdview.c
+++ b/dasdview/dasdview.c
@@ -169,7 +169,7 @@ static void
dasdview_get_info(dasdview_info_t *info)
{
int fd;
- u_int64_t device_size;
+ struct dasd_eckd_characteristics *characteristics;
fd = open(info->device, O_RDONLY);
if (fd == -1)
@@ -201,16 +201,6 @@ dasdview_get_info(dasdview_info_t *info)
exit(-1);
}
- if (ioctl(fd, BLKGETSIZE64, &device_size) != 0) {
- close(fd);
- zt_error_print("dasdview: ioctl error\n" \
- "Could not retrieve device size information.\n");
- exit(-1);
- }
-
- info->hw_cylinders = ((device_size / info->blksize)
- / info->geo.sectors) / info->geo.heads;
-
/* get disk information */
if (ioctl(fd, BIODASDINFO2, &info->dasd_info) == 0) {
info->dasd_info_version = 2;
@@ -223,6 +213,16 @@ dasdview_get_info(dasdview_info_t *info)
exit(-1);
}
}
+
+ characteristics = (struct dasd_eckd_characteristics *)
+ &info->dasd_info.characteristics;
+ if (characteristics->no_cyl == LV_COMPAT_CYL &&
+ characteristics->long_no_cyl)
+ info->hw_cylinders = characteristics->long_no_cyl;
+ else
+ info->hw_cylinders = characteristics->no_cyl;
+
+
close(fd);
}
diff --git a/dasdview/dasdview.h b/dasdview/dasdview.h
index 39e1228..5388592 100644
--- a/dasdview/dasdview.h
+++ b/dasdview/dasdview.h
@@ -72,6 +72,80 @@ typedef struct dasd_information2_t {
unsigned int reserved7; /* reserved for further use ,... */
} dasd_information2_t;
+struct dasd_eckd_characteristics {
+ unsigned short cu_type;
+ struct {
+ unsigned char support:2;
+ unsigned char async:1;
+ unsigned char reserved:1;
+ unsigned char cache_info:1;
+ unsigned char model:3;
+ } __attribute__ ((packed)) cu_model;
+ unsigned short dev_type;
+ unsigned char dev_model;
+ struct {
+ unsigned char mult_burst:1;
+ unsigned char RT_in_LR:1;
+ unsigned char reserved1:1;
+ unsigned char RD_IN_LR:1;
+ unsigned char reserved2:4;
+ unsigned char reserved3:8;
+ unsigned char defect_wr:1;
+ unsigned char XRC_supported:1;
+ unsigned char reserved4:1;
+ unsigned char striping:1;
+ unsigned char reserved5:4;
+ unsigned char cfw:1;
+ unsigned char reserved6:2;
+ unsigned char cache:1;
+ unsigned char dual_copy:1;
+ unsigned char dfw:1;
+ unsigned char reset_alleg:1;
+ unsigned char sense_down:1;
+ } __attribute__ ((packed)) facilities;
+ unsigned char dev_class;
+ unsigned char unit_type;
+ unsigned short no_cyl;
+ unsigned short trk_per_cyl;
+ unsigned char sec_per_trk;
+ unsigned char byte_per_track[3];
+ unsigned short home_bytes;
+ unsigned char formula;
+ union {
+ struct {
+ unsigned char f1;
+ unsigned short f2;
+ unsigned short f3;
+ } __attribute__ ((packed)) f_0x01;
+ struct {
+ unsigned char f1;
+ unsigned char f2;
+ unsigned char f3;
+ unsigned char f4;
+ unsigned char f5;
+ } __attribute__ ((packed)) f_0x02;
+ } __attribute__ ((packed)) factors;
+ unsigned short first_alt_trk;
+ unsigned short no_alt_trk;
+ unsigned short first_dia_trk;
+ unsigned short no_dia_trk;
+ unsigned short first_sup_trk;
+ unsigned short no_sup_trk;
+ unsigned char MDR_ID;
+ unsigned char OBR_ID;
+ unsigned char director;
+ unsigned char rd_trk_set;
+ unsigned short max_rec_zero;
+ unsigned char reserved1;
+ unsigned char RWANY_in_LR;
+ unsigned char factor6;
+ unsigned char factor7;
+ unsigned char factor8;
+ unsigned char reserved2[3];
+ unsigned char reserved3[6];
+ unsigned int long_no_cyl;
+} __attribute__ ((packed));
+
/*
* values to be used for dasd_information2_t.format
* 0x00: NOT formatted
diff --git a/fdasd/fdasd.c b/fdasd/fdasd.c
index a526d7f..8f7f5aa 100644
--- a/fdasd/fdasd.c
+++ b/fdasd/fdasd.c
@@ -2002,7 +2002,7 @@ fdasd_get_geometry (fdasd_anchor_t *anc)
int fd, blksize = 0;
dasd_information_t dasd_info;
char err_str[ERROR_STRING_SIZE];
- u_int64_t device_size;
+ struct dasd_eckd_characteristics *characteristics;
if ((fd = open(options.device,O_RDONLY)) < 0) {
snprintf(err_str, ERROR_STRING_SIZE,
@@ -2023,14 +2023,6 @@ fdasd_get_geometry (fdasd_anchor_t *anc)
"Could not retrieve blocksize information.");
}
- if (ioctl(fd, BLKGETSIZE64, &device_size) != 0) {
- close(fd);
- fdasd_error(anc, unable_to_ioctl,
- "Could not retrieve device size information.");
- }
-
- anc->hw_cylinders = ((device_size / blksize) / geo.sectors) / geo.heads;
-
/* get disk type */
if (ioctl(fd, BIODASDINFO, &dasd_info) != 0) {
close(fd);
@@ -2038,6 +2030,14 @@ fdasd_get_geometry (fdasd_anchor_t *anc)
"Could not retrieve disk information.");
}
+ characteristics =
+ (struct dasd_eckd_characteristics *) &dasd_info.characteristics;
+ if (characteristics->no_cyl == LV_COMPAT_CYL &&
+ characteristics->long_no_cyl)
+ anc->hw_cylinders = characteristics->long_no_cyl;
+ else
+ anc->hw_cylinders = characteristics->no_cyl;
+
close(fd);
if (strncmp(dasd_info.type, "ECKD", 4) != 0) {
diff --git a/fdasd/fdasd.h b/fdasd/fdasd.h
index 107e486..8a1bfd0 100644
--- a/fdasd/fdasd.h
+++ b/fdasd/fdasd.h
@@ -43,6 +43,80 @@ typedef struct dasd_information_t {
char configuration_data[256]; /* from read_configuration_data */
} dasd_information_t;
+struct dasd_eckd_characteristics {
+ unsigned short cu_type;
+ struct {
+ unsigned char support:2;
+ unsigned char async:1;
+ unsigned char reserved:1;
+ unsigned char cache_info:1;
+ unsigned char model:3;
+ } __attribute__ ((packed)) cu_model;
+ unsigned short dev_type;
+ unsigned char dev_model;
+ struct {
+ unsigned char mult_burst:1;
+ unsigned char RT_in_LR:1;
+ unsigned char reserved1:1;
+ unsigned char RD_IN_LR:1;
+ unsigned char reserved2:4;
+ unsigned char reserved3:8;
+ unsigned char defect_wr:1;
+ unsigned char XRC_supported:1;
+ unsigned char reserved4:1;
+ unsigned char striping:1;
+ unsigned char reserved5:4;
+ unsigned char cfw:1;
+ unsigned char reserved6:2;
+ unsigned char cache:1;
+ unsigned char dual_copy:1;
+ unsigned char dfw:1;
+ unsigned char reset_alleg:1;
+ unsigned char sense_down:1;
+ } __attribute__ ((packed)) facilities;
+ unsigned char dev_class;
+ unsigned char unit_type;
+ unsigned short no_cyl;
+ unsigned short trk_per_cyl;
+ unsigned char sec_per_trk;
+ unsigned char byte_per_track[3];
+ unsigned short home_bytes;
+ unsigned char formula;
+ union {
+ struct {
+ unsigned char f1;
+ unsigned short f2;
+ unsigned short f3;
+ } __attribute__ ((packed)) f_0x01;
+ struct {
+ unsigned char f1;
+ unsigned char f2;
+ unsigned char f3;
+ unsigned char f4;
+ unsigned char f5;
+ } __attribute__ ((packed)) f_0x02;
+ } __attribute__ ((packed)) factors;
+ unsigned short first_alt_trk;
+ unsigned short no_alt_trk;
+ unsigned short first_dia_trk;
+ unsigned short no_dia_trk;
+ unsigned short first_sup_trk;
+ unsigned short no_sup_trk;
+ unsigned char MDR_ID;
+ unsigned char OBR_ID;
+ unsigned char director;
+ unsigned char rd_trk_set;
+ unsigned short max_rec_zero;
+ unsigned char reserved1;
+ unsigned char RWANY_in_LR;
+ unsigned char factor6;
+ unsigned char factor7;
+ unsigned char factor8;
+ unsigned char reserved2[3];
+ unsigned char reserved3[6];
+ unsigned int long_no_cyl;
+} __attribute__ ((packed));
+
/* Get information on a dasd device (enhanced) */
#define BIODASDINFO _IOR(DASD_IOCTL_LETTER,1,dasd_information_t)
--
1.6.3.3

File diff suppressed because it is too large Load Diff

View File

@ -1,376 +0,0 @@
From 62fb535a68f1df693869e4361150259b42c6f211 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Thu, 10 Dec 2009 18:30:52 +0100
Subject: [PATCH 16/16] s390tools-1.8.2-lsreipl-nss
---
ipl_tools/ccw.c | 42 ++++++++++++++++---------------------
ipl_tools/chreipl.h | 9 +++++--
ipl_tools/fcp.c | 13 ++++++-----
ipl_tools/ipl.c | 57 +++++++++++++++++++++++++++++++-------------------
ipl_tools/main.c | 25 +++++++++++++++++-----
ipl_tools/system.c | 3 +-
6 files changed, 87 insertions(+), 62 deletions(-)
diff --git a/ipl_tools/ccw.c b/ipl_tools/ccw.c
index 7959831..eef4550 100644
--- a/ipl_tools/ccw.c
+++ b/ipl_tools/ccw.c
@@ -52,22 +52,19 @@ int isccwdev(const char *devno)
}
-int get_ccw_devno_old_sysfs(char *device, char *devno)
+int get_ccw_devno_old_sysfs(char *device)
{
FILE *filp;
- int len, errorpath, rc;
+ int errorpath;
char path1[4096];
char buf[4096];
- char *match, *s1, *s2;
+ char *match = NULL, *s1, *s2;
errorpath = 1;
- rc = 0;
sprintf(path1, "/sys/block/%s/uevent", device);
filp = fopen(path1, "r");
- if (!filp) {
- rc = -1;
- return rc;
- }
+ if (!filp)
+ return -1;
/*
* the uevent file contains an entry like this:
* PHYSDEVPATH=/devices/css0/0.0.206a/0.0.7e78
@@ -77,16 +74,16 @@ int get_ccw_devno_old_sysfs(char *device, char *devno)
if (match != NULL)
break;
}
+ fclose(filp);
+ if (!match)
+ return -1;
s1 = strchr(buf, '/');
s2 = strrchr(buf, '/');
- len = s2-s1;
- strncpy(devno, s2 + 1, sizeof(devno));
- devno[len] = '\0';
- fclose(filp);
+ strncpy(devno, s2 + 1, sizeof(devno) - 1);
return 0;
}
-int get_ccw_devno_new_sysfs(char *device, char *devno)
+int get_ccw_devno_new_sysfs(char *device)
{
int len, errorpath, rc;
char path2[4096];
@@ -119,8 +116,7 @@ int get_ccw_devno_new_sysfs(char *device, char *devno)
return rc;
}
}
- strncpy(devno, s2 + 1, sizeof(devno));
- devno[len] = '\0';
+ strncpy(devno, s2 + 1, sizeof(devno) - 1);
return 0;
}
@@ -134,16 +130,14 @@ int get_ccw_devno_new_sysfs(char *device, char *devno)
*
* This does not work when booting from tape
*/
-int get_ccw_devno(char *device, char *devno)
+int get_ccw_devno(char *device)
{
- if (get_ccw_devno_old_sysfs(device, devno) != 0) {
- if (get_ccw_devno_new_sysfs(device, devno) != 0) {
- fprintf(stderr, "%s: Failed to lookup the device number\n",
- name);
- return -1;
- }
- }
- return 0;
+ if (get_ccw_devno_old_sysfs(device) == 0)
+ return 0;
+ if (get_ccw_devno_new_sysfs(device) == 0)
+ return 0;
+ fprintf(stderr, "%s: Failed to lookup the device number\n", name);
+ return -1;
}
int get_ccw_dev(char *partition, char *device)
diff --git a/ipl_tools/chreipl.h b/ipl_tools/chreipl.h
index 19a83eb..37807a7 100644
--- a/ipl_tools/chreipl.h
+++ b/ipl_tools/chreipl.h
@@ -34,6 +34,9 @@ extern char saction[8];
extern char name[256];
extern int action;
+#define IPL_TYPE_LEN_MAX 100
+#define NSS_NAME_LEN_MAX 8
+
#define ACT_CCW 1
#define ACT_FCP 2
#define ACT_NODE 3
@@ -63,10 +66,10 @@ int is_valid_case(char *c);
int is_valid_action(char *action);
void parse_shutdown_options(int argc, char **argv);
void strlow(char *s);
-int get_ccw_devno(char *device, char *devno);
-int get_reipl_type(void);
+int get_ccw_devno(char *device);
+int get_reipl_type(char *reipltype);
void parse_lsreipl_options(int argc, char **argv);
-int get_ipl_type();
+int get_ipl_type(char *reipltype);
int get_ipl_loadparam(void);
void print_ipl_settings(void);
int get_sa(char *action, char *file);
diff --git a/ipl_tools/fcp.c b/ipl_tools/fcp.c
index 86fa95b..7a8b4c5 100644
--- a/ipl_tools/fcp.c
+++ b/ipl_tools/fcp.c
@@ -33,12 +33,11 @@
/*
* return the current reipl type from /sys/firmware/reipl/reipl_type
- * 0 = fcp, 1 = ccw, -1, error
+ * 0 = fcp, 1 = ccw, 2 = nss, -1 = unknown
*/
-int get_reipl_type(void)
+int get_reipl_type(char *reipltype)
{
FILE *filp;
- char reipltype[4];
char path[4096];
int rc;
@@ -49,7 +48,7 @@ int get_reipl_type(void)
fprintf(stderr, "%s: Can not open /sys/firmware/"
"reipl/reipl_type: ", name);
fprintf(stderr, "%s\n", strerror(errno));
- return -1;
+ exit(1);
}
rc = fscanf(filp, "%s", reipltype);
fclose(filp);
@@ -57,17 +56,19 @@ int get_reipl_type(void)
fprintf(stderr, "%s: Failed to read "
"/sys/firmware/reipl/reipl_type:", name);
fprintf(stderr, "%s\n", strerror(errno));
- return -1;
+ exit(1);
}
if (strncmp(reipltype, "fcp", strlen("fcp")) == 0)
return T_FCP;
else if (strncmp(reipltype, "ccw", strlen("ccw")) == 0)
return T_CCW;
- /* TODO: add NSS support */
+ else if (strncmp(reipltype, "nss", strlen("nss")) == 0)
+ return T_NSS;
} else {
fprintf(stderr, "%s: Can not open /sys/firmware/reipl/"
"reipl_type:", name);
fprintf(stderr, " %s\n", strerror(errno));
+ exit(1);
}
return -1;
}
diff --git a/ipl_tools/ipl.c b/ipl_tools/ipl.c
index 2bf817a..8cca700 100644
--- a/ipl_tools/ipl.c
+++ b/ipl_tools/ipl.c
@@ -33,12 +33,11 @@
/*
* return the ipl type based on /sys/firmware/ipl/ipl_type
- * returns 0 in case of fcp and 1 in case of ccw, -1 otherwise
+ * returns 0 in case of fcp and 1 in case of ccw, 2 for nss and -1 otherwise
*/
-int get_ipl_type()
+int get_ipl_type(char *reipltype)
{
FILE *filp;
- char reipltype[4];
char path[4096];
int rc;
@@ -49,7 +48,7 @@ int get_ipl_type()
fprintf(stderr, "%s: Can not open /sys/firmware/ipl/"
"ipl_type: ", name);
fprintf(stderr, "%s\n", strerror(errno));
- return -1;
+ exit(1);
}
rc = fscanf(filp, "%s", reipltype);
fclose(filp);
@@ -57,12 +56,14 @@ int get_ipl_type()
fprintf(stderr, "%s: Failed to read "
"/sys/firmware/ipl/ipl_type: ", name);
fprintf(stderr, "%s\n", strerror(errno));
- return -1;
+ exit(1);
}
if (strncmp(reipltype, "fcp", strlen("fcp")) == 0)
return T_FCP;
else if (strncmp(reipltype, "ccw", strlen("ccw")) == 0)
return T_CCW;
+ else if (strncmp(reipltype, "nss", strlen("nss")) == 0)
+ return T_NSS;
} else {
fprintf(stderr, "%s: Can not open /sys/firmware/ipl/"
"ipl_type:", name);
@@ -111,30 +112,38 @@ int get_ipl_loadparam(void)
void print_ipl_settings(void)
{
int rc, type;
- char bootprog[1024], lba[1024];
+ char bootprog[1024], lba[1024], nss_name[NSS_NAME_LEN_MAX + 1];
+ char reipltype[IPL_TYPE_LEN_MAX + 1];
- type = get_ipl_type();
- /*
- * TODO: add nss support
- */
- if (type == 1)
+ type = get_ipl_type(reipltype);
+ switch (type) {
+ case T_NSS:
+ printf("IPL type: nss\n");
+ rc = strrd(nss_name, "/sys/firmware/ipl/name");
+ if (rc != 0)
+ exit(1);
+ printf("Name: %s\n", nss_name);
+ break;
+ case T_CCW:
printf("IPL type: ccw\n");
- if (type == 0)
- printf("IPL type: fcp\n");
- rc = strrd(devno, "/sys/firmware/ipl/device");
- if (rc != 0)
- exit(1) /* the error msg comes from get_ipl_device */;
- if (strlen(devno) > 0)
- printf("Device: %s\n", devno);
- if (type == 1) {
+ rc = strrd(devno, "/sys/firmware/ipl/device");
+ if (rc != 0)
+ exit(1);
+ if (strlen(devno) > 0)
+ printf("Device: %s\n", devno);
rc = get_ipl_loadparam();
if (rc != -1)
printf("Loadparm: %d\n", rc);
else
printf("Loadparm: \n");
- }
- if (type == 0) {
- /* these settings are only available for fcp */
+ break;
+ case T_FCP:
+ printf("IPL type: fcp\n");
+ rc = strrd(devno, "/sys/firmware/ipl/device");
+ if (rc != 0)
+ exit(1);
+ if (strlen(devno) > 0)
+ printf("Device: %s\n", devno);
rc = strrd(wwpn, "/sys/firmware/reipl/fcp/wwpn");
if (rc != -1 && strlen(wwpn) > 0)
printf("WWPN: %s\n", wwpn);
@@ -147,6 +156,10 @@ void print_ipl_settings(void)
rc = strrd(lba, "/sys/firmware/ipl/br_lba");
if (rc != -1 && strlen(lba) > 0)
printf("br_lba: %s\n", lba);
+ break;
+ default:
+ printf("IPL type: %s (unknown)\n", reipltype);
+ break;
}
exit(0);
}
diff --git a/ipl_tools/main.c b/ipl_tools/main.c
index 2eaa043..bcebabe 100644
--- a/ipl_tools/main.c
+++ b/ipl_tools/main.c
@@ -57,13 +57,22 @@ int action; /* either CCW, FCP or NODE */
int lsreipl(int argc, char *argv[])
{
int rc;
- char bootprog[1024], lba[1024], val[9];
+ char bootprog[1024], lba[1024], val[9], reipltype[IPL_TYPE_LEN_MAX + 1];
+ char nss_name[NSS_NAME_LEN_MAX + 1];
/* parse the command line options in getop.c */
parse_lsreipl_options(argc, argv);
- rc = get_reipl_type();
- if (rc == 0) {
+ rc = get_reipl_type(reipltype);
+ switch (rc) {
+ case T_NSS:
+ printf("Re-IPL type: nss\n");
+ rc = strrd(nss_name, "/sys/firmware/reipl/nss/name");
+ if (rc != 0)
+ exit(1);
+ printf("Name: %s\n", nss_name);
+ break;
+ case T_FCP:
printf("Re-IPL type: fcp\n");
rc = strrd(wwpn, "/sys/firmware/reipl/fcp/wwpn");
if (rc != 0)
@@ -90,8 +99,8 @@ int lsreipl(int argc, char *argv[])
printf("bootprog: %s\n", bootprog);
if (strlen(lba) > 0)
printf("br_lba: %s\n", lba);
- }
- if (rc == 1) {
+ break;
+ case T_CCW:
printf("Re-IPL type: ccw\n");
rc = strrd(devno, "/sys/firmware/reipl/ccw/device");
if (rc != 0)
@@ -106,6 +115,10 @@ int lsreipl(int argc, char *argv[])
printf("Loadparm: %s\n", val);
else
printf("Loadparm: \n");
+ break;
+ default:
+ printf("Re-IPL type: %s (unknown)\n", reipltype);
+ break;
}
return 0;
}
@@ -134,7 +147,7 @@ int reipl(int argc, char *argv[])
"partition: %s\n", name, partition);
exit(1);
}
- rc = get_ccw_devno(device, devno);
+ rc = get_ccw_devno(device);
if (rc != 0) {
fprintf(stderr, "%s: Unable to lookup device"
" number for device %s\n", name,
diff --git a/ipl_tools/system.c b/ipl_tools/system.c
index fd5b76b..ca6c5af 100644
--- a/ipl_tools/system.c
+++ b/ipl_tools/system.c
@@ -174,7 +174,7 @@ int strrd(char *string, char *file)
fprintf(stderr, "%s\n", strerror(errno));
exit(1);
}
- rc = fread(string, 4096, 1, filp);
+ rc = fread(string, 1, 4096, filp);
fclose(filp);
/*
* special handling is required for
@@ -193,6 +193,7 @@ int strrd(char *string, char *file)
fprintf(stderr, "%s\n", strerror(errno));
return -1;
} else {
+ string[rc] = 0;
if (string[strlen(string) - 1] == '\n')
string[strlen(string) - 1] = 0;
return 0;
--
1.6.3.3

File diff suppressed because it is too large Load Diff

View File

@ -1,38 +0,0 @@
From a8bcc744ec941c3b34c22c7a7729b52a390c7a08 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Wed, 13 Jan 2010 08:39:09 +0100
Subject: [PATCH] fix uppercase conversion in lscss
Description: lscss: fix uppercase conversion
Symptom: when invoking the -u option, lscss will fail with the message "tr: missing operand"
Problem: the bash option "nullglob" interferes with the tr operands
Solution: avoid expanding of those operands by placing quotes around them
---
zconf/lscss | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/zconf/lscss b/zconf/lscss
index efdb9ca..fc40fe6 100755
--- a/zconf/lscss
+++ b/zconf/lscss
@@ -354,7 +354,7 @@ if [ $SCH_IO ] ;then
echo "----------------------------------------------------------------------"
fi
print_io | if [ $UPPERCASE ] ;then
- tr [:lower:] [:upper:]
+ tr "[:lower:]" "[:upper:]"
else
cat -
fi
@@ -368,7 +368,7 @@ if [ $SCH_CHSC ] ;then
echo "Device Subchan."
echo "-----------------"
print_chsc | if [ $UPPERCASE ] ;then
- tr [:lower:] [:upper:]
+ tr "[:lower:]" "[:upper:]"
else
cat -
fi
--
1.6.5.2

View File

@ -1,53 +0,0 @@
From a8ffd7242da2adcc4ab5b0f23193cfe764dc376d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Wed, 20 Jan 2010 08:42:52 +0100
Subject: [PATCH 19/22] ziorep: fix return codes
Description: ziomon: ziorep tools return 1 when using options -h and -v
Symptom: Using ziorep_traffic/utilization with these options give an
error.
Problem: 1 as been introduced as rc for parse_parms besides error codes,
but is not distinguished from them when parse_params is called.
Solution: After calling parse_parms check for rc 1 and substitute through 0.
---
ziomon/ziorep_traffic.cpp | 5 ++++-
ziomon/ziorep_utilization.cpp | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/ziomon/ziorep_traffic.cpp b/ziomon/ziorep_traffic.cpp
index 1461e55..20ee32f 100644
--- a/ziomon/ziorep_traffic.cpp
+++ b/ziomon/ziorep_traffic.cpp
@@ -529,8 +529,11 @@ int main(int argc, char **argv)
verbose = 0;
init_opts(&opts);
- if ( (rc = parse_params(argc, argv, &opts)) )
+ if ( (rc = parse_params(argc, argv, &opts)) ) {
+ if (rc == 1)
+ rc = 0;
goto out;
+ }
if ( (rc = check_opts(&opts, &cfg)) )
goto out;
diff --git a/ziomon/ziorep_utilization.cpp b/ziomon/ziorep_utilization.cpp
index 3f57a47..ac4576f 100644
--- a/ziomon/ziorep_utilization.cpp
+++ b/ziomon/ziorep_utilization.cpp
@@ -352,8 +352,11 @@ int main(int argc, char **argv)
verbose = 0;
init_opts(&opts);
- if ( (rc = parse_params(argc, argv, &opts)) )
+ if ( (rc = parse_params(argc, argv, &opts)) ) {
+ if (rc == 1)
+ rc = 0;
goto out;
+ }
if ( (rc = check_opts(&opts, &cfg)) )
goto out;
--
1.6.5.2

View File

@ -1,31 +0,0 @@
From 72ec5b5bd9a7fd23e2d1aaed455df8f2bda952ca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Wed, 20 Jan 2010 08:44:43 +0100
Subject: [PATCH 20/22] lstape: fix return code
Description: lstape: help function returns 1, although it was successful
Symptom: Issuing "lstape -h" or "lstape --help" and then looking for the
error code on the console through e.g. "echo $?" shows 1. Which
looks like an error.
Problem: exit 1, where we chould have exit 0.
Solution: Return 0 after calling the help function with exit 0.
---
zconf/lstape | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/zconf/lstape b/zconf/lstape
index efacfc9..5671315 100755
--- a/zconf/lstape
+++ b/zconf/lstape
@@ -90,7 +90,7 @@ while [ $# -ne 0 ]; do
case $1 in
-h|--help)
PrintUsage
- exit 1
+ exit 0
;;
-t|--type)
if [ $# -lt 2 ]; then
--
1.6.5.2

View File

@ -1,32 +0,0 @@
From d3c4eb2ced3a8e3c8f7a528f88721324028534e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Wed, 20 Jan 2010 08:46:14 +0100
Subject: [PATCH 21/22] cpuplugd: fix reading the size of /proc/sys/vm/cmm_pages
Description: cpuplugd: fix fscanf file handling in get_cmmpages_size
Symptom: cpuplugd was not able to correctly read the size of the
/proc/sys/vm/cmm_pages file. This prevented cpuplugd from using
the cmm feature correctly.
Problem: The code checked for the wrong return code (!= 0 instead of ==0)
Solution: Check for the right return code in the get_cmmpages_size error
handling function.
---
cpuplugd/mem.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cpuplugd/mem.c b/cpuplugd/mem.c
index a8f2a8e..8d5f05f 100644
--- a/cpuplugd/mem.c
+++ b/cpuplugd/mem.c
@@ -230,7 +230,7 @@ int get_cmmpages_size()
return -1;
}
rc = fscanf(filp, "%d", &size);
- if (rc != 0) {
+ if (rc == 0) {
fprintf(stderr, "Can not read /proc/sys/vm/cmm_pages: %s\n",
strerror(errno));
if (foreground == 0)
--
1.6.5.2

View File

@ -1,74 +0,0 @@
From c986172e782ae2afa41209e7c238315175d589e1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Wed, 20 Jan 2010 08:48:52 +0100
Subject: [PATCH 22/22] lsqeth: support new attributes
Description: lsqeth: add recent qeth attributes
Symptom: no information about "isolation" and "sniffer" values
Problem: new sysfs attributes "isolation" and "sniffer" not mentioned in
lsqeth output.
Solution: add attributes "isolation" and "sniffer" to lsqeth.
---
README | 2 ++
zconf/lsqeth | 11 +++++++----
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/README b/README
index 30ba06f..7c75563 100644
--- a/README
+++ b/README
@@ -192,6 +192,8 @@ Release History:
- lscss: Also show devices on the defunct subchannel.
+ - lsqeth: add attributes "isolation" and "sniffer"
+
- all: Reworked s390-tools build process.
Bug Fixes:
diff --git a/zconf/lsqeth b/zconf/lsqeth
index 9b155e9..b1c2809 100755
--- a/zconf/lsqeth
+++ b/zconf/lsqeth
@@ -3,7 +3,7 @@
# File...........: lsqeth
# Author(s)......: Steffen Thoss <thoss@de.ibm.com>
# Peter Tiedemann <ptiedem@de.ibm.com>
-# Copyright IBM Corp. 2004, 2009
+# Copyright IBM Corp. 2004, 2010
#
# History of changes:
#
@@ -63,7 +63,9 @@ output_array=( if_name
buffer_count
add_hhlen
layer2
- large_send )
+ large_send
+ isolation
+ sniffer )
# Array for sysfs values
sysfs_entries=( "sw checksumming" "hw checksumming" "no checksumming"
"always queue 0" "always queue 1"
@@ -87,7 +89,7 @@ parp_array=0
function PrintVersion
{
echo "$script_name: version %S390_TOOLS_VERSION%"
- echo "Copyright IBM Corp. 2003, 2009"
+ echo "Copyright IBM Corp. 2003, 2010"
}
@@ -308,7 +310,8 @@ function __print_normal_format
function __layer2_print
{
del_layer2=( route4 route6
- fake_ll fake_broadcast )
+ fake_ll fake_broadcast
+ sniffer )
for l in ${del_layer2[@]}
do
--
1.6.5.2

View File

@ -1,47 +0,0 @@
From 3ca0d01240ab14ab3217985bf8ed9c89111e36c9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Wed, 3 Feb 2010 13:17:41 +0100
Subject: [PATCH] znetconf: use hex index for chpidtype table
Description: znetconf: index into chpidtype lookup table must be hex.
Symptom: Network subchannels with CHPID type containing non-decimal digits,
i.e. a-f, cause lsznet.raw errors like the following:
1a: value too great for base (error token is "1a")
Problem: The value of the sysfs attribute "type" of a CHPID is hex,
but the lookup table index in the bash script must be decimal.
Solution: Interpret "type" as hex number when used as lookup table index.
---
zconf/lsznet.raw | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/zconf/lsznet.raw b/zconf/lsznet.raw
index e5643ee..9821ba3 100755
--- a/zconf/lsznet.raw
+++ b/zconf/lsznet.raw
@@ -68,10 +68,10 @@ readonly -a CU_GROUPCHANNELS=(
)
readonly -a CHPIDTYPES=(
- [10]=OSE
- [11]=OSD
- [15]=OSN
- [24]=IQD
+ [0x10]=OSE
+ [0x11]=OSD
+ [0x15]=OSN
+ [0x24]=IQD
)
# whitelist of network devices for TCP/IP stack, e.g. for Linux installers
@@ -116,7 +116,7 @@ function search_cu_tcpip() {
# Always succeeds and returns 0.
function search_chpt() {
local chpidtype_number=$1
- chpidtype_symbolic=${CHPIDTYPES[$chpidtype_number]}
+ chpidtype_symbolic=${CHPIDTYPES[$((0x$chpidtype_number))]}
if [ "$chpidtype_symbolic" == "" ]; then
chpidtype_symbolic="?"
fi
--
1.6.6

View File

@ -1,230 +0,0 @@
From 9c94d906621e775f005fa34583671f08000f1723 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Thu, 4 Feb 2010 13:07:30 +0100
Subject: [PATCH] zipl: handle SSCH status
Description: zipl: handle status during IPL SSCH
Symptom: System enters disabled wait during IPL of DASD disk when an
unexpected status (e.g. triggered by a flashcopy operation)
is recognized on the IPL device.
Problem: Unexpected status is not handled correctly during the SSCH
portion of the IPL code.
Solution: Introduce a more robust SSCH result handling which performs
retries and clears status when encountering errors.
---
zipl/boot/common.S | 163 +++++++++++++++++++++++++++++++++++-----------------
zipl/boot/eckd2.S | 1 -
zipl/boot/fba2.S | 1 -
3 files changed, 110 insertions(+), 55 deletions(-)
diff --git a/zipl/boot/common.S b/zipl/boot/common.S
index fa45e5a..108dbbf 100644
--- a/zipl/boot/common.S
+++ b/zipl/boot/common.S
@@ -249,69 +249,126 @@ _disable_device:
.endm
.macro io_subroutines
+
+
+__LC_IO_NEW_PSW = 0x78
+__LC_SUBCHANNEL_ID = 0xb8
+
+#
+# Wait for I/O interrupt.
+#
+# Wait until status for the specified subchannel is available.
+#
+# %r2 : subchannel id
+# %r3 : address of irb
+#
+
+_wait_for_int:
+ lr %r1,%r2
+ basr %r4,0 # get base register
+0:
+ mvc __LC_IO_NEW_PSW(8),4f-0b(%r4) # set i/o new psw
+1: # wait
+ lpsw 3f-0b(%r4)
+2: # continue
+ tsch 0(%r3) # get status
+ brc 4,1b # if cc=1 goto wait
+ br %r14 # return
+ .align 8
+3:
+ .long 0x020a0000,0x80000000+1b # enabled wait psw
+4:
+ .long 0x00080000,0x80000000+2b # io new psw
+
#
# Start I/O
-# %r2 : device subchannel id
+#
+# Attempt to start I/O defined by ORB on specified subchannel. Retry I/O
+# 256 times per path (recommended error recovery procedure for IFCCs) unless
+# a permanent path error condition is indicated. Try all paths twice to try to
+# work around "link flapping" (paths going down once each in the same order as
+# they are tried). Perform CLEAR SUBCHANNEL when switching paths to clear any
+# improper subchannel status.
+#
+# %r2 : subchannel id
# %r3 : address of orb
# %r4 : address of irb
-# %r5 : retry count
#
_ssch:
- stm %r6,%r15,24(%r15)
- basr %r13,0 # base register
-0: s %r15,6f-0b(%r13) # create stack frame
- lr %r12,%r2 # save subchannel id
- lr %r11,%r3 # save orb
- lr %r10,%r4 # save irb
- lr %r9,%r5 # save retry count
- ic %r0,.Llpm-0b(%r13) # copy lpm to orb lpm
- stc %r0,6(%r3)
-1: lr %r1,%r12
- ssch 0(%r11) # go
- bnz 4f-0b(%r13) # houston, we have a problem
-2: lr %r2,%r12 # call _wait4de with subchannel id
- lr %r3,%r10 # and irb address as parameters
- bas %r14,_wait4de-0b(%r13) # wait until DE or error
- tm 9(%r10),0xff # test channel status
- bnz 4f-0b(%r13)
- tm 8(%r10),0xf3 # test device status
- bz 5f-0b(%r13)
- bct %r9,1b-0b(%r13) # something went wrong, retry.
-4: l %r2,7f-0b(%r13)
- bas %r4,_panik-0b(%r13) # won't return
-5: lm %r6,%r15,120(%r15)
- br %r14
-6: .long 96
-7: .long ESSCH
+ stm %r6,%r15,24(%r15)
+ basr %r13,0 # get base register
+0:
+ ahi %r15,-96 # create stack frame
+ lr %r6,%r2 # r6: sid
+ lr %r7,%r3 # r7: orb
+ lr %r8,%r4 # r8: irb
+ sr %r9,%r9 # r9: initial lpm
+ ic %r9,.Llpm-0b(%r13)
+ l %r10,.Lmask-0b(%r13) # r10: path mask
+1: # restart_all
+ lhi %r11,256 # r11: retry counter
+2: # restart
+ stc %r9,6(%r7) # store initial lpm in orb
+ ltr %r9,%r9 # if non-zero initial lpm
+ jne 3f # then use initial lpm
+ stc %r10,6(%r7) # else use current path mask
+3: # gotlpm
+ lr %r1,%r6 # get sid
+ ssch 0(%r7) # start subchannel
+ brc 1,7f # if cc==3 goto next_path
+ brc 7,6f # if cc!=0 goto retry
+4: # wait_for_int_loop
+ lr %r2,%r6 # get sid
+ lr %r3,%r8 # get irb
+ bras %r14,_wait_for_int # wait for interrupt
+ jnz 9f # if cc!=0 goto panic
+ tm 0(%r8),0x3 # test irb deferred cc
+ brc 1,7f # if cc==3 goto next_path
+ jz 5f # if cc==0 goto no_stctl_check
+ tm 3(%r8),0x10 # test irb status control
+ jnz 6f # if alert goto retry
+5: # no_stctl_check
+ tm 9(%r8),0xff # test irb subchannel status
+ jnz 6f # if status!=0 goto retry
+ tm 8(%r8),0xf3 # test irb unusual device status
+ jnz 6f # if status!=0 goto retry
+ tm 8(%r8),0x4 # test irb device end
+ jz 4b # if !device_end goto wait_for_int_loop
+ lm %r6,%r15,120(%r15)
+ br %r14 # return
+
+6: # retry
+ lr %r1,%r6 # get sid
+ tsch 0(%r8) # clear status if necessary
+ brct %r11,2b # if --retries>0 goto restart
+7: # next_path
+ ltr %r9,%r9 # if initial lpm != 0
+ jnz 8f # then goto noshift
+ srl %r10,1 # path_mask >>= 1
+ ltr %r10,%r10 # if path_mask==0
+ jz 9f # then goto panic
+8: # noshift
+ sr %r9,%r9 # clear initial lpm
+ lr %r1,%r6 # get sid
+ csch # clear subchannel
+ brc 7,9f # if cc!=0 goto panic
+ lr %r2,%r6 # get sid
+ lr %r3,%r8 # get irb
+ bras %r14,_wait_for_int # wait for interrupt
+ j 1b # goto restart_all
+9: # panic
+ l %r2,.Lerrno-0b(%r13) # get error code
+ bras %r14,_panik # panic
+
+.Lerrno:
+ .long ESSCH
+.Lmask:
+ .long 0x8080
.Llpm:
- .byte 0xff
+ .byte 0x00
.align 2
#
-# Wait for interrupt subroutine
-# %r2 : device subchannel id
-# %r3 : address of irb
-#
-_wait4de:
- lr %r1,%r2
- basr %r4,0
-0: mvc 0x78(8),5f-0b(%r4) # set i/o new psw
-1: lpsw 4f-0b(%r4)
-2: c %r1,0xb8 # compare subchannel id
- bne 1b-0b(%r4) # unequal -> continue waiting
- tsch 0(%r3)
- tm 9(%r3),0xff # test channel status
- bnz 3f-0b(%r4)
- tm 8(%r3),0xf3 # got something unusual ?
- bnz 3f-0b(%r4)
- tm 8(%r3),0x04 # got device end ?
- bz 1b-0b(%r4) # still busy -> continue waiting
-3: br %r14
- .align 8
-4: .long 0x020a0000,0x80000000+1b
-5: .long 0x00080000,0x80000000+2b # io new psw
-
-#
# Panik routine. Loads a disabled wait psw
# %r2 : panik code
#
diff --git a/zipl/boot/eckd2.S b/zipl/boot/eckd2.S
index ba71db9..b59ab0e 100644
--- a/zipl/boot/eckd2.S
+++ b/zipl/boot/eckd2.S
@@ -85,7 +85,6 @@ _load_direct:
la %r3,.Lorb-.Lbase(%r13) # pass address of orb
la %r4,.Lirb-.Lbase(%r13) # and pass address of irb
lr %r2,%r11 # pass subchannel id
- la %r5,5 # 5 retries
bas %r14,_ssch-.Lbase(%r13) # read records
.Lexit:
lr %r2,%r12 # return updated load address
diff --git a/zipl/boot/fba2.S b/zipl/boot/fba2.S
index 82b1447..90bb2cd 100644
--- a/zipl/boot/fba2.S
+++ b/zipl/boot/fba2.S
@@ -98,7 +98,6 @@ _load_direct:
lr %r2,%r11 # pass subchannel id
la %r3,.Lorb-.Lbase(%r13) # pass address of orb
la %r4,.Lirb-.Lbase(%r13) # and pass address of irb
- la %r5,5 # 5 retries
bas %r14,_ssch-.Lbase(%r13) # read up to 128 blocks
b .Lmain-.Lbase(%r13)
.Lexit: lr %r2,%r12 # return updated load address
--
1.6.6

View File

@ -1,39 +0,0 @@
From 04859d2270d1327873e1e8825bdd9d0eaf73f5cc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Wed, 10 Mar 2010 11:52:18 +0100
Subject: [PATCH] vmconvert shows garbage in progress bar
Description: vmconvert: Progress bar shows garbage
Symptom: The progress bar shows control characters at end of line.
Problem: One variable responsible for the progress bar has not been
initialized.
Solution: Initialize variable.
---
vmconvert/dump.cpp | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/vmconvert/dump.cpp b/vmconvert/dump.cpp
index f306b27..b4c97d6 100644
--- a/vmconvert/dump.cpp
+++ b/vmconvert/dump.cpp
@@ -46,8 +46,8 @@ ProgressBar::initProgress(void)
void
ProgressBar::displayProgress(uint64_t value, uint64_t maxValue)
{
+ char progress_bar[51];
int j;
- char progress_bar[50];
if (progressPercentage == (int) (value * 100 / maxValue))
fprintf(stderr, "%6lld of %6lld |\r",
@@ -58,6 +58,7 @@ ProgressBar::displayProgress(uint64_t value, uint64_t maxValue)
progress_bar[j] = '#';
for (j = progressPercentage / 2; j < 50; j++)
progress_bar[j] = '-';
+ progress_bar[50] = 0;
fprintf(stderr, "%6lld of %6lld |%s| %3d%% \r",
(long long) value, (long long) maxValue,
progress_bar, progressPercentage);
--
1.6.6.1

View File

@ -1,32 +0,0 @@
From 18bc3ce1055c350aaa50696e53baad984f573697 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Thu, 11 Mar 2010 08:34:32 +0100
Subject: [PATCH] zipl: zfcp dump partition error
Description: zipl: zfcp dump partition error
Symptom: When configuring the zfcp dump partition in zipl.conf the
partition information may be wrong.
Problem: The info data structure is used after it was freed.
Solution: Free the info structure when it is not used any more.
---
zipl/src/bootmap.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/zipl/src/bootmap.c b/zipl/src/bootmap.c
index 526aa48..043a562 100644
--- a/zipl/src/bootmap.c
+++ b/zipl/src/bootmap.c
@@ -689,9 +689,9 @@ get_dump_fs_parmline(char* partition, char* parameters, uint64_t mem,
disk_free_info(info);
return -1;
}
- disk_free_info(info);
buffer = create_dump_fs_parmline(parameters, "/dev/ram0", info->partnum,
mem, 1);
+ disk_free_info(info);
if (buffer == NULL)
return -1;
*result = buffer;
--
1.6.6.1

View File

@ -1,34 +0,0 @@
From cc672d10ef6ee3da060649fa595ed9d980e5e60e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Mon, 22 Mar 2010 12:58:13 +0100
Subject: [PATCH] zfcpdump - disable memory cgroups
Description: zipl/zfcpdump: Use "cgroup_disable=memory" kernel parameter
Symptom: Out of memory kernel panic during SCSI dump.
Problem: The zfcpdump kernel has to run within a 32 MB limit. When
using "memory cgroups" about 2.6 MB are allocated, which leads
to memory problems for zfcpdump.
Solution: For zfcpdump we do not need "memory cgroups". Therefore this patch
adds the kernel parameter "cgroup_disable=memory" to save 2.5 MB
of memory.
---
zipl/src/bootmap.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/zipl/src/bootmap.c b/zipl/src/bootmap.c
index 043a562..69f721e 100644
--- a/zipl/src/bootmap.c
+++ b/zipl/src/bootmap.c
@@ -653,7 +653,8 @@ create_dump_fs_parmline(const char* parmline, const char* root_dev,
if (!result)
return NULL;
snprintf(result, DUMP_PARAM_MAX_LEN, "%s%sroot=%s dump_part=%d "
- "dump_mem=%lld maxcpus=%d", parmline ? parmline : "",
+ "dump_mem=%lld maxcpus=%d cgroup_disable=memory",
+ parmline ? parmline : "",
parmline ? " " : "", root_dev, part_num,
(unsigned long long) mem, max_cpus);
result[DUMP_PARAM_MAX_LEN - 1] = 0;
--
1.6.6.1

View File

@ -1,29 +0,0 @@
From b0238ed360f65ecbf095d89c43c420ed036e4ff0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Mon, 22 Mar 2010 15:21:55 +0100
Subject: [PATCH] fix df usage in ziomon
Description: ziomon: Fix 'df' command usage
Symptom: Long device names could not be parsed properly.
Problem: Long device names were split accross multiple lines.
Solution: Use df with the right options.
---
ziomon/ziomon | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/ziomon/ziomon b/ziomon/ziomon
index 924c1dd..ea910fc 100755
--- a/ziomon/ziomon
+++ b/ziomon/ziomon
@@ -709,7 +709,7 @@ function check_size_requirements() {
(( estimated_size=$total_num_records * $size_per_record ));
debug " estimated size: $estimated_size Bytes";
(( estimated_size=$estimated_size / 1000000 ));
- (( free_space = `df -k $logpath | tail -n 1 | awk '{print $4}'` / 1024 ));
+ free_space=`df -mP $logpath | tail -n 1 | awk '{print $4}'`;
debug " free space on '$logpath': $free_space MBytes";
if [ "$WRP_SIZE" == "" ]; then
echo "NOTE: No size limit specified, run without a limit.";
--
1.6.6.1

View File

@ -1,102 +0,0 @@
From 2ec256f9dab30a57f60c83f7cd9b127c25b6cdd6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Thu, 25 Mar 2010 14:11:31 +0100
Subject: [PATCH] ziomon: remove check for ziorep_config availability
Description: ziomon: Remove check for ziorep_config availability
Symptom: ziorep_config could not be found
Problem: The path for ziorep_config was hardcoded and checked
for to detect install errors. However, as distributions
install these files in varying directories, install issues
should be avoided by distributors to begin with, and
especially since the debug trace helps to detect these,
this check is not really necessary and obviously causing
more harm than it helps.
Solution: Config is read from PATH.
---
ziomon/ziorep_cfgreader.cpp | 24 +++++-------------------
ziomon/ziorep_cfgreader.hpp | 2 --
2 files changed, 5 insertions(+), 21 deletions(-)
diff --git a/ziomon/ziorep_cfgreader.cpp b/ziomon/ziorep_cfgreader.cpp
index c64c150..a8f424f 100644
--- a/ziomon/ziorep_cfgreader.cpp
+++ b/ziomon/ziorep_cfgreader.cpp
@@ -18,7 +18,7 @@
#include "ziorep_utils.hpp"
#define ZIOREP_CFG_EXTENSION ".cfg"
-#define ZIOREP_CONFIG_PATH "/sbin/ziorep_config"
+#define ZIOREP_CONFIG "ziorep_config"
extern const char *toolname;
extern int verbose;
@@ -158,18 +158,6 @@ int ConfigReader::filter_unused_devices(const char *filename)
}
-int ConfigReader::check_ziorep_config() const
-{
- if (access(ZIOREP_CONFIG_PATH, F_OK | R_OK | X_OK)) {
- fprintf(stderr, "%s: Cannot access " ZIOREP_CONFIG_PATH
- ". Please check your installation and try again.\n", toolname);
- return -1;
- }
-
- return 0;
-}
-
-
int ConfigReader::check_config_file(const char *fname) const
{
char *tmp;
@@ -204,8 +192,6 @@ int ConfigReader::extract_config_data(const char *fname)
// Try to extract to .config first, which will be permanently cached
verbose_msg("No data cached, extract\n");
- if (check_ziorep_config())
- return -1;
fprintf(stdout, "Extracting config data...");
fflush(stdout);
@@ -215,8 +201,8 @@ int ConfigReader::extract_config_data(const char *fname)
if (extract_tmp(fname)) {
fprintf(stderr, "%s: Could not extract"
" configuration data. Check the integrity of"
- " %s%s with %s and retry.", toolname, fname,
- ZIOREP_CFG_EXTENSION, ZIOREP_CONFIG_PATH);
+ " %s%s with %s and retry.\n", toolname, fname,
+ ZIOREP_CFG_EXTENSION, ZIOREP_CONFIG);
return -1;
}
}
@@ -286,11 +272,11 @@ int ConfigReader::extract(const char *fname)
char *cmd = NULL;
// /sbin/ziorep_config -I -i <fname.cfg> > <file> 2>/dev/null
- cmd = (char*)malloc(strlen(ZIOREP_CONFIG_PATH) + 7 + strlen(fname)
+ cmd = (char*)malloc(strlen(ZIOREP_CONFIG) + 7 + strlen(fname)
+ strlen(ZIOREP_CFG_EXTENSION) + 3 + strlen(m_tmp_file)
+ 12 + 1);
- sprintf(cmd, "%s -I -i %s%s > %s 2>/dev/null", ZIOREP_CONFIG_PATH, fname,
+ sprintf(cmd, "%s -I -i %s%s > %s 2>/dev/null", ZIOREP_CONFIG, fname,
ZIOREP_CFG_EXTENSION, m_tmp_file);
verbose_msg("Issue command: %s\n", cmd);
diff --git a/ziomon/ziorep_cfgreader.hpp b/ziomon/ziorep_cfgreader.hpp
index 94e612b..3053633 100644
--- a/ziomon/ziorep_cfgreader.hpp
+++ b/ziomon/ziorep_cfgreader.hpp
@@ -138,8 +138,6 @@ private:
* in the actual data, and remove anything that is unused */
int filter_unused_devices(const char *filename);
- int check_ziorep_config() const;
-
int check_config_file(const char *fname) const;
int extract_config_data(const char *fname);
--
1.6.6.1

View File

@ -1,46 +0,0 @@
From 3aa5fa943cea0f01beb63c90a5b0255a797ac117 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Wed, 31 Mar 2010 10:19:50 +0200
Subject: [PATCH] ziomon - fix multipathing
Description: ziomon: Fix problem with multipath command output
Symptom: Number of LUNs does not mach number of devices: E.g. 12 devices
and 10 LUNs.
Problem: Some version of the multipath command use characters that can
break parsing of its output.
Solution: Use proper parsing of the multipath -l output.
---
ziomon/ziomon | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/ziomon/ziomon b/ziomon/ziomon
index ea910fc..b4c6e36 100755
--- a/ziomon/ziomon
+++ b/ziomon/ziomon
@@ -499,15 +499,15 @@ function check_for_multipath_devices() {
WRP_DEVICES[$j]="";
devices_basenames[$j]="";
clean_devices;
- (( i+=3 ));
+ (( i+=2 ));
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=${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}'`;
+ if [ `echo ${mp_arr[$i]} | grep -e "[0-9]\{1,\}:[0-9]\{1,\}:[0-9]\{1,\}:[0-9]\{1,\}" | wc -l` -ne 0 ]; then
+ line="`echo ${mp_arr[$i]} | sed 's/.*\([0-9]\{1,\}:[0-9]\{1,\}:[0-9]\{1,\}:[0-9]\{1,\}\)/\1/'`";
+ checked_devs[${#checked_devs[@]}]=`echo $line | awk '{print "/dev/"$2}'`;
+ ddebug " add ${checked_devs[${#checked_devs[@]}-1]}";
+ WRP_HOST_ADAPTERS[${#WRP_HOST_ADAPTERS[@]}]="host${line%%:*}";
+ WRP_LUNS[${#WRP_LUNS[@]}]=`echo $line | awk '{print $1}'`;
+ fi
(( i++ ));
done;
(( --i ));
--
1.6.6.1

View File

@ -1,66 +0,0 @@
From 37e697ae95b3c03f962ac7bb2dd591f00b6de87b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Wed, 28 Apr 2010 10:24:41 +0200
Subject: [PATCH] mismatch between man and -h in chshut
Description: chshut: Mismatch between man and -h
Symptom: Option -h stills show "panic" as a valid state.
Problem: Although it should not be used it is possible to use the
command with a "panic" state.
Solution: Remove "panic" from the list of valid states.
Provide an explanatory message in case it is used anyhow.
---
ipl_tools/getopt.c | 11 -----------
ipl_tools/sa.c | 7 +++++--
2 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/ipl_tools/getopt.c b/ipl_tools/getopt.c
index abd0cc2..d729379 100644
--- a/ipl_tools/getopt.c
+++ b/ipl_tools/getopt.c
@@ -60,7 +60,6 @@ const char *const usage_sa =
" halt System has been shut down (e.g. shutdown -h -H now)\n"
" poff System has been shut down for power off (e.g. shutdown -h -P now)\n"
" reboot System has been shut down for reboot (e.g. shutdown -r)\n"
-" panic System has been shut down after a kernel panic\n"
" Note: Depending on the distribution, \"halt\" might be mapped to \"poff\".\n"
"\n"
"ACTION specifies the action to be performed:\n"
@@ -638,16 +637,6 @@ void parse_shutdown_options(int argc, char **argv)
"/sys/firmware/vmcmd/on_reboot");
}
break;
- case 3:
- rc = strwrt(argv[2],
- "/sys/firmware/shutdown_actions/on_panic");
- if (action == 4 && rc == 0) {
- /*rc = ustrwrt(argv[3],
- "/sys/firmware/vmcmd/on_reboot"); */
- rc = ustrwrt(argv[3],
- "/sys/firmware/vmcmd/on_panic");
- }
- break;
}
if (rc != 0) {
fprintf(stderr, "%s: Failed to change shutdown"
diff --git a/ipl_tools/sa.c b/ipl_tools/sa.c
index 0232a47..d6b72bb 100644
--- a/ipl_tools/sa.c
+++ b/ipl_tools/sa.c
@@ -83,8 +83,11 @@ int is_valid_case(char *action)
rc = 1;
if (strncmp(action, "reboot", 6) >= 0 && length == 6)
rc = 2;
- if (strncmp(action, "panic", 5) >= 0 && length == 5)
- rc = 3;
+ if (strncmp(action, "panic", 5) >= 0 && length == 5) {
+ fprintf(stderr, "%s: Please use \"service dumpconf\" for "
+ "configuring the panic action\n", name);
+ exit(1);
+ }
return rc;
}
--
1.6.6.1

View File

@ -1,48 +0,0 @@
From c3fc4200d7913b50fb8b501681a0f44e51833a81 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Wed, 28 Apr 2010 20:57:17 +0200
Subject: [PATCH] lsdasd - update man page
Description: lsdasd: add missing description of option -b to man page
Symptom: Option -b/--base is described in lsdasd --help, but not in
the respective man page.
Problem: Man page is missing the description.
Solution: Add description.
---
zconf/lsdasd.8 | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/zconf/lsdasd.8 b/zconf/lsdasd.8
index f37c957..9c13644 100644
--- a/zconf/lsdasd.8
+++ b/zconf/lsdasd.8
@@ -10,6 +10,7 @@ lsdasd \- list channel attached direct access storage devices (DASD).
.TP 8
.B lsdasd
.RB [ -a ]
+.RB [ -b ]
.RB [ -s ]
.RB [ -v ]
.RB [ -l ]
@@ -19,7 +20,7 @@ lsdasd \- list channel attached direct access storage devices (DASD).
.RI [ <bus-ID> " [" <bus-ID> "] ...]]"
.SH DESCRIPTION
-The lsdasd command provides an overview of available DASD devices.
+The lsdasd command provides an overview of available DASD devices.
.SH OPTIONS
.TP 8
@@ -32,6 +33,9 @@ Supresses leading "0.0." for bus IDs.
.BR -a | --offline
Include all (offline) devices.
.TP
+.BR -b | --base
+Include only base devices.
+.TP
.BR -c | --compat
Old output of lsdasd for compatibility.
.TP
--
1.6.6.1

View File

@ -1,79 +0,0 @@
From edd35870b833548853b4c739cee1a7c0bce1fa55 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Mon, 3 May 2010 10:14:08 +0200
Subject: [PATCH] reinitialize array in lsqeth
Description: lsqeth: add clearing of print array for every qeth device
Symptom: lsqeth without parameters displays information of all qeth
devices. For layer2 devices information from a previously
displayed layer3 device may show up.
Problem: A structure used for printing is not cleared after
information for the previous device is written.
Solution: Add clearing of print array before collecting display
information for a single qeth device..
---
README | 3 +++
zconf/lsqeth | 18 ++++++++++++++++--
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/README b/README
index 7c75563..ffd5e54 100644
--- a/README
+++ b/README
@@ -253,6 +253,9 @@ Release History:
Fix printing of vmcmd shutdown action: Also print CP commands that
have more than one word.
+ - lsqeth:
+ * clear print array for every device displayed
+
- all:
Fixed a lot of build warnings and minor bugs.
diff --git a/zconf/lsqeth b/zconf/lsqeth
index b1c2809..19d49cd 100755
--- a/zconf/lsqeth
+++ b/zconf/lsqeth
@@ -168,6 +168,19 @@ fi
}
+#
+# initialize format_array_print
+#
+function __init_format_array_print
+{
+ local k=0
+
+ while [ $k -lt ${#output_array[@]} ];
+ do
+ format_array_print[$k]=''
+ k=$((k+1))
+ done
+}
#
# search value in format_array
@@ -309,9 +322,9 @@ function __print_normal_format
#
function __layer2_print
{
- del_layer2=( route4 route6
+ del_layer2=( route4 route6 large_send
fake_ll fake_broadcast
- sniffer )
+ checksumming sniffer )
for l in ${del_layer2[@]}
do
@@ -358,6 +371,7 @@ fi
#
for k in ${device_list}
do
+ __init_format_array_print
if_name="`cat $device_dir/$k/if_name`"
if [ -z "$if_name" ]; then
if_name=0
--
1.6.6.1

View File

@ -1,50 +0,0 @@
From 78a9e00a3a9885298f09079c026bf5415c137cca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Thu, 20 May 2010 16:19:17 +0200
Subject: [PATCH] check the length of the parameters line
The value of the parameters variable in zipl.conf that is passed as to the kernel
into /proc/cmdline is silently truncated to 896 bytes (it matches the value of
BOOT_PARM_LENGTH from boot/menu.S). Thus we add a check into zipl and end with
an error if the line is longer.
---
zipl/include/zipl.h | 3 +++
zipl/src/job.c | 8 ++++++++
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/zipl/include/zipl.h b/zipl/include/zipl.h
index d2d26dd..5e02f13 100644
--- a/zipl/include/zipl.h
+++ b/zipl/include/zipl.h
@@ -40,6 +40,9 @@
#define MAX_DUMP_VOLUMES 32
+/* defined in boot/menu.S as MENU_PARM_LENGTH */
+#define PARMLINE_LENGTH 896
+
/* Internal component load address type */
typedef uint64_t address_t;
diff --git a/zipl/src/job.c b/zipl/src/job.c
index a65e8c1..76ed5df 100644
--- a/zipl/src/job.c
+++ b/zipl/src/job.c
@@ -894,6 +894,14 @@ get_parmline(char* filename, char* line, char** parmline, address_t* address,
return -1;
} else result = NULL;
+ /* check the maximum possible length */
+ if (result) {
+ len = strlen(result);
+ if (len > PARMLINE_LENGTH) {
+ error_text("The length of parameters line (%d bytes) exceeds the allowed maximum (%d bytes)", len, PARMLINE_LENGTH);
+ return -1;
+ }
+ }
*parmline = result;
*address = addr;
return 0;
--
1.6.6.1

View File

@ -1,28 +0,0 @@
From fabce87ca9d586e6da7ed0bd371f2102408c721c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 4 Jun 2010 12:05:19 +0200
Subject: [PATCH 35/36] ziorep - follow symlink
Description: ziomon: fix the execution of stat <file> to follow symlinks.
Symptom: The device mapper report is failing with a script error.
Solution: Add parameter to stat <file> execution to follow symlinks.
---
ziomon/ziorep_config | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/ziomon/ziorep_config b/ziomon/ziorep_config
index de60379..f2ad35c 100755
--- a/ziomon/ziorep_config
+++ b/ziomon/ziorep_config
@@ -159,7 +159,7 @@ sub get_mapper_devices
next;
}
my $tf = catfile($c_src, "$dev");
- my $mm = `stat -c%t:%T $tf`;
+ my $mm = `stat -L -c%t:%T $tf`;
chomp($mm);
$mm = join(":", map { hex($_) } split(":", $mm));
$mapper_dev{$mm} = $dev;
--
1.6.6.1

View File

@ -1,36 +0,0 @@
From 379f76e4084a0d1875e1f98b2d975600639f6574 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 4 Jun 2010 12:06:38 +0200
Subject: [PATCH 36/36] ts-shell: do not restrict group names to be alphanumeric
Description: ts-shell: do not restrict group names to be alphanumeric
Symptom: ts-shell does not add authorizations assigned to groups
which contain non-alphanumeric characters, for instance,
a hyphen (-) sign.
Problem: ts-shell uses a regular expression to parse group names.
This regular expression uses the alphanumeric character
class (\w) to match group names. Using group names like
"ts-user" are ignored, because hyphen signs are not
included in the alphanumeric character class.
Solution: Make the regular expression less restrictive through
permitting all characters that are not whitespaces (\S).
---
iucvterm/bin/ts-shell.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/iucvterm/bin/ts-shell.in b/iucvterm/bin/ts-shell.in
index 654d0c6..5fdf66c 100755
--- a/iucvterm/bin/ts-shell.in
+++ b/iucvterm/bin/ts-shell.in
@@ -219,7 +219,7 @@ sub loadAuthorization(\%)
$authorized = 1;
log_debug "Found user: $key";
- } elsif ($key =~ /^@(\w+)$/) {
+ } elsif ($key =~ /^@(\S+)$/) {
my $group = $1;
$authorized = 1 if grep {/^${group}$/} @{$cfg->{groups}};
log_debug "Found group: $key" if $authorized;
--
1.6.6.1

View File

@ -1,30 +0,0 @@
From 41d606899d4029f8ac9f3415ebd21142cb223d70 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Tue, 22 Jun 2010 13:25:32 +0200
Subject: [PATCH 37/40] znetconf: unknown driver for qeth
Description: znetconf: --drive|-d option returning "unknown driver" for qeth
Symptom: qeth classified as unknown if specified for -d
Problem: bash reg. expression interpretation changed in new bash versions
Solution: used backward and "forward" compatible expression
---
zconf/znetconf | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/zconf/znetconf b/zconf/znetconf
index 873124a..e1b48b3 100755
--- a/zconf/znetconf
+++ b/zconf/znetconf
@@ -1031,7 +1031,8 @@ function is_shortccwdevbusid_list()
function is_supported_driver()
{
local DRIVER="$1"
- [[ "$DRIVER" =~ "^(qeth|lcs|ctc|ctcm)$" ]]
+ local DRVEXPR='^(qeth|lcs|ctc|ctcm)$'
+ [[ "$DRIVER" =~ $DRVEXPR ]]
case $? in
0)
return 0
--
1.6.6.1

View File

@ -1,90 +0,0 @@
From b0192c18160e5ea35889794895becab99890bca3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Tue, 22 Jun 2010 13:27:27 +0200
Subject: [PATCH 38/40] cpuplugd: fix stack overflow
Description: cpuplugd: fix stack overwrite
Symptom: cpuplugd will terminate with "stack smashing" error on systems
with more than 30 CPUs.
Problem: NULL termination of a read buffer will write beyond the buffer
if a previous read() filled out the whole buffer.
Solution: Only read max. buffer size - 1 bytes.
---
cpuplugd/daemon.c | 2 +-
cpuplugd/main.c | 1 +
cpuplugd/mem.c | 4 ++--
cpuplugd/vmstat.c | 4 ++--
4 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/cpuplugd/daemon.c b/cpuplugd/daemon.c
index f1af263..391acba 100644
--- a/cpuplugd/daemon.c
+++ b/cpuplugd/daemon.c
@@ -287,7 +287,7 @@ int check_lpar()
, strerror(errno));
clean_up();
}
- bytes_read = fread(buffer, 1, sizeof(buffer), filp);
+ bytes_read = fread(buffer, 1, sizeof(buffer) - 1, filp);
if (bytes_read == 0) {
fprintf(stderr, "Reading /proc/cpuinfo failed:");
fprintf(stderr, "%s\n", strerror(errno));
diff --git a/cpuplugd/main.c b/cpuplugd/main.c
index c280342..f8f9dfa 100644
--- a/cpuplugd/main.c
+++ b/cpuplugd/main.c
@@ -347,6 +347,7 @@ int main(int argc, char *argv[])
syslog(LOG_INFO, "Out of memory: Aborting.\n");
clean_up();
}
+ memset(vs, 0, sizeof(struct vmstat));
/*
* If the thread routine requires multiple arguments, they must be
* passed bundled up in an array or a structure
diff --git a/cpuplugd/mem.c b/cpuplugd/mem.c
index 8d5f05f..13f902d 100644
--- a/cpuplugd/mem.c
+++ b/cpuplugd/mem.c
@@ -70,7 +70,7 @@ int get_vmstats(struct vm_info *v)
rc = -1;
goto out;
}
- bytes_read = fread(buffer, 1, sizeof(buffer), filp);
+ bytes_read = fread(buffer, 1, sizeof(buffer) - 1, filp);
/*
* Bail if read failed or the buffer isn't big enough
*/
@@ -314,7 +314,7 @@ int get_free_memsize()
":%s\n", strerror(errno));
clean_up();
}
- bytes_read = fread(buffer, 1, sizeof(buffer), filp);
+ bytes_read = fread(buffer, 1, sizeof(buffer) - 1, filp);
/*
* Bail if read failed or the buffer isn't big enough
*/
diff --git a/cpuplugd/vmstat.c b/cpuplugd/vmstat.c
index 8428cce..d5a0036 100644
--- a/cpuplugd/vmstat.c
+++ b/cpuplugd/vmstat.c
@@ -76,7 +76,7 @@ void get_cpu_stats(struct cpustat *s)
syslog(LOG_ERR, "Can not open /proc/stat"
":%s\n", strerror(errno));
} else {
- bytes_read = fread(buffer, 1, sizeof(buffer), filp);
+ bytes_read = fread(buffer, 1, sizeof(buffer) - 1, filp);
fclose(filp);
/*
* Bail if read failed or the buffer isn't big enough
@@ -118,7 +118,7 @@ void get_cpu_stats(struct cpustat *s)
* softirq: servicing softirqs
* steal: the cpu time spent in involuntary wait
*/
- sscanf(match, "cpu %du %du %du %du %du %du %du %du",
+ sscanf(match, "cpu %d %d %d %d %d %d %d %d",
&s->cpu_user,
&s->cpu_nice,
&s->cpu_sys,
--
1.6.6.1

View File

@ -1,106 +0,0 @@
From 664177c0fe57f671ad0d1eeed18374d77233d4b4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Tue, 22 Jun 2010 13:28:45 +0200
Subject: [PATCH 39/40] cpuplugd: fix cmm limits checks
Description: cpuplugd: fix cmm_min/max limit checks.
Symptom: The cmm_min and cmm_max limits are not enforced correctly
when starting the daemon without the -V option, or when
cmm_pages is set manually below or above the limits.
Problem: Part of the cmm_min/max checks is only done when -V option
is specified. Values above/below the max/min limits are also
not identified correctly.
Solution: Make checks independent from -V option and check for cmm_pages
values beyond the limit.
---
cpuplugd/main.c | 54 +++++++++++++++---------------------------------------
1 files changed, 15 insertions(+), 39 deletions(-)
diff --git a/cpuplugd/main.c b/cpuplugd/main.c
index f8f9dfa..3738a5f 100644
--- a/cpuplugd/main.c
+++ b/cpuplugd/main.c
@@ -226,26 +226,6 @@ void eval_mem_rules(struct config *cfg)
}
/* Evaluate the memunplug rule. */
if (cfg->memunplug && eval_term(cfg->memunplug, &symbols)) {
- /*
- * case where cmm has asynchronously increased
- * cmm_pages after cpuplugd reset it to cmm_max
- * at cpuplugd startup.
- *
- */
- if (cmmpages_size > cfg->cmm_max) {
- if (debug) {
- if (foreground == 1)
- printf("Found cmm_pages above Limit. "
- "Resetting value to %d\n"
- , cfg->cmm_max);
- if (foreground == 0)
- syslog(LOG_INFO, "Found cmm_pages above"
- "Limit. Resetting value to %d\n"
- , cfg->cmm_max);
- }
- set_cmm_pages(cfg->cmm_max);
- return;
- }
/* check memory limit */
if (cmmpages_size + cfg->cmm_inc > cfg->cmm_max) {
if (debug) {
@@ -256,18 +236,16 @@ void eval_mem_rules(struct config *cfg)
syslog(LOG_INFO, "maximum memory"
" limit is reached\n");
}
- if (cmmpages_size < cfg->cmm_max) {
- /* if the next increment would exceed
- * the maximum we advance to the
- * maximum
- */
+ /* if the next increment would exceed
+ * the maximum we advance to the
+ * maximum
+ */
+ if (cmmpages_size != cfg->cmm_max)
set_cmm_pages(cfg->cmm_max);
- return;
- }
- } else {
- memunplug(cfg->cmm_inc);
return;
}
+ memunplug(cfg->cmm_inc);
+ return;
}
/* Evaluate the memplug rule. */
if (cfg->memplug && eval_term(cfg->memplug, &symbols)) {
@@ -280,19 +258,17 @@ void eval_mem_rules(struct config *cfg)
if (foreground == 0)
syslog(LOG_INFO, "minimum memory"
" limit is reached\n");
- if (cmmpages_size > cfg->cmm_min) {
- /* if the next increment would exceed
- * the minimum we advance to the
- * minimum
- */
- set_cmm_pages(cfg->cmm_min);
- return;
- }
}
- } else {
- memplug(cfg->cmm_inc);
+ /* if the next increment would exceed
+ * the minimum we advance to the
+ * minimum
+ */
+ if (cmmpages_size != cfg->cmm_min)
+ set_cmm_pages(cfg->cmm_min);
return;
}
+ memplug(cfg->cmm_inc);
+ return;
}
}
--
1.6.6.1

View File

@ -1,39 +0,0 @@
From 4a2b6aa7b2a873be78c27d2abe010cd7e73d9640 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Tue, 22 Jun 2010 13:33:36 +0200
Subject: [PATCH 40/40] cpuplugd: set cpu_min to 1 by default
Description: cpuplugd: set cpu_min to 1 by default.
Symptom: With a cpu_min default value of 2, the "cpu ping pong" effect
may still be visible with low system load, i.e. expensive cpu
signaling may occur if the workload is spread on 2 under-worked
cpus.
Problem: The default value for cpu_min is 2.
Solution: Set the default value of cpu_min to 1.
---
etc/sysconfig/cpuplugd | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/etc/sysconfig/cpuplugd b/etc/sysconfig/cpuplugd
index c807232..efafa20 100644
--- a/etc/sysconfig/cpuplugd
+++ b/etc/sysconfig/cpuplugd
@@ -6,13 +6,11 @@
# It does not contain shell environment variables.
## Type: integer
-## Default: 2
+## Default: 1
#
# The minimum number of cpus.
-# This means in this example, that every time at least two cpus
-# will be available
#
-CPU_MIN="2"
+CPU_MIN="1"
## Type: integer
## Default: 2
--
1.6.6.1

View File

@ -1,40 +0,0 @@
From e30dc240e7417b83957507f1da6b34c31f18afb5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Tue, 29 Jun 2010 22:23:50 +0200
Subject: [PATCH] fix --dates option on zfcpdbf
Description: zfcpdbf: Fix --dates option
Symptom: Running zfcpdbf with the option --dates returns "Unknown
option: dates".
Problem: The code expects --date, not the documented --dates option.
Solution: Change zfcpdbf to expect --dates, as documented in the
man page and in the usage information.
---
scripts/zfcpdbf | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/zfcpdbf b/scripts/zfcpdbf
index 3693d71..0b75c43 100755
--- a/scripts/zfcpdbf
+++ b/scripts/zfcpdbf
@@ -139,7 +139,7 @@ GetOptions(
'V|verbose' => \$OPT_VERBOSE,
'h|help' => \$OPT_HELP,
'v|version' => \$OPT_VERSION,
- 'D|date=s' => \$OPT_DATE,
+ 'D|dates=s' => \$OPT_DATE,
's|singleline' => \$OPT_SINGLELINE
) or print_usage();
@@ -555,7 +555,7 @@ sub print_san {
#
# Converts the Unix time to localtime an returns it
-# depending on the --date option.
+# depending on the --dates option.
#
# \param UNIX Timestamp to convert
# \return Formated Localtime
--
1.6.6.1

View File

@ -1,36 +0,0 @@
From 76e25ac419c3f23c0cdbfcd2db64bf196d806994 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Tue, 13 Jul 2010 15:27:26 +0200
Subject: [PATCH 42/43] lsluns: uninitialized value on adapter offline
Description: lsluns: uninitialized value on adapter offline.
Symptom: An error message is presented stating that some values
are not initialized while an operation is due.
Problem: The program execution is not reflection the offline adapter
status.
Solution: Account for offlined adapter status and show an appropriate
message.
---
zconf/lsluns | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/zconf/lsluns b/zconf/lsluns
index 9227f64..769b846 100755
--- a/zconf/lsluns
+++ b/zconf/lsluns
@@ -211,7 +211,11 @@ sub show_attached_lun_info
print "\tport = $p\n";
foreach my $l (sort keys %{$lun_hash{$a}{$p}}) {
my $sg_dev = "/dev/".$lun_hash{$a}{$p}{$l};
- my $inq = `sg_inq -r $sg_dev`;
+ my $inq = `sg_inq -r $sg_dev 2>/dev/null`;
+ if (!$inq) {
+ print("\t\tlun = $l [offline]\n");
+ next;
+ }
(my $vend = substr($inq, 0x8, 0x8)) =~ s/\s*//g;
(my $mod = substr($inq, 0x10, 0x10)) =~ s/\s*//g;
my $type = ord(substr($inq, 0x0, 0x1));
--
1.7.1.1

View File

@ -1,78 +0,0 @@
From e1f4564972a7d280badf24568d56c063b6ce0ca7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Tue, 13 Jul 2010 15:29:42 +0200
Subject: [PATCH 43/43] zfcpdbf: Fix "Use of uninitialized value" and output issues
Description: zfcpdbf: Fix "Use of uninitialized value" and output issues
Symptom: zfcpdbf outputs the error "Use of uninitialized value".
Problem: zfcpdbf tried to output attributes for "status read"
commands that do not exist. It also tried to output the
attribute port_handle for ELS requests that does not exist.
Solution: Exit early for "status read" requests, there is no additional
FSF command data. Remove output of LS field for ELS requests.
It was wrong, and newer dbf does not have this redundant field.
For consistency, add devno and timestamp to output of "status
read".
---
scripts/zfcpdbf | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/scripts/zfcpdbf b/scripts/zfcpdbf
index 0b75c43..f82044d 100755
--- a/scripts/zfcpdbf
+++ b/scripts/zfcpdbf
@@ -375,11 +375,13 @@ sub print_hba {
}
elsif(defined($hba_hash{'tag2'}) &&
$hba_hash{'tag2'} eq "dism") {
- print "status read request dissmissed";
+ print "$adapter $hba_hash{'timestamp'} " .
+ "status read request dismissed";
}
elsif(defined($hba_hash{'tag2'}) &&
$hba_hash{'tag2'} eq "fail") {
- print "status read request failed";
+ print "$adapter $hba_hash{'timestamp'} " .
+ "status read request failed";
}
}
elsif(defined($hba_hash{'tag'}) && $hba_hash{'tag'} eq "resp") {
@@ -398,9 +400,14 @@ sub print_hba {
}
}
else {
- next;
+ return;
}
-
+
+ if ($hba_hash{'tag'} eq 'stat') {
+ print "\n";
+ return;
+ }
+
if($OPT_VERBOSE) {
print "protocol status qualifier=" .
"'$hba_hash{'fsf_prot_status_qual'}'" . $endl .
@@ -410,7 +417,7 @@ sub print_hba {
"'$hba_hash{'fsf_req_status'}'" . $endl .
"SBAL=$hba_hash{'sbal_first'}/$hba_hash{
'sbal_last'}/$hba_hash{'sbal_response'} " .
- "(fist/last/response)" . $endl;
+ "(first/last/response)" . $endl;
}
if($hba_hash{'fsf_command'} eq '0x00000002') {
@@ -432,8 +439,7 @@ sub print_hba {
" LUN handle=$hba_hash{'lun_handle'}";
}
elsif($hba_hash{'fsf_command'} eq '0x0000000b' ) {
- print "D_ID=$hba_hash{'d_id'} LS " .
- "code=$hba_hash{'port_handle'}";
+ print "D_ID=$hba_hash{'d_id'}";
}
print"\n";
}
--
1.7.1.1

View File

@ -1,41 +0,0 @@
From 30321208dbccbd634c5e91b594372d150df07a03 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Tue, 25 Jan 2011 10:38:42 +0100
Subject: [PATCH 44/46] xcec-bridge: fix multicast forwarding
Description: xcec-bridge: fix multicast forwarding
Symptom: Forwarding of multicast traffic does not work.
Problem: xcec-bridge was developed for the broken packet socket
support of the qeth layer 3 driver. The code assumes
there are no link level heades for incoming packets.
Solution: New qeth layer 3 driver has full packet socket support
so xcec-bridge has to account link level header.
---
ip_watcher/xcec-bridge.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/ip_watcher/xcec-bridge.c b/ip_watcher/xcec-bridge.c
index d6dd112..7f551d2 100644
--- a/ip_watcher/xcec-bridge.c
+++ b/ip_watcher/xcec-bridge.c
@@ -549,12 +549,13 @@ void process_packet(struct int_sock *i_s)
if (s_ll.sll_pkttype==PACKET_BROADCAST) {
s_in.sin_addr.s_addr=INADDR_BROADCAST;
} else {
- memcpy(&s_in.sin_addr,&buffer[16],4);
+ memcpy(&s_in.sin_addr, &buffer[16 + ETH_HLEN], 4);
}
- retval=sendto(i_s_item->o_fd,buffer,buffer_len,0,
- (struct sockaddr *)&s_in,
- sizeof(struct sockaddr_in));
+ retval=sendto(i_s_item->o_fd, buffer + ETH_HLEN,
+ buffer_len - ETH_HLEN, 0,
+ (struct sockaddr *)&s_in,
+ sizeof(struct sockaddr_in));
if (retval==-1) {
if ( (errno==EMSGSIZE) && (!i_s_item->mtu_warning) ) {
syslog(LOG_WARNING,"MTU of %s too small " \
--
1.7.3.4

View File

@ -1,53 +0,0 @@
From 7ff057ee33e5e452c09308249b36fa5da051b238 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Tue, 25 Jan 2011 10:57:40 +0100
Subject: [PATCH 45/46] ziomon: wrong return codes
Description: ziomon: ziomon tools return 1 when using option -h, --help and -v,
when return code must be 0. ziomon return 0 when using no command line
parameter, return code must be 1 here.
Symptom: Confusing error code. Some automated test cases maybe fail.
Problem: 1 as been introduced as rc for parse_parms besides error codes,
but is not distinguished from them when parse_params is called.
Solution: In function parse_parms substitute "exit 1" by "exit 0"
in case the option -h, --help or -v was handled by the program.
Substitute "exit 0" by "exit 1" in case the case with no
commandline parametes was handled by the program.
---
ziomon/ziomon | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/ziomon/ziomon b/ziomon/ziomon
index b4c6e36..9af2f4e 100755
--- a/ziomon/ziomon
+++ b/ziomon/ziomon
@@ -124,7 +124,7 @@ function parse_params() {
if [ $# -eq 0 ]; then
print_usage;
- exit 0;
+ exit 1;
fi
let i=0;
@@ -132,7 +132,7 @@ function parse_params() {
case $1 in
--help|-h)
print_usage;
- exit 1;;
+ exit 0;;
--verbose|-V)
(( WRP_DEBUG++ ));;
--duration|-d)
@@ -152,7 +152,7 @@ function parse_params() {
[ $? -ne 0 ] && ((error++));;
--version|-v)
print_version;
- exit 1;;
+ exit 0;;
-*)
echo "$WRP_TOOLNAME: Invalid option -- $1";
echo "Try '$WRP_TOOLNAME --help' for more information.";
--
1.7.3.4

View File

@ -1,30 +0,0 @@
From 037964c1dd79a637e66b51544b69243a2f4216ea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Tue, 25 Jan 2011 11:00:09 +0100
Subject: [PATCH 46/46] qethconf: process devices with non-zero subchannel
Description: qethconf: process devices with subchannel set != 0
Symptom: qethconf ipa list does not show devices with subchannel
set != 0.
Problem: The code matches only for subchannel set 0.
Solution: Extend code to match for other subchannel IDs.
---
qethconf/qethconf | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/qethconf/qethconf b/qethconf/qethconf
index 10dc902..9d9de1e 100644
--- a/qethconf/qethconf
+++ b/qethconf/qethconf
@@ -205,7 +205,7 @@ function __list_entries
fi
for j in ${cmd_type}
do
- device_list="`cat $sys_file/0.0.*/if_name`"
+ device_list="`cat $sys_file/*.*.*/if_name`"
for i in ${device_list}
do
__layer2_enabled "$i" "list"
--
1.7.3.4

View File

@ -1,102 +0,0 @@
From 68c07ef0b9d9731c040880e0db3570f48a85f9b8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 28 Jan 2011 13:06:00 +0100
Subject: [PATCH 47/61] wait for completion of any pending actions affecting device
Delay I/O operations until all pending requests against the common I/O layer
have been completed. The kernel now provides /proc/cio_settle file and a write
there will be blocked until all requests are completed.
---
zconf/chccwdev | 5 +++++
zconf/chchp | 5 +++++
zconf/cio_ignore | 9 +++++++++
3 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/zconf/chccwdev b/zconf/chccwdev
index d2a697b..03985a1 100755
--- a/zconf/chccwdev
+++ b/zconf/chccwdev
@@ -28,6 +28,7 @@
#==============================================================================
CMD=$(basename $0)
MAX_RETRIES=5
+CIO_SETTLE="/proc/cio_settle"
if [ "$(cat /proc/filesystems|grep sysfs)" = "" ]; then
echo "ERROR: $CMD requires sysfs support!" >&2
@@ -160,6 +161,10 @@ while [ $# -gt 0 ]; do
shift
done
+if [ -w $CIO_SETTLE ] ; then
+ echo 1 > $CIO_SETTLE
+fi
+
#
# Parse the BUSIDLIST and expand the ranges and short IDs.
#
diff --git a/zconf/chchp b/zconf/chchp
index 520ce3f..4a62579 100755
--- a/zconf/chchp
+++ b/zconf/chchp
@@ -30,6 +30,7 @@ VERSION="%S390_TOOLS_VERSION%"
TOOLNAME=${0##*/}
MAX_CHPID_CSS=255
MAX_CHPID_ID=255
+CIO_SETTLE="/proc/cio_settle"
# Print help text
function print_help()
@@ -408,3 +409,7 @@ for CHPID in $CHPID_LIST ; do
get_chpid_id TO_ID $CHPID_TO
loop_chpids $FROM_CSS $FROM_ID $TO_CSS $TO_ID perform_command
done
+
+if [ -w $CIO_SETTLE ] ; then
+ echo 1 > $CIO_SETTLE
+fi
diff --git a/zconf/cio_ignore b/zconf/cio_ignore
index 71dccb1..476c481 100755
--- a/zconf/cio_ignore
+++ b/zconf/cio_ignore
@@ -8,6 +8,8 @@
VERSION="%S390_TOOLS_VERSION%"
BLACKLIST="/proc/cio_ignore"
+CIO_SETTLE="/proc/cio_settle"
+WAIT_FOR_CIO=0
SYSINFO="/proc/sysinfo"
CONSDRV="/sys/bus/ccw/drivers/3215"
MAXCSSID=0
@@ -706,9 +708,11 @@ while [ $# -gt 0 ] ; do
-r|--remove)
shift
remove_device $1
+ WAIT_FOR_CIO=1
;;
-R|--remove-all)
remove_all_devices
+ WAIT_FOR_CIO=1
;;
-l|--list)
list_blacklisted 1
@@ -724,6 +728,7 @@ while [ $# -gt 0 ] ; do
;;
-p|--purge)
purge
+ WAIT_FOR_CIO=1
;;
*)
warn "invalid option '$1'"
@@ -734,4 +739,8 @@ while [ $# -gt 0 ] ; do
shift
done
+if [ \( -w $CIO_SETTLE \) -a $WAIT_FOR_CIO = 1 ] ; then
+ echo 1 > $CIO_SETTLE
+fi
+
exit 0
--
1.7.3.5

View File

@ -1,169 +0,0 @@
From 1ce37d173f564b5070d1819d0f5cec4f015bcbdf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 28 Jan 2011 13:14:48 +0100
Subject: [PATCH 48/61] add infrastructure code for new features
Summary: s390-tools: Add infrastructure code for new features
Description: Add some infrastructure code from s390-tools upstream
to be used by new features:
* Add linked list implementation
* Add typedefs for replacing __uxx and __sxx datatypes
* Define S390_TOOLS_LIBDIR and S390_TOOLS_SYSCONFDIR macros
---
common.mak | 4 ++
include/list.h | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++
include/zt_common.h | 11 +++++
3 files changed, 119 insertions(+), 0 deletions(-)
create mode 100644 include/list.h
diff --git a/common.mak b/common.mak
index 0a7916e..625cf6c 100644
--- a/common.mak
+++ b/common.mak
@@ -42,8 +42,12 @@ else
WARNFLAGS = -W -Wall
endif
CFLAGS = $(WARNFLAGS) -O3 -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE) \
+ -DS390_TOOLS_LIBDIR=$(TOOLS_LIBDIR) \
+ -DS390_TOOLS_SYSCONFDIR=$(SYSCONFDIR) \
$(OPT_FLAGS)
CXXFLAGS = $(WARNFLAGS) -O3 -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE) \
+ -DS390_TOOLS_LIBDIR=$(TOOLS_LIBDIR) \
+ -DS390_TOOLS_SYSCONFDIR=$(SYSCONFDIR) \
$(OPT_FLAGS)
export AS LD CC CPP AR NM STRIP OBJCOPY OBJDUMP INSTALL CFLAGS
diff --git a/include/list.h b/include/list.h
new file mode 100644
index 0000000..b7344ed
--- /dev/null
+++ b/include/list.h
@@ -0,0 +1,104 @@
+/*
+ * Linked list functions
+ *
+ * Copyright IBM Corp. 2001, 2010
+ * Author(s): Carsten Otte (cotte@de.ibm.com)
+ * Michael Holzheu <holzheu@linux.vnet.ibm.com>
+ */
+
+#ifndef LIST_H
+#define LIST_H
+
+#include <stddef.h>
+
+struct list {
+ struct list *next, *prev;
+};
+
+#define EMPTY_LIST(list) { &(list), &(list) }
+
+/*
+ * Add entry to begining of list
+ */
+static inline void list_add(struct list *entry, struct list *head)
+{
+ entry->next = head->next;
+ entry->next->prev = entry;
+ head->next = entry;
+ entry->prev = head;
+}
+
+/*
+ * Add entry to end of list
+ */
+static inline void list_add_end(struct list *entry, struct list *head)
+{
+ entry->prev = head->prev;
+ entry->prev->next = entry;
+ head->prev = entry;
+ entry->next = head;
+}
+
+/*
+ * Remove entry
+ */
+static inline void list_del(struct list *entry)
+{
+ entry->next->prev = entry->prev;
+ entry->prev->next = entry->next;
+ entry->next = entry;
+ entry->prev = entry;
+}
+
+/*
+ * Check if list is empty
+ */
+static inline int list_is_empty(struct list *head)
+{
+ if ((head->next == head) && (head->prev == head))
+ return 1;
+ else
+ return 0;
+}
+
+/*
+ * Initialize list
+ */
+static inline void list_init(struct list *head)
+{
+ head->next = head;
+ head->prev = head;
+}
+
+#define list_entry(ptr, type, member) ({ \
+ const typeof(((type *) 0)->member) *__member_ptr = (ptr); \
+ (type *)((char *)__member_ptr - offsetof(type, member) ); })
+
+#define list_entry_first(ptr, type, member) \
+ list_entry((ptr)->next, type, member)
+
+#define list_entry_next(ptr, type, member) \
+ list_entry((ptr)->next, type, member)
+
+#define list_entry_prev(ptr, type, member) \
+ list_entry((ptr)->prev, type, member)
+
+/*
+ * List iterators
+ */
+#define list_get(entry, type, member) \
+ ((type *)((char *)(entry)-(unsigned long)(&((type *)0)->member)))
+
+#define list_iterate(i, head, member) \
+ for (i = list_get((head)->next, typeof(*i), member); \
+ &i->member != (head); \
+ i = list_get(i->member.next, typeof(*i), member))
+
+#define list_iterate_safe(i, head, member, n) \
+ for (i = list_get((head)->next, typeof(*i), member), \
+ n = list_get(i->member.next, typeof(*i), member); \
+ &i->member != (head); \
+ i = n, \
+ n = list_get(n->member.next, typeof(*n), member))
+
+#endif /* LIST_H */
diff --git a/include/zt_common.h b/include/zt_common.h
index ba9a850..7950651 100644
--- a/include/zt_common.h
+++ b/include/zt_common.h
@@ -21,5 +21,16 @@
#endif
#define RELEASE_STRING STRINGIFY (S390_TOOLS_RELEASE)
+#define TOOLS_LIBDIR STRINGIFY (S390_TOOLS_LIBDIR)
+#define TOOLS_SYSCONFDIR STRINGIFY (S390_TOOLS_SYSCONFDIR)
+
+typedef unsigned long long u64;
+typedef signed long long s64;
+typedef unsigned int u32;
+typedef signed int s32;
+typedef unsigned short int u16;
+typedef signed short int s16;
+typedef unsigned char u8;
+typedef signed char s8;
#endif /* ZT_COMMON_H */
--
1.7.3.5

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,729 +0,0 @@
From 411a47d37b69a0763d1d7b1e3e132cfab67815cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 28 Jan 2011 14:15:39 +0100
Subject: [PATCH 51/61] lsmem/chmem: Tools to manage memory hotplug
Summary: lsmem/chmem: Tools to manage memory hotplug.
Description: With lsmem, you can display the online status of all available
memory. With chmem, you can set memory online or offline.
---
README | 2 +
zconf/Makefile | 17 +++-
zconf/chmem | 325 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
zconf/chmem.8 | 71 ++++++++++++
zconf/lsmem | 158 +++++++++++++++++++++++++++
zconf/lsmem.8 | 69 ++++++++++++
6 files changed, 639 insertions(+), 3 deletions(-)
create mode 100644 zconf/chmem
create mode 100644 zconf/chmem.8
create mode 100644 zconf/lsmem
create mode 100644 zconf/lsmem.8
diff --git a/README b/README
index 4335b43..dbb1475 100644
--- a/README
+++ b/README
@@ -112,6 +112,8 @@ s390-tools (1.8.2)
adapters.
- cio_ignore: Query and modify the contents of the CIO device driver
blacklist.
+ - lsmem: Display the online status of the available memory.
+ - chmem: Set hotplug memory online or offline.
* dumpconf:
Allows to configure the dump device used for system dump in case a kernel
diff --git a/zconf/Makefile b/zconf/Makefile
index 9fe8b42..10f2b87 100644
--- a/zconf/Makefile
+++ b/zconf/Makefile
@@ -5,14 +5,16 @@ include ../common.mak
SCRIPTS = lsdasd lstape lscss chccwdev lsqeth lszfcp lschp chchp lszcrypt \
chzcrypt lsluns cio_ignore znetconf
+USRSBIN_SCRIPTS = lsmem chmem
MANPAGES= lsdasd.8 lstape.8 lscss.8 chccwdev.8 lsqeth.8 lszfcp.8 lschp.8 \
- chchp.8 lszcrypt.8 chzcrypt.8 lsluns.8 cio_ignore.8 znetconf.8
+ chchp.8 lszcrypt.8 chzcrypt.8 lsluns.8 cio_ignore.8 znetconf.8 \
+ chmem.8 lsmem.8
all:
clean:
-install: install-scripts install-manpages
+install: install-scripts install-manpages install-usrsbin-scripts
$(INSTALL) -g $(GROUP) -o $(OWNER) -m 755 lsznet.raw $(TOOLS_LIBDIR)
$(INSTALL) -g $(GROUP) -o $(OWNER) -m 755 znetcontrolunits \
$(TOOLS_LIBDIR)
@@ -26,6 +28,15 @@ install-scripts: $(SCRIPTS)
chmod 755 $(BINDIR)/$$i; \
done
+install-usrsbin-scripts: $(USRSBIN_SCRIPTS)
+ @for i in $^; do \
+ cat $$i | \
+ sed -e 's+%S390_TOOLS_VERSION%+$(S390_TOOLS_RELEASE)+' \
+ >$(USRSBINDIR)/$$i; \
+ chown $(OWNER).$(GROUP) $(USRSBINDIR)/$$i; \
+ chmod 755 $(USRSBINDIR)/$$i; \
+ done
+
install-manpages: $(MANPAGES)
@if [ ! -d $(MANDIR) ]; then \
mkdir -p $(MANDIR)/man8; \
@@ -38,4 +49,4 @@ install-manpages: $(MANPAGES)
install -o $(OWNER) -g $(GROUP) -m 644 $$i $(MANDIR)/man8; \
done
-.PHONY: all install clean install-scripts install-manpages
+.PHONY: all install clean install-scripts install-manpages install-usrsbin-scripts
diff --git a/zconf/chmem b/zconf/chmem
new file mode 100644
index 0000000..bdc25a4
--- /dev/null
+++ b/zconf/chmem
@@ -0,0 +1,325 @@
+#!/usr/bin/perl
+###############################################################################
+# chmem - script to show memory hotplug status.
+#
+# Copyright IBM Corp. 2010
+# Author(s): Gerald Schaefer <gerald.schaefer@de.ibm.com>
+###############################################################################
+
+use strict;
+use warnings;
+use Getopt::Long qw(:config no_ignore_case no_auto_abbrev);
+use File::Basename;
+
+my $script_name = fileparse($0);
+my $online = 0;
+my $offline = 0;
+my $memdir = "/sys/devices/system/memory";
+my $block_size = 0;
+my $total_blocks = 0;
+my $devices = {};
+my $dev_size;
+my $blocks_per_dev = 0;
+my $devs_per_block = 0;
+my $ret = 0;
+
+sub chmem_usage()
+{
+ print <<HERE;
+Usage: $script_name [OPTIONS] SIZE|RANGE
+
+The $script_name command sets a particular size or range of memory online
+or offline.
+
+Specify SIZE as <size>[m|M|g|G]. With m or M, <size> specifies the memory
+size in MB (1024 x 1024 bytes). With g or G, <size> specifies the memory size
+in GB (1024 x 1024 x 1024 bytes). The default unit is MB.
+
+Specify RANGE in the form 0x<start>-0x<end> as shown in the output of the
+lsmem command. <start> is the hexadecimal address of the first byte and <end>
+is the hexadecimal address of the last byte in the memory range.
+
+SIZE and RANGE must be aligned to the Linux memory block size, as shown in
+the output of the lsmem command.
+
+OPTIONS
+ -e, --enable
+ Set the given RANGE or SIZE of memory online.
+
+ -d, --disable
+ Set the given RANGE or SIZE of memory offline.
+
+ -h, --help
+ Print a short help text, then exit.
+
+ -v, --version
+ Print the version number, then exit.
+HERE
+}
+
+sub chmem_version()
+{
+ print "$script_name: version %S390_TOOLS_VERSION%\n";
+ print "Copyright IBM Corp. 2010\n";
+}
+
+sub chmem_get_dev_size()
+{
+ my $i = 0;
+ my $device = 0;
+ my $old_device = 0;
+
+ while (-d "$memdir/memory$i") {
+ $device = `cat $memdir/memory$i/phys_device`;
+ chomp($device);
+ if ($device > $old_device) {
+ $dev_size = int($dev_size / ($device - $old_device));
+ last;
+ }
+ $dev_size += $block_size;
+ $i++;
+ }
+}
+
+sub chmem_online($)
+{
+ my $block = shift;
+
+ qx(echo online > $memdir/memory$block/state 2>/dev/null);
+ return $? >> 8;
+}
+
+sub chmem_offline($)
+{
+ my $block = shift;
+
+ qx(echo offline > $memdir/memory$block/state 2>/dev/null);
+ return $? >> 8;;
+}
+
+sub chmem_read_attr($$$)
+# parameters: state, device, block
+{
+ my @attributes = qw(state phys_device);
+ foreach (0..1) {
+ $_[$_] = `cat $memdir/memory$_[2]/$attributes[$_]`;
+ chomp($_[$_]);
+ }
+}
+
+sub chmem_read_devices()
+{
+ my $i = 0;
+ my $device = 0;
+ my $old_device = 0;
+ my $blocks = 0;
+ my $state;
+
+ while (-d "$memdir/memory$i") {
+ chmem_read_attr($state, $device, $i);
+ if ($device != $old_device) {
+ $devices->{$old_device}->{'id'} = $old_device;
+ $devices->{$old_device}->{'blocks'} = $blocks;
+ $old_device = $device;
+ $blocks = 0;
+ }
+ if ($state eq "online") {
+ $blocks++;
+ }
+ $i++;
+ }
+ $devices->{$old_device}->{'blocks'} = $blocks;
+ $devices->{$old_device}->{'id'} = $old_device;
+}
+
+sub chmem_dev_action($$)
+{
+ my ($dev_id, $blocks) = @_;
+ my ($start_block, $end_block, $tmp_block, $max_blocks);
+ my $state;
+ my $i = 0;
+ my $count = 0;
+
+ if ($blocks_per_dev > 0) {
+ $start_block = $dev_id * $blocks_per_dev;
+ $end_block = $start_block + $blocks_per_dev - 1;
+ $max_blocks = $blocks_per_dev;
+ } else {
+ $start_block = int($dev_id / $devs_per_block);
+ $end_block = $start_block;
+ $max_blocks = 1;
+ }
+ if ($blocks > $max_blocks) {
+ $blocks = $max_blocks;
+ }
+ while ($count < $blocks && $i < $max_blocks) {
+ $tmp_block = $online ? $start_block + $i : $end_block - $i;
+ $state = `cat $memdir/memory$tmp_block/state`;
+ chomp($state);
+ if ($offline && $state eq "online") {
+ $count++ unless chmem_offline($tmp_block);
+ }
+ if ($online && $state eq "offline") {
+ $count++ unless chmem_online($tmp_block);
+ }
+ $i++;
+ }
+ return $count;
+}
+
+sub chmem_size($)
+{
+ my $size = shift;
+ my ($blocks, $dev_blocks, $dev_id);
+
+ $blocks = int($size / $block_size);
+ if ($online) {
+ foreach my $device (sort {$b->{'blocks'} <=> $a->{'blocks'} ||
+ $a->{'id'} <=> $b->{'id'}}
+ values %{$devices}) {
+ $dev_blocks = $device->{'blocks'};
+ $dev_id = $device->{'id'};
+ if ($dev_blocks < $blocks_per_dev || $dev_blocks == 0) {
+ $blocks -= chmem_dev_action($dev_id, $blocks);
+ if ($blocks == 0) {
+ last;
+ }
+ }
+ }
+ if ($blocks > 0) {
+ printf(STDERR "chmem: Could only set %lu MB of memory ".
+ "online.\n", $size - $blocks * $block_size);
+ $ret = 1;
+ }
+ } else {
+ foreach my $device (sort {$a->{'blocks'} <=> $b->{'blocks'} ||
+ $b->{'id'} <=> $a->{'id'}}
+ values %{$devices}) {
+ $dev_blocks = $device->{'blocks'};
+ $dev_id = $device->{'id'};
+ if ($dev_blocks > 0) {
+ $blocks -= chmem_dev_action($dev_id, $blocks);
+ if ($blocks == 0) {
+ last;
+ }
+ }
+ }
+ if ($blocks > 0) {
+ printf(STDERR "chmem: Could only set %lu MB of memory ".
+ "offline.\n", $size - $blocks * $block_size);
+ $ret = 1;
+ }
+ }
+}
+
+sub chmem_range($$)
+{
+ my ($start, $end) = @_;
+ my $block = 0;
+ my $state;
+
+ while ($start < $end && $block < $total_blocks - 1) {
+ $block = int($start / ($block_size << 20));
+ $state = `cat $memdir/memory$block/state`;
+ chomp($state);
+ if ($online && $state eq "offline") {
+ if (chmem_online($block)) {
+ printf(STDERR "chmem: Could not set ".
+ "0x%016x-0x%016x online\n", $start,
+ $start + ($block_size << 20) - 1);
+ $ret = 1;
+ }
+ }
+ if ($offline && $state eq "online") {
+ if (chmem_offline($block)) {
+ printf(STDERR "chmem: Could not set ".
+ "0x%016x-0x%016x offline\n", $start,
+ $start + ($block_size << 20) - 1);
+ $ret = 1;
+ }
+ }
+ $start += $block_size << 20;
+ }
+}
+
+sub chmem_check()
+{
+ unless (-d $memdir) {
+ die "chmem: No memory hotplug interface in sysfs ($memdir).\n";
+ }
+ $block_size = `cat $memdir/block_size_bytes`;
+ chomp($block_size);
+ if ($block_size =~ /(?:0x)?([[:xdigit:]]+)/) {
+ $block_size = unpack("Q", pack("H16",
+ substr("0" x 16 . $1, -16)));
+ $block_size = $block_size >> 20;
+ } else {
+ die "chmem: Unknown block size format in sysfs.\n";
+ }
+ if ($online == 0 && $offline == 0) {
+ die "chmem: Please specify one of the options -e or -d.\n";
+ }
+ if ($online == 1 && $offline == 1) {
+ die "chmem: You cannot specify both options -e and -d.\n";
+ }
+
+ while (-d "$memdir/memory$total_blocks") {
+ $total_blocks++;
+ }
+ chmem_get_dev_size();
+ if ($dev_size >= $block_size) {
+ $blocks_per_dev = int($dev_size / $block_size);
+ } else {
+ $devs_per_block = int($block_size / $dev_size);
+ }
+}
+
+sub chmem_action()
+{
+ my ($start, $end, $size, $unit);
+
+ if (!defined($ARGV[0])) {
+ die "chmem: Missing size or range.\n";
+ }
+ if ($ARGV[0] =~ /^0x([[:xdigit:]]+)-0x([[:xdigit:]]+)$/) {
+ $start = unpack("Q", pack("H16", substr("0" x 16 . $1, -16)));
+ $end = unpack("Q", pack("H16", substr("0" x 16 . $2, -16)));
+ if ($start % ($block_size << 20) ||
+ ($end + 1) % ($block_size << 20)) {
+ die "chmem: Start address and (end address + 1) must ".
+ "be aligned to memory block size ($block_size MB).\n";
+ }
+ chmem_range($start, $end);
+ } else {
+ if ($ARGV[0] =~ m/^(\d+)([mg]?)$/i) {
+ $size = $1;
+ $unit = $2 || "";
+ if ($unit =~ /g/i) {
+ $size = $size << 10;
+ }
+ if ($size % $block_size) {
+ die "chmem: Size must be aligned to memory ".
+ "block size ($block_size MB).\n";
+ }
+ chmem_size($size);
+ } else {
+ printf(STDERR "chmem: Invalid size or range: %s\n",
+ $ARGV[0]);
+ exit 1;
+ }
+ }
+}
+
+
+# Main
+unless (GetOptions('v|version' => sub {chmem_version(); exit 0;},
+ 'h|help' => sub {chmem_usage(); exit 0;},
+ 'e|enable' => \$online,
+ 'd|disable' => \$offline)) {
+ die "Try '$script_name --help' for more information.\n";
+};
+
+chmem_read_devices();
+chmem_check();
+chmem_action();
+exit $ret;
diff --git a/zconf/chmem.8 b/zconf/chmem.8
new file mode 100644
index 0000000..34bea3c
--- /dev/null
+++ b/zconf/chmem.8
@@ -0,0 +1,71 @@
+.TH CHMEM 8 "Apr 2010" "s390-tools"
+.
+.
+.SH NAME
+chmem \- set memory online or offline.
+.
+.SH SYNOPSIS
+.B chmem
+.RB OPTIONS
+.RB [SIZE|RANGE]
+.
+.
+.SH DESCRIPTION
+The chmem command sets a particular size or range of memory online or offline.
+.
+.IP "\(hy" 2
+Specify SIZE as <size>[m|M|g|G]. With m or M, <size> specifies the memory
+size in MB (1024 x 1024 bytes). With g or G, <size> specifies the memory size
+in GB (1024 x 1024 x 1024 bytes). The default unit is MB.
+.
+.IP "\(hy" 2
+Specify RANGE in the form 0x<start>-0x<end> as shown in the output of the
+lsmem command. <start> is the hexadecimal address of the first byte and <end>
+is the hexadecimal address of the last byte in the memory range.
+.
+.PP
+SIZE and RANGE must be aligned to the Linux memory block size, as shown in
+the output of the lsmem command.
+
+Setting memory online can fail if the hypervisor does not have enough memory
+left, for example because memory was overcommitted. Setting memory offline can
+fail if Linux cannot free the memory. If only part of the requested memory can
+be set online or offline, a message tells you how much memory was set online
+or offline instead of the requested amount.
+.
+.
+.SH OPTIONS
+.TP
+.BR \-h ", " \-\-help
+Print a short help text, then exit.
+.
+.TP
+.BR \-v ", " \-\-version
+Print the version number, then exit.
+.
+.TP
+.BR \-e ", " \-\-enable
+Set the given RANGE or SIZE of memory online.
+.
+.TP
+.BR \-d ", " \-\-disable
+Set the given RANGE or SIZE of memory offline.
+.
+.
+.SH EXAMPLES
+.TP
+.B chmem --enable 1024
+This command requests 1024 MB of memory to be set online.
+.
+.TP
+.B chmem -e 2g
+This command requests 2 GB of memory to be set online.
+.
+.TP
+.B chmem --disable 0x00000000e4000000-0x00000000f3ffffff
+This command requests the memory range starting with 0x00000000e4000000
+and ending with 0x00000000f3ffffff to be set offline.
+.
+.
+.SH SEE ALSO
+.BR lsmem (8)
diff --git a/zconf/lsmem b/zconf/lsmem
new file mode 100644
index 0000000..e6ed1fa
--- /dev/null
+++ b/zconf/lsmem
@@ -0,0 +1,158 @@
+#!/usr/bin/perl
+###############################################################################
+# lsmem - script to show memory hotplug status.
+#
+# Copyright IBM Corp. 2010
+# Author(s): Gerald Schaefer <gerald.schaefer@de.ibm.com>
+###############################################################################
+
+use strict;
+use warnings;
+use Getopt::Long qw(:config no_ignore_case no_auto_abbrev);
+use File::Basename;
+
+my $script_name = fileparse($0);
+my $memdir = "/sys/devices/system/memory";
+my $block_size = 0;
+my $list_all = 0;
+my $dev_size = 0;
+
+
+sub lsmem_read_attr($$$$)
+# parameters: state, rem, device, block_nr
+{
+ my @attributes = qw(state removable phys_device);
+ foreach (0..2) {
+ $_[$_] = `cat $memdir/memory$_[3]/$attributes[$_]`;
+ chomp($_[$_]);
+ }
+}
+
+sub lsmem_get_dev_size()
+{
+ my $i = 0;
+ my ($device, $old_device) = (0, 0);
+
+ while (-d "$memdir/memory$i") {
+ $device = `cat $memdir/memory$i/phys_device`;
+ chomp($device);
+ if ($device > $old_device) {
+ $dev_size = int($dev_size / ($device - $old_device));
+ last;
+ }
+ $dev_size += $block_size;
+ $i++;
+ }
+}
+
+sub lsmem_list()
+{
+ my $i = 0;
+ my ($start, $end, $size) = (0, 0, 0);
+ my ($state, $old_state) = (0, 0);
+ my ($rem, $old_rem) = (0, 0);
+ my ($device, $old_device) = (0, 0);
+ my ($mem_online, $mem_offline) = (0, 0);
+ my ($last_block, $end_dev) = (0, 0);
+
+ if (-d "$memdir/memory0") {
+ lsmem_read_attr($old_state, $old_rem, $old_device, 0);
+ } else {
+ die "lsmem: No memory hotplug interface in sysfs ($memdir).\n";
+ }
+
+ $block_size = `cat $memdir/block_size_bytes`;
+ chomp($block_size);
+ if ($block_size =~ /(?:0x)?([[:xdigit:]]+)/) {
+ $block_size = unpack("Q", pack("H16",
+ substr("0" x 16 . $1, -16)));
+ $block_size = $block_size >> 20;
+ } else {
+ die "lsmem: Unknown block size format in sysfs.\n";
+ }
+ lsmem_get_dev_size();
+
+ print <<HERE;
+Address Range Size (MB) State Removable Device
+===============================================================================
+HERE
+ while (-d "$memdir/memory$i") {
+ $i++;
+ if (-d "$memdir/memory$i") {
+ lsmem_read_attr($state, $rem, $device, $i);
+ } else {
+ $last_block = 1;
+ }
+ if ($state ne $old_state || $rem != $old_rem || $list_all ||
+ $last_block) {
+ $end = $i * ($block_size << 20) - 1;
+ $size = ($end - $start + 1) >> 20;
+ if ($old_state eq "going-offline") {
+ $old_state = "on->off";
+ }
+ printf("0x%016x-0x%016x %10lu %-7s ", $start, $end,
+ $size, $old_state);
+ if ($old_state eq "online") {
+ printf(" %-9s ", $old_rem ? "yes" : "no");
+ $mem_online += $size;
+ } else {
+ printf(" %-9s ", "-");
+ $mem_offline += $size;
+ }
+ $end_dev = ($end / $dev_size) >> 20;
+ if ($old_device == $end_dev) {
+ printf("%d\n", $old_device);
+ } else {
+ printf("%d-%d\n", $old_device, $end_dev);
+ }
+ $old_state = $state;
+ $old_rem = $rem;
+ $old_device = $device;
+ $start = $end + 1;
+ }
+ }
+ printf("\n");
+ printf("Memory device size : %lu MB\n", $dev_size);
+ printf("Memory block size : %lu MB\n", $block_size);
+ printf("Total online memory : %lu MB\n", $mem_online);
+ printf("Total offline memory: %lu MB\n", $mem_offline);
+}
+
+sub lsmem_usage()
+{
+ print <<HERE;
+Usage: $script_name [OPTIONS]
+
+The $script_name command lists the ranges of available memory with their online
+status. The listed memory blocks correspond to the memory block representation
+in sysfs. The command also shows the memory block size, the device size, and
+the amount of memory in online and offline state.
+
+OPTIONS
+ -a, --all
+ List each individual memory block, instead of combining memory blocks
+ with similar attributes.
+
+ -h, --help
+ Print a short help text, then exit.
+
+ -v, --version
+ Print the version number, then exit.
+HERE
+}
+
+sub lsmem_version()
+{
+ print "$script_name: version %S390_TOOLS_VERSION%\n";
+ print "Copyright IBM Corp. 2010\n";
+}
+
+
+# Main
+unless (GetOptions('v|version' => sub {lsmem_version(); exit 0;},
+ 'h|help' => sub {lsmem_usage(); exit 0;},
+ 'a|all' => \$list_all)) {
+ die "Try '$script_name --help' for more information.\n";
+};
+
+lsmem_list();
diff --git a/zconf/lsmem.8 b/zconf/lsmem.8
new file mode 100644
index 0000000..ed052ea
--- /dev/null
+++ b/zconf/lsmem.8
@@ -0,0 +1,69 @@
+.TH LSMEM 8 "Apr 2010" s390\-tools
+.
+.
+.SH NAME
+lsmem \- list the ranges of available memory with their online status.
+.
+.
+.SH SYNOPSIS
+.B lsmem
+.RB [OPTIONS]
+.
+.
+.SH DESCRIPTION
+The lsmem command lists the ranges of available memory with their online
+status. The listed memory blocks correspond to the memory block representation
+in sysfs. The command also shows the memory block size, the device size, and
+the amount of memory in online and offline state.
+.
+.SS "Column description"
+.
+.TP 4
+Address Range
+Start and end address of the memory range.
+.
+.TP 4
+Size
+Size of the memory range in MB (1024 x 1024 bytes).
+.
+.TP 4
+State
+Indication of the online status of the memory range. State on->off means
+that the address range is in transition from online to offline.
+.
+.TP 4
+Removable
+"yes" if the memory range can be set offline, "no" if it cannot be set offline.
+A dash ("\-") means that the range is already offline.
+.
+.TP 4
+Device
+Device number or numbers that correspond to the memory range.
+
+Each device represents a memory unit for the hypervisor in control of the
+memory. The hypervisor cannot reuse a memory unit unless the corresponding
+memory range is completely offline. For best memory utilization, each device
+should either be completely online or completely offline.
+
+The chmem command with the size parameter automatically chooses the best suited
+device or devices when setting memory online or offline. The device size depends
+on the hypervisor and on the amount of total online and offline memory.
+.
+.
+.SH OPTIONS
+.TP
+.BR \-a ", " \-\-all
+List each individual memory block, instead of combining memory blocks with
+similar attributes.
+.
+.TP
+.BR \-h ", " \-\-help
+Print a short help text, then exit.
+.
+.TP
+.BR \-v ", " \-\-version
+Print the version number, then exit.
+.
+.
+.SH SEE ALSO
+.BR chmem (8)
--
1.7.3.5

View File

@ -1,562 +0,0 @@
From 9d93b66b6eda5f3dbaf6804663af21927c3aab8f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 28 Jan 2011 14:17:36 +0100
Subject: [PATCH 52/61] dumpconf: Prevent re-IPL loop for dump on panic
Summary: dumpconf: Prevent re-IPL loop for dump on panic.
Description: A new keyword DELAY_MINUTES is introduced in the dumpconf.
configuration file. Using this keyword the activation of dumpconf
can be delayed in order to prevent potential re-IPL loops.
---
etc/init.d/dumpconf | 271 ++++++++++++++++++++++++++++++++++--------------
etc/sysconfig/dumpconf | 10 ++-
2 files changed, 202 insertions(+), 79 deletions(-)
diff --git a/etc/init.d/dumpconf b/etc/init.d/dumpconf
index 1dd898d..27f52e4 100755
--- a/etc/init.d/dumpconf
+++ b/etc/init.d/dumpconf
@@ -15,25 +15,48 @@
# chkconfig: 0123456 01 99
DUMP_CONFIG_FILE=/etc/sysconfig/dumpconf
+CMDFULL=$0
+CMD="dumpconf"
+LOCKFILE=/var/lock/subsys/$CMD
+PIDFILE=/var/run/$CMD.pid
ERRMSG="Check $DUMP_CONFIG_FILE!"
RETVAL=0
+BACKGROUND=0
+
+pr_info()
+{
+ if [ $BACKGROUND -eq 0 ]; then
+ echo "$@"
+ else
+ echo "$@" | logger -t dumpconf
+ fi
+}
+
+pr_error()
+{
+ if [ $BACKGROUND -eq 0 ]; then
+ echo "$@" >&2
+ else
+ echo "$@" | logger -t dumpconf
+ fi
+}
check_environment()
{
if [ ! -f $DUMP_CONFIG_FILE ]; then
- echo "no config file found: $DUMP_CONFIG_FILE"
+ pr_error "no config file found: $DUMP_CONFIG_FILE"
exit 1
fi
if [ "$(cat /proc/filesystems|grep sysfs)" = "" ]; then
- echo "no sysfs found" >&2
+ pr_error "no sysfs found"
exit 1
fi
SYSFSDIR=$(cat /proc/mounts|awk '$3=="sysfs"{print $2; exit}')
if [ "$SYSFSDIR" = "" ]; then
- echo "sysfs not mounted" >&2
+ pr_error "sysfs not mounted"
exit 1
fi
@@ -41,12 +64,12 @@ check_environment()
ON_PANIC_CONFIG_FILE=/$SYSFSDIR/firmware/shutdown_act\
ions/on_panic
if [ ! -d $DUMP_CONFIG_DIR ]; then
- echo "kernel has no dump on panic support"
+ pr_info "kernel has no dump on panic support"
exit 0
fi
REIPL_CONFIG_DIR=/$SYSFSDIR/firmware/reipl
if [ ! -d $REIPL_CONFIG_DIR ]; then
- echo "kernel has no dump on panic support"
+ pr_info "kernel has no dump on panic support"
exit 0
fi
VMCMD_CONFIG_DIR=/$SYSFSDIR/firmware/vmcmd
@@ -90,6 +113,43 @@ Try 'dumpconf --help' for more information.
EOF
}
+cleanup_pidfile()
+{
+ if [ $(ps $1 | grep $CMD | wc -l) -eq 0 ]; then
+ rm -f $PIDFILE
+ fi
+}
+
+handle_stop_request()
+{
+ rm -f $PIDFILE 2>/dev/null
+ exit 0
+}
+
+delay_activation()
+{
+ # Open lock file with file descriptor 123
+ exec 123>$LOCKFILE
+ if flock -n -x 123; then
+ if [ -f $PIDFILE ]; then
+ # concurrent process was faster
+ exit 0
+ fi
+ trap handle_stop_request TERM
+ echo $$ > $PIDFILE
+ else
+ # Nothing to do, "dumpconf start" is already in progress
+ exit 0
+ fi
+ # Close file descriptor 123
+ exec 123>&-
+ # Do multiple sleeps in order to be interruptible
+ for ((i=0; i < $DELAY_MINUTES * 60; i++)); do
+ sleep 1
+ done
+ rm -f $PIDFILE
+}
+
# $1: dump device bus id (e.g. 0.0.4711)
verify_ccw_dump_device()
{
@@ -98,7 +158,7 @@ verify_ccw_dump_device()
line=$(lsdasd $1)
fi
if [ "$line" == "" ]; then
- echo "WARNING: device $1 not found!"
+ pr_info "WARNING: device $1 not found!"
return 1
fi
found=false
@@ -115,7 +175,7 @@ verify_ccw_dump_device()
if [ $? == 0 ]; then
return 0
else
- echo "WARNING: $1 is no valid dump device!"
+ pr_info "WARNING: $1 is no valid dump device!"
return 1
fi
}
@@ -166,28 +226,28 @@ setup_device()
echo $DEV > $1/$2/device
else
RETVAL=1
- echo "ERROR: Invalid DEVICE '$DEVICE'." $ERRMSG >&2
+ pr_error "ERROR: Invalid DEVICE '$DEVICE'." $ERRMSG
return
fi
if [ $2 == "fcp" ]; then
echo $WWPN > $1/fcp/wwpn 2>/dev/null || RETVAL=1
if [ $RETVAL -eq 1 ]; then
- echo "ERROR: Invalid WWPN '$WWPN'." $ERRMSG >&2
+ pr_error "ERROR: Invalid WWPN '$WWPN'." $ERRMSG
return
fi
echo $LUN > $1/fcp/lun 2>/dev/null || RETVAL=1
if [ $RETVAL -eq 1 ]; then
- echo "ERROR: Invalid LUN '$LUN'." $ERRMSG >&2
+ pr_error "ERROR: Invalid LUN '$LUN'." $ERRMSG
return
fi
echo $BOOTPROG > $1/fcp/bootprog 2>/dev/null || RETVAL=1
if [ $RETVAL -eq 1 ]; then
- echo "ERROR: Invalid BOOTPROG '$BOOTPROG'." $ERRMSG >&2
+ pr_error "ERROR: Invalid BOOTPROG '$BOOTPROG'." $ERRMSG
return
fi
echo $BR_LBA > $1/fcp/br_lba 2>/dev/null || RETVAL=1
if [ $RETVAL -eq 1 ]; then
- echo "ERROR: Invalid BR_LBA '$BR_LBA'." $ERRMSG >&2
+ pr_error "ERROR: Invalid BR_LBA '$BR_LBA'." $ERRMSG
return
fi
fi
@@ -201,7 +261,7 @@ setup_nss_device()
setup_reipl()
{
if [ "$REIPL_TYPE" == "" ]; then
- echo "reipl on panic configured: Using default reipl values."
+ pr_info "reipl on panic configured: Using default reipl values."
return
fi
@@ -210,7 +270,7 @@ setup_reipl()
elif [ "$REIPL_TYPE" == "nss" ]; then
setup_nss_device $REIPL_CONFIG_DIR
else
- echo "ERROR: Unknown reipl type '$REIPL_TYPE'." $ERRMSG >&2
+ pr_error "ERROR: Unknown reipl type '$REIPL_TYPE'." $ERRMSG
RETVAL=1
return
fi
@@ -221,7 +281,7 @@ setup_reipl()
return
fi
- echo "$REIPL_TYPE reipl device configured."
+ pr_info "$REIPL_TYPE reipl device configured."
}
setup_dump()
@@ -229,7 +289,7 @@ setup_dump()
if [ "$DUMP_TYPE" == "ccw" ] || [ "$DUMP_TYPE" == "fcp" ]; then
setup_device $DUMP_CONFIG_DIR $DUMP_TYPE
elif [ "$DUMP_TYPE" != "none" ]; then
- echo "ERROR: Unknown dump type '$DUMP_TYPE'." $ERRMSG >&2
+ pr_error "ERROR: Unknown dump type '$DUMP_TYPE'." $ERRMSG
RETVAL=1
return
fi
@@ -241,7 +301,7 @@ setup_dump()
return
fi
- echo "$ON_PANIC on panic configured: Using $DUMP_TYPE dump device."
+ pr_info "$ON_PANIC on panic configured: Using $DUMP_TYPE dump device."
}
setup_on_panic_vmcmd()
@@ -257,69 +317,69 @@ setup_on_panic_vmcmd()
fi
done
if [ ! -d $VMCMD_CONFIG_DIR ]; then
- echo "ERROR: No vmcmd support. Are you running on LPAR?" >&2
+ pr_error "ERROR: No vmcmd support. Are you running on LPAR?"
RETVAL=1
elif [ "$VMCMD" == "" ]; then
- echo "ERROR: No VMCMD_x keyword specified." $ERRMSG >&2
+ pr_error "ERROR: No VMCMD_x keyword specified." $ERRMSG
RETVAL=1
else
echo -en "$VMCMD" | cat > $VMCMD_CONFIG_DIR/on_panic || RETVAL=1
fi
if [ $RETVAL -eq 0 ]; then
- echo "vmcmd on panic configured:"
- echo -e "$VMCMD"
+ pr_info "vmcmd on panic configured:"
+ pr_info -e "$VMCMD"
fi
}
print_fcp_device()
{
DEVICE=$(cat $1/fcp/device) || RETVAL=1
- echo "device..: $DEVICE"
+ pr_info "device..: $DEVICE"
WWPN=$(cat $1/fcp/wwpn) || RETVAL=1
- echo "wwpn....: $WWPN"
+ pr_info "wwpn....: $WWPN"
LUN=$(cat $1/fcp/lun) || RETVAL=1
- echo "lun.....: $LUN"
+ pr_info "lun.....: $LUN"
BOOTPROG=$(cat $1/fcp/bootprog) || RETVAL=1
- echo "bootprog: $BOOTPROG"
+ pr_info "bootprog: $BOOTPROG"
BR_LBA=$(cat $1/fcp/br_lba) || RETVAL=1
- echo "br_lba..: $BR_LBA"
+ pr_info "br_lba..: $BR_LBA"
}
print_ccw_device()
{
DEVICE=$(cat $1/ccw/device) || RETVAL=1
- echo "device..: $DEVICE"
+ pr_info "device..: $DEVICE"
}
print_nss_name()
{
NAME=$(cat $1/nss/device) || RETVAL=1
- echo "device..: $NAME"
+ pr_info "device..: $NAME"
}
status_dump()
{
CONF_DUMP_TYPE=$(cat $DUMP_CONFIG_DIR/dump_type) || RETVAL=1
if [ "$CONF_DUMP_TYPE" == "none" ]; then
- echo "type....: no dump device configured"
+ pr_info "type....: no dump device configured"
elif [ "$CONF_DUMP_TYPE" == "ccw" ]; then
- echo "type....: ccw"
+ pr_info "type....: ccw"
print_ccw_device $DUMP_CONFIG_DIR
verify_ccw_dump_device $(cat $DUMP_CONFIG_DIR/ccw/device)
elif [ "$CONF_DUMP_TYPE" == "fcp" ]; then
- echo "type....: fcp"
+ pr_info "type....: fcp"
print_fcp_device $DUMP_CONFIG_DIR
else
- echo "ERROR: Unknown dump device type '$CONF_DUMP_TYPE'!" >&2
- echo " Please check if you have the latest dumpconf package!" >&2
+ pr_error "ERROR: Unknown dump device type '$CONF_DUMP_TYPE'!"
+ pr_error " Please check if you have the latest dumpconf package!"
fi
}
status_reipl()
{
REIPL_TYPE=$(cat $REIPL_CONFIG_DIR/reipl_type) || RETVAL=1
- echo "type....: $REIPL_TYPE"
+ pr_info "type....: $REIPL_TYPE"
if [ "$REIPL_TYPE" == "ccw" ]; then
print_ccw_device $REIPL_CONFIG_DIR
elif [ "$REIPL_TYPE" == "fcp" ]; then
@@ -327,16 +387,16 @@ status_reipl()
elif [ "$REIPL_TYPE" == "nss" ]; then
print_nss_name $REIPL_CONFIG_DIR
else
- echo "ERROR: Unknown reipl device type '$REIPL_TYPE'!" >&2
- echo " Please check if you have the latest dumpconf package!" >&2
+ pr_error "ERROR: Unknown reipl device type '$REIPL_TYPE'!"
+ pr_error " Please check if you have the latest dumpconf package!"
fi
}
status_dump_reipl()
{
- echo -e "\ndump:"
+ pr_info -e "\ndump:"
status_dump
- echo -e "\nreipl:"
+ pr_info -e "\nreipl:"
status_reipl
}
@@ -345,33 +405,65 @@ status_vmcmd()
{
VMCMD=$(cat $VMCMD_CONFIG_DIR/on_panic) || RETVAL=1
if [ "$VMCMD" == "" ]; then
- echo "WARNING: No VM command specified!"
+ pr_info "WARNING: No VM command specified!"
else
- echo "---------------"
- echo "$VMCMD"
+ pr_info "---------------"
+ pr_info "$VMCMD"
fi
}
start()
{
+ if [ "$1" == "background" ]; then
+ BACKGROUND=1
+ fi
+ test -n "$DELAY_MINUTES" || DELAY_MINUTES=0
+ test "$DELAY_MINUTES" -ge 0 2>/dev/null || RETVAL=1
+ if [ $RETVAL -eq 1 ]; then
+ pr_error "ERROR: Invalid DELAY_MINUTES parameter" \
+ "'$DELAY_MINUTES'." $ERRMSG
+ return
+ fi
+ if [ $DELAY_MINUTES -gt 0 ]; then
+ if [ -f $PIDFILE ]; then
+ pr_info "A delayed instance of" $CMD \
+ "is already active."
+ return
+ fi
+ if [ $BACKGROUND -eq 1 ]; then
+ delay_activation
+ else
+ pr_info "The activation of dumpconf is being delayed" \
+ "for" $DELAY_MINUTES "minutes"
+ $CMDFULL start background > /dev/null 2>&1 &
+ return
+ fi
+ fi
if [ "$ON_PANIC" == "" ]; then
ON_PANIC="stop"
fi
- if [ "$ON_PANIC" == "reipl" ]; then
- setup_reipl
- elif [ "$ON_PANIC" == "dump" ] || [ "$ON_PANIC" == "dump_reipl" ]; then
- setup_dump
- elif [ "$ON_PANIC" == "vmcmd" ]; then
- setup_on_panic_vmcmd
- elif [ "$ON_PANIC" == "stop" ]; then
- echo "stop on panic configured."
- else
- echo "ERROR: Unknown 'on panic' type '$ON_PANIC'." $ERRMSG >&2
- RETVAL=1
- fi
+ case "$ON_PANIC" in
+ reipl)
+ setup_reipl
+ ;;
+ dump|dump_reipl)
+ setup_dump
+ ;;
+ vmcmd)
+ setup_on_panic_vmcmd
+ ;;
+ stop)
+ pr_info "stop on panic configured."
+ ;;
+ *)
+ pr_error "ERROR: Unknown 'on panic'" \
+ "type '$ON_PANIC'." $ERRMSG
+ RETVAL=1
+ ;;
+ esac
if [ $RETVAL -eq 1 ]; then
- return $RETVAL
+ return
fi
echo $ON_PANIC > $ON_PANIC_CONFIG_FILE 2> /dev/null || RETVAL=1
@@ -380,20 +472,21 @@ start()
if [ $RETVAL -eq 1 ]; then
echo stop > $ON_PANIC_CONFIG_FILE
- echo "ERROR: $ON_PANIC not supported by hardware!" >&2
+ pr_error "ERROR: $ON_PANIC not supported by hardware!"
fi
-
- return $RETVAL
}
stop()
{
+ if [ -f $PIDFILE ]; then
+ kill -TERM $(cat $PIDFILE)
+ fi
echo none > $DUMP_CONFIG_DIR/dump_type || RETVAL=1
echo stop > $ON_PANIC_CONFIG_FILE || RETVAL=1
if [ $RETVAL -eq 0 ]; then
- echo "Dump on panic is disabled now"
+ pr_info "Dump on panic is disabled now"
else
- echo "Disabling dump on panic failed" >&2
+ pr_error "Disabling dump on panic failed"
fi
return $RETVAL
}
@@ -401,34 +494,55 @@ stop()
status()
{
ON_PANIC=$(cat $ON_PANIC_CONFIG_FILE) || RETVAL=1
- echo "on_panic: $ON_PANIC"
- if [ "$ON_PANIC" == "vmcmd" ]; then
- status_vmcmd
- elif [ "$ON_PANIC" == "reipl" ]; then
- status_reipl
- elif [ "$ON_PANIC" == "dump" ]; then
- status_dump
- elif [ "$ON_PANIC" == "dump_reipl" ]; then
- status_dump_reipl
- elif [ "$ON_PANIC" != "stop" ]; then
- echo "ERROR: Unknown on_panic type '$ON_PANIC'" >&2
+ if [ -f $PIDFILE ]; then
+ pr_info "on_panic: $ON_PANIC - dumpconf activation is being" \
+ "delayed for $DELAY_MINUTES minutes"
+ else
+ pr_info "on_panic: $ON_PANIC"
fi
+ case "$ON_PANIC" in
+ vmcmd)
+ status_vmcmd
+ ;;
+ reipl)
+ status_reipl
+ ;;
+ dump)
+ status_dump
+ ;;
+ dump_reipl)
+ status_dump_reipl
+ ;;
+ stop)
+ ;;
+ *)
+ pr_error "ERROR: Unknown on_panic type '$ON_PANIC'"
+ ;;
+ esac
}
-if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
- printhelp
- exit 0
-elif [ "$1" = "-v" ] || [ "$1" = "--version" ]; then
- printversion
- exit 0
-fi
+case "$1" in
+ -h|--help)
+ printhelp
+ exit 0
+ ;;
+ -v|--version)
+ printversion
+ exit 0
+ ;;
+esac
check_environment
+# If system crashed, an invalid $PIDFILE might still exist
+if [ -f $PIDFILE ]; then
+ cleanup_pidfile $(cat $PIDFILE)
+fi
+
# See how we were called.
case "$1" in
start|restart|reload|force-reload|try-restart)
- start
+ start $2
;;
stop)
stop
@@ -439,6 +553,7 @@ case "$1" in
*)
print_invalid_option $1
RETVAL=1
+ ;;
esac
exit $RETVAL
diff --git a/etc/sysconfig/dumpconf b/etc/sysconfig/dumpconf
index cef621b..155a2cc 100644
--- a/etc/sysconfig/dumpconf
+++ b/etc/sysconfig/dumpconf
@@ -13,13 +13,19 @@
# /sys/firmware/reipl
#
-#
+# For the actions "reipl" and "dump_reipl" the DELAY_MINUTES keyword may
+# be used to delay the activation of dumpconf.
+# Thus potential reipl loops caused by kernel panics
+# which persistently occur early in the boot process can be prevented.
+
# Dump on ccw device (DASD) and re-IPL after dump is complete.
# The re-IPL device, as specified under "/sys/firmware/reipl", is used.
+# The activation of dumpconf is delayed by 5 minutes.
#
# ON_PANIC=dump_reipl
# DUMP_TYPE=ccw
# DEVICE=0.0.4e13
+# DELAY_MINUTES=5
#
# Dump on fcp device (SCSI Disk)
@@ -48,5 +54,7 @@
#
# Re-IPL on panic
# The re-IPL device, as specified under "/sys/firmware/reipl", is used.
+# Since the DELAY_MINUTES keyword is omitted, there is no delay and
+# dumpconf becomes active immediately during system startup.
#
# ON_PANIC=reipl
--
1.7.3.5

View File

@ -1,410 +0,0 @@
From bc6e654149018090b7954e6667d3c7e7654625f6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 28 Jan 2011 14:18:39 +0100
Subject: [PATCH 53/61] ttyrun: run a program if a terminal device is available
Summary: ttyrun: run a program if a terminal device is available
Description: Depending on your setup, Linux on System z might or might not
provide a particular terminal or console. ttyrun safely starts
getty programs and prevents respawns through the init program
if a terminal is not available.
---
iucvterm/doc/Makefile | 2 +-
iucvterm/doc/ttyrun.8 | 146 +++++++++++++++++++++++++++++++++++++++
iucvterm/src/Makefile | 11 +++-
iucvterm/src/ttyrun.c | 183 +++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 339 insertions(+), 3 deletions(-)
create mode 100644 iucvterm/doc/ttyrun.8
create mode 100644 iucvterm/src/ttyrun.c
diff --git a/iucvterm/doc/Makefile b/iucvterm/doc/Makefile
index 5815f21..a646765 100644
--- a/iucvterm/doc/Makefile
+++ b/iucvterm/doc/Makefile
@@ -2,7 +2,7 @@
include ../../common.mak
-MANS = iucvconn.1 iucvtty.1 ts-shell.1 hvc_iucv.9 chiucvallow.8
+MANS = iucvconn.1 iucvtty.1 ts-shell.1 hvc_iucv.9 chiucvallow.8 ttyrun.8
all:
diff --git a/iucvterm/doc/ttyrun.8 b/iucvterm/doc/ttyrun.8
new file mode 100644
index 0000000..fc7a16f
--- /dev/null
+++ b/iucvterm/doc/ttyrun.8
@@ -0,0 +1,146 @@
+.\" ttyrun.8
+.\"
+.\"
+.\" Copyright IBM Corp. 2010
+.\" Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
+.\" -------------------------------------------------------------------------
+.TH "ttyrun" "8" "April 2010" "s390-tools" "System Management Commands"
+.LO 8
+.
+.ds s ttyrun
+.
+.
+.SH NAME
+ttyrun \- Start a program if a specified terminal device is available
+.
+.
+.
+.SH SYNOPSIS
+.B \*s
+.RB [ \-e | \-\-exitstatus
+.IR status ]
+.I term
+.I program
+.RI [ "program_options" ]
+.br
+.B \*s
+.RB [ \-h | \-\-help ]
+.br
+.B \*s
+.RB [ \-v | \-\-version ]
+.
+.
+.
+.SH DESCRIPTION
+\fB\*s\fP is typically started during system initialization and is used
+to prevent a respawn through the
+.BR init (8)
+program when a terminal is not available.
+
+\fIterm\fP is the name of the terminal device and is a path relative to
+the \f(CW/dev\fP directory, for example, specify \f(CWhvc0\fP for
+\f(CW/dev/hvc0\fP.
+.br
+If the specified terminal device can be opened, \fB\*s\fP starts the
+specified program.
+
+If the terminal device cannot be opened, the behavior of \fB\*s\fP
+depends on the \fB\-e\fP option:
+.
+.RS 2
+.IP "\(bu" 2
+If the \fB\-e\fP option has been specified, \fB\*s\fP exits with the
+specified return value, or
+.IP "\(bu" 2
+If the \fB\-e\fP option has not been specified, \fB\*s\fP sleeps until
+it receives a signal that causes an exit.
+.RE
+.PP
+\fIprogram\fP is an absolute path to the program to be started by
+\fB\*s\fP and \fIprogram_options\fP specify additional arguments.
+Depending on the program, arguments might be required. The variable
+\f(CW%t\fP in the \fIprogram_options\fP is resolved to the terminal
+device specified with \fIterm\fP.
+.
+.
+.
+.SH OPTIONS
+.TP
+.BR \-e ", " \-\-exitstatus\~\fIstatus\fP
+Specifies an exit status that is returned when the terminal device
+is not available. \fIstatus\fP must be an integer in the range 1 to 255.
+
+You can use this status value in an upstart job file to prevent
+respawning.
+.
+.TP
+.BR \-h ", " \-\-help
+Displays a short help text, then exits.
+.
+.TP
+.BR \-v ", " \-\-version
+Displays the version number of \fB\*s\fP, then exits.
+.
+.
+.
+.SH "RETURN VALUES"
+\fB\*s\fP exits with one of the following return values to report an
+error condition:
+.TP
+.B 1
+\fB\*s\fP has been started with an argument that is not valid or
+required but missing.
+.TP
+.B 2
+\fB\*s\fP could open the file specified for \fIterm\fP but the
+file is not a terminal device.
+.TP
+.B 3
+\fB\*s\fP could not start the specified program.
+.PP
+The return values 1 to 3 might also be returned when the \fB\-e\fP
+option is used and the terminal device is not available.
+.TP
+.B 4 \- 255
+The terminal device is not available and the \fB\-e\fP option
+specifies an exit status in this range.
+.
+.
+.
+.SH "EXAMPLES"
+.SS inittab
+To start \fB/sbin/agetty\fP on terminal device "hvc1", specify:
+.PP
+.ft CW
+.in +0.25in
+.nf
+h1:2345:respawn:/sbin/\*s hvc1 /sbin/agetty -L 9600 %t linux
+.fi
+.in -0.25in
+.ft
+.
+.SS upstart job/event files
+To start \fB/sbin/agetty\fP on terminal device "hvc1", add the following
+settings to the job file:
+.PP
+.ft CW
+.in +0.25in
+.nf
+respawn
+normal exit 42
+exec /sbin/\*s -e 42 hvc1 /sbin/agetty -L 9600 %t linux
+.fi
+.in -0.25in
+.ft
+.PP
+With the normal exit statement, you specify an exit status that will
+prevent upstart from respawning the program. To prevent respawning with
+\fB\*s\fP, you must specify the same value for the \fB\-e\fP option.
+.
+.
+.
+.SH "SEE ALSO"
+.BR agetty (8),
+.BR mingetty (8),
+.BR inittab (5),
+.BR events (5)
diff --git a/iucvterm/src/Makefile b/iucvterm/src/Makefile
index f1f8f7c..369c887 100644
--- a/iucvterm/src/Makefile
+++ b/iucvterm/src/Makefile
@@ -11,20 +11,27 @@ CPPFLAGS += -DUSE_NLS -DGETTEXT_TEXTDOMAIN=\"$(GETTEXT_TEXTDOMAIN)\"
#CPPFLAGS += -D__DEBUG__
PROGRAMS = iucvconn iucvtty
+SYSTOOLS = ttyrun
-all: $(PROGRAMS)
+all: $(PROGRAMS) $(SYSTOOLS)
check:
install:
for prg in $(PROGRAMS); do \
$(INSTALL) -g $(GROUP) -o $(OWNER) -m 755 $$prg $(USRBINDIR) ; \
done
+ for prg in $(SYSTOOLS); do \
+ $(INSTALL) -g $(GROUP) -o $(OWNER) -m 755 $$prg $(BINDIR) ; \
+ done
clean:
- -rm -f *.o $(PROGRAMS)
+ -rm -f *.o $(PROGRAMS) $(SYSTOOLS)
iucvconn: iucvconn.o getopt.o auditlog.o functions.o
iucvtty: LDLIBS = -lutil
iucvtty: iucvtty.o getopt.o auditlog.o functions.o
+ttyrun: GETTEXT_TEXTDOMAIN = ttyrun
+ttyrun: ttyrun.o
+
.PHONY: install clean
diff --git a/iucvterm/src/ttyrun.c b/iucvterm/src/ttyrun.c
new file mode 100644
index 0000000..55c2bc2
--- /dev/null
+++ b/iucvterm/src/ttyrun.c
@@ -0,0 +1,183 @@
+/*
+ * ttyrun - Start a program if a specified terminal device is available
+ *
+ *
+ * ttyrun is typically used to prevent a respawn through the init(8)
+ * program when a terminal is not available.
+ * ttyrun runs the specific program if the specified terminal device
+ * can be opened successfully. Otherwise the program enters a sleep or
+ * exits with a specified return value.
+ *
+ * Example: To start /sbin/agetty on terminal device hvc1, use:
+ *
+ * h1:2345:respawn:/sbin/ttyrun hvc1 /sbin/agetty -L 9600 %t linux
+ *
+ * Note: %t is resolved to the terminal device "hvc1" before /sbin/agetty
+ * is started.
+ *
+ * Return values:
+ * 1 - invalid argument or parameter is missing
+ * 2 - terminal does not resolve to a terminal device
+ * 3 - starting the specified program failed
+ * 1..255 - terminal is not available and the return code is
+ * specified with the -e option
+ *
+ * Copyright IBM Corp. 2010
+ * Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
+ */
+#include <errno.h>
+#include <getopt.h>
+#include <limits.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <syslog.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include "zt_common.h"
+
+
+#define TTY_ESCAPE_STR "%t"
+
+#define EXIT_INVALID_ARG 1
+#define EXIT_NO_TERMINAL 2
+#define EXIT_EXEC_FAILED 3
+
+
+static const char usage[] =
+"Usage: %s [-e status] <term> <program> [<program_options>]\n"
+" %s [-h|--help] [-v|--version]\n"
+"\n"
+"Start the program if the specified terminal device is available.\n"
+"If the terminal device cannot be opened, sleep until a signal is received\n"
+"that causes an exit or exit with the return value specified with status.\n"
+"\n"
+"-e, --exitstatus Specifies an exit status in the range 1 to 255.\n"
+"-h, --help Displays this help, then exits.\n"
+"-v, --version Displays version information, then exits.\n";
+
+static void help_exit(const char *prg)
+{
+ printf(usage, prg, prg);
+ exit(EXIT_SUCCESS);
+}
+
+static void version_exit(const char *prg)
+{
+ printf("%s: Start a program if a terminal device is available, "
+ "version %s\n", prg, RELEASE_STRING);
+ printf("Copyright IBM Corp. 2010\n");
+ exit(EXIT_SUCCESS);
+}
+
+static void err_exit(const char *prg, const char *msg)
+{
+ fprintf(stderr, "%s: %s\n", prg, msg);
+ exit(EXIT_INVALID_ARG);
+}
+
+static void wait_and_exit(void)
+{
+ /* sleep until a signal is received, then exit */
+ pause();
+ exit(EXIT_SUCCESS);
+}
+
+static const struct option prog_opts[] = {
+ { "help", no_argument, NULL, 'h'},
+ { "version", no_argument, NULL, 'v'},
+ { "exitstatus", required_argument, NULL, 'e'},
+ { NULL, no_argument, NULL, 0 },
+};
+
+int main(int argc, char *argv[])
+{
+ int rc, tty, i, c, index, done, term_index;
+ char terminal[PATH_MAX] = "";
+ unsigned long exitstatus;
+
+
+ /* parse command options */
+ if (argc == 1)
+ err_exit(argv[0], "One or more options are required but missing");
+
+ exitstatus = done = term_index = 0;
+ while (!done) {
+ c = getopt_long(argc, argv, "-hve:", prog_opts, NULL);
+ switch (c) {
+ case -1:
+ done = 1;
+ break;
+ case 1:
+ /* the first non-optional argument must be the
+ * terminal device */
+ if (!strncmp(optarg, "/", 1))
+ strncpy(terminal, optarg, PATH_MAX - 1);
+ else
+ snprintf(terminal, PATH_MAX, "/dev/%s", optarg);
+ terminal[PATH_MAX - 1] = 0;
+ term_index = optind - 1;
+ done = 1;
+ break;
+ case 'e':
+ errno = 0;
+ exitstatus = strtoul(optarg, (char **) NULL, 10);
+ if (errno == ERANGE)
+ err_exit(argv[0], "The exit status must be "
+ "an integer in the range 1 to 255");
+
+ if (!exitstatus || exitstatus > 255)
+ err_exit(argv[0], "The exit status must be "
+ "in the range 1 to 255");
+ break;
+ case 'h':
+ help_exit(argv[0]);
+ case 'v':
+ version_exit(argv[0]);
+ case '?':
+ fprintf(stderr, "Try %s --help for more information\n",
+ argv[0]);
+ exit(EXIT_INVALID_ARG);
+ }
+ }
+ index = optind;
+
+ /* check terminal */
+ if (!strlen(terminal))
+ err_exit(argv[0], "You must specify the name of "
+ "a terminal device");
+
+ /* any program to start? */
+ if (index == argc)
+ err_exit(argv[0], "You must specify a program to start");
+
+ /* open and check terminal device */
+ tty = open(terminal, O_NOCTTY | O_RDONLY | O_NONBLOCK);
+ if (tty == -1) {
+ openlog(argv[0], LOG_PID, LOG_DAEMON);
+ syslog(LOG_INFO, "Could not open tty %s (%s)", terminal,
+ strerror(errno));
+ closelog();
+
+ /* enter wait or exit */
+ if (exitstatus)
+ exit(exitstatus);
+ wait_and_exit();
+ }
+ rc = !isatty(tty);
+ close(tty);
+ if (rc)
+ exit(EXIT_NO_TERMINAL);
+
+ /* start getty program */
+ for (i = index; i < argc; i++)
+ if (!strcmp(argv[i], TTY_ESCAPE_STR) && term_index)
+ argv[i] = argv[term_index];
+ if (execv(argv[index], argv + index))
+ exit(EXIT_EXEC_FAILED);
+
+ exit(EXIT_SUCCESS);
+}
--
1.7.3.5

File diff suppressed because it is too large Load Diff

View File

@ -1,91 +0,0 @@
From 7700e2333725199a42d929ceb7af803c609df196 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 28 Jan 2011 14:22:16 +0100
Subject: [PATCH 55/61] znetconf: support for OSA CHPID types OSX and OSM
Summary: znetconf: support for OSA CHPID types OSX and OSM
Description: New feature to enable znetconf to support the
new OSA CHPID types OSX and OSM.
---
zconf/lsznet.raw | 12 ++++++++++++
zconf/znetcontrolunits | 6 +++++-
2 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/zconf/lsznet.raw b/zconf/lsznet.raw
index 9821ba3..a9f1247 100755
--- a/zconf/lsznet.raw
+++ b/zconf/lsznet.raw
@@ -41,6 +41,8 @@ readonly -a CU_CARDTYPE=(
"LCS OSA"
"LCS CLAW"
"OSN"
+ "OSX"
+ "OSM"
)
readonly -a CU_DEVNAME=(
@@ -53,6 +55,8 @@ readonly -a CU_DEVNAME=(
eth
eth
osn
+ eth
+ eth
)
readonly -a CU_GROUPCHANNELS=(
@@ -65,6 +69,8 @@ readonly -a CU_GROUPCHANNELS=(
2
2
3
+ 3
+ 3
)
readonly -a CHPIDTYPES=(
@@ -72,6 +78,8 @@ readonly -a CHPIDTYPES=(
[0x11]=OSD
[0x15]=OSN
[0x24]=IQD
+ [0x30]=OSM
+ [0x31]=OSX
)
# whitelist of network devices for TCP/IP stack, e.g. for Linux installers
@@ -83,6 +91,10 @@ readonly -a CU_TCPIP=(
3088/1e
3088/01
3088/60
+ 3088/61
+ 1731/06
+ 1731/02
+ 1731/02
)
readonly PREFIXFORMAT=[[:xdigit:]]*
diff --git a/zconf/znetcontrolunits b/zconf/znetcontrolunits
index e54e34b..7ee65f7 100644
--- a/zconf/znetcontrolunits
+++ b/zconf/znetcontrolunits
@@ -23,6 +23,8 @@ readonly -a CU=(
3088/60
3088/61
1731/06
+ 1731/02
+ 1731/02
)
readonly -a CU_DEVDRV=(
@@ -33,7 +35,9 @@ readonly -a CU_DEVDRV=(
ctcm
lcs
lcs
- lcs
+ claw
+ qeth
+ qeth
qeth
)
--
1.7.3.5

View File

@ -1,68 +0,0 @@
From ed12fec98c2365593e3b8bac14701112051028ad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 28 Jan 2011 14:24:23 +0100
Subject: [PATCH 56/61] iucvtty: do not specify z/VM user ID as argument to login -h
Description: iucvtty: do not specify z/VM user ID as argument to login -h
Symptom: When establishing a terminal connection to an iucvtty
instance on a target system, iucvconn disconnects due to a
timeout of the login program. Users are not able to log in.
Problem: iucvtty passes the z/VM user ID of the originating guest
virtual machine as argument to the -h option of the login
program. The -h option specifies a host name that is used
when writing [uw]tmp records. Depending on the implementation
of the login program, login calls gethostbyname() to get the
FQDN of the hostname. If the target system does not have any
working network connection, the DNS query times out. The DNS
timeout might be greater than the timeout the login program
waits for user input. The login timeout is caused by a SIGALRM
signal that is registered before login calls gethostbyname().
If the DNS timeout is greater, login exits.
Solution: Do not specify the z/VM user ID when iucvtty starts the login
program. The workaround to avoid timeouts is to explicitly
specify the login program when starting iucvtty.
For example, use "iucvtty TERMID -- /bin/login".
---
iucvterm/src/iucvtty.c | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/iucvterm/src/iucvtty.c b/iucvterm/src/iucvtty.c
index b9a2754..ef7e212 100644
--- a/iucvterm/src/iucvtty.c
+++ b/iucvterm/src/iucvtty.c
@@ -48,21 +48,15 @@ static void sig_handler(int sig)
/**
* exec_login_prog() - execute a login program
* @cmd: Path to the (login) program executable
- * @host: Originator host that is passed to /bin/login
*/
-static int exec_login_prog(char *cmd[], const char *host)
+static int exec_login_prog(char *cmd[])
{
int rc;
if (cmd != NULL)
rc = execv(cmd[0], cmd);
else
- /* for root only: write hostname to [uw]tmp if set */
- if (geteuid() == 0 && host != NULL)
- rc = execl("/bin/login", "/bin/login", "-h", host,
- (char *) NULL);
- else
- rc = execl("/bin/login", "/bin/login", (char *) NULL);
+ rc = execl("/bin/login", "/bin/login", (char *) NULL);
return rc;
}
@@ -110,7 +104,7 @@ static int iucvtty_worker(int client, int master, int slave,
exit(2);
}
setenv("TERM", term_env, 1);
- if (exec_login_prog(cfg->cmd_parms, host)) {
+ if (exec_login_prog(cfg->cmd_parms)) {
print_error("Running the login program failed");
iucvtty_tx_error(client, ERR_CANNOT_EXEC_LOGIN);
}
--
1.7.3.5

View File

@ -1,340 +0,0 @@
From a3fd27a0ce5920b66afbf89cb83a9b61db9460c7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 28 Jan 2011 14:26:53 +0100
Subject: [PATCH 57/61] tunedasd: add new option -Q / --query_reserve
Summary: tunedasd: add new option -Q / --query_reserve
Description: The new option -Q / --query_reserve uses the BIODASDSNID ioctl to
determine the device reservation status for the given device and
prints it to stdout.
---
tunedasd/include/disk.h | 1 +
tunedasd/man/tunedasd.8 | 22 +++++++++-
tunedasd/src/disk.c | 65 +++++++++++++++++++++++++++++
tunedasd/src/tunedasd.c | 104 +++++++++++++++++++++++++++--------------------
4 files changed, 147 insertions(+), 45 deletions(-)
diff --git a/tunedasd/include/disk.h b/tunedasd/include/disk.h
index 4b98fb0..ece8cb5 100644
--- a/tunedasd/include/disk.h
+++ b/tunedasd/include/disk.h
@@ -25,6 +25,7 @@ int disk_set_cache (char* device, char* cache, char* no_cyl);
int disk_reserve (char* device);
int disk_release (char* device);
int disk_slock (char* device);
+int disk_query_reserve_status(char* device);
int disk_profile (char* device, char* prof_item);
int disk_reset_prof (char* device);
diff --git a/tunedasd/man/tunedasd.8 b/tunedasd/man/tunedasd.8
index 2d99bdc..a96913e 100644
--- a/tunedasd/man/tunedasd.8
+++ b/tunedasd/man/tunedasd.8
@@ -66,7 +66,6 @@ Enterprise Storage Servers (ESS):
(Record Access)
.IP "" 7
More details about caching can be found in the 'Storage Control Reference' of the attached storage server.
-
.TP
.BR "\-n" " or " "\-\-no_cyl" " <n> "
Number of cylinders to be cached (only valid together with --cache).
@@ -91,6 +90,27 @@ Profile info must be available and enabled
('echo set on > /proc/dasd/statistics')
in the kernel to get valid results out of the profile commands.
.TP
+.BR "\-Q" " or " "\-\-query_reserve"
+Query the current reserve status of the device.
+The following states are defined:
+.br
+.IP " \(bu" 12
+.I none:
+The device is not reserved.
+.IP " \(bu" 12
+.I implicit:
+The device is not reserved, but there is a contingent or implicit
+allegiance to this Linux instance.
+.IP " \(bu" 12
+.I other:
+The device is reserved to another operating system instance.
+.IP " \(bu" 12
+.I reserved:
+The device is reserved to this Linux instance.
+.IP "" 7
+More details about reserve/release can be found in the 'Storage Control Reference' of the attached storage server.
+
+.TP
.BR "\-I" " or " "\-\-prof_item <row> "
Print single profile item data row (without header).
.br
diff --git a/tunedasd/src/disk.c b/tunedasd/src/disk.c
index afbe851..3eaa4f3 100644
--- a/tunedasd/src/disk.c
+++ b/tunedasd/src/disk.c
@@ -68,6 +68,25 @@ typedef struct attrib_data_t {
#define DASD_REC_ACCESS 0x5
/*
+ * Data returned by Sense Path Group ID (SNID)
+ */
+struct dasd_snid_data {
+ struct {
+ __u8 group:2;
+ __u8 reserve:2;
+ __u8 mode:1;
+ __u8 res:3;
+ } __attribute__ ((packed)) path_state;
+ __u8 pgid[11];
+} __attribute__ ((packed));
+
+struct dasd_snid_ioctl_data {
+ struct dasd_snid_data data;
+ __u8 path_mask;
+} __attribute__ ((packed));
+
+
+/*
* DASD-IOCTLs (copied from dasd.h)
*/
/* Issue a reserve/release command, rsp. */
@@ -85,6 +104,9 @@ typedef struct attrib_data_t {
/* Set Attributes (cache operations) */
#define BIODASDSATTR _IOW (DASD_IOCTL_LETTER,2,attrib_data_t)
+/* Get Sense Path Group ID (SNID) data */
+#define BIODASDSNID _IOWR(DASD_IOCTL_LETTER, 1, struct dasd_snid_ioctl_data)
+
/* id definition for profile items */
enum prof_id {
@@ -378,6 +400,49 @@ disk_slock (char* device)
return 0;
}
+
+/*
+ * Uses the Sense Path Group ID (SNID) ioctl to find out if
+ * a device is reserved to it's path group.
+ */
+int
+disk_query_reserve_status(char* device)
+{
+ int fd;
+ struct dasd_snid_ioctl_data snid;
+
+ /* Open device file */
+ fd = open (device, O_RDONLY);
+ if (fd == -1) {
+ error_print ("<%s> - %s", device, strerror (errno));
+ return -1;
+ }
+ snid.path_mask = 0;
+ /* Release device */
+ if (ioctl(fd, BIODASDSNID, &snid)) {
+ error_print("Could not read reserve status"
+ " for device <%s>", device);
+ close (fd);
+ return -1;
+ }
+ switch (snid.data.path_state.reserve) {
+ case 0:
+ printf("none\n");
+ break;
+ case 1:
+ printf("implicit\n");
+ break;
+ case 2:
+ printf("other\n");
+ break;
+ case 3:
+ printf("reserved\n");
+ break;
+ }
+ close (fd);
+ return 0;
+}
+
int
disk_profile_summary (dasd_profile_info_t dasd_profile_info)
{
diff --git a/tunedasd/src/tunedasd.c b/tunedasd/src/tunedasd.c
index 05e0344..fbb7a1e 100644
--- a/tunedasd/src/tunedasd.c
+++ b/tunedasd/src/tunedasd.c
@@ -47,6 +47,7 @@ static const char* usage_text[] = {
"-O, --slock Unconditional reserve device",
" Note: Use with care, this breaks an existing "
"lock",
+ "-Q, --query_reserve Print reserve status of device ",
"-P, --profile Print profile info of device",
"-I, --prof_item Print single profile item",
" (reqs/sects/sizes/total/totsect/start/irq/",
@@ -54,21 +55,22 @@ static const char* usage_text[] = {
"-R, --reset_prof Reset profile info of device"
};
-#define CMD_KEYWORD_NUM 11
+#define CMD_KEYWORD_NUM 12
#define DEVICES_NUM 256
enum cmd_keyword_id {
- cmd_keyword_help = 0,
- cmd_keyword_version = 1,
- cmd_keyword_get_cache = 2,
- cmd_keyword_cache = 3,
- cmd_keyword_no_cyl = 4,
- cmd_keyword_reserve = 5,
- cmd_keyword_release = 6,
- cmd_keyword_slock = 7,
- cmd_keyword_profile = 8,
- cmd_keyword_prof_item = 9,
- cmd_keyword_reset_prof = 10,
+ cmd_keyword_help = 0,
+ cmd_keyword_version = 1,
+ cmd_keyword_get_cache = 2,
+ cmd_keyword_cache = 3,
+ cmd_keyword_no_cyl = 4,
+ cmd_keyword_reserve = 5,
+ cmd_keyword_release = 6,
+ cmd_keyword_slock = 7,
+ cmd_keyword_profile = 8,
+ cmd_keyword_prof_item = 9,
+ cmd_keyword_reset_prof = 10,
+ cmd_keyword_query_reserve = 11,
};
@@ -77,17 +79,18 @@ static const struct {
char* keyword;
enum cmd_keyword_id id;
} keyword_list[] = {
- { "help", cmd_keyword_help },
- { "version", cmd_keyword_version },
- { "get_cache", cmd_keyword_get_cache },
- { "cache", cmd_keyword_cache },
- { "no_cyl", cmd_keyword_no_cyl },
- { "reserve", cmd_keyword_reserve },
- { "release", cmd_keyword_release },
- { "slock", cmd_keyword_slock },
- { "profile", cmd_keyword_profile },
- { "prof_item", cmd_keyword_prof_item },
- { "reset_prof", cmd_keyword_reset_prof }
+ { "help", cmd_keyword_help },
+ { "version", cmd_keyword_version },
+ { "get_cache", cmd_keyword_get_cache },
+ { "cache", cmd_keyword_cache },
+ { "no_cyl", cmd_keyword_no_cyl },
+ { "reserve", cmd_keyword_reserve },
+ { "release", cmd_keyword_release },
+ { "slock", cmd_keyword_slock },
+ { "profile", cmd_keyword_profile },
+ { "prof_item", cmd_keyword_prof_item },
+ { "reset_prof", cmd_keyword_reset_prof },
+ { "query_reserve", cmd_keyword_query_reserve }
};
@@ -100,21 +103,22 @@ enum cmd_key_state {
/* Determines which combination of keywords are valid */
enum cmd_key_state cmd_key_table[CMD_KEYWORD_NUM][CMD_KEYWORD_NUM] = {
- /* help vers get_ cach no_c rese rele sloc prof prof rese
- * ion cach e yl rve ase k ile _ite t_pr
- * e m of
- */
- /* help */ { req, opt, opt, opt, opt, opt, opt, opt, opt, opt, opt },
- /* version */ { inv, req, inv, inv, inv, inv, inv, inv, inv, inv, inv },
- /* get_cache */ { opt, opt, req, inv, inv, inv, inv, inv, inv, inv, inv },
- /* cache */ { opt, opt, inv, req, opt, inv, inv, inv, inv, inv, inv },
- /* no_cyl */ { opt, opt, inv, req, req, inv, inv, inv, inv, inv, inv },
- /* reserve */ { opt, opt, inv, inv, inv, req, inv, inv, inv, inv, inv },
- /* release */ { opt, opt, inv, inv, inv, inv, req, inv, inv, inv, inv },
- /* slock */ { opt, opt, inv, inv, inv, inv, inv, req, inv, inv, inv },
- /* profile */ { opt, opt, inv, inv, inv, inv, inv, inv, req, opt, inv },
- /* prof_item */ { opt, opt, inv, inv, inv, inv, inv, inv, req, req, inv },
- /* reset_prof */ { opt, opt, inv, inv, inv, inv, inv, inv, inv, inv, req },
+ /* help vers get_ cach no_c rese rele sloc prof prof rese quer
+ * ion cach e yl rve ase k ile _ite t_pr y_re
+ * e m of serv
+ */
+ /* help */ { req, opt, opt, opt, opt, opt, opt, opt, opt, opt, opt, inv },
+ /* version */ { inv, req, inv, inv, inv, inv, inv, inv, inv, inv, inv, inv },
+ /* get_cache */ { opt, opt, req, inv, inv, inv, inv, inv, inv, inv, inv, inv },
+ /* cache */ { opt, opt, inv, req, opt, inv, inv, inv, inv, inv, inv, inv },
+ /* no_cyl */ { opt, opt, inv, req, req, inv, inv, inv, inv, inv, inv, inv },
+ /* reserve */ { opt, opt, inv, inv, inv, req, inv, inv, inv, inv, inv, inv },
+ /* release */ { opt, opt, inv, inv, inv, inv, req, inv, inv, inv, inv, inv },
+ /* slock */ { opt, opt, inv, inv, inv, inv, inv, req, inv, inv, inv, inv },
+ /* profile */ { opt, opt, inv, inv, inv, inv, inv, inv, req, opt, inv, inv },
+ /* prof_item */ { opt, opt, inv, inv, inv, inv, inv, inv, req, req, inv, inv },
+ /* reset_prof */ { opt, opt, inv, inv, inv, inv, inv, inv, inv, inv, req, inv },
+ /* query_reserve */ { inv, inv, inv, inv, inv, inv, inv, inv, inv, inv, inv, req },
};
struct parameter {
@@ -141,11 +145,12 @@ static struct option options[] = {
{ "profile", no_argument, NULL, 'P'},
{ "prof_item", required_argument, NULL, 'I'},
{ "reset_prof", no_argument, NULL, 'R'},
+ { "query_reserve", no_argument, NULL, 'Q'},
{ NULL, 0, NULL, 0 }
};
/* Command line option abbreviations */
-static const char option_string[] = "hvgc:n:SLOPI:R";
+static const char option_string[] = "hvgc:n:SLOPI:RQ";
/* Error message string */
@@ -372,6 +377,11 @@ get_command_line (int argc, char* argv[], struct command_line* line)
rc = store_option (&cmdline, cmd_keyword_reset_prof,
optarg);
break;
+ case 'Q':
+ rc = store_option (&cmdline, cmd_keyword_query_reserve,
+ optarg);
+ break;
+
case -1:
/* End of options string - start of devices list */
cmdline.device_id = optind;
@@ -431,8 +441,11 @@ do_command (char* device, struct command_line cmdline)
rc = disk_reset_prof (device);
break;
case cmd_keyword_prof_item:
- break;
- default:
+ break;
+ case cmd_keyword_query_reserve:
+ rc = disk_query_reserve_status(device);
+ break;
+ default:
error_print ("Unknown command '%s' specified",
get_keyword_name (i));
break;
@@ -449,7 +462,7 @@ int
main (int argc, char* argv[])
{
struct command_line cmdline;
- int rc;
+ int rc, finalrc;
/* Find out what we're supposed to do */
rc = get_command_line (argc, argv, &cmdline);
@@ -484,9 +497,12 @@ main (int argc, char* argv[])
return 1;
}
- while (cmdline.device_id < argc) {
+ finalrc = 0;
+ while (cmdline.device_id < argc) {
rc = do_command (argv[cmdline.device_id], cmdline);
+ if (rc && !finalrc)
+ finalrc = rc;
cmdline.device_id++;
}
- return 0;
+ return finalrc;
}
--
1.7.3.5

View File

@ -1,96 +0,0 @@
From f877ca62c13e475d55f6fe3fac5c9732ed44b49e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 28 Jan 2011 14:27:39 +0100
Subject: [PATCH 58/61] fdasd/dasdfmt: fix format 7 label
Description: fdasd/dasdfmt: fix format 7 label
Symptom: Backups of Linux on System z disks from z/OS do not work
when the disk is not fully partitioned.
Problem: The format 7 label written by fdasd and dasdfmt is incorrect.
The extend for free space has one track less than required
which is recognized as inconsistent vtoc state by z/OS tools.
Solution: Fix libvtoc to write the format 7 label correctly.
---
libvtoc/vtoc.c | 22 +++++++++++++---------
1 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/libvtoc/vtoc.c b/libvtoc/vtoc.c
index cebd5a4..36269a4 100644
--- a/libvtoc/vtoc.c
+++ b/libvtoc/vtoc.c
@@ -1204,7 +1204,7 @@ void vtoc_update_format7_label_add (format7_label_t *f7, int verbose,
if ((ext->a + ext->b) == 0x00000000)
continue;
- if ((ext->b + 1) == tmp->a) {
+ if ((ext->b) == tmp->a) {
/* this extent precedes the new one */
ext->b = tmp->b;
bzero(tmp, sizeof(ds7ext_t));
@@ -1216,7 +1216,7 @@ void vtoc_update_format7_label_add (format7_label_t *f7, int verbose,
continue;
}
- if (ext->a == (tmp->b + 1))
+ if (ext->a == (tmp->b))
{
/* this extent succeeds the new one */
ext->a = tmp->a;
@@ -1240,7 +1240,7 @@ void vtoc_update_format7_label_del (format7_label_t *f7, int verbose,
{
ds7ext_t *ext;
int i, counter=0;
-
+
for (i=0; i<16; i++) {
if (i<5)
ext = &f7->DS7EXTNT[i];
@@ -1258,7 +1258,7 @@ void vtoc_update_format7_label_del (format7_label_t *f7, int verbose,
if ((a == ext->a) && (b < ext->b)) {
/* left-bounded in free space gap */
- ext->a = b + 1;
+ ext->a = b;
if (verbose)
printf("FMT7 add extent: left-bounded\n");
counter++;
@@ -1267,7 +1267,7 @@ void vtoc_update_format7_label_del (format7_label_t *f7, int verbose,
if ((a > ext->a) && (b == ext->b)) {
/* right-bounded in free space gap */
- ext->b = a - 1;
+ ext->b = a;
if (verbose)
printf("FMT7 add extent: right-bounded\n");
counter++;
@@ -1277,8 +1277,8 @@ void vtoc_update_format7_label_del (format7_label_t *f7, int verbose,
if ((a > ext->a) && (b < ext->b)) {
/* partition devides free space into 2 pieces */
vtoc_update_format7_label_add(f7, verbose,
- b+1, ext->b);
- ext->b = a - 1;
+ b, ext->b);
+ ext->b = a;
if (verbose)
printf("FMT7 add extent: 2 pieces\n");
counter++;
@@ -1311,10 +1311,14 @@ void vtoc_set_freespace(format4_label_t *f4, format5_label_t *f5,
{
if ((cyl * trk) > BIG_DISK_SIZE) {
if (ch == '+') {
- vtoc_update_format7_label_add(f7, verbose, start,stop);
+ vtoc_update_format7_label_add(f7, verbose, start,
+ /* ds7ext RTA + 1 */
+ stop + 1);
}
else if (ch == '-') {
- vtoc_update_format7_label_del(f7, verbose, start,stop);
+ vtoc_update_format7_label_del(f7, verbose, start,
+ /* ds7ext RTA + 1 */
+ stop + 1);
}
else {
printf("BUG: syntax error in vtoc_set_freespace.\n");
--
1.7.3.5

View File

@ -1,69 +0,0 @@
From f127d0df43f5fe5709f068e0c79bef0b759cb6fe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 28 Jan 2011 14:28:35 +0100
Subject: [PATCH 59/61] cpuplugd: cmm_pages not set and restored correctly
Description: cpuplugd: cmm_pages not set and restored correctly
Symptom: /proc/sys/vm/cmm_pages will be restored to 0 after program exit,
regardless of previous value, if cpuplugd is run with an invalid
memory configuration, e.g. cmm_min commented out. Also, cmm_pages
will not correctly reach a cmm_min of 0 during run-time, in a case
where cmm_pages is equal to cmm_inc.
Problem: Incorrect checks on program exit, and in the memplug function.
Solution: Fix checks on program exit and memplug.
---
cpuplugd/config.c | 1 +
cpuplugd/daemon.c | 4 ++--
cpuplugd/mem.c | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/cpuplugd/config.c b/cpuplugd/config.c
index e853ea7..bda7780 100644
--- a/cpuplugd/config.c
+++ b/cpuplugd/config.c
@@ -358,6 +358,7 @@ void check_config(struct config *cfg)
if (foreground == 0)
syslog(LOG_INFO, "No valid memory hotplug "
"configuration detected\n");
+ memory = 0;
} else {
memory = 1;
/*
diff --git a/cpuplugd/daemon.c b/cpuplugd/daemon.c
index 391acba..4dab372 100644
--- a/cpuplugd/daemon.c
+++ b/cpuplugd/daemon.c
@@ -125,7 +125,7 @@ void clean_up()
syslog(LOG_INFO, "terminated\n");
remove(pid_file);
reactivate_cpus();
- if (check_cmmfiles() == 0)
+ if (memory)
cleanup_cmm();
exit(1);
}
@@ -139,7 +139,7 @@ void kill_daemon(int a)
syslog(LOG_INFO, "shutting down\n");
remove(pid_file);
reactivate_cpus();
- if (check_cmmfiles() == 0)
+ if (memory)
cleanup_cmm();
exit(0);
}
diff --git a/cpuplugd/mem.c b/cpuplugd/mem.c
index 13f902d..b15c7e2 100644
--- a/cpuplugd/mem.c
+++ b/cpuplugd/mem.c
@@ -163,7 +163,7 @@ int memplug(int size)
* new value: previous value - size
*/
new_size = old_size - size;
- if (new_size <= 0)
+ if (new_size < 0)
return -1;
filp = fopen("/proc/sys/vm/cmm_pages", "w");
if (!filp) {
--
1.7.3.5

View File

@ -1,69 +0,0 @@
From bdc3b89850bb437f48cb2f9fa31a8f51d3cd88b5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 28 Jan 2011 14:30:22 +0100
Subject: [PATCH 60/61] lsluns: Fix LUN reporting for SAN volume controller (SVC)
Description: lsluns: Fix LUN reporting for SAN volume controller (SVC)
Symptom: lsluns fails to report LUNs from SVC
Problem: The SCSI Architecture Model (SAM) specifies that a storage
server only has to support the REPORT LUNs command for LUN 0
or the "REPORT LUNS Well-Known-LUN" (WLUN). The SAN Volume
Controller (SVC) only supports REPORT LUNS on LUN 0. The
approach of lsluns of sending the REPORT LUNS to any attached
LUN does not work for the SVC.
Solution: Change the strategy of lsluns to check if the LUN 0 or the
WLUN is already available. If both LUNs are not available,
first try to attach LUN 0 and issue the command; if this
fails, try the WLUN.
---
zconf/lsluns | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/zconf/lsluns b/zconf/lsluns
index 769b846..acbdcd7 100755
--- a/zconf/lsluns
+++ b/zconf/lsluns
@@ -45,16 +45,16 @@ sub list_luns
next;
}
if (!defined($lun_hash{$a}{$p})) {
- `echo $wlun >> $drv_dir/$a/$p/unit_add 2>/dev/null`;
+ `echo $lun0 >> $drv_dir/$a/$p/unit_add 2>/dev/null`;
select(undef, undef, undef, 0.1);
%lun_hash = get_lun_hash();
if (!defined($lun_hash{$a}{$p})) {
- `echo $wlun >> $drv_dir/$a/$p/unit_remove 2>/dev/null`;
- `echo $lun0 >> $drv_dir/$a/$p/unit_add 2>/dev/null`;
+ `echo $lun0 >> $drv_dir/$a/$p/unit_remove 2>/dev/null`;
+ `echo $wlun >> $drv_dir/$a/$p/unit_add 2>/dev/null`;
select(undef, undef, undef, 0.1);
%lun_hash = get_lun_hash();
if (!defined($lun_hash{$a}{$p})) {
- `echo $lun0 >> $drv_dir/$a/$p/unit_remove 2>/dev/null`;
+ `echo $wlun >> $drv_dir/$a/$p/unit_remove 2>/dev/null`;
print"\tat port $p:\n";
print "\t\tCannot attach WLUN / LUN0 for scanning.\n";
next;
@@ -92,6 +92,8 @@ sub list_luns
}
}
+# Look only for LUN0 and the REPORT LUNs WLUN. SAM specifies that the storage
+# only has to response on one of those to the REPORT LUNs command.
sub get_lun_hash
{
my %lun_hash;
@@ -105,7 +107,9 @@ sub get_lun_hash
$p =~ s/(0x\w{16})*\n/$1/;
chomp($a);
- $lun_hash{$a}{$p}{$l} = ${[split('/', $device)]}[-1];
+ if ($l eq $lun0 or $l eq $wlun) {
+ $lun_hash{$a}{$p}{$l} = ${[split('/', $device)]}[-1];
+ }
}
return %lun_hash;
}
--
1.7.3.5

View File

@ -1,39 +0,0 @@
From 7fd37ae55c104cf62f8d62da79d89a4c59087a6d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 28 Jan 2011 14:31:06 +0100
Subject: [PATCH 61/61] lsluns: Accept uppercase and lowercase hex digits
Description: lsluns: Accept uppercase and lowercase hex digits
Symptom: lsluns does not accept uppercase letters in hex-digits for
FCP device id and WWPN.
Problem: lsluns compares the FCP device id and the WWPN with the
sysfs entries that are always lowercase.
Solution: Convert the input from the command line to lowercase, so
that lsluns accepts both, uppercase and lowercase for the
hex digits in the FCP device and the WWPN.
---
zconf/lsluns | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/zconf/lsluns b/zconf/lsluns
index acbdcd7..436ea34 100755
--- a/zconf/lsluns
+++ b/zconf/lsluns
@@ -252,7 +252,14 @@ GetOptions('c|ccw=s' => \@adapter,
};
@adapter = split(',', join(',', @adapter));
+foreach (@adapter) {
+ $_ =~ tr/A-Z/a-z/;
+}
+
@port = split(',', join(',', @port));
+foreach (@port) {
+ $_ =~ tr/A-Z/a-z/;
+}
%res_hash = get_env_list(\@adapter, \@port);
--
1.7.3.5

View File

@ -1,225 +0,0 @@
From 9e35e49ec56880c9f62cce2ff79849e1e409bc2b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Mon, 14 Feb 2011 11:03:03 +0100
Subject: [PATCH] dumpconf: Add DELAY_MINUTES description to man page
Description: dumpconf: Add DELAY_MINUTES description to man page
Symptom: User has no online documentation for the DELAY_MINUTES keyword.
Problem: Description of the DELAY_MINUTES keyword is missing in dumpconf
man page.
Solution: Add description of DELAY_MINUTES keyword to dumpconf man page.
Also add some minor man page cleanups from upstream version.
---
man/dumpconf.8 | 104 +++++++++++++++++++++++--------------------------------
1 files changed, 44 insertions(+), 60 deletions(-)
diff --git a/man/dumpconf.8 b/man/dumpconf.8
index b8dcd00..c795568 100644
--- a/man/dumpconf.8
+++ b/man/dumpconf.8
@@ -1,7 +1,7 @@
-.TH DUMPCONF 8 "Nov 2006" "s390-tools"
+.TH DUMPCONF 8 "Nov 2009" "s390-tools"
.SH NAME
-dumpconf \- Configure automatic dump for Linux on z/Series.
+dumpconf \- Configure an ON_PANIC action for Linux on System z.
.SH SYNOPSIS
.br
@@ -10,8 +10,8 @@ dumpconf \- Configure automatic dump for Linux on z/Series.
\fBdumpconf\fR [-h|-v]
.SH DESCRIPTION
-\fBdumpconf\fR reads /etc/sysconfig/dumpconf and initializes the automatic dump
-feature according to the configuration file.
+\fBdumpconf\fR reads the /etc/sysconfig/dumpconf file
+and establishes the action to be taken in case a kernel panic occurs.
The following keywords can be used in the dumpconf file:
@@ -20,21 +20,22 @@ The following keywords can be used in the dumpconf file:
Shutdown action in case of a kernel panic. Possible values are 'dump', 'reipl', 'dump_reipl', 'stop' and 'vmcmd':
.br
-dump: trigger dump according to configuration in /etc/sysconfig/dumpconf.
+dump: trigger dump according to the configuration in /etc/sysconfig/dumpconf.
.br
-reipl: trigger re-IPL according to configuration under /sys/firmware/reipl.
+reipl: trigger re-IPL according to the configuration under /sys/firmware/reipl.
.br
-dump_reipl: first trigger dump according to configuration in
-/etc/sysconfig/dumpconf, then trigger re-IPL according to configuration under
-/sys/firmware/reipl.
+dump_reipl: first trigger dump according to the configuration in
+/etc/sysconfig/dumpconf, then trigger re-IPL according to the configuration
+under /sys/firmware/reipl.
.br
stop: stop Linux and enter disabled wait (default).
.br
-vmcmd: trigger vm command according to 'VMCMD_X' configuration in /etc/sysconfig/dumpconf.
+vmcmd: trigger CP command according to the 'VMCMD_X' configuration in
+/etc/sysconfig/dumpconf.
.TP
\fB - DUMP_TYPE:\fR
@@ -46,15 +47,15 @@ Device number of dump device.
.TP
\fB - WWPN\fR
-WWPN for scsi dump device.
+WWPN for SCSI dump device.
.TP
\fB - LUN\fR
-LUN for scsi dump device.
+LUN for SCSI dump device.
.TP
\fB - BOOTPROG:\fR
-Boot program selector
+Boot program selector.
.TP
\fB - BR_LBA:\fR
@@ -64,46 +65,25 @@ Boot record logical block address.
\fB - VMCMD_1, VMCMD_2 ... VMCMD_5:\fR
Up to five CP commands, which are triggered in case of a kernel panic.
-.SH Reboot loop considerations
-
-If you select the shutdown actions "reipl" or "dump_reipl", in rare cases a
-"reboot loop" can occur, if the Linux kernel crashes everytime after the
-reboot. If you want to prevent that scenario, one of the following two
-approaches can be taken:
-
-1. Manual activation of dumpconf
-
-Ensure that the dumpconf service is not active by default:
-.br
-# chkconfig --del dumpconf
-
-Start dumpconf service manually:
-.br
-# service dumpconf start
-
-When your Linux system crashes, the system will be rebooted (after creating
-a dump in case of dump_reipl). Because the dumpconf script will then not be
-activated automatically, a second crash will stop the system.
-
-2. Automatic delayed activation of dumpconf
-
-Ensure that the dumpconf service is not active by default:
-.br
-# chkconfig --del dumpconf
-
-To enable delayed activation one of the following methods can be used:
- a) Use a init script (e.g. /etc/rc.d/boot.local):
- (sleep 10m; /sbin/service dumpconf start) &
-
- b) Use a init script (e.g. /etc/rc.d/boot.local) together with "at":
- echo 'echo /sbin/service dumpconf start' |at now+10min
-
- c) Use the following crontab entry:
- @reboot sleep 10m && /sbin/service dumpconf start
-
-In these examples, when your Linux system crashes within 10 minutes after
-the reboot, the dumpconf script is not active and a second crash will stop
-the system.
+.TP
+\fB - DELAY_MINUTES:\fR
+Number of minutes the activation of dumpconf is to be delayed. If this keyword
+is omitted, the default is zero, which means that
+dumpconf activates immediately during system startup.
+Specify a non-zero delay time only if you specified
+shutdown action "reipl" or "dump_reipl".
+These actions might cause a reboot loop
+if the Linux kernel crashes persistently during (or shortly after) each reboot.
+
+A non-zero delay time causes dumpconf to sleep in the background until the
+delay time has expired. In this case messages are written to /var/log/messages.
+By default (DELAY_MINUTES is omitted or zero) dumpconf runs in the foreground
+and informational messages are written to sysout, while
+error messages are written to syserr.
+
+Example: If you specified DELAY_MINUTES=10 and
+your Linux system crashes within 10 minutes after the reboot,
+then dumpconf is not yet active and the default action (stop) is triggered.
.SH COMMANDS
.TP
@@ -128,12 +108,12 @@ Print usage information, then exit.
Print version information, then exit.
.SH EXAMPLES:
-The following are examples for /etc/sysconfig/dumpconf:
+The following are examples of the /etc/sysconfig/dumpconf file:
.br
#
.br
-# Example config for CCW dump device (DASD)
+# Example configuration for a CCW dump device (DASD)
.br
#
.br
@@ -141,12 +121,14 @@ ON_PANIC=dump_reipl
.br
DUMP_TYPE=ccw
.br
-DEVICE=0.0.4714
+DEVICE=0.0.1234
+.br
+DELAY_MINUTES=5
.br
#
.br
-# Example config for FCP dump device (SCSI Disk)
+# Example configuration for an FCP dump device (SCSI Disk)
.br
#
.br
@@ -154,7 +136,7 @@ ON_PANIC=dump
.br
DUMP_TYPE=fcp
.br
-DEVICE=0.0.4711
+DEVICE=0.0.2345
.br
WWPN=0x5005076303004712
.br
@@ -167,7 +149,7 @@ BR_LBA=0
#
.br
-# Example config for vm command on panic
+# Example configuration for CP commands on panic
.br
#
.br
@@ -177,7 +159,7 @@ VMCMD_1="MESSAGE * Starting VMDUMP"
.br
VMCMD_2="VMDUMP"
.br
-VMCMD_3="IPL 4711"
+VMCMD_3="IPL 3456"
#
.br
@@ -186,6 +168,8 @@ VMCMD_3="IPL 4711"
#
.br
ON_PANIC=reipl
+.br
+DELAY_MINUTES=5
.SH SEE ALSO
Linux on zSeries: Using the Dump Tools
--
1.7.4

View File

@ -1,164 +0,0 @@
From c55983415ae3bd360deb04ede20bc482bd2c41b7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Mon, 7 Mar 2011 15:13:45 +0100
Subject: [PATCH] cmsfs-fuse: fix read and write errors in text mode
Description: cmsfs-fuse: fix read and write errors in text mode.
Symptom: Copying a file in text mode fails with read or write errors.
Problem: Miscalculation of file size in text mode and off-by-one error
in record length check for fixed files.
Solution: Correct the calculation of the file size by using the displacement
value for the last block of a variable file and by limiting
the size of the last record of a fixed file to the actual size.
Additionally scan for the correct length of a fixed record in text
mode.
Problem-ID: 70230
---
cmsfs-fuse/cmsfs-fuse.c | 67 ++++++++++++++++++++++++++---------------------
cmsfs-fuse/dasd.c | 2 +-
2 files changed, 38 insertions(+), 31 deletions(-)
diff --git a/cmsfs-fuse/cmsfs-fuse.c b/cmsfs-fuse/cmsfs-fuse.c
index 6c5b0b5..fd87774 100644
--- a/cmsfs-fuse/cmsfs-fuse.c
+++ b/cmsfs-fuse/cmsfs-fuse.c
@@ -917,6 +917,33 @@ static void set_record_extension(struct file *f, int *record, off_t addr,
f->record_scan_state = RSS_DATA_BLOCK_EXT;
}
+/* check for file end via byte count and return count of bytes left */
+static size_t crop_file_end(struct file *f, int record, size_t done,
+ int first)
+{
+ size_t filesize = f->fst->nr_records * f->fst->record_len;
+ struct record *rec = &f->rlist[record];
+ struct record_ext *rext = rec->ext;
+
+ /* done already includes the complete record length incl. extensions */
+ done -= rec->total_len;
+ /* remove possible linefeeds before comparing with on-disk file size */
+ if (f->linefeed && record)
+ done -= record;
+ done += rec->first_block_len;
+
+ /* add length of all existing extensions */
+ while (rext != NULL) {
+ done += rext->len;
+ rext = rext->next;
+ }
+
+ if (done + first > filesize)
+ first = filesize - done;
+ return first;
+}
+
+/* check for file end by record number */
static int end_of_file(struct file *f, int record)
{
if (record == f->fst->nr_records)
@@ -936,6 +963,8 @@ static void walk_fixed_data_block(struct file *f, off_t addr, int *record,
if (first) {
BUG(first > left);
+
+ first = crop_file_end(f, *record, *total, first);
set_record_extension(f, record, addr, first, block);
left -= first;
if (addr != NULL_BLOCK)
@@ -1572,28 +1601,6 @@ static ssize_t get_file_size_fixed(struct fst_entry *fst)
return fst->nr_records * fst->record_len;
}
-static ssize_t get_file_size_variable_slow(struct fst_entry *fst)
-{
- struct record *rec;
- ssize_t total = 0;
- int rc = 0;
- struct file *f = create_file_object(fst, &rc);
-
- if (f == NULL)
- return rc;
-
- rec = get_record(f, f->fst->nr_records - 1);
- total = rec->file_start + rec->total_len;
-
- /*
- * Note: need to add header bytes since the record information does
- * not contain them but get_file_size_logical will remove them...
- */
- total += f->fst->nr_records * VAR_RECORD_HEADER_SIZE;
- destroy_file_object(f);
- return total;
-}
-
static ssize_t get_file_size_variable(struct fst_entry *fst)
{
struct var_ptr vptr;
@@ -1608,11 +1615,11 @@ static ssize_t get_file_size_variable(struct fst_entry *fst)
return rc;
if (vptr.next == 0) {
/*
- * Last block is a null block. Cannot scan that block,
- * need to scan the whole file instead...
+ * Last block is a null block. No more records can
+ * follow, so the displacement value points to EOF.
*/
- total = get_file_size_variable_slow(fst);
- goto skip;
+ total = vptr.disp;
+ goto skip_scan;
}
ptr = ABS(vptr.next);
if (vptr.disp != VAR_RECORD_SPANNED) {
@@ -1638,7 +1645,6 @@ skip_scan:
*/
if (fst->nr_blocks)
total += (fst->nr_blocks - 1) * cmsfs.blksize;
-skip:
return total;
}
@@ -3896,7 +3902,8 @@ static int do_write(struct file *f, const char *buf, size_t size, off_t offset)
return rc;
f->ptr_dirty = 0;
} else
- if (f->fst->levels > 0) {
+ if (f->fst->levels > 0 &&
+ f->fst->record_format == RECORD_LEN_VARIABLE) {
rc = update_last_block_vptr(f, ABS(f->fst->fop),
f->fst->levels, &vptr);
if (rc < 0)
@@ -3962,7 +3969,7 @@ static int cmsfs_write(const char *path, const char *buf, size_t size,
return do_write(f, buf, size, offset);
/* remove already comitted bytes */
- offset -= f->wcache_used;
+ offset -= f->wcache_commited;
/* write offset must be at the end of the file */
if (offset + f->null_records + f->pad_bytes != f->session_size)
@@ -3981,7 +3988,7 @@ static int cmsfs_write(const char *path, const char *buf, size_t size,
return -EINVAL;
} else {
if (f->fst->record_format == RECORD_LEN_FIXED &&
- f->wcache_commited + scan_len >= f->fst->record_len) {
+ f->wcache_commited + scan_len > f->fst->record_len) {
purge_wcache(f);
return -EINVAL;
}
diff --git a/cmsfs-fuse/dasd.c b/cmsfs-fuse/dasd.c
index d79d34d..1b9af9a 100644
--- a/cmsfs-fuse/dasd.c
+++ b/cmsfs-fuse/dasd.c
@@ -196,7 +196,7 @@ int get_device_info(struct cmsfs *cmsfs)
*/
fd = open(cmsfs->device, O_RDWR);
if (fd < 0) {
- if (errno == EROFS) {
+ if (errno == EROFS || errno == EACCES) {
cmsfs->readonly = 1;
fd = open(cmsfs->device, O_RDONLY);
if (fd < 0)
--
1.7.4

View File

@ -1,25 +0,0 @@
From c4a38de57376a6ddf03906afeac142525837aab0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 18 Mar 2011 16:35:17 +0100
Subject: [PATCH 64/66] switch to using udevadm settle
---
etc/init.d/mon_statd | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/etc/init.d/mon_statd b/etc/init.d/mon_statd
index 60bcf00..b6699c7 100755
--- a/etc/init.d/mon_statd
+++ b/etc/init.d/mon_statd
@@ -39,7 +39,7 @@ load_kernel_module()
if [ $? -ne 0 ]; then
exit 1
fi
- udevsettle
+ udevadm settle
if [ $? -ne 0 ]; then
exit 1
fi
--
1.7.4

View File

@ -1,30 +0,0 @@
From 983f8cd4337de2ca5377ed64121c55d27367beca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 18 Mar 2011 16:37:15 +0100
Subject: [PATCH 65/66] hyptop: Fix man page typo for "current weight"
Description: hyptop: Fix man page typo for "current weight"
Symptom: The hyptop man page says that the 't' character is used for
"current weight" under z/VM.
Problem: The correct character for "current weight" is 'r'.
Solution: Document the correct character 'r' for "current weight".
---
hyptop/hyptop.8 | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/hyptop/hyptop.8 b/hyptop/hyptop.8
index 99a729c..325613b 100644
--- a/hyptop/hyptop.8
+++ b/hyptop/hyptop.8
@@ -127,7 +127,7 @@ The following fields are available under z/VM:
'u' - Used memory
'a' - Maximum memory
'n' - Minimum weight
- 't' - Current weight
+ 'r' - Current weight
'x' - Maximum weight
In "sys" window:
--
1.7.4

View File

@ -1,61 +0,0 @@
From f5a80bd5d3d478354d6044b6d2b9951fd29a8d59 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 18 Mar 2011 16:37:54 +0100
Subject: [PATCH 66/66] fdasd: buffer overflow when writing to read-only device
Description: fdasd: buffer overflow when writing to read-only device
Symptom: When fdasd tries to write to a read-only disk, it fails with
a '*** buffer overflow detected ***' error message.
Problem: It is expected that fdasd cannot write to a read-only disk, and
such an operation should end with a proper error message. The
libvtoc code, which writes this message, contains the bug that
causes the buffer overflow.
Solution: Directly print the error message, without formatting it first in
a buffer.
---
libvtoc/vtoc.c | 15 +++++----------
1 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/libvtoc/vtoc.c b/libvtoc/vtoc.c
index 36269a4..ae1de8c 100644
--- a/libvtoc/vtoc.c
+++ b/libvtoc/vtoc.c
@@ -146,30 +146,25 @@ static char buffer[85];
*/
static void vtoc_error(enum failure why, char *s1, char *s2)
{
- char error[LINE_LENGTH];
-
switch (why) {
case unable_to_open:
- sprintf(error, "%s opening device '%s' failed.\n%s\n",
+ fprintf(stderr, "\n%s opening device '%s' failed.\n%s\n",
VTOC_ERROR, s1, s2);
break;
case unable_to_seek:
- sprintf(error, "%s seeking device '%s' failed.\n%s\n",
+ fprintf(stderr, "\n%s seeking device '%s' failed.\n%s\n",
VTOC_ERROR, s1, s2);
break;
case unable_to_write:
- sprintf(error, "%s writing to device '%s' failed,\n%s\n",
+ fprintf(stderr, "\n%s writing to device '%s' failed,\n%s\n",
VTOC_ERROR, s1, s2);
break;
case unable_to_read:
- sprintf(error, "%s reading from device '%s' failed.\n%s\n",
+ fprintf(stderr, "\n%s reading from device '%s' failed.\n%s\n",
VTOC_ERROR, s1, s2);
break;
- default: sprintf(error, "Fatal error\n");
+ default: fprintf(stderr, "\nFatal error\n");
}
-
- fputc('\n', stderr);
- fputs(error, stderr);
exit(1);
}
--
1.7.4

View File

@ -1,297 +0,0 @@
From f6494a1210439d591a1319498026ffcdd91a2ebf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Tue, 29 Mar 2011 10:49:25 +0200
Subject: [PATCH 67/70] cmsfs-fuse: Delete old file if renaming to an existing file
Description: cmsfs-fuse: Delete old file if renaming to an existing file.
Symptom: Stale old file if renaming a file to an existing file.
Problem: In case rename is used to overwrite an existing file the old
file entry was not deleted resulting in a duplicated file.
Solution: If the target of a rename operation exists delete the target
file before the rename operation.
---
cmsfs-fuse/cmsfs-fuse.c | 248 ++++++++++++++++++++++++-----------------------
1 files changed, 128 insertions(+), 120 deletions(-)
diff --git a/cmsfs-fuse/cmsfs-fuse.c b/cmsfs-fuse/cmsfs-fuse.c
index fd87774..9f1aa1a 100644
--- a/cmsfs-fuse/cmsfs-fuse.c
+++ b/cmsfs-fuse/cmsfs-fuse.c
@@ -2638,14 +2638,132 @@ static int cmsfs_utimens(const char *path, const struct timespec ts[2])
return 0;
}
+/*
+ * Get the address of the last directory entry.
+ */
+off_t find_last_fdir_entry(off_t addr, int level)
+{
+ struct fst_entry fst;
+ int left, rc;
+ off_t ptr;
+
+ if (level > 0) {
+ level--;
+ left = PTRS_PER_BLOCK;
+ while (left--) {
+ ptr = get_fixed_pointer(addr + left * PTR_SIZE);
+ BUG(ptr < 0);
+ if (ptr)
+ return find_last_fdir_entry(ptr, level);
+ }
+ DIE("Directory entry not found\n");
+ return 0;
+ }
+
+ left = cmsfs.blksize / sizeof(struct fst_entry);
+ while (left--) {
+ rc = _read(&fst, sizeof(fst),
+ addr + left * sizeof(struct fst_entry));
+ BUG(rc < 0);
+ if (is_file((unsigned long long *) fst.name,
+ (unsigned long long *) fst.type))
+ return addr + left * sizeof(struct fst_entry);
+ }
+ DIE("Directory entry not found\n");
+}
+
+static int delete_file(const char *path)
+{
+ off_t fst_kill, fst_last;
+ struct walk_file walk;
+ struct file *f_moved;
+ char file[MAX_FNAME];
+ struct fst_entry fst;
+ struct file *f;
+ int rc = 0, i;
+
+ if (cmsfs.readonly)
+ return -EROFS;
+
+ fst_kill = lookup_file(path + 1, &fst, SHOW_UNLINKED);
+ if (!fst_kill)
+ return -ENOENT;
+ f = create_file_object(&fst, &rc);
+ if (f == NULL)
+ return rc;
+
+ /* delete all data blocks */
+ for (i = 0; i < f->fst->nr_blocks; i++)
+ free_block(f->blist[i].disk_addr);
+
+ if (f->fst->fop) {
+ rc = f->fops->delete_pointers(f, f->fst->levels, ABS(f->fst->fop));
+ if (rc < 0)
+ goto error;
+ }
+
+ if (cmsfs.dir_levels)
+ fst_last = find_last_fdir_entry(get_fop(cmsfs.fdir), cmsfs.dir_levels);
+ else
+ fst_last = find_last_fdir_entry(cmsfs.fdir, cmsfs.dir_levels);
+
+ /* remove unlinked file from fcache */
+ strncpy(file, path + 1, MAX_FNAME);
+ str_toupper(file);
+ invalidate_htab_entry(file);
+
+ if (fst_last == fst_kill)
+ goto skip_copy;
+
+ /* copy last entry over unlinked entry */
+ rc = _read(&fst, sizeof(struct fst_entry), fst_last);
+ BUG(rc < 0);
+ rc = _write(&fst, sizeof(struct fst_entry), fst_kill);
+ BUG(rc < 0);
+
+ /* update moved fcache entry */
+ memset(file, 0, sizeof(file));
+ decode_edf_name(file, fst.name, fst.type);
+ update_htab_entry(fst_kill, file);
+ /* update cached address of moved FST */
+ f_moved = file_open(file);
+ if (f_moved != NULL)
+ f->fst_addr = fst_kill;
+
+skip_copy:
+ /* delete last entry */
+ rc = _zero(fst_last, sizeof(struct fst_entry));
+ BUG(rc < 0);
+
+ /* if the deleted entry was the first of a block, free the block */
+ if (fst_last % cmsfs.blksize == 0) {
+ cache_dblocks(&walk);
+ /* delete the last block from dlist */
+ walk.dlist_used--;
+ free_block(fst_last);
+ purge_dblock_ptrs(cmsfs.dir_levels, get_fop(cmsfs.fdir));
+ rewrite_dblock_ptrs(&walk);
+ free_dblocks(&walk);
+ }
+
+ destroy_file_object(f);
+ decrease_file_count();
+ update_block_count();
+ return 0;
+
+error:
+ destroy_file_object(f);
+ return rc;
+}
+
static int cmsfs_rename(const char *path, const char *new_path)
{
+ struct fst_entry fst, fst_new;
+ off_t fst_addr, fst_addr_new;
char uc_old_name[MAX_FNAME];
char fname[8], ftype[8];
- struct fst_entry fst;
char *uc_new_name;
struct file *f;
- off_t fst_addr;
int rc;
if (cmsfs.readonly)
@@ -2655,6 +2773,14 @@ static int cmsfs_rename(const char *path, const char *new_path)
if (!fst_addr)
return -ENOENT;
+ /* if new file already exists it must be overwritten so delete it */
+ fst_addr_new = lookup_file(new_path + 1, &fst_new, HIDE_UNLINKED);
+ if (fst_addr_new) {
+ delete_file(new_path);
+ /* fst_addr may have changed due to copy-up */
+ fst_addr = lookup_file(path + 1, &fst, HIDE_UNLINKED);
+ }
+
rc = edf_name_valid(new_path + 1);
if (rc)
return rc;
@@ -4042,124 +4168,6 @@ static int cmsfs_write(const char *path, const char *buf, size_t size,
return rc;
}
-/*
- * Get the address of the last directory entry.
- */
-off_t find_last_fdir_entry(off_t addr, int level)
-{
- struct fst_entry fst;
- int left, rc;
- off_t ptr;
-
- if (level > 0) {
- level--;
- left = PTRS_PER_BLOCK;
- while (left--) {
- ptr = get_fixed_pointer(addr + left * PTR_SIZE);
- BUG(ptr < 0);
- if (ptr)
- return find_last_fdir_entry(ptr, level);
- }
- DIE("Directory entry not found\n");
- return 0;
- }
-
- left = cmsfs.blksize / sizeof(struct fst_entry);
- while (left--) {
- rc = _read(&fst, sizeof(fst),
- addr + left * sizeof(struct fst_entry));
- BUG(rc < 0);
- if (is_file((unsigned long long *) fst.name,
- (unsigned long long *) fst.type))
- return addr + left * sizeof(struct fst_entry);
- }
- DIE("Directory entry not found\n");
-}
-
-static int delete_file(const char *path)
-{
- off_t fst_kill, fst_last;
- struct walk_file walk;
- struct file *f_moved;
- char file[MAX_FNAME];
- struct fst_entry fst;
- struct file *f;
- int rc = 0, i;
-
- if (cmsfs.readonly)
- return -EROFS;
-
- fst_kill = lookup_file(path + 1, &fst, SHOW_UNLINKED);
- if (!fst_kill)
- return -ENOENT;
- f = create_file_object(&fst, &rc);
- if (f == NULL)
- return rc;
-
- /* delete all data blocks */
- for (i = 0; i < f->fst->nr_blocks; i++)
- free_block(f->blist[i].disk_addr);
-
- if (f->fst->fop) {
- rc = f->fops->delete_pointers(f, f->fst->levels, ABS(f->fst->fop));
- if (rc < 0)
- goto error;
- }
-
- if (cmsfs.dir_levels)
- fst_last = find_last_fdir_entry(get_fop(cmsfs.fdir), cmsfs.dir_levels);
- else
- fst_last = find_last_fdir_entry(cmsfs.fdir, cmsfs.dir_levels);
-
- /* remove unlinked file from fcache */
- strncpy(file, path + 1, MAX_FNAME);
- str_toupper(file);
- invalidate_htab_entry(file);
-
- if (fst_last == fst_kill)
- goto skip_copy;
-
- /* copy last entry over unlinked entry */
- rc = _read(&fst, sizeof(struct fst_entry), fst_last);
- BUG(rc < 0);
- rc = _write(&fst, sizeof(struct fst_entry), fst_kill);
- BUG(rc < 0);
-
- /* update moved fcache entry */
- memset(file, 0, sizeof(file));
- decode_edf_name(file, fst.name, fst.type);
- update_htab_entry(fst_kill, file);
- /* update cached address of moved FST */
- f_moved = file_open(file);
- if (f_moved != NULL)
- f->fst_addr = fst_kill;
-
-skip_copy:
- /* delete last entry */
- rc = _zero(fst_last, sizeof(struct fst_entry));
- BUG(rc < 0);
-
- /* if the deleted entry was the first of a block, free the block */
- if (fst_last % cmsfs.blksize == 0) {
- cache_dblocks(&walk);
- /* delete the last block from dlist */
- walk.dlist_used--;
- free_block(fst_last);
- purge_dblock_ptrs(cmsfs.dir_levels, get_fop(cmsfs.fdir));
- rewrite_dblock_ptrs(&walk);
- free_dblocks(&walk);
- }
-
- destroy_file_object(f);
- decrease_file_count();
- update_block_count();
- return 0;
-
-error:
- destroy_file_object(f);
- return rc;
-}
-
static int cmsfs_unlink(const char *path)
{
struct fst_entry fst;
--
1.7.4

View File

@ -1,31 +0,0 @@
From 62c2c000645613cb6be82f48fc641c07ca25370c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Tue, 29 Mar 2011 10:50:08 +0200
Subject: [PATCH 68/70] cmsfs-fuse: Enlarge fsname string
Description: cmsfs-fuse: Enlarge fsname string
Symptom: Truncated device part of file system name
Problem: The device part of the file system name was limited to 50
characters and gets truncated for long device names, for
instance if /dev/disk/by-path/ device names are used.
Solution: Increase the fsname string limit to 200 characters.
---
cmsfs-fuse/cmsfs-fuse.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cmsfs-fuse/cmsfs-fuse.c b/cmsfs-fuse/cmsfs-fuse.c
index 9f1aa1a..a3a16d0 100644
--- a/cmsfs-fuse/cmsfs-fuse.c
+++ b/cmsfs-fuse/cmsfs-fuse.c
@@ -46,7 +46,7 @@ struct list text_type_list;
FILE *logfile;
#define PAGE_SIZE 0xfff
-#define FSNAME_MAX_LEN 50
+#define FSNAME_MAX_LEN 200
#define MAX_FNAME 18
#define CMSFS_OPT(t, p, v) { t, offsetof(struct cmsfs, p), v }
--
1.7.4

View File

@ -1,62 +0,0 @@
From 3a7a5e5eaec3aff2e078a91b76f09eb4ae7f8778 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Tue, 29 Mar 2011 10:50:37 +0200
Subject: [PATCH 69/70] cmsfs-fuse: Unable to use cmsfs-fuse if $HOME is not set
Description: cmsfs-fuse: Unable to use cmsfs-fuse if $HOME is not set.
Symptom: Segmentation fault while starting cmsfs-fuse.
Problem: Missing malloc if $HOME environment variable is not set.
Solution: Allocate the string buffer before the $HOME query.
---
cmsfs-fuse/config.c | 22 ++++++++++++----------
1 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/cmsfs-fuse/config.c b/cmsfs-fuse/config.c
index 9f9de45..f89e444 100644
--- a/cmsfs-fuse/config.c
+++ b/cmsfs-fuse/config.c
@@ -26,21 +26,20 @@ char *conffile;
int open_conf_file(FILE **fh)
{
- const char *home_env = getenv("HOME");
-
- if (home_env == NULL)
- goto no_home;
+ const char *home_env;
conffile = malloc(4096);
if (conffile == NULL)
DIE_PERROR("malloc failed");
+
+ home_env = getenv("HOME");
+ if (home_env == NULL)
+ goto no_home;
+
sprintf(conffile, "%s/.cmsfs-fuse/filetypes.conf", home_env);
*fh = fopen(conffile, "r");
- if (*fh == NULL)
- goto no_home;
-out:
- DEBUG("using config file: %s\n", conffile);
- return 0;
+ if (*fh != NULL)
+ goto out;
no_home:
sprintf(conffile, "%s/%s", TOOLS_SYSCONFDIR,
@@ -50,7 +49,10 @@ no_home:
free(conffile);
return -ENOENT;
}
- goto out;
+out:
+ DEBUG("using config file: %s\n", conffile);
+ free(conffile);
+ return 0;
}
void add_filetype(char *name, struct list *head)
--
1.7.4

View File

@ -1,81 +0,0 @@
From 7ec17ba524709c44561ed6016ba2940473bfa48f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Tue, 29 Mar 2011 10:51:45 +0200
Subject: [PATCH 70/70] hyptop: Prevent interactive mode on s390 line mode terminals
Description: hyptop: Prevent interactive mode on s390 line mode terminals
Symptom: Unreadable output, when hyptop is started on line mode terminals.
Problem: Check for line mode terminal is missing.
Solution: To prevent hyptop starting in interactive mode on line mode
terminals, the TERM variable is checked. If TERM is unset or
set to "dumb" interactive mode is not allowed.
---
hyptop/hyptop.8 | 8 ++++++++
hyptop/hyptop.c | 21 ++++++++++++++++++++-
2 files changed, 28 insertions(+), 1 deletions(-)
diff --git a/hyptop/hyptop.8 b/hyptop/hyptop.8
index 325613b..19c9d7c 100644
--- a/hyptop/hyptop.8
+++ b/hyptop/hyptop.8
@@ -211,3 +211,11 @@ for CPU time calculation, enter:
.br
# hyptop -t ifl,cp
+
+.SH ENVIRONMENT
+.TP
+.B TERM
+The TERM environment variable specifies your terminal type. To run
+\fBhyptop\fP in interactive mode the TERM environment variable has
+to be set. The interactive mode is not available for terminals that
+have TERM=dumb (e.g. line mode terminals).
diff --git a/hyptop/hyptop.c b/hyptop/hyptop.c
index c42e8b0..c558a21 100644
--- a/hyptop/hyptop.c
+++ b/hyptop/hyptop.c
@@ -199,6 +199,23 @@ static int l_initscr(void)
}
/*
+ * Check if terminal is able to run hyptop in curses mode
+ */
+static void l_term_check(void)
+{
+ char *term_str = getenv("TERM");
+
+ if (!term_str)
+ ERR_EXIT("Please set TERM environment variable or "
+ "try \"--batch_mode\"\n");
+
+ /* S390 line mode terminals normally have TERM=dumb */
+ if (strcmp(term_str, "dumb") == 0)
+ ERR_EXIT("Terminal of type \"dumb\" is not supported,"
+ " try \"--batch_mode\"\n");
+}
+
+/*
* Init curses
*/
static void l_term_init(void)
@@ -206,6 +223,8 @@ static void l_term_init(void)
if (g.o.batch_mode_specified)
return;
+ l_term_check();
+
if (l_initscr() == ERR)
goto fail;
if (noecho() == ERR)
@@ -221,7 +240,7 @@ static void l_term_init(void)
l_sig_handler_init();
return;
fail:
- ERR_EXIT("Could not initialize curses, try \"--batchmode\"\n");
+ ERR_EXIT("Could not initialize curses, try \"--batch_mode\"\n");
}
/*
--
1.7.4

View File

@ -1,28 +0,0 @@
From 07e1c6ff7f6deb2c35c436c5d5def61e6aac32ed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Tue, 5 Apr 2011 14:52:24 +0200
Subject: [PATCH] cpuplugd: Fix incorrect multiplication in rules evaluation
Description: cpuplugd: Fix incorrect multiplication in rules evaluation
Symptom: Rules don't evaluate correctly when multiplication (*) is used.
Problem: Missing return statement in switch/case block.
Solution: Add return statement.
---
cpuplugd/terms.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/cpuplugd/terms.c b/cpuplugd/terms.c
index 0d08e9e..2371efa 100644
--- a/cpuplugd/terms.c
+++ b/cpuplugd/terms.c
@@ -339,6 +339,7 @@ static double eval_double(struct term *fn, struct symbols *symbols)
a = eval_double(fn->left, symbols);
b = eval_double(fn->right, symbols);
sum = a*b;
+ return sum;
/*return eval_double(fn->left, symbols) *
eval_double(fn->right, symbols);*/
case OP_DIV:
--
1.7.4

View File

@ -1,12 +0,0 @@
diff -up s390-tools-1.8.2/ziomon/Makefile.linker s390-tools-1.8.2/ziomon/Makefile
--- s390-tools-1.8.2/ziomon/Makefile.linker 2010-06-10 08:54:55.000000000 +0200
+++ s390-tools-1.8.2/ziomon/Makefile 2010-06-10 08:55:48.000000000 +0200
@@ -21,7 +21,7 @@ ziomon_util: ziomon_util_main.o ziomon_t
ziomon_zfcpdd_main.o: ziomon_zfcpdd.c ziomon_zfcpdd.h
$(CC) -DWITH_MAIN $(CFLAGS) $(CPPFLAGS) -c $< -o $@
ziomon_zfcpdd: ziomon_zfcpdd_main.o ziomon_tools.o
- $(LINK) $^ -o $@ -lm -lrt
+ $(LINK) $^ -o $@ -lm -lrt -lpthread
ziorep_traffic: ziorep_traffic.o ziorep_framer.o ziorep_frameset.o \
ziorep_printers.o ziomon_dacc.o ziomon_util.o \

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,13 +1,4 @@
ACTION!="add|change", GOTO="ccw_end"
ACTION!="add|bind|change", GOTO="ccw_end"
SUBSYSTEM!="ccw", GOTO="ccw_end"
ATTRS{cutype}=="1731/01", RUN+="ccw_init"
ATTRS{cutype}=="1731/02", RUN+="ccw_init"
ATTRS{cutype}=="1731/05", RUN+="ccw_init"
ATTRS{cutype}=="1731/06", RUN+="ccw_init"
ATTRS{cutype}=="3088/01", RUN+="ccw_init"
ATTRS{cutype}=="3088/08", RUN+="ccw_init"
ATTRS{cutype}=="3088/60", RUN+="ccw_init"
ATTRS{cutype}=="3088/61", RUN+="ccw_init"
ATTRS{cutype}=="3088/1e", RUN+="ccw_init"
ATTRS{cutype}=="3088/1f", RUN+="ccw_init"
DRIVER=="ctcm|lcs|qeth", RUN+="ccw_init"
LABEL="ccw_end"

View File

@ -24,6 +24,25 @@ get_config_line_by_subchannel()
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
@ -49,14 +68,19 @@ if [ $MODE = "dracut" ]; then
elif [ $MODE = "normal" ]; then
NOLOCALE="yes"
. /etc/sysconfig/network-scripts/network-functions
CONFIG_FILE=$(get_config_by_subchannel $CHANNEL)
if [ -n "$CONFIG_FILE" ]; then
. $CONFIG_FILE
else
exit 1
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"
@ -88,7 +112,7 @@ if [ -n "$PORTNAME" ]; then
fi
fi
if [ "$NETTYPE" = "ctc" -a -n "$CTCPROT" ]; then
OPTIONS="$OPTIONS protocol=$CTCPROTO"
OPTIONS="$OPTIONS protocol=$CTCPROT"
fi
# SUBCHANNELS is only set on mainframe ccwgroup devices

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,31 +0,0 @@
From 25442f958a12b428b7d063b927ac48965dcd8164 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Fri, 28 Jan 2011 16:11:19 +0100
Subject: [PATCH] use detected filesystem block size on FBA devices
If a FBA device is not properly formated, then the CMS file system can
have a different block size. The cmsfs tools were able to detect the file
system block size, but in fact they still used default 512 instead. And
using the default was causing crashes. Now the detected value is used.
https://bugzilla.redhat.com/show_bug.cgi?id=651012
---
cmsfsany.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cmsfsany.c b/cmsfsany.c
index 55bcfdc..18efffb 100644
--- a/cmsfsany.c
+++ b/cmsfsany.c
@@ -102,7 +102,7 @@ int cmsfs_find_label(struct CMSSUPER *vol,struct CMSFSADT *adt)
cmsfs_error(cmsfs_ermsg);
}
vol->flags = CMSFSFBA;
- vol->blksz = 512;
+ vol->blksz = blksz;
return vol->blksz;
} }
--
1.7.3.5

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++)
{

130
cpi.initd
View File

@ -1,130 +0,0 @@
#!/bin/sh
#
# Copyright 2009 Red Hat, Inc.
# License: GPLv2
# Author: Dan Horák <dhorak@redhat.com>
#
# cpi Set Control Program Identification on IBM zSeries
#
# chkconfig: 12345 80 20
# description: Set Control Program Identification on IBM zSeries \
# that's reported on a Linux LPAR
### BEGIN INIT INFO
# Provides: cpi
# Required-Start:
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: 1 2 3 4 5
# Default-Stop: 0 6
# Short-Description: Set control program identification on IBM zSeries
# Description: Set Control Program Identification on IBM zSeries \
# that's reported on a Linux LPAR
### END INIT INFO
# Source function library.
. /etc/init.d/functions
prog="cpi"
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
cpipath=/sys/firmware/cpi
start() {
[ `id -u` -eq 0 ] || return 4
echo -n $"Starting $prog: "
if [ -d $cpipath ]; then
retval=0
echo LINUX > $cpipath/system_type 2> /dev/null || retval=1
[ $retval -eq 0 ] && echo "$SYSTEM_NAME" > $cpipath/system_name 2> /dev/null || retval=1
[ $retval -eq 0 ] && echo "$SYSPLEX_NAME" > $cpipath/sysplex_name 2> /dev/null || retval=1
level_maj=`uname -r | cut -d '-' -f 1 | cut -d '.' -f 1`
level_min=`uname -r | cut -d '-' -f 1 | cut -d '.' -f 2`
level_mic=`uname -r | cut -d '-' -f 1 | cut -d '.' -f 3`
level=`printf '%02x%02x%02x' $level_maj $level_min $level_mic`
[ $retval -eq 0 ] && echo $level > $cpipath/system_level 2> /dev/null || retval=1
[ $retval -eq 0 ] && echo 1 > $cpipath/set 2> /dev/null || retval=1
else
retval=1
fi
[ $retval -eq 0 ] && success || failure
echo
return $retval
}
stop() {
echo -n $"Stopping $prog: "
# nothing to do
success
echo
return 0
}
restart() {
stop
start
}
reload() {
restart
}
force_reload() {
restart
}
rh_status() {
if [ -d $cpipath ]; then
echo -n "System type: "; cat $cpipath/system_type
echo -n "System level: "; cat $cpipath/system_level
echo -n "System name: "; cat $cpipath/system_name
echo -n "Sysplex name: "; cat $cpipath/sysplex_name
retval=0
else
echo "Control Program Identification system interface doesn't exist."
retval=1
fi
return $retval
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
$1
;;
stop)
$1
;;
restart)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac
exit $?

View File

@ -1,5 +0,0 @@
# Define a system name (8 chars maximum)
SYSTEM_NAME=
# Define a sysplex name (8 chars maximum)
SYSPLEX_NAME=

View File

@ -1,114 +0,0 @@
#! /bin/sh
#
# chkconfig: 2345 90 10
# description: Start the cpu hotplug daemon for Linux on System z
# processname: cpuplugd
# config: /etc/sysconfig/cpuplugd
# pidfile: /var/run/cpuplugd.pid
### BEGIN INIT INFO
# Provides: cpuplugd
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start the cpu hotplug daemon for Linux on System z
# Description: Starts the cpuplugd. It uses the configuration
# file /etc/sysconfig/cpuplugd
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
exec="/usr/sbin/cpuplugd"
prog="cpuplugd"
config="/etc/sysconfig/cpuplugd"
lockfile=/var/lock/subsys/$prog
start() {
[ -x $exec ] || exit 5
[ -f $config ] || exit 6
[ `id -u` -eq 0 ] || exit 4
echo -n $"Starting $prog: "
daemon $exec -c $config
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
[ `id -u` -eq 0 ] || exit 4
echo -n $"Stopping $prog: "
killproc $exec
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
stop
#
# We have to wait 2-3 seconds here. When the daemon is stopped it takes
# the time we sleep to reactivate cpus. If we restart to fast and
# cpuplugd wasn't able to restore some settings we may get a undesired
# online cpu count after cpuplugd shutdown
#
sleep 4
start
}
reload() {
restart
}
force_reload() {
restart
}
rh_status() {
# run checks to determine if the service is running or use generic status
# status -l $prog $exec
status $exec
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac
exit $?

View File

@ -26,6 +26,7 @@ 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
@ -97,6 +98,12 @@ wait_on_single_device()
# 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
@ -241,6 +248,7 @@ if [ "$DEVICE" ]; then
[ $VERBOSE ] && echo "Freeing specific devices"
free_device $DEVICE
wait_on_devices
udevadm settle
exit 0
fi
@ -298,6 +306,14 @@ if [ $MODE_ZNET ]; then
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

View File

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

View File

@ -1,26 +0,0 @@
diff -up lib-zfcp-hbaapi-2.1/Makefile.am.module lib-zfcp-hbaapi-2.1/Makefile.am
--- lib-zfcp-hbaapi-2.1/Makefile.am.module 2010-07-21 09:55:20.000000000 +0200
+++ lib-zfcp-hbaapi-2.1/Makefile.am 2011-01-14 10:42:06.000000000 +0100
@@ -69,6 +69,10 @@ libzfcphbaapi_la_LDFLAGS = \
-lpthread -Wl,-init,_initvlib,-fini,_finivlib \
-export-symbols $(SYMFILE)
+if VENDORLIB
+libzfcphbaapi_la_LDFLAGS += -module -avoid-version -release $(VERSION)
+endif
+
bin_PROGRAMS = zfcp_ping zfcp_show
zfcp_ping_SOURCES = fc_tools/zfcp_ping.c
diff -up lib-zfcp-hbaapi-2.1/Makefile.in.module lib-zfcp-hbaapi-2.1/Makefile.in
--- lib-zfcp-hbaapi-2.1/Makefile.in.module 2010-09-17 13:17:17.000000000 +0200
+++ lib-zfcp-hbaapi-2.1/Makefile.in 2011-01-14 10:42:44.000000000 +0100
@@ -279,6 +279,8 @@ libzfcphbaapi_la_LDFLAGS = \
-lpthread -Wl,-init,_initvlib,-fini,_finivlib \
-export-symbols $(SYMFILE)
+@VENDORLIB_TRUE@libzfcphbaapi_la_LDFLAGS += -module -avoid-version -release $(VERSION)
+
zfcp_ping_SOURCES = fc_tools/zfcp_ping.c
zfcp_ping_LDADD = -lzfcphbaapi
zfcp_show_SOURCES = fc_tools/zfcp_show.c

View File

@ -1,13 +0,0 @@
diff -up lib-zfcp-hbaapi-2.1/vlib_sg_io.c.u8 lib-zfcp-hbaapi-2.1/vlib_sg_io.c
--- lib-zfcp-hbaapi-2.1/vlib_sg_io.c.u8 2011-01-14 11:57:51.000000000 +0100
+++ lib-zfcp-hbaapi-2.1/vlib_sg_io.c 2011-01-14 11:58:05.000000000 +0100
@@ -24,6 +24,9 @@
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/time.h>
+
+typedef __u8 u8;
+
#include <scsi/scsi.h>
#include <scsi/sg.h>

View File

@ -1,37 +0,0 @@
diff -up lib-zfcp-hbaapi-2.1/Makefile.am.vendorlib lib-zfcp-hbaapi-2.1/Makefile.am
--- lib-zfcp-hbaapi-2.1/Makefile.am.vendorlib 2011-01-14 12:10:56.000000000 +0100
+++ lib-zfcp-hbaapi-2.1/Makefile.am 2011-01-14 12:12:02.000000000 +0100
@@ -76,9 +76,15 @@ endif
bin_PROGRAMS = zfcp_ping zfcp_show
zfcp_ping_SOURCES = fc_tools/zfcp_ping.c
-zfcp_ping_LDADD = -lzfcphbaapi
zfcp_show_SOURCES = fc_tools/zfcp_show.c
+
+if VENDORLIB
+zfcp_ping_LDADD = -lHBAAPI
+zfcp_show_LDADD = -lHBAAPI
+else
+zfcp_ping_LDADD = -lzfcphbaapi
zfcp_show_LDADD = -lzfcphbaapi
+endif
if DOCS
diff -up lib-zfcp-hbaapi-2.1/Makefile.in.vendorlib lib-zfcp-hbaapi-2.1/Makefile.in
--- lib-zfcp-hbaapi-2.1/Makefile.in.vendorlib 2011-01-14 12:11:01.000000000 +0100
+++ lib-zfcp-hbaapi-2.1/Makefile.in 2011-01-14 12:13:05.000000000 +0100
@@ -282,9 +282,11 @@ libzfcphbaapi_la_LDFLAGS = \
@VENDORLIB_TRUE@libzfcphbaapi_la_LDFLAGS += -module -avoid-version -release $(VERSION)
zfcp_ping_SOURCES = fc_tools/zfcp_ping.c
-zfcp_ping_LDADD = -lzfcphbaapi
zfcp_show_SOURCES = fc_tools/zfcp_show.c
-zfcp_show_LDADD = -lzfcphbaapi
+@VENDORLIB_TRUE@zfcp_ping_LDADD = -lHBAAPI
+@VENDORLIB_TRUE@zfcp_show_LDADD = -lHBAAPI
+@VENDORLIB_FALSE@zfcp_ping_LDADD = -lzfcphbaapi
+@VENDORLIB_FALSE@zfcp_show_LDADD = -lzfcphbaapi
@DOCS_FALSE@man_MANS = zfcp_show.8 zfcp_ping.8 libzfcphbaapi.3
@DOCS_TRUE@man_MANS = libzfcphbaapi.3 dox/man/man3/SupportedHBAAPIs.3 \
@DOCS_TRUE@ dox/man/man3/UnSupportedHBAAPIs.3 dox/man/man3/hbaapi.h.3 \

View File

@ -1,172 +0,0 @@
#! /bin/sh
#
# chkconfig: 2345 90 10
# description: Configure the mon_fsstatd and mon_procd daemons.
### BEGIN INIT INFO
# Provides: mon_statd
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Configure the mon_fsstatd and mon_procd daemons.
# Description: Configures the mon_fsstatd and mon_procd daemons. It uses the
# configuration file /etc/sysconfig/mon_statd.
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
exec_fsstat="/usr/sbin/mon_fsstatd"
prog_fsstat="mon_fsstatd"
exec_proc="/usr/sbin/mon_procd"
prog_proc="mon_procd"
config="/etc/sysconfig/mon_statd"
g_retval=0
lockfile_fsstat=/var/lock/subsys/$prog_fsstat
lockfile_proc=/var/lock/subsys/$prog_proc
[ -e $config ] && . $config || exit 6
load_kernel_module()
{
if [ ! -e /dev/monwriter ]; then
echo "Loading monwriter module..."
modprobe monwriter 2>&1
if [ $? -ne 0 ]; then
exit 1
fi
udevadm settle
if [ $? -ne 0 ]; then
exit 1
fi
fi
}
start_fsstat() {
[ `id -u` -eq 0 ] || exit 4
load_kernel_module
[ -x $exec_fsstat ] || exit 5
echo -n $"Starting $prog_fsstat: "
daemon $exec_fsstat -i $FSSTAT_INTERVAL
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile_fsstat
return $retval
}
start_proc() {
[ `id -u` -eq 0 ] || exit 4
load_kernel_module
[ -x $exec_proc ] || exit 5
echo -n $"Starting $prog_proc: "
daemon $exec_proc -i $PROC_INTERVAL
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile_proc
return $retval
}
stop_fsstat() {
[ `id -u` -eq 0 ] || exit 4
echo -n $"Stopping $prog_fsstat: "
killproc $exec_fsstat
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile_fsstat
return $retval
}
stop_proc() {
[ `id -u` -eq 0 ] || exit 4
echo -n $"Stopping $prog_proc: "
killproc $exec_proc
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile_proc
return $retval
}
restart_fsstat() {
stop_fsstat
start_fsstat
}
restart_proc() {
stop_proc
start_proc
}
reload_fsstat() {
restart_fsstat
}
reload_proc() {
restart_proc
}
force_reload_fsstat() {
restart_fsstat
}
force_reload_proc() {
restart_proc
}
rh_status_fsstat() {
# run checks to determine if the service is running or use generic status
status $exec_fsstat
}
rh_status_proc() {
# run checks to determine if the service is running or use generic status
status $exec_proc
}
rh_status_fsstat_q() {
rh_status_fsstat >/dev/null 2>&1
}
rh_status_proc_q() {
rh_status_proc >/dev/null 2>&1
}
case "$1" in
start)
[ $FSSTAT = "yes" ] && { rh_status_fsstat_q || { start_fsstat ; g_retval=$? ; } || { g_retval=0 ; } }
[ $PROC = "yes" ] && { rh_status_proc_q || { start_proc ; g_retval=$? ; } || { g_retval=0 ; } }
;;
stop)
[ $FSSTAT = "yes" ] && { rh_status_fsstat_q && { stop_fsstat ; g_retval=$? ; } || { g_retval=0 ; } }
[ $PROC = "yes" ] && { rh_status_proc_q && { stop_proc ; g_retval=$? ; } || { g_retval=0 ; } }
;;
restart)
[ $FSSTAT = "yes" ] && { restart_fsstat ; g_retval=$? ; }
[ $PROC = "yes" ] && { restart_proc ; g_retval=$? ; }
;;
reload)
[ $FSSTAT = "yes" ] && { rh_status_fsstat_q && { reload_fsstat ; g_retval=$? ; } || { g_retval=7 ; } }
[ $PROC = "yes" ] && { rh_status_proc_q && { reload_proc ; g_retval=$? ; } || { g_retval=7 ; } }
;;
force-reload)
[ $FSSTAT = "yes" ] && { force_reload_fsstat ; g_retval=$? ; }
[ $PROC = "yes" ] && { force_reload_proc ; g_retval=$? ; }
;;
status)
[ $FSSTAT = "yes" ] && { rh_status_fsstat ; g_retval=$? ; }
[ $PROC = "yes" ] && { rh_status_proc ; g_retval=$? ; }
;;
condrestart|try-restart)
[ $FSSTAT = "yes" ] && { rh_status_fsstat_q && { restart_fsstat ; g_retval=$? ; } || { g_retval=0 ; } }
[ $PROC = "yes" ] && { rh_status_proc_q && { restart_proc ; g_retval=$? ; } || { g_retval=0 ; } }
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac
exit $g_retval

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 @@
856ecdd42ad358433eb3fcc886b58a89 s390-tools-1.8.2.tar.bz2
71a8ee5918f2c44c385fcfe8350cdc98 cmsfs-1.1.8c.tar.gz
ecf3ff0ac4469db7297ebd6f7607fb48 lib-zfcp-hbaapi-2.1.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

Some files were not shown because too many files have changed in this diff Show More