From 87176b057ef2ab61bb5bf420b38d4e0fd2484fc5 Mon Sep 17 00:00:00 2001 From: Philipp Kern Date: Sat, 19 Sep 2015 23:44:08 +0200 Subject: [PATCH] Use mapdevfs to find the device of the root filesystem. This no longer forces the device path for the root system to be a DASD. Instead it infers the root device like on any other platform. (The code is mostly the one lilo-installer uses.) This requires sysconfig-hardware (>= 0.0.10+nmu3, or feature-equivalent) in the target system to set the relevant DASDs online by using configuration stored in the initrd. It is copied into the final system by s390-sysconfig-writer. --- debian/changelog | 6 ++++++ debian/zipl-installer.postinst | 22 +++++++++++++--------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8d5fcb9..85d6680 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +zipl-installer (0.0.28) UNRELEASED; urgency=medium + + * Use mapdevfs to find the device of the root filesystem. + + -- Philipp Kern Sat, 19 Sep 2015 23:41:42 +0200 + zipl-installer (0.0.27) unstable; urgency=medium * Log the output of zipl to syslog. diff --git a/debian/zipl-installer.postinst b/debian/zipl-installer.postinst index 2eeb5bd..c70ab6f 100755 --- a/debian/zipl-installer.postinst +++ b/debian/zipl-installer.postinst @@ -2,19 +2,23 @@ . /usr/share/debconf/confmodule -findfs () { +log() { + logger -t zipl-installer "$@" +} + +info() { + log "info: $@" +} + +findfs() { mount | grep "on /target${1%/} " | tail -n1 | cut -d' ' -f1 } -ROOT_PLAIN="$(findfs /)" -name="${ROOT_PLAIN#/dev/}" -disk="${name%%[0-9]*}" -part="${name#$disk}" -devpath=/sys/block/$disk/$(readlink /sys/block/$disk/device) -dev=${devpath##*/} -ROOT=/dev/disk/by-path/ccw-$dev-part$part +rootfs_devfs="$(findfs /)" +rootfs="$(mapdevfs $rootfs_devfs)" +log "Root filesystem on ${rootfs} (${rootfs_devfs})" -PARAMETER="root=$ROOT" +PARAMETER="root=${rootfs}" cat > /target/etc/zipl.conf << EOF [defaultboot] -- 2.20.1