Accepting request 238337 from Base:System

1

OBS-URL: https://build.opensuse.org/request/show/238337
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/dracut?expand=0&rev=48
This commit is contained in:
Stephan Kulow 2014-06-25 08:48:58 +00:00 committed by Git OBS Bridge
commit 9d633f31f2
4 changed files with 314 additions and 0 deletions

View File

@ -0,0 +1,115 @@
From d5bbccaaff904eb0dbbd2e5407278e69436e559b Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Tue, 17 Jun 2014 11:09:59 +0200
Subject: 81cio_ignore: skip module if cio_ignore is not active
When cio_ignore is not active we should skip the entire module
during boot; otherwise it'll lead to adverse effects.
References: bnc#882685
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
modules.d/81cio_ignore/module-setup.sh | 45 ++++++++++++++++++++--------------
modules.d/81cio_ignore/parse-zipl.sh | 11 ++++++---
2 files changed, 34 insertions(+), 22 deletions(-)
diff --git a/modules.d/81cio_ignore/module-setup.sh b/modules.d/81cio_ignore/module-setup.sh
index a812649..52cb188 100644
--- a/modules.d/81cio_ignore/module-setup.sh
+++ b/modules.d/81cio_ignore/module-setup.sh
@@ -5,35 +5,44 @@
# called by dracut
check() {
# do not add this module by default
- local arch=$(uname -m)
- [ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1
- return 0
+ local arch=$(uname -m)
+ [ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1
+ return 0
}
find_mount() {
- local dev mnt etc wanted_dev
- wanted_dev="$(readlink -e -q $1)"
- while read dev mnt etc; do
- [ "$mnt" = "$wanted_dev" ] && echo "$dev" && return 0
- done < /proc/mounts
- return 1
+ local dev mnt etc wanted_dev zipl_dev
+ wanted_dev="$(readlink -e -q $1)"
+ while read dev mnt etc; do
+ [ "$mnt" = "$wanted_dev" ] && zipl_dev="$dev" && break
+ done < /etc/fstab
+ if [ -z "$zipl_dev" ] ; then
+ return 1
+ fi
+ if [ -e ${wanted_dev}/active_devices.txt ] ; then
+ echo "$zipl_dev"
+ return 0
+ fi
+ return 1
}
cmdline() {
- local zipl_dasd
- zipl_dasd=`find_mount /boot/zipl`
- printf " rd.zipl_dasd=%s\n" "$zipl_dasd "
+ local zipl_dasd
+ zipl_dasd=`find_mount /boot/zipl`
+ if [ -n "$zipl_dasd" ] ; then
+ printf " rd.zipl_dasd=%s " $zipl_dasd
+ fi
}
# called by dracut
install() {
- if [[ $hostonly_cmdline == "yes" ]];then
- echo $(cmdline) >"${initdir}/etc/cmdline.d/01zipl_dasd.conf"
- fi
+ if [[ $hostonly_cmdline == "yes" ]];then
+ echo $(cmdline) >"${initdir}/etc/cmdline.d/01zipl_dasd.conf"
+ fi
- inst_hook pre-mount 10 "$moddir/parse-zipl.sh"
- inst_multiple cio_ignore mount umount mkdir
+ inst_hook pre-mount 10 "$moddir/parse-zipl.sh"
+ inst_multiple cio_ignore mount umount mkdir
}
installkernel() {
- instmods ext4
+ instmods ext4
}
diff --git a/modules.d/81cio_ignore/parse-zipl.sh b/modules.d/81cio_ignore/parse-zipl.sh
index 5f7aa58..9d68c52 100644
--- a/modules.d/81cio_ignore/parse-zipl.sh
+++ b/modules.d/81cio_ignore/parse-zipl.sh
@@ -2,17 +2,20 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
-ZIPL_DEV="$(getarg rd.zipl_dasd)"
-ZIPL_DIR=/tmp/zipl
+ZIPL_DEV=$(getarg rd.zipl_dasd)
+ZIPL_DIR=/boot/zipl
CIO_REMOVE_LIST=$ZIPL_DIR/active_devices.txt
-if [ -n $ZIPL_DEV ];then
+if ! getarg cio_ignore ; then
+ return
+fi
+if [ -n "$ZIPL_DEV" ];then
info "Waiting for zipl device $ZIPL_DEV"
wait_for_dev -n "$ZIPL_DEV"
#
# mount device and read devices
#
- [ -d $ZIPL_DIR ] || mkdir $ZIPL_DIR
+ [ -d $ZIPL_DIR ] || mkdir -p $ZIPL_DIR
mount -t ext2 -o ro $ZIPL_DEV $ZIPL_DIR
if [ -f $CIO_REMOVE_LIST ] ; then
#
--
1.8.4.5

View File

@ -0,0 +1,180 @@
From 137090516e1c48ef134209c2ed4f625799691090 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Tue, 17 Jun 2014 16:45:06 +0200
Subject: 81cio_ignore: rewrite module
Rewrite cio_ignore module to rely on the dracut commandline
parameter 'rd.cio_accept', which takes a comma-separated list
of CCW IDs. Each of those IDs are being removed from the
list of devices from cio_ignore.
The default values for rd.cio_accept are taken from
/boot/zipl/active_devices.txt.
References: bnc#882685
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
dracut.cmdline.7.asc | 15 +++++++++++
modules.d/81cio_ignore/module-setup.sh | 43 ++++++++++++------------------
modules.d/81cio_ignore/parse-cio_accept.sh | 21 +++++++++++++++
modules.d/81cio_ignore/parse-zipl.sh | 32 ----------------------
4 files changed, 53 insertions(+), 58 deletions(-)
create mode 100644 modules.d/81cio_ignore/parse-cio_accept.sh
delete mode 100644 modules.d/81cio_ignore/parse-zipl.sh
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc
index 985285b..bd8e4ce 100644
--- a/dracut.cmdline.7.asc
+++ b/dracut.cmdline.7.asc
@@ -711,6 +711,21 @@ rd.znet=qeth,0.0.0600,0.0.0601,0.0.0602,layer2=1,portname=foo
rd.znet=ctc,0.0.0600,0.0.0601,protocol=bar
--
+CIO_IGNORE
+~~~~~~~~~~
+**rd.cio_accept=**__<device-ids>__::
+ Remove the devices listed in <device-ids> from the default
+ cio_ignore kernel command-line settings.
+ <device-ids> is a list of comma-separated CCW device ids.
+ The default for this value is taken from the
+ _/boot/zipl/active_devices.txt_ file.
++
+[listing]
+.Example
+--
+rd.cio_accept=0.0.0180,0.0.0800,0.0.0801,0.0.0802
+--
+
Plymouth Boot Splash
~~~~~~~~~~~~~~~~~~~~
**plymouth.enable=0**::
diff --git a/modules.d/81cio_ignore/module-setup.sh b/modules.d/81cio_ignore/module-setup.sh
index 52cb188..42ae2f9 100644
--- a/modules.d/81cio_ignore/module-setup.sh
+++ b/modules.d/81cio_ignore/module-setup.sh
@@ -10,39 +10,30 @@ check() {
return 0
}
-find_mount() {
- local dev mnt etc wanted_dev zipl_dev
- wanted_dev="$(readlink -e -q $1)"
- while read dev mnt etc; do
- [ "$mnt" = "$wanted_dev" ] && zipl_dev="$dev" && break
- done < /etc/fstab
- if [ -z "$zipl_dev" ] ; then
- return 1
- fi
- if [ -e ${wanted_dev}/active_devices.txt ] ; then
- echo "$zipl_dev"
- return 0
- fi
- return 1
-}
-
cmdline() {
- local zipl_dasd
- zipl_dasd=`find_mount /boot/zipl`
- if [ -n "$zipl_dasd" ] ; then
- printf " rd.zipl_dasd=%s " $zipl_dasd
+ local cio_accept
+
+ if [ -e /boot/zipl/active_devices.txt ] ; then
+ while read dev etc ; do
+ [ "$dev" = "#" -o "$dev" = "" ] && continue;
+ if [ -z "$cio_accept" ] ; then
+ cio_accept="$dev"
+ else
+ cio_accept="${cio_accept},${dev}"
+ fi
+ done < /boot/zipl/active_devices.txt
+ fi
+ if [ -n "$cio_accept" ] ; then
+ echo "rd.cio_accept=${cio_accept}"
fi
}
# called by dracut
install() {
if [[ $hostonly_cmdline == "yes" ]];then
- echo $(cmdline) >"${initdir}/etc/cmdline.d/01zipl_dasd.conf"
+ cmdline >> "${initdir}/etc/cmdline.d/01cio_accept.conf"
fi
- inst_hook pre-mount 10 "$moddir/parse-zipl.sh"
- inst_multiple cio_ignore mount umount mkdir
-}
-installkernel() {
- instmods ext4
+ inst_hook cmdline 20 "$moddir/parse-cio_accept.sh"
+ inst_multiple cio_ignore
}
diff --git a/modules.d/81cio_ignore/parse-cio_accept.sh b/modules.d/81cio_ignore/parse-cio_accept.sh
new file mode 100644
index 0000000..fec8a92
--- /dev/null
+++ b/modules.d/81cio_ignore/parse-cio_accept.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
+
+CIO_IGNORE=$(getarg cio_ignore)
+CIO_ACCEPT=$(getarg rd.cio_accept)
+
+if [ -z $CIO_IGNORE ] ; then
+ info "cio_ignored disabled on commandline"
+ return
+fi
+if [ -n "$CIO_ACCEPT" ] ; then
+ IFS=,
+ set -- $CIO_ACCEPT
+ while (($# > 0)) ; do
+ info "Enabling device $1"
+ cio_ignore --remove $1
+ shift
+ done
+ unset IFS
+fi
diff --git a/modules.d/81cio_ignore/parse-zipl.sh b/modules.d/81cio_ignore/parse-zipl.sh
deleted file mode 100644
index 9d68c52..0000000
--- a/modules.d/81cio_ignore/parse-zipl.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
-# ex: ts=8 sw=4 sts=4 et filetype=sh
-
-ZIPL_DEV=$(getarg rd.zipl_dasd)
-ZIPL_DIR=/boot/zipl
-CIO_REMOVE_LIST=$ZIPL_DIR/active_devices.txt
-
-if ! getarg cio_ignore ; then
- return
-fi
-if [ -n "$ZIPL_DEV" ];then
- info "Waiting for zipl device $ZIPL_DEV"
- wait_for_dev -n "$ZIPL_DEV"
-#
-# mount device and read devices
-#
- [ -d $ZIPL_DIR ] || mkdir -p $ZIPL_DIR
- mount -t ext2 -o ro $ZIPL_DEV $ZIPL_DIR
- if [ -f $CIO_REMOVE_LIST ] ; then
-#
-# File exist
-#
- while read dev etc; do
- [ "$dev" = "#" -o "$dev" = "" ] && continue
- cio_ignore --remove $dev
- done < $CIO_REMOVE_LIST
- fi
- umount $ZIPL_DIR
-else
- warn "No rd.zipl_dasd boot parameter found"
-fi
--
1.7.12.4

View File

@ -1,3 +1,18 @@
-------------------------------------------------------------------
Tue Jun 17 16:58:03 CEST 2014 - hare@suse.de
- 81cio_ignore: rewrite module to not mount any filesystem
(bnc#882685)
* Add: 0070-81cio_ignore-rewrite-module.patch
-------------------------------------------------------------------
Tue Jun 17 11:14:07 CEST 2014 - hare@suse.de
- 81cio_ignore: ignore module if cio_ignore is not specified
(bnc#882685)
* Add:
0069-81cio_ignore-skip-module-if-cio_ignore-is-not-active.patch
-------------------------------------------------------------------
Mon Jun 16 14:17:43 CEST 2014 - hare@suse.de

View File

@ -89,6 +89,8 @@ Patch65: 0065-95iscsi-Fixup-bnx2i-offload-booting.patch
Patch66: 0066-40network-always-start-netroot-in-ifup.sh.patch
Patch67: 0067-95fcoe-check-always-returns-255.patch
Patch68: 0068-95fcoe-uefi-Test-for-EFI-firmware.patch
Patch69: 0069-81cio_ignore-skip-module-if-cio_ignore-is-not-active.patch
Patch70: 0070-81cio_ignore-rewrite-module.patch
BuildRequires: asciidoc
BuildRequires: bash
@ -198,6 +200,8 @@ and its cryptography during startup.
%patch66 -p1
%patch67 -p1
%patch68 -p1
%patch69 -p1
%patch70 -p1
%build
%configure\