From 3b8feef5b46f73449cbe503b18822d4d8fe3f50f Mon Sep 17 00:00:00 2001 From: Nils Meyer Date: Thu, 6 Oct 2016 20:09:54 +0000 Subject: [PATCH] Resolve symlink for device Resolving the symlink before using the Device Variable fixes issues with lsblk and blkid. Symlinks may be problematic when using ZFS and using a path like /dev/zvol/poolname/volname. Fixes coreos/bugs#1599 for me. --- bin/coreos-install | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/coreos-install b/bin/coreos-install index 88ecf83..7cc166b 100755 --- a/bin/coreos-install +++ b/bin/coreos-install @@ -309,6 +309,11 @@ if [[ -z "${DEVICE}" ]]; then exit 1 fi +# Symlink may cause trouble with lsblk and blkid +if [[ -L "${DEVICE}" ]]; then + DEVICE=$(readlink -f "${DEVICE}") +fi + if ! [[ $(lsblk -n -d -o TYPE "${DEVICE}") =~ ^(disk|loop|lvm)$ ]]; then echo "$0: Target block device (${DEVICE}) is not a full disk." >&2 exit 1