forked from pool/grub2
Accepting request 634907 from home:michael-chang:bsc:1106381
- Fix outputting invalid btrfs subvol path on non btrfs filesystem due to bogus return code handling. (bsc#1106381) * modified grub2-btrfs-10-config-directory.patch OBS-URL: https://build.opensuse.org/request/show/634907 OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=313
This commit is contained in:
parent
31d76fc0f5
commit
d37f9a340e
@ -1,3 +1,11 @@
|
||||
v1:
|
||||
References: bsc#1063443
|
||||
|
||||
v2:
|
||||
References: bsc#1106381
|
||||
Fix outputting invalid btrfs subvol path on non btrfs filesystem due to bogus
|
||||
return code handling.
|
||||
|
||||
Index: grub-2.02/grub-core/fs/btrfs.c
|
||||
===================================================================
|
||||
--- grub-2.02.orig/grub-core/fs/btrfs.c
|
||||
@ -35,7 +43,17 @@ Index: grub-2.02/grub-core/fs/btrfs.c
|
||||
dev = grub_device_open (devname);
|
||||
grub_free (devname);
|
||||
if (!dev)
|
||||
@@ -2655,12 +2641,43 @@ grub_cmd_btrfs_get_default_subvol (struc
|
||||
@@ -2625,8 +2611,7 @@ grub_cmd_btrfs_get_default_subvol (struc
|
||||
{
|
||||
grub_device_close (dev);
|
||||
grub_dprintf ("btrfs", "failed to open fs\n");
|
||||
- grub_errno = GRUB_ERR_NONE;
|
||||
- return 0;
|
||||
+ return grub_errno;
|
||||
}
|
||||
|
||||
err = grub_btrfs_get_default_subvolume_id (data, &subvolid);
|
||||
@@ -2655,12 +2640,47 @@ grub_cmd_btrfs_get_default_subvol (struc
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -76,12 +94,16 @@ Index: grub-2.02/grub-core/fs/btrfs.c
|
||||
+ return grub_error (GRUB_ERR_BAD_ARGUMENT, "device name required");
|
||||
+
|
||||
+ if ((err = grub_btrfs_get_default_subvol (argv[0], &subvolid, &subvol)) != GRUB_ERR_NONE)
|
||||
+ return err;
|
||||
+ {
|
||||
+ if (err == GRUB_ERR_BAD_FS)
|
||||
+ err = grub_errno = GRUB_ERR_NONE;
|
||||
+ return err;
|
||||
+ }
|
||||
+
|
||||
if (num_only && path_only)
|
||||
output = grub_xasprintf ("%"PRIuGRUB_UINT64_T" /%s", subvolid, subvol);
|
||||
else if (num_only)
|
||||
@@ -2676,9 +2693,6 @@ grub_cmd_btrfs_get_default_subvol (struc
|
||||
@@ -2676,9 +2696,6 @@ grub_cmd_btrfs_get_default_subvol (struc
|
||||
grub_free (output);
|
||||
grub_free (subvol);
|
||||
|
||||
@ -91,7 +113,7 @@ Index: grub-2.02/grub-core/fs/btrfs.c
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
@@ -2757,6 +2771,122 @@ subvol_get_env (struct grub_env_var *var
|
||||
@@ -2757,6 +2774,122 @@ subvol_get_env (struct grub_env_var *var
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -214,7 +236,7 @@ Index: grub-2.02/grub-core/fs/btrfs.c
|
||||
GRUB_MOD_INIT (btrfs)
|
||||
{
|
||||
grub_fs_register (&grub_btrfs_fs);
|
||||
@@ -2780,6 +2910,8 @@ GRUB_MOD_INIT (btrfs)
|
||||
@@ -2780,6 +2913,8 @@ GRUB_MOD_INIT (btrfs)
|
||||
subvol_set_env);
|
||||
grub_register_variable_hook ("btrfs_subvolid", subvolid_get_env,
|
||||
subvolid_set_env);
|
||||
@ -223,7 +245,7 @@ Index: grub-2.02/grub-core/fs/btrfs.c
|
||||
grub_env_export ("btrfs_subvol");
|
||||
grub_env_export ("btrfs_subvolid");
|
||||
grub_env_export ("btrfs_relative_path");
|
||||
@@ -2789,6 +2921,7 @@ GRUB_MOD_FINI (btrfs)
|
||||
@@ -2789,6 +2924,7 @@ GRUB_MOD_FINI (btrfs)
|
||||
{
|
||||
grub_register_variable_hook ("btrfs_subvol", NULL, NULL);
|
||||
grub_register_variable_hook ("btrfs_subvolid", NULL, NULL);
|
||||
|
@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Aug 31 10:06:56 UTC 2018 - mchang@suse.com
|
||||
|
||||
- Fix outputting invalid btrfs subvol path on non btrfs filesystem due to bogus
|
||||
return code handling. (bsc#1106381)
|
||||
* modified grub2-btrfs-10-config-directory.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 23 08:37:15 UTC 2018 - mchang@suse.com
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user