From d7262ac0caf3c49f5033d2ca07feda6b782bd669 Mon Sep 17 00:00:00 2001 From: Bailetti Tommaso Date: Tue, 10 Dec 2024 16:48:22 +0100 Subject: [PATCH] fix(phonehome): get always the generated UUID instead of the system one (#967) --- packages/ns-phonehome/files/phonehome | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/ns-phonehome/files/phonehome b/packages/ns-phonehome/files/phonehome index 9dc08bad9..ecb8446da 100755 --- a/packages/ns-phonehome/files/phonehome +++ b/packages/ns-phonehome/files/phonehome @@ -57,15 +57,13 @@ if os.path.isdir('/proc/bus/pci'): pci[fields[0]]['device_name'] = fields[3] pci[fields[0]]['driver'] = drivers.get(fields[0], '') -# use hardware uuid, if not present just generate one -sid = _run("cat /sys/class/dmi/id/product_uuid") +# generate the UUID if not present +u = EUci() +sid = u.get('phonehome', 'config', 'uuid', default=None) if not sid: - u = EUci() - sid = u.get('phonehome', 'config', 'uuid', default=None) - if not sid: - sid = str(uuid.uuid4()) - u.set('phonehome', 'config', 'uuid', sid) - u.commit('phonehome') + sid = str(uuid.uuid4()) + u.set('phonehome', 'config', 'uuid', sid) + u.commit('phonehome') product = _run("cat /sys/devices/virtual/dmi/id/product_name") if not product: