Skip to contentSkip to conversation

SUSE S/390 integration

PATCH Superseded Hannes Reinecke 2 participants 15 messages Nov 27, 2013 – Nov 28, 2013 5 messages not in the archive

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover SUSE S/390 integration

Hi all,

SUSE is keeping the S/390 device configuration in udev rules, on rule per device.
And it doesn't have the RH-specific configuration scripts (obviously). This patchset abstracts away the RH-specific configuration and adds modules to make dracut boot on SLES installations.

Please apply.

Hannes Reinecke (10):
95dasd: Install kernel modules only once
95dasd: Only install module if normalize_dasd_arg is present 95dasd_mod: make dasd_cio_free optional
95zfcp: Make installation optional
95znet: Make installation optional
Install /bin/mount
Fixup keymap setting for openSUSE
Check for plymouth lib directories
Add DASD configuration for SuSE
Add zfcp scripts for SUSE

 dracut-functions.sh                    | 37 ++++++++++++++++++++++
 modules.d/10i18n/module-setup.sh       |  3 ++
 modules.d/50plymouth/module-setup.sh   | 17 ++++++++---
 modules.d/95dasd/module-setup.sh       |  7 ++---
 modules.d/95dasd_mod/module-setup.sh   |  3 +-
 modules.d/95dasd_mod/parse-dasd-mod.sh |  4 ++-
 modules.d/95dasd_rules/module-setup.sh | 27 ++++++++++++++++
 modules.d/95dasd_rules/parse-dasd.sh   | 56 ++++++++++++++++++++++++++++++++++
 modules.d/95zfcp/module-setup.sh       |  4 +--
 modules.d/95zfcp_rules/module-setup.sh | 25 +++++++++++++++
 modules.d/95zfcp_rules/parse-zfcp.sh   | 54 ++++++++++++++++++++++++++++++++
 modules.d/95znet/module-setup.sh       |  1 +
 modules.d/99fs-lib/module-setup.sh     |  1 +
 13 files changed, 224 insertions(+), 15 deletions(-)
 create mode 100755 modules.d/95dasd_rules/module-setup.sh
 create mode 100755 modules.d/95dasd_rules/parse-dasd.sh
 create mode 100755 modules.d/95zfcp_rules/module-setup.sh
 create mode 100755 modules.d/95zfcp_rules/parse-zfcp.sh
Signature · 1 line
1.8.1.4

A message that is not in the archive (sent off-list or not yet received): 1385567061-13247-1-git-send-email-hare-l3A5Bk7waGM@public.gmane.org

#2 lore raw

PATCH 1/10 95dasd: Install kernel modules only once

Move kernel module selection to 95dasd_mod and make 95dasd depend on that module.

---
 modules.d/95dasd/module-setup.sh | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
modules.d/95dasd/module-setup.sh +1 -5
index 861df29..16207bc 100755
@@ -11,15 +11,11 @@ check() {
 
 # called by dracut
 depends() {
+    echo "dasd_mod"
     return 0
 }
 
 # called by dracut
-installkernel() {
-    instmods dasd_mod dasd_eckd_mod dasd_fba_mod dasd_diag_mod
-}
-
-# called by dracut
 install() {
     inst_hook cmdline 30 "$moddir/parse-dasd.sh"
     inst_multiple dasdinfo dasdconf.sh normalize_dasd_arg
Signature · 1 line
1.8.1.4
#3 lore raw

PATCH 2/10 95dasd: Only install module if normalize_dasd_arg is present

In reply to a message not in the archive

normalize_dasd_arg is a RedHat specific script, so no point installing this module if the script isn't present.

---
 modules.d/95dasd/module-setup.sh | 1 +
 1 file changed, 1 insertion(+)
modules.d/95dasd/module-setup.sh +1 -0
index 16207bc..9c93d40 100755
@@ -5,6 +5,7 @@
 # called by dracut
 check() {
     local _arch=$(uname -m)
+    [ -x /sbin/normalize_dasd_arg ] || return 1
     [ "$_arch" = "s390" -o "$_arch" = "s390x" ] || return 1
     return 0
 }
Signature · 1 line
1.8.1.4
#4 lore raw

PATCH 3/10 95dasd_mod: make dasd_cio_free optional

In reply to a message not in the archive

dasd_cio_free is a RedHat-specific tool, so make it optional.

---
 dracut-functions.sh                    | 9 +++++++++
 modules.d/95dasd_mod/module-setup.sh   | 3 ++-
 modules.d/95dasd_mod/parse-dasd-mod.sh | 4 +++-
 3 files changed, 14 insertions(+), 2 deletions(-)
dracut-functions.sh +9 -0
index 2872516..c2cf67a 100755
@@ -741,6 +741,15 @@ inst_multiple() {
     return $ret
 }
 
+inst_multiple_optional() {
+    local ret
+        #dinfo "initdir=$initdir $DRACUT_INSTALL -l $@"
+    $DRACUT_INSTALL ${initdir:+-D "$initdir"} -o -a ${DRACUT_RESOLVE_DEPS:+-l}  ${DRACUT_FIPS_MODE:+-H} "$@"
+    ret=$?
+    (($ret != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} -o -a ${DRACUT_RESOLVE_DEPS:+-l}  ${DRACUT_FIPS_MODE:+-H} "$@" || :
+    return $ret
+}
+
 dracut_install() {
     inst_multiple "$@"
 }
modules.d/95dasd_mod/module-setup.sh +2 -1
index 011010d..4546059 100755
@@ -23,6 +23,7 @@ installkernel() {
 # called by dracut
 install() {
     inst_hook cmdline 31 "$moddir/parse-dasd-mod.sh"
-    inst_multiple dasd_cio_free grep sed seq
+    inst_multiple grep sed seq
+    inst_multiple_optional dasd_cio_free
 }
 
modules.d/95dasd_mod/parse-dasd-mod.sh +3 -1
index 87c88ed..0236d12 100755
@@ -15,4 +15,6 @@ if [ -n "$mod_args" ]; then
 fi
 
 unset dasd_arg
-dasd_cio_free
+if [ -x /sbin/dasd_cio_free ] ; then
+    dasd_cio_free
+fi
Signature · 1 line
1.8.1.4

A message that is not in the archive (sent off-list or not yet received): 1385567061-13247-4-git-send-email-hare-l3A5Bk7waGM@public.gmane.org

#6 lore raw

Re: [PATCH 03/10] 95dasd_mod: make dasd_cio_free optional

Quoted 16 lines · Hannes Reinecke

dasd_cio_free is a RedHat-specific tool, so make it optional.

---
 dracut-functions.sh                    | 9 +++++++++
 modules.d/95dasd_mod/module-setup.sh   | 3 ++-
 modules.d/95dasd_mod/parse-dasd-mod.sh | 4 +++-
 3 files changed, 14 insertions(+), 2 deletions(-)
dracut-functions.sh +0 -0
index 2872516..c2cf67a 100755
@@ -741,6 +741,15 @@ inst_multiple() {
     return $ret
 }

dracut-functions.sh inst_multiple() { · line 752

Quoted 10 lines
dracut-functions.sh +9 -0
 
+inst_multiple_optional() {
+    local ret
+        #dinfo "initdir=$initdir $DRACUT_INSTALL -l $@"
+    $DRACUT_INSTALL ${initdir:+-D "$initdir"} -o -a ${DRACUT_RESOLVE_DEPS:+-l}  ${DRACUT_FIPS_MODE:+-H} "$@"
+    ret=$?
+    (($ret != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} -o -a ${DRACUT_RESOLVE_DEPS:+-l}  ${DRACUT_FIPS_MODE:+-H} "$@" || :
+    return $ret
+}
+

Why so complicated and not use "inst_multiple -o" ??
Or, if you prefer inst_multiple_optional, replace all other occurences of "inst_multiple -o" with inst_multiple_optional also.

Quoted 29 lines
dracut-functions.sh +0 -0
 dracut_install() {
     inst_multiple "$@"
 }
modules.d/95dasd_mod/module-setup.sh +2 -1
index 011010d..4546059 100755
@@ -23,6 +23,7 @@ installkernel() {
 # called by dracut
 install() {
     inst_hook cmdline 31 "$moddir/parse-dasd-mod.sh"
-    inst_multiple dasd_cio_free grep sed seq
+    inst_multiple grep sed seq
+    inst_multiple_optional dasd_cio_free
 }
 
modules.d/95dasd_mod/parse-dasd-mod.sh +3 -1
index 87c88ed..0236d12 100755
@@ -15,4 +15,6 @@ if [ -n "$mod_args" ]; then
 fi
 
 unset dasd_arg
-dasd_cio_free
+if [ -x /sbin/dasd_cio_free ] ; then
+    dasd_cio_free
+fi

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw

Re: [PATCH 03/10] 95dasd_mod: make dasd_cio_free optional

Quoted 18 lines · Harald Hoyer
Quoted 17 lines · Hannes Reinecke

dasd_cio_free is a RedHat-specific tool, so make it optional.

---
 dracut-functions.sh                    | 9 +++++++++
 modules.d/95dasd_mod/module-setup.sh   | 3 ++-
 modules.d/95dasd_mod/parse-dasd-mod.sh | 4 +++-
 3 files changed, 14 insertions(+), 2 deletions(-)
dracut-functions.sh +0 -0
index 2872516..c2cf67a 100755
@@ -741,6 +741,15 @@ inst_multiple() {
     return $ret
 }
 
Quoted 15 lines

dracut-functions.sh inst_multiple() { · line 752

Quoted 9 lines
dracut-functions.sh +9 -0
+inst_multiple_optional() {
+    local ret
+        #dinfo "initdir=$initdir $DRACUT_INSTALL -l $@"
+    $DRACUT_INSTALL ${initdir:+-D "$initdir"} -o -a ${DRACUT_RESOLVE_DEPS:+-l}  ${DRACUT_FIPS_MODE:+-H} "$@"
+    ret=$?
+    (($ret != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} -o -a ${DRACUT_RESOLVE_DEPS:+-l}  ${DRACUT_FIPS_MODE:+-H} "$@" || :
+    return $ret
+}
+

Why so complicated and not use "inst_multiple -o" ??
Or, if you prefer inst_multiple_optional, replace all other occurences of "inst_multiple -o" with inst_multiple_optional also.

Ah. Okay, will be doing it.

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke		      zSeries & Storage
[email protected]			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
#9 lore raw

PATCH 4/10 95zfcp: Make installation optional

In reply to a message not in the archive

zfcp_cio_free is a RedHat-specific tool, so do not install this module if the program isn't present.

---
 modules.d/95zfcp/module-setup.sh | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
modules.d/95zfcp/module-setup.sh +1 -3
index 5d9b506..dfbeed5 100755
@@ -5,6 +5,7 @@
 # called by dracut
 check() {
     arch=$(uname -m)
+    [ -x /sbin/zfcp_cio_free ] || return 1
     [ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1
 
     return 0
@@ -12,9 +13,6 @@ check() {
 
 # called by dracut
 depends() {
-    arch=$(uname -m)
-    [ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1
-
     return 0
 }
 
Signature · 1 line
1.8.1.4
#10 lore raw

PATCH 5/10 95znet: Make installation optional

In reply to a message not in the archive

znet_cio_free is a RedHat-specific tool, so do not install this module on systems where the program is missing.

---
 modules.d/95znet/module-setup.sh | 1 +
 1 file changed, 1 insertion(+)
modules.d/95znet/module-setup.sh +1 -0
index 4c211a9..5012b77 100755
@@ -5,6 +5,7 @@
 # called by dracut
 check() {
     arch=$(uname -m)
+    [ -z /sbin/znet_cio_free ] || return 1
     [ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1
 
     return 0
Signature · 1 line
1.8.1.4
#11 lore raw

PATCH 6/10 Install /bin/mount

In reply to a message not in the archive

systemd relies on /bin/mount to be present, so install it.

---
 modules.d/99fs-lib/module-setup.sh | 1 +
 1 file changed, 1 insertion(+)
modules.d/99fs-lib/module-setup.sh +1 -0
index 7979bab..b24207d 100755
@@ -85,4 +85,5 @@ install() {
     fi
 
     inst_multiple -o $_helpers fsck
+    inst /usr/bin/mount /bin/mount
 }
Signature · 1 line
1.8.1.4

A message that is not in the archive (sent off-list or not yet received): 1385567061-13247-7-git-send-email-hare-l3A5Bk7waGM@public.gmane.org

#13 lore raw

Re: [PATCH 06/10] Install /bin/mount

Quoted 13 lines · Hannes Reinecke

systemd relies on /bin/mount to be present, so install it.

---
 modules.d/99fs-lib/module-setup.sh | 1 +
 1 file changed, 1 insertion(+)
modules.d/99fs-lib/module-setup.sh +0 -0
index 7979bab..b24207d 100755

modules.d/99fs-lib/module-setup.sh install() { · line 89

Quoted 5 lines
modules.d/99fs-lib/module-setup.sh +1 -0
@@ -85,4 +85,5 @@ install() {
     fi
 
     inst_multiple -o $_helpers fsck
+    inst /usr/bin/mount /bin/mount
 }

After much debate and soul-searching it was found that

a) /bin/mount is _REQUIRED_ to be present
b) dracut will only copy /usr/bin/mount

So if /bin is _not_ a symlink to /usr/bin, but the individual programs are, /bin/mount doesn't find it's way into the initrd. Nor do several other programs.

How to approach this fundamentally?
I would prefer to have 'inst' checking for symlinks, and copy them over if required.
Adding them manually seems ineffectual to me.
But I'll do whatever is desired here ...

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke		      zSeries & Storage
[email protected]			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)

A message that is not in the archive (sent off-list or not yet received): [email protected]

#15 lore raw

Re: [PATCH 06/10] Install /bin/mount

Quoted 34 lines · Hannes Reinecke
Quoted 13 lines · Hannes Reinecke

systemd relies on /bin/mount to be present, so install it.

---
 modules.d/99fs-lib/module-setup.sh | 1 +
 1 file changed, 1 insertion(+)
modules.d/99fs-lib/module-setup.sh +0 -0
index 7979bab..b24207d 100755

modules.d/99fs-lib/module-setup.sh install() { · line 89

Quoted 5 lines
modules.d/99fs-lib/module-setup.sh +1 -0
@@ -85,4 +85,5 @@ install() {
     fi
 
     inst_multiple -o $_helpers fsck
+    inst /usr/bin/mount /bin/mount
 }

After much debate and soul-searching it was found that

a) /bin/mount is _REQUIRED_ to be present
b) dracut will only copy /usr/bin/mount

So if /bin is _not_ a symlink to /usr/bin, but the individual programs are, /bin/mount doesn't find it's way into the initrd. Nor do several other programs.

How to approach this fundamentally?
I would prefer to have 'inst' checking for symlinks, and copy them over if required.
Adding them manually seems ineffectual to me.
But I'll do whatever is desired here ...

Quoted 4 lines

Cheers,

Hannes

Like already discussed, we should alter dracut-install to search all PATH elements, instead of just taking the first one.

http://git.kernel.org/cgit/boot/dracut/dracut.git/tree/install/dracut-install.c#n787

http://git.kernel.org/cgit/boot/dracut/dracut.git/tree/install/dracut-install.c#n851

http://git.kernel.org/cgit/boot/dracut/dracut.git/tree/install/dracut-install.c#n883

Will do, and also cleanup dracut-install.c in the process.

#16 lore raw

PATCH 7/10 Fixup keymap setting for openSUSE

In reply to a message not in the archive

openSUSE is using compressed keymaps.

---
 modules.d/10i18n/module-setup.sh | 3 +++
 1 file changed, 3 insertions(+)
modules.d/10i18n/module-setup.sh +3 -0
index 0741c64..f07b148 100755
@@ -161,6 +161,9 @@ install() {
         # Gentoo user may have KEYMAP set to something like "-u pl2",
         KEYMAP=${KEYMAP#-* }
 
+        # openSUSE user may have KEYMAP set to something like ".gz"
+        KEYMAP=${KEYMAP/.gz/}
+
         # KEYTABLE is a bit special - it defines base keymap name and UNICODE
         # determines whether non-UNICODE or UNICODE version is used
 
Signature · 1 line
1.8.1.4
#17 lore raw

PATCH 8/10 Check for plymouth lib directories

In reply to a message not in the archive

SUSE installs plymount files in /usr/lib, not /usr/libexec. So check for both when including plymouth support.

---
 modules.d/50plymouth/module-setup.sh | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
modules.d/50plymouth/module-setup.sh +12 -5
index 1360924..7ccf9e4 100755
@@ -15,12 +15,19 @@ depends() {
 
 # called by dracut
 install() {
-    if grep -q nash /usr/libexec/plymouth/plymouth-populate-initrd \
-        || [ ! -x /usr/libexec/plymouth/plymouth-populate-initrd ]; then
+    if [ -d /usr/libexec/plymouth ] ; then
+        _plymouth=/usr/libexec/plymouth;
+    elif [ -d /usr/lib/plymouth ] ; then
+        _plymouth=/usr/lib/plymouth
+    fi
+    if [ -n "$_plymouth" ] ; then
+        if grep -q nash ${_plymouth}/plymouth-populate-initrd \
+        || [ ! -x ${_plymouth}/plymouth-populate-initrd ]; then
         . "$moddir"/plymouth-populate-initrd.sh
-    else
-        PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="$dracutfunctions" \
-            /usr/libexec/plymouth/plymouth-populate-initrd -t "$initdir"
+        else
+            PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="$dracutfunctions" \
+                ${_plymouth}/plymouth-populate-initrd -t "$initdir"
+        fi
     fi
 
     inst_hook emergency 50 "$moddir"/plymouth-emergency.sh
Signature · 1 line
1.8.1.4
#18 lore raw

PATCH 9/10 Add DASD configuration for SuSE

In reply to a message not in the archive

On SuSE the DASD configuration is kept in udev rules, one rule file per device. So add a new module for copying and creating these rules during boot.

---
 dracut-functions.sh                    | 28 +++++++++++++++++
 modules.d/95dasd_rules/module-setup.sh | 27 ++++++++++++++++
 modules.d/95dasd_rules/parse-dasd.sh   | 56 ++++++++++++++++++++++++++++++++++
 3 files changed, 111 insertions(+)
 create mode 100755 modules.d/95dasd_rules/module-setup.sh
 create mode 100755 modules.d/95dasd_rules/parse-dasd.sh
dracut-functions.sh +28 -0
index c2cf67a..27f1507 100755
@@ -908,6 +908,34 @@ inst_rules() {
     done
 }
 
+inst_rules_wildcard() {
+    local _target=/etc/udev/rules.d _rule _found
+
+    inst_dir "${udevdir}/rules.d"
+    inst_dir "$_target"
+    for _rule in ${udevdir}/rules.d/$1 ${dracutbasedir}/rules.d/$1 ; do
+        if [[ -e $_rule ]]; then
+            inst_rule_programs "$_rule"
+            inst_rule_group_owner "$_rule"
+            inst_rule_initqueue "$_rule"
+            inst_simple "$_rule"
+            _found=$_rule
+        fi
+    done
+    if [ -n ${hostonly} ] ; then
+        for _rule in ${_target}/$1 ; do
+            if [[ -f $_rule ]]; then
+                inst_rule_programs "$_rule"
+                inst_rule_group_owner "$_rule"
+                inst_rule_initqueue "$_rule"
+                inst_simple "$_rule"
+                _found=$_rule
+            fi
+        done
+    fi
+    [[ $_found ]] || dinfo "Skipping udev rule: $_rule"
+}
+
 prepare_udev_rules() {
     [ -z "$UDEVVERSION" ] && export UDEVVERSION=$(udevadm --version)
 
modules.d/95dasd_rules/module-setup.sh new file +27 -0
new file mode 100755
index 0000000..d313171
@@ -0,0 +1,27 @@
+#!/bin/bash
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
+
+# called by dracut
+check() {
+    local _arch=$(uname -m)
+    [ -x /sbin/dasd_configure ] || return 1
+    [ "$_arch" = "s390" -o "$_arch" = "s390x" ] || return 1
+    return 0
+}
+
+# called by dracut
+depends() {
+    echo 'dasd_mod'
+    return 0
+}
+
+# called by dracut
+install() {
+    inst_multiple /usr/lib/udev/collect
+    inst_hook cmdline 30 "$moddir/parse-dasd.sh"
+    if [[ $hostonly ]] ; then
+        inst_rules_wildcard 51-dasd-*.rules
+    fi
+    inst_rules 59-dasd.rules
+}
modules.d/95dasd_rules/parse-dasd.sh new file +56 -0

56 lines not on this page · raw message

Signature · 1 line
1.8.1.4
#19 lore raw

PATCH 10/10 Add zfcp scripts for SUSE

In reply to a message not in the archive

SuSE is storing the zfcp configuration in udev files, so we should be including these.

---
 modules.d/95zfcp_rules/module-setup.sh | 25 ++++++++++++++++
 modules.d/95zfcp_rules/parse-zfcp.sh   | 54 ++++++++++++++++++++++++++++++++++
 2 files changed, 79 insertions(+)
 create mode 100755 modules.d/95zfcp_rules/module-setup.sh
 create mode 100755 modules.d/95zfcp_rules/parse-zfcp.sh
modules.d/95zfcp_rules/module-setup.sh new file +25 -0
new file mode 100755
index 0000000..9a1ab20
@@ -0,0 +1,25 @@
+#!/bin/bash
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
+
+# called by dracut
+check() {
+    local _arch=$(uname -m)
+    [ -x /sbin/zfcp_disk_configure ] || return 1
+    [ "$_arch" = "s390" -o "$_arch" = "s390x" ] || return 1
+    return 0
+}
+
+# called by dracut
+depends() {
+    return 0
+}
+
+# called by dracut
+install() {
+    inst_multiple /usr/lib/udev/collect
+    inst_hook cmdline 30 "$moddir/parse-zfcp.sh"
+    if [[ $hostonly ]] ; then
+        inst_rules_wildcard 51-zfcp-*.rules
+    fi
+}
modules.d/95zfcp_rules/parse-zfcp.sh new file +54 -0

54 lines not on this page · raw message

Signature · 1 line
1.8.1.4