grub: fix build; fix zfs detection

This commit is contained in:
Christian Neukirchen 2014-08-07 17:24:03 +02:00
parent 645936c8c2
commit 1a37c591cf
2 changed files with 61 additions and 1 deletions

View File

@ -0,0 +1,55 @@
--- grub-core/fs/zfs/zfs.c
+++ grub-core/fs/zfs/zfs.c
@@ -490,15 +490,11 @@ uberblock_verify (uberblock_phys_t * ub, grub_uint64_t offset,
if (grub_zfs_to_cpu64 (uber->ub_magic, GRUB_ZFS_LITTLE_ENDIAN)
== UBERBLOCK_MAGIC
- && grub_zfs_to_cpu64 (uber->ub_version, GRUB_ZFS_LITTLE_ENDIAN) > 0
- && grub_zfs_to_cpu64 (uber->ub_version, GRUB_ZFS_LITTLE_ENDIAN)
- <= SPA_VERSION)
- endian = GRUB_ZFS_LITTLE_ENDIAN;
+ && SPA_VERSION_IS_SUPPORTED(grub_zfs_to_cpu64 (uber->ub_version, GRUB_ZFS_LITTLE_ENDIAN)))
+ endian = GRUB_ZFS_LITTLE_ENDIAN;
if (grub_zfs_to_cpu64 (uber->ub_magic, GRUB_ZFS_BIG_ENDIAN) == UBERBLOCK_MAGIC
- && grub_zfs_to_cpu64 (uber->ub_version, GRUB_ZFS_BIG_ENDIAN) > 0
- && grub_zfs_to_cpu64 (uber->ub_version, GRUB_ZFS_BIG_ENDIAN)
- <= SPA_VERSION)
+ && SPA_VERSION_IS_SUPPORTED(grub_zfs_to_cpu64 (uber->ub_version, GRUB_ZFS_BIG_ENDIAN)))
endian = GRUB_ZFS_BIG_ENDIAN;
if (endian == GRUB_ZFS_UNKNOWN_ENDIAN)
@@ -845,13 +841,13 @@ check_pool_label (struct grub_zfs_data *data,
}
grub_dprintf ("zfs", "check 8 passed\n");
- if (version > SPA_VERSION)
+ if (!SPA_VERSION_IS_SUPPORTED(version))
{
grub_free (nvlist);
return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
"too new version %llu > %llu",
(unsigned long long) version,
- (unsigned long long) SPA_VERSION);
+ (unsigned long long) SPA_VERSION_BEFORE_FEATURES);
}
grub_dprintf ("zfs", "check 9 passed\n");
--- include/grub/zfs/zfs.h
+++ include/grub/zfs/zfs.h
@@ -36,8 +36,13 @@ typedef enum grub_zfs_endian
/*
* On-disk version number.
*/
-#define SPA_VERSION 33ULL
-
+#define SPA_VERSION_INITIAL 1ULL
+#define SPA_VERSION_BEFORE_FEATURES 33ULL
+#define SPA_VERSION 5000ULL
+#define SPA_VERSION_FEATURES 5000ULL
+#define SPA_VERSION_IS_SUPPORTED(v) \
+ (((v) >= SPA_VERSION_INITIAL && (v) <= SPA_VERSION_BEFORE_FEATURES) || \
+ ((v) >= SPA_VERSION_FEATURES && (v) <= SPA_VERSION))
/*
* The following are configuration names used in the nvlist describing a pool's
* configuration.

View File

@ -1,7 +1,7 @@
# Template file for 'grub' # Template file for 'grub'
pkgname=grub pkgname=grub
version=2.00 version=2.00
revision=12 revision=13
hostmakedepends="flex" hostmakedepends="flex"
makedepends="libusb-compat-devel ncurses-devel freetype-devel makedepends="libusb-compat-devel ncurses-devel freetype-devel
liblzma-devel device-mapper-devel font-unifont-bdf fuse-devel" liblzma-devel device-mapper-devel font-unifont-bdf fuse-devel"
@ -14,8 +14,13 @@ homepage="http://www.gnu.org/software/grub/"
distfiles="$GNU_SITE/grub/grub-$version.tar.xz" distfiles="$GNU_SITE/grub/grub-$version.tar.xz"
checksum=784ec38e7edc32239ad75b8e66df04dc8bfb26d88681bc9f627133a6eb85c458 checksum=784ec38e7edc32239ad75b8e66df04dc8bfb26d88681bc9f627133a6eb85c458
post_extract() {
sed -i -e 's,freetype/ftsynth.h,freetype2/ftsynth.h,' util/grub-mkfont.c
}
do_configure() { do_configure() {
unset CC AS LD RANLIB CPP unset CC AS LD RANLIB CPP
CFLAGS="$CFLAGS -fno-stack-protector"
configure_args+=" --enable-device-mapper --enable-cache-stats --enable-nls configure_args+=" --enable-device-mapper --enable-cache-stats --enable-nls
--enable-grub-mkfont --enable-grub-mount --disable-werror " --enable-grub-mkfont --enable-grub-mount --disable-werror "