#!/bin/sh [ "$#" -lt 1 ] && exit 0 find_mount_dev() { local mnt="$1" awk "\$2 == \"$mnt\" { print \$1 }" /proc/mounts | tail -n 1 } zipl_gen_conf() { KERNEL_FLAVOR="-vanilla" RAMDISK_FLAVOR="-vanilla" rootdev=$(find_mount_dev "/") root_parm="root=$rootdev" _tmpfile="$(mktemp)" cat /proc/cmdline | tr A-Z a-z | xargs -n 1 | grep '=' > "$_tmpfile" . "$_tmpfile" > /dev/null 2>&1 rm "$_tmpfile" cat > /etc/zipl.conf <<- EOF [defaultboot] defaultauto prompt=1 timeout=5 default=linux target=/boot [linux] image=/boot/vmlinuz$KERNEL_FLAVOR ramdisk=/boot/initramfs$RAMDISK_FLAVOR parameters="$root_parm dasd=$dasd s390x_net=$s390x_net" EOF } zipl_run() { zipl_gen_conf /sbin/zipl --verbose } "$1"