How are these files generated, how are they different?
these pseudo-files are generated by code from the dmi-id.c , dmi_scan.c and dmi-sysfs.c from the drivers/firmware directory. the content is taken from the bios in accordance with the smbios specification, the documentation on which you should first of all refer to “what does this or that returned information differ from”. secondarily (for example, if the returned information is contrary to the specification), contact the manufacturer of the bios and / or motherboard.
on my system, for example, it is very difficult not to notice the differences between the contents of these two files:
$ sudo tail /sys/class/dmi/id/product_{serial,uuid} ==> /sys/class/dmi/id/product_serial <== System Serial Number ==> /sys/class/dmi/id/product_uuid <== 0F0914E0-5BCB-11D9-AE58-5404A6CC1207
How do they change? When you reinstall the system they change?
this information is likely to be gathered from the smbios specification description mentioned above.
Why do these files have root access only?
The rights to pseudo-files in the /sys/class/dmi/id/ directory under discussion are defined in the dmi-id.c from lines 42 to 59 (in the second field in the macro call DEFINE_DMI_ATTR_WITH_SHOW ). The commit that added these lines was made by Lennart Poettering <mzxreary@0pointer.de> (yeah, that one). details, you can probably ask directly from him, or in the lkml mailing list .
Do the other files in this directory have read permissions for all users?
Yes, most have. what you can be convinced of by examining those very lines (from 42 to 59), and simply by running:
$ ls -l /sys/class/dmi/id/