aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-06-24[realtek] Work around hardware bug on RTL8211Brealtek_hackMichael Brown2-0/+12
The RTL8211B seems to have a bug that prevents the link from coming up unless the MII_MMD_DATA register is cleared. The Linux kernel driver applies this workaround (in rtl8211b_resume()) only to the specific RTL8211B PHY model, along with a matching workaround to set bit 9 of MII_MMD_DATA when suspending the PHY. Since we have no need to ever suspend the PHY, and since writing a zero ought to be harmless, we just clear the register unconditionally. Debugged-by: Nikolay Pertsev <nikolay.p@cos.flag.org> Tested-by: Nikolay Pertsev <nikolay.p@cos.flag.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-06-23[cloud] Show ifstat output after a failed boot attemptMichael Brown2-2/+4
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-06-22[peerdist] Assume that most recently discovered peer can be reusedMichael Brown1-0/+23
The peer discovery time has a significant impact on the overall PeerDist download speed, since each block requires an individual discovery attempt. In most cases, a peer that responds for block N will turn out to also respond for block N+1. Assume that the most recently discovered peer (for any block) probably has a copy of the next block to be discovered, thereby allowing the peer download attempt to begin immediately. In the case that this assumption is incorrect, the existing error recovery path will allow for fallback to newly discovered peers (or to the origin server). Suggested-by: Andreas Hammarskjöld <junior@2PintSoftware.com> Tested-by: Andreas Hammarskjöld <junior@2PintSoftware.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-06-17[build] Fix building on broken versions of GNU binutilsMichael Brown1-1/+2
Some versions of GNU objcopy (observed with binutils 2.23.52.0.1 on CentOS 7.0.1406) document the -D/--enable-deterministic-archives option but fail to recognise the short form of the option. Work around this problem by using the long form of the option. Reported-by: Olaf Hering <olaf@aepfle.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-06-14[build] Ensure build ID is deterministicBernhard M. Wiedemann1-1/+1
Commit 040cdd0 ("[linux] Add a prefix to all symbols to avoid future name collisions") unintentionally reintroduced an element of non-determinism into the build ID, by omitting the -D option when manipulating the blib.a archive. Fix by adding the -D option to restore determinism. Reworded-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-06-11[efi] Veto the Itautec Ip4ConfigDxe driveritautecMichael Brown1-8/+10
The Ip4ConfigDxe driver bug that was observed on Dell systems in commit 64b4452 ("[efi] Blacklist the Dell Ip4ConfigDxe driver") has also been observed on systems with a manufacturer name of "Itautec S.A.". The symptoms of the bug are identical: an attempt to call DisconnectController() on the LOM device handle will lock up the system. Fix by extending the veto to cover the Ip4ConfigDxe driver for this manufacturer. Debugged-by: Celso Viana <celso.vianna@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-06-07[libc] Match standard prototype for putchar()Michael Brown2-2/+5
Reported-by: Bernhard M. Wiedemann <bwiedemann@suse.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-06-07[base64] Include terminating NUL within base64 character arrayMichael Brown1-1/+1
Reported-by: Bernhard M. Wiedemann <bwiedemann@suse.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-06-07[rndis] Fix size of reserved fieldsrndis_paddingMichael Brown1-2/+2
Most RNDIS data structures include a trailing 4-byte reserved field. For the REMOTE_NDIS_PACKET_MSG and REMOTE_NDIS_INITIALIZE_CMPLT structures, this is an 8-byte field instead. iPXE currently uses incorrect structure definitions with a 4-byte reserved field in all data structures, resulting in data payloads that overlap the last 4 bytes of the 8-byte reserved field. RNDIS uses explicit offsets to locate any data payloads beyond the message header, and so liberal RNDIS parsers (such as those used in Hyper-V and in the Linux USB Ethernet gadget driver) are still able to parse the malformed structures. A stricter RNDIS parser (such as that found in some older Android builds that seem to use an out-of-tree USB Ethernet gadget driver) may reject the malformed structures since the data payload offset is less than the header length, causing iPXE to be unable to transmit packets. Fix by correcting the length of the reserved fields. Debugged-by: Martin Nield <pmn1492@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-06-04[ath5k] Avoid returning uninitialised data on EEPROM read errorsMichael Brown1-0/+3
Originally-implemented-by: Bernhard M. Wiedemann <bwiedemann@suse.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-06-03[crypto] Add memory output constraints for big-integer inline assemblybigint_output_constraintsMichael Brown2-22/+43
The ARM versions of the big-integer inline assembly functions include constraints to indicate that the output value is modified by the assembly code. These constraints are not present in the equivalent code for the x86 versions. As of GCC 11, this results in the compiler reporting that the output values may be uninitialized. Fix by including the relevant memory output constraints. Reported-by: Christian Hesse <mail@eworm.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-05-24[build] Use SOURCE_DATE_EPOCH for isohybrid MBR ID if it existsMichael Brown1-1/+5
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-05-24[build] Use SOURCE_DATE_EPOCH for .iso timestamps if it existsMichael Brown1-0/+10
Originally-implemented-by: Bernhard M. Wiedemann <bwiedemann@suse.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-05-21[efi] Provide an "initrd.magic" file for use by UEFI kernelsMichael Brown1-0/+88
Provide a file "initrd.magic" via the EFI_SIMPLE_FILE_SYSTEM_PROTOCOL that contains the initrd file as constructed for BIOS bzImage kernels (including injected files with CPIO headers constructed by iPXE). This allows BIOS and UEFI kernels to obtain the exact same initramfs image, by adding "initrd=initrd.magic" to the kernel command line. For example: #!ipxe kernel boot/vmlinuz initrd=initrd.magic initrd boot/initrd.img initrd boot/modules/e1000.ko /lib/modules/e1000.ko initrd boot/modules/af_packet.ko /lib/modules/af_packet.ko boot Do not include the "initrd.magic" file within the root directory listing, since doing so would break software such as wimboot that processes all files within the root directory. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-05-21[efi] Allow for non-image-backed virtual filesMichael Brown1-69/+221
Restructure the EFI_SIMPLE_FILE_SYSTEM_PROTOCOL implementation to allow for the existence of virtual files that are not simply backed by a single underlying image. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-05-21[cpio] Split out bzImage initrd CPIO header constructionMichael Brown5-56/+110
iPXE will construct CPIO headers for images that have a non-empty command line, thereby allowing raw images (without CPIO headers) to be injected into a dynamically constructed initrd. This feature is currently implemented within the BIOS-only bzImage format support. Split out the CPIO header construction logic to allow for reuse in other contexts such as in a UEFI build. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-05-18[x509] Use case-insensitive comparison for certificate namesMichael Brown2-1/+3
DNS names are case-insensitive, and RFC 5280 (unlike RFC 3280) mandates support for case-insensitive name comparison in X.509 certificates. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-05-18[libc] Add strncasecmp()Michael Brown3-1/+26
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-05-17[bnxt] Use hexadecimal values in PCI_ROM entriesJoseph2-141/+64
Use hexadecimal values instead of macros in PCI_ROM entries so Perl script can parse them correctly. Move PCI_ROM entries from header file to C file. Integrate bnxt_vf_nics array into PCI_ROM entries by introducing BNXT_FLAG_PCI_VF flag into driver_data field. Add whitespaces in PCI_ROM entries for style consistency. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-05-17[intel] Add PCI ID for I219-V and -LM 10 to 15Christian Nilsson1-0/+12
Signed-off-by: Christian Nilsson <nikize@gmail.com>
2021-05-12[image] Support archive image formats independently of "imgextract" commandMichael Brown3-11/+11
Support for the zlib and gzip archive image formats is currently included only if the IMAGE_ARCHIVE_CMD is used to enable the "imgextract" command. The ability to transparently execute a single-member archive image without using the "imgextract" command renders this unintuitive: a user wanting to gain the ability to boot a gzip-compressed kernel image would expect to have to enable IMAGE_GZIP rather than IMAGE_ARCHIVE_CMD. Reverse the inclusion logic, so that archive image formats must now be enabled explicitly (via IMAGE_GZIP and/or IMAGE_ZLIB), with the archive image management commands dragged in as needed if any archive image formats are enabled. The archive image management commands may be explicitly disabled via IMAGE_ARCHIVE_CMD if necessary. This matches the behaviour of IBMGMT_CMD and similar options, where the relevant commands are included only when something else already drags in the underlying feature. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-05-12[image] Propagate trust flag to extracted archive imagesMichael Brown1-0/+4
An extracted image is wholly derived from the original archive image. If the original archive image has been verified and marked as trusted, then this trust logically extends to any image extracted from it. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-05-12[image] Allow single-member archive images to be executed transparentlyMichael Brown4-0/+33
Provide image_extract_exec() as a helper method to allow single-member archive images (such as gzip compressed images) to be executed without an explicit "imgextract" step. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-05-12[undi] Read TSC only when profilingMichael Brown1-2/+9
Avoid using the "rdtsc" instruction unless profiling is enabled. This allows the non-debug build of the UNDI driver to be used on a CPU such as a 486 that does not support the TSC. Reported-by: Nikolai Zhubr <n-a-zhubr@yandex.ru> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-05-12[rng] Check for TSC support before using RTC entropy sourceMichael Brown2-0/+14
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-05-12[prefix] Specify i486 architecture for LZMA decompressorMichael Brown1-1/+1
The decompressor uses the i486 "bswap" instruction, but does not require any instructions that exist only on i586 or above. Update the ".arch" directive to reflect the requirements of the code as implemented. Reported-by: Martin Habets <habetsm.xilinx@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-05-08[gzip] Add support for gzip archive imagesimgextractMichael Brown7-0/+403
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-05-08[zlib] Add support for zlib archive imagesMichael Brown7-0/+345
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-05-08[image] Add "imgextract" command for extracting archive imagesMichael Brown9-0/+326
Add the concept of extracting an image from an archive (which could be a single-file archive such as a gzip-compressed file), along with an "imgextract" command to expose this functionality to scripts. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-05-08[image] Provide image_set_len() utility functionMichael Brown2-4/+22
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-05-02[cloud] Allow multiple images to be imported simultaneouslyMichael Brown1-19/+19
Allow both x86_64 and arm64 images to be imported in a single import command, thereby allowing for e.g. make CONFIG=cloud EMBED=config/cloud/aws.ipxe bin/ipxe.usb make CONFIG=cloud EMBED=config/cloud/aws.ipxe \ CROSS=aarch64-linux-gnu- bin-arm64-efi/ipxe.usb ../contrib/cloud/aws-import -w amilist.txt -p \ bin/ipxe.usb bin-arm64-efi/ipxe.usb This simplifies the process of generating a single amilist.txt file for inclusion in the documentation at https://ipxe.org/howto/ec2 Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-05-02[cloud] Attempt to include CPUID_SETTINGS only for x86 buildsMichael Brown1-0/+2
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-05-02[cloud] Autodetect CPU architecture from AMI disk imageMichael Brown1-6/+17
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-05-01[cloud] Use a sortable default AMI nameMichael Brown1-1/+9
The AWS console user interface provides no convenient way to sort AMIs by creation date. Provide a default AMI name constructed from the current date and CPU architecture, to simplify the task of finding the most recent iPXE AMI in a given AWS region. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-05-01[cloud] Add ability to generate Dokuwiki table of AMI imagesMichael Brown1-0/+20
Add an option to generate the amilist.txt list of current AMI images as included in the EC2 documentation at https://ipxe.org/howto/ec2 Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-04-23[settings] Add --timeout option to "read" commandMichael Brown1-14/+43
Requested-by: Matteo Guglielmi <Matteo.Guglielmi@dalco.ch> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-04-23[readline] Add an optional timeout to readline_history()Michael Brown4-6/+18
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-04-21[efi] Show ACPI address space descriptor ranges in debug messagesMichael Brown1-0/+3
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-04-20[efi] Always map full length of coherent DMA buffer allocationMichael Brown1-1/+2
The EFI PCI API takes a page count as the input to AllocateBuffer() but a byte count as the input to Map(). There is nothing in the UEFI specification that requires us to map exactly the allocated length, and no systems have yet been observed that will fail if the map length does not exactly match the allocated length. However, it is plausible that some implementations may fail if asked to map a length that does not match the length of the corresponding allocation. Avoid potential future problems by always mapping the full allocated length. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-04-20[build] Fix genfsimg to build ISO with long filenamesMatya1-1/+1
Commit 79c0173 ("[build] Create util/genfsimg for building filesystem-based images") introduced the new genfsimg, which lacks the -l option when building ISO files. This option is required to build level 2 (long plain) ISO9660 filenames, which are required when using the .lkrn extensions on older versions of ISOLINUX. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-04-20[xen] Avoid infinite loop on allocation failure in xenstore_response()Michael Brown1-6/+6
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-04-14[xen] Support scatter-gather to allow for jumbo framesxen-sgMichael Brown3-57/+154
The use of jumbo frames for the Xen netfront virtual NIC requires the use of scatter-gather ("feature-sg"), with the receive descriptor ring becoming a list of page-sized buffers and the backend using as many page buffers as required for each packet. Since iPXE's abstraction of an I/O buffer does not include any sort of scatter-gather list, this requires an extra allocation and copy on the receive datapath for any packet that spans more than a single page. This support is required in order to successfully boot an AWS EC2 virtual machine (with non-enhanced networking) via iSCSI if jumbo frames are enabled, since the netback driver used in EC2 seems not to allow "feature-sg" to be renegotiated once the Linux kernel driver takes over. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-04-13[int13] Do not report INT 13 extension support for emulated floppiesMichael Brown1-2/+2
The INT 13 extensions provide a mechanism for accessing disks using linear (LBA) rather than C/H/S addressing. SAN protocols such as iSCSI invariably support only linear addresses and so iPXE currently provides LBA access to all SAN disks (with autodetection and emulation of an appropriate geometry for C/H/S accesses). Most BIOSes will not report support for INT 13 extensions for floppy disk drives, and some operating systems may be confused by a floppy drive that claims such support. Minimise surprise by reporting the existence of support for INT 13 extensions only for non-floppy drive numbers. Continue to provide support for all drive numbers, to avoid breaking operating systems that may unconditionally use the INT 13 extensions without first checking for support. Reported-by: Valdo Toost <vtoost@hot.ee> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-04-10[cloud] Enable "poweroff" command in cloud imagesMichael Brown1-0/+5
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-04-10[netdevice] Ensure driver transmit() and poll() will not be re-enteredMichael Brown2-7/+38
When CONSOLE_SYSLOG is used, a DBG() from within a network device driver may cause its transmit() or poll() methods to be unexpectedly re-entered. Since these methods are not intended to be re-entrant, this can lead to undefined behaviour. Add an explicit re-entrancy guard to both methods. Note that this must operate at a per-netdevice level, since there are legitimate circumstances under which the netdev_tx() or netdev_poll() functions may be re-entered (e.g. when using VLAN devices). Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-04-10[pci] Avoid scanning nonexistent buses when using PCIAPI_DIRECTMichael Brown3-4/+30
There is no method for obtaining the number of PCI buses when using PCIAPI_DIRECT, and we therefore currently scan all possible bus numbers. This can cause a several-second startup delay in some virtualised environments, since PCI configuration space access will necessarily require the involvement of the hypervisor. Ameliorate this situation by defaulting to scanning only a single bus, and expanding the number of PCI buses to accommodate any subordinate buses that are detected during enumeration. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-04-10[intel] Add additional PCI device ID to tableTyler J. Stachecki1-0/+1
Adding this missing identifier allows the X557-AT2 chipset seen on (at least) Super Micro A2SDI-H-TF motherboards to function with iPXE. Signed-off-by: Tyler J. Stachecki <stachecki.tyler@gmail.com>
2021-04-10[efi] Mark PE .reloc and .debug sections as discardableMarvin Häuser1-0/+2
After a PE image is fully loaded and relocated, the loader code may opt to zero discardable sections for security reasons. This includes relocation and debug information, as both contain hints about specific locations within the binary. Mark both generated sections as discardable, which follows the PE specification. Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
2021-04-10[efi] Align EFI image sections by page sizeMarvin Häuser2-20/+33
For optimal memory permission management, PE sections need to be aligned by the platform's minimum page size. Currently, the PE section alignment is fixed to 32 bytes, which is below the typical 4kB page size. Align all sections to 4kB and adjust ELF to PE image conversion accordingly. Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
2021-04-10[efi] Discard .pci_devlist.* sections for EFI imagestmpMarvin Häuser1-0/+1
As per https://github.com/ipxe/ipxe/pull/313#issuecomment-816018398, these sections are not required for EFI execution. Discard them to avoid implementation-defined alignment malforming binaries. Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>