From: Matt Fleming <matt.fleming at intel.com> The first two patches in this series are fixes for bugs reported by someone in #syslinux. The third makes dmitest.c32 actually wait for user input. If no one has any objections/concerns, I'll pull this into the official elflink branch. Matt Fleming (3): core: Print error message if we don't load ldlinux.c32 Clean up $(GPLLIB) leak ldlinux: Use stdcon instead of rawcon for the console Makefile | 10 ++++++---- com32/elflink/ldlinux/ldlinux.c | 2 +- com32/hdt/Makefile | 4 +--- com32/modules/Makefile | 5 +---- core/elflink/load_env32.c | 2 ++ mk/elf.mk | 2 +- 6 files changed, 12 insertions(+), 13 deletions(-) -- 1.7.11.7
Matt Fleming
2012-Oct-19 15:11 UTC
[syslinux] [PATCH 1/3] core: Print error message if we don't load ldlinux.c32
From: Matt Fleming <matt.fleming at intel.com> If the user forgot to install ldlinux.c32 they're greeted with the following unhelpful message, Boot failed: press a key to retry, or wait for reset... We should explicitly tell the user that the reason for the boot failing is that ldlinux.c32 could not be loaded. Signed-off-by: Matt Fleming <matt.fleming at intel.com> --- core/elflink/load_env32.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/elflink/load_env32.c b/core/elflink/load_env32.c index 8e124a0..49c5989 100644 --- a/core/elflink/load_env32.c +++ b/core/elflink/load_env32.c @@ -141,6 +141,8 @@ void load_env32(com32sys_t * regs __unused) if (!search_dirs(&fp->i.fd, search_directories, filenames, realname)) start_ldlinux(argv); + + writestr("\nFailed to load ldlinux.c32"); } int create_args_and_load(char *cmdline) -- 1.7.11.7
From: Matt Fleming <matt.fleming at intel.com> Modules were linking against com32/gpllib/libcom32gpl.c32 even when NOGPL was set, so remove it from various modules Makefiles and use $(C_LIBS) in mk/elf.mk which already has the conditional-magic for $(GPLLIB). Also, the object files in com32/gpllib/ are not distributed in the release tarballs, which means that if a user does a 'make netinstall' they hit the following install error, install: cannot stat `com32/gpllib/*.c32': No such file or directory Add a $(INSTALLABLE_MODULES) variable to separate the list of build and install modules. Signed-off-by: Matt Fleming <matt.fleming at intel.com> --- Makefile | 10 ++++++---- com32/hdt/Makefile | 4 +--- com32/modules/Makefile | 5 +---- mk/elf.mk | 2 +- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 499ca5e..f25a922 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,6 @@ include $(MAKEDIR)/syslinux.mk # directories. # -# List of module objects that should be installed for all derivatives MODULES = memdisk/memdisk memdump/memdump.com modules/*.com \ com32/menu/*.c32 com32/modules/*.c32 com32/mboot/*.c32 \ com32/hdt/*.c32 com32/rosh/*.c32 com32/gfxboot/*.c32 \ @@ -38,6 +37,9 @@ MODULES = memdisk/memdisk memdump/memdump.com modules/*.com \ com32/lib/*.c32 com32/libutil/*.c32 com32/gpllib/*.c32 \ com32/elflink/ldlinux/*.c32 +# List of module objects that should be installed for all derivatives +INSTALLABLE_MODULES = $(filter-out com32/gpllib%,$(MODULES)) + # syslinux.exe is BTARGET so as to not require everyone to have the # mingw suite installed BTARGET = version.gen version.h version.mk @@ -71,7 +73,7 @@ INSTALL_SBIN = extlinux/extlinux INSTALL_AUX = core/pxelinux.0 gpxe/gpxelinux.0 gpxe/gpxelinuxk.0 \ core/isolinux.bin core/isolinux-debug.bin \ dos/syslinux.com \ - mbr/*.bin $(MODULES) + mbr/*.bin $(INSTALLABLE_MODULES) INSTALL_AUX_OPT = win32/syslinux.exe win64/syslinux64.exe INSTALL_DIAG = diag/mbr/handoff.bin \ diag/geodsp/geodsp1s.img.xz diag/geodsp/geodspms.img.xz @@ -80,11 +82,11 @@ INSTALL_DIAG = diag/mbr/handoff.bin \ INSTALLSUBDIRS = com32 utils dosutil # Things to install in /boot/extlinux -EXTBOOTINSTALL = $(MODULES) +EXTBOOTINSTALL = $(INSTALLABLE_MODULES) # Things to install in /tftpboot NETINSTALLABLE = core/pxelinux.0 gpxe/gpxelinux.0 \ - $(MODULES) + $(INSTALLABLE_MODULES) all: $(MAKE) all-local diff --git a/com32/hdt/Makefile b/com32/hdt/Makefile index ff0fa2e..897b660 100644 --- a/com32/hdt/Makefile +++ b/com32/hdt/Makefile @@ -20,9 +20,7 @@ MAKEDIR = $(topdir)/mk include $(MAKEDIR)/elf.mk LIBS = ../libupload/libcom32upload.a -C_LIBS += $(com32)/cmenu/libmenu/libmenu.c32 \ - $(com32)/libutil/libutil_com.c32 \ - $(com32)/lib/libcom32.c32 $(com32)/gpllib/libcom32gpl.c32 +C_LIBS += $(com32)/cmenu/libmenu/libmenu.c32 CFLAGS += -I$(com32)/cmenu/libmenu -I$(com32) MODULES = hdt.c32 diff --git a/com32/modules/Makefile b/com32/modules/Makefile index 8f5b769..dd5f2e0 100644 --- a/com32/modules/Makefile +++ b/com32/modules/Makefile @@ -15,9 +15,6 @@ ## COM32 standard modules ## -LIBS = $(com32)/gpllib/libcom32gpl.c32 $(com32)/lib/libcom32.c32 \ - $(com32)/libutil/libutil_com.c32 - topdir = ../.. MAKEDIR = $(topdir)/mk include $(MAKEDIR)/elf.mk @@ -37,7 +34,7 @@ all: $(MODULES) $(TESTFILES) dmitest.o: dmitest.c $(CC) $(CFLAGS) $(GPLINCLUDE) -c -o $@ $< -dmitest.c32 : dmi_utils.o dmitest.o $(GPLLIB) $(LIBS) $(C_LIBS) +dmitest.c32 : dmi_utils.o dmitest.o $(C_LIBS) $(LD) $(LDFLAGS) -o $@ $^ tidy dist: diff --git a/mk/elf.mk b/mk/elf.mk index 4e76c71..160dadc 100644 --- a/mk/elf.mk +++ b/mk/elf.mk @@ -81,5 +81,5 @@ C_LNXLIBS = $(com32)/libutil/libutil_lnx.a \ %.lnx: %.lo $(LNXLIBS) $(C_LNXLIBS) $(CC) $(LNXCFLAGS) -o $@ $^ -%.c32: %.o $(LIBS) +%.c32: %.o $(C_LIBS) $(LD) $(LDFLAGS) -o $@ $^ -- 1.7.11.7
Matt Fleming
2012-Oct-19 15:11 UTC
[syslinux] [PATCH 3/3] ldlinux: Use stdcon instead of rawcon for the console
From: Matt Fleming <matt.fleming at intel.com> Switch to the stdcon input device so things like fgets() work correctly when reading from stdin. I noticed this was broken when running dmitest.c32. fgets() was returning NULL because there was no pending user input instead of waiting for/buffering the input. Modules are expecting stdin to be a line-oriented device, not a raw one where each module has to implement its own line support. Signed-off-by: Matt Fleming <matt.fleming at intel.com> --- com32/elflink/ldlinux/ldlinux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com32/elflink/ldlinux/ldlinux.c b/com32/elflink/ldlinux/ldlinux.c index f82b166..d963595 100644 --- a/com32/elflink/ldlinux/ldlinux.c +++ b/com32/elflink/ldlinux/ldlinux.c @@ -271,7 +271,7 @@ int main(int argc __unused, char **argv __unused) size_t count = 0; char *config_argv[2] = { NULL, NULL }; - openconsole(&dev_rawcon_r, &dev_ansiserial_w); + openconsole(&dev_stdcon_r, &dev_ansiserial_w); if (ConfigName[0]) config_argv[0] = ConfigName; -- 1.7.11.7