mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-23 22:14:54 +00:00
bootflow: Show an empty filename when there is none
At present 'bootflow list' shows <NULL> for the filename when it is not present. Show an empty string instead, since that is more user-friendly. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
00613bc19a
commit
c3867e2e98
2 changed files with 13 additions and 11 deletions
|
@ -71,7 +71,7 @@ static void show_bootflow(int index, struct bootflow *bflow, bool errors)
|
||||||
printf("%3x %-11s %-6s %-9.9s %4x %-25.25s %s\n", index,
|
printf("%3x %-11s %-6s %-9.9s %4x %-25.25s %s\n", index,
|
||||||
bflow->method->name, bootflow_state_get_name(bflow->state),
|
bflow->method->name, bootflow_state_get_name(bflow->state),
|
||||||
bflow->dev ? dev_get_uclass_name(dev_get_parent(bflow->dev)) :
|
bflow->dev ? dev_get_uclass_name(dev_get_parent(bflow->dev)) :
|
||||||
"(none)", bflow->part, bflow->name, bflow->fname);
|
"(none)", bflow->part, bflow->name, bflow->fname ?: "");
|
||||||
if (errors)
|
if (errors)
|
||||||
report_bootflow_err(bflow, bflow->err);
|
report_bootflow_err(bflow, bflow->err);
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,21 +167,22 @@ static int bootflow_cmd_scan_e(struct unit_test_state *uts)
|
||||||
ut_assert_nextline("Seq Method State Uclass Part Name Filename");
|
ut_assert_nextline("Seq Method State Uclass Part Name Filename");
|
||||||
ut_assert_nextlinen("---");
|
ut_assert_nextlinen("---");
|
||||||
ut_assert_nextline("Scanning bootdev 'mmc2.bootdev':");
|
ut_assert_nextline("Scanning bootdev 'mmc2.bootdev':");
|
||||||
ut_assert_nextline(" 0 extlinux media mmc 0 mmc2.bootdev.whole <NULL>");
|
ut_assert_nextline(" 0 extlinux media mmc 0 mmc2.bootdev.whole ");
|
||||||
ut_assert_nextline(" ** No partition found, err=-93: Protocol not supported");
|
ut_assert_nextline(" ** No partition found, err=-93: Protocol not supported");
|
||||||
ut_assert_nextline(" 1 efi media mmc 0 mmc2.bootdev.whole <NULL>");
|
ut_assert_nextline(" 1 efi media mmc 0 mmc2.bootdev.whole ");
|
||||||
ut_assert_nextline(" ** No partition found, err=-93: Protocol not supported");
|
ut_assert_nextline(" ** No partition found, err=-93: Protocol not supported");
|
||||||
|
|
||||||
ut_assert_nextline("Scanning bootdev 'mmc1.bootdev':");
|
ut_assert_nextline("Scanning bootdev 'mmc1.bootdev':");
|
||||||
ut_assert_nextline(" 2 extlinux media mmc 0 mmc1.bootdev.whole <NULL>");
|
ut_assert_nextline(" 2 extlinux media mmc 0 mmc1.bootdev.whole ");
|
||||||
ut_assert_nextline(" ** No partition found, err=-2: No such file or directory");
|
ut_assert_nextline(" ** No partition found, err=-2: No such file or directory");
|
||||||
ut_assert_nextline(" 3 efi media mmc 0 mmc1.bootdev.whole <NULL>");
|
ut_assert_nextline(" 3 efi media mmc 0 mmc1.bootdev.whole ");
|
||||||
ut_assert_nextline(" ** No partition found, err=-2: No such file or directory");
|
ut_assert_nextline(" ** No partition found, err=-2: No such file or directory");
|
||||||
ut_assert_nextline(" 4 extlinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf");
|
ut_assert_nextline(" 4 extlinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf");
|
||||||
ut_assert_nextline(" 5 efi fs mmc 1 mmc1.bootdev.part_1 efi/boot/bootsbox.efi");
|
ut_assert_nextline(" 5 efi fs mmc 1 mmc1.bootdev.part_1 efi/boot/bootsbox.efi");
|
||||||
|
|
||||||
ut_assert_skip_to_line("Scanning bootdev 'mmc0.bootdev':");
|
ut_assert_skip_to_line("Scanning bootdev 'mmc0.bootdev':");
|
||||||
ut_assert_skip_to_line(" 3f efi media mmc 0 mmc0.bootdev.whole <NULL>");
|
ut_assert_skip_to_line(
|
||||||
|
" 3f efi media mmc 0 mmc0.bootdev.whole ");
|
||||||
ut_assert_nextline(" ** No partition found, err=-93: Protocol not supported");
|
ut_assert_nextline(" ** No partition found, err=-93: Protocol not supported");
|
||||||
ut_assert_nextline("No more bootdevs");
|
ut_assert_nextline("No more bootdevs");
|
||||||
ut_assert_nextlinen("---");
|
ut_assert_nextlinen("---");
|
||||||
|
@ -192,10 +193,11 @@ static int bootflow_cmd_scan_e(struct unit_test_state *uts)
|
||||||
ut_assert_nextline("Showing all bootflows");
|
ut_assert_nextline("Showing all bootflows");
|
||||||
ut_assert_nextline("Seq Method State Uclass Part Name Filename");
|
ut_assert_nextline("Seq Method State Uclass Part Name Filename");
|
||||||
ut_assert_nextlinen("---");
|
ut_assert_nextlinen("---");
|
||||||
ut_assert_nextline(" 0 extlinux media mmc 0 mmc2.bootdev.whole <NULL>");
|
ut_assert_nextline(" 0 extlinux media mmc 0 mmc2.bootdev.whole ");
|
||||||
ut_assert_nextline(" 1 efi media mmc 0 mmc2.bootdev.whole <NULL>");
|
ut_assert_nextline(" 1 efi media mmc 0 mmc2.bootdev.whole ");
|
||||||
ut_assert_skip_to_line(" 4 extlinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf");
|
ut_assert_skip_to_line(
|
||||||
ut_assert_skip_to_line(" 3f efi media mmc 0 mmc0.bootdev.whole <NULL>");
|
" 4 extlinux ready mmc 1 mmc1.bootdev.part_1 /extlinux/extlinux.conf");
|
||||||
|
ut_assert_skip_to_line(" 3f efi media mmc 0 mmc0.bootdev.whole ");
|
||||||
ut_assert_nextlinen("---");
|
ut_assert_nextlinen("---");
|
||||||
ut_assert_nextline("(64 bootflows, 1 valid)");
|
ut_assert_nextline("(64 bootflows, 1 valid)");
|
||||||
ut_assert_console_end();
|
ut_assert_console_end();
|
||||||
|
@ -384,7 +386,7 @@ static int bootflow_system(struct unit_test_state *uts)
|
||||||
console_record_reset_enable();
|
console_record_reset_enable();
|
||||||
ut_assertok(run_command("bootflow scan -lH", 0));
|
ut_assertok(run_command("bootflow scan -lH", 0));
|
||||||
ut_assert_skip_to_line(
|
ut_assert_skip_to_line(
|
||||||
" 0 efi_mgr ready (none) 0 <NULL> <NULL>");
|
" 0 efi_mgr ready (none) 0 <NULL> ");
|
||||||
ut_assert_skip_to_line("No more bootdevs");
|
ut_assert_skip_to_line("No more bootdevs");
|
||||||
ut_assert_skip_to_line("(2 bootflows, 2 valid)");
|
ut_assert_skip_to_line("(2 bootflows, 2 valid)");
|
||||||
ut_assert_console_end();
|
ut_assert_console_end();
|
||||||
|
|
Loading…
Add table
Reference in a new issue