Browse Source

[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>
tags/v1.20.1
Michael Brown 9 years ago
parent
commit
f6e1da5cbf
3 changed files with 21 additions and 12 deletions
  1. 18
    9
      src/arch/i386/Makefile
  2. 2
    1
      src/arch/i386/Makefile.pcbios
  3. 1
    2
      src/util/geniso

+ 18
- 9
src/arch/i386/Makefile View File

@@ -84,18 +84,27 @@ endif
84 84
 #
85 85
 CFLAGS_lkrnprefix	+= -DVERSION="\"$(VERSION)\""
86 86
 
87
-# Locations of utilities
88
-#
87
+# Locations of isolinux files
88
+#
89
+SYSLINUX_DIR_LIST	:= \
90
+	/usr/lib/syslinux \
91
+	/usr/lib/syslinux/bios \
92
+	/usr/lib/syslinux/modules/bios \
93
+	/usr/share/syslinux \
94
+	/usr/share/syslinux/bios \
95
+	/usr/share/syslinux/modules/bios \
96
+	/usr/local/share/syslinux \
97
+	/usr/local/share/syslinux/bios \
98
+	/usr/local/share/syslinux/modules/bios \
99
+	/usr/lib/ISOLINUX
89 100
 ISOLINUX_BIN_LIST	:= \
90 101
 	$(ISOLINUX_BIN) \
91
-	/usr/lib/syslinux/isolinux.bin \
92
-	/usr/lib/syslinux/bios/isolinux.bin \
93
-	/usr/share/syslinux/isolinux.bin \
94
-	/usr/share/syslinux/bios/isolinux.bin \
95
-	/usr/local/share/syslinux/isolinux.bin \
96
-	/usr/local/share/syslinux/bios/isolinux.bin \
97
-	/usr/lib/ISOLINUX/isolinux.bin
102
+	$(patsubst %,%/isolinux.bin,$(SYSLINUX_DIR_LIST))
103
+LDLINUX_C32_LIST	:= \
104
+	$(LDLINUX_C32) \
105
+	$(patsubst %,%/ldlinux.c32,$(SYSLINUX_DIR_LIST))
98 106
 ISOLINUX_BIN	= $(firstword $(wildcard $(ISOLINUX_BIN_LIST)))
107
+LDLINUX_C32	= $(firstword $(wildcard $(LDLINUX_C32_LIST)))
99 108
 
100 109
 # i386-specific directories containing source files
101 110
 #

+ 2
- 1
src/arch/i386/Makefile.pcbios View File

@@ -57,7 +57,8 @@ LIST_NAME_isarom := ROMS
57 57
 NON_AUTO_MEDIA	+= iso
58 58
 %iso:	%lkrn util/geniso
59 59
 	$(QM)$(ECHO) "  [GENISO] $@"
60
-	$(Q)ISOLINUX_BIN=$(ISOLINUX_BIN) VERSION="$(VERSION)" bash util/geniso -o $@ $<
60
+	$(Q)ISOLINUX_BIN=$(ISOLINUX_BIN) LDLINUX_C32=$(LDLINUX_C32) \
61
+	    VERSION="$(VERSION)" bash util/geniso -o $@ $<
61 62
 
62 63
 # rule to make a floppy emulation ISO boot image
63 64
 NON_AUTO_MEDIA	+= liso

+ 1
- 2
src/util/geniso View File

@@ -123,8 +123,7 @@ case "${LEGACY}" in
123 123
 		cp ${ISOLINUX_BIN} ${dir}
124 124
 
125 125
 		# syslinux 6.x needs a file called ldlinux.c32
126
-		LDLINUX_C32=$(dirname ${ISOLINUX_BIN})/ldlinux.c32
127
-		if [ -s ${LDLINUX_C32} ]; then
126
+		if [ -n "${LDLINUX_C32}" -a -s "${LDLINUX_C32}" ]; then
128 127
 			cp ${LDLINUX_C32} ${dir}
129 128
 		fi
130 129
 

Loading…
Cancel
Save