Merge branch 'upstream' into experimental

This commit is contained in:
Colin Watson 2013-11-27 11:00:51 +00:00
commit 0749c27555
17 changed files with 673 additions and 415 deletions

1
.gitignore vendored
View File

@ -161,7 +161,6 @@ GPATH
GRTAGS
GSYMS
GTAGS
Makefile.tpl
compile
depcomp
mdate-sh

View File

@ -1,3 +1,16 @@
2013-11-27 Colin Watson <cjwatson@ubuntu.com>
Generate Makefile.*.am directly from gentpl.py, eliminating the use
of Autogen. The Autogen definitions files remain intact as they
offer a useful abstraction.
2013-11-27 Colin Watson <cjwatson@ubuntu.com>
Add grub_util_disable_fd_syncs call to turn grub_util_fd_sync calls
into no-ops, and use it in programs that copy files but do not need
to take special care to sync writes (grub-mknetdir, grub-rescue,
grub-mkstandalone).
2013-11-26 Colin Watson <cjwatson@ubuntu.com>
* tests/util/grub-fs-tester.in: Execute xorriso from $PATH rather

View File

@ -55,7 +55,6 @@ need the following.
* Python 2.5.2 or later
* Autoconf 2.60 or later
* Automake 1.10.1 or later
* Autogen 5.10 or later
Prerequisites for make-check:

View File

@ -8,8 +8,6 @@ unset LC_ALL
find . -iname '*.[ch]' ! -ipath './grub-core/lib/libgcrypt-grub/*' ! -ipath './build-aux/*' ! -ipath './grub-core/lib/libgcrypt/src/misc.c' ! -ipath './grub-core/lib/libgcrypt/src/global.c' ! -ipath './grub-core/lib/libgcrypt/src/secmem.c' ! -ipath './util/grub-gen-widthspec.c' ! -ipath './util/grub-gen-asciih.c' |sort > po/POTFILES.in
find util -iname '*.in' ! -name Makefile.in |sort > po/POTFILES-shell.in
autogen --version >/dev/null || exit 1
echo "Importing unicode..."
python util/import_unicode.py unicode/UnicodeData.txt unicode/BidiMirroring.txt unicode/ArabicShaping.txt grub-core/unidata.c
@ -32,10 +30,7 @@ for x in mpi-asm-defs.h mpih-add1.c mpih-sub1.c mpih-mul1.c mpih-mul2.c mpih-mul
ln -s generic/"$x" grub-core/lib/libgcrypt-grub/mpi/"$x"
done
echo "Creating Makefile.tpl..."
python gentpl.py | sed -e '/^$/{N;/^\n$/D;}' > Makefile.tpl
echo "Running autogen..."
echo "Generating Automake input..."
# Automake doesn't like including files from a path outside the project.
rm -f contrib grub-core/contrib
@ -59,8 +54,8 @@ for extra in contrib/*/Makefile.core.def; do
fi
done
cat $UTIL_DEFS | autogen -T Makefile.tpl | sed -e '/^$/{N;/^\n$/D;}' > Makefile.util.am
cat $CORE_DEFS | autogen -T Makefile.tpl | sed -e '/^$/{N;/^\n$/D;}' > grub-core/Makefile.core.am
python gentpl.py $UTIL_DEFS > Makefile.util.am
python gentpl.py $CORE_DEFS > grub-core/Makefile.core.am
for extra in contrib/*/Makefile.common; do
if test -e "$extra"; then

View File

@ -131,20 +131,15 @@ EXTRA_DIST =
CLEANFILES =
BUILT_SOURCES =
# Rules for autogen definition files
.PRECIOUS: $(top_srcdir)/Makefile.tpl
$(top_srcdir)/Makefile.tpl: $(top_srcdir)/gentpl.py
python $< | sed -e '/^$$/{N;/^\\n$$/D;}' > $@.new || (rm -f $@.new; exit 1)
mv $@.new $@
# Rules for Automake input
.PRECIOUS: $(top_srcdir)/Makefile.util.am
$(top_srcdir)/Makefile.util.am: $(top_srcdir)/Makefile.util.def $(top_srcdir)/Makefile.utilgcry.def $(top_srcdir)/Makefile.tpl
cat $(top_srcdir)/Makefile.util.def $(top_srcdir)/Makefile.utilgcry.def | autogen -T $(top_srcdir)/Makefile.tpl | sed -e '/^$$/{N;/^\\n$$/D;}' > $@.new || (rm -f $@.new; exit 1)
$(top_srcdir)/Makefile.util.am: $(top_srcdir)/gentpl.py $(top_srcdir)/Makefile.util.def $(top_srcdir)/Makefile.utilgcry.def
python $^ > $@.new || (rm -f $@.new; exit 1)
mv $@.new $@
.PRECIOUS: $(top_srcdir)/grub-core/Makefile.core.am
$(top_srcdir)/grub-core/Makefile.core.am: $(top_srcdir)/grub-core/Makefile.core.def $(top_srcdir)/grub-core/Makefile.gcry.def $(top_srcdir)/Makefile.tpl
$(top_srcdir)/grub-core/Makefile.core.am: $(top_srcdir)/gentpl.py $(top_srcdir)/grub-core/Makefile.core.def $(top_srcdir)/grub-core/Makefile.gcry.def
if [ "x$$GRUB_CONTRIB" != x ]; then echo "You need to run ./autogen.sh manually." >&2; exit 1; fi
cat $(top_srcdir)/grub-core/Makefile.core.def $(top_srcdir)/grub-core/Makefile.gcry.def | autogen -T $(top_srcdir)/Makefile.tpl | sed -e '/^$$/{N;/^\\n$$/D;}' > $@.new || (rm -f $@.new; exit 1)
python $^ > $@.new || (rm -f $@.new; exit 1)
mv $@.new $@

View File

@ -2,7 +2,6 @@ EXTRA_DIST += autogen.sh
EXTRA_DIST += geninit.sh
EXTRA_DIST += gentpl.py
EXTRA_DIST += Makefile.tpl
EXTRA_DIST += Makefile.util.def
EXTRA_DIST += Makefile.utilgcry.def

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
grub2 (2.00+20131126-1) UNRELEASED; urgency=low
grub2 (2.00+20131127-1) UNRELEASED; urgency=low
* New upstream snapshot.
- Skip issuing cursor on/off sequences on Macs (closes: #683068).

View File

@ -3,13 +3,13 @@ Author: Mario Limonciello <Mario_Limonciello@dell.com>
Author: Colin Watson <cjwatson@ubuntu.com>
Bug-Ubuntu: https://bugs.launchpad.net/bugs/677758
Forwarded: http://lists.gnu.org/archive/html/grub-devel/2011-01/msg00028.html
Last-Update: 2013-11-26
Last-Update: 2013-11-27
Index: b/util/grub-mkrescue.c
===================================================================
--- a/util/grub-mkrescue.c
+++ b/util/grub-mkrescue.c
@@ -635,12 +635,18 @@
@@ -636,12 +636,18 @@
make_image_fwdisk_abs (GRUB_INSTALL_PLATFORM_IA64_EFI, "ia64-efi", imgname);
free (imgname);

984
gentpl.py

File diff suppressed because it is too large Load Diff

View File

@ -455,6 +455,8 @@ grub_util_fd_close (grub_util_fd_t fd)
}
}
static int allow_fd_syncs = 1;
static void
grub_util_fd_sync_volume (grub_util_fd_t fd)
{
@ -469,17 +471,26 @@ grub_util_fd_sync_volume (grub_util_fd_t fd)
void
grub_util_fd_sync (grub_util_fd_t fd)
{
switch (fd->type)
if (allow_fd_syncs)
{
case GRUB_UTIL_FD_FILE:
fsync (fd->fd);
return;
case GRUB_UTIL_FD_DISK:
grub_util_fd_sync_volume (fd);
return;
switch (fd->type)
{
case GRUB_UTIL_FD_FILE:
fsync (fd->fd);
return;
case GRUB_UTIL_FD_DISK:
grub_util_fd_sync_volume (fd);
return;
}
}
}
void
grub_util_disable_fd_syncs (void)
{
allow_fd_syncs = 0;
}
void
grub_hostdisk_flush_initial_buffer (const char *os_dev __attribute__ ((unused)))
{

View File

@ -191,10 +191,19 @@ grub_util_fd_strerror (void)
return strerror (errno);
}
static int allow_fd_syncs = 1;
void
grub_util_fd_sync (grub_util_fd_t fd)
{
fsync (fd);
if (allow_fd_syncs)
fsync (fd);
}
void
grub_util_disable_fd_syncs (void)
{
allow_fd_syncs = 0;
}
void

View File

@ -240,10 +240,19 @@ grub_util_fd_write (grub_util_fd_t fd, const char *buf, size_t len)
return real_read;
}
static int allow_fd_syncs = 1;
void
grub_util_fd_sync (grub_util_fd_t fd)
{
FlushFileBuffers (fd);
if (allow_fd_syncs)
FlushFileBuffers (fd);
}
void
grub_util_disable_fd_syncs (void)
{
allow_fd_syncs = 0;
}
void

View File

@ -50,6 +50,8 @@ EXPORT_FUNC(grub_util_fd_strerror) (void);
void
grub_util_fd_sync (grub_util_fd_t fd);
void
grub_util_disable_fd_syncs (void);
void
EXPORT_FUNC(grub_util_fd_close) (grub_util_fd_t fd);
grub_uint64_t

View File

@ -492,7 +492,7 @@ grub_install_make_image_wrap (const char *dir, const char *prefix,
memdisk_path, config_path,
mkimage_target, note, comp);
fflush (fp);
fsync (fileno (fp));
grub_util_fd_sync (fileno (fp));
fclose (fp);
}

View File

@ -171,6 +171,7 @@ main (int argc, char *argv[])
const char *pkglibdir;
grub_util_host_init (&argc, &argv);
grub_util_disable_fd_syncs ();
rootdir = xstrdup ("/srv/tftp");
pkglibdir = grub_util_get_pkglibdir ();

View File

@ -369,6 +369,7 @@ main (int argc, char *argv[])
const char *pkgdatadir;
grub_util_host_init (&argc, &argv);
grub_util_disable_fd_syncs ();
pkgdatadir = grub_util_get_pkgdatadir ();
@ -529,7 +530,7 @@ main (int argc, char *argv[])
GRUB_COMPRESSION_AUTO);
sz = ftello (sa);
fflush (sa);
fsync (fileno (sa));
grub_util_fd_sync (fileno (sa));
fclose (sa);
if (sz > 32768)

View File

@ -305,6 +305,7 @@ main (int argc, char *argv[])
int i;
grub_util_host_init (&argc, &argv);
grub_util_disable_fd_syncs ();
files = xmalloc ((argc + 1) * sizeof (files[0]));