stand: uboot: Do not panic if we can't find a boot device

It is really anoying to panic when there is no boot device as you
cannot see the availables ones.
This commit is contained in:
Emmanuel Vadot 2018-07-02 18:23:43 +00:00
parent 32c52b4847
commit f127d86390
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=335869

View file

@ -444,8 +444,10 @@ main(int argc, char **argv)
/*
* Enumerate U-Boot devices
*/
if ((devs_no = ub_dev_enum()) == 0)
panic("no U-Boot devices found");
if ((devs_no = ub_dev_enum()) == 0) {
printf("no U-Boot devices found");
goto do_interact;
}
printf("Number of U-Boot devices: %d\n", devs_no);
get_load_device(&load_type, &load_unit, &load_slice, &load_partition);
@ -492,6 +494,7 @@ main(int argc, char **argv)
env_setenv("loaddev", EV_VOLATILE, ldev, env_noset, env_nounset);
printf("Booting from %s\n", ldev);
do_interact:
setenv("LINES", "24", 1); /* optional */
setenv("prompt", "loader>", 1);