summaryrefslogtreecommitdiff
path: root/libinstaller
Commit message (Collapse)AuthorAgeFilesLines
* libinstaller: introduce syslxrw libraryPaulo Alcantara2015-11-105-65/+106
| | | | | | | | 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>
* libinstaller: Explicit failure if path isn't writableErwan Velu2015-09-081-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.
* define _DEFAULT_SOURCE for glibc-2.20Chanho Park2014-09-292-0/+4
| | | | | | | | | | | | | _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>
* installer: Add UFS1/2 support for Extlinux installerRaphael S. Carvalho2014-06-021-1/+3
| | | | | | | | | | | 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>
* syslxint: fix compilation on non-x86 architecturesH. Peter Anvin2014-01-181-12/+10
| | | | | | | The access functions for architectures which need bytewise access had type problems. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* installer: fix 0 used as NULLH. Peter Anvin2014-01-171-1/+1
| | | | | | 0 used as NULL triggers a warning. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* installer: Add sparse address space annotations to the syslinux imageH. Peter Anvin2014-01-173-40/+87
| | | | | | | | Add sparse address space annotations for the syslinux boot image, to make it easier to catch errors that break the DOS installer build again. Use "make CC=cgcc" to run sparse. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* dos: We cannot use memset() for a far object, introduce memset_sl()H. Peter Anvin2014-01-162-1/+3
| | | | | | | | | | We started using memset() on the extents buffer in ldlinux.sys, which doesn't reside in the main segment, which worked on all the installer platforms except DOS. Fix DOS by introducing memset_sl() for this case. Reported-by: Ady <ady-sf@hotmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Merge tag 'syslinux-5.01' into firmwaresyslinux-6.00-pre4Matt Fleming2013-01-291-17/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Makefile NEWS com32/cmenu/Makefile com32/elflink/ldlinux/Makefile com32/gfxboot/Makefile com32/gpllib/Makefile com32/include/sys/module.h com32/lib/Makefile com32/lib/sys/module/elf_module.c com32/menu/Makefile com32/rosh/Makefile com32/samples/Makefile core/init.c mk/elf.mk Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * dos: obtain the executable pathname, cleanupsH. Peter Anvin2013-01-171-17/+0
| | | | | | | | | | | | | | | | | | | | | | DOS actually does provide the fully qualified pathname to the executable, which would be useful to make ldlinux.c32 data rather than live inside the executable itself -- it has gotten too large. Also, move some DOS internals -- inline functions only used inside the dos directory -- out of libinstaller. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* | Merge tag 'syslinux-5.00' into firmwaresyslinux-6.00-pre3Matt Fleming2012-12-071-2/+3
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Makefile com32/elflink/ldlinux/Makefile com32/lib/sys/module/elf_module.c core/cleanup.c core/comboot.inc core/conio.c core/fs/fs.c core/init.c core/mem/free.c core/mem/malloc.c core/timer.inc diag/geodsp/Makefile extlinux/main.c mk/embedded.mk modules/Makefile Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * Merge branch 'xfs-for-hpa' of git://zytor.com/users/pcacjr/syslinux into ↵Matt Fleming2012-11-271-2/+3
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | merge/elflink/xfs Pull XFS filesystem driver from Paulo Alcantara, * 'xfs-for-hpa' of git://zytor.com/users/pcacjr/syslinux: (60 commits) xfs: Fix the way we check di_mode of an inode xfs: Cleanup previous commit xfs: Add xfs_readlink() xfs: Cleanup and remove some trailing whitespaces xfs: Add XFS_DINODE_FMT_BTREE support in xfs_next_extent() xfs: Cleanup and remove some trailing whitespaces xfs: Rework xfs_dir2_get_right_blk() xfs: cleanup unused structure xfs: Remove some trailing whitespaces xfs: Add full B+tree search support in xfs_dir2_node_find_entry() xfs: Add xfs_fmt_btree_find_entry() xfs: Fix memory leak in xfs_dir2_node_find_entry() function xfs: Cleanup xfs_readdir_dir2_leaf() function xfs: Implement xfs_readdir_dir2_node() function EXTLINUX: Add sanity check for XFS filesystems xfs: Add xfs_fmt_local_readdir() function xfs: Add xfs_fmt_local_find_entry() function xfs: Move readdir functions to another source file xfs: Remove trailing whitespace in xfs_dir2_isleaf() function xfs: Move dir2 functions to another source file ... Conflicts: extlinux/main.c
| | * EXTLINUX: Initial XFS filesystem supportPaulo Alcantara2012-07-211-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | XFS filesystems are divided into a number of equally sized chunks called Allocation Groups (AGs). Each AG can almost be thought of as an individual filesystem that maintains its own's space usage. Each AG has the following structure: - A super block describing the overall filesystem info - Free space management - Inode allocation and tracking So, due to historical reasons (SGI IRIX's design of disk layouts), the first sector in the primary AG on XFS filesystems contains the superblock, which is a problem with bootloaders that rely on BIOSes (that load VBRs which are located in the first sector of the partition). This patch adds support to the EXTLINUX installer to be able to install Syslinux in an XFS partition, but with a limitation (temporarily) of relying on the filesystem block size being 4+ KiB, otherwise there won't be enough space to store the Syslinux boot sector in the blank area around the 2048 to 4096 bytes of the primary AG/superblock. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
* | | libinstaller: Fixup merge botchMatt Fleming2012-11-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The merge commit 0b26e59c8f5d didn't cause any conflicts in libinstaller/ so this bug went unnoticed, but we need to sync the merged libinstaller/Makefile with the changes in 1408e6ca7b38 ("Add per-firmware object directory support"). Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | | Merge tag 'syslinux-5.00-pre9' into for-hpa/elflink/firmwareMatt Fleming2012-11-054-9/+24
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | This merge also includes the Syslinux-4.06 release. Conflicts: Makefile com32/hdt/Makefile com32/modules/Makefile com32/samples/hello.c mtools/Makefile
| * | Merge branch 'master' into elflinkMatt Fleming2012-10-242-8/+17
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following conflict is a result of the fact comapi_chainboot was only stubbed out on the 'elflink' branch but was properly marked as obsolete in 'master'. Conflicts: core/comboot.inc
| | * | Packed definition: workaround for mingw + gcc 4.7H. Peter Anvin2012-10-221-6/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | __attribute__((packed)) does the wrong thing when in ms-struct mode; this breaks compiling on mingw-w64. Therefore force gcc struct mode when we use packed. This obsoletes checkin 7d9ee65 win: Add -mno-ms-bitfields Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| | * | make some functions static remove unused NADV defineFrediano Ziglio2012-10-091-2/+0
| | |/ | | | | | | | | | | | | | | | | | | Just some minor cleanup Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * | installers: Install ldlinux.c32 automaticallysyslinux-5.00-pre8Matt Fleming2012-09-192-1/+7
| | | | | | | | | | | | | | | | | | | | | Because ldlinux.c32 is required for Syslinux to function correctly, we should be installing it automatically much like ldlinux.sys. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | | Add per-firmware object directory supportMatt Fleming2012-10-162-10/+14
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we have multiple firmware backends it no longer makes sense to write object files to the same directory as their source. A better solution is to write the object files to a per-firmware directory under a top-level object directory. The top-level object directory can be specified on the command-line with the O= variable, e.g. make O=/tmp/obj. If no top-level object directory is specified an 'obj' directory is created in the top-level of the Syslinux source repository. All the existing make targets continue to work as before, however now they apply to all firmware backends, e.g. 'make installer' will build the BIOS, 32-bit EFI and 64-bit EFI installers and place them under $(OBJ)/bios, $(OBJ)/efi32 and $(OBJ)/efi64 respectively. Note unlike every other bit of Syslinux, the gpxe objects are still kept in the src directory, e.g. gpxe/src, since gpxe is only required by the BIOS backend. It is possible to specify a make target for a specific firmware or list of firmware with the following syntax, make [firmware[,firmware]] [target[,target]] To clean the object directory for just the BIOS firmware type, 'make bios clean' To build both the 32-bit and 64-bit EFI installers type, 'make efi32 efi64 installer' Since the Syslinux make infrastructure is now more complex a new file doc/building.txt has been created to explain how to build Syslinux. The top-level Makefile now exports some make variables for use in module Makefiles, - topdir - the top-level source directory of the Syslinux repository, e.g. /usr/src/syslinux - objdir - the top-level object directory for the firmware backend currently being built, e.g. /obj/syslinux/bios - SRC - the source directory in the Syslinux repository for the module currently being built, e.g. /usr/src/syslinux/com32/libupload - OBJ - the object directory for the module currently being built, e.g. /obj/syslinux/bios/com32/libupload Since we're rewriting the Makefile infrastructure anyway it seemed like a good idea to add parallel support. By writing subdirectories as prequisites for make targets the objects in those subdirectories can be built in parallel. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | Merge remote-tracking branch 'origin/master' into elflinksyslinux-5.00-pre4H. Peter Anvin2012-06-222-1/+9
|\ \ | |/
| * syslxopt: fix syntax errorssyslinux-4.06-pre7H. Peter Anvin2012-06-201-2/+2
| | | | | | | | | | | | Oops :) Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * extlinux: add --device option to override device detectH. Peter Anvin2012-06-202-1/+9
| | | | | | | | | | | | | | Add a --device option for scripts and expert users to override the device detection. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | Merge remote-tracking branch 'zytor/master' into merge/elflink/masterMatt Fleming2012-05-3110-55/+193
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | A lot of development has gone on in the 'master' branch since the last time we merged; new features, bug fixes, etc, etc. Conflicts: Makefile com32/Makefile com32/lib/Makefile com32/lib/syslinux/load_linux.c com32/modules/Makefile com32/modules/chain.c core/bootsect.inc core/init.inc version
| * libinstaller: Avoid using <linux/ext2_fs.h>syslinux-4.06-pre3H. Peter Anvin2012-03-263-11/+886
| | | | | | | | | | | | | | | | | | | | | | | | | | Don't use <linux/ext2_fs.h> if we can avoid it. The ioctl constants have been globalized and moved to <linux/fs.h>. Use a private copy of ext2_fs.h from e2fsprogs with the ioctl constants removed for the data structures. Do at least attempt backward compatibility for old kernel headers, but no real hope of proper operation there... Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * Add NTFS filesystem support to Linux and Windows installersPaulo Alcantara2011-09-0710-60/+184
| | | | | | | | Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
| * implement fat_check_sb_fields()Paulo Alcantara2011-07-051-0/+9
| | | | | | | | | | | | Sanity check for FAT volumes Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
| * Add "make strip" targetH. Peter Anvin2011-05-091-0/+2
| | | | | | | | | | | | | | | | Add a "make strip" target, to make doing the official build easier. We want the official build to have stripped binaries for size reasons, so do it right and make it an actual build target. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | libinstaller: Avoid using <linux/ext2_fs.h>H. Peter Anvin2012-04-033-11/+883
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't use <linux/ext2_fs.h> if we can avoid it. The ioctl constants have been globalized and moved to <linux/fs.h>. Use a private copy of ext2_fs.h from e2fsprogs with the ioctl constants removed for the data structures. Do at least attempt backward compatibility for old kernel headers, but no real hope of proper operation there... [ Doing this as a cherry-pick to unblock this branch ] Signed-off-by: H. Peter Anvin <hpa@zytor.com> Resolved Conflicts: libinstaller/linuxioctl.h
* | Merge remote-tracking branch 'zytor/master' into elflinkMatt Fleming2011-04-263-9/+26
|\ \ | |/ | | | | | | | | | | | | | | | | | | We need the recent Makefile filename changes to be merged into the elflink branch because it will make things simpler when converting all modules to ELF format. Conflicts: com32/Makefile com32/modules/Makefile version
| * Merge commit 'syslinux-4.04' into dynamic-sectordynamic-sectorH. Peter Anvin2011-04-182-0/+14
| |\
| | * libinstaller: implement syslinux_already_installedPaulo Alcantara2011-04-152-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | syslinux_already_installed function will be used in both extlinux and syslinux for checking if the boot sector has either the string "SYSLINUX" or "EXTLINUX" in the OEMID field. Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
| * | installer: Update and correct generate_extents()H. Peter Anvin2011-04-051-9/+12
| |/ | | | | | | | | | | | | 1. Make sure extents are strictly less than 64K in size 2. Make sure extents do not cross 64K boundaries Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* | Merge remote-tracking branch 'zytor/master' into elflink-mergeMatt Fleming2011-04-043-6/+7
|\ \ | |/ | | | | | | | | | | Conflicts: com32/lib/Makefile com32/lib/sys/open.c version
| * libinstaller/fat.c: remove variables set but not usedH. Peter Anvin2011-03-161-3/+0
| | | | | | | | | | | | gcc 4.6 warns on variables set but not used, so remove them. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * disk: put a magic at the end of the boot sectorH. Peter Anvin2011-01-251-2/+6
| | | | | | | | | | | | | | | | | | Put a magic signature at the end of the boot sector, and a backpointer to the code that contains the pointer to the main code extent. This is useful for integrity-checking tools, and could help the installer in the future. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| * Fix missing option -s in libinstallersyslinux-4.03-pre3Arwin Vosselman2010-09-091-1/+1
| | | | | | | | | | | | | | | | In 'libinstaller/syslxopt.c' on line 71 the "s" (undercast) is missing in: const char short_options[] = "t:fid:UuzS:H:rvho:OM:ma"; Adding the 's' there seems to solve our problem.
* | Merge branch 'master' into elflink-mergeH. Peter Anvin2010-08-125-17/+229
|\ \ | |/ | | | | | | | | | | | | Resolved Conflicts: core/diskfs.inc core/mem/free.c Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * syslxopt: remove lengthy warning messageH. Peter Anvin2010-07-301-10/+0
| | | | | | | | | | | | | | Remove a lengthy warning message which cause the actual command reference to overflow a 24-line screen. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * syslxopt: fix fatal warningsH. Peter Anvin2010-07-301-9/+12
| | | | | | | | | | | | | | | | | | | | | | Fix fatal warnings in syslxopt.c partly due to legal but non-idiomatic use of switch(). Since the only purpose was to conditionalize single output statements, just do it explicitly. In addition, since they are conditional messages, there is no need to explain when they apply. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * libinstaller/syslxopt.c: remove unneeded usage text from certain variants.Gene Cumm2010-07-271-3/+10
| | | | | | | | Gert Hulselmans noticed this.
| * dos: Use libinstaller option parserShao Miller2010-07-191-2/+3
| | | | | | | | | | | | | | We will produce an error message if a user attempts to use an option we don't implement. Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
| * dos, win32: use our own getopt_long() for bothH. Peter Anvin2010-07-192-0/+177
| | | | | | | | | | | | | | | | Use our own version of getopt_long() for both the DOS and Win32 installers. Currently, on MinGW, getopt_long() is a static library, but that could change in some installations. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| * dos: fix non-executable files which were +xH. Peter Anvin2010-07-193-0/+0
| | | | | | | | | | | | Don't make non-executable files +x... Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| * dos: add memcpy_from_sl() and use it where appropriateH. Peter Anvin2010-07-191-0/+2
| | | | | | | | | | | | | | Add memcpy_from_sl() and use it to handle pointers into the payload section. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| * dos: change the link procedure to use negative pointers below DGROUPH. Peter Anvin2010-07-191-3/+1
| | | | | | | | | | | | | | | | | | Use negative pointer values below DGROUP, i.e. for the .payload segment. This makes it a lot easier to figure out if we are dealing with pointers that shouldn't come from where they do, since the DGROUP and .payload segments no longer overlap, and in fact are congruent. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| * dos: Work-in-progress 2Shao Miller2010-07-101-0/+0
| |
| * dos: Work-in-progressShao Miller2010-07-031-3/+5
| |
| * win32: Use libinstaller option parserShao Miller2010-07-032-1/+15
| | | | | | | | | | | | | | We will produce an error message if a user attempts to use an option we don't implement. Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
| * libinstaller: Add --mbr, --active, and --force optionsShao Miller2010-07-032-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to consolidate the installer option-parsing system, we add the --mbr (-m), --active (-a), and --force (-f) options from the DOS, Win32, and mtools installers to libinstaller. Since the -m and -a options are not currently valid for the Linux 'syslinux' and 'extlinux' installers, we add error messages to both of these. The -f option is allowed but does nothing for them. Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>