summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2008-10-21 13:06:37 -1000
committerDavid Cantrell <dcantrell@redhat.com>2008-10-21 13:06:37 -1000
commit9762dfc46cf731ca983dcdb57e31d40c3afbf24b (patch)
treecdf91566b2cd7d3dac75f6c5163a620e5c6c0c81
parent5a0ac6d89573555f769de2c93979d2fb0fad4035 (diff)
downloadanaconda-9762dfc46cf731ca983dcdb57e31d40c3afbf24b.tar.gz
anaconda-9762dfc46cf731ca983dcdb57e31d40c3afbf24b.tar.xz
anaconda-9762dfc46cf731ca983dcdb57e31d40c3afbf24b.zip
Correctly enable ignored CCW devices in linuxrc.s390 (#253075)
Take IBM's modified patch to enable CCW devices in linuxrc.s390. We do not need to use chccwdev and need to make sure we wait for udevsettle to...settle.
-rwxr-xr-x[-rw-r--r--]loader2/linuxrc.s39059
-rwxr-xr-xscripts/mk-images5
-rwxr-xr-xscripts/upd-instroot6
3 files changed, 60 insertions, 10 deletions
diff --git a/loader2/linuxrc.s390 b/loader2/linuxrc.s390
index b657204d4..93eedd3e0 100644..100755
--- a/loader2/linuxrc.s390
+++ b/loader2/linuxrc.s390
@@ -137,6 +137,16 @@ readcmsfile() # $1=dasdport $2=filename
{
local dev
if [ $# -ne 2 ]; then return; fi
+ if [ -r /proc/cio_ignore ]; then
+ # enable DASD device with conf file
+ if sysecho /proc/cio_ignore "free $1"; then
+ udevsettle
+ sleep 1
+ # the DASD device will be set online when loading the dasd driver
+ else
+ echo $"Could not free DASD $1 with conf file from device blacklist"
+ fi
+ fi
mknod /dev/dasda b 94 0
insmod dasd_mod$LO dasd=$1
insmod dasd_eckd_mod$LO
@@ -161,8 +171,19 @@ setupdevice()
if [ -r /proc/cio_ignore ]; then
# enable subchannels
for subchannel in ${SUBCHANNELS//,/ } ; do
- echo free $subchannel > /proc/cio_ignore
- /sbin/chccwdev -e $subchannel
+ if sysecho /proc/cio_ignore "free $subchannel"; then
+ # /proc/cio_ignore won't block on freeing devices until resensing
+ # has been completed, so wait until the udev event queue depletes
+ # (without udevsettle we could wait 2 seconds unconditionally)
+ # udevsettle only works if udevd is running (/dev/.udev/queue)!
+ udevsettle
+ # even though the device might now be online, some of its
+ # sysfs attributes (e.g. cutype) might not yet be available
+ sleep 1
+ # network channels cannot be set online, only the group later on
+ else
+ echo $"Could not free channel $subchannel from device blacklist"
+ fi
done
fi
@@ -256,6 +277,10 @@ route add -host 127.0.0.1 dev lo 2>/dev/null
echo -e "127.0.0.1\tlocalhost.localdomain localhost" > /etc/hosts
echo -e "::1\t\tlocalhost6.localdomain6 localhost6" >> /etc/hosts
+# udevd required by udevsettle
+# (important to start udevd at the right time, e.g. after setup of /dev)
+udevd --daemon
+
LO=""
[ -L /sbin/insmod ] && LO=".ko"
@@ -587,9 +612,19 @@ fi
if [ -n "$DASD" ]; then
# enable DASD devices
if [ -r /proc/cio_ignore ]; then
+ # ATTENTION: The loader passes $DASD as kernel module parameter value
+ # to the dasd driver and that syntax allows much more than what is
+ # assumed here. Please see the device drivers book for the details.
+ # The question is, if the user is allowed to take advantage of the full
+ # syntax supported by the dasd driver module?
for dev in ${DASD//,/ } ; do
- echo free $dev > /proc/cio_ignore
- /sbin/chccwdev -e $dev
+ if sysecho /proc/cio_ignore "free $dev"; then
+ udevsettle
+ sleep 1
+ # the DASD devices will be set online when loading the dasd driver
+ else
+ echo $"Could not free DASD device $dev from device blacklist"
+ fi
done
fi
@@ -598,15 +633,23 @@ fi
for i in ${!FCP_*}; do
# enable FCP devices
- if [ -r /proc/cio_ignore ]; then
- dev="$(echo ${!i} | cut -d ' ' -f 1)"
- echo free $dev > /proc/cio_ignore
- /sbin/chccwdev -e $dev
+ dev="$(echo ${!i} | cut -d ' ' -f 1)"
+ if [ -r /proc/cio_ignore ] && \
+ sysecho /proc/cio_ignore "free $dev"; then
+ udevsettle
+ sleep 1
+ # the FCP device will be set online later on when loading the zfcp driver
+ else
+ echo $"Could not free FCP device $dev from device blacklist"
fi
echo "${!i}" >> /tmp/fcpconfig
done
+# undo startup of udevd, only needed it for possible calls of udevsettle
+killall udevd
+# Do NOT use udevsettle after udevd has been terminated!
+
grep -q ext3 /proc/filesystems
if [ "$?" != "0" ]; then
insmod jbd$LO
diff --git a/scripts/mk-images b/scripts/mk-images
index 4c86f88f9..ac7f92fa5 100755
--- a/scripts/mk-images
+++ b/scripts/mk-images
@@ -443,6 +443,9 @@ PermitUserEnvironment yes
EOF
chmod 600 $MBD_DIR/etc/ssh/sshd_config
+ mkdir -p $MBD_DIR/etc/udev
+ cp -f $IMGPATH/etc/udev/udev.conf $MBD_DIR/etc/udev/udev.conf
+
# copy in the binaries
cp -f $IMGPATH/usr/bin/login $MBD_DIR/sbin/login
cp -f $IMGPATH/usr/sbin/sshd $MBD_DIR/sbin/sshd
@@ -450,6 +453,8 @@ EOF
cp -f $IMGPATH/usr/sbin/in.telnetd $MBD_DIR/sbin/in.telnetd
cp -f $IMGPATH/usr/bin/bash $MBD_DIR/sbin/bash
cp -f $IMGPATH/usr/bin/busybox $MBD_DIR/sbin/busybox
+ cp -f $IMGPATH/usr/sbin/udevd $MBD_DIR/sbin/udevd
+ cp -f $IMGPATH/usr/sbin/udevsettle $MBD_DIR/sbin/udevsettle
# make some symlinks
ln -sf bash $MBD_DIR/sbin/sh
diff --git a/scripts/upd-instroot b/scripts/upd-instroot
index 9fa9606e5..66c3d94e9 100755
--- a/scripts/upd-instroot
+++ b/scripts/upd-instroot
@@ -144,7 +144,7 @@ if [ $ARCH = s390 -o $ARCH = s390x ]; then
sed net-tools xinetd openssl openssh openssh-server coreutils
login initscripts XFree86-xauth bash portmap pam
telnet-server login mount grep modutils gawk
- XFree86-libs strace xorg-x11-xauth xorg-x11-libs"
+ XFree86-libs strace xorg-x11-xauth xorg-x11-libs udev"
fi
if [ $ARCH = ppc -o $ARCH = ppc64 ]; then
@@ -286,6 +286,7 @@ etc/selinux/targeted/*
usr/share/selinux/targeted/*
etc/security/selinux/policy.*
etc/security/selinux/file_contexts
+etc/udev/udev.conf
etc/yum/pluginconf.d/kmod.conf
$LIBDIR/bdevid/*
$LIBDIR/libaudit*.so*
@@ -541,7 +542,6 @@ usr/sbin/sshd
usr/sbin/glibc_post_upgrade
usr/sbin/in.telnetd
usr/sbin/xinetd
-sbin/chccwdev
sbin/cmsfslst
sbin/cmsfscat
sbin/busybox.anaconda
@@ -553,6 +553,8 @@ sbin/dasdfmt
sbin/swapon
sbin/swapoff
sbin/mkswap
+sbin/udevd
+sbin/udevsettle
bin/bash
bin/dd
bin/gawk