aboutsummaryrefslogtreecommitdiffstats
path: root/main/grub
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2018-09-04 06:24:47 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2018-09-04 06:25:14 +0000
commitbc2b2f660231afb4c09512175e93cc236758d9f9 (patch)
tree9e7a6b2e124e0fd90000a7f7263005d47a63d3de /main/grub
parent1ed9fcae5259c100cc349f4faa182fda40705e2a (diff)
downloadaports-bc2b2f660231afb4c09512175e93cc236758d9f9.tar.bz2
aports-bc2b2f660231afb4c09512175e93cc236758d9f9.tar.xz
main/grub: fix install on xfs
ref #9375
Diffstat (limited to 'main/grub')
-rw-r--r--main/grub/0009-xfs-Accept-filesystem-with-sparse-inodes.patch60
-rw-r--r--main/grub/APKBUILD6
2 files changed, 64 insertions, 2 deletions
diff --git a/main/grub/0009-xfs-Accept-filesystem-with-sparse-inodes.patch b/main/grub/0009-xfs-Accept-filesystem-with-sparse-inodes.patch
new file mode 100644
index 0000000000..6c6a750b42
--- /dev/null
+++ b/main/grub/0009-xfs-Accept-filesystem-with-sparse-inodes.patch
@@ -0,0 +1,60 @@
+From cda0a857dd7a27cd5d621747464bfe71e8727fff Mon Sep 17 00:00:00 2001
+From: Daniel Kiper <daniel.kiper@oracle.com>
+Date: Tue, 29 May 2018 16:16:02 +0200
+Subject: xfs: Accept filesystem with sparse inodes
+
+The sparse inode metadata format became a mkfs.xfs default in
+xfsprogs-4.16.0, and such filesystems are now rejected by grub as
+containing an incompatible feature.
+
+In essence, this feature allows xfs to allocate inodes into fragmented
+freespace. (Without this feature, if xfs could not allocate contiguous
+space for 64 new inodes, inode creation would fail.)
+
+In practice, the disk format change is restricted to the inode btree,
+which as far as I can tell is not used by grub. If all you're doing
+today is parsing a directory, reading an inode number, and converting
+that inode number to a disk location, then ignoring this feature
+should be fine, so I've added it to XFS_SB_FEAT_INCOMPAT_SUPPORTED
+
+I did some brief testing of this patch by hacking up the regression
+tests to completely fragment freespace on the test xfs filesystem, and
+then write a large-ish number of inodes to consume any existing
+contiguous 64-inode chunk. This way any files the grub tests add and
+traverse would be in such a fragmented inode allocation. Tests passed,
+but I'm not sure how to cleanly integrate that into the test harness.
+
+Signed-off-by: Eric Sandeen <sandeen@redhat.com>
+Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
+Tested-by: Chris Murphy <lists@colorremedies.com>
+---
+ grub-core/fs/xfs.c | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c
+index c6031bd..3b00c74 100644
+--- a/grub-core/fs/xfs.c
++++ b/grub-core/fs/xfs.c
+@@ -79,9 +79,18 @@ GRUB_MOD_LICENSE ("GPLv3+");
+ #define XFS_SB_FEAT_INCOMPAT_SPINODES (1 << 1) /* sparse inode chunks */
+ #define XFS_SB_FEAT_INCOMPAT_META_UUID (1 << 2) /* metadata UUID */
+
+-/* We do not currently verify metadata UUID so it is safe to read such filesystem */
++/*
++ * Directory entries with ftype are explicitly handled by GRUB code.
++ *
++ * We do not currently read the inode btrees, so it is safe to read filesystems
++ * with the XFS_SB_FEAT_INCOMPAT_SPINODES feature.
++ *
++ * We do not currently verify metadata UUID, so it is safe to read filesystems
++ * with the XFS_SB_FEAT_INCOMPAT_META_UUID feature.
++ */
+ #define XFS_SB_FEAT_INCOMPAT_SUPPORTED \
+ (XFS_SB_FEAT_INCOMPAT_FTYPE | \
++ XFS_SB_FEAT_INCOMPAT_SPINODES | \
+ XFS_SB_FEAT_INCOMPAT_META_UUID)
+
+ struct grub_xfs_sblock
+--
+cgit v1.0-41-gc330
+
diff --git a/main/grub/APKBUILD b/main/grub/APKBUILD
index 3a65f9b2fb..cd082e2891 100644
--- a/main/grub/APKBUILD
+++ b/main/grub/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname=grub
pkgver=2.02
-pkgrel=5
+pkgrel=6
pkgdesc="Bootloader with support for Linux, Multiboot and more"
url="https://www.gnu.org/software/grub/"
arch="all !s390x"
@@ -35,6 +35,7 @@ source="https://ftp.gnu.org/gnu/grub/grub-$pkgver.tar.xz
grub2-accept-empty-module.patch
grub-xen-host_grub.cfg
2.02_beta3-mkconfig-alpine.patch
+ 0009-xfs-Accept-filesystem-with-sparse-inodes.patch
"
builddir="$srcdir/grub-$pkgver"
@@ -159,4 +160,5 @@ sha512sums="cc6eb0a42b5c8df2f671cc128ff725afb3ff1f8832a196022e433cf0d3b75decfca2
f2a7d9ab6c445f4e402e790db56378cecd6631b5c367451aa6ce5c01cd95b95c83c3dd24d6d4b857f8f42601eba82c855607513eb6ce5b2af6bd6c71f046e288 fix-gcc-no-pie-specs.patch
098a1742aef131c85d63b934a9815879b991f2e73030cb90ac4b5dcd07d249fa0dd0a281e52ada0e10f05d59223493bd416eb47543242bf0ba336a0ebc9b2a1a grub2-accept-empty-module.patch
4e7394e0fff6772c89683039ccf81099ebbfe4f498e6df408977a1488fd59389b6e19afdbf0860ec271e2b2aea0df7216243dcc8235d1ca3af0e7f4d0a9d60a4 grub-xen-host_grub.cfg
-5de7c1cc11640a3892447f0daa1e3fd1f67b0c474c8aec555e4e6315b5e6c00491ba02c88b420cec221da0640c6961d639f148746df14a0b2c15bda7989cd25c 2.02_beta3-mkconfig-alpine.patch"
+5de7c1cc11640a3892447f0daa1e3fd1f67b0c474c8aec555e4e6315b5e6c00491ba02c88b420cec221da0640c6961d639f148746df14a0b2c15bda7989cd25c 2.02_beta3-mkconfig-alpine.patch
+4723c5dd9fd6e9b6c8677e32e4906c7995d695c7e85e834b1b29eb1d9a024678f8fa75846c7b929d1db9b5911b604c69c1b0379cb3b9adc98d5bb6d6719eb2c4 0009-xfs-Accept-filesystem-with-sparse-inodes.patch"