Commit a9ea042d authored by Lorenzo "Palinuro" Faletra's avatar Lorenzo "Palinuro" Faletra
Browse files

Import Debian changes 2.02+dfsg1-13parrot1

grub2 (2.02+dfsg1-13parrot1) parrot; urgency=medium

  * Import new Debian release.
  * Include patch for failover boot options (disable acpi, disable nouveau).

grub2 (2.02+dfsg1-13) unstable; urgency=medium

  * Add regexp module to signed UEFI images.
  * debian/signing-template.json.in: Use new extendable format.

  [ Debconf translations ]
  * [nb] Norwegian Bokmål (Petter Reinholdtsen; closes: #924326).

grub2 (2.02+dfsg1-12) unstable; urgency=medium

  [ Colin Watson ]
  * Remove code to migrate grub-pc/install_devices to persistent device
    names under /dev/disk/by-id/.  This migration happened in
    1.98+20100702-1, which was in squeeze (four stable releases ago), so we
    no longer need to carry around this complex code.
  * Preserve previous answer to grub-pc/install_devices if we have to ask
    grub-pc/install_devices_disks_changed and the user chooses not to
    install to any devices, so that we can recover from temporary bugs that
    cause /dev/disk/by-id/ paths to change (closes: #919029).
  * debian/signing-template.json.in: Add trusted_certs key (empty, since
    GRUB has no hardcoded list of trusted certificates).
  * util: Detect more I/O errors (closes: #922741).

  [ Leif Lindholm ]
  * arm64/efi: Fix grub_efi_get_ram_base().

  [ Steve McIntyre ]
  * grub-install: Check for arm-efi as a default target (closes: #922104).

  [ James Clarke ]
  * osdep/freebsd: Fix partition calculation for EBR entries (closes:
    #923253).
parent 2e758a3d
# see git-dpm(1) from git-dpm package
ec85b3d37cd12b4121a286a47e84ecb79a714df8
ec85b3d37cd12b4121a286a47e84ecb79a714df8
0cc1bd74c82c94ad93049a7298987c8f155cd0d2
0cc1bd74c82c94ad93049a7298987c8f155cd0d2
59aeb1cfaa3d5bfd7bbeeee0f0d37f6d9eed51fe
59aeb1cfaa3d5bfd7bbeeee0f0d37f6d9eed51fe
grub2_2.02+dfsg1.orig.tar.xz
......
......@@ -121,6 +121,7 @@ CD_MODULES="
password_pbkdf2
png
reboot
regexp
search
search_fs_uuid
search_fs_file
......
grub2 (2.02+dfsg1-13parrot1) parrot; urgency=medium
* Import new Debian release.
* Include patch for failover boot options (disable acpi, disable nouveau).
-- Lorenzo "Palinuro" Faletra <palinuro@parrotsec.org> Wed, 20 Mar 2019 13:29:56 +0100
grub2 (2.02+dfsg1-13) unstable; urgency=medium
* Add regexp module to signed UEFI images.
* debian/signing-template.json.in: Use new extendable format.
[ Debconf translations ]
* [nb] Norwegian Bokmål (Petter Reinholdtsen; closes: #924326).
-- Colin Watson <cjwatson@debian.org> Thu, 14 Mar 2019 10:33:24 +0000
grub2 (2.02+dfsg1-12) unstable; urgency=medium
[ Colin Watson ]
* Remove code to migrate grub-pc/install_devices to persistent device
names under /dev/disk/by-id/. This migration happened in
1.98+20100702-1, which was in squeeze (four stable releases ago), so we
no longer need to carry around this complex code.
* Preserve previous answer to grub-pc/install_devices if we have to ask
grub-pc/install_devices_disks_changed and the user chooses not to
install to any devices, so that we can recover from temporary bugs that
cause /dev/disk/by-id/ paths to change (closes: #919029).
* debian/signing-template.json.in: Add trusted_certs key (empty, since
GRUB has no hardcoded list of trusted certificates).
* util: Detect more I/O errors (closes: #922741).
[ Leif Lindholm ]
* arm64/efi: Fix grub_efi_get_ram_base().
[ Steve McIntyre ]
* grub-install: Check for arm-efi as a default target (closes: #922104).
[ James Clarke ]
* osdep/freebsd: Fix partition calculation for EBR entries (closes:
#923253).
-- Colin Watson <cjwatson@debian.org> Fri, 01 Mar 2019 12:34:45 +0000
grub2 (2.02+dfsg1-11parrot1) testing; urgency=medium
* Import new Debian release.
......
Description: Add failsafe options for acpi and nouveau on boot screen
Author: Lorenzo "Palinuro" Faletra <palinuro@parrotsec.org>
Last-Update: 2019-03-20
--- grub2-2.02+dfsg1.orig/util/grub.d/10_linux.in
+++ grub2-2.02+dfsg1/util/grub.d/10_linux.in
@@ -17,6 +17,8 @@ set -e
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
+
+
prefix="@prefix@"
exec_prefix="@exec_prefix@"
datarootdir="@datarootdir@"
@@ -120,6 +122,10 @@ linux_entry ()
title="$(gettext_printf "%s, with Linux %s (%s)" "${os}" "${version}" "$(gettext "${GRUB_RECOVERY_TITLE}")")" ;;
init-*)
title="$(gettext_printf "%s, with Linux %s (%s)" "${os}" "${version}" "${type#init-}")" ;;
+ nouveau-off)
+ title="$(gettext_printf "%s, with Linux %s (%s)" "${os}" "${version}" "$(gettext "Nouveau/Nvidia Off")")" ;;
+ acpi-off)
+ title="$(gettext_printf "%s, with Linux %s (%s)" "${os}" "${version}" "$(gettext "ACPI Off")")" ;;
*)
title="$(gettext_printf "%s, with Linux %s" "${os}" "${version}")" ;;
esac
@@ -334,6 +340,11 @@ while [ "x$list" != "x" ] ; do
if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then
linux_entry "${OS}" "${version}" simple \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
+
+ linux_entry "${OS}" "${version}" nouveau-off \
+ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} nouveau.modeset=0"
+ linux_entry "${OS}" "${version}" acpi-off \
+ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} acpi=off"
submenu_indentation="$grub_tab"
From d9aa347c109422e5c809906909b06028312f0787 Mon Sep 17 00:00:00 2001
From: Leif Lindholm <leif.lindholm@linaro.org>
Date: Thu, 21 Feb 2019 10:15:08 +0000
Subject: arm64/efi: Fix grub_efi_get_ram_base()
grub_efi_get_ram_base() looks for the lowest available RAM address by
traversing the memory map, comparing lowest address found so far.
Due to a brain glitch, that "so far" was initialized to GRUB_UINT_MAX -
completely preventing boot on systems without RAM below 4GB.
Change the initial value to GRUB_EFI_MAX_USABLE_ADDRESS, as originally
intended.
Reported-by: Steve McIntyre <93sam@debian.org>
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Tested-by: Steve McIntyre <93sam@debian.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=566b16a0dc23d72357d2d75b781d3c7895b8a234
Last-Update: 2019-02-26
Patch-Name: arm64-fix-grub_efi_get_ram_base.patch
---
grub-core/kern/efi/mm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c
index 9475e2eb5..a0f0c3c81 100644
--- a/grub-core/kern/efi/mm.c
+++ b/grub-core/kern/efi/mm.c
@@ -603,7 +603,7 @@ grub_efi_get_ram_base(grub_addr_t *base_addr)
if (ret < 1)
return GRUB_ERR_BUG;
- for (desc = memory_map, *base_addr = GRUB_UINT_MAX;
+ for (desc = memory_map, *base_addr = GRUB_EFI_MAX_USABLE_ADDRESS;
(grub_addr_t) desc < ((grub_addr_t) memory_map + memory_map_size);
desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size))
if (desc->attribute & GRUB_EFI_MEMORY_WB)
From 6a7aa8f22219488778226cc9d42ecd60448889e4 Mon Sep 17 00:00:00 2001
From: James Clarke <jrtc27@jrtc27.com>
Date: Tue, 26 Feb 2019 18:34:22 +0000
Subject: osdep/freebsd: Fix partition calculation for EBR entries
For EBR partitions, "start" is the relative starting sector of the EBR
header itself, whereas "offset" is the relative starting byte of the
partition's contents, excluding the EBR header and any padding. Thus we
must use "offset", and divide by the sector size to convert to sectors.
Bug-Debian: https://bugs.debian.org/923253
Forwarded: https://lists.gnu.org/archive/html/grub-devel/2019-02/msg00124.html
Last-Update: 2019-02-26
Patch-Name: freebsd-ebr-partition-offset.patch
---
grub-core/osdep/freebsd/getroot.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/grub-core/osdep/freebsd/getroot.c b/grub-core/osdep/freebsd/getroot.c
index ccc1d7028..4f1720451 100644
--- a/grub-core/osdep/freebsd/getroot.c
+++ b/grub-core/osdep/freebsd/getroot.c
@@ -338,8 +338,9 @@ grub_util_follow_gpart_up (const char *name, grub_disk_addr_t *off_out, char **n
grub_util_follow_gpart_up (name_tmp, &off, name_out);
free (name_tmp);
LIST_FOREACH (config, &provider->lg_config, lg_config)
- if (strcasecmp (config->lg_name, "start") == 0)
- off += strtoull (config->lg_val, 0, 10);
+ if (strcasecmp (config->lg_name, "offset") == 0)
+ off += strtoull (config->lg_val, 0, 10)
+ / provider->lg_sectorsize;
if (off_out)
*off_out = off;
return;
From 47e4c28ec5131bc0921c15fe9c368e6160b0858f Mon Sep 17 00:00:00 2001
From: Steve McIntyre <93sam@debian.org>
Date: Mon, 11 Feb 2019 02:42:34 +0000
Subject: grub-install: Check for arm-efi as a default target
Much like on x86, we can work out if the system is running on top
of EFI firmware. If so, return "arm-efi". If not, fall back to
"arm-uboot" as previously.
Heavily inspired by the existing code for x86.
Signed-off-by: Steve McIntyre <93sam@debian.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=082fd84d525f8d6602f892160b77c0a948308a78
Bug-Debian: https://bugs.debian.org/922104
Last-Update: 2019-02-26
Patch-Name: grub-install-arm-default-target.patch
---
grub-core/osdep/basic/platform.c | 6 ++++++
grub-core/osdep/linux/platform.c | 22 ++++++++++++++++++++++
include/grub/util/install.h | 3 +++
util/grub-install.c | 2 +-
4 files changed, 32 insertions(+), 1 deletion(-)
diff --git a/grub-core/osdep/basic/platform.c b/grub-core/osdep/basic/platform.c
index 2ab907976..6c293ed2d 100644
--- a/grub-core/osdep/basic/platform.c
+++ b/grub-core/osdep/basic/platform.c
@@ -18,6 +18,12 @@
#include <grub/util/install.h>
+const char *
+grub_install_get_default_arm_platform (void)
+{
+ return "arm-uboot";
+}
+
const char *
grub_install_get_default_x86_platform (void)
{
diff --git a/grub-core/osdep/linux/platform.c b/grub-core/osdep/linux/platform.c
index 9805c36d4..54a9b9ecc 100644
--- a/grub-core/osdep/linux/platform.c
+++ b/grub-core/osdep/linux/platform.c
@@ -100,6 +100,28 @@ read_platform_size (void)
return ret;
}
+const char *
+grub_install_get_default_arm_platform (void)
+{
+ /*
+ * On Linux, we need the efivars kernel modules. If no EFI is available this
+ * module just does nothing besides a small hello and if we detect efi we'll
+ * load it anyway later. So it should be safe to try to load it here.
+ */
+ grub_util_exec_redirect_all ((const char * []){ "modprobe", "efivars", NULL },
+ NULL, NULL, "/dev/null");
+
+ grub_util_info ("Looking for /sys/firmware/efi ..");
+ if (is_not_empty_directory ("/sys/firmware/efi"))
+ {
+ grub_util_info ("...found");
+ return "arm-efi";
+ }
+
+ grub_util_info ("... not found");
+ return "arm-uboot";
+}
+
const char *
grub_install_get_default_x86_platform (void)
{
diff --git a/include/grub/util/install.h b/include/grub/util/install.h
index 3fd46ec30..5783cc4bc 100644
--- a/include/grub/util/install.h
+++ b/include/grub/util/install.h
@@ -204,6 +204,9 @@ grub_util_get_target_dirname (const struct grub_install_image_target_desc *t);
void
grub_install_create_envblk_file (const char *name);
+const char *
+grub_install_get_default_arm_platform (void);
+
const char *
grub_install_get_default_x86_platform (void);
diff --git a/util/grub-install.c b/util/grub-install.c
index 81b648efc..55491589f 100644
--- a/util/grub-install.c
+++ b/util/grub-install.c
@@ -348,7 +348,7 @@ get_default_platform (void)
#elif defined (__ia64__)
return "ia64-efi";
#elif defined (__arm__)
- return "arm-uboot";
+ return grub_install_get_default_arm_platform ();
#elif defined (__aarch64__)
return "arm64-efi";
#elif defined (__amd64__) || defined (__x86_64__) || defined (__i386__)
From b678887f5e7563f13c41d46f3665b08a7643a2da Mon Sep 17 00:00:00 2001
From: Steve McIntyre <93sam@debian.org>
Date: Tue, 26 Feb 2019 14:14:17 +0000
Subject: Fall back to arm-uboot if booted using EFI but -efi is missing
It may be possible, particularly in recovery situations, to be booted
using EFI on ARM when only the arm-uboot target is installed. There's
nothing actually stopping us installing arm-uboot from an EFI
environment, and it's better than returning a confusing error.
(When convenient, this patch should be merged with
install_efi_fallback.patch.)
Forwarded: no
Last-Update: 2019-02-26
Patch-Name: install_efi_fallback_arm.patch
---
grub-core/osdep/linux/platform.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/grub-core/osdep/linux/platform.c b/grub-core/osdep/linux/platform.c
index 54a9b9ecc..fae85430c 100644
--- a/grub-core/osdep/linux/platform.c
+++ b/grub-core/osdep/linux/platform.c
@@ -114,8 +114,21 @@ grub_install_get_default_arm_platform (void)
grub_util_info ("Looking for /sys/firmware/efi ..");
if (is_not_empty_directory ("/sys/firmware/efi"))
{
+ const char *pkglibdir = grub_util_get_pkglibdir ();
+ const char *platform;
+ char *pd;
+ int found;
+
grub_util_info ("...found");
- return "arm-efi";
+ platform = "arm-efi";
+
+ pd = grub_util_path_concat (2, pkglibdir, platform);
+ found = grub_util_is_directory (pd);
+ free (pd);
+ if (found)
+ return platform;
+ else
+ grub_util_info ("... but %s platform not available", platform);
}
grub_util_info ("... not found");
......@@ -126,3 +126,9 @@ mkimage_clarify_file_alignment_efi.patch
at-keyboard-module-init.patch
sparc64-aout-fix.patch
uefi-secure-boot-cryptomount.patch
arm64-fix-grub_efi_get_ram_base.patch
grub-install-arm-default-target.patch
install_efi_fallback_arm.patch
freebsd-ebr-partition-offset.patch
util-check-errors.patch
add-failsafe-boot-options.patch
From 0cc1bd74c82c94ad93049a7298987c8f155cd0d2 Mon Sep 17 00:00:00 2001
From: Colin Watson <cjwatson@debian.org>
Date: Thu, 28 Feb 2019 09:32:00 +0000
Subject: util: Detect more I/O errors
Many of GRUB's utilities don't check anywhere near all the possible
write errors. For example, if grub-install runs out of space when
copying a file, it won't notice. There were missing checks for the
return values of write, fflush, fsync, and close (or the equivalents on
other OSes), all of which must be checked.
I tried to be consistent with the existing logging practices of the
various hostdisk implementations, but they weren't entirely consistent
to start with so I used my judgement. The result at least looks
reasonable on GNU/Linux when I provoke a write error:
Installing for x86_64-efi platform.
grub-install: error: cannot copy `/usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed' to `/boot/efi/EFI/debian/grubx64.efi': No space left on device.
There are more missing checks in other utilities, but this should fix
the most critical ones.
Bug-Debian: https://bugs.debian.org/922741
Forwarded: https://lists.gnu.org/archive/html/grub-devel/2019-02/msg00125.html
Last-Update: 2019-02-28
Patch-Name: util-check-errors.patch
---
grub-core/osdep/aros/hostdisk.c | 38 ++++++++++++++++++------------
grub-core/osdep/unix/hostdisk.c | 18 +++++++-------
grub-core/osdep/windows/hostdisk.c | 37 ++++++++++++++++++++++-------
include/grub/emu/hostfile.h | 4 ++--
include/grub/emu/misc.h | 2 +-
util/editenv.c | 3 ++-
util/grub-editenv.c | 3 ++-
util/grub-install-common.c | 16 +++++++++----
util/grub-mkimage.c | 8 +++++--
util/setup.c | 6 +++--
10 files changed, 90 insertions(+), 45 deletions(-)
diff --git a/grub-core/osdep/aros/hostdisk.c b/grub-core/osdep/aros/hostdisk.c
index 7d99b54b8..2be654ca3 100644
--- a/grub-core/osdep/aros/hostdisk.c
+++ b/grub-core/osdep/aros/hostdisk.c
@@ -439,36 +439,44 @@ grub_util_get_fd_size (grub_util_fd_t fd,
return -1;
}
-void
+int
grub_util_fd_close (grub_util_fd_t fd)
{
switch (fd->type)
{
case GRUB_UTIL_FD_FILE:
- close (fd->fd);
- return;
+ return close (fd->fd);
case GRUB_UTIL_FD_DISK:
CloseDevice ((struct IORequest *) fd->ioreq);
DeleteIORequest((struct IORequest *) fd->ioreq);
DeleteMsgPort (fd->mp);
- return;
+ return 0;
}
+ return 0;
}
static int allow_fd_syncs = 1;
-static void
+static int
grub_util_fd_sync_volume (grub_util_fd_t fd)
{
+ LONG err;
+
fd->ioreq->iotd_Req.io_Command = CMD_UPDATE;
fd->ioreq->iotd_Req.io_Length = 0;
fd->ioreq->iotd_Req.io_Data = 0;
fd->ioreq->iotd_Req.io_Offset = 0;
fd->ioreq->iotd_Req.io_Actual = 0;
- DoIO ((struct IORequest *) fd->ioreq);
+ err = DoIO ((struct IORequest *) fd->ioreq);
+ if (err)
+ {
+ grub_util_info ("I/O failed with error %d, IoErr=%d", (int)err, (int) IoErr ());
+ return -1;
+ }
+ return 0;
}
-void
+int
grub_util_fd_sync (grub_util_fd_t fd)
{
if (allow_fd_syncs)
@@ -476,22 +484,22 @@ grub_util_fd_sync (grub_util_fd_t fd)
switch (fd->type)
{
case GRUB_UTIL_FD_FILE:
- fsync (fd->fd);
- return;
+ return fsync (fd->fd);
case GRUB_UTIL_FD_DISK:
- grub_util_fd_sync_volume (fd);
- return;
+ return grub_util_fd_sync_volume (fd);
}
}
+ return 0;
}
-void
+int
grub_util_file_sync (FILE *f)
{
- fflush (f);
+ if (fflush (f) != 0)
+ return -1;
if (!allow_fd_syncs)
- return;
- fsync (fileno (f));
+ return 0;
+ return fsync (fileno (f));
}
void
diff --git a/grub-core/osdep/unix/hostdisk.c b/grub-core/osdep/unix/hostdisk.c
index 2a8c5882e..c09b7f402 100644
--- a/grub-core/osdep/unix/hostdisk.c
+++ b/grub-core/osdep/unix/hostdisk.c
@@ -169,20 +169,22 @@ grub_util_fd_strerror (void)
static int allow_fd_syncs = 1;
-void
+int
grub_util_fd_sync (grub_util_fd_t fd)
{
if (allow_fd_syncs)
- fsync (fd);
+ return fsync (fd);
+ return 0;
}
-void
+int
grub_util_file_sync (FILE *f)
{
- fflush (f);
+ if (fflush (f) != 0)
+ return -1;
if (!allow_fd_syncs)
- return;
- fsync (fileno (f));
+ return 0;
+ return fsync (fileno (f));
}
void
@@ -191,10 +193,10 @@ grub_util_disable_fd_syncs (void)
allow_fd_syncs = 0;
}
-void
+int
grub_util_fd_close (grub_util_fd_t fd)
{
- close (fd);
+ return close (fd);
}
char *
diff --git a/grub-core/osdep/windows/hostdisk.c b/grub-core/osdep/windows/hostdisk.c
index 85507af88..355100789 100644
--- a/grub-core/osdep/windows/hostdisk.c
+++ b/grub-core/osdep/windows/hostdisk.c
@@ -275,11 +275,18 @@ grub_util_fd_write (grub_util_fd_t fd, const char *buf, size_t len)
static int allow_fd_syncs = 1;
-void
+int
grub_util_fd_sync (grub_util_fd_t fd)
{
if (allow_fd_syncs)
- FlushFileBuffers (fd);
+ {
+ if (!FlushFileBuffers (fd))
+ {
+ grub_util_info ("flush err %x", (int) GetLastError ());
+ return -1;
+ }
+ }
+ return 0;
}
void
@@ -288,10 +295,15 @@ grub_util_disable_fd_syncs (void)
allow_fd_syncs = 0;
}
-void
+int
grub_util_fd_close (grub_util_fd_t fd)
{
- CloseHandle (fd);
+ if (!CloseHandle (fd))
+ {
+ grub_util_info ("close err %x", (int) GetLastError ());
+ return -1;
+ }
+ return 0;
}
const char *
@@ -620,16 +632,25 @@ grub_util_fopen (const char *path, const char *mode)
return ret;
}
-void
+int
grub_util_file_sync (FILE *f)
{
HANDLE hnd;
- fflush (f);
+ if (fflush (f) != 0)
+ {
+ grub_util_info ("fflush err %x", (int) GetLastError ());
+ return -1;
+ }
if (!allow_fd_syncs)
- return;
+ return 0;
hnd = (HANDLE) _get_osfhandle (fileno (f));
- FlushFileBuffers (hnd);
+ if (!FlushFileBuffers (hnd))
+ {
+ grub_util_info ("flush err %x", (int) GetLastError ());
+ return -1;
+ }
+ return 0;
}
int
diff --git a/include/grub/emu/hostfile.h b/include/grub/emu/hostfile.h
index 8e37d5acb..cfb1e2b56 100644
--- a/include/grub/emu/hostfile.h
+++ b/include/grub/emu/hostfile.h
@@ -47,11 +47,11 @@ grub_util_fd_t
EXPORT_FUNC(grub_util_fd_open) (const char *os_dev, int flags);
const char *
EXPORT_FUNC(grub_util_fd_strerror) (void);
-void
+int
grub_util_fd_sync (grub_util_fd_t fd);
void
grub_util_disable_fd_syncs (void);
-void
+int
EXPORT_FUNC(grub_util_fd_close) (grub_util_fd_t fd);
grub_uint64_t
diff --git a/include/grub/emu/misc.h b/include/grub/emu/misc.h
index df6085bcb..59b8b35fc 100644
--- a/include/grub/emu/misc.h
+++ b/include/grub/emu/misc.h
@@ -73,6 +73,6 @@ FILE *
grub_util_fopen (const char *path, const char *mode);
#endif
-void grub_util_file_sync (FILE *f);
+int grub_util_file_sync (FILE *f);
#endif /* GRUB_EMU_MISC_H */
diff --git a/util/editenv.c b/util/editenv.c
index c6f8d2298..eb2d0c03a 100644