summaryrefslogtreecommitdiff
path: root/core/fs
Commit message (Collapse)AuthorAgeFilesLines
* unload_pxe(): fix string in dprintf()H. Peter Anvin2016-06-161-1/+1
| | | | | | Fix a dprintf() message so it matches reality. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* pxe.c: fix stray line-end garbageH. Peter Anvin2016-04-061-1/+1
| | | | | | The previous commit had some unfortunate line-end garbage; remove. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* libupload: use url_set_ip()H. Peter Anvin2016-04-062-4/+17
| | | | | | | | We already have a core function for setting the IP address of an URL object based on network lookup or the server default. Export and use it instead of open-coding the equivalent logic in upload_tftp.c. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* pxe_dns: remove obsolete pxe_dns.c wrapperH. Peter Anvin2016-04-062-12/+2
| | | | | | | | | We used to need a wrapper around the core function dns_resolv() to implement pxe_dns(), because the former function required its argument to live in low memory. This is no longer the case and hasn't been for a while, so remove this unnecessary level of indirection. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* libupload: don't error out because the tftp functions are unavailableH. Peter Anvin2016-04-061-1/+3
| | | | | | | | Provide weak stubs for the case where the tftp functions aren't available. This prevents link failures for the case of running on top of non-network cores. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* getfssec: update comment explaining next_extent() semanticsH. Peter Anvin2016-02-171-3/+8
| | | | | | | Update comments which explains next_extent() semantics to be slightly clearer, and also correct the statement that next_extent can be NULL. Signed-off-by: H. Peter Anvin <hpa@linux.intel.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.
* 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>
* 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>
* core: readd gPXE/iPXE support for HTTP on pxelinux.0Gene Cumm2015-09-272-81/+7
| | | | | | | | | | | 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>
* 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.
* libupload: Reworking tftp support to use core functionsErwan Velu2015-09-043-1/+182
| | | | | | | | | | | | | | | 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.
* tftp: Report server IP address on debug messageErwan Velu2015-09-041-1/+10
| | | | | When debugging, it is very useful to get the ip adress of the server that reponsded to that packet.
* core/pxe/dhcp_option: Filter options based on pkt_typeGene Cumm2015-06-251-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>
* core/pxe: Don't prevent serverip overrideGene Cumm2015-06-251-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>
* core/pxe: extend parse_dhcp() for packet typeGene Cumm2015-06-203-6/+8
| | | | | | | 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>
* core/fs/pxe/dhcp_option: comment spellingGene Cumm2015-06-091-1/+1
| | | | Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* pxe: fix truncation warningJonathan Boeing2015-05-031-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>
* fix a few typosJonathan Boeing2015-05-031-1/+1
| | | | Signed-off-by: Jonathan Boeing <jonathan.n.boeing@gmail.com>
* btrfs: Suffix 64b macroMartinS2015-01-051-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>
* PXE ISR: Force polling on select hardware #3 WORKAROUNDGene Cumm2014-08-021-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>
* PXE ISR: Force polling on select hardware WORKAROUNDGene Cumm2014-07-131-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>
* pxe: Re-add support for embedded DHCP optionssyslinux-6.03-pre15H. Peter Anvin2014-06-163-3/+22
| | | | | | | | | | 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>
* core/fs: Add support to Unix File system 1/2.syslinux-6.03-pre13Raphael S. Carvalho2014-06-023-0/+942
| | | | | | | | 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>
* ntfs: fix incorrect file->offset usage in ntfs_readdirAndy Alex2014-06-021-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>
* cache, btrfs: Provide a general cached read routineH. Peter Anvin2014-05-262-34/+40
| | | | | | | | 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>
* btrfs: Remove static variablesH. Peter Anvin2014-05-262-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>
* btrfs: Fix stack smash with node size > 4Ksyslinux-6.03-pre12H. Peter Anvin2014-05-262-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>
* NTFS: Fragmented $MFT file was not handledAndy Alex2014-04-171-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>
* core: Avoid initializing the cache more than onceRaphael S. Carvalho2014-04-033-2/+6
| | | | | | | | | | 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>
* ntfs: Make byte_shift a constH. Peter Anvin2014-03-131-1/+1
| | | | | | byte_shift is a constant, label it as such. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* NTFS: Incorrect parsing of file runsAndy Alex2014-03-131-6/+2
| | | | | | | Length of some extents of NTFS files is parsed in wrong way. Signed-off-by: Andy Alex <andy at r-tt.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* FSUUID for ext2 filesystemSerj Kalichev2014-03-132-1/+40
| | | | | | | | | The ext2 filesystem supports volume UUID now. The FSUUID variable can be set to kernel command line. Patch is based on FSUUID for FAT patch. Signed-off-by: Serj Kalichev <serj.kalichev@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Add filesystem UUID to SYSAPPEND for FATSerj Kalichev2014-03-139-1/+52
| | | | | | | | | | Filesystem UUID shows the partition we boot kernel from. The kernel parameter has format like FSUUID=DA1A-0B2E. The SYSAPPEND bit is 0x40000. Now the FAT only supports FSUUID. The patch is based on 67aaaeeb228. Signed-off-by: Serj Kalichev <serj.kalichev@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core, bios: Incorrect detection of EDD in /core/fs/diskio_bios.csyslinux-6.03-pre3Andy Alex2014-02-261-0/+2
| | | | | | | DL register is not set to drive number when detecting EDD for drive, so detection may fail. Signed-off-by: Andy Alex <andy at r-tt.com>
* pxe: Export the initial stack and PXE(NV) structure, fix pxechnH. Peter Anvin2014-02-131-3/+16
| | | | | | | | | | Export the initial stack and PXE(NV) structure pointers properly, even for users which need seg:offs. Use this in pxechn.c rather than the already-removed INT 22h AX=000Ah call. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com> Cc: Gene Cumm <gene.cumm@gmail.com>
* Merge remote-tracking branch 'origin/rockridge'H. Peter Anvin2014-02-124-4/+655
|\ | | | | | | | | | | | | Resolved Conflicts: com32/include/byteswap.h Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * iso9660.c did not copy terminating 0 of Rock Ridge namerockridgeThomas Schmitt2013-04-251-1/+1
| | | | | | | | | | I noticed that the trailing 0-byte is not copied to the result of iso_readdir(). The function iso_convert_name() does append a trailing 0.
| * iso9660: use generic get_le32() accessor in SUSP/Rock Ridge codeH. Peter Anvin2013-04-021-12/+7
| | | | | | | | | | | | | | Use the new get_le32() accessor in the SUSP/Rock Ridge code. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Cc: Thomas Schmitt <scdbackup@gmx.net>
| * iso9660: read littleendian ISO 9660/SUSP numbersH. Peter Anvin2013-04-021-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | Attached is a patch which switches susp_rr.c from reading the big-endian ISO 9660 and SUSP numbers to reading the little-endian ones. Tested within libisofs on my collection of ISO images. [ hpa: more mastering programs are known which botch the bigendian information than the littleendian information, so most systems only read the littleendian info regardless of the native byte order. ]
| * iso9660: Avoid arbitrarily large malloc()sThomas Schmitt2013-04-021-0/+4
| | | | | | | | | | | | | | | | | | | | After explaining the slightly wasteful usage of malloc()/memcpy() with multi-block CE entries, i noticed that i did not install a safety cap on the malloc size. I could not challenge this in practice but only by gdb manipulation. My most CE-happy test image has 3 occasions of multi-block CE. All three only span over 2 blocks each.
| * iso9660: Add support for Rock Ridge filenamesThomas Schmitt2013-03-314-4/+659
| | | | | | | | | | | | | | | | | | Add support for parsing SUSP and RRIP records, and support for Rock Ridge filename extensions, thus avoiding the filename limitations (length and character set) of plain iso9660. This will be a part of using UTF-8 for filenames and console. [ hpa: manually rebased to the elflink branch ]
* | com32sys_t inreg shall be zeroified prior intcallErwan Velu2014-01-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | As per commit f775e740a3a817a4ff5ba26bea99dbfd735456b3, inreg parameters of intcall() shall be zeroified. Having unclean inreg could trigger bad behaviors on some hosts. This patch is about adding memset() calls prior any intcall() : - some intcall didn't had any memset at all - some successive intcall() calls didn't memset inreg in between calls
* | Merge remote-tracking branch 'origin/elflink' into firmwareH. Peter Anvin2013-12-111-35/+11
|\ \ | | | | | | | | | Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| * | pxe, efi: Bad read of file size over TFTP on EFI64Celelibi2013-12-111-35/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A fancy pointers logic has been replaced with a plain old if / else branches. It was assigning only half of a 64 bits integer which is then assigned to a size_t. Thus leading to a bug on platform where size_t is 64 bits. Resolves bug #26 Signed-off-by: Celelibi <celelibi@gmail.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>