From 9e279163927766a11740ad306278493f2d894469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Wed, 7 Jul 2010 13:42:34 +0000 Subject: [PATCH] update to match the EL-6 version --- ...nf-use-hex-index-for-chpidtype-table.patch | 47 +++ 0024-zipl-handle-SSCH-status.patch | 230 +++++++++++++ ...onvert-shows-garbage-in-progress-bar.patch | 39 +++ 0026-zipl-zfcp-dump-partition-error.patch | 32 ++ 0027-zfcpdump-disable-memory-cgroups.patch | 34 ++ 0028-fix-df-usage-in-ziomon.patch | 29 ++ ...check-for-ziorep_config-availability.patch | 102 ++++++ 0030-ziomon-fix-multipathing.patch | 46 +++ ...mismatch-between-man-and-h-in-chshut.patch | 66 ++++ 0032-lsdasd-update-man-page.patch | 48 +++ 0033-reinitialize-array-in-lsqeth.patch | 79 +++++ ...ck-the-length-of-the-parameters-line.patch | 50 +++ 0035-ziorep-follow-symlink.patch | 28 ++ ...restrict-group-names-to-be-alphanume.patch | 36 ++ 0037-znetconf-unknown-driver-for-qeth.patch | 30 ++ 0038-cpuplugd-fix-stack-overflow.patch | 90 +++++ 0039-cpuplugd-fix-cmm-limits-checks.patch | 106 ++++++ ...cpuplugd-set-cpu_min-to-1-by-default.patch | 39 +++ 0041-fix-dates-option-on-zfcpdbf.patch | 40 +++ ccw.udev | 12 + ccw_init | 176 ++++++++++ cpi.initd | 4 +- cpuplugd.initd | 114 +++++++ dasdconf.sh | 4 +- device_cio_free | 322 +++++++++++------- device_cio_free.conf | 11 + mon_statd.initd | 172 ++++++++++ s390utils.spec | 192 ++++++++++- zfcpconf.sh | 38 ++- 29 files changed, 2068 insertions(+), 148 deletions(-) create mode 100644 0023-znetconf-use-hex-index-for-chpidtype-table.patch create mode 100644 0024-zipl-handle-SSCH-status.patch create mode 100644 0025-vmconvert-shows-garbage-in-progress-bar.patch create mode 100644 0026-zipl-zfcp-dump-partition-error.patch create mode 100644 0027-zfcpdump-disable-memory-cgroups.patch create mode 100644 0028-fix-df-usage-in-ziomon.patch create mode 100644 0029-ziomon-remove-check-for-ziorep_config-availability.patch create mode 100644 0030-ziomon-fix-multipathing.patch create mode 100644 0031-mismatch-between-man-and-h-in-chshut.patch create mode 100644 0032-lsdasd-update-man-page.patch create mode 100644 0033-reinitialize-array-in-lsqeth.patch create mode 100644 0034-check-the-length-of-the-parameters-line.patch create mode 100644 0035-ziorep-follow-symlink.patch create mode 100644 0036-ts-shell-do-not-restrict-group-names-to-be-alphanume.patch create mode 100644 0037-znetconf-unknown-driver-for-qeth.patch create mode 100644 0038-cpuplugd-fix-stack-overflow.patch create mode 100644 0039-cpuplugd-fix-cmm-limits-checks.patch create mode 100644 0040-cpuplugd-set-cpu_min-to-1-by-default.patch create mode 100644 0041-fix-dates-option-on-zfcpdbf.patch create mode 100644 ccw.udev create mode 100644 ccw_init create mode 100644 cpuplugd.initd create mode 100644 device_cio_free.conf create mode 100644 mon_statd.initd diff --git a/0023-znetconf-use-hex-index-for-chpidtype-table.patch b/0023-znetconf-use-hex-index-for-chpidtype-table.patch new file mode 100644 index 0000000..6fed2eb --- /dev/null +++ b/0023-znetconf-use-hex-index-for-chpidtype-table.patch @@ -0,0 +1,47 @@ +From 3ca0d01240ab14ab3217985bf8ed9c89111e36c9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20Hor=C3=A1k?= +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 + diff --git a/0024-zipl-handle-SSCH-status.patch b/0024-zipl-handle-SSCH-status.patch new file mode 100644 index 0000000..3b1b54f --- /dev/null +++ b/0024-zipl-handle-SSCH-status.patch @@ -0,0 +1,230 @@ +From 9c94d906621e775f005fa34583671f08000f1723 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20Hor=C3=A1k?= +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 + diff --git a/0025-vmconvert-shows-garbage-in-progress-bar.patch b/0025-vmconvert-shows-garbage-in-progress-bar.patch new file mode 100644 index 0000000..7c13c59 --- /dev/null +++ b/0025-vmconvert-shows-garbage-in-progress-bar.patch @@ -0,0 +1,39 @@ +From 04859d2270d1327873e1e8825bdd9d0eaf73f5cc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20Hor=C3=A1k?= +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 + diff --git a/0026-zipl-zfcp-dump-partition-error.patch b/0026-zipl-zfcp-dump-partition-error.patch new file mode 100644 index 0000000..5864c85 --- /dev/null +++ b/0026-zipl-zfcp-dump-partition-error.patch @@ -0,0 +1,32 @@ +From 18bc3ce1055c350aaa50696e53baad984f573697 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20Hor=C3=A1k?= +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 + diff --git a/0027-zfcpdump-disable-memory-cgroups.patch b/0027-zfcpdump-disable-memory-cgroups.patch new file mode 100644 index 0000000..2a7db37 --- /dev/null +++ b/0027-zfcpdump-disable-memory-cgroups.patch @@ -0,0 +1,34 @@ +From cc672d10ef6ee3da060649fa595ed9d980e5e60e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20Hor=C3=A1k?= +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 + diff --git a/0028-fix-df-usage-in-ziomon.patch b/0028-fix-df-usage-in-ziomon.patch new file mode 100644 index 0000000..24e7d4e --- /dev/null +++ b/0028-fix-df-usage-in-ziomon.patch @@ -0,0 +1,29 @@ +From b0238ed360f65ecbf095d89c43c420ed036e4ff0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20Hor=C3=A1k?= +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 + diff --git a/0029-ziomon-remove-check-for-ziorep_config-availability.patch b/0029-ziomon-remove-check-for-ziorep_config-availability.patch new file mode 100644 index 0000000..2925582 --- /dev/null +++ b/0029-ziomon-remove-check-for-ziorep_config-availability.patch @@ -0,0 +1,102 @@ +From 2ec256f9dab30a57f60c83f7cd9b127c25b6cdd6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20Hor=C3=A1k?= +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 > 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 + diff --git a/0030-ziomon-fix-multipathing.patch b/0030-ziomon-fix-multipathing.patch new file mode 100644 index 0000000..f636f19 --- /dev/null +++ b/0030-ziomon-fix-multipathing.patch @@ -0,0 +1,46 @@ +From 3aa5fa943cea0f01beb63c90a5b0255a797ac117 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20Hor=C3=A1k?= +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 + diff --git a/0031-mismatch-between-man-and-h-in-chshut.patch b/0031-mismatch-between-man-and-h-in-chshut.patch new file mode 100644 index 0000000..8f8cddd --- /dev/null +++ b/0031-mismatch-between-man-and-h-in-chshut.patch @@ -0,0 +1,66 @@ +From 37e697ae95b3c03f962ac7bb2dd591f00b6de87b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20Hor=C3=A1k?= +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 + diff --git a/0032-lsdasd-update-man-page.patch b/0032-lsdasd-update-man-page.patch new file mode 100644 index 0000000..9dab991 --- /dev/null +++ b/0032-lsdasd-update-man-page.patch @@ -0,0 +1,48 @@ +From c3fc4200d7913b50fb8b501681a0f44e51833a81 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20Hor=C3=A1k?= +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 [ " [" "] ...]]" + + .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 + diff --git a/0033-reinitialize-array-in-lsqeth.patch b/0033-reinitialize-array-in-lsqeth.patch new file mode 100644 index 0000000..331d7e9 --- /dev/null +++ b/0033-reinitialize-array-in-lsqeth.patch @@ -0,0 +1,79 @@ +From edd35870b833548853b4c739cee1a7c0bce1fa55 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20Hor=C3=A1k?= +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 + diff --git a/0034-check-the-length-of-the-parameters-line.patch b/0034-check-the-length-of-the-parameters-line.patch new file mode 100644 index 0000000..86107bc --- /dev/null +++ b/0034-check-the-length-of-the-parameters-line.patch @@ -0,0 +1,50 @@ +From 78a9e00a3a9885298f09079c026bf5415c137cca Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20Hor=C3=A1k?= +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 + diff --git a/0035-ziorep-follow-symlink.patch b/0035-ziorep-follow-symlink.patch new file mode 100644 index 0000000..dbe821a --- /dev/null +++ b/0035-ziorep-follow-symlink.patch @@ -0,0 +1,28 @@ +From fabce87ca9d586e6da7ed0bd371f2102408c721c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20Hor=C3=A1k?= +Date: Fri, 4 Jun 2010 12:05:19 +0200 +Subject: [PATCH 35/36] ziorep - follow symlink + +Description: ziomon: fix the execution of stat to follow symlinks. +Symptom: The device mapper report is failing with a script error. +Solution: Add parameter to stat 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 + diff --git a/0036-ts-shell-do-not-restrict-group-names-to-be-alphanume.patch b/0036-ts-shell-do-not-restrict-group-names-to-be-alphanume.patch new file mode 100644 index 0000000..7a42d73 --- /dev/null +++ b/0036-ts-shell-do-not-restrict-group-names-to-be-alphanume.patch @@ -0,0 +1,36 @@ +From 379f76e4084a0d1875e1f98b2d975600639f6574 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20Hor=C3=A1k?= +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 + diff --git a/0037-znetconf-unknown-driver-for-qeth.patch b/0037-znetconf-unknown-driver-for-qeth.patch new file mode 100644 index 0000000..97f2b5a --- /dev/null +++ b/0037-znetconf-unknown-driver-for-qeth.patch @@ -0,0 +1,30 @@ +From 41d606899d4029f8ac9f3415ebd21142cb223d70 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20Hor=C3=A1k?= +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 + diff --git a/0038-cpuplugd-fix-stack-overflow.patch b/0038-cpuplugd-fix-stack-overflow.patch new file mode 100644 index 0000000..58084eb --- /dev/null +++ b/0038-cpuplugd-fix-stack-overflow.patch @@ -0,0 +1,90 @@ +From b0192c18160e5ea35889794895becab99890bca3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20Hor=C3=A1k?= +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 + diff --git a/0039-cpuplugd-fix-cmm-limits-checks.patch b/0039-cpuplugd-fix-cmm-limits-checks.patch new file mode 100644 index 0000000..d620813 --- /dev/null +++ b/0039-cpuplugd-fix-cmm-limits-checks.patch @@ -0,0 +1,106 @@ +From 664177c0fe57f671ad0d1eeed18374d77233d4b4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20Hor=C3=A1k?= +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 + diff --git a/0040-cpuplugd-set-cpu_min-to-1-by-default.patch b/0040-cpuplugd-set-cpu_min-to-1-by-default.patch new file mode 100644 index 0000000..572f9e4 --- /dev/null +++ b/0040-cpuplugd-set-cpu_min-to-1-by-default.patch @@ -0,0 +1,39 @@ +From 4a2b6aa7b2a873be78c27d2abe010cd7e73d9640 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20Hor=C3=A1k?= +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 + diff --git a/0041-fix-dates-option-on-zfcpdbf.patch b/0041-fix-dates-option-on-zfcpdbf.patch new file mode 100644 index 0000000..1f39594 --- /dev/null +++ b/0041-fix-dates-option-on-zfcpdbf.patch @@ -0,0 +1,40 @@ +From e30dc240e7417b83957507f1da6b34c31f18afb5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20Hor=C3=A1k?= +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 + diff --git a/ccw.udev b/ccw.udev new file mode 100644 index 0000000..2c6a805 --- /dev/null +++ b/ccw.udev @@ -0,0 +1,12 @@ +ACTION!="add|change", GOTO="ccw_end" +SUBSYSTEM!="ccw", GOTO="ccw_end" +SYSFS{cutype}=="1731/01", RUN+="ccw_init" +SYSFS{cutype}=="1731/05", RUN+="ccw_init" +SYSFS{cutype}=="1731/06", RUN+="ccw_init" +SYSFS{cutype}=="3088/01", RUN+="ccw_init" +SYSFS{cutype}=="3088/08", RUN+="ccw_init" +SYSFS{cutype}=="3088/60", RUN+="ccw_init" +SYSFS{cutype}=="3088/61", RUN+="ccw_init" +SYSFS{cutype}=="3088/1E", RUN+="ccw_init" +SYSFS{cutype}=="3088/1F", RUN+="ccw_init" +LABEL="ccw_end" diff --git a/ccw_init b/ccw_init new file mode 100644 index 0000000..8eabbe2 --- /dev/null +++ b/ccw_init @@ -0,0 +1,176 @@ +#! /bin/sh + +[ -z "$DEVPATH" ] && exit 0 +[ "$SUBSYSTEM" != "ccw" ] && exit 0 + +[ -e /etc/ccw.conf ] && MODE="dracut" || MODE="normal" +OLD_IFS="$IFS" + +get_config_line_by_subchannel() +{ + local CHANNEL + CHANNEL="$1" + while read line; do + IFS="," + set $line + IFS="$OLD_IFS" + for i in $@; do + if [ "$CHANNEL" = "$i" ]; then + echo $line + return 0 + fi + done + done < /etc/ccw.conf + return 1 +} + +CHANNEL=${DEVPATH##*/} + +if [ $MODE = "dracut" ]; then + CONFIG_LINE=$(get_config_line_by_subchannel $CHANNEL) + + [ $? -ne 0 -o -z "$CONFIG_LINE" ] && break + + IFS="," + set $CONFIG_LINE + IFS="$OLD_IFS" + NETTYPE=$1 + shift + SUBCHANNELS="$1" + OPTIONS="" + shift + while [ $# -gt 0 ]; do + case $1 in + *=*) OPTIONS="$OPTIONS $1";; + [0-9]*) SUBCHANNELS="$SUBCHANNELS,$1";; + esac + shift + done +elif [ $MODE = "normal" ]; then + NOLOCALE="yes" + + . /etc/sysconfig/network-scripts/network-functions + + CONFIG_FILE=$(get_config_by_subchannel $CHANNEL) + + if [ -n "$CONFIG_FILE" ]; then + . $CONFIG_FILE + else + exit 1 + fi +else + echo "Unknown mode=$MODE" + exit 1 +fi + + +# now we have extracted these variables from the config files: +# SUBCHANNELS +# OPTIONS + +# put LAYER2 option into its own variable +set $OPTIONS +OPTIONS="" +while [ $# -gt 0 ]; do + case $1 in + layer2=*) LAYER2=${1##layer2=};; + *=*) OPTIONS="$OPTIONS $1";; + esac + shift +done + +# translate variables from the interface config files to OPTIONS +if [ -n "$PORTNAME" ]; then + if [ "$NETTYPE" = "lcs" ]; then + OPTIONS="$OPTIONS portno=$PORTNAME" + else + OPTIONS="$OPTIONS portname=$PORTNAME" + fi +fi +if [ "$NETTYPE" = "ctc" -a -n "$CTCPROT" ]; then + OPTIONS="$OPTIONS protocol=$CTCPROTO" +fi + +# SUBCHANNELS is only set on mainframe ccwgroup devices +[ -z "$SUBCHANNELS" -o -z "$NETTYPE" ] && exit 0 +if [ "$NETTYPE" = "ctc" ]; then + DIR="/sys/bus/ccwgroup/drivers/ctcm" +else + DIR="/sys/bus/ccwgroup/drivers/$NETTYPE" +fi + +i=0 +while [ $i -lt 20 ]; do + [ -e $DIR ] && break + sleep 0.1 + i=$(($i+1)) +done + +# driver missing or not loaded +[ ! -e $DIR ] && exit 0 + +IFS="," +set $SUBCHANNELS +IFS="$OLD_IFS" +CHANNEL1=$1 +CHANNEL2=$2 +SYSDIR="$DIR/$CHANNEL1" + +[ -e $SYSDIR ] && exit 0 + +# check if the interface is already online +if [ -e $SYSDIR/online ]; then + read on <$SYSDIR/online + [ "$on" = "1" ] && exit 0 +fi + +DRIVER=$(readlink $DEVPATH/driver) +DRIVER=${DRIVER##*/} +if [ "$DRIVER" = "lcs" -a "$NETTYPE" = "ctc" ]; then + echo "$CHANNEL" > /sys/bus/ccw/drivers/lcs/unbind + echo "$CHANNEL" > /sys/bus/ccw/drivers/ctcm/bind + echo "$CHANNEL2" > /sys/bus/ccw/drivers/lcs/unbind + echo "$CHANNEL2" > /sys/bus/ccw/drivers/ctcm/bind +fi +if [ "$DRIVER" = "ctcm" -a "$NETTYPE" = "lcs" ]; then + echo "$CHANNEL" > /sys/bus/ccw/drivers/ctcm/unbind + echo "$CHANNEL" > /sys/bus/ccw/drivers/lcs/bind + echo "$CHANNEL2" > /sys/bus/ccw/drivers/ctcm/unbind + echo "$CHANNEL2" > /sys/bus/ccw/drivers/lcs/bind +fi + +if [ ! -e $SYSDIR ]; then + echo "$SUBCHANNELS" > $DIR/group + i=0 + while [ $i -lt 20 ]; do + [ -e $SYSDIR ] && break + sleep 0.1 + i=$(($i+1)) + done + + [ ! -e $SYSDIR ] && exit 1 +fi + +# check if the interface is already online +if [ -e $SYSDIR/online ]; then + read on <$SYSDIR/online + [ "$on" = "1" ] && exit 0 +fi + +# first set layer2, other options may depend on it +[ -n "$LAYER2" ] && echo $LAYER2 > $SYSDIR/layer2 + +if [ -n "$OPTIONS" ]; then + for i in $OPTIONS; do + OPT=${i%%=*} + VAL=${i##*=} + if [ -e "$SYSDIR/$OPT" ]; then + echo "$VAL" > "$SYSDIR/$OPT" || \ + echo "Could not set value \"$VAL\" for OPTION \"$OPT\" with SUBCHANNELS \"$SUBCHANNELS\"" + else + echo "OPTION \"$OPT\" does not exist for SUBCHANNELS \"$SUBCHANNELS\"" + fi + done +fi + +[ -e $SYSDIR/online ] && echo 1 > $SYSDIR/online diff --git a/cpi.initd b/cpi.initd index 463a2e5..80977fb 100644 --- a/cpi.initd +++ b/cpi.initd @@ -8,7 +8,7 @@ # # chkconfig: 12345 80 20 # description: Set Control Program Identification on IBM zSeries \ -# that's reported from Linux guest to a LPAR or z/VM +# that's reported on a Linux LPAR ### BEGIN INIT INFO # Provides: cpi @@ -20,7 +20,7 @@ # Default-Stop: 0 6 # Short-Description: Set control program identification on IBM zSeries # Description: Set Control Program Identification on IBM zSeries \ -# that's reported from Linux guest to a LPAR or z/VM +# that's reported on a Linux LPAR ### END INIT INFO # Source function library. diff --git a/cpuplugd.initd b/cpuplugd.initd new file mode 100644 index 0000000..4e6ad9f --- /dev/null +++ b/cpuplugd.initd @@ -0,0 +1,114 @@ +#! /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 $? diff --git a/dasdconf.sh b/dasdconf.sh index fb3ac90..2be5276 100644 --- a/dasdconf.sh +++ b/dasdconf.sh @@ -14,7 +14,7 @@ CHANNEL=${DEVPATH##*/} CONFIG=/etc/dasd.conf -PATH=/sbin:/bin:/usr/sbin:/usr/bin +PATH=/sbin:/bin export PATH warn() { @@ -27,7 +27,7 @@ if [ -f "$CONFIG" ]; then #warn "No dasd-eckd or dasd-eckd loaded" exit 0 fi - tr "A-Z" "a-z" < $CONFIG | while read line; do + sed 'y/ABCDEF/abcdef/' < $CONFIG | while read line; do case $line in \#*) ;; *) diff --git a/device_cio_free b/device_cio_free index 557427a..416224b 100644 --- a/device_cio_free +++ b/device_cio_free @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright 2009 Red Hat, Inc. +# Copyright 2009, 2010 Red Hat, Inc. # License: GPLv2 # Author: Dan Horák # @@ -14,53 +14,67 @@ # # also processes the system ccw config file and network interface configurations # +# requires: echo, sleep, modprobe, grep, printf, sed. +# +# it is used in +# anaconda +# dracut generated initramfs +# normal system startup driven by upstart +# DASDCONFIG=/etc/dasd.conf ZFCPCONFIG=/etc/zfcp.conf ZNETCONFIG=/etc/ccw.conf BLACKLIST=/proc/cio_ignore VERBOSE= -PATH=/bin:/usr/bin:/sbin:/usr/sbin -ALL_DEVICES= +PATH=/bin:/sbin +DEVICE= # list of devices given on command line +ALL_DEVICES= # list of all unblocked devices WAITING_TIMEOUT=60 # maximum time to wait for all devices to appear WAITING_TOTAL=0 # actual time spent waiting for devices usage() { - echo "Usage: $CMD [-h|--help] [-V|--verbose]" + echo "Usage: $CMD [-h|--help] [-V|--verbose] [-d|--device ]" + echo " -h|--help print this message" + echo " -V|--verbose be verbose" + echo " -d|--device unblock and wait for specified device" exit 1 } # accepts single device, comma-separated lists and dash separated ranges and their combinations +# the comma separated list is split so we minimize the effect of unsuccessful freeing free_device() { - local DEV + local DEV DEV_LIST [ -z "$1" ] && return - DEV=$(echo $1 | tr "A-Z" "a-z") - - [ $VERBOSE ] && echo "Freeing device(s) $DEV" - if ! echo "free $DEV" > $BLACKLIST 2> /dev/null ; then - echo "Error: can't free device(s) $DEV" - else - if [ -z $ALL_DEVICES ]; then - ALL_DEVICES=$DEV + DEV_LIST=$(echo "$1" | sed 'y/ABCDEF/abcdef/' | sed 's/,/ /g') + + for DEV in $DEV_LIST; do + [ $VERBOSE ] && echo "Freeing device(s) $DEV" + if ! echo "free $DEV" > $BLACKLIST 2> /dev/null ; then + echo "Error: can't free device(s) $DEV" else - ALL_DEVICES="$ALL_DEVICES,$DEV" + if [ -z $ALL_DEVICES ]; then + ALL_DEVICES="$DEV" + else + ALL_DEVICES="$ALL_DEVICES,$DEV" + fi fi - fi + done } # wait until a device appears on the ccw bus -wait_on_device() +wait_on_single_device() { local DEVICE_ONLINE DEV [ -z "$1" ] && return - DEV=$1 - DEVICE_ONLINE=/sys/bus/ccw/devices/$DEV/online + DEV="$1" + DEVICE_ONLINE="/sys/bus/ccw/devices/$DEV/online" [ $VERBOSE ] && echo "Waiting on device $DEV" [ -f "$DEVICE_ONLINE" ] && return @@ -79,52 +93,75 @@ wait_on_device() echo "Error: device $DEV still not ready" } -# check how we were called -CMD=$(basename "$0") -case $CMD in - "dasd_cio_free") - CONFIG=$DASDCONFIG - MODE=dasd - ;; - "zfcp_cio_free") - CONFIG=$ZFCPCONFIG - MODE=zfcp - ;; - "znet_cio_free") - CONFIG=$ZNETCONFIG - MODE=znet - ;; - *) - echo "Error: unknown alias '$CMD'." - echo "Supported aliases are dasd_cio_free, zfcp_cio_free and znet_cio_free." - exit 1 - ;; -esac +# wait until recently unblocked devices are ready +# at this point we know the content of ALL_DEVICES is syntacticly correct +wait_on_devices() +{ + OLD_IFS=$IFS + IFS="," + set $ALL_DEVICES + for DEV in $* + do + IFS="." -# process command line options -if [ $# -gt 0 ]; then - case $1 in - -V|--verbose) - VERBOSE=yes - shift - ;; - -h|--help) - usage - ;; - *) - echo "Error: unknown option $1" - usage - ;; - esac -fi + # get the lower bound for range or get the single device + LOWER=${DEV%%-*} + set $LOWER + if [ $# -eq 1 ]; then + L0=0 + L1=0 + L2=$(printf "%d" "0x$1") + else + L0=$(printf "%d" "0x$1") + L1=$(printf "%d" "0x$2") + L2=$(printf "%d" "0x$3") + fi -if [ ! -f $BLACKLIST ]; then - echo "Error: $BLACKLIST kernel interface doesn't exist" - exit 2 -fi + # get the upper bound for range or get the single device + UPPER=${DEV##*-} + set $UPPER + if [ $# -eq 1 ]; then + U0=0 + U1=0 + U2=$(printf "%d" "0x$1") + else + U0=$(printf "%d" "0x$1") + U1=$(printf "%d" "0x$2") + U2=$(printf "%d" "0x$3") + fi -if [ $MODE = "dasd" -o $MODE = "zfcp" ]; then - # process the config file + IFS=$OLD_IFS + + # iterate thru all devices + i=$L0 + while [ $i -le $U0 ]; do + [ $i -eq $L0 ] && LJ=$L1 || LJ=0 + [ $i -eq $U0 ] && UJ=$U1 || UJ=3 + + j=$LJ + while [ $j -le $UJ ]; do + [ $i -eq $L0 -a $j -eq $L1 ] && LK=$L2 || LK=0 + [ $i -eq $U0 -a $j -eq $U1 ] && UK=$U2 || UK=65535 + + k=$LK + while [ $k -le $UK ]; do + wait_on_single_device "$(printf %x.%x.%04x $i $j $k)" + k=$(($k + 1)) + done + j=$(($j + 1)) + done + i=$(($i + 1)) + done + done +} + +process_config_file() +{ + local CONFIG + + [ -z "$1" ] && return + + CONFIG="$1" if [ -f "$CONFIG" ]; then while read line; do case $line in @@ -135,93 +172,134 @@ if [ $MODE = "dasd" -o $MODE = "zfcp" ]; then free_device $1 ;; esac - done < $CONFIG + done < "$CONFIG" fi +} + +# check how we were called +CMD=${0##*/} +DIR=${0%/*} +ARGS=$@ +case $CMD in + "dasd_cio_free") + MODE_DASD="yes" + ;; + "zfcp_cio_free") + MODE_ZFCP="yes" + ;; + "znet_cio_free") + MODE_ZNET="yes" + ;; + "device_cio_free") + MODE_DASD="yes" + MODE_ZFCP="yes" + MODE_ZNET="yes" + ;; + *) + echo "Error: unknown alias '$CMD'." + echo "Supported aliases are dasd_cio_free, zfcp_cio_free and znet_cio_free." + exit 1 + ;; +esac + +# process command line options +while [ $# -gt 0 ]; do + case $1 in + -V|--verbose) + VERBOSE=yes + ;; + -h|--help) + usage + ;; + -d|--device) + shift + if [ "$1" ]; then + if [ "$DEVICE" ]; then + DEVICE="$DEVICE,$1" + else + DEVICE=$1 + fi + else + echo "Error: no device given" + usage + fi + ;; + *) + echo "Error: unknown option $1" + usage + ;; + esac + shift +done + +if [ ! -f $BLACKLIST ]; then + echo "Error: $BLACKLIST kernel interface doesn't exist" + exit 2 fi -if [ $MODE = "dasd" ]; then +if [ "$DEVICE" ]; then + [ $VERBOSE ] && echo "Freeing specific devices" + free_device $DEVICE + wait_on_devices + exit 0 +fi + +if [ $VERBOSE ]; then + echo -n "Freeing devices:" + [ $MODE_DASD ] && echo -n " dasd" + [ $MODE_ZFCP ] && echo -n " zfcp" + [ $MODE_ZNET ] && echo -n " znet" + echo +fi + +[ $MODE_DASD ] && process_config_file $DASDCONFIG +[ $MODE_ZFCP ] && process_config_file $ZFCPCONFIG + +if [ $MODE_DASD ]; then # process the device list defined as option for the dasd module - DEVICES=$(modprobe --showconfig | grep "options[[:space:]]\+dasd_mod" | \ + DEVICES=$(modprobe --showconfig | LANG=C grep "options[[:space:]]\+dasd_mod" | \ sed -e 's/.*[[:space:]]dasd=\([^[:space:]]*\).*/\1/' -e 's/([^)]*)//g' \ -e 's/nopav\|nofcx\|autodetect\|probeonly//g' -e 's/,,/,/g' -e 's/^,//' -e 's/,$//') - for DEVRANGE in $(echo $DEVICES | tr ',' ' '); do + for DEVRANGE in $(echo $DEVICES | sed 's/,/ /g'); do free_device $DEVRANGE done fi -if [ $MODE = "znet" ]; then +if [ $MODE_ZNET ]; then # process the config file - if [ -f "$CONFIG" ]; then + if [ -f "$ZNETCONFIG" ]; then while read line; do case $line in \#*) ;; *) [ -z "$line" ] && continue - # grep 2 or 3 channels from beginning of each line - DEVICES=$(echo $line | grep -E -i -o "^([0-9]\.[0-9]\.[a-f0-9]+,){1,2}([0-9]\.[0-9]\.[a-f0-9]+)") + # grep 2 or 3 channels from each ",," line + DEVICES=$(echo $line | LANG=C grep -E -i -o "([0-9]\.[0-9]\.[a-f0-9]+,){1,2}([0-9]\.[0-9]\.[a-f0-9]+)") free_device $DEVICES ;; esac - done < $CONFIG + done < "$ZNETCONFIG" fi # process channels from network interface configurations - for line in $(grep -E -i -h "^[[:space:]]*SUBCHANNELS=['\"]?([0-9]\.[0-9]\.[a-f0-9]+,){1,2}([0-9]\.[0-9]\.[a-f0-9]+)['\"]?([[:space:]]+#|[[:space:]]*$)" /etc/sysconfig/network-scripts/ifcfg-* 2> /dev/null) + if [ -z "$__sed_discard_ignored_files" ]; then + if [ -f /etc/init.d/functions ]; then + . /etc/init.d/functions + else + # default value copied from initscripts 9.03.10 + __sed_discard_ignored_files='/\(~\|\.bak\|\.orig\|\.rpmnew\|\.rpmorig\|\.rpmsave\)$/d' + fi + fi + for line in $(LANG=C grep -E -i -h \ + "^[[:space:]]*SUBCHANNELS=['\"]?([0-9]\.[0-9]\.[a-f0-9]+,){1,2}([0-9]\.[0-9]\.[a-f0-9]+)['\"]?([[:space:]]+#|[[:space:]]*$)" \ + $( (ls /etc/sysconfig/network-scripts/ifcfg-* 2> /dev/null || echo "__no_config_file") | \ + LC_ALL=C sed -e "$__sed_discard_ignored_files") 2> /dev/null) do eval "$line" free_device $SUBCHANNELS done fi -# wait until recently unblocked devices are ready -# at this point we know the content of ALL_DEVICES is syntacticly correct -OLD_IFS=$IFS -IFS="," -set $ALL_DEVICES -for DEV in $* -do - IFS="." +[ -z "$ALL_DEVICES" ] && exit 0 - # get the lower bound for range or get the single device - LOWER=${DEV%%-*} - set $LOWER - if [ $# -eq 1 ]; then - L0=0 - L1=0 - L2=$(printf "%d" "0x$1") - else - L0=$(printf "%d" "0x$1") - L1=$(printf "%d" "0x$2") - L2=$(printf "%d" "0x$3") - fi - - # get the upper bound for range or get the single device - UPPER=${DEV##*-} - set $UPPER - if [ $# -eq 1 ]; then - U0=0 - U1=0 - U2=$(printf "%d" "0x$1") - else - U0=$(printf "%d" "0x$1") - U1=$(printf "%d" "0x$2") - U2=$(printf "%d" "0x$3") - fi - - IFS=$OLD_IFS - - # iterate thru all devices - for i in $(seq $L0 $U0); do - [ $i -eq $L0 ] && LJ=$L1 || LJ=0 - [ $i -eq $U0 ] && UJ=$U1 || UJ=3 - - for j in $(seq $LJ $UJ); do - [ $i -eq $L0 -a $j -eq $L1 ] && LK=$L2 || LK=0 - [ $i -eq $U0 -a $j -eq $U1 ] && UK=$U2 || UK=65535 - - for k in $(seq $LK $UK); do - wait_on_device "$(printf %x.%x.%04x $i $j $k)" - done - done - done -done +wait_on_devices diff --git a/device_cio_free.conf b/device_cio_free.conf new file mode 100644 index 0000000..8d61531 --- /dev/null +++ b/device_cio_free.conf @@ -0,0 +1,11 @@ +# +# free all devices on startup +# + +start on starting rcS + +task + +console output + +exec /sbin/device_cio_free diff --git a/mon_statd.initd b/mon_statd.initd new file mode 100644 index 0000000..089572b --- /dev/null +++ b/mon_statd.initd @@ -0,0 +1,172 @@ +#! /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 + udevsettle + 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 diff --git a/s390utils.spec b/s390utils.spec index 5c46fcf..de94c27 100644 --- a/s390utils.spec +++ b/s390utils.spec @@ -8,7 +8,7 @@ Name: s390utils Summary: Utilities and daemons for IBM System/z Group: System Environment/Base Version: 1.8.2 -Release: 10%{?dist}.1 +Release: 28%{?dist} Epoch: 2 License: GPLv2 and GPLv2+ and CPL Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -32,6 +32,11 @@ Source11: cpi.sysconfig Source12: dasd.udev Source13: dasdconf.sh Source14: device_cio_free +Source15: device_cio_free.conf +Source16: ccw_init +Source17: ccw.udev +Source18: cpuplugd.initd +Source19: mon_statd.initd Patch1: 0001-s390-tools-1.5.3-zipl-zfcpdump-2.patch Patch2: 0002-s390-tools-1.8.1-zipl-automenu.patch @@ -55,6 +60,25 @@ Patch19: 0019-ziorep-fix-return-codes.patch Patch20: 0020-lstape-fix-return-code.patch Patch21: 0021-cpuplugd-fix-reading-the-size-of-proc-sys-vm-cmm_pag.patch Patch22: 0022-lsqeth-support-new-attributes.patch +Patch23: 0023-znetconf-use-hex-index-for-chpidtype-table.patch +Patch24: 0024-zipl-handle-SSCH-status.patch +Patch25: 0025-vmconvert-shows-garbage-in-progress-bar.patch +Patch26: 0026-zipl-zfcp-dump-partition-error.patch +Patch27: 0027-zfcpdump-disable-memory-cgroups.patch +Patch28: 0028-fix-df-usage-in-ziomon.patch +Patch29: 0029-ziomon-remove-check-for-ziorep_config-availability.patch +Patch30: 0030-ziomon-fix-multipathing.patch +Patch31: 0031-mismatch-between-man-and-h-in-chshut.patch +Patch32: 0032-lsdasd-update-man-page.patch +Patch33: 0033-reinitialize-array-in-lsqeth.patch +Patch34: 0034-check-the-length-of-the-parameters-line.patch +Patch35: 0035-ziorep-follow-symlink.patch +Patch36: 0036-ts-shell-do-not-restrict-group-names-to-be-alphanume.patch +Patch37: 0037-znetconf-unknown-driver-for-qeth.patch +Patch38: 0038-cpuplugd-fix-stack-overflow.patch +Patch39: 0039-cpuplugd-fix-cmm-limits-checks.patch +Patch40: 0040-cpuplugd-set-cpu_min-to-1-by-default.patch +Patch41: 0041-fix-dates-option-on-zfcpdbf.patch Patch1000: 1000-ziomon-linker.patch @@ -152,6 +176,63 @@ be used together with the zSeries (s390) Linux kernel and device drivers. # Support new attributes in lsqeth (#556915) %patch22 -p1 -b .lsqeth-new-attrs +# Use hex index for chpidtype table in znetconf (#561056) +%patch23 -p1 -b .znetconf-hex-chpidtype + +# Handle status during IPL SSCH (#559250) +%patch24 -p1 -b .zipl-handle-ssch-status + +# Don't show garbage in vmconvert's progress bar (#567681) +%patch25 -p1 -b .vmconvert-progress-bar + +# Fix zfcp dump partition error (#572313) +%patch26 -p1 -b .zfcp-dump-partition + +# Don't use memory cgroups in zfcpdump kernel (#575183) +%patch27 -p1 -b .zfcpdump-cgroups + +# Fix df usage in ziomon (#575833) +%patch28 -p1 -b .ziomon-df + +# Remove check for ziorep_config availability (#576579) +%patch29 -p1 -b .ziorep_config + +# Fix multipathing in ziomon (#577318) +%patch30 -p1 -b .ziomon-multipath-2 + +# Fixed mismatch between man and -h in chshut (#563625) +%patch31 -p1 -b .man-mismatch + +# Update lsdasd man page (#587044) +%patch32 -p1 -b .lsdasd-man + +# Reinitialize array in lsqeth (#587599) +%patch33 -p1 -b .lsqeth-reinit-array + +# Check the length of the parameters line (#594031) +%patch34 -p1 -b .zipl-max-parmline + +# Follow symlinks in ziorep (#598574) +%patch35 -p1 -b .ziorep-follow-symlinks + +# Do not restrict group names to be alphanumeric in ts-shell (#598641) +%patch36 -p1 -b .ts-shell-groups + +# znetconf --drive|-d option returning 'unknown driver' for qeth (#601846) +%patch37 -p1 -b .znetconf-driver-option + +# Fix stack overwrite in cpuplugd (#601847) +%patch38 -p1 -b .cpuplugd-stack-overwrite + +# Fix cmm_min/max limit checks in cpuplugd (#606366) +%patch39 -p1 -b .cpuplugd-cmm-limits + +# Set cpu_min to 1 by default in cpuplugd (#606416) +%patch40 -p1 -b .cpuplugd-cpu_min + +# Fix --dates option in zfcpdbf (#609092) +%patch41 -p1 -b .zfcpdbf-dates + # Fix linking with --no-add-needed %patch1000 -p1 -b .linker @@ -206,11 +287,11 @@ popd %build -make OPT_FLAGS="$RPM_OPT_FLAGS" DISTRELEASE=%{release} V=1 +make OPT_FLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" DISTRELEASE=%{release} V=1 pushd cmsfs-%{cmsfsver} ./configure -make CC="gcc $RPM_OPT_FLAGS" +make CC="gcc $RPM_OPT_FLAGS -fno-strict-aliasing" popd pushd src_vipa-%{vipaver} @@ -219,7 +300,7 @@ popd pushd lib-zfcp-hbaapi-%{hbaapiver} %configure --disable-static -make EXTRA_CFLAGS="$RPM_OPT_FLAGS" +make EXTRA_CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" popd @@ -252,10 +333,10 @@ install -p -m 644 etc/sysconfig/dumpconf ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconf install -p -m 755 etc/init.d/dumpconf ${RPM_BUILD_ROOT}%{_initddir}/dumpconf install -p -m 644 etc/sysconfig/mon_statd ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig -install -p -m 755 etc/init.d/mon_statd ${RPM_BUILD_ROOT}%{_initddir}/mon_statd +install -p -m 755 %{SOURCE19} ${RPM_BUILD_ROOT}%{_initddir}/mon_statd install -p -m 644 etc/sysconfig/cpuplugd ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig -install -p -m 755 etc/init.d/cpuplugd ${RPM_BUILD_ROOT}%{_initddir}/cpuplugd +install -p -m 755 %{SOURCE18} ${RPM_BUILD_ROOT}%{_initddir}/cpuplugd install -Dp -m 644 etc/udev/rules.d/*.rules ${RPM_BUILD_ROOT}%{_sysconfdir}/udev/rules.d @@ -300,6 +381,13 @@ for lnk in dasd zfcp znet; do ln -sf device_cio_free ${lnk}_cio_free done popd +mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/init +install -p -m 644 %{SOURCE15} ${RPM_BUILD_ROOT}%{_sysconfdir}/init + +# ccw +mkdir -p ${RPM_BUILD_ROOT}/lib/udev/rules.d +install -p -m 755 %{SOURCE16} ${RPM_BUILD_ROOT}/lib/udev/ccw_init +install -p -m 644 %{SOURCE17} ${RPM_BUILD_ROOT}/lib/udev/rules.d/81-ccw.rules %clean @@ -320,6 +408,7 @@ Summary: S390 base tools Group: System Environment/Base Requires: perl gawk sed coreutils Requires: sysfsutils +Requires: sg3_utils Requires(pre): chkconfig Requires(preun): chkconfig Requires(preun): initscripts @@ -564,6 +653,9 @@ fi /sbin/device_cio_free /sbin/zfcp_cio_free /sbin/znet_cio_free +%{_sysconfdir}/init/device_cio_free.conf +/lib/udev/ccw_init +/lib/udev/rules.d/81-ccw.rules # src_vipa %{_bindir}/src_vipa.sh @@ -598,7 +690,7 @@ ATM Ethernet LAN Emulation in QDIO mode. License: GPLv2 Summary: Monitoring daemons for Linux in z/VM Group: System Environment/Daemons -Requires: redhat-lsb coreutils +Requires: coreutils Requires(pre): chkconfig Requires(preun): chkconfig Requires(preun): initscripts @@ -639,7 +731,7 @@ fi License: GPLv2+ Summary: Daemon that manages CPU and memory resources Group: System Environment/Daemons -Requires: redhat-lsb coreutils +Requires: coreutils Requires(pre): chkconfig Requires(preun): chkconfig Requires(preun): initscripts @@ -851,9 +943,88 @@ User-space development files for the s390/s390x architecture. %changelog -* Thu Jun 10 2010 Dan Horák 2:1.8.2-10.1 +* Wed Jul 7 2010 Dan Horák 2:1.8.2-28 - fix linking with --no-add-needed +* Tue Jun 29 2010 Dan Horák 2:1.8.2-27 +- make znet_cio_free work also when no interface config files exists (#609073) +- fix --dates option in zfcpdbf (#609092) + +* Mon Jun 28 2010 Dan Horák 2:1.8.2-26 +- follow symlinks in ziorep (#598574) +- do not restrict group names to be alphanumeric in ts-shell (#598641) +- znetconf --drive|-d option returning 'unknown driver' for qeth (#601846) +- fix stack overwrite in cpuplugd (#601847) +- fix cmm_min/max limit checks in cpuplugd (#606366) +- set cpu_min to 1 by default in cpuplugd (#606416) +- build with -fno-strict-aliasing (#599396) +- remove reference to z/VM from the cpi initscript (#601753) +- fix return values for the mon_statd initscript (#606805) +- ignore backup and similar config files in device_cio_free (#533494) + +* Fri May 28 2010 Dan Horák 2:1.8.2-25 +- fixed device_cio_free command line handling (#595569) + +* Thu May 20 2010 Dan Horák 2:1.8.2-24 +- added a check for the length of the parameters line (#594031) + +* Wed May 19 2010 Dan Horák 2:1.8.2-23 +- make ccw_init compatible with posix shell (#546615) + +* Wed May 5 2010 Dan Horák 2:1.8.2-22 +- scripts can't depend on stuff from /usr (#587364) + +* Mon May 3 2010 Dan Horák 2:1.8.2-21 +- updated patch for the "reinitialize array in lsqeth" issue (#587757) + +* Fri Apr 30 2010 Dan Horák 2:1.8.2-20 +- updated lsdasd man page (#587044) +- reinitialize array in lsqeth (#587599) + +* Wed Apr 28 2010 Dan Horák 2:1.8.2-19 +- fixed mismatch between man and -h in chshut (#563625) +- use the merged ccw_init script (#533494, #561814) + +* Thu Apr 22 2010 Dan Horák 2:1.8.2-18 +- lsluns utility from the base subpackage requires sg3_utils + +* Wed Apr 21 2010 Dan Horák 2:1.8.2-17 +- updated device_cio_free script (#576015) + +* Wed Mar 31 2010 Dan Horák 2:1.8.2-16 +- updated device_cio_free upstart config file (#578260) +- fix multipathing in ziomon (#577318) + +* Mon Mar 29 2010 Dan Horák 2:1.8.2-15 +- remove check for ziorep_config availability (#576579) +- install upstart event file into /etc/init (#561339) +- device_cio_free updates + - don't use basename/dirname + - correctly parse /etc/ccw.conf (#533494) + +* Mon Mar 22 2010 Dan Horák 2:1.8.2-14 +- don't use memory cgroups in zfcpdump kernel (#575183) +- fix df usage in ziomon (#575833) + +* Thu Mar 11 2010 Dan Horák 2:1.8.2-13 +- dropped dependency on redhat-lsb (#542702) + +* Wed Mar 10 2010 Dan Horák 2:1.8.2-12 +- run device_cio_free on startup (#561339) +- use hex index for chpidtype table in znetconf (#561056) +- handle status during IPL SSCH (#559250) +- don't show garbage in vmconvert's progress bar (#567681) +- don't print enviroment when there are no devices to wait for (#570763) +- fix zfcp dump partition error (#572313) +- switched to new initscripts for cpuplugd and fsstatd/procd (#524218, #524477) + +* Tue Feb 16 2010 Dan Horák 2:1.8.2-11 +- moved ccw udev stuff from initscripts to s390utils +- updated ccw_init with delay loops and layer2 handling (#561926) + +* Fri Jan 22 2010 Dan Horák 2:1.8.2-10.1 +- really update zfcpconf.sh script from dracut + * Wed Jan 20 2010 Dan Horák 2:1.8.2-10 - fixed return codes in ziorep (#556849) - fixed return code in lstape (#556910) @@ -870,6 +1041,9 @@ User-space development files for the s390/s390x architecture. * Fri Jan 8 2010 Dan Horák 2:1.8.2-7 - updated device_cio_free script (#533494) +* Tue Dec 22 2009 Dan Horák 2:1.8.2-6.1 +- fixed return value in cpi initscript (#541389) + * Tue Dec 22 2009 Dan Horák 2:1.8.2-6 - fixed return value in cpi initscript (#541389) - updated zfcpconf.sh script from dracut diff --git a/zfcpconf.sh b/zfcpconf.sh index a1f474c..ff8506f 100644 --- a/zfcpconf.sh +++ b/zfcpconf.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # config file syntax: # deviceno WWPN FCPLUN @@ -19,25 +19,37 @@ # echo 0x5022000000000000 > /sys/bus/ccw/drivers/zfcp/0.0.4000/0x5005076300c213e9/unit_add CONFIG=/etc/zfcp.conf -PATH=/bin:/usr/bin:/sbin:/usr/sbin +PATH=/bin:/sbin if [ -f "$CONFIG" ]; then - if [ ! -d /sys/bus/ccw/drivers/zfcp ]; then modprobe zfcp fi if [ ! -d /sys/bus/ccw/drivers/zfcp ]; then return fi - cat $CONFIG | grep -v "^#" | tr "A-Z" "a-z" | while read line; do - numparams=$(echo $line | wc -w) - if [ $numparams == 5 ]; then - read DEVICE SCSIID WWPN SCSILUN FCPLUN < <(echo $line) - echo "Warning: Deprecated values in /etc/zfcp.conf, ignoring SCSI ID $SCSIID and SCSI LUN $SCSILUN" - elif [ $numparams == 3 ]; then - read DEVICE WWPN FCPLUN < <(echo $line) - fi - echo 1 > /sys/bus/ccw/drivers/zfcp/${DEVICE/0x/}/online - [ ! -d /sys/bus/ccw/drivers/zfcp/${DEVICE/0x/}/$WWPN/$FCPLUN ] && echo $FCPLUN > /sys/bus/ccw/drivers/zfcp/${DEVICE/0x/}/$WWPN/unit_add + sed 'y/ABCDEF/abcdef/' < $CONFIG | while read line; do + case $line in + \#*) ;; + *) + [ -z "$line" ] && continue + set $line + if [ $# -eq 5 ]; then + DEVICE=$1 + SCSIID=$2 + WWPN=$3 + SCSILUN=$4 + FCPLUN=$5 + echo "Warning: Deprecated values in /etc/zfcp.conf, ignoring SCSI ID $SCSIID and SCSI LUN $SCSILUN" + elif [ $# -eq 3 ]; then + DEVICE=${1##*0x} + WWPN=$2 + FCPLUN=$3 + fi + echo 1 > /sys/bus/ccw/drivers/zfcp/${DEVICE}/online + [ ! -d /sys/bus/ccw/drivers/zfcp/${DEVICE}/${WWPN}/${FCPLUN} ] \ + && echo $FCPLUN > /sys/bus/ccw/drivers/zfcp/${DEVICE}/${WWPN}/unit_add + ;; + esac done fi