Showing with 28 additions and 9 deletions.
  1. +11 −1 CHANGELOG.md
  2. +12 −7 sortbootorder.c
  3. +5 −1 utils/sec_reg_menu.c
12 changes: 11 additions & 1 deletion CHANGELOG.md
Expand Up @@ -8,6 +8,14 @@ Releases 4.5.x and 4.6.x are based on mainline support submitted in

## [Unreleased]

## [v4.6.11] - 2018-09-28
### Fixed
- printing serial number when security registers are erased

## [v4.6.10] - 2018-09-24
### Changed
- rewrite CBFS access using existing libpayload API

## [v4.6.9] - 2018-06-08
### Added
- erase security registers content option in hidden menu
Expand Down Expand Up @@ -136,7 +144,9 @@ initial commit based on [coreboot_140908](http://pcengines.ch/tmp/coreboot_14090
### Fixed
- used proper way to access extended SPI registers

[Unreleased]: https://github.com/pcengines/sortbootorder/compare/v4.6.9...master
[Unreleased]: https://github.com/pcengines/sortbootorder/compare/v4.6.11...master
[v4.6.11]: https://github.com/pcengines/sortbootorder/compare/v4.6.10...v4.6.11
[v4.6.10]: https://github.com/pcengines/sortbootorder/compare/v4.6.9...v4.6.10
[v4.6.9]: https://github.com/pcengines/sortbootorder/compare/v4.6.8...v4.6.9
[v4.6.8]: https://github.com/pcengines/sortbootorder/compare/v4.6.5...v4.6.8
[v4.6.5]: https://github.com/pcengines/sortbootorder/compare/v4.6.4...v4.6.5
Expand Down
19 changes: 12 additions & 7 deletions sortbootorder.c
Expand Up @@ -98,6 +98,8 @@ int main(void) {
u8 line_start = 0;
u8 line_number = 0;
char *token;
char *bootorder_data;
size_t cbfs_length;
#ifndef COREBOOT_LEGACY
struct cbfs_handle *bootorder_handle;
#endif
Expand Down Expand Up @@ -138,40 +140,43 @@ int main(void) {
printf("Warning: The bootorder file is not 4k aligned!\n");
#endif


bootorder_data = (char *) cbfs_get_file_content( CBFS_DEFAULT_MEDIA, BOOTORDER_FILE, CBFS_TYPE_RAW, &cbfs_length );

// Get required files from CBFS
fetch_file_from_cbfs( BOOTORDER_FILE, bootlist, &max_lines );
fetch_file_from_cbfs( BOOTORDER_DEF, bootlist_def, &bootlist_def_ln );
fetch_file_from_cbfs( BOOTORDER_MAP, bootlist_map, &bootlist_map_ln );

// Init ipxe and serial status
token = cbfs_find_string("pxen", BOOTORDER_FILE);
token = strstr(bootorder_data, "pxen");
token += strlen("pxen");
ipxe_toggle = token ? strtoul(token, NULL, 10) : 1;

token = cbfs_find_string("usben", BOOTORDER_FILE);
token = strstr(bootorder_data, "usben");
token += strlen("usben");
usb_toggle = token ? strtoul(token, NULL, 10) : 1;

token = cbfs_find_string("scon", BOOTORDER_FILE);
token = strstr(bootorder_data, "scon");
token += strlen("scon");
console_toggle = token ? strtoul(token, NULL, 10) : 1;

#ifndef TARGET_APU1
token = cbfs_find_string("ehcien", BOOTORDER_FILE);
token = strstr(bootorder_data, "ehcien");
token += strlen("ehcien");
ehci0_toggle = token ? strtoul(token, NULL, 10) : 1;
#endif

token = cbfs_find_string("uartc", BOOTORDER_FILE);
token = strstr(bootorder_data, "uartc");
token += strlen("uartc");
uartc_toggle = token ? strtoul(token, NULL, 10) : 0;

token = cbfs_find_string("uartd", BOOTORDER_FILE);
token = strstr(bootorder_data, "uartd");
token += strlen("uartd");
uartd_toggle = token ? strtoul(token, NULL, 10) : 0;

#ifndef TARGET_APU1
token = cbfs_find_string("mpcie2_clk", BOOTORDER_FILE);
token = strstr(bootorder_data, "mpcie2_clk");
token += strlen("mpcie2_clk");
mpcie2_clk_toggle = token ? strtoul(token, NULL, 10) : 0;
#endif
Expand Down
6 changes: 5 additions & 1 deletion utils/sec_reg_menu.c
Expand Up @@ -50,7 +50,11 @@ static void cmd_read_serial(void)
return;
}

printf("serial: %s\n", buf);
if (buf[0] != 0xff) {
printf("serial: %s\n", buf);
} else {
printf("serial: \n");
}
}

static void cmd_write_serial(char *cmd)
Expand Down