From bb20789a34c93b7a871ab35efd6a4c8ae6ebb76b Mon Sep 17 00:00:00 2001 From: Brian King Date: Fri, 26 Feb 2021 14:24:07 -0600 Subject: [PATCH] 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 --- scripts/gen-hostnqn.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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." -- 2.50.1