diff --git a/ChangeLog b/ChangeLog index 90bbce0e2..1977f24ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,136 @@ +2010-03-14 Thorsten Glaser + + * util/grub-mkrescue.in: Base ISO UUID on UTC. + +2010-03-08 Matt Kraai + + * util/i386/pc/grub-setup.c (setup): Fix a grammatical error (Debian + bug #559005). + +2010-03-07 Vladimir Serbinenko + + * genmoddep.awk: Output all missing symbols and not only first. + +2010-03-06 Vladimir Serbinenko + + * NEWS: Put the date of 1.98 release. + +2010-03-06 Vladimir Serbinenko + + * configure.ac: Update CPPFLAGS and not CFLAGS when checking for + ft2build.h. + +2010-03-06 Vladimir Serbinenko + + * normal/cmdline.c (grub_cmdline_get): Fix gabled line after + completition in the middle of string. + +2010-03-06 Vladimir Serbinenko + + * util/grub-mkrescue.in: Use mktemp with explicit template. + +2010-03-06 Vladimir Serbinenko + + * loader/i386/bsd.c (grub_bsd_get_device): Fix a memory leak. + +2010-03-06 Vladimir Serbinenko + + * loader/i386/multiboot_mbi.c (grub_multiboot_set_bootdev): Free the + right pointer. + +2010-03-05 Vladimir Serbinenko + + Fix FreeBSD compilation. + + * Makefile.in (TARGET_CPPFLAGS): Remove -nostdinc -isystem. + * configure.ac: Add -nostdinc -isystem to TARGET_CPPFLAGS if it works. + +2010-03-05 Vladimir Serbinenko + + * util/import_gcry.py: Add autogenerated files to MAINTAINER_CLEANFILES. + +2010-03-04 Vladimir Serbinenko + + * gettext/gettext.c (grub_gettext_init_ext): Fix a memory leak. + +2010-03-04 Vladimir Serbinenko + + * disk/scsi.c (grub_scsi_iterate): Fix a memory leak. + +2010-03-04 Robert Millan + + Support relative image path in theme file. + + * gfxmenu/gui_image.c (grub_gui_image): New member theme_dir. + (image_set_property): Handle theme_dir and relative path. + +2010-03-04 Vladimir Serbinenko + + * configure.ac: Alias amd64 to x86_64. + +2010-03-04 Vladimir Serbinenko + + * NEWS: mention multiboot on EFI. + +2010-03-04 Vladimir Serbinenko + + * kern/main.c (grub_load_modules): Handle errors from init functions of + embeded modules. + +2010-03-04 Vladimir Serbinenko + + * normal/autofs.c (autoload_fs_module): Handle errors. + +2010-03-04 Vladimir Serbinenko + + Disable linux.mod on qemu-mips since it's not functional and leads + to compilation failure. + + * conf/mips.rmk (pkglib_MODULES): Remove linux.mod. + * conf/mips-yeeloong.rmk (pkglib_MODULES): Add linux.mod. + * conf/mips.rmk (linux_mod_SOURCES): Move from here ... + * conf/mips-yeeloong.rmk (linux_mod_SOURCES): ... here + * conf/mips.rmk (linux_mod_CFLAGS): Move from here ... + * conf/mips-yeeloong.rmk (linux_mod_CFLAGS): ... here + * conf/mips.rmk (linux_mod_ASFLAGS): Move from here ... + * conf/mips-yeeloong.rmk (linux_mod_ASFLAGS): ... here + * conf/mips.rmk (linux_mod_LDFLAGS): Move from here ... + * conf/mips-yeeloong.rmk (linux_mod_LDFLAGS): ... here + Reported by: BVK Chaitanya + +2010-03-04 Jordan Uggla + + * INSTALL: Add gettext as a dependency and add qemu to a new section + "Prerequisites for make-check". + +2010-03-04 Christian Franke + + * util/grub-pe2elf.c: Add missing include "progname.h". + +2010-03-04 Vladimir Serbinenko + + * normal/crypto.c (read_crypto_list): Fix a typo. + Reported by: Seth Goldberg. + +2010-03-04 Vladimir Serbinenko + + * Makefile.in (DISTCLEANFILES): Add stamp-h1. + Reported by: Seth Goldberg. + +2010-03-04 Vladimir Serbinenko + + * Makefile.in (CLEANFILES) [FONT_SOURCE && grub_mkfont]: Add + ascii.bitmaps. + +2010-03-04 Vladimir Serbinenko + + * genmk.rb: Remove terminal*.lst in make clean. + Reported by: Seth Goldberg. + +2010-03-04 Vladimir Serbinenko + + * util/i386/efi/grub-install.in: Copy gettext files. + 2010-03-01 Vladimir Serbinenko * fs/ext2.c (grub_ext2_read_block): Fix an integer overflow. diff --git a/INSTALL b/INSTALL index cfade2026..0dd408bcc 100644 --- a/INSTALL +++ b/INSTALL @@ -14,6 +14,7 @@ configuring the GRUB. * GCC 4.1.3 or later * GNU Make * GNU Bison 2.3 or later +* GNU gettext 0.17 or later * GNU binutils 2.9.1.0.23 or later * Other standard GNU/Unix tools @@ -25,6 +26,10 @@ need the following. * Autoconf 2.60 or later * Automake 1.10.1 or later +Prerequisites for make-check: + +* qemu, specifically the binary 'qemu-system-i386' + Configuring the GRUB ==================== diff --git a/Makefile.in b/Makefile.in index 539cde397..47584cdde 100644 --- a/Makefile.in +++ b/Makefile.in @@ -89,7 +89,7 @@ TARGET_ASFLAGS = @TARGET_ASFLAGS@ TARGET_MODULE_FORMAT = @TARGET_MODULE_FORMAT@ TARGET_APPLE_CC = @TARGET_APPLE_CC@ OBJCONV = @OBJCONV@ -TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -nostdinc -isystem $(shell $(TARGET_CC) -print-file-name=include) -I$(srcdir)/include -I$(builddir) -I$(builddir)/include \ +TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -I$(srcdir)/include -I$(builddir) -I$(builddir)/include \ -Wall -W TARGET_LDFLAGS = @TARGET_LDFLAGS@ TARGET_IMG_LDSCRIPT = @TARGET_IMG_LDSCRIPT@ @@ -147,7 +147,7 @@ INFOS = $(info_INFOS) CLEANFILES = MOSTLYCLEANFILES = DISTCLEANFILES = config.status config.cache config.log config.h \ - Makefile stamp-h include/grub/cpu include/grub/machine \ + Makefile stamp-h stamp-h1 include/grub/cpu include/grub/machine \ gensymlist.sh genkernsyms.sh build_env.mk \ docs/grub.info docs/version.texi docs/stamp-vti @@ -239,6 +239,7 @@ else ifeq ($(enable_grub_mkfont),yes) pkgdata_DATA += unicode.pf2 ascii.pf2 ascii.h +CLEANFILES += ascii.bitmaps # Arrows and lines are needed to draw the menu, so we always include them UNICODE_ARROWS=0x2190-0x2193 diff --git a/NEWS b/NEWS index 828eea081..1e3334f18 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ -New in 1.98: +New in 1.98 - 2010-03-06: + +* Multiboot on EFI support. * Graphical menu support. diff --git a/conf/mips-yeeloong.rmk b/conf/mips-yeeloong.rmk index 0d9a4c1bb..9977f7881 100644 --- a/conf/mips-yeeloong.rmk +++ b/conf/mips-yeeloong.rmk @@ -76,6 +76,11 @@ datehook_mod_SOURCES = hook/datehook.c datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +pkglib_MODULES += linux.mod +linux_mod_SOURCES = loader/$(target_cpu)/linux.c +linux_mod_CFLAGS = $(COMMON_CFLAGS) +linux_mod_ASFLAGS = $(COMMON_ASFLAGS) +linux_mod_LDFLAGS = $(COMMON_LDFLAGS) sbin_SCRIPTS += grub-install grub_install_SOURCES = util/grub-install.in diff --git a/conf/mips.rmk b/conf/mips.rmk index c7c80a26d..536d35cac 100644 --- a/conf/mips.rmk +++ b/conf/mips.rmk @@ -73,10 +73,4 @@ relocator_mod_CFLAGS = $(COMMON_CFLAGS) relocator_mod_ASFLAGS = $(COMMON_ASFLAGS) relocator_mod_LDFLAGS = $(COMMON_LDFLAGS) -pkglib_MODULES += linux.mod -linux_mod_SOURCES = loader/$(target_cpu)/linux.c -linux_mod_CFLAGS = $(COMMON_CFLAGS) -linux_mod_ASFLAGS = $(COMMON_ASFLAGS) -linux_mod_LDFLAGS = $(COMMON_LDFLAGS) - include $(srcdir)/conf/common.mk diff --git a/configure.ac b/configure.ac index 4bf455d13..e06b0a55c 100644 --- a/configure.ac +++ b/configure.ac @@ -51,6 +51,7 @@ fi case "$target_cpu" in i[[3456]]86) target_cpu=i386 ;; + amd64) target_cpu=x86_64 ;; sparc) target_cpu=sparc64 ;; mipsel|mips64el) target_cpu=mips; @@ -521,6 +522,19 @@ enable_efiemu=no fi AC_SUBST([enable_efiemu]) +AC_CACHE_CHECK([whether -nostdinc -isystem works], [grub_cv_cc_isystem], [ + SAVED_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include +int va_arg_func (int fixed, va_list args);]], [[]])], + [grub_cv_cc_isystem=yes], + [grub_cv_cc_isystem=no]) + CPPFLAGS="$SAVED_CPPFLAGS" +]) + +if test x"$grub_cv_cc_isystem" = xyes ; then + TARGET_CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`" +fi # Restore the flags. CC="$tmp_CC" @@ -687,11 +701,11 @@ fi if test x"$grub_mkfont_excuse" = x ; then # Check for freetype libraries. - SAVED_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $freetype_cflags" + SAVED_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $freetype_cflags" AC_CHECK_HEADERS([ft2build.h], [], [grub_mkfont_excuse=["need freetype2 headers"]]) - CFLAGS="$SAVED_CFLAGS" + CPPFLAGS="$SAVED_CPPFLAGS" fi if test x"$enable_grub_mkfont" = xyes && test x"$grub_mkfont_excuse" != x ; then diff --git a/disk/scsi.c b/disk/scsi.c index 6f3233b29..eba237287 100644 --- a/disk/scsi.c +++ b/disk/scsi.c @@ -208,12 +208,14 @@ grub_scsi_iterate (int (*hook) (const char *name)) for (i = 0; i < luns; i++) { char *sname; + int ret; sname = grub_xasprintf ("%s%c", name, 'a' + i); if (!sname) return 1; - if (hook (sname)) - return 1; + ret = hook (sname); grub_free (sname); + if (ret) + return 1; } return 0; } diff --git a/genmk.rb b/genmk.rb index df03e1dfe..efea16412 100644 --- a/genmk.rb +++ b/genmk.rb @@ -201,7 +201,7 @@ endif -include #{dep} clean-module-#{extra_target}.#{@rule_count}: - rm -f #{command} #{fs} #{partmap} #{handler} #{parttool} #{video} + rm -f #{command} #{fs} #{partmap} #{handler} #{parttool} #{video} #{terminal} CLEAN_MODULE_TARGETS += clean-module-#{extra_target}.#{@rule_count} diff --git a/genmoddep.awk b/genmoddep.awk index 19ac80c71..48419a091 100644 --- a/genmoddep.awk +++ b/genmoddep.awk @@ -32,13 +32,12 @@ FNR == 1 { else if ($1 != "__gnu_local_gp") { printf "%s in %s is not defined\n", $1, module >"/dev/stderr"; error++; - exit; } } # Output the result. END { - if (error == 1) + if (error >= 1) exit 1; for (mod in modtab) { diff --git a/gettext/gettext.c b/gettext/gettext.c index 9a1756be7..0aa8decbd 100644 --- a/gettext/gettext.c +++ b/gettext/gettext.c @@ -279,13 +279,6 @@ grub_gettext_init_ext (const char *lang) /* mo_file e.g.: /boot/grub/locale/ca.mo */ - mo_file = - grub_malloc (grub_strlen (locale_dir) + grub_strlen ("/") + - grub_strlen (lang) + grub_strlen (".mo") + 1); - - /* Warning: if changing some paths in the below line, change the grub_malloc - contents below. */ - mo_file = grub_xasprintf ("%s/%s.mo", locale_dir, lang); if (!mo_file) return; diff --git a/gfxmenu/gui_image.c b/gfxmenu/gui_image.c index ef8bcbe9a..3988f4ba8 100644 --- a/gfxmenu/gui_image.c +++ b/gfxmenu/gui_image.c @@ -31,6 +31,7 @@ struct grub_gui_image grub_gui_container_t parent; grub_video_rect_t bounds; char *id; + char *theme_dir; struct grub_video_bitmap *raw_bitmap; struct grub_video_bitmap *bitmap; }; @@ -208,8 +209,28 @@ static grub_err_t image_set_property (void *vself, const char *name, const char *value) { grub_gui_image_t self = vself; - if (grub_strcmp (name, "file") == 0) - return load_image (self, value); + if (grub_strcmp (name, "theme_dir") == 0) + { + grub_free (self->theme_dir); + self->theme_dir = grub_strdup (value); + } + else if (grub_strcmp (name, "file") == 0) + { + char *absvalue; + grub_err_t err; + + /* Resolve to an absolute path. */ + if (! self->theme_dir) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "unspecified theme_dir"); + absvalue = grub_resolve_relative_path (self->theme_dir, value); + if (! absvalue) + return grub_errno; + + err = load_image (self, absvalue); + grub_free (absvalue); + + return err; + } else if (grub_strcmp (name, "id") == 0) { grub_free (self->id); diff --git a/kern/main.c b/kern/main.c index 54235821d..2f2c951ab 100644 --- a/kern/main.c +++ b/kern/main.c @@ -87,6 +87,9 @@ grub_load_modules (void) (header->size - sizeof (struct grub_module_header)))) grub_fatal ("%s", grub_errmsg); + if (grub_errno) + grub_print_error (); + return 0; } diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index 3dd3c70c5..949de408d 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -154,8 +154,8 @@ grub_bsd_get_device (grub_uint32_t * biosdev, dev = grub_device_open (0); if (dev && dev->disk && dev->disk->partition) { - - p = dev->disk->partition->partmap->get_name (dev->disk->partition); + char *p0; + p0 = p = dev->disk->partition->partmap->get_name (dev->disk->partition); if (p) { if ((p[0] >= '0') && (p[0] <= '9')) @@ -169,6 +169,7 @@ grub_bsd_get_device (grub_uint32_t * biosdev, if ((p[0] >= 'a') && (p[0] <= 'z')) *part = p[0] - 'a'; } + grub_free (p0); } if (dev) grub_device_close (dev); diff --git a/loader/i386/multiboot_mbi.c b/loader/i386/multiboot_mbi.c index 3f937c446..6391564d6 100644 --- a/loader/i386/multiboot_mbi.c +++ b/loader/i386/multiboot_mbi.c @@ -448,8 +448,8 @@ grub_multiboot_set_bootdev (void) dev = grub_device_open (0); if (dev && dev->disk && dev->disk->partition) { - - p = dev->disk->partition->partmap->get_name (dev->disk->partition); + char *p0; + p = p0 = dev->disk->partition->partmap->get_name (dev->disk->partition); if (p) { if ((p[0] >= '0') && (p[0] <= '9')) @@ -463,7 +463,7 @@ grub_multiboot_set_bootdev (void) if ((p[0] >= 'a') && (p[0] <= 'z')) part = p[0] - 'a'; } - grub_free (p); + grub_free (p0); } if (dev) grub_device_close (dev); diff --git a/normal/autofs.c b/normal/autofs.c index 57e43fdf4..11b3fc1be 100644 --- a/normal/autofs.c +++ b/normal/autofs.c @@ -38,6 +38,9 @@ autoload_fs_module (void) if (! grub_dl_get (p->name) && grub_dl_load (p->name)) return 1; + if (grub_errno) + grub_print_error (); + fs_module_list = p->next; grub_free (p->name); grub_free (p); diff --git a/normal/cmdline.c b/normal/cmdline.c index f63953944..05d665411 100644 --- a/normal/cmdline.c +++ b/normal/cmdline.c @@ -303,8 +303,9 @@ grub_cmdline_get (const char *prompt) grub_memmove (buf + lpos, str, len * sizeof (grub_uint32_t)); llen += len; + cl_set_pos_all (); + cl_print_all (lpos, 0); lpos += len; - cl_print_all (lpos - len, 0); cl_set_pos_all (); } } @@ -473,7 +474,6 @@ grub_cmdline_get (const char *prompt) if (t != 1) cl_insert (insert); lpos++; - cl_set_pos_all (); } else { @@ -485,6 +485,7 @@ grub_cmdline_get (const char *prompt) grub_free (insertu8); grub_free (insert); } + cl_set_pos_all (); } break; diff --git a/normal/crypto.c b/normal/crypto.c index 95899fbd5..f051e2c4c 100644 --- a/normal/crypto.c +++ b/normal/crypto.c @@ -95,7 +95,7 @@ read_crypto_list (void) return; } - /* Override previous commands.lst. */ + /* Override previous crypto.lst. */ grub_crypto_spec_free (); for (;; grub_free (buf)) diff --git a/util/grub-mkrescue.in b/util/grub-mkrescue.in index 6b3c9ecb8..db29b0899 100644 --- a/util/grub-mkrescue.in +++ b/util/grub-mkrescue.in @@ -86,7 +86,15 @@ if [ "x${output_image}" = x ] ; then exit 1 fi -iso9660_dir=`mktemp -d` +if test "x$TMP" != x; then + MKTEMP_TEMPLATE="$TMP/grub-mkrescue.XXXXXXXXXX" +elif test "x$TEMP" != x; then + MKTEMP_TEMPLATE="$TEMP/grub-mkrescue.XXXXXXXXXX" +else + MKTEMP_TEMPLATE="/tmp/grub-mkrescue.XXXXXXXXXX" +fi + +iso9660_dir=`mktemp -d "$MKTEMP_TEMPLATE"` mkdir -p ${iso9660_dir}/boot/grub process_input_dir () @@ -133,11 +141,11 @@ fi # build coreboot core.img if test -e "${coreboot_dir}" ; then echo "Enabling coreboot support ..." - memdisk_img=`mktemp` - memdisk_dir=`mktemp -d` + memdisk_img=`mktemp "$MKTEMP_TEMPLATE"` + memdisk_dir=`mktemp -d "$MKTEMP_TEMPLATE"` mkdir -p ${memdisk_dir}/boot/grub # obtain date-based UUID - iso_uuid=$(date +%Y-%m-%d-%H-%M-%S-00) + iso_uuid=$(date -u +%Y-%m-%d-%H-%M-%S-00) modules="$(cat ${coreboot_dir}/partmap.lst) ${modules}" cat << EOF > ${memdisk_dir}/boot/grub/grub.cfg @@ -162,12 +170,12 @@ fi # build BIOS core.img if test -e "${pc_dir}" ; then echo "Enabling BIOS support ..." - core_img=`mktemp` + core_img=`mktemp "$MKTEMP_TEMPLATE"` grub-mkimage -d ${pc_dir}/ -o ${core_img} --prefix=/boot/grub/i386-pc \ iso9660 biosdisk cat ${pc_dir}/cdboot.img ${core_img} > ${iso9660_dir}/boot/grub/i386-pc/eltorito.img - embed_img=`mktemp` + embed_img=`mktemp "$MKTEMP_TEMPLATE"` cat ${pc_dir}/boot.img ${core_img} > ${embed_img} rm -f ${core_img} diff --git a/util/grub-pe2elf.c b/util/grub-pe2elf.c index 488ad9b23..f370bbfa8 100644 --- a/util/grub-pe2elf.c +++ b/util/grub-pe2elf.c @@ -29,6 +29,8 @@ #include #include +#include "progname.h" + static struct option options[] = { {"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'V'}, diff --git a/util/i386/efi/grub-install.in b/util/i386/efi/grub-install.in index caa7be7e4..6a8573e81 100644 --- a/util/i386/efi/grub-install.in +++ b/util/i386/efi/grub-install.in @@ -180,6 +180,14 @@ for file in ${pkglibdir}/*.mod ${pkglibdir}/*.lst; do cp -f $file ${grubdir} || exit 1 done +# Copy gettext files +mkdir -p ${grubdir}/locale/ +for file in ${grubdir}/locale/*.mo ${pkglibdir}/locale/*.mo; do + if test -f "$file"; then + cp -f "$file" ${grubdir}/locale/ + fi +done + if ! test -f ${grubdir}/grubenv; then $grub_editenv ${grubdir}/grubenv create fi diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 4e2517ef2..ace577f37 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -418,7 +418,7 @@ unable_to_embed: grub_util_warn (_("Embedding is not possible. GRUB can only be installed in this " "setup by using blocklists. However, blocklists are UNRELIABLE and " - "its use is discouraged.")); + "their use is discouraged.")); if (! force) grub_util_error (_("if you really want blocklists, use --force")); diff --git a/util/import_gcry.py b/util/import_gcry.py index d71924d53..b9c3edcde 100644 --- a/util/import_gcry.py +++ b/util/import_gcry.py @@ -62,6 +62,7 @@ mdblocksizes = {"_gcry_digest_spec_crc32" : 64, "_gcry_digest_spec_whirlpool" : 64} cryptolist = open (os.path.join (cipher_dir_out, "crypto.lst"), "w") +conf.write ("MAINTAINER_CLEANFILES += $(srcdir)/conf/gcry.rmk $(srcdir)/lib/libgcrypt-grub/cipher/ChangeLog $(srcdir)/lib/libgcrypt-grub/cipher/cipher.h $(srcdir)/lib/libgcrypt-grub/cipher/crypto.lst $(srcdir)/lib/libgcrypt-grub/cipher/g10lib.h $(srcdir)/lib/libgcrypt-grub/cipher/memory.h $(srcdir)/lib/libgcrypt-grub/cipher/types.h\n"); # rijndael is the only cipher using aliases. So no need for mangling, just # hardcode it @@ -87,6 +88,7 @@ for cipher_file in cipher_files: continue nch = False if re.match (".*\.[ch]$", cipher_file): + conf.write ("MAINTAINER_CLEANFILES += $(srcdir)/lib/libgcrypt-grub/cipher/" + cipher_file + "\n"); isc = re.match (".*\.c$", cipher_file) f = open (infile, "r") fw = open (outfile, "w")