~cyphermox/ubuntu/wily/grub2/lp1097570

« back to all changes in this revision

Viewing changes to debian/patches/zfs_v5000.patch

  • Committer: Package Import Robot
  • Author(s): Colin Watson, Robert Millan, Colin Watson
  • Date: 2013-12-03 16:53:32 UTC
  • Revision ID: package-import@ubuntu.com-20131203165332-6ao0wq900yihmmv9
Tags: 2.00-21
[ Robert Millan ]
* Backport from upstream:
  - Accept ZFS version 5000 (feature based).

[ Colin Watson ]
* Silence error message on initial installation when /etc/default/grub
  does not yet exist.
* Add GRUB_RECOVERY_TITLE option, to allow the controversial "recovery
  mode" text to be customised (LP: #1240360).
* Backport from upstream:
  - Revamp hidden timeout handling by adding a new timeout_style
    environment variable and a corresponding GRUB_TIMEOUT_STYLE
    configuration key for grub-mkconfig.  This controls hidden-timeout
    handling more simply than the previous arrangements, and pressing any
    hotkeys associated with menu entries during the hidden timeout will
    now boot the corresponding menu entry immediately (LP: #1178618).  As
    part of merging this, radically simplify the mess that
    quick_boot.patch had made of /etc/grub.d/30_os-prober; if it finds
    other OSes it can now just set timeout_style=menu and make sure the
    timeout is non-zero.
  - Fix build with FreeType 2.5.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Description: Accept ZFS version 5000 (feature based)
 
2
Origin: http://git.savannah.gnu.org/cgit/grub.git/commit/?id=c71dbd40a9f788d5cdba26e8293dbb95b70f33be
 
3
Author: Massimo Maggi <me@massimo-maggi.eu>
 
4
Forwarded: not-needed
 
5
Last-Update: 2013-11-21
 
6
 
 
7
--- a/grub-core/fs/zfs/zfs.c
 
8
+++ b/grub-core/fs/zfs/zfs.c
 
9
@@ -482,15 +482,11 @@
 
10
 
 
11
   if (grub_zfs_to_cpu64 (uber->ub_magic, GRUB_ZFS_LITTLE_ENDIAN)
 
12
       == UBERBLOCK_MAGIC
 
13
-      && grub_zfs_to_cpu64 (uber->ub_version, GRUB_ZFS_LITTLE_ENDIAN) > 0 
 
14
-      && grub_zfs_to_cpu64 (uber->ub_version, GRUB_ZFS_LITTLE_ENDIAN)
 
15
-      <= SPA_VERSION)
 
16
-    endian = GRUB_ZFS_LITTLE_ENDIAN;
 
17
+      && SPA_VERSION_IS_SUPPORTED(grub_zfs_to_cpu64 (uber->ub_version, GRUB_ZFS_LITTLE_ENDIAN)))
 
18
+     endian = GRUB_ZFS_LITTLE_ENDIAN;
 
19
 
 
20
   if (grub_zfs_to_cpu64 (uber->ub_magic, GRUB_ZFS_BIG_ENDIAN) == UBERBLOCK_MAGIC
 
21
-      && grub_zfs_to_cpu64 (uber->ub_version, GRUB_ZFS_BIG_ENDIAN) > 0 
 
22
-      && grub_zfs_to_cpu64 (uber->ub_version, GRUB_ZFS_BIG_ENDIAN)
 
23
-      <= SPA_VERSION)
 
24
+      && SPA_VERSION_IS_SUPPORTED(grub_zfs_to_cpu64 (uber->ub_version, GRUB_ZFS_BIG_ENDIAN)))
 
25
     endian = GRUB_ZFS_BIG_ENDIAN;
 
26
 
 
27
   if (endian == GRUB_ZFS_UNKNOWN_ENDIAN)
 
28
@@ -837,13 +833,13 @@
 
29
     }
 
30
   grub_dprintf ("zfs", "check 8 passed\n");
 
31
 
 
32
-  if (version > SPA_VERSION)
 
33
+  if (!SPA_VERSION_IS_SUPPORTED(version))
 
34
     {
 
35
       grub_free (nvlist);
 
36
       return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
 
37
                         "too new version %llu > %llu",
 
38
                         (unsigned long long) version,
 
39
-                        (unsigned long long) SPA_VERSION);
 
40
+                        (unsigned long long) SPA_VERSION_BEFORE_FEATURES);
 
41
     }
 
42
   grub_dprintf ("zfs", "check 9 passed\n");
 
43
 
 
44
--- a/include/grub/zfs/zfs.h
 
45
+++ b/include/grub/zfs/zfs.h
 
46
@@ -36,8 +36,12 @@
 
47
 /*
 
48
  * On-disk version number.
 
49
  */
 
50
-#define        SPA_VERSION                     33ULL
 
51
-
 
52
+#define        SPA_VERSION_INITIAL             1ULL
 
53
+#define        SPA_VERSION_BEFORE_FEATURES     33ULL
 
54
+#define        SPA_VERSION_FEATURES            5000ULL
 
55
+#define        SPA_VERSION_IS_SUPPORTED(v) \
 
56
+       (((v) >= SPA_VERSION_INITIAL && (v) <= SPA_VERSION_BEFORE_FEATURES) || \
 
57
+       ((v) == SPA_VERSION_FEATURES))
 
58
 /*
 
59
  * The following are configuration names used in the nvlist describing a pool's
 
60
  * configuration.