From 087c07c4fa73a50c87451e2ad9df89c66b4d6c63 Mon Sep 17 00:00:00 2001 From: cjwatson Date: Thu, 3 Sep 2009 07:53:40 +0000 Subject: [PATCH 1/8] 2009-09-03 Colin Watson * kern/i386/pc/startup.S: Fix typo. --- ChangeLog | 4 ++++ kern/i386/pc/startup.S | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index feb735cb3..b0b2cbcf4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-09-03 Colin Watson + + * kern/i386/pc/startup.S: Fix typo. + 2009-09-02 Vladimir Serbinenko * efiemu/loadcore.c (SUFFIX (grub_efiemu_loadcore_load)): Fix style diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index 1a896eda1..529662b93 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -37,7 +37,7 @@ * Note: GRUB is compiled with the options -mrtd and -mregparm=3. * So the first three arguments are passed in %eax, %edx, and %ecx, * respectively, and if a function has a fixed number of arguments - * and the number if greater than three, the function must return + * and the number is greater than three, the function must return * with "ret $N" where N is ((the number of arguments) - 3) * 4. */ From 160034b2bf0b542c510aa3d84ff45340c4723388 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Thu, 3 Sep 2009 14:12:27 +0000 Subject: [PATCH 2/8] 2009-09-03 Felix Zielcke * INSTALL: Note that GNU Bison 2.3 or later is required. --- ChangeLog | 4 ++++ INSTALL | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b0b2cbcf4..84c051eee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-09-03 Felix Zielcke + + * INSTALL: Note that GNU Bison 2.3 or later is required. + 2009-09-03 Colin Watson * kern/i386/pc/startup.S: Fix typo. diff --git a/INSTALL b/INSTALL index 6048b1d6e..65993657f 100644 --- a/INSTALL +++ b/INSTALL @@ -13,7 +13,7 @@ configuring the GRUB. * GCC 2.95 or later * GNU Make -* GNU Bison +* GNU Bison 2.3 or later * GNU binutils 2.9.1.0.23 or later * Other standard GNU/Unix tools * Ruby 1.6 or later From 93a81088133d4daea9b6d0935f25d5362f9313de Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 3 Sep 2009 16:32:14 +0000 Subject: [PATCH 3/8] 2009-09-03 Magnus Granberg * aclocal.m4: Add grub_CHECK_PIE. It check if the compiler include -fPIE in the default specs. * configure.ac: Check if pie_possible is yes and add -fno-PIE to TARGET_CFLAGS. --- ChangeLog | 7 +++++++ aclocal.m4 | 28 ++++++++++++++++++++++++++++ configure.ac | 8 ++++++++ 3 files changed, 43 insertions(+) diff --git a/ChangeLog b/ChangeLog index 84c051eee..fda47fe51 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-09-03 Magnus Granberg + + * aclocal.m4: Add grub_CHECK_PIE. It check if the compiler + include -fPIE in the default specs. + * configure.ac: Check if pie_possible is yes and add -fno-PIE + to TARGET_CFLAGS. + 2009-09-03 Felix Zielcke * INSTALL: Note that GNU Bison 2.3 or later is required. diff --git a/aclocal.m4 b/aclocal.m4 index bde935dc9..313b241fa 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -413,3 +413,31 @@ else [fi rm -rf testdir] ]) + +dnl Check if the C compiler supports `-fPIE'. +AC_DEFUN(grub_CHECK_PIE,[ +[# Position independent executable. +pie_possible=yes] +AC_MSG_CHECKING([whether `$CC' has `-fPIE' as default]) +# Is this a reliable test case? +AC_LANG_CONFTEST([[ +#ifdef __PIE__ +int main() { + return 0; +} +#else +#error NO __PIE__ DEFINED +#endif +]]) + +[# `$CC -c -o ...' might not be portable. But, oh, well... Is calling +# `ac_compile' like this correct, after all? +if eval "$ac_compile -S -o conftest.s" 2> /dev/null; then] + AC_MSG_RESULT([yes]) + [# Should we clear up other files as well, having called `AC_LANG_CONFTEST'? + rm -f conftest.s +else + pie_possible=no] + AC_MSG_RESULT([no]) +[fi] +]) diff --git a/configure.ac b/configure.ac index cddd9fe2d..3c4c6dce6 100644 --- a/configure.ac +++ b/configure.ac @@ -346,6 +346,14 @@ fi # Need __enable_execute_stack() for nested function trampolines? grub_CHECK_ENABLE_EXECUTE_STACK +# Position independent executable. +grub_CHECK_PIE +[# Need that, because some distributions ship compilers that include +# `-fPIE' in the default specs. +if [ x"$pie_possible" = xyes ]; then + TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE" +fi] + # Smashing stack protector. grub_CHECK_STACK_PROTECTOR # Need that, because some distributions ship compilers that include From f79572cdd6a05079fde64d4e48ae966da0c6961c Mon Sep 17 00:00:00 2001 From: blusseau Date: Thu, 3 Sep 2009 17:07:08 +0000 Subject: [PATCH 4/8] 2009-09-02 Yves BLUSSEAU Embedding loadenv module into grub-emu * conf/i386-pc.rmk (grub_emu_SOURCES): add lib/envblk.c and commands/loadenv.c * conf/i386-coreboot.rmk (grub_emu_SOURCES): Likewise * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise --- ChangeLog | 13 +++++++++++++ conf/i386-coreboot.rmk | 1 + conf/i386-efi.rmk | 1 + conf/i386-ieee1275.rmk | 1 + conf/i386-pc.rmk | 1 + conf/powerpc-ieee1275.rmk | 1 + conf/sparc64-ieee1275.rmk | 1 + conf/x86_64-efi.rmk | 1 + 8 files changed, 20 insertions(+) diff --git a/ChangeLog b/ChangeLog index fda47fe51..55f059bba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2009-09-02 Yves BLUSSEAU + + Embedding loadenv module into grub-emu + + * conf/i386-pc.rmk (grub_emu_SOURCES): add lib/envblk.c and + commands/loadenv.c + * conf/i386-coreboot.rmk (grub_emu_SOURCES): Likewise + * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise + * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise + * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise + * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise + * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise + 2009-09-03 Magnus Granberg * aclocal.m4: Add grub_CHECK_PIE. It check if the compiler diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 4e2d1f1ec..09ec7787c 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -112,6 +112,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ commands/password.c commands/keystatus.c \ lib/hexdump.c commands/i386/cpuid.c \ + lib/envblk.c commands/loadenv.c \ disk/host.c disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 18a9a636b..99ab06f64 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -40,6 +40,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/halt.c commands/reboot.c commands/keystatus.c \ commands/i386/cpuid.c \ commands/password.c \ + lib/envblk.c commands/loadenv.c \ disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index b426bdd80..4b640de49 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -64,6 +64,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ + lib/envblk.c commands/loadenv.c \ commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ commands/i386/cpuid.c \ commands/password.c commands/keystatus.c \ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 8d7d9fca9..bf8fbfb9d 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -122,6 +122,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/i386/pc/halt.c commands/reboot.c \ + lib/envblk.c commands/loadenv.c \ commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ commands/i386/cpuid.c \ commands/password.c commands/keystatus.c \ diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index b294de917..ee7f9ec27 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -45,6 +45,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/search.c commands/handler.c commands/test.c \ commands/ls.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ + lib/envblk.c commands/loadenv.c \ commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ commands/password.c commands/keystatus.c \ disk/loopback.c \ diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index c44c6ca78..62e951a5e 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -103,6 +103,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/search.c commands/handler.c commands/test.c \ commands/ls.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ + lib/envblk.c commands/loadenv.c \ commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ commands/password.c commands/keystatus.c \ disk/loopback.c \ diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 1a4cf89ed..934cd7284 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -38,6 +38,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/halt.c commands/reboot.c \ commands/i386/cpuid.c \ commands/password.c commands/keystatus.c \ + lib/envblk.c commands/loadenv.c \ disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ From 77c55a8749fb69a6a2946bfcab7a06c857d05c12 Mon Sep 17 00:00:00 2001 From: cjwatson Date: Thu, 3 Sep 2009 23:00:25 +0000 Subject: [PATCH 5/8] 2009-09-03 Colin Watson * configure.ac: By default, GCC 4.4 generates .eh_frame sections containing unwind information in some cases where it previously did not. Use -fno-dwarf2-cfi-asm if available to restore the old behaviour. See http://patchwork.kernel.org/patch/8555/ for related discussion. --- ChangeLog | 8 ++++++++ configure.ac | 17 +++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/ChangeLog b/ChangeLog index 55f059bba..bafb163e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-09-03 Colin Watson + + * configure.ac: By default, GCC 4.4 generates .eh_frame sections + containing unwind information in some cases where it previously did + not. Use -fno-dwarf2-cfi-asm if available to restore the old + behaviour. See http://patchwork.kernel.org/patch/8555/ for related + discussion. + 2009-09-02 Yves BLUSSEAU Embedding loadenv module into grub-emu diff --git a/configure.ac b/configure.ac index 3c4c6dce6..59e046363 100644 --- a/configure.ac +++ b/configure.ac @@ -246,6 +246,23 @@ if test "x$TARGET_CFLAGS" = x; then TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1" fi fi + + # By default, GCC 4.4 generates .eh_frame sections containing unwind + # information in some cases where it previously did not. GRUB doesn't need + # these and they just use up vital space. Restore the old compiler + # behaviour. + AC_CACHE_CHECK([whether -fno-dwarf2-cfi-asm works], [grub_cv_cc_fno_dwarf2_cfi_asm], [ + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fno-dwarf2-cfi-asm" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], + [grub_cv_cc_fno_dwarf2_cfi_asm=yes], + [grub_cv_cc_fno_dwarf2_cfi_asm=no]) + CFLAGS="$SAVE_CFLAGS" + ]) + + if test "x$grub_cv_cc_fno_dwarf2_cfi_asm" = xyes; then + TARGET_CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm" + fi fi grub_apple_target_cc From 4ff0d7a4b8e0345ce32fea4407b73bd08a9aa8ef Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 4 Sep 2009 12:08:43 +0000 Subject: [PATCH 6/8] 2009-09-04 Robert Millan * configure.ac: Bump version to 1.97~beta2. * docs/version.texi: Likewise. --- ChangeLog | 5 +++++ configure.ac | 2 +- docs/version.texi | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index bafb163e5..a12ef99e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-04 Robert Millan + + * configure.ac: Bump version to 1.97~beta2. + * docs/version.texi: Likewise. + 2009-09-03 Colin Watson * configure.ac: By default, GCC 4.4 generates .eh_frame sections diff --git a/configure.ac b/configure.ac index 59e046363..551605812 100644 --- a/configure.ac +++ b/configure.ac @@ -31,7 +31,7 @@ dnl (such as TARGET_CC, TARGET_CFLAGS, etc.) are used for the target dnl type. -AC_INIT([GRUB],[1.97~beta1],[bug-grub@gnu.org]) +AC_INIT([GRUB],[1.97~beta2],[bug-grub@gnu.org]) AC_PREREQ(2.59) AC_CONFIG_SRCDIR([include/grub/dl.h]) AC_CONFIG_HEADER([config.h]) diff --git a/docs/version.texi b/docs/version.texi index 4528c7b2e..04c8473f4 100644 --- a/docs/version.texi +++ b/docs/version.texi @@ -1,4 +1,4 @@ @set UPDATED 7 Ago 2009 @set UPDATED-MONTH Ago 2009 -@set EDITION 1.97~beta1 -@set VERSION 1.97~beta1 +@set EDITION 1.97~beta2 +@set VERSION 1.97~beta2 From 70ba68ce8264b5fbb5441e51863965db9baadb4a Mon Sep 17 00:00:00 2001 From: cjwatson Date: Fri, 4 Sep 2009 12:59:54 +0000 Subject: [PATCH 7/8] 2009-09-04 Colin Watson * NEWS: Mention `keystatus' and Unicode fonts. --- ChangeLog | 4 ++++ NEWS | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index a12ef99e3..826bbc2b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-09-04 Colin Watson + + * NEWS: Mention `keystatus' and Unicode fonts. + 2009-09-04 Robert Millan * configure.ac: Bump version to 1.97~beta2. diff --git a/NEWS b/NEWS index c54095e9b..03ba6a268 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,9 @@ New in 1.97 - : +* Add `keystatus' command. + +* Unicode fonts are now used by default. + * Add `hdparm' command. * Add support for getting the current date and time from CMOS as variables. From 197f76c741caf9e67ba0f4bdf5a708f80f5cd049 Mon Sep 17 00:00:00 2001 From: phcoder Date: Fri, 4 Sep 2009 13:16:07 +0000 Subject: [PATCH 8/8] 2009-09-04 Vladimir Serbinenko * loader/i386/xnu.c (grub_cpu_xnu_fill_devicetree): Remove unnecessary calls to grub_error. --- ChangeLog | 5 +++++ loader/i386/xnu.c | 15 ++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 826bbc2b8..7d4946b6e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-04 Vladimir Serbinenko + + * loader/i386/xnu.c (grub_cpu_xnu_fill_devicetree): Remove + unnecessary calls to grub_error. + 2009-09-04 Colin Watson * NEWS: Mention `keystatus' and Unicode fonts. diff --git a/loader/i386/xnu.c b/loader/i386/xnu.c index 06e375c69..39b02c7a3 100644 --- a/loader/i386/xnu.c +++ b/loader/i386/xnu.c @@ -247,7 +247,7 @@ grub_cpu_xnu_fill_devicetree (void) curval->datasize = (SYSTEM_TABLE_SIZEOF (firmware_revision)); curval->data = grub_malloc (curval->datasize); if (! curval->data) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't create device tree"); + return grub_errno; grub_memcpy (curval->data, (SYSTEM_TABLE_VAR(firmware_revision)), curval->datasize); @@ -268,7 +268,7 @@ grub_cpu_xnu_fill_devicetree (void) curval->datasize = sizeof ("EFI32"); curval->data = grub_malloc (curval->datasize); if (! curval->data) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't create device tree"); + return grub_errno; if (SIZEOF_OF_UINTN == 4) grub_memcpy (curval->data, "EFI32", curval->datasize); else @@ -287,7 +287,7 @@ grub_cpu_xnu_fill_devicetree (void) curval->datasize = sizeof (grub_uint64_t); curval->data = grub_malloc (curval->datasize); if (!curval->data) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't create device tree"); + return grub_errno; /* First see if user supplies the value. */ char *fsbvar = grub_env_get ("fsb"); @@ -373,8 +373,7 @@ grub_cpu_xnu_fill_devicetree (void) curval->datasize = SIZEOF_OF_UINTN; curval->data = grub_malloc (curval->datasize); if (! curval->data) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, - "couldn't create device tree"); + return grub_errno; if (SIZEOF_OF_UINTN == 4) *((grub_uint32_t *)curval->data) = PTR_TO_UINT32 (ptr); else @@ -392,8 +391,7 @@ grub_cpu_xnu_fill_devicetree (void) curval->datasize = grub_strlen (table_aliases[j].name) + 1; curval->data = grub_malloc (curval->datasize); if (!curval->data) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, - "couldn't create device tree"); + return grub_errno; grub_memcpy (curval->data, table_aliases[j].name, curval->datasize); } } @@ -409,8 +407,7 @@ grub_cpu_xnu_fill_devicetree (void) curval->datasize = SIZEOF_OF_UINTN; curval->data = grub_malloc (curval->datasize); if (! curval->data) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, - "couldn't create device tree"); + return grub_errno; if (SIZEOF_OF_UINTN == 4) *((grub_uint32_t *) curval->data) = PTR_TO_UINT32 (SYSTEM_TABLE_PTR (runtime_services));