aboutsummaryrefslogtreecommitdiff
path: root/stand/efi
Commit message (Collapse)AuthorAgeFilesLines
* loader.efi: use and prefer coninex interfaceToomas Soome2019-09-021-7/+66
| | | | | | | Add support for EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL. Notes: svn path=/head/; revision=351696
* loader.efi: some systems do not translate scan code 0x8 to backspaceToomas Soome2019-09-021-5/+8
| | | | | | | Add scancode translation for backspace. Notes: svn path=/head/; revision=351695
* loader.efi: use shift 16 in efipart as it is max ashift supported by zfsToomas Soome2019-08-311-2/+3
| | | | Notes: svn path=/head/; revision=351637
* qemu-system-aarch64 does list block device with very large block sizeToomas Soome2019-08-301-1/+4
| | | | | | | | | | Also insert Vendor device as "parent" disk (found in qemu-system-aarch64 -cpu cortex-a57). This does fix lsdev in loader.efi on this platform. Notes: svn path=/head/; revision=351630
* loader.efi: efipart should be more careful about constructing block device listsToomas Soome2019-08-201-351/+284
| | | | | | | | | | | | | | | The cd handles should be collected as list of partitions. Some systems also provide base name for block device (like PciRoot(0x0)/Pci(0x5,0x0)), we need to be careful about those. To make out life a bit easier, we prepare not just an array of handles, but we allocate pdinfo struct for each handle and devicepath, then we can simplify our work to sort the devices. Differential Revision: https://reviews.freebsd.org/D21187 Notes: svn path=/head/; revision=351274
* Reduce size of EFI_STAGING_SIZE to 32 on armTom Jones2019-08-171-0/+2
| | | | | | | | | | | | | | Reduce the size of the EFI_STAGING area we allocate on arm to 32. On arm SBC such as the NanoPi-NEOLTS the staging area allocation will fail on the 256MB model with a staging size of 64. Reviewed by: bcran, manu Approved by: bz (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D21016 Notes: svn path=/head/; revision=351166
* loader: support com.delphix:removingToomas Soome2019-08-081-0/+2
| | | | | | | | | | | | We should support removing vdev from boot pool. Update loader zfs reader to support com.delphix:removing. Reviewed by: allanjude MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D18901 Notes: svn path=/head/; revision=350772
* Verify files loaded in chain command.Marcin Wojtas2019-08-081-0/+8
| | | | | | | | | | | | | | | | The chain command can be used to chain load another binary. If veriexec is enabled we should verify it first. Note that on EFI systems the verification was already done through firmware, assuming that Secure Boot was enabled there. Submitted by: Kornel Duleba <mindal@semihalf.com> Reviewed by: sjg MFC after: 1 week Obtained from: Semihalf Differential Revision: https://reviews.freebsd.org/D20952 Notes: svn path=/head/; revision=350761
* loader.efi: efilib.h and libefi.c were left out of 350654Toomas Soome2019-08-062-0/+8
| | | | | | | And this is second followup for 350654 Notes: svn path=/head/; revision=350656
* loader.efi: boot1.c was left out of 350654Toomas Soome2019-08-061-5/+6
| | | | | | | Followup for 350654. Notes: svn path=/head/; revision=350655
* loader.efi: replace HandleProtocol() with OpenProtocol()Toomas Soome2019-08-068-22/+25
| | | | | | | | | | | | | | The HandleProtocol() is deprecated interface and we should use OpenProtocol() instead. Moreover, in some firmware implementation(s), the HandleProtocol() does return device path using static storage, so we can not keep the value returned there. With same firmware, the OpenProtocol() does return data we do not need to clone. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D21162 Notes: svn path=/head/; revision=350654
* Fix EFI loader build when LOADER_NET_SUPPORT=no.Ruslan Bukin2019-07-301-0/+4
| | | | | | | Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=350444
* Allow efi loader to get network params from ubootJustin Hibbits2019-07-121-0/+73
| | | | | | | | | | | | | | | Summary: efi loader does not work with static network parameters. It always uses BOOTP/DHCP and also uses RARP as a fallback. Problems with DHCP servers can cause the loader to fail to populate network parameters. Submitted by: Siddharth Tuli <siddharthtuli_gmail.com> Reviewed by: imp Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D20811 Notes: svn path=/head/; revision=349928
* efihttp: mac and err can be used uninitializedToomas Soome2019-07-021-5/+8
| | | | | | | | While there, also check if mac != NULL, and use pointer compare for ipv4 and dns. Notes: svn path=/head/; revision=349613
* efihttp: mark unused arguments with __unusedToomas Soome2019-06-301-5/+7
| | | | | | | we do have __unused, lets use it. Notes: svn path=/head/; revision=349566
* efihttp: comparison of integers of different signsToomas Soome2019-06-301-1/+1
| | | | | | | message.HeaderCount is UINTN (unsigned int), so should be i. Notes: svn path=/head/; revision=349565
* Clean efihttp pointer-sign warningsToomas Soome2019-06-301-14/+14
| | | | | | | | The Http protocol structure is using unsigned char strings, Use type casts where needed. Notes: svn path=/head/; revision=349564
* Increase EFI_STAGING_SIZE to 100MB on x64Rebecca Cran2019-06-271-0/+4
| | | | | | | | | To avoid failures when the large 18MB nvidia.ko module is being loaded, increase EFI_STAGING_SIZE from 64MB to 100MB on x64 systems. Leave the other platforms at 64MB. Notes: svn path=/head/; revision=349471
* Re-enable loader efi http boot and fix dv_open bug if dv_init failedRebecca Cran2019-06-262-0/+12
| | | | | | | | | | | The code in efihttp.c was assuming that dv_open wouldn't be called if dv_init failed. But the dv_init return value is currently ignored. Add a new variable, `efihttp_init_done` and only proceed in dv_open if it's true. This fixes the loader on systems without efi http support. Notes: svn path=/head/; revision=349404
* Disconnect EFI HTTP supportRebecca Cran2019-06-251-2/+0
| | | | | | | | The EFI HTTP code has been causing boot failures for people, so disable it while a fix is being worked on. Notes: svn path=/head/; revision=349395
* loader: add HTTP support using UEFIRebecca Cran2019-06-248-0/+1734
| | | | | | | | | | | | | | | | | | | | | | Add support for an HTTP "network filesystem" using the UEFI's HTTP stack. This also supports HTTPS, but TianoCore EDK2 implementations currently crash while fetching loader files. Only IPv4 is supported at the moment. IPv6 support is planned for a follow-up changeset. Note that we include some headers from the TianoCore EDK II project in stand/efi/include/Protocol verbatim, including links to the license instead of including the full text because that's their preferred way of communicating it, despite not being normal FreeBSD project practice. Submitted by: scottph Reviewed by: imp, bcran Differential Revision: https://reviews.freebsd.org/D20643 Notes: svn path=/head/; revision=349349
* Move to using a common kernel path between the boot / laoder bits andWarner Losh2019-06-241-2/+3
| | | | | | | the kernel. Notes: svn path=/head/; revision=349343
* efinet: Defer exclusively opening the network handlesRebecca Cran2019-06-191-14/+18
| | | | | | | | | | | | | | | Don't commit to exclusive access to the network device handle by efinet until the loader has decided to load something through the network. This allows for the possibility of other users of the network device. Submitted by: scottph Reviewed by: tsoome, emaste Tested by: tsoome, bcran Differential Revision: https://reviews.freebsd.org/D20642 Notes: svn path=/head/; revision=349201
* Fix gcc build by removing redeclarationLi-Wen Hsu2019-06-131-1/+0
| | | | | | | | | Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20622 Notes: svn path=/head/; revision=349008
* Add stuff to disable warning for %SWarner Losh2019-06-081-0/+2
| | | | | | | | | Add the customary warnings to disable format checking on armv7. Code move to new files, and the unconditional setting of WARNS to 6 provoked it on tinerbox... Notes: svn path=/head/; revision=348814
* Create gptboot.efiWarner Losh2019-06-084-1/+338
| | | | | | | | | | | | | | | | | This is a primary boot loader that is intended to implement the gptboot partition selection algorithm just like we did for BIOS booting. While the preferred method for UEFI is to use the UEFI Boot Manager protocol, there are situations where that can't be done: some BIOS makers interfere with the protocol in unhelpful ways, there's a new standard for a zero variable write from the client OS, and finally for USB drives that might be mobile between systems with multiple partitions there needs to be a media stable way to select. Reviewed by: tsoome, bcran Differential Revision: https://reviews.freebsd.org/D20547 Notes: svn path=/head/; revision=348812
* Break out the disk selection protocol from the rest of boot1.Warner Losh2019-06-085-196/+280
| | | | | | | | | | | Segregate the disk probing and selection protocol from the rest of the boot loader. Reviewed by: tsoome, bcran Differential Revision: https://reviews.freebsd.org/D20547 Notes: svn path=/head/; revision=348811
* Rework the reporting of the priority.Warner Losh2019-06-071-55/+34
| | | | | | | | | | | Simplify the code a bit and rework how we report the results of the probing. Reviewed by: tsoome@ Differential Revision: https://reviews.freebsd.org/D20537 Notes: svn path=/head/; revision=348768
* Remove left-over status variablesWarner Losh2019-06-072-2/+0
| | | | Notes: svn path=/head/; revision=348766
* Fix when NOFAT is definedWarner Losh2019-06-061-2/+3
| | | | | | | | We need to add the *efi file to the list of things that get built, even if we're not creating the efifat stuff. Notes: svn path=/head/; revision=348763
* Use simple malloc/free instead of dropping down to the UEFIWarner Losh2019-06-062-18/+16
| | | | | | | | | | | BootServices AllocatePool/FreePool calls. They are simpler to use and result in the same thing happening. Reviewed by: tsoome@ Differential Revision: https://reviews.freebsd.org/D20540 Notes: svn path=/head/; revision=348760
* Don't make the efifat thing if NOFAT is defined.Warner Losh2019-06-061-0/+4
| | | | Notes: svn path=/head/; revision=348722
* ufs_module.c can't currently be compiled with -Wcast-align, but theWarner Losh2019-06-051-0/+3
| | | | | | | | code is safe enough. Turn off the warning for now until I can find the right construct to silence it in the code. Notes: svn path=/head/; revision=348675
* Don't shadow a global zfsmount variable.Warner Losh2019-06-051-3/+3
| | | | Notes: svn path=/head/; revision=348674
* Use newly minted efi_devpath_same_disk() instead ofWarner Losh2019-06-041-1/+1
| | | | | | | | | | efi_devpath_match(). This fixes a regression in r347193. Reported by: Tomoaki AOKI Differential Revision: https://reviews.freebsd.org/D20513 Notes: svn path=/head/; revision=348659
* Introduce efi_devpath_same_diskWarner Losh2019-06-042-2/+27
| | | | | | | | | | This is like efi_devpath_match, but allows differing device media paths. Those just specify the partition information. Differential Revision: https://reviews.freebsd.org/D20513 Notes: svn path=/head/; revision=348658
* boot1.efi should also provide CallocToomas Soome2019-05-291-1/+15
| | | | | | | boot1.efi does provide Malloc and Free, we also need Calloc. Notes: svn path=/head/; revision=348353
* loader: no-TERM_EMU is broken nowToomas Soome2019-05-091-1/+1
| | | | | | | | If TERM_EMU is not defined, we do not have curx variable. Use conout mode for efi and expose get_pos() for i386. Notes: svn path=/head/; revision=347391
* loader: implement proper 8 char tab stopsToomas Soome2019-05-091-4/+6
| | | | | | | | The current console code is printing out 8 spaces for tab, calculate the amount of spaces based on tab stops. Notes: svn path=/head/; revision=347388
* Simplify boot1 allocation of handles.Warner Losh2019-05-061-25/+8
| | | | | | | | | There's no need to pre-malloc the number of handles. Instead call LocateHandles twice, once to get the size, and once to get the data. Notes: svn path=/head/; revision=347201
* Abstract out efi_devpath_to_handle to search for a handle that matchesWarner Losh2019-05-063-14/+26
| | | | | | | the desired devpath. Notes: svn path=/head/; revision=347195
* We only ever need one devinfo per handle. So allocate it outside ofWarner Losh2019-05-061-12/+12
| | | | | | | | | looping over the filesystem modules rather than doing a malloc + free each time through the loop. In addition, nothing changes from loop to loop, so setup the new devinfo outside the loop as well. Notes: svn path=/head/; revision=347194
* Reach over and pull in devpath.c from libefiWarner Losh2019-05-062-63/+4
| | | | | | | | This allows us to remove three nearly identical functions because the differences don't matter, and the size difference is trivial. Notes: svn path=/head/; revision=347193
* Use SRC+= rather than SRC=Warner Losh2019-05-031-1/+1
| | | | | | | | To allow boot1/Makefile to be included, use SRC+= rathern than SRC= so the including Makefile can add additional sources to the build. Notes: svn path=/head/; revision=347062
* Substitute boot1 with ${BOOT1}Warner Losh2019-05-031-6/+7
| | | | | | | | Allow for other names to be built, so parameterize this makefile to avoid hard coding boot1. Notes: svn path=/head/; revision=347061
* When we can't get memory, trying again right away is going toWarner Losh2019-05-031-1/+1
| | | | | | | fail. Rather than print N failure messages, bail on the first one. Notes: svn path=/head/; revision=347060
* Remove stray '*'Warner Losh2019-05-031-1/+1
| | | | | | | | | We're storing an EFI_HANDLE, not an pointer to a handle. Since EFI_HANDLE is a void * anyway, this has little practical effect since the conversion to / from void * and void ** is silent. Notes: svn path=/head/; revision=347059
* stand: correct mis-merge from r346879Kyle Evans2019-05-021-14/+0
| | | | | | | | | | | | Small mis-merge from multiple WIP resulted in block io media handles getting double-initialized. This resulted in some installations oddly landing at the mountroot prompt. Reported by: ler Reviewed by: imp Notes: svn path=/head/; revision=347023
* Implement uefi_ignore_boot_mgr env variable.Warner Losh2019-04-291-29/+35
| | | | | | | | | | | | | | | | When set, we ignore all the hints that the UEFI boot manager has set for us. We also always fail back to the OK prompt when we can't find the right thing to boot rather than failing back to the UEFI boot manager. This has the side effect of also expanding the cases where we fail back to the OK prompt to include when we're booted under UEFI, but UEFI::BootCurrent isn't set in the environment and we can't find a proper place to boot from. Reviewed by: bcran Differential Revision: https://reviews.freebsd.org/D20016 Notes: svn path=/head/; revision=346881
* Implement uefi_rootdevWarner Losh2019-04-291-2/+24
| | | | | | | | | | | | | If uefi_rootdev is set in the environment, then treat it like a device path. Convert the string to a device path and see if we can find a device that matches. If so, use that device at our root dev no matter what. If it's bad in any way, the boot will fail. Reviewed by: bcran Differential Revision: https://reviews.freebsd.org/D20016 Notes: svn path=/head/; revision=346880