mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-11-07 04:36:52 -10:00
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:
1 parent
0693c3f7cb
commit
41cf74fe8c
2 files changed
+2
-2
No files matched your search
@@ -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