Re: loader warnings with LOADER_FDT_SUPPORT

Warner Losh <[email protected]>
Newsgroups gmane.os.freebsd.devel.arm
Message-ID <CANCZdfoUwevO+gr+QYB3RwZ_VaV1yBy7mBoMTNuvQHCFcFFCWg@mail.gmail.com>
On Sun, Jan 4, 2026 at 6:16 PM Colin Percival <[email protected]> wrote:

> Hi all,
>
> The arm64 EFI loader is built with LOADER_FDT_SUPPORT, which is probably
> the
> correct default, but when the loader has LOADER_FDT_SUPPORT set it emits
> some
> unnecessarily scary warnings on many systems:
>
> > No valid device tree blob found!
> > WARNING! Trying to fire up the kernel, but no device tree blob found!
>
> Since many systems legitimately don't have DTBs, can we remove this warning
> and/or make it conditional on some check as to whether we think a DTB might
> be needed?
>
> In particular since this is the last thing the loader prints, it has sent a
> few people down rabbit holes when the serial console in the loader works
> but
> the serial console in the kernel doesn't, since they assume this message is
> somehow related to the lack of further console output.
>

diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c
index 67b36313c26f..e43eebb4bd5c 100644
--- a/stand/efi/loader/bootinfo.c
+++ b/stand/efi/loader/bootinfo.c
@@ -432,9 +432,12 @@ bi_load(char *args, vm_offset_t *modulep, vm_offset_t
*kernendp, bool exit_bs)
 #if defined(LOADER_FDT_SUPPORT)
        if (dtb_size)
                file_addmetadata(kfp, MODINFOMD_DTBP, sizeof(dtbp), &dtbp);
-       else
-               printf("WARNING! Trying to fire up the kernel, but no "
-                   "device tree blob found!\n");
+       else {
+               if (getenv("acpi.revision") == NULL) {
+                       printf("WARNING! Trying to fire up the kernel, but
no "
+                           "device tree blob found!\n");
+               }
+       }
 #endif
        file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof(kernend), &kernend);
 #ifdef MODINFOMD_MODULEP

???

Warner
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.