aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2016-01-31efi/multifs: correctly enumerate partitions per diskmultifsPaulo Alcantara1-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>
2016-01-31s/MultiFS/multifsRaphael S. Carvalho6-12/+12
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2016-01-31efi/multifs: fix misuse of static private informationPaulo Alcantara1-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>
2016-01-31multifs: add support for both UEFI and BIOS firmwarePaulo Alcantara13-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>
2016-01-31sys/common: handle multifs paths in findpath()Paulo Alcantara1-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>
2016-01-31efi: add multifs supportPaulo Alcantara9-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>
2016-01-31ldlinux/kernel: contemplate multifs path syntaxPaulo Alcantara1-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>
2016-01-31Wire up multifs support.Raphael S. Carvalho4-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>
2016-01-31core: multifs infrastructure added.Raphael S. Carvalho7-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>
2016-01-31Move partiter from com32/chain to com32/lib/syslinuxRaphael S. Carvalho10-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>
2016-01-19Merge ↵Gene Cumm3-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.
2016-01-19core/xfs: Silence compiler warningGene Cumm1-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>
2016-01-19Merge 'git://zytor.com/users/pcacjr/syslinux.git/xfs-v3-support' into masterGene Cumm6-230/+399
2015-12-27btrfs: Fix logical to physical block address mappingPaulo Alcantara2-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.
2015-12-14xfs: Add support for v3 directoriesPaulo Alcantara6-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>
2015-12-10Partial Revert: Still use .*.d depsGene Cumm1-2/+2
Previous commit changed the dependency filenames to not have a leading '.' Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-12-10Dont bypass compiler driver for Dependency generation optionsKhem Raj1-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>
2015-12-06com32: Adding 'exit' entry in chain.c32Erwan Velu1-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...
2015-12-06com32: Handle broken modules.aliasErwan Velu1-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.
2015-11-27Makefile: Always use -mno-red-zone for EFISylvain Gault4-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>
2015-11-27Makefile: Pass down the variable EFI_BUILDSylvain Gault4-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>
2015-11-25extlinux: code cleanup and simplificationNicolas Cornu via Syslinux1-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>
2015-11-15extlinux/main.c: space changeAdy1-10/+10
Spaces, ASCII 0x20, have been * moved * inserted * deleted Signed-off-by: Geert Stappers <stappers@stappers.nl>
2015-11-15extlinux/main.c: Correct comment about btrfs installGene Cumm1-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>
2015-11-15extlinux/main.c: comment typo fixesAdy1-5/+5
Some typo fixes in extlinux/main.c. None of them affects code execution. Signed-off-by: Geert Stappers <stappers@stappers.nl>
2015-11-10libinstaller: introduce syslxrw libraryPaulo Alcantara11-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>
2015-11-10mtools: Remove local xpread/xpwrite, use ones from syslxcomNicolas Cornu2-58/+2
Signed-off-by: Nicolas Cornu <ncornu@aldebaran.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2015-11-08xfs: rename xfs_is_valid_magicnum to xfs_is_valid_sbPaulo Alcantara2-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>
2015-11-08bios: Don't try to guess the sections alignmentSylvain Gault2-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>
2015-11-08bios: Fix alignment change with gcc 5Sylvain Gault2-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>
2015-10-18ldlinux: Fix return pointer to local dataSylvain Gault1-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>
2015-10-15efi: Disable UseDefaultAddress if possibly deafGene Cumm1-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>
2015-10-13core: Fix stack overflow when reloading configSylvain Gault1-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>
2015-10-13ldlinux: fix stack overflow when running COM32 modulesSylvain Gault2-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>
2015-10-12efi: core_udp_configure()/core_tcp_connect(): Fix error messageGene Cumm2-2/+2
Wrong translation type used. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-10-10mboot.c32: add ELF64 support for Multiboot1Alex2-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>
2015-10-10core/http: Append port number to Host field if neededGene Cumm1-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>
2015-10-08core/pxe: Allow DHCP option 54 Server IdentifierGene Cumm1-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>
2015-09-28chrreplace: Don't skip the first characterJosh Triplett1-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>
2015-09-27extlinux: fix memory leakImran Zaman1-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>
2015-09-27Add gpxe/ to clean-up targetsGene Cumm2-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>
2015-09-27core: readd gPXE/iPXE support for HTTP on pxelinux.0Gene Cumm3-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>
2015-09-20core/fs/lib/loadconfig.c: Add architecture-specific config name to searchAdy1-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>
2015-09-20com32/modules: Split build by architecture. Add dir.c32Gene Cumm1-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>
2015-09-16efi: Don't unnecessarily rebuild syslinux.soSylvain Gault1-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>
2015-09-13zlib: use (void(0)) instead of empty #definesPatrick Masotta1-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>
2015-09-13efi/x86_64: fix trivial compilation warningSylvain Gault1-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>
2015-09-12pxe/dhcp_option: Don't parse DHCP option 54 Server IdentifierGene Cumm1-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.
2015-09-10efi: Merge cleanupGene Cumm2-4/+3
Merge git://github.com/Celelibi/syslinux.git branch 'fix/efi/cleanup' Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-09-08libinstaller: Explicit failure if path isn't writableErwan Velu1-1/+2
As per bug #4, we should report a clear failure if the target path is not writable. The current code was catching the fact the file was not writable but it didn't wrote an explicit message and even more confusing, was trying to process the file descriptor leading to a creepy "Bad file descriptor" error message. This patch does return EACCES to avoid process the file description. It also print an explicit message saying a particular file isn't writable which generates a fatal error. A typical output looks like : [root@host]: extlinux --once=plop /boot /boot is device /dev/sda Cannot open file '/boot/ldlinux.sys' in read/write mode ! Fatal error, exiting.
2015-09-06doc/menu.txt: further correctionsGene Cumm1-6/+7
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-09-06doc/menu.txt: correction, rewording and type corrections.Ady1-89/+99
Correct the order of the parameters for MENU RESOLUTION. Update references. Rewording. Typos. [certain phrases seem clearer in original wording - gene.cumm@gmail.com] Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-09-06efi/x86_64: leave long mode properlyThomas Letan1-20/+41
Syslinux 6.03 (efi64) fails to boot a 32-bit kernel. The way Syslinux leaves long mode in kernel_jump assembly routine does not follow AMD64 specifications. More precisely: 1. After setting a new GADT, `cs` has to be refresh by doing a long jump, but it is not 2. Other segments have to be updated, but they are not 3. Disabling paging has to be done before disabling long mode, but the implementation does the opposite In most cases, a computer that tries to execute the kernel_jump routine reboot (it can also hangs). This patch fixes the kernel_jump routine. Signed-off-by: Thomas Letan <thomas.letan@ssi.gouv.fr> Tested-by: Patrick Masotta <masottaus@yahoo.com> Tested-by: Celelibi <celelibi@gmail.com>
2015-09-04libupload: Reworking tftp support to use core functionsErwan Velu5-150/+220
The libupload was using the pxe_call() directly for doing the tftp uploading stuff. This was only working with pxelinux. Since we do have lpxelinux, the libupload should use the core functions to get rid of thoses direct PXE calls. This patch does - add a tftp_put() function which supports core functions. - implement the call from libupload making the code much more simplier As a result {l}pxelinux can upload data to a tftp server is a similar way. HDT is getting the benefit of such code.
2015-09-04tftp: Report server IP address on debug messageErwan Velu1-1/+10
When debugging, it is very useful to get the ip adress of the server that reponsded to that packet.
2015-09-04hdt: print tftp error number & message if dump failedErwan Velu1-1/+2
The current code was making a mistake by searching the -err element in the array as it was resulting into a negative value. The current patch does print the error number which could be useful but also retrieve the proper string to indicate the real error we encountered.
2015-09-04hdt: Removing commas and plus signs from filenameErwan Velu1-0/+6
When uploading the dump file to a tftp server, removing the plus & comma sign from the filename could make the file easier to manipulate later.
2015-09-04debug: Adding -DDEBUG_THREADErwan Velu2-0/+5
When debugging some syslinux code with debugging enabled, the threading code is so verbose that it completly slow down syslinux but also is so verbose that any other trace is invisible in the flood. This commit aims at requesting people to explicitly enable the threading logs by using -DDEBUG_THREAD.
2015-09-04gpllib: Updating dmi codeErwan Velu6-30/+67
This is a simple rebase of the current code against current dmidecode version. This is pretty lame copy/paste but as we don't have a libification of dmidecode, that does the job. This patch does improve mostly the cpu & ram reporting.
2015-09-04hdt: Avoid false-positive single command detectionErwan Velu1-2/+2
Since commit 1697594b61f9a8f9d092996afc0e2c80bbb2a20a, some commands are said to be "nomodule" like "say". This patch was adding a check if the nomodule flag was set but didn't checked that the associated structure did exist leading to false positive detection. As a result, the commands were not executed meaning the CLI was unsuable since ... 3 years.... *shame* This commit simply avoid considering the nomodule flag if the structure is not allocated
2015-09-04hdt: Fixing argv usage to avoid crashErwan Velu1-5/+5
argv shall be passed as a pointer to avoid a crash when running command like "dmi". Thanks genec for pointing this out.
2015-09-02core: dprintf on malloc/free if -DDEBUG_MALLOCErwan Velu2-0/+6
When dynamic debug is engaged, the output is pretty flooded by malloc/free messages while you are looking at other traces. As devel.mk have a DEBUG_MALLOC option, it seems pretty logical to enable the malloc/free dprintf() only if this option is engaged. That patch make the dynamic debug output less floody while letting the choice to get the malloc/free dprintf() messages.
2015-09-02efi: Change status check when draining keyboardOliver Wagner1-1/+1
PCs without keyboards may hang as they might return a status other than EFI_NOT_READY. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-08-27com32: write_sectors() sizing correctionsRobert1-3/+3
Memory allocation and copy length should be SECTOR * size for sectors operation. Signed-off-by: Robert <luyao-c@360.cn> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-08-26efi: fix warning about unused variableSylvain Gault1-1/+0
Signed-off-by: Sylvain Gault <sylvain.gault@gmail.com>
2015-08-26efi: fix pointer-type mismatch assigment warningSylvain Gault1-1/+1
The assignment looks suspicious but is actually legit since it is protected by the type check. Signed-off-by: Sylvain Gault <sylvain.gault@gmail.com>
2015-08-26efi: fix warnings about argument typesSylvain Gault1-2/+2
The function efi_get_MAC was given a pointer to array instead of a simple pointer, generating a warning with gcc. Signed-off-by: Sylvain Gault <sylvain.gault@gmail.com>
2015-08-01efi/main: set/check for NULL in efi_create_binding()Patrick Masotta1-2/+2
If LibLocateHandle() returns success and either 0 handles or we find no matching handles, treat it the same. Originally-By: Patrick Masotta <masottaus@yahoo.com> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-07-19efi: Hunt for service binding handle if neededGene Cumm1-7/+39
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-07-19efi: add efi_get_MAC()Gene Cumm1-0/+36
Extracts a MAC address from a device path Originally-By: Patrick Masotta <masottaus@yahoo.com> [gene.cumm@gmail.com: Respace] Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-07-19efi: rename pxe_handle to image_device_handleGene Cumm3-9/+9
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-07-18com32 readconfig: use my_isspace()Gene Cumm2-2/+2
More consistent. Also ensures it's properly recast. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-07-18com32/include/menu.h: Extend my_isspaceGene Cumm1-1/+1
Add 0x7f as a space character Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-07-18core/serirq: Use memset not memcpyGene Cumm1-1/+1
The intention is to nullify not copy the IRQ pointers Reported-By: Thomas Schmitt <scdbackup@gmx.net> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-07-18efi/udp: Don't use AllowPromiscuousGene Cumm1-2/+0
Unnecessary. On some systems, opens NIC in promiscuous mode or breaks UseDefaultAddress. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-07-18efi: Provide feedback on Configure() failuresGene Cumm2-6/+10
There are more unsuccessful returns that are ignored. Restructure to allow for trapping other values. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-06-27efi/main.c: don't close handle earlyPatrick Masotta1-3/+0
This clause closes the protocol before creating the child Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-06-26efi/pxe.c: missing returnPatrick Masotta1-0/+1
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-06-25efi/pxe: Reuse handleGene Cumm3-35/+23
Store and reuse handle found with EFI_LOADED_IMAGE_PROTOCOL for EFI_PXE_BASE_CODE_PROTOCOL and EFI_UDP4_SERVICE_BINDING_PROTOCOL This caused machines with multiple NICs to not reliably attach to the correct NIC handle. gnu-efi LoadedImageProtocol PxeBaseCodeProtocol Udp4ServiceBindingProtocol Reported-By: Holger Baust <holger.baust@freenet.ag> Reported-By: Michael Glasgow <glasgow@beer.net> Reported-By: Da Shi Cao <dscao999@gmail.com> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-06-25core/pxe/dhcp_option: Filter options based on pkt_typeGene Cumm1-1/+4
Filter (by setting a minimum option number) the options based on pkt_type. DHCPDiscover/PXEReply should only contain info about client ID, boot server and PXELINUX options. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-06-25core/pxe: Don't prevent serverip overrideGene Cumm1-3/+0
This prevented a proxyDHCP/PXEReply from overriding the IPInfo.serverip, most often stored in BOOTP field siaddr or DHCP option 54. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-06-20core/pxe: extend parse_dhcp() for packet typeGene Cumm4-9/+11
Add packet type so we can eventually only grab certain data elements from the DHCP packets appropriately Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-06-09core/fs/pxe/dhcp_option: comment spellingGene Cumm1-1/+1
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-06-09efi/pxe: save MAC after parsing last packetPatrick Masotta1-9/+11
parse_dhcp() does this also, seeming to set a bad value for some clients. Fixes some deaf clients. Signed-off-by: Patrick Masotta <masottaus@yahoo.com> [gene.cumm@gmail.com: Just move existing code] Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-05-26efi/pxe: Use the appropriate 3rd packetPatrick Masotta1-1/+9
EFI allows us to have access to more DHCP-related packets. Choose the packet with the highest priority for the third to parse. Signed-off-by: Patrick Masotta <masottaus@yahoo.com> [gene.cumm@gmail.com: Only change the third parsing iteration; reflow to better fit code standards; don't reparse DhcpAck] Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-05-25efi/pxe: Amend comments to clarify BIOS.Gene Cumm1-3/+3
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-05-24ldlinux.c32: SERIAL directive: Allow octal/hex on port/flow controlAndrew J. Schorr1-2/+2
For the SERIAL directive, allow octal (0###) and hexidecimal (0x###) notation on the port and flow control arguments. Two of the old ASM getint/parseint callers Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-05-17com32/Makefile: resequence/regroupGene Cumm1-10/+8
A lot more items have identical dependencies; regroup. Certain items make more sense to build first; resequence. Group library dependencies before COM32 directories Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-05-17com32/Makefile: additional dependenciesJonathan Boeing1-2/+2
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-05-03hdt: fix sizeof(char *) misuseJonathan Boeing1-3/+2
The code was passing sizeof(const char *) - not the length of the string or the size of the buffer - as the length to strncmp(). These two cases don't need the length, so switch to strcmp. Fixes the warning: argument to 'sizeof' in 'strncmp' call is the same expression as the second source; did you mean to provide an explicit length? Signed-off-by: Jonathan Boeing <jonathan.n.boeing@gmail.com>
2015-05-03hdt: fix sizeof(char *) misuseJonathan Boeing1-89/+89
The code was passing sizeof(char *) - not the length of the buffer - to memset. Change the function to take the length of the buffer as a parameter. Fixes the warning: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to provide an explicit length? Signed-off-by: Jonathan Boeing <jonathan.n.boeing@gmail.com>
2015-05-03hdt: fix sizeof(char *) misuseJonathan Boeing1-89/+89
The code was passing sizeof(char *) - not the length of the buffer - to memset. Change the function to take the length of the buffer as a parameter. Fixes the warning: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to provide an explicit length? Signed-off-by: Jonathan Boeing <jonathan.n.boeing@gmail.com>
2015-05-03gpllib: fix sizeof(char *) misuseJonathan Boeing1-10/+14
The code was passing sizeof(char *) - not the length of the buffer - to strlcpy and snprintf. Change the function to take the length of the buffer as a parameter. Fixes the warning: argument to 'sizeof' in 'snprintf' call is the same expression as the destination; did you mean to provide an explicit length? Signed-off-by: Jonathan Boeing <jonathan.n.boeing@gmail.com>
2015-05-03pxe: fix truncation warningJonathan Boeing1-1/+1
When building efi64, there's a size mismatch between the uint32_t variable (32 bits) and the -1UL (64 bits). This fixes the warning: large integer implicitly truncated to unsigned type Signed-off-by: Jonathan Boeing <jonathan.n.boeing@gmail.com>
2015-05-03Use z width specifier when printing size_t variableJonathan Boeing1-1/+1
Fixes the warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'size_t' Signed-off-by: Jonathan Boeing <jonathan.n.boeing@gmail.com>
2015-05-03add missing '\n' to dprintfJonathan Boeing1-2/+2
Signed-off-by: Jonathan Boeing <jonathan.n.boeing@gmail.com>
2015-05-03fix a few typosJonathan Boeing3-3/+3
Signed-off-by: Jonathan Boeing <jonathan.n.boeing@gmail.com>
2015-04-18com32/lib/syslinux/load_linux.c: update prot_mode_baseScot Doyle1-0/+1
If the kernel is relocatable and the protected mode code will not fit in the initially determined location, that code will be moved to the next available location. However, beginning with commit 8f470e7b, the code is moved to the initially determined location instead of the next available location because prot_mode_base is no longer updated to the correct location. Since whdr->code32_start is updated, it is pointing to the wrong execution start location, random code is executed and the machine is rebooted. Restore the old behavior by assigning prot_mode_base the value of base. Tested on a machine that exposed this behavior. Signed-off-by: Scot Doyle <lkml14@scotdoyle.com> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-03-15chain: year update in commments (trivial)Gene Cumm11-11/+11
Signed-off-by: Michal Soltys <soltys@ziu.info> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-03-15chain/partiter: add options to ignore GPT crc checksMichal Soltys4-23/+57
This can be useful to force boot even if checksums of GPT header and/or partition list are invalid. This works independently from 'strict' option. Signed-off-by: Michal Soltys <soltys@ziu.info>
2015-03-15chain/partiter: call notsane_gpt_hdr() per headerMichal Soltys1-48/+48
Instead of calling it just once after the examination of both headers (the 2nd one only if necessary) - call it per each header during examination. Thus in unlikely situation of passing crc check on primary gpt header and at the same time failing sanity checks, it will also try backup header. Signed-off-by: Michal Soltys <soltys@ziu.info>
2015-02-22diag/geodsp/: Remove geodsp1s_f.img.xz image from target; CopyrightGene Cumm4-5/+5
It's relatively simple to just apply the geodsp1s_f.bin force drive 80h after applying the plain geodsp1s.img.xz Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-02-16core/diskboot.inc: spellingGene Cumm1-1/+1
Remove 1 spelling error Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-02-16diag/geodsp/Makefile: lib; _f alternateGene Cumm1-3/+7
Move library dependendcies to a variable; Add another _f (Force DL == 80h) variant. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-02-16diag/geodsp: updateGene Cumm3-74/+113
Print drive number at start. Print '!' before data when an error is encountered (but continue). Several macros to change codesize. Code refactoring to reduce size. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-02-15diag/geodsp: Update README with a sampleGene Cumm1-0/+24
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-02-15diag/geodsp: mk-lba-img.pl misdirects a status messageGene Cumm1-1/+1
mk-lba-img.pl misdirects a status message about len/tail such that it hits stdout (which may be our file) instead of stderr. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-02-14load_linux: correct a typeScot Doyle1-2/+2
Correct base's type to match its initialization from prot_mode_base and passage to syslinux_memmap_find(). Tested with extlinux. Signed-off-by: Scot Doyle <lkml14@scotdoyle.com> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-02-14Merge remote-tracking branch 'u-gh-wferi/pub'Gene Cumm5-341/+329
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-01-05txt/syslinux.txt: --onceAdy1-1/+1
remove mention of the deprecated "-o" option Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-01-05txt/syslinux.txt: updatesAdy1-10/+12
Correct typos. Improve format for asciidoc-to-manpage conversion. Wrap text. Correct info. Help phase-out deprecated and/or conflicting options. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-01-05check-gnu-efi.sh: print the output of build-gnu-efi.shRobert Yang1-1/+1
The build would be failed and exit if build-gnu-efi.sh is failed, so we'd better not suppress the output of build-gnu-efi.sh, which is good for debugging. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-01-05efi: prevent git command in non-git tree #2Gene Cumm1-1/+3
efi/clean-gnu-efi.sh presumes it's in a git repo. Test first. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-01-05efi: prevent git command in non-git treeErwan Velu1-1/+3
efi/build-gnu-efi.sh presumes it's in a git repo. Test first. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-01-05txt/syslinux.cfg.txt: Fix SYSAPPEND FSUUIDGene Cumm1-4/+6
Reflow for proper AsciiDoc formatting. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-01-05com32: Use z size specifier for printf-ing size_t variableMartin Str|mberg6-8/+8
Use the z size specifier to printf-ing size_t variables to get rid of gcc warning format ‘%08x’ expects type ‘unsigned int’, but argument 2 has type ‘long unsigned int’ Author: Martin Str|mberg <ams@ludd.ltu.se> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-01-05SYSAPPEND: Fix space strippingDany St-Amant3-3/+3
The description of SYSAPPEND for the DMI information states that the spaces are replaced by underscores, but this replacement does not occur in 6.03. Signed-off-by: Dany St-Amant <dany.ephemeral.2014@icloud.com> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-01-05build: sort sources to build in a more deterministic wayPhilippe Coval15-27/+27
It has been observed that binaries contents are depending on the order of linked objects. This order is caused by GNU make's wildcard function and the position of sources on filesystem. This change tries to prevent this kind of randomness. Also consider building using -j1 flag to make it even more reproductible. Change-Id: Ie8eee7f336e6f1fa2863c4150d967afd15519f1d Bug: http://bugzilla.syslinux.org/show_bug.cgi?id=57#related Signed-off-by: Philippe Coval <philippe.coval at open.eurogiciel.org>
2015-01-05com32: change '%llx' to use PRIx64Martin Str|mberg6-21/+21
Get rid of printf format warning format ‘%llx’ expects type ‘long long unsigned int’, but argument 2 has type ‘uint64_t’ Use <inttypes.h> PRIx64 instead of llx to get rid of gcc warning format ‘%llx’ expects type ‘long long unsigned int’, but argument 2 has type ‘uint64_t’ Author: Martin Str|mberg <ams@ludd.ltu.se> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-01-05com32: parallel depsGene Cumm1-4/+2
Resort and collapse the list; add libutil to dep lib Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-01-05gpllib: fix parallel building issueChong Lu1-0/+1
From: Chong Lu <Chong.Lu at windriver.com> There might be an error when parallel build: [snip] cp: cannot create directory `tmp/sysroots/x86_64-linux/usr/share/ syslinux/com32/include/gplinclude': No such file or directory make[4]: *** [install] Error 1 make[3]: *** [gpllib] Error 2 [snip] This is a potential issue. In ${S}/com32/gpllib/Makefile file, install target wants to copy $(SRC)/../gplinclude to $(INSTALLROOT)$(COM32DIR)/include/ directory, but in ${S}/com32/lib/Makefile file, the install target will remove $(INSTALLROOT)$(COM32DIR)/include directory. We need to do com32/lib first. The patch make com32/gpllib depends on com32/lib to fix this issue. Upstream-Status: Pending Signed-off-by: Chong Lu <Chong.Lu at windriver.com> Signed-off-by: Robert Yang <liezhi.yang at windriver.com> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-01-05libupload: fix parallel build issueRobert Yang1-0/+1
Fixed: cp -r syslinux-6.01/com32/libupload/*.h image/usr/share/syslinux/com32/include/ [snip] rm -rf image/usr/share/syslinux/com32/include [snip] cp: cannot create regular file `image/usr/share/syslinux/com32/include/serial.h': No such file or directory The cp is happened in the "libupload" dir, while "rm -fr" is happend in "lib" dir, let "libupload" depend "lib" will fix the problem. Signed-off-by: Robert Yang <liezhi.yang at windriver.com> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-01-05doc/syslinux.txt, txt/syslinux.cfg.txt: Adjust bit valuesGene Cumm2-13/+18
Accidentally misdocumented. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-01-05doc/syslinux.txt: SYSAPPEND 0x20000 FSUUIDGene Cumm1-0/+5
Document the change introduced in 386b59e1 and extended in 7c5efd0 Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-01-05btrfs: Suffix 64b macroMartinS1-1/+1
gcc complains about the size of the constant of BTRFS_MAGIC_N. It is a 64bit value, so it needs the ULL suffix. Signed-off-by: MartinS <ams@luminous.ludd.ltu.se> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2015-01-05version: bump to 6.04/2015Gene Cumm1-1/+1
Begin 6.04 in 2015. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2014-10-13lua: simplify the function/value handling in the automenu testFerenc Wágner1-10/+7
Signed-off-by: Ferenc Wágner <wferi@niif.hu>
2014-10-13lua: move the automenu test from the boot_linux to the boot_it bindingFerenc Wágner1-5/+18
Signed-off-by: Ferenc Wágner <wferi@niif.hu>
2014-10-13lua: return the modified object from the initramfs methodsFerenc Wágner2-4/+8
Signed-off-by: Ferenc Wágner <wferi@niif.hu>
2014-10-13lua: docs: refresh and extend the documentationFerenc Wágner1-128/+93
Signed-off-by: Ferenc Wágner <wferi@niif.hu>
2014-10-13lua: initramfs: enable adding nonempty filesFerenc Wágner1-4/+11
Signed-off-by: Ferenc Wágner <wferi@niif.hu>
2014-10-13lua: don't do a local boot when asked to final_cleanupFerenc Wágner1-2/+1
Signed-off-by: Ferenc Wágner <wferi@niif.hu>
2014-10-13lua: do not leak initramfs data chunks on garbage collectionFerenc Wágner1-0/+16
Signed-off-by: Ferenc Wágner <wferi@niif.hu>
2014-10-13lua: make initramfs structures full userdata objects with methodsFerenc Wágner1-25/+43
Signed-off-by: Ferenc Wágner <wferi@niif.hu>
2014-10-12lua: unused optional arguments can goFerenc Wágner1-10/+0
Not expecting them does not cause any problems, they are ignored by Lua anyway. Signed-off-by: Ferenc Wágner <wferi@niif.hu>
2014-10-12lua: make the file operations methodsFerenc Wágner1-2/+7
This also enables manual unloading of files by callig f:__gc(). Signed-off-by: Ferenc Wágner <wferi@niif.hu>
2014-10-12lua: garbage collect file objectsFerenc Wágner1-0/+15
Signed-off-by: Ferenc Wágner <wferi@niif.hu>
2014-10-12lua: represent syslinux files as full userdataFerenc Wágner1-21/+13
Light userdata don't have individual metatables, thus they aren't suitable for type checking. Also, a200ad6d replaced relying on reused memory (from luaL_checkstring) with writing to uninitialized pointers; copy the filename instead into freshly allocated memory. Signed-off-by: Ferenc Wágner <wferi@niif.hu>
2014-10-12lua: Remove even more cruft from syslinux.cFerenc Wágner1-44/+2
Signed-off-by: Ferenc Wágner <wferi@niif.hu>
2014-10-11lua: docs: condense the PCI exampleFerenc Wágner1-29/+6
Signed-off-by: Ferenc Wágner <wferi@niif.hu>
2014-10-11lua: docs: remove printf from loadfile exampleFerenc Wágner1-10/+3
Signed-off-by: Ferenc Wágner <wferi@niif.hu>
2014-10-11lua: docs: loadfile() is not TFTP-specificFerenc Wágner1-1/+1
Signed-off-by: Ferenc Wágner <wferi@niif.hu>
2014-10-11libansi.h: depends on stdbool.h and stdio.hFerenc Wágner1-0/+3
Signed-off-by: Ferenc Wágner <wferi@niif.hu>
2014-10-11lua: docs: remove overall indentation and some verbose cruft from the examplesFerenc Wágner1-104/+99
Signed-off-by: Ferenc Wágner <wferi@niif.hu>
2014-10-11lua: docs: bring documentation up to dateFerenc Wágner1-31/+42
Signed-off-by: Ferenc Wágner <wferi@niif.hu>
2014-10-11lua: vesa: delete stray would-be-debug outputFerenc Wágner1-2/+0
Signed-off-by: Ferenc Wágner <wferi@niif.hu>
2014-10-11lua: docs: add new bindings to syslinux.ascFerenc Wágner1-1/+21
Signed-off-by: Ferenc Wágner <wferi@niif.hu>
2014-10-11lua: docs: do not reference removed exampleFerenc Wágner1-1/+0
Signed-off-by: Ferenc Wágner <wferi@niif.hu>
2014-10-11lua: share the export macro (CPP only change)Ferenc Wágner1-39/+39
Signed-off-by: Ferenc Wágner <wferi@niif.hu>
2014-10-11lua: add the IMAGE_TYPE table to the syslinux moduleFerenc Wágner1-0/+13
Signed-off-by: Ferenc Wágner <wferi@niif.hu>
2014-10-11lua: make kernel and initrd progress output match in sl_boot_linuxFerenc Wágner1-4/+4
Signed-off-by: Ferenc Wágner <wferi@niif.hu>
2014-10-06NEWS: Update for 6.03 releasesyslinux-6.03H. Peter Anvin1-0/+75
Thanks to Ady <ady-sf@hotmail.com> for most of this writeup. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-09-29define _DEFAULT_SOURCE for glibc-2.20Chanho Park3-0/+6
_BSD_SOURCE was deprecated in favour of _DEFAULT_SOURCE since glibc 2.20[1]. To avoid build warning on glibc2.20, _DEFAULT_SOURCE should also be defined. [1]: https://sourceware.org/glibc/wiki/Release/2.20 Signed-off-by: Chanho Park <chanho61.park@samsung.com> _BSD_SOURCE was fist used at 1769d57c94d7a965168b72b6fd8d48251710b452 Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2014-08-26chain/partiter: correct gpt header checkssyslinux-6.03-pre20Michal Soltys1-4/+8
In gpt header, lba_cur and lba_alt alternate depending on whether we read primary or backup copy. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-08-26chain: implement strict=<0|1|2>Michal Soltys5-22/+53
This provides more fine grained control than single relax flag. to cover case with wrong disk sizes. relax and nostrict are equivalent to strict=0 norelax and strict are equivalent to strict=2 strict=1 does the same as strict=2, but ignores checks against disk size The current default is strict=1. Options: 'fixchs', '[un]hide[all]' and 'save' will forcibly enable strict=2 (can be overridden by the user). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-08-26chain: add missing pi_del() in find*() functionsMichal Soltys1-35/+25
As partiter doesn't deallocate itself after finish (anymore), it should be deleted after each loop iteration. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-08-26chain/partiter: adjust error reportingMichal Soltys3-10/+5
Use <0 for errors, 0 for normal state, and >0 for clean completion. In future this would be necessary if it's decided to make partiter a generic lib (similar to disklib) - though it has to be quieted first and provide strerr()-like functionality in place of its verbosity. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-08-26chain/partiter: fix possible non-NULL value returned by pi_begin() on errorMichal Soltys1-8/+10
This patch fixes non-NULL value returned from pi_begin() in case of an error (which resulted in further hang instead of proper exit). Probably a leftover from pi_dealloc() times. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-08-26chain/partiter: fix and improve gpt handling in buggy casesMichal Soltys1-76/+128
Previous version had some issues in case of error situations, among those: - backup gpt header was not read if reading of primary failed - alternating nature of lba_cur and lba_alt was ignored This patch fixes this and extends the gpt handling. The current behavior is: - try primary header; if unreadable or checksum fails (or sanity checks fail unless relax flag is set) - try secondary header - try main partition table referenced in the header that was read; if it's unreadable or if its crc check fails - try alternative (so if we managed to read primary header, table at the end would be considered as alternative - if we managed to read secondary header, table at the beginning would be treated as such) Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-08-02PXE ISR: Force polling on select hardware #3 WORKAROUNDGene Cumm1-0/+1
Like 2fe3a7bd, certain Dell machines (Latitude E6510) state interrupts should work but effectively don't. Force polling. Reported-by: Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2014-07-29core, pxe: Don't push on one stack and pop from the other in pxenvsyslinux-6.03-pre19H. Peter Anvin1-0/+4
When saving/restoring the flags around the stack switch test, we cannot leave live data on the stack *across* the stack switch that we are going to use on the other side (unlike the "big" stack frame which we only use once we are back on the original stack.) Use register BP, which is not live at either point, as a temporary holding place for the flags from the stack. Reported-by: Frank Mehnert <frank.mehnert@googlemail.com> Link: http://bugzilla.syslinux.org/show_bug.cgi?id=54 Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-07-13PXE ISR: Force polling on select hardware WORKAROUNDGene Cumm1-3/+2
Like 2fe3a7bd, certain Dell machines (OptiPlex 990) state interrupts should work but effectively don't. Force polling. Reported-by: Alexander Perlis <aperlis@math.lsu.edu> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2014-06-27lzo: Upgrade to LZO 2.07H. Peter Anvin53-2126/+7217
Use version 2.07 of the LZO compression library. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-06-24Test for Watcom C presencesyslinux-6.03-pre18Lubomir Rintel1-0/+8
This adds checks for Watcom C DOS cross-compiler in a manner analogous to mingw compiler for Windows. The compiler is not commonly present in Linux distributions due to a non-free license. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2014-06-24utils/isohybrid.c: Enable promised options -u, -m, -bThomas Schmitt1-1/+1
This change enables the single-letter options -u, -m, -b as promised by the help text. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2014-06-24efi: Tag __syslinux_adv* with __exportMatt Fleming1-2/+2
commit 415d571 ("adv: Remove double defintion") introduced a regression for the EFI boot loader. The commit is correct, but should have tagged the __syslinux_adv_ptr and __syslinux_adv_size data objects in the EFI core as __export. This change is required because symbols in the EFI code are not global by default, and so, when ldlinux.{e32,e64} tries to bind to the adv symbols it fails. The following demonstrates the ELF symbol changes, Before: 659: 0000000000034f40 8 OBJECT LOCAL DEFAULT 16 __syslinux_adv_ptr After: 957: 0000000000036fe0 8 OBJECT GLOBAL DEFAULT 16 __syslinux_adv_ptr Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2014-06-23isohybrid: Function to write UTF-16LE stringsH. Peter Anvin1-9/+19
Rather than open-coding the content of UTF-16LE strings, just add a simple function to convert ASCII (only) strings to UTF-16LE. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-06-23utils/isohybrid.c: Introduce option --mbr and make isohybrid.c compilable ↵Thomas Schmitt1-2/+46
standalone Although isohybrid.c is supposed to be a companion of the local SYSLINUX installation, there may be situations where the file isolinux.bin and the matching MBR template do not stem directly from such an installation. This change adds an option --mbr, which allows to load an MBR template file. This may be an isohdp[fp]x*.bin MBR template from the local SYSLINUX installation, or the first 512 bytes of the isohybrid-capable ISO image from which isolinux.bin and the other ISOLINUX files are taken. If macro ISOHYBRID_C_STANDALONE is defined, then the hardcoded MBR templates are not accessible and isohdpfx.o is not needed at compile time. In this case, option --mbr becomes mandatory. I used this for testing my changes with Fedora-Live-Desktop-x86_64-20-1.iso. isohybrid.c is then compilable without further components of ISOLINUX by: cc -DISOHYBRID_C_STANDALONE -Wall -o isohybrid isohybrid.c -luuid Test run: cp Fedora-Live-Desktop-x86_64-20-1.iso \ Fedora-Live-Desktop-x86_64-20-1-rehybrid.iso valgrind ./isohybrid --uefi --mac \ --mbr Fedora-Live-Desktop-x86_64-20-1.mbr \ Fedora-Live-Desktop-x86_64-20-1-rehybrid.iso yields: ==13828== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 1) ... ==13828== LEAK SUMMARY: ==13828== definitely lost: 2,048 bytes in 1 blocks. (Not that valgrind would have detected the memcpy() abuse of patch 001. But at least i seem to have not introduced more obvious sins.) Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-06-23utils/isohybrid.c: Change all fseek(3) to fseeko(3)Thomas Schmitt1-10/+9
It seems unwise to offer future programmers fseek(3) calls for copy+paste. They are simply insufficient for large image files. This change switches all calls of fseek(3) to fseeko(3) and takes care that the offset value if of type off_t. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-06-23utils/isohybrid.c: Write GPT backup to the very end of the imageThomas Schmitt1-3/+3
The GPT backup header block should start 512 bytes before the end of the image file (resp. end of the disk device). This block and the backup GPT array were wrongly written 512 bytes too early. This change brings the backup GPT at its correct position. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-06-23utils/isohybrid.c: Correct end block address of first GPT partitionThomas Schmitt1-1/+1
The GPT partition 1 covers the whole ISO filesystem size. GPT specs demand that the partition end block number shall be the last valid block in the partition. isohybrid.c rather wrote the number of the first block after the partition end. This change reduces the number by 1. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-06-23utils/isohybrid.c: Correct blocking factor in APM partition block countsThomas Schmitt1-5/+5
The block counts in the APM partitions assumed 512 bytes per block, whereas the start block numbers assume 2048 as announced in the APM header. This change divides the affected block counts by 4 to correct the assumption. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-06-23utils/isohybrid.c: Encode GPT partition names as UTF-16LEThomas Schmitt1-3/+8
The worst sin of isohybrid.c was to compose GPT partition names by 8-bit characters and to memcpy() them as if they were 16 bit wide. GPT names are encoded as UTF-16LE. It is trivial to create this encoding from 7-bit ASCII. This change introduces two byte arrays with the desired UTF-16LE names which replace the string constants "ISOHybrid ISO" and "ISOHybrid". Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-06-19isohybrid: define _FILE_OFFSET_BITS in the file itselfH. Peter Anvin1-0/+1
On general principles, define _FILE_OFFSET_BITS in the file itself (even though it is also in the Makefile.) Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-06-19isohybrid: fix overflow on 32 bit systemKai Kang1-1/+1
When call isohybrid with option '-u', it overflows on a 32 bits host. It seeks to 512 bytes before the end of the image to install gpt header. If the size of image is larger than LONG_MAX, it overflows fseek() and cause error: isohybrid: image-x86-64-20140505110100.iso: seek error - 8: Invalid argument Replace fseek with fseeko to fix this issue. Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-06-16pxelinux-options: Fix data corruption bugsyslinux-6.03-pre17H. Peter Anvin1-3/+1
Fix bug where the data would invariably be incorrectly written. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-06-16pxe: Add support for embedded options in EFIsyslinux-6.03-pre16H. Peter Anvin2-23/+113
For EFI, rather than mucking with the PECOFF or ELF headers (we have both!) just use a fixed-size buffer embedded in the image with a large magic number that can be scanned for safely. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-06-16pxe: Re-add support for embedded DHCP optionssyslinux-6.03-pre15H. Peter Anvin4-3/+23
Fix the support for embedded DHCP options. Although we were diligently saving them away, we never actually parsed them. This fixes embedded options for BIOS only -- for EFI we need to modify the encoding scheme so that it can fit inside an EFI PECOFF image. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-06-10Revert "ldlinux: Allow a held shift key to override UI as well as DEFAULT"H. Peter Anvin1-1/+4
This reverts commit 7e7139788c8ac6ffbf474976ad4d1727e0677b9f. Requested by Ady <ady-sf@hotmail.com> who also requested the original patch: After some tests with MENU SHIFTKEY with different versions of Syslinux, I came to the conclusion that, at least for now, it would be better to undo commit 7e7139788c8ac6ffbf474976ad4d1727e0677b9f: "ldlinux: Allow a held shift key to override UI as well as DEFAULT" committed on Thu, 22 May 2014. Although the aforementioned commit makes the current 6.03 branch behave as version 4.xx, my tests show that the behavior is effectively inadequate and inconsistent. Although I had been previously nagging you in irc about maintaining backward compatibility of the "force-prompt" keys, I have to ask you to undo the aforementioned commit before the final release of 6.03 stable. The behavior of Syslinux 6.03 without this particular commit will slightly "break" with the prior "force-prompt" behavior as seen in 4.xx when using [vesa]menu.c32, but it will be more consistent and clean. Without this commit, the user can still avoid the automatic launch of the default label by the same means (the "escape" "shift" keys), which is the most important characteristic of MENU SHIFTKEY. Please consider this request before the release of 6.03 stable. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-06-10com32: Fixing lua's dependenciessyslinux-6.03-pre14Erwan Velu1-1/+2
Lua shall be one of the latest module to build as it requires some other components to be built before. Prior this patch, it was impossible to make a parallel build when "j" was greater than 26. This patch fix the ordering and allow a "make -j" of com32 directory.
2014-06-10memdump: Remove old obsolete COM16 binaryH. Peter Anvin33-3898/+2
memdump was a com16 binary. If still useful, it should be replaced with a com32 library using libupload, but it has largely been replaced by sysdump anyway. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-06-10sysdump: Remove README that was for memdump, not sysdumpH. Peter Anvin1-19/+0
Sysdump was forked from memdump, but the README was never fixed. It should be updated, but until then, delete it. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-06-10Make symbols defined in linker script HIDDENH. Peter Anvin2-164/+164
This makes symbols defined in com32.ld and syslinux.ld HIDDEN, to avoid collisions. Additional linker scripts should have this done, too. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-06-09adv: Remove double defintionH. Peter Anvin1-3/+1
__syslinux_adv_* symbols are now part of the core, so don't export them again elsewhere. This broke all uses of the ADV, including --once. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2014-06-02core/fs: Add support to Unix File system 1/2.syslinux-6.03-pre13Raphael S. Carvalho4-0/+944
It's already loading modules successfully, booting Linux, and both UFS version 1 and 2 seem to be working correctly. Signed-off-by: Raphael S. Carvalho <raphael.scarv@gmail.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2014-06-02installer: Add UFS1/2 support for Extlinux installerRaphael S. Carvalho4-10/+378
It's needed to enumerate both UFS1 and UFS2 as they have different magic numbers and super block offsets. Neither UFS1 nor UFS2 move files around, therefore, ldlinux.sys can be installed as a regular file. Signed-off-by: Raphael S. Carvalho <raphael.scarv@gmail.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2014-06-02ntfs: fix incorrect file->offset usage in ntfs_readdirAndy Alex1-6/+4
file->offset is used to store position in index root between ntfs_readdir calls. Previously, pointer to buffer was stored in this field. However this buffer is reallocated and read each ntfs_readdir call so the pointer may become incorrect. Now offset in index root rather than pointer is stored in this field. [ hpa: applied patch manually as it arrived whitespace-corrupted ] Signed-off-by: Andy Alex <andy at r-tt.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2014-05-26cache, btrfs: Provide a general cached read routineH. Peter Anvin3-34/+41
btrfs_read() was really just a function to read data linearly while using the metadata cache. Move it to cache.c and rename it cache_read() so other filesystems can make use of it as well. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-05-26btrfs: Remove static variablesH. Peter Anvin2-77/+100
Remove the use of static variables and replace them with per-instance allocations that can be found from the fs_info structure. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-05-26btrfs: Fix stack smash with node size > 4Ksyslinux-6.03-pre12H. Peter Anvin2-41/+62
Newer btrfs has a node size of more than 4K. Make sure we have a buffer big enough to hold a node -- instead of allocating it on the stack, allocate it at startup time. While changing this code, remove a completely unnecessary arbitrary 64-bit divide. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-05-21ldlinux: Allow a held shift key to override UI as well as DEFAULTH. Peter Anvin1-4/+1
For compatibility with 4.xx, make a held shift escape to override UI as well as DEFAULT. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-05-20btrfs: fix typo in definition of BTRFS_ADV_OFFSETH. Peter Anvin1-1/+2
Correct the macros used in BTRFS_ADV_OFFSET. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2014-05-20btrfs: Move ldlinux.sys to Boot Area BH. Peter Anvin2-6/+15
ldlinux.sys is frequently too big to fit into Boot Area A (64K). Per a recent ruling by Chris Mason, we have a 768K Boot Area B at offset 256K, so use that to store ldlinux.sys. In theory we could split it up and make it slightly larger, however, ldlinux.sys is loaded below the 640K mark so it has to be smaller than that size anyway. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2014-04-20Centralize shift_is_held(), make it work to force the command linesyslinux-6.03-pre11H. Peter Anvin4-7/+11
Holding down shift is supposed to force a command line unless noescape is provided; make it behave that way. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-04-20kbd: Use the extended keyboard state query for bios_shiftflags()H. Peter Anvin1-3/+18
Mixing extended and non-extended keyboard functions can be a bad idea. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-04-20kbd: Make getting the keyboard shift state a firmware methodH. Peter Anvin4-12/+24
Getting the keyboard shift state is a firmware method. It is unfortunately unclear if it is even possible on EFI. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-04-17bios: Use int 0x16, ah=0x02 to probe for shift flagssyslinux-6.03-pre10H. Peter Anvin2-5/+17
At least one USB keyboard BIOS has been reported to not properly handle the keyboard flags in memory. See if actually using INT 16h works better. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-04-17NTFS: Fragmented $MFT file was not handledAndy Alex1-100/+93
NTFS $MFT file may be fragmented by itself (and actually is in most cases). However, such a situation was not handled. This patch adds support for a fragmented $MFT file. Signed-off-by: Andy Alex <andy at r-tt.com> Fixed-by: Ady <ady-sf@hotmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-04-03core: Avoid initializing the cache more than onceRaphael S. Carvalho4-2/+7
Most of file system drivers initialize the cache themselves. The problem is that the same cache could be again initialized later, then invalidating the previous one. This patch fixes this. Problem found while auditing the code. Signed-off-by: Raphael S. Carvalho <raphael.scarv@gmail.com>
2014-03-13lua: Remove additional old cruft from sl_boot_linux()syslinux-6.03-pre9H. Peter Anvin1-4/+0
More obsolete cruft... Signed-off-by: H. Peter Anvin <hpa@zytor.com>