Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[build] Search for ldlinux.c32 separately from isolinux.bin
Some distributions (observed with Ubuntu 15.04) place ldlinux.c32 in a
separate directory from isolinux.bin.  Search for these files
separately, and allow an alternative location of ldlinux.c32 to be
provided via LDLINUX_C32=... on the make command line.

Reported-by: Adrian Koshka <adriankoshcha@teknik.io>
Tested-by: Adrian Koshka <adriankoshcha@teknik.io>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Sep 1, 2015
1 parent 619a377 commit f6e1da5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
27 changes: 18 additions & 9 deletions src/arch/i386/Makefile
Expand Up @@ -84,18 +84,27 @@ endif
#
CFLAGS_lkrnprefix += -DVERSION="\"$(VERSION)\""

# Locations of utilities
#
# Locations of isolinux files
#
SYSLINUX_DIR_LIST := \
/usr/lib/syslinux \
/usr/lib/syslinux/bios \
/usr/lib/syslinux/modules/bios \
/usr/share/syslinux \
/usr/share/syslinux/bios \
/usr/share/syslinux/modules/bios \
/usr/local/share/syslinux \
/usr/local/share/syslinux/bios \
/usr/local/share/syslinux/modules/bios \
/usr/lib/ISOLINUX
ISOLINUX_BIN_LIST := \
$(ISOLINUX_BIN) \
/usr/lib/syslinux/isolinux.bin \
/usr/lib/syslinux/bios/isolinux.bin \
/usr/share/syslinux/isolinux.bin \
/usr/share/syslinux/bios/isolinux.bin \
/usr/local/share/syslinux/isolinux.bin \
/usr/local/share/syslinux/bios/isolinux.bin \
/usr/lib/ISOLINUX/isolinux.bin
$(patsubst %,%/isolinux.bin,$(SYSLINUX_DIR_LIST))
LDLINUX_C32_LIST := \
$(LDLINUX_C32) \
$(patsubst %,%/ldlinux.c32,$(SYSLINUX_DIR_LIST))
ISOLINUX_BIN = $(firstword $(wildcard $(ISOLINUX_BIN_LIST)))
LDLINUX_C32 = $(firstword $(wildcard $(LDLINUX_C32_LIST)))

# i386-specific directories containing source files
#
Expand Down
3 changes: 2 additions & 1 deletion src/arch/i386/Makefile.pcbios
Expand Up @@ -57,7 +57,8 @@ LIST_NAME_isarom := ROMS
NON_AUTO_MEDIA += iso
%iso: %lkrn util/geniso
$(QM)$(ECHO) " [GENISO] $@"
$(Q)ISOLINUX_BIN=$(ISOLINUX_BIN) VERSION="$(VERSION)" bash util/geniso -o $@ $<
$(Q)ISOLINUX_BIN=$(ISOLINUX_BIN) LDLINUX_C32=$(LDLINUX_C32) \
VERSION="$(VERSION)" bash util/geniso -o $@ $<

# rule to make a floppy emulation ISO boot image
NON_AUTO_MEDIA += liso
Expand Down
3 changes: 1 addition & 2 deletions src/util/geniso
Expand Up @@ -123,8 +123,7 @@ case "${LEGACY}" in
cp ${ISOLINUX_BIN} ${dir}

# syslinux 6.x needs a file called ldlinux.c32
LDLINUX_C32=$(dirname ${ISOLINUX_BIN})/ldlinux.c32
if [ -s ${LDLINUX_C32} ]; then
if [ -n "${LDLINUX_C32}" -a -s "${LDLINUX_C32}" ]; then
cp ${LDLINUX_C32} ${dir}
fi

Expand Down

0 comments on commit f6e1da5

Please sign in to comment.