Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Sep 2017 07:33:26 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Jia-Shiun Li <jiashiun@gmail.com>
Cc:        Warner Losh <imp@freebsd.org>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r323063 - head/sys/boot/efi/boot1
Message-ID:  <CANCZdfpPrbEFkESC%2BUp5fjVxko=MwbrrTDmeXavc9VY7FanFEA@mail.gmail.com>
In-Reply-To: <CAHNYxxNKsB1VzSV89N8n3Hwdrxp_KNjAHhqK8JE4hM2xCmn=tA@mail.gmail.com>
References:  <201708311732.v7VHWEvs037245@repo.freebsd.org> <CAHNYxxNKsB1VzSV89N8n3Hwdrxp_KNjAHhqK8JE4hM2xCmn=tA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Sep 4, 2017 at 11:51 PM, Jia-Shiun Li <jiashiun@gmail.com> wrote:

> Seems to cause armv6 crossbuild to fail.
> But did armv6 use efi anyway?
>
>
> jsli@jsli-e5:/tmp/src # uname -a
> FreeBSD jsli-e5 12.0-CURRENT FreeBSD 12.0-CURRENT #59 r323150: Mon Sep  4
> 11:30:09 CST 2017     jsli@jsli-e5:/usr/obj/usr/src/sys/GENERIC-NODEBUG
> amd64
> jsli@jsli-e5:/tmp/src # svnversion
> 323170
> jsli@jsli-e5:/tmp/src # time nice +20 env MAKEOBJDIRPREFIX=/tmp/obj make
> -sj12 TARGET_ARCH=armv6 KERNCONF=RPI2 -DNO_CLEAN buildworld buildkernel
> ...
> ...
> ...
> /tmp/src/sys/boot/efi/boot1/boot1.c:474:32: error: format specifies type
> 'wchar_t *' (aka 'unsigned int *') but the argume
> nt has type 'CHAR16 *' (aka 'unsigned short *') [-Werror,-Wformat]
>                 printf("   Load Path: %S\n", text);
>                                       ~~     ^~~~
> /tmp/src/sys/boot/efi/boot1/boot1.c:485:35: error: format specifies type
> 'wchar_t *' (aka 'unsigned int *') but the argume
> nt has type 'CHAR16 *' (aka 'unsigned short *') [-Werror,-Wformat]
>                         printf("   Load Device: %S\n", text);
>                                                 ~~     ^~~~
>

Yea, this is just a command line flag. Will fix. Not sure why x86 doesn't
suffer from this, but it's a wchar_t size difference I'm sure.

Warner


> On Fri, Sep 1, 2017 at 1:32 AM, Warner Losh <imp@freebsd.org> wrote:
>
>> Author: imp
>> Date: Thu Aug 31 17:32:14 2017
>> New Revision: 323063
>> URL: https://svnweb.freebsd.org/changeset/base/323063
>>
>> Log:
>>   boot1.efi: print more info about where boot1.efi is loaded from
>>
>>   Print the device that boot1.efi was loaded from. Print the path as
>>   well (since it isn't included in DeviceHandle). Move block where we do
>>   this earlier so all the block handle code is now together.
>>
>>   Sponsored by: Netflix
>>
>> Modified:
>>   head/sys/boot/efi/boot1/boot1.c
>>
>> Modified: head/sys/boot/efi/boot1/boot1.c
>> ============================================================
>> ==================
>> --- head/sys/boot/efi/boot1/boot1.c     Thu Aug 31 17:32:09 2017
>> (r323062)
>> +++ head/sys/boot/efi/boot1/boot1.c     Thu Aug 31 17:32:14 2017
>> (r323063)
>> @@ -344,6 +344,7 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab)
>>         EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl = NULL;
>>         SIMPLE_TEXT_OUTPUT_INTERFACE *conout = NULL;
>>         UINTN i, max_dim, best_mode, cols, rows, hsize, nhandles;
>> +       CHAR16 *text;
>>
>>         /* Basic initialization*/
>>         ST = Xsystab;
>> @@ -387,6 +388,27 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE
>> *Xsystab)
>>         }
>>         putchar('\n');
>>
>> +       /* Determine the devpath of our image so we can prefer it. */
>> +       status = BS->HandleProtocol(IH, &LoadedImageGUID, (VOID**)&img);
>> +       imgpath = NULL;
>> +       if (status == EFI_SUCCESS) {
>> +               text = efi_devpath_name(img->FilePath);
>> +               printf("   Load Path: %S\n", text);
>> +               efi_free_devpath_name(text);
>> +
>> +               status = BS->HandleProtocol(img->DeviceHandle,
>> &DevicePathGUID,
>> +                   (void **)&imgpath);
>> +               if (status != EFI_SUCCESS) {
>> +                       DPRINTF("Failed to get image DevicePath (%lu)\n",
>> +                           EFI_ERROR_CODE(status));
>> +               } else {
>> +                       text = efi_devpath_name(imgpath);
>> +                       printf("   Load Device: %S\n", text);
>> +                       efi_free_devpath_name(text);
>> +               }
>> +
>> +       }
>> +
>>         /* Get all the device handles */
>>         hsize = (UINTN)NUM_HANDLES_INIT * sizeof(EFI_HANDLE);
>>         if ((status = BS->AllocatePool(EfiLoaderData, hsize, (void
>> **)&handles))
>> @@ -421,24 +443,6 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE
>> *Xsystab)
>>         nhandles = hsize / sizeof(*handles);
>>         printf("   Probing %zu block devices...", nhandles);
>>         DPRINTF("\n");
>> -
>> -       /* Determine the devpath of our image so we can prefer it. */
>> -       status = BS->HandleProtocol(IH, &LoadedImageGUID, (VOID**)&img);
>> -       imgpath = NULL;
>> -       if (status == EFI_SUCCESS) {
>> -               status = BS->HandleProtocol(img->DeviceHandle,
>> &DevicePathGUID,
>> -                   (void **)&imgpath);
>> -               if (status != EFI_SUCCESS)
>> -                       DPRINTF("Failed to get image DevicePath (%lu)\n",
>> -                           EFI_ERROR_CODE(status));
>> -#ifdef EFI_DEBUG
>> -               {
>> -                       CHAR16 *text = efi_devpath_name(imgpath);
>> -                       DPRINTF("boot1 imagepath: %S\n", text);
>> -                       efi_free_devpath_name(text);
>> -               }
>> -#endif
>> -       }
>>
>>         for (i = 0; i < nhandles; i++)
>>                 probe_handle_status(handles[i], imgpath);
>> _______________________________________________
>> svn-src-head@freebsd.org mailing list
>> https://lists.freebsd.org/mailman/listinfo/svn-src-head
>> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org"
>>
>
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfpPrbEFkESC%2BUp5fjVxko=MwbrrTDmeXavc9VY7FanFEA>