aboutsummaryrefslogtreecommitdiffstats
path: root/com32/libutil
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'syslinux-5.01' into firmwaresyslinux-6.00-pre4Matt Fleming2013-01-291-3/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Rename libutil_com.c32 to libutil.c32H. Peter Anvin2013-01-171-3/+2
| | | | | | | | | | | | Conform to 8.3 filenames for essential files. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| * Always strip all the modulesH. Peter Anvin2013-01-171-2/+3
| | | | | | | | | | | | | | | | Always strip the modules; they are too big unstripped. Specifically, we generate unstripped *.elf files, and then convert them to stripped *.c32 files. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* | Merge branch 'elflink' into firmwareMatt Fleming2013-01-081-1/+1
|\| | | | | | | | | | | | | | | | | | | | | Merge the changes since Syslinux-5.00. The main reason behind this merge is to pull in the following bug fix, commit 90b5864fc793 ("core/kaboom.c: Export __bad_SEG()"), which allows us to turn on debugging in mk/devel.mk without ldlinux.c32 failing to load. Conflicts: com32/elflink/ldlinux/Makefile version
| * elflink: set the sonames of shared librariesH. Peter Anvin2013-01-031-1/+1
| | | | | | | | | | Set the sonames of shared libraries to the filename, so we don't end up with full pathnames embedded in the files.
* | Merge tag 'syslinux-5.00-pre10' into for-hpa/elflink/firmwareMatt Fleming2012-11-141-0/+19
|\| | | | | | | | | | | | | | | | | | | | | Pull in the latest prerelease that includes some bug fixes for ldlinux and a realloc() bug in core/. Conflicts: com32/cmenu/Makefile com32/elflink/ldlinux/Makefile com32/lib/Makefile core/pxelinux.asm
| * ldlinux: get_key() requires raw access to user inputMatt Fleming2012-11-021-0/+19
| | | | | | | | | | | | | | | | | | commit 4503e6260c0 ("ldlinux: Use stdcon instead of rawcon for the console") broke get_key() because it was no longer possible to read raw data from stdin. Provide a new function raw_read() that will return user input a character at a time. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | Add per-firmware object directory supportMatt Fleming2012-10-161-2/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix Makefile install targetsMatt Fleming2012-07-041-1/+1
| | | | | | | | | | | | | | | | | | | | Some Makefiles were still referring to libutil_com.a, even though we stopped producing that file with commit 74518b8b691c ("elflink: Make ELF the default object format"). Delete all references to avoid the following install error, install: cannot stat `libutil_com.a': No such file or directory Remove the install target from com32/elflink as we no longer build any of the test modules, and so don't need to install them. Also, we need to add ldlinux.c32 to the list of modules that *must* be installed for all targets, since it is required for Syslinux to function correctly. Reported-by: Dag Wieers <dag@wieers.com> Reported-by: Michael D. Setzer II <mikes@kuentos.guam.net> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* ldlinux: Accept commands from the serial consoleMatt Fleming2011-12-021-0/+3
| | | | | | | | To mimic the old (pre-elflink) command-line interface behaviour let's use getchar() instead of reading from stdin. This way, if the user types a command on the serial console it will actually be executed. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* elflink: ldlinux should not have any dependenciesMatt Fleming2011-04-262-173/+1
| | | | | | | | | | | | | | | | | | | | | | | ldlinux currently requires the get_key() symbol, which means it has a dependency on libutil_com.c32. ldlinux.c32 really should be a standalone module so let's move get_key.c into ldlinux/. However, moving get_key.c creates a new problem - native linux applications such as com32/samples/keytest.c require the get_key() symbol which is currently exported by libutil_lnx.a. To fix this, we create a new native linux library that exports any required symbols from ldlinux. With this change we need to update com32/Makefile so that we build com32/elfink/ldlinux before com32/samples, and seeing as ldlinux now has no dependencies, we may as well move it to the front of $SUBDIRS. Also, update elf_gen_dep.sh to skip ldlinux.c32 and not search for dependencies for any of its unresolved symbols. This way, if anyone inadvertently introduces a dependency that cannot be resolved by the core, ldlinux.c32 will fail to load at runtime (which guarantees that the newly introduced dependency won't go unnoticed). Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
* elflink: Make ELF the default object formatMatt Fleming2011-04-262-7/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | com32/elflink/modules was originally created to house ELF modules and keep them separate from the COM32 modules as the elflink branch was being developed. However, this has inadvertently created a maintenance nightmare because code was copied from elsewhere in the tree into com32/elflink/modules, resulting in duplication. Bug fixes have been going into the original code but have not been merged onto the elflink branch, leaving the duplicate code in com32/elflink/modules buggy. So let's delete this directory. There really is no reason to keep ELF and COM32 modules separate because there's no reason to need both COM32 and ELF modules to coexist. ELF is a far superior object file format and all modules are not emitted as ELF objects. Now that we're outputting ELF modules we can use dynamic memory instead of the cs_bounce bounce buffer. This commit requires a certain amount of shuffling for some files. quicksort.c isn't a module and belongs as part of the util library. cli.h belongs in com32/include so that other modules can make use of the cli code in ldlinux.c32. All libraries are now ELF shared libraries which are only loaded to fixup unresolved symbols for executable modules and renamed from *.a to *.c32. This reduces the runtime memory footprint because libraries are only loaded when needed and because every executable no longer gets its own copy of code/data (as it would if linking with a static library). Also, remove MINLIBOBJS from libcom32.c32 because it is already part of libcom32min.a and we don't want to have any duplicate symbols between the core (which links with libcom32min.a) and libcom32.c32. Welcome to the New World Order of ELF modules! Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
* Merge remote-tracking branch 'mfleming/for-hpa/makefile-cleanup'H. Peter Anvin2011-04-261-1/+2
|\ | | | | | | | | | | | | | | Resolved Conflicts: com32/hdt/Makefile com32/sysdump/Makefile Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * Makefile: Move Makefile fragments into mk/Matt Fleming2011-04-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the MCONFIG files into a mk/ directory and give them more descriptive names. This is purely a cosmetic change to make the 'include' directives a bit more coherent by making it obvious exactly which MCONFIG file we're including. For example, in com32/lua/src/Makefile we exchange the line, include ../../MCONFIG for the much more comprehensible, include $(MAKEDIR)/com32.mk Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
* | keyname: better handling of named control charactersH. Peter Anvin2011-04-111-4/+9
| | | | | | | | | | | | | | Named control character (Tab, Enter, Backspace etc.) should use those names rather than caret sequences. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* | menu: Add "menu hiddenkey" to make terminating menu hidden a commandH. Peter Anvin2011-04-113-1/+139
|/ | | | | | | Use "menu hiddenkey" together with "menu hidden" for a one-keystroke action. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* sha256/512: fix signedness errorsH. Peter Anvin2010-05-122-11/+11
| | | | | | Fix signedness errors as part of -Werror cleanup. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* get_key.c: fix signedness errorH. Peter Anvin2010-05-121-1/+1
| | | | | | Fix signedness error, part of -Werror cleanup. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* Run Nindent on com32/libutil/unbase64.cH. Peter Anvin2009-05-291-30/+29
| | | | | | | | | Automatically reformat com32/libutil/unbase64.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Run Nindent on com32/libutil/sha512crypt.cH. Peter Anvin2009-05-291-611/+566
| | | | | | | | | Automatically reformat com32/libutil/sha512crypt.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Run Nindent on com32/libutil/sha256crypt.cH. Peter Anvin2009-05-291-537/+492
| | | | | | | | | Automatically reformat com32/libutil/sha256crypt.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Run Nindent on com32/libutil/sha1hash.cH. Peter Anvin2009-05-291-116/+172
| | | | | | | | | Automatically reformat com32/libutil/sha1hash.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Run Nindent on com32/libutil/md5.cH. Peter Anvin2009-05-291-143/+136
| | | | | | | | | Automatically reformat com32/libutil/md5.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Run Nindent on com32/libutil/include/xcrypt.hH. Peter Anvin2009-05-291-2/+2
| | | | | | | | | Automatically reformat com32/libutil/include/xcrypt.h using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Run Nindent on com32/libutil/include/sha1.hH. Peter Anvin2009-05-291-4/+4
| | | | | | | | | Automatically reformat com32/libutil/include/sha1.h using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Run Nindent on com32/libutil/include/md5.hH. Peter Anvin2009-05-291-4/+4
| | | | | | | | | Automatically reformat com32/libutil/include/md5.h using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Run Nindent on com32/libutil/include/base64.hH. Peter Anvin2009-05-291-2/+2
| | | | | | | | | Automatically reformat com32/libutil/include/base64.h using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Run Nindent on com32/libutil/get_key.cH. Peter Anvin2009-05-291-112/+113
| | | | | | | | | Automatically reformat com32/libutil/get_key.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Run Nindent on com32/libutil/crypt-md5.cH. Peter Anvin2009-05-291-125/+122
| | | | | | | | | Automatically reformat com32/libutil/crypt-md5.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Run Nindent on com32/libutil/base64.cH. Peter Anvin2009-05-291-65/+66
| | | | | | | | | Automatically reformat com32/libutil/base64.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Run Nindent on com32/libutil/ansiraw.cH. Peter Anvin2009-05-291-22/+21
| | | | | | | | | Automatically reformat com32/libutil/ansiraw.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Run Nindent on com32/libutil/ansiline.cH. Peter Anvin2009-05-291-20/+19
| | | | | | | | | Automatically reformat com32/libutil/ansiline.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Don't set the autocr flag on the serial console; clean up crapsyslinux-3.81-pre12H. Peter Anvin2009-05-232-18/+6
| | | | | | | | | | | | | libutil would set the autocr flag on the serial console, which really never was any point -- we already do \n -> \r\n conversion explicitly in the serial code. This was always very annoying to deal with if the menu was interrupted. Furthermore, drop completely unnecessary initialization/deinitialization routines that completely duplicated other code. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* com32/libutil/Makefile: Duplicate spotless targetGene Cumm2009-02-281-2/+0
| | | | | | | Fix duplicate spotless target in com32/libutil/Makefile. Signed-off-by: Gene Cumm <gene.cumm@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* COM32 libutil: Fix error in flags in console_ansi_std(void)Gene Cumm2009-02-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ICANON and ECHO were applied to the control flags not local flags. If ICANON or ECHO were applied to a serial port on Linux on the x86 architecture, this would change the serial ports baud rate. From my /usr/include/bits/termios.h (select in-order lines): /* c_cflag bit meaning */ #define B150 0000005 #define B300 0000007 #define B9600 0000015 #define B38400 0000017 /* c_lflag bits */ #define ICANON 0000002 #define ECHO 0000010 The different baud rates are defined here. If someone set the baud rate to 9600 and set ICANON on c_cflag, it should change the baud rate to 38400, dropping communication. Another example is if someone set the baud rate to 150 the set ICANON and ECHO on c_cflag, it should change the baud to 38400. If I am interpreting the rest of the file correctly, a bitmask covering all of the bits used in c_cflag for the baud rate is 0010017. Signed-off-by: Gene Cumm <gene.cumm@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Fix "make clean" confusionsyslinux-3.72H. Peter Anvin2008-09-251-1/+4
| | | | | | | | "make clean" must NOT remove stuff that "make installer" should not rebuild. This is a somewhat unfortunate choice of naming, but that's the way it is. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Major Makefile cleanups; gcc 4.3.0 compatiblityH. Peter Anvin2008-08-201-62/+3
| | | | | Cleanup and centralize the Makefile system even more. Fix a gcc 4.3 incompatibility in memdisk (definition of strlen).
* com32: compile with -std=gnu99H. Peter Anvin2008-08-121-2/+4
| | | | | | | Compile with -std=gnu99, this allows us to define initializers inside for() loops, which makes certain kinds of ugly macros easier to write. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Centralize configurables; better "make install" etcH. Peter Anvin2008-05-291-1/+2
| | | | | | | Begin the process of centralizing configurables. Improve "make install" and "make netinstall"; add "make extbootinstall".
* Move files out of root into core, dos, and utilsH. Peter Anvin2008-05-291-1/+1
| | | | | | | | Move source files out of the root directory; the root is a mess and has become virtually unmaintainable. The Syslinux core now lives in core/; the Linux and generic utilities has moved into utils/, and copybs.com has moved into dos/; it had to go somewhere, and it seemed as good a place as any.
* Fixed the various Makefiles so that SYSLINUX compiles on platforms with GCC ↵Stefan Bucur2008-05-121-1/+1
| | | | -fstack-protector flag enabled by default.
* Use $(CC) in gcc_ok macro, not plain gccH. Peter Anvin2008-03-051-1/+1
| | | | | Use $(CC) in gcc_ok macro, not plain gcc. This seems to work, iff the gcc_ok macro is declared with =, not :=
* Clean up .*.d files for "make tidy" in libutilH. Peter Anvin2008-03-031-1/+1
|
* Prevent inclusion of system include files when inappropriateH. Peter Anvin2008-03-033-3/+15
| | | | | Use "-nostdinc -iwithprefix include" to prevent the inclusion of system header files, but still permitting *compiler* header files.
* Whitespace cleanup...syslinux-3.62-pre11H. Peter Anvin2008-02-191-1/+0
|
* com32/*: move _GNU_SOURCE definitions into MakefilesH. Peter Anvin2008-02-101-1/+1
| | | | | We need _GNU_SOURCE when compiling for Linux in enough places. Just move it to the LNXCFLAGS definition in the Makefiles.
* libutil: add header file <xcrypt.h> for extended crypt routinesH. Peter Anvin2008-02-103-0/+12
| | | | | Add a common header file, xcrypt.h, for the various extended crypt routines (md5, sha256, sha512).
* menu: clean up and fix MD5 password codeH. Peter Anvin2008-01-282-53/+61
| | | | | | MD5 password code would append the encrypted password to a previous password, with the result that it would never match after picking a wrong password. Fix.
* Update copyright yearH. Peter Anvin2008-01-1010-10/+10
|
* Add sha256crypt and sha512crypt; not yet enabledH. Peter Anvin2007-11-093-1/+1512
| | | | | | Add support for sha256crypt and sha512crypt to the library. Not yet included in the menu system, need to decide if it's worth 10K or if the code can be realistically compacted.