loader - guard against empty rootdev
At least one instance of u-boot pretending to be EFI is passing empty rootdev to loader which does not end well. A simple precaution is harmless. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D50334
This commit is contained in:
@@ -111,7 +111,7 @@ md_load_dual(char *args, vm_offset_t *modulep, vm_offset_t *dtb, int kern64)
|
||||
* tested/set by MI code before launching the kernel.
|
||||
*/
|
||||
rootdevname = getenv("rootdev");
|
||||
if (rootdevname == NULL)
|
||||
if (rootdevname == NULL || *rootdevname == '\0')
|
||||
rootdevname = getenv("currdev");
|
||||
/* Try reading the /etc/fstab file to select the root device */
|
||||
getrootmount(rootdevname);
|
||||
|
||||
@@ -513,7 +513,7 @@ find_currdev(bool do_bootmgr, bool is_last,
|
||||
* it's wrong.
|
||||
*/
|
||||
rootdev = getenv("rootdev");
|
||||
if (rootdev != NULL) {
|
||||
if (rootdev != NULL && *rootdev != '\0') {
|
||||
printf(" Setting currdev to configured rootdev %s\n",
|
||||
rootdev);
|
||||
set_currdev(rootdev);
|
||||
|
||||
Reference in New Issue
Block a user