diff options
author | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | 2016-03-10 04:32:46 +0100 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2016-03-11 18:41:41 +0100 |
commit | 1aca8b898da359fbde2976ba0d031de8be6e857c (patch) | |
tree | 92663b5e2c30addf0a2de895d92f03c931333597 /payloads/coreinfo | |
parent | 9c3ff1ba5209220cd41bee16015ae388ac6fce39 (diff) |
coreinfo/cbfs: Don't assume that the free space is at the end
On emulation/qemu-i440fx, I get this layout:
Name Offset Type Size
cbfs master header 0x0 cbfs header 32
fallback/romstage 0x80 stage 14284
fallback/ramstage 0x38c0 stage 42382
fallback/payload 0xdec0 payload 1165052
config 0x12a600 raw 352
revision 0x12a7c0 raw 572
cmos_layout.bin 0x12aa40 cmos_layout 772
fallback/dsdt.aml 0x12ad80 raw 4000
img/coreinfo 0x12bd80 payload 1165052
(empty) 0x2484c0 null 1799192
bootblock 0x3ff900 bootblock 1456
... which coreinfo displays in the following way, without this patch:
cbfs master header
fallback/romstage
fallback/ramstage
fallback/payload
config
revision
cmos_layout.bin
fallback/dsdt.aml
img/coreinfo
<free space>
Change-Id: I21eb1dfbe52921843d28683c9396e9b27caa4fbf
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/14024
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'payloads/coreinfo')
-rw-r--r-- | payloads/coreinfo/cbfs_module.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/payloads/coreinfo/cbfs_module.c b/payloads/coreinfo/cbfs_module.c index a5ddc53171..1a59d01d28 100644 --- a/payloads/coreinfo/cbfs_module.c +++ b/payloads/coreinfo/cbfs_module.c @@ -134,10 +134,15 @@ static int cbfs_module_redraw(WINDOW * win) wattrset(win, COLOR_PAIR(3) | A_BOLD); else wattrset(win, COLOR_PAIR(2)); - if (i == filecount - 1) - mvwprintw(win, 2 + i, 1, "<free space>"); - else + + if (strlen(filenames[i]) == 0) { + if (findfile(filenames[i])->type == COMPONENT_NULL) + mvwprintw(win, 2 + i, 1, "<free space>"); + else + mvwprintw(win, 2 + i, 1, "<unnamed>"); + } else { mvwprintw(win, 2 + i, 1, "%.25s", filenames[i]); + } } f = findfile(filenames[selected]); |