Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 585515 Details for
Bug 823078
Add a script to normalize DASD arguments for a dasd.conf
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
normalize_dasd_arg
normalize_dasd_arg (text/plain), 4.52 KB, created by
Jesse Keating
on 2012-05-18 22:27:15 UTC
(
hide
)
Description:
normalize_dasd_arg
Filename:
MIME Type:
Creator:
Jesse Keating
Created:
2012-05-18 22:27:15 UTC
Size:
4.52 KB
patch
obsolete
>#!/bin/sh ># ># Copyright 2012 Red Hat, Inc. ># License: GPLv2 ># Author: Jesse Keating <jkeating@redhat.com> ># ># Normalize DASD data into valid dasd.conf format ># ># Standard input should be the DASD argument ># Standard otuput is the properly formatted content ># ># it is used in ># dracut generated initramfs ># ># Much of this code was salvaged from linuxrc.s390 from Anaconda: ># ># License GPLv2+ ># ># Copyright (C) 2000-2004 by ># Bernhard Rosenkraenzer <bero@redhat.com> ># Oliver Paukstadt <opaukstadt@millenux.com> ># Karsten Hopp <karsten@redhat.de> ># Florian La Roche <laroche@redhat.com> ># Nils Philippsen <nils@redhat.de> ># Helge Deller <hdeller@redhat.de> ># David Sainty <dsainty@redhat.com> ># Copyright (C) IBM Corp. 2008,2009 ># Author: Steffen Maier <maier@de.ibm.com> > > >function canonicalize_devno() >{ > case ${#1} in > 3) echo "0.0.0${1}" ;; > 4) echo "0.0.${1}" ;; > *) echo "${1}" ;; > esac > return 0 >} > >read DASD >for dasditem in $(echo $DASD |sed 's/,/ /g') > do > unset range features lo hi attrs devno lodevno hidevno devbusid sys > case $dasditem in > autodetect|probeonly|nopav|nofcx|"") continue ;; # these don't gen a config > *) > IFS='(' > read range features <<< "$dasditem" > unset IFS > lo=${range%%-*} > [[ "$lo" =~ (^[[:xdigit:]]+\.[0-3]\.[[:xdigit:]]{4}$)|(^[[:xdigit:]]{3,4}$) ]] > case $? in > 0) # string matched the pattern > lo=$(canonicalize_devno $lo) ;; > 1) # string did not match the pattern > echo $"Incorrect format for lower bound of DASD range $range: $lo" > exit 1 > ;; > 2) echo "l.$LINENO: syntax error in regex of match operator =~, code needs to be fixed" 1>&2 ;; > *) echo "l.$LINENO: unexpected return code of regex match operator =~, code needs to be fixed" 1>&2 ;; > esac > if [ "${range//*-*/}" = "" ]; then > hi=${range##*-} > [[ "$hi" =~ (^[[:xdigit:]]+\.[0-3]\.[[:xdigit:]]{4}$)|(^[[:xdigit:]]{3,4}$) ]] > case $? in > 0) # string matched the pattern > hi=$(canonicalize_devno $hi) > if [ "${lo%.*}" != "${hi%.*}" ]; then > echo $"Prefixes of DASD range $range do not match: ${lo%.*} != ${hi%.*}" > exit 1 > fi > ;; > 1) # string did not match the pattern > echo $"Incorrect format for upper bound of DASD range $range: $hi" > exit 1 > ;; > 2) echo "l.$LINENO: syntax error in regex of match operator =~, code needs to be fixed" 1>&2 ;; > *) echo "l.$LINENO: unexpected return code of regex match operator =~, code needs to be fixed" 1>&2 ;; > esac > fi > if [ "${features//*)/}" != "" ]; then > echo $"Missing closing parenthesis at features of DASD range $range: ($features" > exit 1 > fi > if [ -n "$features" ]; then > attrs="" > features="${features%)}" > for feature in $(echo $features |sed 's/:/\n/g'); do > case $feature in > ro) attrs=$attrs" readonly" ;; > diag) attrs=$attrs" use_diag" ;; > erplog|failfast) attrs=$attrs" "$feature ;; > *) echo $"Unknown DASD feature for device range $range: $feature" > exit 1 > ;; > esac > done > fi > [ -z "$hi" ] && hi=$lo > lodevno=$((0x${lo##*.})) > hidevno=$((0x${hi##*.})) > for ((devno=$lodevno; $devno <= $hidevno; ++devno)); do > devbusid=$(printf "%s.%04x" ${lo%.*} $devno) > echo -n "$devbusid" > for attr in $attrs; do > echo -n " $attr=1" > done > echo > done > esac >done
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 823078
: 585515