Skip to content

Commit

Permalink
fix(phonehome): get always the generated UUID instead of the system o…
Browse files Browse the repository at this point in the history
…ne (#967)
  • Loading branch information
Tbaile authored Dec 10, 2024
1 parent 9558dec commit d7262ac
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions packages/ns-phonehome/files/phonehome
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d7262ac

Please sign in to comment.