3 type getarg
>/dev
/null
2>&1 || .
/lib
/dracut-lib.sh
9 while [ $i -le 10 ] ; do
10 if [ ! -f "$file" ]; then
19 if [[ ! $status == $
* ]]; then
20 [ -f "$file" ] && echo $
* > "$file"
24 function dasd_settle
() {
25 local dasd_status
=/sys
/bus
/ccw
/devices
/$1/status
26 if [ ! -f $dasd_status ]; then
30 while [ $i -le 60 ] ; do
32 read status
< $dasd_status
44 function dasd_settle_all
() {
45 for dasdccw
in $
(while read line ||
[ -n "$line" ]; do echo "${line%%(*}"; done < /proc
/dasd
/devices
) ; do
46 if ! dasd_settle
$dasdccw ; then
47 echo $
"Could not access DASD $dasdccw in time"
54 # prints a canonocalized device bus ID for a given devno of any format
55 function canonicalize_devno
()
58 3) echo "0.0.0${1}" ;;
65 # read file from CMS and write it to /tmp
66 function readcmsfile
() # $1=dasdport $2=filename
72 if [ $# -ne 2 ]; then return; fi
73 # precondition: udevd created dasda block device node
74 if ! dasd_cio_free
-d $1 ; then
75 echo $
"DASD $1 could not be cleared from device blacklist"
79 modprobe dasd_mod dasd
=$CMSDASD
80 modprobe dasd_eckd_mod
83 # precondition: dasd_eckd_mod driver incl. dependencies loaded,
84 # dasd_mod must be loaded without setting any DASD online
85 dev
=$
(canonicalize_devno
$1)
87 while read line ||
[ -n "$line" ]; do
88 if strstr
"$line" "# processors"; then
95 if [ ${numcpus} -eq 1 ]; then
96 echo 1 > /sys
/bus
/ccw
/devices
/$dev/online
98 if ! sysecho
/sys
/bus
/ccw
/devices
/$dev/online
1; then
99 echo $
"DASD $dev could not be set online"
103 if ! dasd_settle
$dev ; then
104 echo $
"Could not access DASD $dev in time"
111 devname
=$
(cd /sys
/bus
/ccw
/devices
/$dev/block
; set -- *; [ -b /dev
/$1 ] && echo $1)
112 devname
=${devname:-dasda}
114 [[ -d /mnt
]] || mkdir
/mnt
115 if cmsfs-fuse
--to=UTF-8
-a /dev
/$devname /mnt
; then
116 cat /mnt
/$2 > /run
/initramfs
/$2
117 umount
/mnt || umount
-l /mnt
120 echo $
"Could not read conf file $2 on CMS DASD $1."
124 if ! sysecho
/sys
/bus
/ccw
/devices
/$dev/online
0; then
125 echo $
"DASD $dev could not be set offline again"
130 # unbind all dasds to unload the dasd modules for a clean start
131 ( cd /sys
/bus
/ccw
/drivers
/dasd-eckd
; for i
in *.
*; do echo $i > unbind
;done)
133 modprobe
-r dasd_eckd_mod
135 modprobe
-r dasd_diag_mod
145 SUBCHANNELS
="$(echo $SUBCHANNELS | sed 'y/ABCDEF/abcdef/')"
147 if [[ $NETTYPE ]]; then
149 echo -n $NETTYPE,$SUBCHANNELS
150 [[ $PORTNAME ]] && echo -n ",portname=$PORTNAME"
151 [[ $LAYER2 ]] && echo -n ",layer2=$LAYER2"
152 [[ "$NETTYPE" = "ctc" ]] && [[ $CTCPROT ]] && echo -n ",protocol=$CTCPROT"
158 read -a subch_array
<<< "indexzero,$SUBCHANNELS"
160 devbusid
=${subch_array[1]}
161 if [ "$NETTYPE" = "ctc" ]; then
167 printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="%s", KERNELS=="%s", ENV{INTERFACE}=="?*", RUN+="/sbin/initqueue --onetime --unique --name cmsifup-$env{INTERFACE} /sbin/cmsifup $env{INTERFACE}"\n' "$driver" "$devbusid" > /etc
/udev
/rules.d
/99-cms.rules
168 # remove the default net rules
169 rm -f -- /etc
/udev
/rules.d
/91-default-net.rules
170 [[ -f /etc
/udev
/rules.d
/90-net.rules
]] \
171 ||
printf 'SUBSYSTEM=="net", ACTION=="online", RUN+="/sbin/initqueue --onetime --env netif=$env{INTERFACE} source_hook initqueue/online"\n' >> /etc
/udev
/rules.d
/99-cms.rules
172 udevadm control
--reload
176 if [[ $DASD ]] && [[ $DASD != "none" ]]; then
177 echo $DASD | normalize_dasd_arg
> /etc
/dasd.conf
178 echo "options dasd_mod dasd=$DASD" > /etc
/modprobe.d
/dasd_mod.conf
183 for i
in ${!FCP_*}; do
184 echo "${!i}" |
while read port rest ||
[ -n "$port" ]; do
195 echo $port $rest >> /etc
/zfcp.conf
199 [[ $_do_zfcp ]] && zfcp_cio_free
203 [[ $CMSDASD ]] || CMSDASD
=$
(getarg
"CMSDASD=")
204 [[ $CMSCONFFILE ]] || CMSCONFFILE
=$
(getarg
"CMSCONFFILE=")
206 # Parse configuration
207 if [ -n "$CMSDASD" -a -n "$CMSCONFFILE" ]; then
208 if readcmsfile
$CMSDASD $CMSCONFFILE; then
209 ln -s /run
/initramfs
/$CMSCONFFILE /tmp
/$CMSCONFFILE
210 ln -s /run
/initramfs
/$CMSCONFFILE /tmp
/cms.conf