]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme: Make gen-hostnqn use partition UUID on IBM POWER systems
authorBrian King <brking@linux.vnet.ibm.com>
Fri, 26 Feb 2021 20:24:07 +0000 (14:24 -0600)
committerKeith Busch <kbusch@kernel.org>
Mon, 1 Mar 2021 18:37:35 +0000 (11:37 -0700)
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 <brking@linux.vnet.ibm.com>
scripts/gen-hostnqn.sh

index d8783cfc2a360a6b915036d4fd8fafe1ce03ce33..5138f0c06041b53360cf7bded63ba30809c1b9ad 100644 (file)
@@ -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."