From bf16e98e3c93890c32cea3d612913d9bdf544378 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 23 Nov 2010 12:52:40 +0000 Subject: [PATCH 1/5] * grub-core/Makefile.am (command.lst): Adjust sed expression ordering so that extended and priority commands aren't treated as ordinary commands. --- ChangeLog | 6 ++++++ grub-core/Makefile.am | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 815004080..4a09faca4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-11-23 Colin Watson + + * grub-core/Makefile.am (command.lst): Adjust sed expression + ordering so that extended and priority commands aren't treated as + ordinary commands. + 2010-11-23 Colin Watson * include/grub/gpt_partition.h (GRUB_GPT_PARTITION_TYPE_BIOS_BOOT): diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am index 9792dd974..131fa5fd7 100644 --- a/grub-core/Makefile.am +++ b/grub-core/Makefile.am @@ -237,9 +237,9 @@ command.lst: $(MARKER_FILES) (for pp in $^; do \ b=`basename $$pp .marker`; \ sed -n \ - -e "/COMMAND_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/\1: $$b/;p;}" \ -e "/EXTCOMMAND_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/*\1: $$b/;p;}" \ - -e "/P1COMMAND_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/*\1: $$b/;p;}" $$pp; \ + -e "/P1COMMAND_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/*\1: $$b/;p;}" \ + -e "/COMMAND_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/\1: $$b/;p;}" $$pp; \ done) | sort -u > $@ platform_DATA += command.lst CLEANFILES += command.lst From 038b3ce8dc10e598b95aa8f92a243bdfaa078e84 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 23 Nov 2010 13:00:05 +0000 Subject: [PATCH 2/5] * grub-core/Makefile.am (gentrigtables): Put -lm after $<; some linkers are picky about this. --- ChangeLog | 5 +++++ grub-core/Makefile.am | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4a09faca4..5f38faf42 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-11-23 Colin Watson + + * grub-core/Makefile.am (gentrigtables): Put -lm after $<; some + linkers are picky about this. + 2010-11-23 Colin Watson * grub-core/Makefile.am (command.lst): Adjust sed expression diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am index 131fa5fd7..073ce37f6 100644 --- a/grub-core/Makefile.am +++ b/grub-core/Makefile.am @@ -30,7 +30,7 @@ CCASFLAGS_LIBRARY += $(CCASFLAGS_PLATFORM) # gentrigtables gentrigtables: gentrigtables.c - $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(CPPFLAGS) -lm $< + $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(CPPFLAGS) $< -lm CLEANFILES += gentrigtables # trigtables.c From 5225f3288296190e8fa16a34560b1b7bf2ae4a6b Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 23 Nov 2010 15:56:18 +0000 Subject: [PATCH 3/5] * Makefile.util.def (grub-menulst2cfg): List libraries in ldadd, not ldflags, to fix link line ordering. --- ChangeLog | 5 +++++ Makefile.util.def | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5f38faf42..9b01330d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-11-23 Colin Watson + + * Makefile.util.def (grub-menulst2cfg): List libraries in ldadd, not + ldflags, to fix link line ordering. + 2010-11-23 Colin Watson * grub-core/Makefile.am (gentrigtables): Put -lm after $<; some diff --git a/Makefile.util.def b/Makefile.util.def index 748bb1c59..3e8ae16f5 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -620,5 +620,5 @@ program = { ldadd = libgrubmods.a; ldadd = libgrubkern.a; ldadd = grub-core/gnulib/libgnu.a; - ldflags = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR)'; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR)'; }; From b7fbac1214cfb38fd81f2d2555b34064456a1424 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 23 Nov 2010 17:42:06 +0000 Subject: [PATCH 4/5] * util/deviceiter.c (compare_devices): If the by-id link for a device couldn't be resolved, fall back to sorting by the by-id link rather than segfaulting. Reported and tested by: Daniel Mierswa. --- ChangeLog | 7 +++++++ util/deviceiter.c | 15 +++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9b01330d5..c6bbffd99 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-11-23 Colin Watson + + * util/deviceiter.c (compare_devices): If the by-id link for a + device couldn't be resolved, fall back to sorting by the by-id link + rather than segfaulting. + Reported and tested by: Daniel Mierswa. + 2010-11-23 Colin Watson * Makefile.util.def (grub-menulst2cfg): List libraries in ldadd, not diff --git a/util/deviceiter.c b/util/deviceiter.c index 34d34b7bb..1de8e54df 100644 --- a/util/deviceiter.c +++ b/util/deviceiter.c @@ -485,12 +485,15 @@ compare_devices (const void *a, const void *b) { const struct device *left = (const struct device *) a; const struct device *right = (const struct device *) b; - int ret; - ret = strcmp (left->kernel, right->kernel); - if (ret) - return ret; - else - return strcmp (left->stable, right->stable); + + if (left->kernel && right->kernel) + { + int ret = strcmp (left->kernel, right->kernel); + if (ret) + return ret; + } + + return strcmp (left->stable, right->stable); } #endif /* __linux__ */ From 3030d8ec490c87a85ac1fd9fbff7b9eecfb8cfec Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Wed, 24 Nov 2010 12:07:14 +0000 Subject: [PATCH 5/5] * grub-core/Makefile.core.def (kernel): Add kern/emu/cache.S for emu platforms. (grub-emu-lite): Remove kern/emu/cache.S. --- ChangeLog | 6 ++++++ grub-core/Makefile.core.def | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c6bbffd99..39a6b5146 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-11-24 Colin Watson + + * grub-core/Makefile.core.def (kernel): Add kern/emu/cache.S for emu + platforms. + (grub-emu-lite): Remove kern/emu/cache.S. + 2010-11-23 Colin Watson * util/deviceiter.c (compare_devices): If the by-id link for a diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def index 46c65adac..098df91dc 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -162,6 +162,7 @@ kernel = { emu = disk/host.c; emu = gnulib/progname.c; emu = gnulib/error.c; + emu = kern/emu/cache.S; emu = kern/emu/console.c; emu = kern/emu/getroot.c; emu = kern/emu/hostdisk.c; @@ -208,7 +209,6 @@ program = { name = grub-emu-lite; emu = kern/emu/lite.c; - emu = kern/emu/cache.S; emu_nodist = symlist.c; ldadd = 'kernel.img$(EXEEXT)';