summaryrefslogtreecommitdiff
path: root/core/fs
Commit message (Collapse)AuthorAgeFilesLines
* iso9660: use generic_mangle_nameH. Peter Anvin2011-04-041-49/+1
| | | | | | | There is no longer any need to do special name-mangling for iso9660, and doing so, in fact, breaks the handling of paths starting with ../. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* vfat: Fix mangling of directory names starting with ..Rich Mahn2011-04-041-2/+4
| | | | | | We need to handle directory names starting with .. correctly. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* pxe: disable the "force INT 18h" hackH. Peter Anvin2011-04-041-6/+13
| | | | | | It seems to break as many machines as it fixes, so disable it for now. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* pxe: allow TFTP server IP to be empty when not using TFTPMichael Brown2011-03-281-3/+3
| | | | | Reported-by: Marcus Grando <Marcus.Grando@corp.terra.com.br> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* core/fs/pxe/pxe.c: remove variables set but not usedH. Peter Anvin2011-03-161-0/+1
| | | | | | gcc 4.6 warns on variables set but not used, so remove them. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core/fs/iso9660/iso9660.c: remove variables set but not usedH. Peter Anvin2011-03-161-1/+2
| | | | | | gcc 4.6 warns on variables set but not used, so remove them. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core/fs/fat/fat.c: remove variables set but not usedH. Peter Anvin2011-03-161-4/+2
| | | | | | gcc 4.6 warns on variables set but not used, so remove them. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* diskio: Support EDD 4 16-byte device pathsH. Peter Anvin2011-01-171-2/+2
| | | | | | | | EDD 4 has 16-byte device path information. Make the EDD buffer big enough to capture that. Note that the location of the device path checksum actually depends on the device path length information field! Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* diskio: add reminder that we need clear in the futureH. Peter Anvin2011-01-171-0/+3
| | | | | | | | | Currently, disk_init() can only be called once, and edd_params get statically initialized to zero. This will change once this function can be called more than once, and we depend on the pre-initialization to zero to avoid known BIOS bugs. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* core, pxe: Fix handling of unqualified DNS namesH. Peter Anvin2010-11-141-1/+1
| | | | | | | | Actually append the domain name to the end of an unqualified DNS name like we should have done all along. Reported-by: Gene Cumm <gene.cumm@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core: fix handling new directory "/" for CONFIG in ISOLINUX and EXTLINUXGene Cumm2010-09-232-0/+4
|
* pxe: add a "pxeretry" option to deal with 404's in web appssyslinux-4.03-pre2H. Peter Anvin2010-08-261-0/+14
| | | | | | | | For web downloads, sometimes a mirror site will not be fully synced. Add an option to retry the open a specific number of times before giving up. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* diskio: remove redundant register writeDon Hiatt2010-08-131-2/+0
| | | | | The disk number is set twice in diskio.c/edd_rdwr_sectors() this patch removes the redundant setting.
* core: define and use set_flags() helperH. Peter Anvin2010-07-262-7/+5
| | | | | | | Rather than opencoding the arithmetic flag mask, define an inline to make that happen properly. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* core: don't hang if no config file is foundH. Peter Anvin2010-07-251-1/+4
| | | | | | | | If we can't find a configuration file, we need to do something slightly more friendly than hanging. Reported-by: Sebastian Herbszt <herbszt@gmx.de> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* pxe: fix byte order of output from parse_dotquad()H. Peter Anvin2010-07-191-1/+1
| | | | | | | parse_dotquad() incorrectly returned output in host byte order. Reported-by: Alexander Wuerstlein <arw@arw.name> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* diskio: add a paranoia castH. Peter Anvin2010-07-171-1/+1
| | | | | | | Make sure we don't overflow the shift, even though that should never be possible. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* diskio: fix name for secpercyl field, remove unused type fieldH. Peter Anvin2010-07-171-4/+3
| | | | | | | | | | | Fix the name for the incorrectly named "t" (track) field; it is in fact the sectors/cylinder (secpercyl) field. Furthermore, remove the completely unused "type" field... right now the pointer to the rdwr_sectors field acts as a proxy, and if we need more complex stuff in the future it is probably better handled by pointing to an ops structure. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* diskio: remove locally coded ilog2()H. Peter Anvin2010-07-161-13/+1
| | | | | | Use the centrally coded ilog2() function. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* diskio: expand most fields; cache the number of total tracksH. Peter Anvin2010-07-161-1/+2
| | | | | | | | | Expand most fields in struct disk to 32 bits -- it makes the code smaller in general, and struct disk is not a common data element. Add a field for the number of tracks (number of heads*sectors). Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* diskio: move strict CHS start value check into chs_rdwr_sectors()H. Peter Anvin2010-07-161-9/+15
| | | | | | It really makes more sense in chs_rdwr_sectors()... Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* diskio: check early for an impossible LBA value for CHS requestsH. Peter Anvin2010-07-161-0/+3
| | | | | | | Make sure we don't end up trying to do a CHS request for a truly absurd value, that could possibly be misconverted. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* diskio: when falling back EDD->CHS make sure to get the offset rightH. Peter Anvin2010-07-161-1/+2
| | | | | | | | When we decide to go from EDD to CHS, make sure we convert from absolute back to a partition offset. The cylinder check should still be on the absolute value, however. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* diskio: remove redundant sector count capH. Peter Anvin2010-07-161-3/+0
| | | | | | | The sector count cap on CHS is automatically given as a result of the no-track-crossing rule. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* diskio: allow fallback from EDD to CHSH. Peter Anvin2010-07-161-39/+72
| | | | | | | At least one system has been found which require fallback from EDD to CHS, so actually make it doable. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* btrfs: print an error if finding compressed/encrypted dataH. Peter Anvin2010-07-052-1/+14
| | | | | | | | If we find compressed or encrypted data, print an error message instead of returning garbage. This is suboptimal, but at least handles the common subcase of an encrypted configuration file. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core: split loadconfig.c into two filesH. Peter Anvin2010-07-022-29/+41
| | | | | | | Split loadconfig.c into two files. In particular, isolinux needs search_config() but not generic_load_config(). Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* core: merge the configfile-searching code, isolinux generic namesH. Peter Anvin2010-07-022-42/+39
| | | | | | | | | | | | | | | | | | | | Merge the config file searching code between syslinux and isolinux, and make isolinux also recognize the generic names "syslinux" and "syslinux.cfg". Thus, isolinux now searches for configuration files in the following order: /boot/isolinux/isolinux.cfg /boot/isolinux/syslinux.cfg /isolinux/isolinux.cfg /isolinux/syslinux.cfg /boot/syslinux/isolinux.cfg /boot/syslinux/syslinux.cfg /syslinux/isolinux.cfg /syslinux/syslinux.cfg /isolinux.cfg /syslinux.cfg Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* core: always canonicalize the configuration file nameH. Peter Anvin2010-07-021-1/+4
| | | | | | | | | The FAT installers may not produce a canonical pathname in the CurrentDirName field on entry. Make sure that the core doesn't croak when that happens, and still produces an absolute pathname for the configuration file. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* pxelinux: new IPAPPEND 4 to generate a SYSUUID= option.syslinux-4.01-pre3H. Peter Anvin2010-07-013-23/+55
| | | | | | | Add a new IPAPPEND option to generate a SYSUUID= option with the in-system UUID. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core, diskio: reset controller between EDD retriesH. Peter Anvin2010-07-011-1/+13
| | | | | | | | | As documented in the old assembly code, reset the disk controller between retries when using EDD. We don't want to do that for CHS, since a reset shuts down the floppy motor, and we might be suffering a timeout. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* core, diskio: skip EDD/CHS detect for CD-ROMsH. Peter Anvin2010-07-011-53/+59
| | | | | | | | Skip EDD and CHS detection if we know it is a CD-ROM, because some CD-ROMs possibly report bad information, and/or screw up the stack, possibly permanently. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* core, diskio: move dprintfs to the intended locationH. Peter Anvin2010-07-011-4/+6
| | | | | | Move the dprintfs to the location that they were intended to use. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core, diskio: put the error code in dprintf and printable messagesH. Peter Anvin2010-07-011-2/+8
| | | | | | | When we print an error message to the screen, include the error number. Furthermore, dprintf it on retries. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core, diskio: add a few dprintf()'sH. Peter Anvin2010-06-291-7/+22
| | | | | | | Add a handful of dprintf's to make it easier to debug disk I/O failures. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* diskio: hard-code CD-ROM sectors to 2048 bytesH. Peter Anvin2010-06-281-1/+12
| | | | | | | | | | At least the ThinkPad T22 and T23 will incorrectly report a sector size of 512 bytes for El Torito CD-ROMs. Ignore the reported sector size for El Torito boots. Reported-by: Helmut Hullen <hullen@t-online.de> Tested-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* core, chdir: collapse slashes, avoid copy-to-selfsyslinux-4.00-pre64H. Peter Anvin2010-06-271-11/+48
| | | | | | | | | | | Collapse multiple slashes into one (this still doesn't resolve . and .. in the path, since that requires awareness of symlinks.) This code also avoids a copy-over-self bug by introducing a temporary buffer. Reported-by: Gene Cumm <gene.cumm@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* PM getcwd(); Fix COM32 getcwdGene Cumm2010-06-261-0/+13
| | | | | | | | | Implement getcwd() in the core; Fix COM32 getcwd() to use the new function. This resolves the previous comment about COM32 getcwd() not working by not using INT 22h AX=001Fh. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core, fs: eliminate recursion in put_inode()H. Peter Anvin2010-06-261-5/+4
| | | | | | | We don't actually need recursion in put_inode(), so replace recursion with a loop. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core, fs: handle .. resolution in the filesystem coreH. Peter Anvin2010-06-251-9/+30
| | | | | | | | | | | Some filesystems, including btrfs, don't have .. directory entries. We already handle . in the filesystem core, handle .. as well. This means keeping chains of parent inodes for all open inodes, at least for the duration of a path search; we might as well hang onto them. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* btrfs: initialize the block cache earlyH. Peter Anvin2010-06-251-44/+5
| | | | | | | | Initialize the block cache at the very start. The block size for btrfs is fixed, and so we can start by initializing the cache. That eliminates a whole bunch of unnecessary I/O as well as extra code. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* btrfs: do not read past the end of the diskH. Peter Anvin2010-06-251-0/+8
| | | | | | | | When looking for the current superblock, don't read past the end of the disk. This more or less assumes that the superblocks are reasonably consistent with regards to the total filesystem size. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core, diskio: make error messages a little more usefulH. Peter Anvin2010-06-251-1/+7
| | | | | | Be a bit more explicit about the particular errors we see. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* pxe: don't corrupt the length of an RRQ packet on retryH. Peter Anvin2010-06-251-1/+4
| | | | | | | | | | Due to double use of the variable "buf", we would end up corrupting the length, but not the contents, of an RRQ packet if we ended up having to re-send. Some TFTP servers ignored the extra garbage (including tftp-hpa), others would refuse to accept the RRQ, causing failures. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* pxe: fix the unload sequenceH. Peter Anvin2010-06-242-16/+24
| | | | | | | | For somewhat unclear reasons, the PXE unload sequence took the old PXE path (pre-2.00 API). Take the new sequence if available. Also improve the error message. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* pxe: fix ip_ok()H. Peter Anvin2010-06-242-8/+10
| | | | | | | Make it easier to read, but fix the address for the loopback network (127, not 255). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* fs: enforce filetypes in open_fileH. Peter Anvin2010-06-231-5/+13
| | | | | | Enforce that the file type in open_file is a plain file. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* opendir: enforce the file typeH. Peter Anvin2010-06-231-2/+9
| | | | | | Don't allow opendir() on a non-directory. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* pxe: set the file type in the inode structureH. Peter Anvin2010-06-231-0/+1
| | | | | | | All "files" on PXE are regular files (there is no official directory mechanism) and so, at least for now, it's all DT_REG. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* pxe: fix the timeout logic for RRQsyslinux-4.00-pre57H. Peter Anvin2010-06-221-28/+22
| | | | | | | Fix the timeout logic for RRQ, to avoid a spew of identical RRQ packets which at best will annoy the server. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>