Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revision Both sides next revision
en:linux:nfs_unique_machineid [2020/05/06 03:21]
alex created
en:linux:nfs_unique_machineid [2020/05/06 03:26]
alex
Line 2: Line 2:
  
  
 +
 +<code bash machineid>​
 +#!/bin/sh -e
 +
 +PREREQS=""​
 +
 +prereqs() { echo "​$PREREQS";​ }
 +
 +case "​$1"​ in
 +    prereqs)
 +    prereqs
 +    exit 0
 +    ;;
 +esac
 +
 +# write sanitized motherboard UUID to /​run/​machine-id
 +sed '​s/​-//​g'​ /​sys/​class/​dmi/​id/​product_uuid > /​run/​machine-id
 +
 +# requires the following symbolic links:
 +# ln -sf /​run/​machine-id /​etc/​machine-id
 +# ln -sf /​run/​machine-id /​var/​lib/​dbus/​machine-id
 +
 +</​code>​