dracut/0501-dasd_fix_ssid_bigger_zero.patch
Thomas Renninger e7df022c61 Accepting request 416594 from home:trenn:branches:Base:System
- Fix DASD SSID handling (bsc#989313)
* Add 0501-dasd_fix_ssid_bigger_zero.patch

- Advise user of fs recovery options when we fail to mount (fate#320443)
 * Add 0404-dracut-emergency-optionally-print-fs-help.patch

OBS-URL: https://build.opensuse.org/request/show/416594
OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=262
2016-08-02 16:36:01 +00:00

52 lines
1.8 KiB
Diff

From: Hannes Reinecke <hare@suse.com>
Fix DASD with SSID greater than 0
bsc#989313
Signed-off-by: Thomas Renninger <trenn@suse.com>
---
modules.d/95dasd_rules/parse-dasd.sh | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
--- a/modules.d/95dasd_rules/parse-dasd.sh
+++ a/modules.d/95dasd_rules/parse-dasd.sh
@@ -84,13 +84,14 @@ for dasd_arg in $(getargs rd.dasd=); do
OLDIFS="$IFS"
IFS="-"
set -- $range
- start=${1#0.0.}
+ prefix=${1%.*}
+ start=${1##*.}
shift
- end=${1#0.0.}
+ end=${1##.}
shift
IFS="$OLDIFS"
for dev in $(seq $(( 16#$start )) $(( 16#$end )) ) ; do
- create_udev_rule $(printf "0.0.%04x" "$dev")
+ create_udev_rule $(printf "%s.%04x" "$prefix" "$dev")
done
;;
*)
@@ -98,8 +99,16 @@ for dasd_arg in $(getargs rd.dasd=); do
if [ "$dev" != "$1" ] ; then
ro=1
fi
- dev=${dev#0.0.}
- create_udev_rule $(printf "0.0.%04x" $(( 16#$dev )) )
+ OLDIFS="$IFS"
+ IFS="."
+ set -- $dev
+ sid=$1
+ shift
+ ssid=$1
+ shift
+ chan=$1
+ IFS="$OLDIFS"
+ create_udev_rule $(printf "%01x.%01x.%04x" $(( 16#$sid )) $(( 16#$ssid )) $(( 16#$chan )) )
shift
;;
esac
--