From: Brian King Date: Fri, 26 Feb 2021 20:24:07 +0000 (-0600) Subject: nvme: Make gen-hostnqn use partition UUID on IBM POWER systems X-Git-Tag: v1.14~67 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=bb20789a34c93b7a871ab35efd6a4c8ae6ebb76b;p=users%2Fsagi%2Fnvme-cli.git nvme: Make gen-hostnqn use partition UUID on IBM POWER systems IBM POWER systems expose a platform created UUID in the device tree. Use that as the UUID in the host NQN. Signed-off-by: Brian King --- diff --git a/scripts/gen-hostnqn.sh b/scripts/gen-hostnqn.sh index d8783cfc..5138f0c0 100644 --- a/scripts/gen-hostnqn.sh +++ b/scripts/gen-hostnqn.sh @@ -2,7 +2,11 @@ LC_ALL=C -UUID=$(dmidecode -s system-uuid | tr -d '[:space:]') +if [ -e "/proc/device-tree/ibm,partition-uuid" ] ; then + UUID=$(tr -d '\0' < /proc/device-tree/ibm,partition-uuid) +else + UUID=$(dmidecode -s system-uuid | tr -d '[:space:]') +fi if [ -z "$UUID" ] ; then >&2 echo "No UUID found, can't determine hostnqn."