summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/control1
-rwxr-xr-xscripts/init/vyos-router6
2 files changed, 6 insertions, 1 deletions
diff --git a/debian/control b/debian/control
index edbeee7..0836fe8 100644
--- a/debian/control
+++ b/debian/control
@@ -21,6 +21,7 @@ Depends: sed (>= 4.1.5),
systemd,
libboost-filesystem1.55.0 | libboost-filesystem1.62.0 | libboost-filesystem1.67.0,
libapt-pkg4.12 | libapt-pkg5.0,
+ uuid-runtime,
${perl:Depends}, ${shlibs:Depends}
Suggests: util-linux (>= 2.13-5),
net-tools,
diff --git a/scripts/init/vyos-router b/scripts/init/vyos-router
index 7863bd9..2582736 100755
--- a/scripts/init/vyos-router
+++ b/scripts/init/vyos-router
@@ -178,12 +178,16 @@ gen_duid ()
{
DUID_FILE="/var/lib/dhcpv6/dhcp6c_duid"
UUID_FILE="/sys/class/dmi/id/product_uuid"
- if [ ! -f ${UUID_FILE} ]; then
+ UUID_FILE_ALT="/sys/class/dmi/id/product_serial"
+ if [ ! -f ${UUID_FILE} ] && [ ! -f ${UUID_FILE_ALT} ]; then
return 1
fi
# DUID is based on the BIOS/EFI UUID. We omit additional - characters
UUID=$(cat ${UUID_FILE} | tr -d -)
+ if [ -z ${UUID} ]; then
+ UUID=$(uuidgen --sha1 --namespace @dns --name $(cat ${UUID_FILE_ALT}) | tr -d -)
+ fi
# Add DUID type4 (UUID) information
DUID_TYPE="0004"