[PATCH 3/4] Sanitize DASD device specifications (#689470)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Make sure things like "DASD=21F" turns in to "0.0.021f" before we try to
bring it online.
---
 loader2/linuxrc.s390 |   12 ++++++------
 scripts/mk-images    |    1 +
 scripts/upd-instroot |    1 +
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/loader2/linuxrc.s390 b/loader2/linuxrc.s390
index 2732270..e152746 100644
--- a/loader2/linuxrc.s390
+++ b/loader2/linuxrc.s390
@@ -155,13 +155,13 @@ function readcmsfile() # $1=dasdport $2=filename
     if ! cmsfscat -d /dev/dasda -a $2 > /tmp/$2; then
         echo $"Could not read conf file $2 on CMS DASD $1."
     fi
-    # maybe replace with a more robust: dev=$(printf "0.0.%04x" $((0x${1})))
-    if [ ${#1} == 3 ]; then
-        dev="0.0.0${1}"
-    elif [ ${#1} == 4 ]; then
-        dev="0.0.${1}"
+    dev="$(echo $1 | tr [:upper:] [:lower:])"
+    if [ ! -r "/sys/bus/ccw/drivers/dasd-eckd/$dev" ]; then
+        dev=$(printf "0.0.%04x" $((0x$1)))
+    fi
+    if ! sysecho /sys/bus/ccw/drivers/dasd-eckd/$dev/online 0; then
+        echo $"DASD $dev could not be brought online."
     fi
-    sysecho /sys/bus/ccw/drivers/dasd-eckd/$dev/online 0
     rmmod dasd_eckd_mod
     rmmod dasd_mod
 }
diff --git a/scripts/mk-images b/scripts/mk-images
index 069bd4c..4d47c72 100755
--- a/scripts/mk-images
+++ b/scripts/mk-images
@@ -651,6 +651,7 @@ EOF
 	install -m 755 $IMGPATH/usr/sbin/dasdfmt $MBD_DIR/sbin/dasdfmt
 	install -m 755 $IMGPATH/usr/sbin/udevsettle $MBD_DIR/sbin/udevsettle
 	install -m 755 $IMGPATH/usr/sbin/udevd $MBD_DIR/sbin/udevd
+	install -m 755 $IMGPATH/usr/bin/printf $MBD_DIR/sbin/printf
 	mkdir -p $MBD_DIR/etc/udev
 	echo "# udev.conf" > $MBD_DIR/etc/udev/udev.conf
     fi
diff --git a/scripts/upd-instroot b/scripts/upd-instroot
index 2e58c98..1f5b9cd 100755
--- a/scripts/upd-instroot
+++ b/scripts/upd-instroot
@@ -544,6 +544,7 @@ usr/share/terminfo/v/vt320
 usr/share/terminfo/v/vt320-w
 usr/share/terminfo/x/xterm
 usr/share/terminfo/x/xterm-color
+usr/bin/printf
 usr/bin/strace
 usr/bin/ldd
 usr/sbin/chroot
-- 
1.7.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux