linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Extracting system UUID...
@ 2010-04-20 18:52 Darryl L. Pierce
  2010-04-20 19:10 ` Lennart Poettering
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Darryl L. Pierce @ 2010-04-20 18:52 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 449 bytes --]

Does anything return the UUID for the host system? Such as what was
returned by hal with:

(mcpierce@mcpierce-desktop:~)$ hal-get-property --udi \
     /org/freedesktop/Hal/devices/computer --key system.hardware.uuid
00DD19E3-DD3A-DE11-90DA-812C97507C34

-- 
Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc.
Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Extracting system UUID...
  2010-04-20 18:52 Extracting system UUID Darryl L. Pierce
@ 2010-04-20 19:10 ` Lennart Poettering
  2010-04-20 19:11 ` Greg KH
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Lennart Poettering @ 2010-04-20 19:10 UTC (permalink / raw)
  To: linux-hotplug

On Tue, 20.04.10 14:52, Darryl L. Pierce (dpierce@redhat.com) wrote:

> Does anything return the UUID for the host system? Such as what was
> returned by hal with:
> 
> (mcpierce@mcpierce-desktop:~)$ hal-get-property --udi \
>      /org/freedesktop/Hal/devices/computer --key system.hardware.uuid
> 00DD19E3-DD3A-DE11-90DA-812C97507C34

That's the product UUID key from the DMI data, which you also can read
from sysfs:

/sys/devices/virtual/dmi/id/product_uuid

Not sure what you want to use this for, but given that many BIOS vendors
just write rubbish to that field, it's mostly useless.

The D-Bus machine ID is usually more useful, as stored in
/var/lib/dbus/machine-id. It's nowadays available on virtually all
systems and considered part of the D-Bus API, and hence can be reliably
be used to identify a system. There's no need to actually use libdbus to
read that file.

Lennart

-- 
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net
http://0pointer.net/lennart/           GnuPG 0x1A015CC4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Extracting system UUID...
  2010-04-20 18:52 Extracting system UUID Darryl L. Pierce
  2010-04-20 19:10 ` Lennart Poettering
@ 2010-04-20 19:11 ` Greg KH
  2010-04-20 19:30 ` Darryl L. Pierce
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2010-04-20 19:11 UTC (permalink / raw)
  To: linux-hotplug

On Tue, Apr 20, 2010 at 02:52:05PM -0400, Darryl L. Pierce wrote:
> Does anything return the UUID for the host system? Such as what was
> returned by hal with:
> 
> (mcpierce@mcpierce-desktop:~)$ hal-get-property --udi \
>      /org/freedesktop/Hal/devices/computer --key system.hardware.uuid
> 00DD19E3-DD3A-DE11-90DA-812C97507C34

What piece of hardware on the host system would create such a "computer"
uuid?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Extracting system UUID...
  2010-04-20 18:52 Extracting system UUID Darryl L. Pierce
  2010-04-20 19:10 ` Lennart Poettering
  2010-04-20 19:11 ` Greg KH
@ 2010-04-20 19:30 ` Darryl L. Pierce
  2010-04-20 19:39 ` Greg KH
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Darryl L. Pierce @ 2010-04-20 19:30 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 722 bytes --]

On Tue, Apr 20, 2010 at 12:11:42PM -0700, Greg KH wrote:
> On Tue, Apr 20, 2010 at 02:52:05PM -0400, Darryl L. Pierce wrote:
> > Does anything return the UUID for the host system? Such as what was
> > returned by hal with:
> > 
> > (mcpierce@mcpierce-desktop:~)$ hal-get-property --udi \
> >      /org/freedesktop/Hal/devices/computer --key system.hardware.uuid
> > 00DD19E3-DD3A-DE11-90DA-812C97507C34
> 
> What piece of hardware on the host system would create such a "computer"
> uuid?

I believe it comes from BIOS.

-- 
Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc.
Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Extracting system UUID...
  2010-04-20 18:52 Extracting system UUID Darryl L. Pierce
                   ` (2 preceding siblings ...)
  2010-04-20 19:30 ` Darryl L. Pierce
@ 2010-04-20 19:39 ` Greg KH
  2010-04-20 19:49 ` Darryl L. Pierce
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2010-04-20 19:39 UTC (permalink / raw)
  To: linux-hotplug

On Tue, Apr 20, 2010 at 03:30:37PM -0400, Darryl L. Pierce wrote:
> On Tue, Apr 20, 2010 at 12:11:42PM -0700, Greg KH wrote:
> > On Tue, Apr 20, 2010 at 02:52:05PM -0400, Darryl L. Pierce wrote:
> > > Does anything return the UUID for the host system? Such as what was
> > > returned by hal with:
> > > 
> > > (mcpierce@mcpierce-desktop:~)$ hal-get-property --udi \
> > >      /org/freedesktop/Hal/devices/computer --key system.hardware.uuid
> > > 00DD19E3-DD3A-DE11-90DA-812C97507C34
> > 
> > What piece of hardware on the host system would create such a "computer"
> > uuid?
> 
> I believe it comes from BIOS.

Ah, as Lennart just pointed out, you really don't want to use that, it
can't be trusted on a lot of platforms.  Unless you don't mind having
the same value for lots of different machines :)

What do you want to use this value for?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Extracting system UUID...
  2010-04-20 18:52 Extracting system UUID Darryl L. Pierce
                   ` (3 preceding siblings ...)
  2010-04-20 19:39 ` Greg KH
@ 2010-04-20 19:49 ` Darryl L. Pierce
  2010-04-20 20:11 ` Greg KH
  2010-04-20 20:16 ` Lennart Poettering
  6 siblings, 0 replies; 8+ messages in thread
From: Darryl L. Pierce @ 2010-04-20 19:49 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 691 bytes --]

On Tue, Apr 20, 2010 at 12:39:13PM -0700, Greg KH wrote:
> Ah, as Lennart just pointed out, you really don't want to use that, it
> can't be trusted on a lot of platforms.  Unless you don't mind having
> the same value for lots of different machines :)
> 
> What do you want to use this value for?

It's going to be used to persistently and uniquely identify systems in a
network. The hostname can't be used since it's possible for a system to
come up with a different hostname within DHCP. 

-- 
Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc.
Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Extracting system UUID...
  2010-04-20 18:52 Extracting system UUID Darryl L. Pierce
                   ` (4 preceding siblings ...)
  2010-04-20 19:49 ` Darryl L. Pierce
@ 2010-04-20 20:11 ` Greg KH
  2010-04-20 20:16 ` Lennart Poettering
  6 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2010-04-20 20:11 UTC (permalink / raw)
  To: linux-hotplug

On Tue, Apr 20, 2010 at 03:49:28PM -0400, Darryl L. Pierce wrote:
> On Tue, Apr 20, 2010 at 12:39:13PM -0700, Greg KH wrote:
> > Ah, as Lennart just pointed out, you really don't want to use that, it
> > can't be trusted on a lot of platforms.  Unless you don't mind having
> > the same value for lots of different machines :)
> > 
> > What do you want to use this value for?
> 
> It's going to be used to persistently and uniquely identify systems in a
> network. The hostname can't be used since it's possible for a system to
> come up with a different hostname within DHCP. 

Try using the dbus id like was pointed out.  Otherwise you will have
lots of problems if people with the same type of machine connect to a
network (as is common in business settings.)

good luck,

greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Extracting system UUID...
  2010-04-20 18:52 Extracting system UUID Darryl L. Pierce
                   ` (5 preceding siblings ...)
  2010-04-20 20:11 ` Greg KH
@ 2010-04-20 20:16 ` Lennart Poettering
  6 siblings, 0 replies; 8+ messages in thread
From: Lennart Poettering @ 2010-04-20 20:16 UTC (permalink / raw)
  To: linux-hotplug

On Tue, 20.04.10 15:49, Darryl L. Pierce (dpierce@redhat.com) wrote:

> On Tue, Apr 20, 2010 at 12:39:13PM -0700, Greg KH wrote:
> > Ah, as Lennart just pointed out, you really don't want to use that, it
> > can't be trusted on a lot of platforms.  Unless you don't mind having
> > the same value for lots of different machines :)
> > 
> > What do you want to use this value for?
> 
> It's going to be used to persistently and uniquely identify systems in a
> network. The hostname can't be used since it's possible for a system to
> come up with a different hostname within DHCP. 

You really should use the D-Bus machine ID for stuff like this (as
mentioned). In fact, it was invented just for use cases like that. It is
reliably available everywhere, accessible without libdbus, has clearly
defined semantics and actually identifies the installation (in contrast
to the machine), which more often than not is the actual thing you want
to identify (especially in a VM environment, where multiple VMs might
end up with the same UUID otherwise if you really read it from the hw,
since after all you run multiple VMs on the same physical hw).

See the man page for more information about the D-Bus machine id:

http://linux.die.net/man/1/dbus-uuidgen

Lennart

-- 
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net
http://0pointer.net/lennart/           GnuPG 0x1A015CC4

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-04-20 20:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-20 18:52 Extracting system UUID Darryl L. Pierce
2010-04-20 19:10 ` Lennart Poettering
2010-04-20 19:11 ` Greg KH
2010-04-20 19:30 ` Darryl L. Pierce
2010-04-20 19:39 ` Greg KH
2010-04-20 19:49 ` Darryl L. Pierce
2010-04-20 20:11 ` Greg KH
2010-04-20 20:16 ` Lennart Poettering

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).