aboutsummaryrefslogtreecommitdiff
path: root/stand/efi/loader/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'stand/efi/loader/main.c')
-rw-r--r--stand/efi/loader/main.c39
1 files changed, 22 insertions, 17 deletions
diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c
index eb143989190d..85c545e0e72f 100644
--- a/stand/efi/loader/main.c
+++ b/stand/efi/loader/main.c
@@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$");
#include <smbios.h>
#include "efizfs.h"
+#include "framebuffer.h"
#include "loader_efi.h"
@@ -203,7 +204,7 @@ set_currdev_devdesc(struct devdesc *currdev)
{
const char *devname;
- devname = efi_fmtdev(currdev);
+ devname = devformat(currdev);
printf("Setting currdev to %s\n", devname);
set_currdev(devname);
}
@@ -273,7 +274,7 @@ probe_zfs_currdev(uint64_t guid)
currdev.pool_guid = guid;
currdev.root_guid = 0;
set_currdev_devdesc((struct devdesc *)&currdev);
- devname = efi_fmtdev(&currdev);
+ devname = devformat(&currdev.dd);
init_zfs_boot_options(devname);
rv = sanity_check_currdev();
@@ -719,7 +720,7 @@ parse_args(int argc, CHAR16 *argv[])
* method is flawed for non-ASCII characters).
*/
howto = 0;
- for (i = 1; i < argc; i++) {
+ for (i = 0; i < argc; i++) {
cpy16to8(argv[i], var, sizeof(var));
howto |= boot_parse_arg(var);
}
@@ -760,8 +761,20 @@ parse_uefi_con_out(void)
if (rv != EFI_SUCCESS)
rv = efi_global_getenv("ConOutDev", buf, &sz);
if (rv != EFI_SUCCESS) {
- /* If we don't have any ConOut default to serial */
- how = RB_SERIAL;
+ /*
+ * If we don't have any ConOut default to both. If we have GOP
+ * make video primary, otherwise just make serial primary. In
+ * either case, try to use both the 'efi' console which will use
+ * the GOP, if present and serial. If there's an EFI BIOS that
+ * omits this, but has a serial port redirect, we'll
+ * unavioidably get doubled characters (but we'll be right in
+ * all the other more common cases).
+ */
+ if (efi_has_gop())
+ how = RB_MULTIPLE;
+ else
+ how = RB_MULTIPLE | RB_SERIAL;
+ setenv("console", "efi,comconsole", 1);
goto out;
}
ep = buf + sz;
@@ -949,6 +962,9 @@ main(int argc, CHAR16 *argv[])
setenv("console", "efi", 1);
uhowto = parse_uefi_con_out();
#if defined(__riscv)
+ /*
+ * This workaround likely is papering over a real issue
+ */
if ((uhowto & RB_SERIAL) != 0)
setenv("console", "comconsole", 1);
#endif
@@ -975,9 +991,7 @@ main(int argc, CHAR16 *argv[])
"failures\n", i);
}
- for (i = 0; devsw[i] != NULL; i++)
- if (devsw[i]->dv_init != NULL)
- (devsw[i]->dv_init)();
+ devinit();
/*
* Detect console settings two different ways: one via the command
@@ -1280,15 +1294,6 @@ command_reboot(int argc, char *argv[])
return (CMD_ERROR);
}
-COMMAND_SET(quit, "quit", "exit the loader", command_quit);
-
-static int
-command_quit(int argc, char *argv[])
-{
- exit(0);
- return (CMD_OK);
-}
-
COMMAND_SET(memmap, "memmap", "print memory map", command_memmap);
static int