Hello, all. There is amount of information that should be unique to each machine and is supplied by coreboot. Most common examples are: - mobo serial number - UUID - Internal mac.
While first 2 are not very important, the fact that currently on some boards all of them will share the same API is disturbing. For some machines like thinkpads this info is in some EEPROM and can be easily read (see my path on gerrit to do so) On other boards that info is stored in vendor flash and currently coreboot just uses some hardcoded string which is a problem. I think that this info should be stored in some text config file in CBFS. E.g:
Mainboard serial: 99887766 Mainboard UUID: acdea9c8-be5e-4799-a972-ead8dab8e5c0 Internal MAC: 00:11:22:33:44:55
The file would be added at compile time from info supplied by user or randomly-generated strings if user didn't supply it. In case of missing file coreboot should disable internal NIC if possible. Duplicate macs should never go into networks. It being a separate file allows it to be easly replaced without recompilation. Is everyone ok with such plan of action?
On Sunday, January 26, 2014 01:22:46 AM Vladimir 'φ-coder/phcoder' Serbinenko wrote:
Hello, all. There is amount of information that should be unique to each machine and is supplied by coreboot. Most common examples are:
- mobo serial number
- UUID
- Internal mac.
There are a few things you will need to go about solving this (in this exact order):
1. A format for the key-value pairs. Here, you'd use your talk page on the wiki to make suggestions, and fine something sane. most likely a key (C valid name, followed by a colon, followed by the value string, followed by either a newline (easier to read the file as text), or a null character (easier to parse it as a string). Since you'll probably have to validate these strings at runtime, there is little value to making them null-terminated.
example 1 (null separator ignore newlines):
ether_mac1:C0:3E:B0:07:00:01\0 mainboard_name:Mambo Jumbo\0 ether_mac2:C0:3E:B0:07:00:01\0 <EOF>
example 2 (newline separator):
ether_mac1:C0:3E:B0:07:00:01 mainboard_name:Mambo Jumbo #`~!@#$%^&*()-_=+# UBXT ether_mac2:C0:3E:B0:07:00:02 <EOF>
2. A tool to generate and append new key-value pairs to the file. You might even use "echo >>", but something which verifies the strings for validity is preferred.
3. Integrate the new tool into the build system, and allow arbitrary key- value pairs to be generated. Maybe take inspiration from how we handle "cbfs- file-y"
4. Provide an implemented API coreboot-wise which reads these keys. This should be fairly similar to get_option(). (But of course, instead of a value, you'd get a string)
5. Convince people on gerrit that your idea is good.
All being said, this is actually pretty simple.
Alex