summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* efi/multifs: correctly enumerate partitions per diskmultifsPaulo Alcantara2016-01-311-54/+159
| | | | | | | | | | | The initial multifs support for EFI was saving all device handles which are logical partitions regardless which disk they belong to, so indexing disks other than 0 (or even partitions outside disk 0) would not work. This patch fixes enumeration of all logical partitions per disk thus making possible to index both disk and partition correctly. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
* s/MultiFS/multifsRaphael S. Carvalho2016-01-316-12/+12
| | | | | Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
* efi/multifs: fix misuse of static private informationPaulo Alcantara2016-01-311-6/+10
| | | | | | | | | | | | The get_dev_info_priv() function cannot return a reference of a static variable since there might be multiple device handles and each one per logical partition. A typical example of this failure is when a configuration file contains multifs-path-syntax like, so multifs will initialised to the first partition found (including its device handle) and the other ones will be using the same partition to do I/O. Cc: Gene Cumm <gene.cumm@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
* multifs: add support for both UEFI and BIOS firmwarePaulo Alcantara2016-01-3113-668/+514
| | | | | | | | | | | | | | | The previous multifs implementation only supported BIOS, so this patch basically keeps common code in a single place and separate firmware-specific functions that'll be exposed later. A generic interface has been added to be able to switch among different FSes regardless which firmware is being used. Although, each implementation has to implement init() and get_is_info() functions, pass through multifs_ops structure and they'll get called in starting of ldlinux. Cc: Gene Cumm <gene.cumm@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
* sys/common: handle multifs paths in findpath()Paulo Alcantara2016-01-311-1/+6
| | | | | | | | By looking for PATH entries and trying to find multifs-like paths does not make any sense. Only try to open it once. Cc: Gene Cumm <gene.cumm@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
* efi: add multifs supportPaulo Alcantara2016-01-319-23/+387
| | | | | | | | | | | | The system firmware will expose device handles of all MBR/GPT partitions which support BlockIo and/or DiskIo protocols, so find them and pass through multifs driver. Even in EFI environment ldlinux will be loaded up, so to avoid initialise multifs twice call init_multifs() earlier. Cc: Gene Cumm <gene.cumm@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
* ldlinux/kernel: contemplate multifs path syntaxPaulo Alcantara2016-01-311-0/+9
| | | | | | | | | The initramfs path in the configuration file might come with multifs path syntax (e.g. (hdX,Y)/initramfs...), so we must include it so multifs will know how fs ops to switch to. Cc: Gene Cumm <gene.cumm@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
* Wire up multifs support.Raphael S. Carvalho2016-01-314-0/+377
| | | | | | | | | | | | | | This patch finishes the multifs support. init_multifs gets called in the main (startup) function of ldlinux.c32, so multifs will be initialized automatically. init_multifs calls enable_multifs (lives in the core) to hook get_fs_info. Subsequent accesses will callback the get_fs_info living in ldlinux.c32. Cc: Gene Cumm <gene.cumm@gmail.com> Signed-off-by: Raphael S. Carvalho <raphael.scarv@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
* core: multifs infrastructure added.Raphael S. Carvalho2016-01-317-32/+206
| | | | | | | | | | | | | | | | multifs syntax: (hd[disk number],[partition number])/path/to/file The meaning of this_fs was changed to improve the flexibility of the support. Now, this_fs means the file system being currently used. root_fs was created to save the context of the main file system (where ldlinux.sys lives in). get_fs_info is a function pointer that will be later hooked to a function from ldlinux.c32. get_fs_info is expected to return a fs_info structure given the multifs path. Cc: Gene Cumm <gene.cumm@gmail.com> Signed-off-by: Raphael S. Carvalho <raphael.scarv@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
* Move partiter from com32/chain to com32/lib/syslinuxRaphael S. Carvalho2016-01-3110-14/+15
| | | | | | | | multifs depends on the availability of partiter to find a partition. Cc: Gene Cumm <gene.cumm@gmail.com> Signed-off-by: Raphael S. Carvalho <raphael.scarv@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
* Merge ↵Gene Cumm2016-01-193-10/+80
|\ | | | | | | | | | | | | 'git://github.com/Celelibi/syslinux.git/fix/bios/tail-call-stack-overflows' FIXME: this circumvents some of the issue but is not the cleanest and may reoccur.
| * core: Fix stack overflow when reloading configSylvain Gault2015-10-131-1/+57
| | | | | | | | | | | | | | | | | | | | | | The behavior when running a "CONFIG" command line is to reload ldlinux.c32 with the new file as argument. This call never return. In order to avoid stacking up the calls to start_ldlinux, this patch introduce a setjmp/longjmp to return to the first call to start_ldlinux, thus freeing all the stack space. Signed-off-by: Sylvain Gault <sylvain.gault@gmail.com>
| * ldlinux: fix stack overflow when running COM32 modulesSylvain Gault2015-10-132-9/+23
| | | | | | | | | | | | | | | | | | | | | | When a COM32 module exits, the functions never return and a new call to ldlinux_enter_command is made. This could fill the stack and overflow on some data present in memory. This patch use setjmp/longjmp to return to the main function and restart from there when a COM32 module exits. Signed-off-by: Sylvain Gault <sylvain.gault@gmail.com>
* | core/xfs: Silence compiler warningGene Cumm2016-01-191-2/+2
| | | | | | | | | | | | | | "may be used uninitialized in this function [-Wuninitialized]" even though logic dictates it must be OK. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* | Merge 'git://zytor.com/users/pcacjr/syslinux.git/xfs-v3-support' into masterGene Cumm2016-01-196-230/+399
|\ \
| * | xfs: Add support for v3 directoriesPaulo Alcantara2015-12-146-230/+399
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Besides supporting newer version of xfs file system, this patch also does some code refactoring and fix completely broken listing and searching on v2-3 node directories. Cc: Gene Cumm <gene.cumm@gmail.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Raphael S. Carvalho <raphael.scarv@gmail.com> Cc: Ady <ady-sf@hotmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
* | | btrfs: Fix logical to physical block address mappingPaulo Alcantara2015-12-272-16/+35
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current btrfs support did not handled multiple stripes stored in chunk items, hence skipping the physical addresses that were needed to do the mapping. Besides, the chunk tree may contain DEV_ITEM keys which store information on all of the underlying block devices, so we must skip them instead of finishing lookup. The bug was reproduced with btrfs-progs v4.2.2. Cc: Gene Cumm <gene.cumm@gmail.com> Cc: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com> --- v1 -> v2: * Do not set ignore_key multiple times. Set it before parsing chunk tree. v2 -> v3: * Replace an unnecessary goto with a continue statement.
* | Partial Revert: Still use .*.d depsGene Cumm2015-12-101-2/+2
| | | | | | | | | | | | Previous commit changed the dependency filenames to not have a leading '.' Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* | Dont bypass compiler driver for Dependency generation optionsKhem Raj2015-12-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | We can let compiler driver pass the right options to preprocessor after processing -Mxy options, right now its bypassing the gcc driver and handing them straight to cpp This also helps in other compilers processing these options correctly for their preprocessors consumption Signed-off-by: Khem Raj <raj.khem@gmail.com>
* | com32: Adding 'exit' entry in chain.c32Erwan Velu2015-12-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is coming after some bad experience with gfxboot. GFXboot was padding unexpected options on the chain.c32 commande line. As a result, chain was confused and didn't provided the expected behavior. This patch is a workaround to enforce chain.c32 not considering anything on the command line after this keyword. Example: chain.c32 hd0 exit ...garbage...
* | com32: Handle broken modules.aliasErwan Velu2015-12-061-0/+8
| | | | | | | | | | | | | | | | When parsing the modules.alias, we shall report it as broken if we cannot find any valid line in it. This patch simply count the number of valid lines and report a missing modules.alias if no valid lines are found.
* | Makefile: Always use -mno-red-zone for EFISylvain Gault2015-11-274-7/+12
| | | | | | | | | | | | | | | | This option is mandatory when compiling for EFI as some event handlers may interupt the running code and use the space just above the reserved stack space. Signed-off-by: Sylvain Gault <sylvain.gault@gmail.com>
* | Makefile: Pass down the variable EFI_BUILDSylvain Gault2015-11-274-13/+14
| | | | | | | | | | | | | | | | This variable indicates whether or nor the files are compiled for EFI. The lack of it lead the Makefiles to forget to add some compilation options specific to EFI. Signed-off-by: Sylvain Gault <sylvain.gault@gmail.com>
* | extlinux: code cleanup and simplificationNicolas Cornu via Syslinux2015-11-251-58/+55
| | | | | | | | | | | | | | | | | | | | | | Merge btrfs_read_adv and xfs_read_adv into a single generic function ext_read_adv and split ext_write_adv_offset out of ext_write_adv. Use those new functions in rewrite_boot_image and btrfs_install_file where it is actually hardcoded. Signed-off-by: Nicolas Cornu <nicolac76@yahoo.fr> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
* | extlinux/main.c: space changeAdy2015-11-151-10/+10
| | | | | | | | | | | | | | | | | | Spaces, ASCII 0x20, have been * moved * inserted * deleted Signed-off-by: Geert Stappers <stappers@stappers.nl>
* | extlinux/main.c: Correct comment about btrfs installGene Cumm2015-11-151-3/+6
| | | | | | | | | | | | | | As of commit ID 37eef640 (before 6.03-pre12, before 6.03), it is now in Boot Area B. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* | extlinux/main.c: comment typo fixesAdy2015-11-151-5/+5
| | | | | | | | | | | | | | Some typo fixes in extlinux/main.c. None of them affects code execution. Signed-off-by: Geert Stappers <stappers@stappers.nl>
* | libinstaller: introduce syslxrw libraryPaulo Alcantara2015-11-1011-67/+113
| | | | | | | | | | | | | | | | Due to size constraints on DOS systems, do not include whole syslxcom into DOS-based installer for using xpread() and xpwrite() functions, instead make them part of another separate library and include it only. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
* | mtools: Remove local xpread/xpwrite, use ones from syslxcomNicolas Cornu2015-11-102-58/+2
| | | | | | | | | | Signed-off-by: Nicolas Cornu <ncornu@aldebaran.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
* | xfs: rename xfs_is_valid_magicnum to xfs_is_valid_sbPaulo Alcantara2015-11-082-17/+15
| | | | | | | | | | | | | | | | xfs_is_valid_magicnum is not actually a generic function that checks for magic numbers, instead it checks only for superblock's one. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com> Reviewed-by: Gene Cumm <gene.cumm@gmail.com>
* | bios: Don't try to guess the sections alignmentSylvain Gault2015-11-082-102/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For the compression / decompression to succeed, the sections layout must be the same between the virtual memory and load memory. The section alignment was kept in sync by introducing aligment that should be greater or equal to the actual section alignment. This patch compute the load memory addresses of the sections so that the layout is the same as the virtual memory addresses. Signed-off-by: Sylvain Gault <sylvain.gault@gmail.com> Tested-by: poma <pomidorabelisima@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
* | bios: Fix alignment change with gcc 5Sylvain Gault2015-11-082-6/+6
| | | | | | | | | | | | | | | | | | The section aligment specified in the ld scripts have to be greater or equal to those in the .o files generated by gcc. Signed-off-by: Sylvain Gault <sylvain.gault@gmail.com> Tested-by: poma <pomidorabelisima@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
* | ldlinux: Fix return pointer to local dataSylvain Gault2015-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The command-line parsing used to return a pointer to a local array. The code used to work by chance, but now, gcc 5 is able to detect it and return a NULL pointer instead. The buffer is now marked static. This shouldn't be a problem as only one command line can be read at a time. Signed-off-by: Sylvain Gault <sylvain.gault@gmail.com> Tested-by: poma <pomidorabelisima at gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
* | efi: Disable UseDefaultAddress if possibly deafGene Cumm2015-10-151-3/+28
| | | | | | | | | | | | | | Some machines don't like UseDefaultAddress; fallback to manually configuring. HP EFI servers like DL160 Gen9 are affected. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* | efi: core_udp_configure()/core_tcp_connect(): Fix error messageGene Cumm2015-10-122-2/+2
|/ | | | | | Wrong translation type used. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* mboot.c32: add ELF64 support for Multiboot1Alex2015-10-102-0/+124
| | | | | | | | | mboot.c32 lacks support for loading ELF64 binaries (supported by GRUB2, for example). This is a trivial patch to add such feature. [reflow some changes to fit ~80 columns; remove trailing whitespace - gene.cumm@gmail.com] Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* core/http: Append port number to Host field if neededGene Cumm2015-10-101-2/+15
| | | | | | | | HTTP/1.1 header Host must contain the port number if not default for the protocol. Host isn't a part of HTTP/1.0 but let's implement it right. Reported-By: Michael DeCandia <michael.decandia@gmail.com> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* core/pxe: Allow DHCP option 54 Server IdentifierGene Cumm2015-10-081-2/+6
| | | | | | | | | | | Apparently some servers don't bother setting siaddr when pointing to itself for TFTP. Re-allow 54 but always set IPInfo.serverip from siaddr/dhcp->sip in packet #3 (PXEReply/proxyDHCP). Always set from siaddr if good in case parsing after-DHCP options. Reported-by: Celelibi <celelibi@gmail.com> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* chrreplace: Don't skip the first characterJosh Triplett2015-09-281-1/+1
| | | | | | | Check if the first character matches the character to replace, rather than skipping it and starting with the second. Signed-off-by: Josh Triplett <josh@joshtriplett.org>
* extlinux: fix memory leakImran Zaman2015-09-271-14/+30
| | | | | | | | devname is put on heap for all cases to avoid memory leak, and ease of use in future as well Signed-off-by: Imran Zaman <imran.zaman@intel.com> Reviewed-by: Paulo Alcantara <pcacjr@zytor.com>
* Add gpxe/ to clean-up targetsGene Cumm2015-09-272-4/+12
| | | | | | | | gpxe/ has a lot of binary blobs after a spotless. Start the cleanup measures. do-spotless-gpxe for bios target might be better in another spot. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* core: readd gPXE/iPXE support for HTTP on pxelinux.0Gene Cumm2015-09-273-81/+108
| | | | | | | | | | | When adding lwIP functionality, the gPXE/iPXE callback was broken. This prevented pxelinux.0 from calling gPXE/iPXE for HTTP and FTP URLs. Re-add for pxelinux.0 and add code to find file size. Move to core/legacynet/core.c to access packet_buf and leave a dummy function for lpxelinux.0. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* core/fs/lib/loadconfig.c: Add architecture-specific config name to searchAdy2015-09-201-0/+5
| | | | | | | | When multiple architectures are on a single media, all will try to use the same config, preventing PATH from pointing to an architecture-specific directory. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* com32/modules: Split build by architecture. Add dir.c32Gene Cumm2015-09-201-7/+16
| | | | | | | | | Certain modules directly make BIOS calls or call library functions that will not be ported from BIOS (like syslinux_shuffle_boot_rm()). It appears dir.c32 was long-forgotten for the Makefile Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* efi: Don't unnecessarily rebuild syslinux.soSylvain Gault2015-09-161-4/+3
| | | | | | | | | | | OBJ directory creation changed from a .PHONY target to a real target used through an order-only dependency. A target depending on another target marked .PHONY is always rebuilt, thus forcing all the .o files to be rebuilt everytime. Signed-off-by: Sylvain Gault <sylvain.gault@gmail.com> Reviewed-by: Paulo Alcantara <pcacjr@zytor.com>
* zlib: use (void(0)) instead of empty #definesPatrick Masotta2015-09-131-6/+6
| | | | | | Originally-By: Patrick Masotta <masottaus@yahoo.com> [Use (void(0)) instead of a dummy function - gene.cumm@gmail.com] Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* efi/x86_64: fix trivial compilation warningSylvain Gault2015-09-131-1/+1
| | | | | | | Missing */ at the end of a comment. Signed-off-by: Sylvain Gault <sylvain.gault@gmail.com> Reviewed-by: Paulo Alcantara <pcacjr@zytor.com>
* pxe/dhcp_option: Don't parse DHCP option 54 Server IdentifierGene Cumm2015-09-121-1/+0
| | | | | | | Server Identifier is NEVER the next server where Syslinux was loaded from. BOOTP field siaddr, BOOTP field sname and DHCP option 66 TFTP server name may contain this information. For now, just use siaddr.
* efi: Merge cleanupGene Cumm2015-09-102-4/+3
|\ | | | | | | | | | | Merge git://github.com/Celelibi/syslinux.git branch 'fix/efi/cleanup' Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
| * efi: fix warning about unused variableSylvain Gault2015-08-261-1/+0
| | | | | | | | Signed-off-by: Sylvain Gault <sylvain.gault@gmail.com>