root/utils/Makefile

Revision 2c3a24e5f4b807ec31595227afa59a818c060ca9, 2.1 KB (checked in by H. Peter Anvin <hpa@…>, 9 months ago)

isohybrid: Generate GPT and Mac bootable images

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@…>
Signed-off-by: H. Peter Anvin <hpa@…>

  • Property mode set to 100644
Line 
1## -----------------------------------------------------------------------
2##
3##   Copyright 1998-2008 H. Peter Anvin - All Rights Reserved
4##
5##   This program is free software; you can redistribute it and/or modify
6##   it under the terms of the GNU General Public License as published by
7##   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
8##   Boston MA 02111-1307, USA; either version 2 of the License, or
9##   (at your option) any later version; incorporated herein by reference.
10##
11## -----------------------------------------------------------------------
12
13#
14# SYSLINUX utilities
15#
16
17topdir = ..
18MAKEDIR = $(topdir)/mk
19include $(MAKEDIR)/syslinux.mk
20
21CFLAGS   = $(GCCWARN) -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64
22LDFLAGS  = -O2
23
24C_TARGETS        = isohybrid gethostip memdiskfind
25SCRIPT_TARGETS   = mkdiskimage
26SCRIPT_TARGETS  += isohybrid.pl  # about to be obsoleted
27ASIS             = keytab-lilo lss16toppm md5pass ppmtolss16 sha1pass \
28                   syslinux2ansi pxelinux-options
29
30TARGETS = $(C_TARGETS) $(SCRIPT_TARGETS)
31
32ISOHDPFX = ../mbr/isohdpfx.bin ../mbr/isohdpfx_f.bin ../mbr/isohdpfx_c.bin \
33           ../mbr/isohdppx.bin ../mbr/isohdppx_f.bin ../mbr/isohdppx_c.bin
34
35all: $(TARGETS)
36
37%.o: %.c
38        $(CC) $(UMAKEDEPS) $(CFLAGS) -c -o $@ $<
39
40mkdiskimage: mkdiskimage.in ../mbr/mbr.bin bin2hex.pl
41        $(PERL) bin2hex.pl < ../mbr/mbr.bin | cat mkdiskimage.in - > $@
42        chmod a+x $@
43
44# Works on anything with a Perl interpreter...
45isohybrid.pl: isohybrid.in $(ISOHDPFX) bin2hex.pl
46        cp -f isohybrid.in $@
47        for f in $(ISOHDPFX) ; do $(PERL) bin2hex.pl < $$f >> $@ ; done
48        chmod a+x $@
49
50isohdpfx.c: $(ISOHDPFX) isohdpfxarray.pl
51        $(PERL) isohdpfxarray.pl $(ISOHDPFX) > $@
52
53isohybrid: isohybrid.o isohdpfx.o
54        $(CC) $(LDFLAGS) -luuid -o $@ $^
55
56gethostip: gethostip.o
57        $(CC) $(LDFLAGS) -o $@ $^
58
59memdiskfind: memdiskfind.o
60        $(CC) $(LDFLAGS) -o $@ $^
61
62tidy dist:
63        rm -f *.o .*.d isohdpfx.c
64
65clean: tidy
66        rm -f $(TARGETS)
67
68spotless: clean
69
70installer: all
71
72install: installer
73        mkdir -m 755 -p $(INSTALLROOT)$(BINDIR)
74        install -m 755 $(TARGETS) $(ASIS) $(INSTALLROOT)$(BINDIR)
75
76strip:
77        $(STRIP) $(C_TARGETS)
78
79-include .*.d
Note: See TracBrowser for help on using the browser.