Merge mainline into sparc-mkimage

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-03-14 15:21:04 +01:00
commit 313df2f552
23 changed files with 238 additions and 41 deletions

133
ChangeLog
View File

@ -1,3 +1,136 @@
2010-03-14 Thorsten Glaser <tg@mirbsd.org>
* util/grub-mkrescue.in: Base ISO UUID on UTC.
2010-03-08 Matt Kraai <kraai@ftbfs.org>
* util/i386/pc/grub-setup.c (setup): Fix a grammatical error (Debian
bug #559005).
2010-03-07 Vladimir Serbinenko <phcoder@gmail.com>
* genmoddep.awk: Output all missing symbols and not only first.
2010-03-06 Vladimir Serbinenko <phcoder@gmail.com>
* NEWS: Put the date of 1.98 release.
2010-03-06 Vladimir Serbinenko <phcoder@gmail.com>
* configure.ac: Update CPPFLAGS and not CFLAGS when checking for
ft2build.h.
2010-03-06 Vladimir Serbinenko <phcoder@gmail.com>
* normal/cmdline.c (grub_cmdline_get): Fix gabled line after
completition in the middle of string.
2010-03-06 Vladimir Serbinenko <phcoder@gmail.com>
* util/grub-mkrescue.in: Use mktemp with explicit template.
2010-03-06 Vladimir Serbinenko <phcoder@gmail.com>
* loader/i386/bsd.c (grub_bsd_get_device): Fix a memory leak.
2010-03-06 Vladimir Serbinenko <phcoder@gmail.com>
* loader/i386/multiboot_mbi.c (grub_multiboot_set_bootdev): Free the
right pointer.
2010-03-05 Vladimir Serbinenko <phcoder@gmail.com>
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 <phcoder@gmail.com>
* util/import_gcry.py: Add autogenerated files to MAINTAINER_CLEANFILES.
2010-03-04 Vladimir Serbinenko <phcoder@gmail.com>
* gettext/gettext.c (grub_gettext_init_ext): Fix a memory leak.
2010-03-04 Vladimir Serbinenko <phcoder@gmail.com>
* disk/scsi.c (grub_scsi_iterate): Fix a memory leak.
2010-03-04 Robert Millan <rmh.grub@aybabtu.com>
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 <phcoder@gmail.com>
* configure.ac: Alias amd64 to x86_64.
2010-03-04 Vladimir Serbinenko <phcoder@gmail.com>
* NEWS: mention multiboot on EFI.
2010-03-04 Vladimir Serbinenko <phcoder@gmail.com>
* kern/main.c (grub_load_modules): Handle errors from init functions of
embeded modules.
2010-03-04 Vladimir Serbinenko <phcoder@gmail.com>
* normal/autofs.c (autoload_fs_module): Handle errors.
2010-03-04 Vladimir Serbinenko <phcoder@gmail.com>
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 <jordan.uggla@gmail.com>
* INSTALL: Add gettext as a dependency and add qemu to a new section
"Prerequisites for make-check".
2010-03-04 Christian Franke <franke@computer.org>
* util/grub-pe2elf.c: Add missing include "progname.h".
2010-03-04 Vladimir Serbinenko <phcoder@gmail.com>
* normal/crypto.c (read_crypto_list): Fix a typo.
Reported by: Seth Goldberg.
2010-03-04 Vladimir Serbinenko <phcoder@gmail.com>
* Makefile.in (DISTCLEANFILES): Add stamp-h1.
Reported by: Seth Goldberg.
2010-03-04 Vladimir Serbinenko <phcoder@gmail.com>
* Makefile.in (CLEANFILES) [FONT_SOURCE && grub_mkfont]: Add
ascii.bitmaps.
2010-03-04 Vladimir Serbinenko <phcoder@gmail.com>
* genmk.rb: Remove terminal*.lst in make clean.
Reported by: Seth Goldberg.
2010-03-04 Vladimir Serbinenko <phcoder@gmail.com>
* util/i386/efi/grub-install.in: Copy gettext files.
2010-03-01 Vladimir Serbinenko <phcoder@gmail.com>
* fs/ext2.c (grub_ext2_read_block): Fix an integer overflow.

View File

@ -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
====================

View File

@ -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

4
NEWS
View File

@ -1,4 +1,6 @@
New in 1.98:
New in 1.98 - 2010-03-06:
* Multiboot on EFI support.
* Graphical menu support.

View File

@ -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

View File

@ -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

View File

@ -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 <stdarg.h>
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

View File

@ -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;
}

View File

@ -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}

View File

@ -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) {

View File

@ -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;

View File

@ -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);

View File

@ -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;
}

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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))

View File

@ -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}

View File

@ -29,6 +29,8 @@
#include <stdlib.h>
#include <getopt.h>
#include "progname.h"
static struct option options[] = {
{"help", no_argument, 0, 'h'},
{"version", no_argument, 0, 'V'},

View File

@ -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

View File

@ -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"));

View File

@ -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")