Hello community, here is the log from the commit of package grub2 for openSUSE:Leap:15.2 checked in at 2020-05-12 11:31:37 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2/grub2 (Old) and /work/SRC/openSUSE:Leap:15.2/.grub2.new.2738 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "grub2" Tue May 12 11:31:37 2020 rev:81 rq:801259 version:2.04 Changes: -------- --- /work/SRC/openSUSE:Leap:15.2/grub2/grub2.changes 2020-03-31 07:22:09.194392384 +0200 +++ /work/SRC/openSUSE:Leap:15.2/.grub2.new.2738/grub2.changes 2020-05-12 11:31:48.931670653 +0200 @@ -1,0 +2,20 @@ +Tue May 5 06:48:55 UTC 2020 - Michael Chang <[email protected]> + +- Fix boot failure as journaled data not get drained due to abrupt power + off after grub-install (bsc#1167756) + * grub-install-force-journal-draining-to-ensure-data-i.patch + +------------------------------------------------------------------- +Thu Apr 16 13:35:10 UTC 2020 - Michael Chang <[email protected]> + +- Fix executable stack in grub-probe and other grub utility (bsc#1169137) + * grub2-btrfs-06-subvol-mount.patch + +------------------------------------------------------------------- +Tue Mar 24 08:17:33 UTC 2020 - Michael Chang <[email protected]> + +- Fix GCC 10 build fail (bsc#1158189) + * 0001-mdraid1x_linux-Fix-gcc10-error-Werror-array-bounds.patch + * 0002-zfs-Fix-gcc10-error-Werror-zero-length-bounds.patch + +------------------------------------------------------------------- New: ---- 0001-mdraid1x_linux-Fix-gcc10-error-Werror-array-bounds.patch 0002-zfs-Fix-gcc10-error-Werror-zero-length-bounds.patch grub-install-force-journal-draining-to-ensure-data-i.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ grub2.spec ++++++ --- /var/tmp/diff_new_pack.yYDHTV/_old 2020-05-12 11:31:50.699674367 +0200 +++ /var/tmp/diff_new_pack.yYDHTV/_new 2020-05-12 11:31:50.699674367 +0200 @@ -1,7 +1,7 @@ # # spec file for package grub2 # -# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -224,6 +224,7 @@ Patch93: grub2-getroot-support-nvdimm.patch Patch94: grub2-install-fix-not-a-directory-error.patch Patch95: grub2-verifiers-fix-system-freeze-if-verify-failed.patch +Patch96: grub-install-force-journal-draining-to-ensure-data-i.patch # Btrfs snapshot booting related patches Patch101: grub2-btrfs-01-add-ability-to-boot-from-subvolumes.patch Patch102: grub2-btrfs-02-export-subvolume-envvars.patch @@ -291,6 +292,9 @@ Patch601: risc-v-fix-computation-of-pc-relative-relocation-offset.patch Patch602: risc-v-add-clzdi2-symbol.patch Patch603: grub-install-define-default-platform-for-risc-v.patch +# Fix gcc-10 build fail +Patch610: 0001-mdraid1x_linux-Fix-gcc10-error-Werror-array-bounds.patch +Patch611: 0002-zfs-Fix-gcc10-error-Werror-zero-length-bounds.patch # bsc#1166409 - Grub netbooting does not search for grub.cfg files with mac # address or ip address in filename Patch700: 0001-normal-Move-common-datetime-functions-out-of-the-nor.patch @@ -543,6 +547,7 @@ %patch93 -p1 %patch94 -p1 %patch95 -p1 +%patch96 -p1 %patch101 -p1 %patch102 -p1 %patch103 -p1 @@ -594,6 +599,8 @@ %patch601 -p1 %patch602 -p1 %patch603 -p1 +%patch610 -p1 +%patch611 -p1 %patch700 -p1 %patch701 -p1 %patch702 -p1 ++++++ 0001-mdraid1x_linux-Fix-gcc10-error-Werror-array-bounds.patch ++++++ >From fe8a83722bf1af7ea3949e6d96e7906407f78d5c Mon Sep 17 00:00:00 2001 From: Michael Chang <[email protected]> Date: Wed, 25 Mar 2020 13:52:51 +0800 Subject: [PATCH 1/2] mdraid1x_linux: Fix gcc10 error -Werror=array-bounds We bumped into the build error while testing gcc-10 pre-release. ../../grub-core/disk/mdraid1x_linux.c: In function 'grub_mdraid_detect': ../../grub-core/disk/mdraid1x_linux.c:181:15: error: array subscript <unknown> is outside array bounds of 'grub_uint16_t[0]' {aka 'short unsigned int[0]'} [-Werror=array-bounds] 181 | (char *) &sb.dev_roles[grub_le_to_cpu32 (sb.dev_number)] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../grub-core/disk/mdraid1x_linux.c:98:17: note: while referencing 'dev_roles' 98 | grub_uint16_t dev_roles[0]; /* Role in array, or 0xffff for a spare, or 0xfffe for faulty. */ | ^~~~~~~~~ ../../grub-core/disk/mdraid1x_linux.c:127:33: note: defined here 'sb' 127 | struct grub_raid_super_1x sb; | ^~ cc1: all warnings being treated as errors Apparently gcc issues the warning when trying to access sb.dev_roles array's member, since it is a zero length array as the last element of struct grub_raid_super_1x that is allocated sparsely without extra chunks for the trailing bits, so the warning looks legitimate in this regard. As the whole thing here is doing offset computation, it is undue to use syntax that would imply array member access then take address from it later. Instead we could accomplish the same thing through basic array pointer arithmetic to pacify the warning. Signed-off-by: Michael Chang <[email protected]> Reviewed-by: Daniel Kiper <[email protected]> --- grub-core/disk/mdraid1x_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/disk/mdraid1x_linux.c b/grub-core/disk/mdraid1x_linux.c index 7cc80d3df..c980feba4 100644 --- a/grub-core/disk/mdraid1x_linux.c +++ b/grub-core/disk/mdraid1x_linux.c @@ -178,7 +178,7 @@ grub_mdraid_detect (grub_disk_t disk, return NULL; if (grub_disk_read (disk, sector, - (char *) &sb.dev_roles[grub_le_to_cpu32 (sb.dev_number)] + (char *) (sb.dev_roles + grub_le_to_cpu32 (sb.dev_number)) - (char *) &sb, sizeof (role), &role)) return NULL; -- 2.16.4 ++++++ 0002-zfs-Fix-gcc10-error-Werror-zero-length-bounds.patch ++++++ >From 30379c2280c5b4514abafc2492e081209a330cb0 Mon Sep 17 00:00:00 2001 From: Michael Chang <[email protected]> Date: Wed, 25 Mar 2020 14:28:15 +0800 Subject: [PATCH 2/2] zfs: Fix gcc10 error -Werror=zero-length-bounds We bumped into the build error while testing gcc-10 pre-release. In file included from ../../include/grub/file.h:22, from ../../grub-core/fs/zfs/zfs.c:34: ../../grub-core/fs/zfs/zfs.c: In function 'zap_leaf_lookup': ../../grub-core/fs/zfs/zfs.c:2263:44: error: array subscript '<unknown>' is outside the bounds of an interior zero-length array 'grub_uint16_t[0]' {aka 'short unsigned int[0]'} [-Werror=zero-length-bounds] 2263 | for (chunk = grub_zfs_to_cpu16 (l->l_hash[LEAF_HASH (blksft, h, l)], endian); ../../include/grub/types.h:241:48: note: in definition of macro 'grub_le_to_cpu16' 241 | # define grub_le_to_cpu16(x) ((grub_uint16_t) (x)) | ^ ../../grub-core/fs/zfs/zfs.c:2263:16: note: in expansion of macro 'grub_zfs_to_cpu16' 2263 | for (chunk = grub_zfs_to_cpu16 (l->l_hash[LEAF_HASH (blksft, h, l)], endian); | ^~~~~~~~~~~~~~~~~ In file included from ../../grub-core/fs/zfs/zfs.c:48: ../../include/grub/zfs/zap_leaf.h:72:16: note: while referencing 'l_hash' 72 | grub_uint16_t l_hash[0]; | ^~~~~~ Here I'd like to quote from the gcc document [1] which seems best to explain what is going on here. "Although the size of a zero-length array is zero, an array member of this kind may increase the size of the enclosing type as a result of tail padding. The offset of a zero-length array member from the beginning of the enclosing structure is the same as the offset of an array with one or more elements of the same type. The alignment of a zero-length array is the same as the alignment of its elements. Declaring zero-length arrays in other contexts, including as interior members of structure objects or as non-member objects, is discouraged. Accessing elements of zero-length arrays declared in such contexts is undefined and may be diagnosed." The l_hash[0] is apparnetly an interior member to the enclosed structure while l_entries[0] is the trailing member. And the offending code tries to access members in l_hash[0] array that triggers the diagnose. Given that the l_entries[0] is used to get proper alignment to access leaf chunks, we can accomplish the same thing through the ALIGN_UP macro thus eliminating l_entries[0] from the structure. In this way we can pacify the warning as l_hash[0] now becomes the last member to the enclosed structure. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html Signed-off-by: Michael Chang <[email protected]> --- grub-core/fs/zfs/zfs.c | 5 ++++- include/grub/zfs/zap_leaf.h | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/grub-core/fs/zfs/zfs.c b/grub-core/fs/zfs/zfs.c index 2f72e42bf..b5e10fd0b 100644 --- a/grub-core/fs/zfs/zfs.c +++ b/grub-core/fs/zfs/zfs.c @@ -141,7 +141,10 @@ ZAP_LEAF_NUMCHUNKS (int bs) static inline zap_leaf_chunk_t * ZAP_LEAF_CHUNK (zap_leaf_phys_t *l, int bs, int idx) { - return &((zap_leaf_chunk_t *) (l->l_entries + grub_properly_aligned_t *l_entries; + + l_entries = (grub_properly_aligned_t *) ALIGN_UP((grub_addr_t)l->l_hash, sizeof (grub_properly_aligned_t)); + return &((zap_leaf_chunk_t *) (l_entries + (ZAP_LEAF_HASH_NUMENTRIES(bs) * 2) / sizeof (grub_properly_aligned_t)))[idx]; } diff --git a/include/grub/zfs/zap_leaf.h b/include/grub/zfs/zap_leaf.h index 95c67dcba..11447c166 100644 --- a/include/grub/zfs/zap_leaf.h +++ b/include/grub/zfs/zap_leaf.h @@ -70,7 +70,6 @@ typedef struct zap_leaf_phys { */ grub_uint16_t l_hash[0]; - grub_properly_aligned_t l_entries[0]; } zap_leaf_phys_t; typedef union zap_leaf_chunk { -- 2.16.4 ++++++ grub-install-force-journal-draining-to-ensure-data-i.patch ++++++ >From 3085db0922a1d803d4a9dfe54daae6fef20e4340 Mon Sep 17 00:00:00 2001 From: Michael Chang <[email protected]> Date: Mon, 13 Apr 2020 16:08:59 +0800 Subject: [PATCH] grub-install: force journal draining to ensure data integrity In XFS, the system would end up in unbootable state if an abrupt power off after grub-install is occuring. It can be easily reproduced with. grub-install /dev/vda; reboot -f The grub error would show many different kinds of corruption in filesystem and the problem boils down to incompleted journal transaction which would leave pending writes behind in the on-disk journal. It is therefore necessary to recover the system via re-mounting the filesystem from linux system that all pending journal log can be replayed. On the other hand if journal draining can be enforced by grub-install then it can bring more resilience to such abrupt power loss. The fsync is not enough here for XFS, because that only writes in-memory log to on-disk (ie makes sure broken state can be repaired). Unfortunately there's no designated system call to serve solely for the journal draining, so it can only be achieved via fsfreeze system call that the journal draining can happen as a byproduct during the process. This patch adds fsfreeze/unfreeze at the end of grub-install to induce journal draining on journaled file system. However btrfs is excluded from the list as it is using fsync to drain journal and also is not desired as reportedly having negative side effect. With this patch applied, the boot falilure can no longer be reproduced with above procedure. Signed-off-by: Michael Chang <[email protected]> --- Makefile.util.def | 1 + grub-core/osdep/basic/journaled_fs.c | 26 +++++++++++++++++++ grub-core/osdep/journaled_fs.c | 5 ++++ grub-core/osdep/linux/journaled_fs.c | 48 ++++++++++++++++++++++++++++++++++++ include/grub/util/install.h | 2 ++ util/grub-install.c | 20 +++++++++++++++ 6 files changed, 102 insertions(+) create mode 100644 grub-core/osdep/basic/journaled_fs.c create mode 100644 grub-core/osdep/journaled_fs.c create mode 100644 grub-core/osdep/linux/journaled_fs.c Index: grub-2.04/Makefile.util.def =================================================================== --- grub-2.04.orig/Makefile.util.def +++ grub-2.04/Makefile.util.def @@ -645,6 +645,7 @@ program = { emu_condition = COND_s390x; common = grub-core/kern/emu/argp_common.c; common = grub-core/osdep/init.c; + common = grub-core/osdep/journaled_fs.c; ldadd = '$(LIBLZMA)'; ldadd = libgrubmods.a; Index: grub-2.04/grub-core/osdep/basic/journaled_fs.c =================================================================== --- /dev/null +++ grub-2.04/grub-core/osdep/basic/journaled_fs.c @@ -0,0 +1,26 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2010,2011,2012,2013 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see <http://www.gnu.org/licenses/>. + */ + +#include <grub/util/install.h> + +int +grub_install_sync_fs_journal (const char *path) +{ + return 1; +} + Index: grub-2.04/grub-core/osdep/journaled_fs.c =================================================================== --- /dev/null +++ grub-2.04/grub-core/osdep/journaled_fs.c @@ -0,0 +1,5 @@ +#ifdef __linux__ +#include "linux/journaled_fs.c" +#else +#include "basic/journaled_fs.c" +#endif Index: grub-2.04/grub-core/osdep/linux/journaled_fs.c =================================================================== --- /dev/null +++ grub-2.04/grub-core/osdep/linux/journaled_fs.c @@ -0,0 +1,48 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2010,2011,2012,2013 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see <http://www.gnu.org/licenses/>. + */ + +#include <fcntl.h> +#include <linux/fs.h> +#include <sys/ioctl.h> +#include <errno.h> +#include <grub/util/install.h> + +int +grub_install_sync_fs_journal (const char *path) +{ + int fd, ret; + + fd = open (path, O_RDONLY); + + if (fd == -1) + return 1; + + if (ioctl (fd, FIFREEZE, 0) == 0) + { + ioctl(fd, FITHAW, 0); + ret = 1; + } + else if (errno == EOPNOTSUPP) + ret = 1; + else + ret = 0; + + close (fd); + return ret; +} + Index: grub-2.04/include/grub/util/install.h =================================================================== --- grub-2.04.orig/include/grub/util/install.h +++ grub-2.04/include/grub/util/install.h @@ -269,4 +269,6 @@ grub_util_get_target_name (const struct extern char *grub_install_copy_buffer; #define GRUB_INSTALL_COPY_BUFFER_SIZE 1048576 +int +grub_install_sync_fs_journal (const char *path); #endif Index: grub-2.04/util/grub-install.c =================================================================== --- grub-2.04.orig/util/grub-install.c +++ grub-2.04/util/grub-install.c @@ -42,6 +42,7 @@ #include <grub/emu/config.h> #include <grub/util/ofpath.h> #include <grub/hfsplus.h> +#include <grub/time.h> #include <string.h> @@ -1997,6 +1998,25 @@ main (int argc, char *argv[]) break; } + { + const char *journaled_fs[] = {"xfs", "ext2", NULL}; + int i; + + for (i = 0; journaled_fs[i]; ++i) + if (grub_strcmp (grub_fs->name, journaled_fs[i]) == 0) + { + int retries = 10; + + /* If the fs is already frozen at that point, we could generally + * expected that it will be soon unfrozen again (assuming some other + * process has frozen it for snapshotting or something), so we may + * as well retry a few (limited) times in a delay loop. */ + while (retries-- && !grub_install_sync_fs_journal (grubdir)) + grub_sleep (1); + break; + } + } + fprintf (stderr, "%s\n", _("Installation finished. No error reported.")); /* Free resources. */ ++++++ grub2-btrfs-06-subvol-mount.patch ++++++ --- /var/tmp/diff_new_pack.yYDHTV/_old 2020-05-12 11:31:50.883674753 +0200 +++ /var/tmp/diff_new_pack.yYDHTV/_new 2020-05-12 11:31:50.883674753 +0200 @@ -3,11 +3,15 @@ * Fix grub2-install --root-directory does not work for /boot/grub2/<arch> on separate btrfs subvolume (boo#1098420) -Index: grub-2.02/grub-core/fs/btrfs.c +v3: +* Fix executable stack on which function trampoline is constructed to support + closure (nested function). The closure sematic is replaced. + +Index: grub-2.04/grub-core/fs/btrfs.c =================================================================== ---- grub-2.02.orig/grub-core/fs/btrfs.c -+++ grub-2.02/grub-core/fs/btrfs.c -@@ -32,6 +32,7 @@ +--- grub-2.04.orig/grub-core/fs/btrfs.c ++++ grub-2.04/grub-core/fs/btrfs.c +@@ -43,6 +43,7 @@ #include <grub/command.h> #include <grub/env.h> #include <grub/extcmd.h> @@ -15,7 +19,7 @@ GRUB_MOD_LICENSE ("GPLv3+"); -@@ -245,6 +246,12 @@ static grub_err_t +@@ -263,6 +264,12 @@ static grub_err_t grub_btrfs_read_logical (struct grub_btrfs_data *data, grub_disk_addr_t addr, void *buf, grub_size_t size, int recursion_depth); @@ -28,7 +32,7 @@ static grub_err_t read_sblock (grub_disk_t disk, struct grub_btrfs_superblock *sb) -@@ -887,9 +894,26 @@ lookup_root_by_name(struct grub_btrfs_da +@@ -1203,9 +1210,26 @@ lookup_root_by_name(struct grub_btrfs_da grub_err_t err; grub_uint64_t tree = 0; grub_uint8_t type; @@ -55,7 +59,7 @@ if (err) return grub_error(GRUB_ERR_FILE_NOT_FOUND, "couldn't locate %s\n", path); -@@ -1758,11 +1782,20 @@ grub_btrfs_dir (grub_device_t device, co +@@ -2179,11 +2203,20 @@ grub_btrfs_dir (grub_device_t device, co int r = 0; grub_uint64_t tree; grub_uint8_t type; @@ -77,7 +81,7 @@ if (err) { grub_btrfs_unmount (data); -@@ -1864,11 +1897,21 @@ grub_btrfs_open (struct grub_file *file, +@@ -2285,11 +2318,21 @@ grub_btrfs_open (struct grub_file *file, struct grub_btrfs_inode inode; grub_uint8_t type; struct grub_btrfs_key key_in; @@ -100,7 +104,7 @@ if (err) { grub_btrfs_unmount (data); -@@ -2039,6 +2082,150 @@ grub_cmd_btrfs_info (grub_command_t cmd +@@ -2460,6 +2503,150 @@ grub_cmd_btrfs_info (grub_command_t cmd return 0; } @@ -251,7 +255,7 @@ static grub_err_t get_fs_root(struct grub_btrfs_data *data, grub_uint64_t tree, grub_uint64_t objectid, grub_uint64_t offset, -@@ -2245,6 +2432,7 @@ static struct grub_fs grub_btrfs_fs = { +@@ -2666,6 +2853,7 @@ static struct grub_fs grub_btrfs_fs = { }; static grub_command_t cmd_info; @@ -259,7 +263,7 @@ static grub_extcmd_t cmd_list_subvols; static char * -@@ -2308,6 +2496,9 @@ GRUB_MOD_INIT (btrfs) +@@ -2729,6 +2917,9 @@ GRUB_MOD_INIT (btrfs) cmd_info = grub_register_command("btrfs-info", grub_cmd_btrfs_info, "DEVICE", "Print BtrFS info about DEVICE."); @@ -269,10 +273,10 @@ cmd_list_subvols = grub_register_extcmd("btrfs-list-subvols", grub_cmd_btrfs_list_subvols, 0, "[-p|-n] [-o var] DEVICE", -Index: grub-2.02/grub-core/osdep/linux/getroot.c +Index: grub-2.04/grub-core/osdep/linux/getroot.c =================================================================== ---- grub-2.02.orig/grub-core/osdep/linux/getroot.c -+++ grub-2.02/grub-core/osdep/linux/getroot.c +--- grub-2.04.orig/grub-core/osdep/linux/getroot.c ++++ grub-2.04/grub-core/osdep/linux/getroot.c @@ -107,6 +107,14 @@ struct btrfs_ioctl_search_key grub_uint32_t unused[9]; }; @@ -393,12 +397,12 @@ + return NULL; +} + -+void (*grub_find_root_btrfs_mount_path_hook)(const char *mount_path); ++static char *grub_btrfs_mount_path; + char ** grub_find_root_devices_from_mountinfo (const char *dir, char **relroot) { -@@ -519,12 +630,15 @@ again: +@@ -519,12 +630,17 @@ again: else if (grub_strcmp (entries[i].fstype, "btrfs") == 0) { ret = grub_find_root_devices_from_btrfs (dir); @@ -408,8 +412,10 @@ - if (fs_prefix) - free (fs_prefix); fs_prefix = xstrdup ("/"); -+ if (grub_find_root_btrfs_mount_path_hook) -+ grub_find_root_btrfs_mount_path_hook (entries[i].enc_path); ++ ++ if (grub_btrfs_mount_path) ++ grub_free (grub_btrfs_mount_path); ++ grub_btrfs_mount_path = grub_strdup (entries[i].enc_path); + } + else + { @@ -417,7 +423,7 @@ } } else if (!retry && grub_strcmp (entries[i].fstype, "autofs") == 0) -@@ -1148,6 +1262,34 @@ grub_util_get_grub_dev_os (const char *o +@@ -1192,6 +1308,24 @@ grub_util_get_grub_dev_os (const char *o return grub_dev; } @@ -425,38 +431,28 @@ +char * +grub_util_get_btrfs_subvol (const char *path, char **mount_path) +{ -+ char *mp = NULL; -+ + if (mount_path) + *mount_path = NULL; + -+ auto void -+ mount_path_hook (const char *m) -+ { -+ mp = strdup (m); -+ } -+ -+ grub_find_root_btrfs_mount_path_hook = mount_path_hook; + grub_free (grub_find_root_devices_from_mountinfo (path, NULL)); -+ grub_find_root_btrfs_mount_path_hook = NULL; + -+ if (!mp) ++ if (!grub_btrfs_mount_path) + return NULL; + + if (mount_path) -+ *mount_path = mp; ++ *mount_path = grub_strdup (grub_btrfs_mount_path); + -+ return get_btrfs_subvol (mp); ++ return get_btrfs_subvol (grub_btrfs_mount_path); +} + char * grub_make_system_path_relative_to_its_root_os (const char *path) { -Index: grub-2.02/util/grub-install.c +Index: grub-2.04/util/grub-install.c =================================================================== ---- grub-2.02.orig/util/grub-install.c -+++ grub-2.02/util/grub-install.c -@@ -1560,6 +1560,58 @@ main (int argc, char *argv[]) +--- grub-2.04.orig/util/grub-install.c ++++ grub-2.04/util/grub-install.c +@@ -1591,6 +1591,58 @@ main (int argc, char *argv[]) prefix_drive = xasprintf ("(%s)", grub_drives[0]); } @@ -515,10 +511,10 @@ char mkimage_target[200]; const char *core_name = NULL; -Index: grub-2.02/include/grub/emu/getroot.h +Index: grub-2.04/include/grub/emu/getroot.h =================================================================== ---- grub-2.02.orig/include/grub/emu/getroot.h -+++ grub-2.02/include/grub/emu/getroot.h +--- grub-2.04.orig/include/grub/emu/getroot.h ++++ grub-2.04/include/grub/emu/getroot.h @@ -53,6 +53,11 @@ char ** grub_find_root_devices_from_mountinfo (const char *dir, char **relroot); #endif
