| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Fix bug where the data would invariably be incorrectly written.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
|
| |
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>
|
|\ |
|
| |
| |
| |
| | |
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|\ \
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This merge also includes the Syslinux-4.06 release.
Conflicts:
Makefile
com32/hdt/Makefile
com32/modules/Makefile
com32/samples/hello.c
mtools/Makefile
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Make isohybrid.c compile on gcc 4.4 32 bit instead of producing the
following error,
isohybrid.c: In function ‘lendian_64’:
isohybrid.c:437: error: integer constant is too large for ‘long’ type
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Michal Soltys <soltys@ziu.info>
Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
The library link order was wrong.
This patch was picked from Ubuntu.
Reported-and-tested-by: Tim Fletcher <tim@night-shade.org.uk>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Various EFI systems insist that there be no active flag in the pMBR in
order to parse the GPT. The only way around this is to also generate a
valid MBR - the firmware will then pick that up and use the system
partition provided there. In order to deal with other EFI "sanity" checks,
the partition type for the non-EFI partitions is set to 0 to skip the
firmware bailing because of overlapping partitions.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
EFI systems typically don't support booting off ISO 9660 filesystems,
even if written to USB sticks. This patch adds support for generating a
GPT that covers the stick as well, with an additional partition entry
pointing purely at the secondary El Torito image. When burned to CD the
secondary El Torito will be used as an EFI boot image, and when written
to a USB stick the GPT partition will be found and may be booted from.
However, some earlier EFI Macs don't support booting from El Torito
images via EFI. To cater for them this also supports generating an Apple
partition table, allowing a third El Torito image in HFS+ format to be
made available to the firmware. This requires padding the MBR images
slightly in order to leave space for the Apple header, but should have
no functional impact.
Sadly, this breaks the workaround for Acer BIOSes (magic xor
instruction) when Mac support is enabled via -m... not much that can
be done about that.
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
|
|
|
| |
Allow hex/octal arguments in the C version of isohybrid, since they
were accepted by the Perl version.
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
Remove -s for host binaries; current practice is to let the distro
packaging systems do that themselves. For the official binaries, we
should probably strip them, but via an external tool.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|\
| |
| |
| |
| |
| |
| |
| | |
Resolved Conflicts:
com32/hdt/Makefile
com32/sysdump/Makefile
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
|/
|
|
|
|
|
| |
defined() on an array is considered obsolete; instead check for a
nonzero number of elements with scalar().
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
|
|
|
| |
klibc doesn't have sysconf(), because it involves a hideously
inefficient multiplex. Thus, if _SC_PAGESIZE is not defined, invoke
getpagesize(). Call the routine get_page_size() so it doesn't
conflict on a platform which has both sysconf(_SC_PAGESIZE) and
getpagesize().
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
|
|
|
|
|
| |
Pad the image via ftruncate instead of seeking to the end (which was
done incorrectly).
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
| |
Fix a couple of _FORTIFY_SOURCE failures which are nuisance warnings,
but fortunately not too hard to just plain avoid.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
| |
Remove accidentally checked in debugging printf.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
|
|
| |
Sometimes FBM is below the reserved memory limit, which means memory
that is available to protected-mode operating systems only and which
will be claimed by the kernel and therefore be unmappable. Read
/proc/iomem to make sure the memory range is safe to map.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
| |
Add a sector_shift field to the MDI rather than assuming 512-byte
sectors. Fix memdiskfind to report size in bytes, not in sectors.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
|
|
|
|
| |
Fix another printf type mismatch in the C version of isohybrid.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
| |
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
|
|
|
|
|
| |
A trivial Linux utility to search for mBFT and output its parameters
in a form which can be used as input to the phram Linux kernel module.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
|
|
|
|
| |
Fix isohybrid build rules.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
|
|
| |
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
|
|
|
|
|
| |
For compatibility with isohybrid.pl, use getopt_long_only() so long
options are accepted with a single dash.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
| |
Some Linux distributions have complained about Perl as a prerequisite
for isohybrid, so create a C version.
[ hpa: modified the array generator to put it all in one script ]
|
|
|
|
|
|
|
| |
It is often fine to have a sparse file for the output image, so add an
-s option to generate a sparse image.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
|
|
| |
Replace -W -Wall hardcoded into a bunch of Makefiles with $(GCCWARN),
a centralized variable defined in the root MCONFIG. Add
-Wstrict-prototypes to the list of global warnings: we should never
have non-prototyped declarations.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
|
| |
Actually implement the -offset option. Credit for the patch goes to
"cmdr from the gparted-forum", reported by
Sven-Hendrik Haase <sh@lutzhaase.com>.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
| |
Make sure the pxelinux-options script gets installed.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
| |
Add help text to pxelinux-options.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
|
|
| |
Support hardcoded DHCP options both "before" or "after" the
PXE-provided options.
Add a tool to manipulate these hardcoded options.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
| |
Shouldn't 'isohybrid -id ID' write ID as 32bit number? Currently it ends up
as string messing up the mbr.
|
|
|
|
|
|
| |
Unlike C, in Perl printf() doesn't return the number of bytes written.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
|
|
| |
Automatically reformat utils/gethostip.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>
|
|
|
|
|
|
|
|
| |
We are backwards compatible again, at least as long as -partok is not
used. However, there is no minor version number, so we can't check
for that at this time.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
|
| |
Revert the isohybrid handover protocol so that it has a stack format
compatible with the previous versions; that way we can also revert the
magic number to a compatible one.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|