From 9dfe92d07acd3da80d0a96ca89f036e71e04e553 Mon Sep 17 00:00:00 2001 From: Robert Millan Date: Thu, 18 Nov 2010 16:52:27 +0100 Subject: [PATCH 01/16] 2010-11-18 Robert Millan * grub-core/fs/btrfs.c (grub_btrfs_mount): Replace grub_strncmp() with grub_memcmp(). --- ChangeLog | 5 +++++ grub-core/fs/btrfs.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d839afb65..b78bdcce0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-11-18 Robert Millan + + * grub-core/fs/btrfs.c (grub_btrfs_mount): Replace grub_strncmp() + with grub_memcmp(). + 2010-11-18 Vladimir Serbinenko * grub-core/normal/menu_entry.c (print_up): Fix displacement of up diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c index a50bae000..a2ee485b4 100644 --- a/grub-core/fs/btrfs.c +++ b/grub-core/fs/btrfs.c @@ -51,7 +51,7 @@ grub_btrfs_mount (grub_disk_t disk) &data->sblock) != GRUB_ERR_NONE) goto fail; - if (grub_strncmp ((char *) data->sblock.signature, BTRFS_SIGNATURE, sizeof (BTRFS_SIGNATURE) - 1)) + if (grub_memcmp ((char *) data->sblock.signature, BTRFS_SIGNATURE, sizeof (BTRFS_SIGNATURE) - 1)) { grub_error (GRUB_ERR_BAD_FS, "not a Btrfs filesystem"); goto fail; From 7b61e6096bcb15a0066ed8d33992ed895062ffcd Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Fri, 19 Nov 2010 22:48:26 +0100 Subject: [PATCH 02/16] * grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): Don't try to retrieve the metadat sector if size isn't known. * grub-core/disk/mdraid_linux.c (grub_mdraid_detect): Likewise. --- ChangeLog | 6 ++++++ grub-core/disk/mdraid1x_linux.c | 3 +++ grub-core/disk/mdraid_linux.c | 2 ++ 3 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index b78bdcce0..44e8badf2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-11-19 Vladimir Serbinenko + + * grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): Don't try to + retrieve the metadat sector if size isn't known. + * grub-core/disk/mdraid_linux.c (grub_mdraid_detect): Likewise. + 2010-11-18 Robert Millan * grub-core/fs/btrfs.c (grub_btrfs_mount): Replace grub_strncmp() diff --git a/grub-core/disk/mdraid1x_linux.c b/grub-core/disk/mdraid1x_linux.c index dd60df695..b1fce86a0 100644 --- a/grub-core/disk/mdraid1x_linux.c +++ b/grub-core/disk/mdraid1x_linux.c @@ -123,6 +123,9 @@ grub_mdraid_detect (grub_disk_t disk, struct grub_raid_array *array, for (minor_version = 0; minor_version < 3; ++minor_version) { + if (size == GRUB_DISK_SIZE_UNKNOWN && minor_version == 0) + continue; + switch (minor_version) { case 0: diff --git a/grub-core/disk/mdraid_linux.c b/grub-core/disk/mdraid_linux.c index f5cad9dbf..dc0d80ffd 100644 --- a/grub-core/disk/mdraid_linux.c +++ b/grub-core/disk/mdraid_linux.c @@ -170,6 +170,8 @@ grub_mdraid_detect (grub_disk_t disk, struct grub_raid_array *array, /* The sector where the mdraid 0.90 superblock is stored, if available. */ size = grub_disk_get_size (disk); + if (size == GRUB_DISK_SIZE_UNKNOWN) + return grub_error (GRUB_ERR_OUT_OF_RANGE, "not 0.9x raid"); sector = NEW_SIZE_SECTORS (size); if (grub_disk_read (disk, sector, 0, SB_BYTES, &sb)) From dfd240b122b77fe20219ee1490e8d9290a5c95ea Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Fri, 19 Nov 2010 22:52:27 +0100 Subject: [PATCH 03/16] * grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): Fix spurious warning. --- ChangeLog | 5 +++++ grub-core/disk/mdraid1x_linux.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 44e8badf2..c143eebb8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-11-19 Vladimir Serbinenko + + * grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): Fix spurious + warning. + 2010-11-19 Vladimir Serbinenko * grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): Don't try to diff --git a/grub-core/disk/mdraid1x_linux.c b/grub-core/disk/mdraid1x_linux.c index b1fce86a0..b6a48b848 100644 --- a/grub-core/disk/mdraid1x_linux.c +++ b/grub-core/disk/mdraid1x_linux.c @@ -105,7 +105,7 @@ static grub_err_t grub_mdraid_detect (grub_disk_t disk, struct grub_raid_array *array, grub_disk_addr_t *start_sector) { - grub_disk_addr_t sector; + grub_disk_addr_t sector = 0; grub_uint64_t size; struct grub_raid_super_1x sb; grub_uint8_t minor_version; From 7f8b0fd7f0e08175e3468ad8732aad243d3d141a Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Fri, 19 Nov 2010 22:58:06 +0100 Subject: [PATCH 04/16] * grub-core/loader/i386/linux.c (grub_cmd_linux): Pass correctly the bootloader version instead of 0. --- ChangeLog | 5 +++++ grub-core/loader/i386/linux.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c143eebb8..8b98c1a4f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-11-19 Vladimir Serbinenko + + * grub-core/loader/i386/linux.c (grub_cmd_linux): Pass correctly the + bootloader version instead of 0. + 2010-11-19 Vladimir Serbinenko * grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): Fix spurious diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c index de4bec106..95aa6b456 100644 --- a/grub-core/loader/i386/linux.c +++ b/grub-core/loader/i386/linux.c @@ -655,7 +655,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), goto fail; } - params->type_of_loader = (LINUX_LOADER_ID_GRUB << 4); + params->type_of_loader = GRUB_LINUX_BOOT_LOADER_TYPE; /* These two are used (instead of cmd_line_ptr) by older versions of Linux, and otherwise ignored. */ From cf8ffc3825cc51eb2eb62a325aaa16f6a951f4c5 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 22 Nov 2010 12:20:57 +0000 Subject: [PATCH 05/16] * util/grub-install.in: Remove excessive quoting that broke installations to RAID devices. --- ChangeLog | 5 +++++ util/grub-install.in | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8b98c1a4f..9782c205c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-11-22 Colin Watson + + * util/grub-install.in: Remove excessive quoting that broke + installations to RAID devices. + 2010-11-19 Vladimir Serbinenko * grub-core/loader/i386/linux.c (grub_cmd_linux): Pass correctly the diff --git a/util/grub-install.in b/util/grub-install.in index 00ad3fde4..ec210b309 100644 --- a/util/grub-install.in +++ b/util/grub-install.in @@ -473,7 +473,7 @@ fi # this command is allowed to fail (--target=fs already grants us that the # filesystem will be accessible). partmap_module= -for x in "`"$grub_probe" --device-map="${device_map}" --target=partmap --device "${grub_device}" 2> /dev/null`"; do +for x in `"$grub_probe" --device-map="${device_map}" --target=partmap --device "${grub_device}" 2> /dev/null`; do case "$x" in netbsd | openbsd) partmap_module="$partmap_module part_bsd";; From 03df09c7c825ad2f2b8a54264ca063dd72085c0c Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 22 Nov 2010 13:57:16 +0000 Subject: [PATCH 06/16] * util/grub-install.in: Fix parsing of --grub-mkrelpath= option. --- ChangeLog | 4 ++++ util/grub-install.in | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9782c205c..14fa1a1c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-11-22 Colin Watson + + * util/grub-install.in: Fix parsing of --grub-mkrelpath= option. + 2010-11-22 Colin Watson * util/grub-install.in: Remove excessive quoting that broke diff --git a/util/grub-install.in b/util/grub-install.in index ec210b309..b9e833360 100644 --- a/util/grub-install.in +++ b/util/grub-install.in @@ -205,7 +205,7 @@ do --grub-mkrelpath) grub_mkrelpath="`argument "$option" "$@"`"; shift;; - --grub-mkimage=*) + --grub-mkrelpath=*) grub_mkrelpath="`echo "$option" | sed 's/--grub-mkrelpath=//'`" ;; --grub-mkdevicemap) From e6f63338f70bc9e315cc68d0b1f0af358dd89530 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 22 Nov 2010 18:22:00 +0000 Subject: [PATCH 07/16] usual e-mail address --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 14fa1a1c5..7fb54fc99 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -2010-11-22 Colin Watson +2010-11-22 Colin Watson * util/grub-install.in: Fix parsing of --grub-mkrelpath= option. From 14e8b279e9789d22106a5ac8fa7630659c7032c5 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 22 Nov 2010 18:22:50 +0000 Subject: [PATCH 08/16] Fix test program build on GNU/kFreeBSD. * Makefile.util.def (example_unit_test): Add `$(LIBZFS) $(LIBNVPAIR)' library dependencies. --- ChangeLog | 7 +++++++ Makefile.util.def | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7fb54fc99..03f5f5e19 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-11-22 Colin Watson + + Fix test program build on GNU/kFreeBSD. + + * Makefile.util.def (example_unit_test): Add `$(LIBZFS) + $(LIBNVPAIR)' library dependencies. + 2010-11-22 Colin Watson * util/grub-install.in: Fix parsing of --grub-mkrelpath= option. diff --git a/Makefile.util.def b/Makefile.util.def index 94dfb1044..748bb1c59 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -607,7 +607,7 @@ program = { ldadd = libgrubmods.a; ldadd = libgrubkern.a; ldadd = grub-core/gnulib/libgnu.a; - ldadd = '$(LIBDEVMAPPER)'; + ldadd = '$(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR)'; }; program = { From 7242bab6a496eb28aa469b3f8bf5768b64425f4e Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 23 Nov 2010 10:48:46 +0000 Subject: [PATCH 09/16] * include/grub/gpt_partition.h (GRUB_GPT_PARTITION_TYPE_BIOS_BOOT): Remove byte-swapping function calls, which are not valid in structure initialisers. * grub-core/partmap/gpt.c (grub_gpt_partition_type_bios_boot): Make non-const. (GRUB_MOD_INIT): Byte-swap data1, data2, and data3 fields of grub_gpt_partition_type_bios_boot. --- ChangeLog | 10 ++++++++++ grub-core/partmap/gpt.c | 10 +++++++++- include/grub/gpt_partition.h | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 03f5f5e19..815004080 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2010-11-23 Colin Watson + + * include/grub/gpt_partition.h (GRUB_GPT_PARTITION_TYPE_BIOS_BOOT): + Remove byte-swapping function calls, which are not valid in + structure initialisers. + * grub-core/partmap/gpt.c (grub_gpt_partition_type_bios_boot): Make + non-const. + (GRUB_MOD_INIT): Byte-swap data1, data2, and data3 fields of + grub_gpt_partition_type_bios_boot. + 2010-11-22 Colin Watson Fix test program build on GNU/kFreeBSD. diff --git a/grub-core/partmap/gpt.c b/grub-core/partmap/gpt.c index 7f2c36143..13223460b 100644 --- a/grub-core/partmap/gpt.c +++ b/grub-core/partmap/gpt.c @@ -33,7 +33,7 @@ static grub_uint8_t grub_gpt_magic[8] = static const grub_gpt_part_type_t grub_gpt_partition_type_empty = GRUB_GPT_PARTITION_TYPE_EMPTY; #ifdef GRUB_UTIL -static const grub_gpt_part_type_t grub_gpt_partition_type_bios_boot = GRUB_GPT_PARTITION_TYPE_BIOS_BOOT; +static grub_gpt_part_type_t grub_gpt_partition_type_bios_boot = GRUB_GPT_PARTITION_TYPE_BIOS_BOOT; #endif /* 512 << 7 = 65536 byte sectors. */ @@ -198,6 +198,14 @@ static struct grub_partition_map grub_gpt_partition_map = GRUB_MOD_INIT(part_gpt) { grub_partition_map_register (&grub_gpt_partition_map); +#ifdef GRUB_UTIL + grub_gpt_partition_type_bios_boot.data1 = + grub_cpu_to_le32 (grub_gpt_partition_type_bios_boot.data1); + grub_gpt_partition_type_bios_boot.data2 = + grub_cpu_to_le16 (grub_gpt_partition_type_bios_boot.data2); + grub_gpt_partition_type_bios_boot.data3 = + grub_cpu_to_le16 (grub_gpt_partition_type_bios_boot.data3); +#endif } GRUB_MOD_FINI(part_gpt) diff --git a/include/grub/gpt_partition.h b/include/grub/gpt_partition.h index 428ceb166..bc3d3f210 100644 --- a/include/grub/gpt_partition.h +++ b/include/grub/gpt_partition.h @@ -36,7 +36,7 @@ typedef struct grub_gpt_part_type grub_gpt_part_type_t; } #define GRUB_GPT_PARTITION_TYPE_BIOS_BOOT \ - { grub_cpu_to_le32 (0x21686148), grub_cpu_to_le16 (0x6449), grub_cpu_to_le16 (0x6e6f), \ + { 0x21686148, 0x6449, 0x6e6f, \ { 0x74, 0x4e, 0x65, 0x65, 0x64, 0x45, 0x46, 0x49 } \ } From bf16e98e3c93890c32cea3d612913d9bdf544378 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 23 Nov 2010 12:52:40 +0000 Subject: [PATCH 10/16] * 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 11/16] * 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 12/16] * 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 13/16] * 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 14/16] * 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)'; From 5a4072785bbaec011b37e0d46a3d2bcd0127a150 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Wed, 24 Nov 2010 19:32:49 +0000 Subject: [PATCH 15/16] * grub-core/Makefile.core.def (xz_decompress): Move -lgcc from ldflags to ldadd, to fix link line ordering. (none_decompress): Likewise. --- ChangeLog | 6 ++++++ grub-core/Makefile.core.def | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 39a6b5146..f29ade31c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-11-24 Colin Watson + + * grub-core/Makefile.core.def (xz_decompress): Move -lgcc from + ldflags to ldadd, to fix link line ordering. + (none_decompress): Likewise. + 2010-11-24 Colin Watson * grub-core/Makefile.core.def (kernel): Add kern/emu/cache.S for emu diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def index 098df91dc..ce10ba372 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -300,7 +300,8 @@ image = { mips_cppflags = '-I$(srcdir)/lib/posix_wrap -I$(srcdir)/lib/xzembed -DGRUB_EMBED_DECOMPRESSOR=1 -DGRUB_MACHINE_LINK_ADDR=0x80200000'; objcopyflags = '-O binary'; - ldflags = '-lgcc -static-libgcc -Wl,-Ttext,0x80100000'; + ldflags = '-static-libgcc -Wl,-Ttext,0x80100000'; + ldadd = '-lgcc'; cflags = '-static-libgcc'; enable = mips; }; @@ -313,7 +314,8 @@ image = { mips_cppflags = '-DGRUB_EMBED_DECOMPRESSOR=1 -DGRUB_MACHINE_LINK_ADDR=0x80200000'; objcopyflags = '-O binary'; - ldflags = '-lgcc -static-libgcc -Wl,-Ttext,0x80100000'; + ldflags = '-static-libgcc -Wl,-Ttext,0x80100000'; + ldadd = '-lgcc'; cflags = '-static-libgcc'; enable = mips; }; From 74f72a6415a450219afe51fa0f2c17ffdb085e61 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Wed, 24 Nov 2010 19:43:32 +0000 Subject: [PATCH 16/16] * util/deviceiter.c (grub_util_iterate_devices): Save a bit of effort by skipping "." and ".." entries up-front. Suggested by: Michael Lazarev. --- ChangeLog | 6 ++++++ util/deviceiter.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index f29ade31c..6bc7f1b9e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-11-24 Colin Watson + + * util/deviceiter.c (grub_util_iterate_devices): Save a bit of + effort by skipping "." and ".." entries up-front. + Suggested by: Michael Lazarev. + 2010-11-24 Colin Watson * grub-core/Makefile.core.def (xz_decompress): Move -lgcc from diff --git a/util/deviceiter.c b/util/deviceiter.c index 1de8e54df..30c18beea 100644 --- a/util/deviceiter.c +++ b/util/deviceiter.c @@ -536,6 +536,10 @@ grub_util_iterate_devices (int NESTED_FUNC_ATTR (*hook) (const char *, int), necessary. */ for (entry = readdir (dir); entry; entry = readdir (dir)) { + /* Skip current and parent directory entries. */ + if (strcmp (entry->d_name, ".") == 0 || + strcmp (entry->d_name, "..") == 0) + continue; /* Skip partition entries. */ if (strstr (entry->d_name, "-part")) continue;