summaryrefslogtreecommitdiffstats
path: root/sys/boot
Commit message (Collapse)AuthorAgeFilesLines
* MFC r322628: Fix BSD label partition end sector calculation.oleg2017-08-311-1/+1
| | | | | Approved by: re (marius) Differential Revision: https://reviews.freebsd.org/D12066
* MFC r321305:dim2017-07-281-2/+2
| | | | | | | | | | | | | | | | Fix printf format warning in zfs_module.c Clang 5.0.0 got better warnings about print format strings using %zd, and this leads to the following -Werror warning on e.g. arm: sys/boot/efi/boot1/zfs_module.c:186:18: error: format specifies type 'ssize_t' (aka 'int') but the argument has type 'off_t' (aka 'long long') [-Werror,-Wformat] "(%lu)\n", st.st_size, spa->spa_name, filepath, EFI_ERROR_CODE(status)); ^~~~~~~~~~ Fix this by casting off_t arguments to intmax_t, and using %jd instead. Reviewed by: tsoome Differential Revision: https://reviews.freebsd.org/D11678
* MFC r316102:ngie2017-07-201-1/+2
| | | | | | | | Wrap bootcamp DEBUG statement with curly braces This fixes a -Wempty-body warning with gcc 6.3.0 when PART_DEBUG is undefined. Tested with: amd64-gcc-6.3.0 (devel/amd64-xtoolchain-gcc)
* MFC r309412,r316109,r316132:ngie2017-05-2810-16/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | r309412 (by imp): dd is currently a bootstrap tool. It really doesn't have any business being a bootstrap tool. However, for reproducible build output, FreeBSD added dd status=none because it was otherwise difficult to suppress the status information, but retain any errors that might happen. There's no real reason that dd has to be a build tool, other than we use status=none unconditional. Remove dd from a bootstrap tool entirely by only using status=none when available. This may also help efforts to build the system on non-FreeBSD hosts as well. r316109: Don't hardcode input files for stage 1/2 bootloaders; use .ALLSRC instead This is a better pattern to follow when creating the bootloaders and doing the relevant space checks to make sure that the sizes aren't exceeded (and thus, copy-pasting is a bit less error prone). r316132: Parameterize out 7680 (15 * 512) as BOOT2SIZE, similar to sys/boot/i386/zfsboot/... This is being done to make it easier to change in the future--this action might be needed sooner rather than later because of gcc 6.3.0 bailing, stating that there is negative free space left (deficit) in the boot2 bootloader.
* MFC r316103:ngie2017-05-222-3/+0
| | | | | | Remove redundant declarations They're already defined in libstand.h
* MFC r316106:ngie2017-03-311-5/+5
| | | | | | | Don't shadow read(2) definition with `read` argument in vdev_{create,probe} This fixes several -Wshadow warnings introduced in r192194, but now errors with gcc 6.3.0.
* MFC r316107:ngie2017-03-311-1/+0
| | | | | | | | | Remove redundant declaration for `zfs_crc64_table` zfssubr.c already defines this statically. Besides, zfsimpl.c defined it, but didn't use it. This fixes a -Wredundant-decls warning.
* MFC r316108:ngie2017-03-311-2/+1
| | | | | | Remove -Wunused-but-set variable, `tail` in `ls_getdir(..)` This variable has been unused since its inception in r40106.
* MFC: 314547, 314770, 314828, 314891, 314956, 314962, 315235dexuan2017-03-301-4/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r314547 loader.efi: reduce the size of the staging area if necessary The loader assumes physical memory in [2MB, 2MB + EFI_STAGING_SIZE) is Conventional Memory, but actually it may not, e.g. in the case of Hyper-V Generation-2 VM (i.e. UEFI VM) running on Windows Server 2012 R2 host, there is a BootServiceData memory block at the address 47.449MB and the memory is not writable. Without the patch, the loader will crash in efi_copy_finish(): see PR 211746. The patch verifies the end of the staging area, and reduces its size if necessary. This way, the loader will not try to write into the BootServiceData memory any longer. Thank Marcel Moolenaar for helping me on this issue! The patch also allocates the staging area in the first 1GB memory. See the comment in the patch for this. Reviewed by: marcel, kib, sephe Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D9686 r314770 loader.efi: fix recent UEFI-boot regression on physical machines This patch fixes my recent patch "loader.efi: reduce the size of the staging area if necessary", which causes EFI-boot failure on physical machines since Mar 2: on the host there is a 1MB LoaderData memory range, which splits the big Conventional Memory range into a small one (15MB) and a big one: the small one is too small to hold the staging area. We can actually use the LoaderData range safely, because when amd64_tramp -> efi_copy_finish() starts to run, we're almost at the very end of the efi loader code and we're going to "return" to the kernel entry, so we're pretty sure we won't access any loader data any more. For people who are interested in the details: please see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211746#c22 PS, some people also reported the regression happened to FreeBSD VM running on Bhyve in EFI mode. This patch should resolve it too, though I don't have such a setup to test. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D9904 r314828 loader.efi: fix an off-by-one bug in efi_verify_staging_size() Also remove the warning message: it may not be unusual to see the memory range containing 2MB is not of EfiConventionalMemory. Sponsored by: Microsoft r314891 loader.efi: finally fix the off-by-one bug in efi_verify_staging_size() r314828(loader.efi: fix an off-by-one bug in efi_verify_staging_size()) doesn't really fix the bug and this patch adds the missing part. It's a shame that I didn't make everything correct at the very beginning... Sponsored by: Microsoft r314956 loader.efi: only reduce the size of the staging area on Hyper-V Doing this on physical hosts turns out to be problematic, e.g. see comment 24 and 28 in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211746. To fix the real underlying issue correctly & thoroughly, IMO we need a relocatable kernel, but that would require a lot of complicated long term work: https://reviews.freebsd.org/D9686?id=25414#inline-56969 For now, let's only apply efi_verify_staging_size() to VMs running on Hyper-V, and restore the old behavior on physical machines since that has been working for people for a long period of time, though that's potentially unsafe... Sponsored by: Microsoft r314962 loader.efi: only include the machine/ header files on x86 The 2 files may not exist on other archs like aarch64 and hence we can have a build failure there. Reported by: lwhsu Sponsored by: Microsoft r315235 loader.efi: use stricter check for Hyper-V Some other hypervisors like Xen can pretend to be Hyper-V but obviously they can't implement all Hyper-V features. Let's make sure we're genuine Hyper-V here. Also fix some minor coding style issues. Sponsored by: Microsoft PR: 211746
* MFC r315738:ngie2017-03-291-0/+4
| | | | | | | | | Document some more 10GbE+ network drivers in loader.conf - if_cxgbe - if_ixl - if_ixlv - sfxge
* MFC r314505:pfg2017-03-085-5/+10
| | | | | | | Split the ficl CFLAGS when they refer to an arch-specific include path. This is a minimal attempt to keep consistency in the Makefiles so that moving ficl to somwehere like contrib will be less error prone.
* MFC r311933:dim2017-01-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use proper prototypes in struct boot_module_t With clang 4.0.0, we are getting the following warnings about struct boot_module_t in efi's boot_module.h: In file included from sys/boot/efi/boot1/ufs_module.c:41: sys/boot/efi/boot1/boot_module.h:67:14: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] void (*init)(); ^ void sys/boot/efi/boot1/boot_module.h:92:16: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] void (*status)(); ^ void sys/boot/efi/boot1/boot_module.h:95:24: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] dev_info_t *(*devices)(); ^ void 3 errors generated. Fix this by adding 'void' to the parameter lists. No functional change. Reviewed by: emaste, imp, smh Differential Revision: https://reviews.freebsd.org/D9144
* MFC r311932:dim2017-01-251-0/+1
| | | | | | | | | | | | | | | | | Make EFI_RESERVED_SERVICE a proper prototype With clang 4.0.0, the EFI API header causes the following warning: In file included from sys/boot/efi/loader/bootinfo.c:43: In file included from sys/boot/efi/loader/../include/efi.h:52: sys/boot/efi/include/efiapi.h:534:32: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] (EFIAPI *EFI_RESERVED_SERVICE) ( ^ Add VOID to make it into a real prototype. Reviewed by: imp, emaste, tsoome Differential Revision: https://reviews.freebsd.org/D9132
* MFC r311929:dim2017-01-251-1/+0
| | | | | | | | | | | | | | | Don't include <errno.h> in reloc_elf.c, as it includes <stand.h> just after it, which has a conflicting definition of errno. This leads to the following warning with clang 4.0.0: In file included from sys/boot/common/reloc_elf32.c:6: In file included from sys/boot/common/reloc_elf.c:37: /usr/obj/usr/src/tmp/usr/include/stand.h:155:12: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] extern int errno; ^ sys/sys/errno.h:46:26: note: expanded from macro 'errno' #define errno (* __error()) ^
* MFC r310417asomers2017-01-201-0/+1
| | | | Add a dumpdev example to /boot/defaults/loader.conf
* MFC r293040,293341,293435:delphij2017-01-192-334/+18
| | | | | | Reduce libstand Makefile duplication. PR: 216251
* MFC r308089: zfsbootcfg: a simple tool to set next boot (one time)avg2016-11-215-9/+130
| | | | | | | options for zfsboot There is a branch-specific change in sbin/zfsbootcfg/Makefile because of LIBADD vs LDADD/DPADD.
* MFC 305588sephe2016-10-131-0/+8
| | | | | | | | | | | | pxeboot: Add nfs.read_size tunable. Increase this tunable improves kernel loading speed. Submitted by: Jun Su <junsu microsoft com> Reviewed by: rpokala, wblock (previous version) Obtained from: DragonFlyBSD Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7756
* MFC r274925: misc mdoc fixes.pluknet2016-09-272-6/+3
|
* MFC r303891, r303892:pfg2016-09-081-1/+1
| | | | | | | | sys: replace comma with semicolon when pertinent. Uses of commas instead of a semicolons can easily go undetected. The comma can serve as a statement separator but this shouldn't be abused when statements are meant to be standalone.
* MFC r303738: report sector size and number of sectors in lsdev outputavg2016-09-061-2/+4
| | | | for bios disks
* MFC 304018: Add defines needed to export SMBIOS serial numbersjhb2016-08-191-0/+12
| | | | | | | | Some defines needed for exporting serial numbers from the SMBIOS were missed during integration of SMBIOS support in the EFI boot loader (r281138). This is needed for getting the hostid set from the system hardware UUID. PR: 206031
* MFC r297871: boot1.efifat: provide a fallback startup.nshemaste2016-07-251-0/+2
| | | | | | | | | In case the firmware falls through to executing startup.sh, populate it with the name of our boot loader. In normal operation this should not be necessary but may allow the system to boot if it would otherwise just remain at a shell prompt. Sponsored by: The FreeBSD Foundation
* MFC r302335: boot1.efi: fix assignment / comparison expressionemaste2016-07-251-1/+1
| | | | | PR: 210706 Submitted by: David Binderman <dcb314@hotmail.com>
* MFC r297147, r297148, r297149, r297150, r297151:ian2016-05-314-2/+13
| | | | | | | | | | | | | | | | | | | | | | | Make both the loader and kernel use the interface-mtu option if the dhcp server provides it. Made up of these (semi-)related changes... [kernel...] If the dhcp server provides an interface-mtu option, parse the value and set that mtu on the interface. [libstand...] Garbage collect the bswap routines from libstand, use sys/endian.h. If the dhcp server delivers an interface-mtu option, parse it and store the value in a new global intf_mtu for use by the application. [loader...] If the dhcp server provided an interface-mtu option, transcribe the value to the boot.netif.mtu env var, which will be picked up by pre-existing code in nfs_mountroot() and used to configure the interface accordingly. PR: 187094
* MFC r299659:ngie2016-05-231-1/+0
| | | | Remove unused const variable
* MFC r299655:ngie2016-05-231-0/+1
| | | | Add missing prototype for getchar(..)
* MFC r298831:pfg2016-05-145-11/+11
| | | | boot/forth: minor spelling fixes.
* MFC r277205 (imp):emaste2016-04-221-0/+1
| | | | | | | | | Reserve and ignore the a new module metadata type MDT_PNP_INFO for associating an optional PNP hint table with this module. In the future, when these are added, these changes will silently ignore the new type they would otherwise warn about. It will always be safe to ignore this data. Get this into the builds today for some future proofing.
* MFC r296769: boot/efi: Prefer nm to objdumpemaste2016-04-112-6/+6
| | | | | | | | | Both objdump and nm are equally capable of reporting undefined symbols. This gets us a step closer to building without binutils as we have an nm implementation from ELF Tool Chain. Sponsored by: The FreeBSD Foundation
* MFC: r292563marius2016-04-043-7/+7
| | | | | | | | loader.efi: strip trailing whitespace MFC: r293244 (remainder missing in r294275) Introduce and use new EFI_ERROR_CODE macro for EFI errors
* MFC r296419 (by kib):dim2016-03-071-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | In the link_elf_obj.c, handle sections of type SHT_AMD64_UNWIND same as SHT_PROGBITS. This is needed after the clang 3.8 import, which generates that type for .eh_frame section, which had SHT_PROGBITS type before. Reported by: Nikolai Lifanov <lifanov@mail.lifanov.com> PR: 207729 Tested by: dim (previous version) Sponsored by: The FreeBSD Foundation MFC r296428: Since kernel modules can now contain sections of type SHT_AMD64_UNWIND, the boot loader should not skip over these anymore while loading images. Otherwise the kernel can still panic when it doesn't find the .eh_frame section belonging to the .rela.eh_frame section. Unfortunately this will require installing boot loaders from sys/boot before attempting to boot with a new kernel. Reviewed by: kib
* MFC: r287299 [1]marius2016-02-223-23/+1227
| | | | | | | | | | | | | | | | | | | Add a gop command to help diagnose VT efifb problems. The gop command has the following sub-commands: list - list all possible modes (paged) get - return the current mode set <mode> - set the current mode to <mode> MFC: r287317, r287422, r287475, r287489, r287538 [2] Add support for the UGA draw protocol. This includes adding a command called 'uga' to show whether UGA is implemented by the firmware and what the settings are. It also includes filling the efi_fb structure from the UGA information when GOP isn't implemented by the firmware. PR: 207313 [1], 202730 [2] Approved by: re (gjb)
* MFC r272785:smh2016-02-201-3/+5
| | | | | | | | Null terminate boot config buffer PR: 207070 Approved by: re (gjb) Sponsored by: Multiplay
* Merge from current r294767,294769,295408imp2016-02-112-15/+186
| | | | | | | | r294767: Parse command line arguments in loader.fi r294769: Allow newlines to be treated as whitespace when parsing args r295408: Implement -P command line option in for EFI booting. Approved by: re@ (gjb@)
* MFC r295320, r295356 (Partial)smh2016-02-115-181/+517
| | | | | | | Fix EFI multi device boot support Approved by: re (marius) Sponsored by: Multiplay
* MFC r294768:smh2016-02-111-1/+37
| | | | | | | Process /boot/config and /boot.config during EFI boot Approved by: re (marius) Sponsored by: Multiplay
* Fix ia64 build failures in EFI platformsmh2016-02-113-1/+12
| | | | | | | | | | | | | | | | | | The MFC of the recent EFI work to stable/10 caused build breakage under ia64. It was not apparent that there was EFI code outside the EFI tree as this is not the case in HEAD, however in stable/10 there is for ia64. This change does the following: * Re-enables libefi for ia64 under gcc. * Adds the ignore for unsupported pragma's when building libefi for ia64. * Adds the missing parameter to efi_handle_lookup in the ia64 loader. This is a direct commit as ia64 is no longer supported after 10.x Approved by: re (marius) Sponsored by: Multiplay
* MFC r295356 (Partial)smh2016-02-111-1/+1
| | | | | | | Fix EFI platform build failures on arm.armeb Approved by: re (marius) Sponsored by: Multiplay
* Catch the EFI loader up to the latest ZFS Boot Environment Menu featuresallanjude2016-02-105-56/+65
| | | | | | | | | | | | | | | MFC: r294072 Move init_zfs_bootenv to sys/boot/zfs/zfs.c instead of having a copy in each loader MFC: r294073 Connect the ZFS boot environment menu to the UEFI loader MFC: r295357 Do not set vfs.root.mountfrom unnecessarily when initializing ZFS BE menu Approved by: re (marius) Relnotes: yes Sponsored by: ScaleEngine Inc.
* MFC boot loader path and RBX constant deduplicationemaste2016-02-0911-196/+69
| | | | | | | | | | | | | | | | | | | | | | | | r294765 (imp) Move all the separate copies of the same strings into paths.h. There's nothing machine specific about these. r294765 (imp) RBX_ defines are in rbx.h, move it there. r294847 (imp) Remove static from these two. They slipped through the cracks. r294925 (imp) Fix mistake when transitioning to the new defines with ZFS loader. I hate adding yet another define, but it is the lessor of the evil choices available. Kill another evil by removing PATH_BOOT3 and replacing it with PATH_LOADER or PATH_LOADER_ZFS as appropriate. Approved by: re (gjb)
* MFC: r294926allanjude2016-02-021-1/+1
| | | | | | | ficl on i386 should cast to unsigned char output to support efi i386 Submitted by: Toomas Soome <tsoome at me.com> Approved by: re (gjb)
* Fix clean target for sys/boot/efismh2016-01-301-0/+2
| | | | | | | | | | | Fix clean target breakage of sys/boot/efi introduced by r294981 specifically the MFC of r294029 without the related change introduced by r281114. This is direct commit to stable/10 as head uses src.opts.mk. Approved by: re (glebius) Sponsored by: Multiplay
* MFC r294068, r294265smh2016-01-2810-8/+377
| | | | | | | | | | | MFC r294068: Add EFI ZFS boot support MFC r294265: Fix broken DPRINTF and wire up EFI_DEBUG so -DEFI_DEBUG to make works. Relnotes: Yes Sponsored by: Multiplay
* MFC r281060, r294060, r294291, r294493, r294284:smh2016-01-288-221/+607
| | | | | | | | | | | | | | | | | | | MFC r281060: Remove an unnecessary space in a printf call MFC r294060: Modularise EFI boot loader MFC r294291 (by andrew): Reset the filesystem cache MFC r294493: Fix EFI UFS caching MFC r294284 (by emaste): boot1: correct typo in error message Sponsored by: Multiplay
* MFC r294506:smh2016-01-281-27/+66
| | | | | | Prevent loader.conf load failure due to unknown console entries Sponsored by: Multiplay
* MFC r293835:smh2016-01-283-11/+37
| | | | | | Improve non-interactive forth cmd error reporting Sponsored by: Multiplay
* MFC r286234 (by trasz):smh2016-01-281-0/+8
| | | | | | Fix a problem which made loader(8) load non-kld files twice. Sponsored by: Multiplay
* MFC r294059:smh2016-01-281-1/+8
| | | | | | Ensure boot fsread correctly probes all partitions Sponsored by: Multiplay
* MFC r281169, r293724, r293796, r294029, r294041, r294058smh2016-01-2840-130/+137
| | | | | | | | | | | | | | | | | | | | | | MFC r281169 (by andrew): Make global variabled only used in this file static MFC r294058: Make common boot file_loadraw name parameter const MFC r294041: Remove unused reg param from fdt_fixup_memory MFC r293724: Enable warnings in EFI boot code MFC r293796: Fix typo in libefi.c MFC r294029: Only build EFI components on supported compilers Sponsored by: Multiplay
OpenPOWER on IntegriCloud