network: don't use "ifup -m"
[dracut.git] / modules.d / 95dasd_rules / parse-dasd.sh
blobeb1edf88859a5eb6c0698c2c06daf01fe7fe0467
1 #!/bin/sh
3 create_udev_rule() {
4 local ccw=$1
5 local _drv _cu_type _dev_type
6 local _rule=/etc/udev/rules.d/51-dasd-${ccw}.rules
8 if [ -e /sys/bus/ccw/devices/${ccw} ] ; then
9 read _cu_type < /sys/bus/ccw/devices/${ccw}/cutype
10 read _dev_type < /sys/bus/ccw/devices/${ccw}/devtype
12 case "$_cu_type" in
13 3990/*|2105/*|2107/*|1750/*|9343/*)
14 _drv=dasd-eckd
16 6310/*)
17 _drv=dasd-fba
19 3880/*)
20 case "$_dev_type" in
21 3380/*)
22 _drv=dasd_eckd
24 3370/*)
25 _drv=dasd-fba
27 esac
29 esac
30 [ -z "${_drv}" ] && return 0
32 [ -e ${_rule} ] && return 0
34 cat > $_rule <<EOF
35 ACTION=="add", SUBSYSTEM=="ccw", KERNEL=="$ccw", IMPORT{program}="collect $ccw %k ${ccw} $_drv"
36 ACTION=="add", SUBSYSTEM=="drivers", KERNEL=="$_drv", IMPORT{program}="collect $ccw %k ${ccw} $_drv"
37 ACTION=="add", ENV{COLLECT_$ccw}=="0", ATTR{[ccw/$ccw]online}="1"
38 EOF
41 for dasd_arg in $(getargs root=) $(getargs resume=); do
43 case $dasd_arg in
44 /dev/disk/by-path/ccw-*)
45 ccw_arg=${dasd_arg##*/}
46 break;
47 esac
48 if [ -n "$ccw_arg" ] ; then
49 IFS="-"
50 set -- $ccw_arg
51 create_udev_rule $2
54 done