| 1 |
|
| 2 |
|
| 3 |
#include <cbfs.h> |
| 4 |
#include <device/device.h> |
| 5 |
#include <smbios.h> |
| 6 |
#include <string.h> |
| 7 |
#include <uuid.h> |
| 8 |
|
| 9 |
void smbios_system_set_uuid(u8 *uuid) |
| 10 |
{ |
| 11 |
|
| 12 |
char uuid_str[UUID_STRLEN + 3] = {0}; |
| 13 |
uint8_t system_uuid[UUID_LEN]; |
| 14 |
|
| 15 |
size_t uuid_len = cbfs_load("system_uuid", uuid_str, UUID_STRLEN); |
| 16 |
|
| 17 |
if (uuid_len >= UUID_STRLEN && uuid_len <= UUID_STRLEN + 3) { |
| 18 |
|
| 19 |
uuid_str[UUID_STRLEN] = '\0'; |
| 20 |
if (!parse_uuid(system_uuid, uuid_str)) |
| 21 |
memcpy(uuid, system_uuid, UUID_LEN); |
| 22 |
} |
| 23 |
} |