Summary: | stable/13: efi boot always defaults to cons: serial | ||
---|---|---|---|
Product: | Base System | Reporter: | Remko Catersels <sirdice> |
Component: | conf | Assignee: | Toomas Soome <tsoome> |
Status: | Closed FIXED | ||
Severity: | Affects Many People | CC: | emaste, tsoome |
Priority: | --- | ||
Version: | 13.0-STABLE | ||
Hardware: | amd64 | ||
OS: | Any |
Description
Remko Catersels
2021-02-04 16:35:23 UTC
(In reply to sirdice from comment #0) vidconsole is not legal value with efi. what does (from loader OK prompt) efi-show -g global -v ConOut tell? or from running system: efivar -d 8be4df61-93ca-11d2-aa0d-00e098032b8c-ConOut Same for ConOutDev? Yeah, was grasping at straws with vidconsole. IIRC that was valid with the old sc(4) console. I don't seem to have ConOut? root@molly:~ # efivar -d 8be4df61-93ca-11d2-aa0d-00e098032b8c-ConOut efivar: fetching 8be4df61-93ca-11d2-aa0d-00e098032b8c-ConOut: No such file or directory root@molly:~ # efivar | grep ConOut 8be4df61-93ca-11d2-aa0d-00e098032b8c-ConOutDev root@molly:~ # efivar -d 8be4df61-93ca-11d2-aa0d-00e098032b8c-ConOutDev 8be4df61-93ca-11d2-aa0d-00e098032b8c-ConOutDev : PciRoot(0x0)/Pci(0x2,0x0)/AcpiAdr(0x80010100) I do have a ConInDev: root@molly:~ # efivar | grep ConIn 8be4df61-93ca-11d2-aa0d-00e098032b8c-ConInDev root@molly:~ # efivar -d 8be4df61-93ca-11d2-aa0d-00e098032b8c-ConInDev 8be4df61-93ca-11d2-aa0d-00e098032b8c-ConInDev : PciRoot(0x0)/Pci(0x1f,0x0)/Acpi(PNP0303,0x0) Note that this system has now been booted by manually setting Cons: to video. Not sure if that matters for the contents of those variables. I can't get it to boot at all if Cons: is set to serial. I've also added a specific FreeBSD boot entry with efibootmgr to see if that made any difference. It didn't. root@molly:~ # efibootmgr BootCurrent: 0000 Timeout : 1 seconds BootOrder : 0000, 0001 +Boot0000* FreeBSD-13 Boot0001* Hard Drive (In reply to sirdice from comment #2) vidvonsole is only valid with bios loade, not with uefi (loader.efi). There is this block of code: rv = efi_global_getenv("ConOut", buf, &sz); if (rv != EFI_SUCCESS) { /* If we don't have any ConOut default to serial */ how = RB_SERIAL; goto out; } That does explain it... This patch should fix it tsoome@freebsd-2:/usr/src % git diff diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c index ca41cd4a2610..a21e8b0d96ba 100644 --- a/stand/efi/loader/main.c +++ b/stand/efi/loader/main.c @@ -735,6 +735,8 @@ parse_uefi_con_out(void) how = 0; sz = sizeof(buf); rv = efi_global_getenv("ConOut", buf, &sz); + 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; tsoome@freebsd-2:/usr/src % (In reply to Toomas Soome from comment #3) Oh, please note, there is extra { on that aded if statement. Did this: root@molly:/usr/src/stand/efi/loader # git diff diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c index ca41cd4a261..9d81003acc4 100644 --- a/stand/efi/loader/main.c +++ b/stand/efi/loader/main.c @@ -735,6 +735,9 @@ parse_uefi_con_out(void) how = 0; sz = sizeof(buf); rv = efi_global_getenv("ConOut", buf, &sz); + 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; Build is good. root@molly:/usr/src/stand/efi/loader # cp /usr/obj/usr/src/amd64.amd64/stand/efi/loader/loader_lua.efi /boot/efi/EFI/BOOT/bootx64.efi Then rebooted. Yes! That works. Cons: is now video by default. I even got the cool graphics loader :) A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=2bd4ff2d8911009283e4e615ca4aad35a845f48b commit 2bd4ff2d8911009283e4e615ca4aad35a845f48b Author: Toomas Soome <tsoome@FreeBSD.org> AuthorDate: 2021-02-04 20:49:02 +0000 Commit: Toomas Soome <tsoome@FreeBSD.org> CommitDate: 2021-02-04 21:29:38 +0000 loader.efi: There are systems without ConOut, also use ConOutDev Conout does contian the default output device name. ConOutDev does contain all possible output device names, so we can use it as fallback, when there is no ConOut. PR: 253253 stand/efi/loader/main.c | 2 ++ 1 file changed, 2 insertions(+) A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=0c839497c174e961fc71f7d3329d05b10ec5525b commit 0c839497c174e961fc71f7d3329d05b10ec5525b Author: Toomas Soome <tsoome@FreeBSD.org> AuthorDate: 2021-02-04 20:49:02 +0000 Commit: Toomas Soome <tsoome@FreeBSD.org> CommitDate: 2021-02-04 21:33:15 +0000 loader.efi: There are systems without ConOut, also use ConOutDev Conout does contian the default output device name. ConOutDev does contain all possible output device names, so we can use it as fallback, when there is no ConOut. PR: 253253 (cherry picked from commit 2bd4ff2d8911009283e4e615ca4aad35a845f48b) stand/efi/loader/main.c | 2 ++ 1 file changed, 2 insertions(+) |