From add77633e3e839e392ee1a9b847e5f1ab6adc6fa Mon Sep 17 00:00:00 2001 From: Chunmei Xu Date: Tue, 22 Mar 2022 19:37:16 +0800 Subject: [PATCH] change to use fuse3 Signed-off-by: Chunmei Xu --- 1000-change-to-use-fuse3.patch | 106 +++++++++++++++++++++++++++++++++ grub.patches | 2 + grub2.spec | 5 +- 3 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 1000-change-to-use-fuse3.patch diff --git a/1000-change-to-use-fuse3.patch b/1000-change-to-use-fuse3.patch new file mode 100644 index 0000000..ca5d41c --- /dev/null +++ b/1000-change-to-use-fuse3.patch @@ -0,0 +1,106 @@ +From 520f6df25b9643349c3a76ff197b967d3c2660c5 Mon Sep 17 00:00:00 2001 +From: Fedora Ninjas +Date: Tue, 22 Mar 2022 19:31:05 +0800 +Subject: [PATCH] change to use fuse3 + +Signed-off-by: Fedora Ninjas +--- + Makefile.util.def | 3 ++- + configure.ac | 10 +++++----- + util/grub-mount.c | 10 +++++----- + 3 files changed, 12 insertions(+), 11 deletions(-) + +diff --git a/Makefile.util.def b/Makefile.util.def +index 3f191aa..fa6e842 100644 +--- a/Makefile.util.def ++++ b/Makefile.util.def +@@ -315,11 +315,12 @@ program = { + common = grub-core/disk/host.c; + common = grub-core/osdep/init.c; + ++ cppflags = '-I/usr/include/fuse3'; + ldadd = libgrubmods.a; + ldadd = libgrubgcry.a; + ldadd = libgrubkern.a; + ldadd = grub-core/lib/gnulib/libgnu.a; +- ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM) -lfuse'; ++ ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM) -lfuse3'; + condition = COND_GRUB_MOUNT; + }; + +diff --git a/configure.ac b/configure.ac +index d04c946..878a54c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1874,16 +1874,16 @@ if test x"$enable_grub_mount" = xno ; then + fi + + if test x"$grub_mount_excuse" = x ; then +- AC_CHECK_LIB([fuse], [fuse_main_real], [], +- [grub_mount_excuse="need FUSE library"]) ++ AC_CHECK_LIB([fuse3], [fuse_main_real], [], ++ [grub_mount_excuse="need FUSE3 library"]) + fi + + if test x"$grub_mount_excuse" = x ; then + # Check for fuse headers. + SAVED_CPPFLAGS="$CPPFLAGS" +- CPPFLAGS="$CPPFLAGS -DFUSE_USE_VERSION=26" +- AC_CHECK_HEADERS([fuse/fuse.h], [], +- [grub_mount_excuse=["need FUSE headers"]]) ++ CPPFLAGS="$CPPFLAGS -I/usr/include/fuse3 -DFUSE_USE_VERSION=30" ++ AC_CHECK_HEADERS([fuse3/fuse.h], [], ++ [grub_mount_excuse=["need FUSE3 headers"]]) + CPPFLAGS="$SAVED_CPPFLAGS" + fi + +diff --git a/util/grub-mount.c b/util/grub-mount.c +index d7be2a4..b7fd04d 100644 +--- a/util/grub-mount.c ++++ b/util/grub-mount.c +@@ -16,7 +16,7 @@ + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ +-#define FUSE_USE_VERSION 26 ++#define FUSE_USE_VERSION 30 + #include + #include + #include +@@ -34,7 +34,7 @@ + #include + #include + #include +-#include ++#include + + #include + #include +@@ -147,7 +147,7 @@ fuse_getattr_find_file (const char *cur_filename, + } + + static int +-fuse_getattr (const char *path, struct stat *st) ++fuse_getattr (const char *path, struct stat *st, struct fuse_file_info *fi) + { + struct fuse_getattr_ctx ctx; + char *pathname, *path2; +@@ -330,13 +330,13 @@ fuse_readdir_call_fill (const char *filename, + st.st_blocks = (st.st_size + 511) >> 9; + st.st_atime = st.st_mtime = st.st_ctime + = info->mtimeset ? info->mtime : 0; +- ctx->fill (ctx->buf, filename, &st, 0); ++ ctx->fill (ctx->buf, filename, &st, 0, 0); + return 0; + } + + static int + fuse_readdir (const char *path, void *buf, +- fuse_fill_dir_t fill, off_t off, struct fuse_file_info *fi) ++ fuse_fill_dir_t fill, off_t off, struct fuse_file_info *fi, enum fuse_readdir_flags fl) + { + struct fuse_readdir_ctx ctx = { + .path = path, +-- +2.34.1 + diff --git a/grub.patches b/grub.patches index 2818569..0ffa64a 100644 --- a/grub.patches +++ b/grub.patches @@ -210,3 +210,5 @@ Patch0209: 0209-Update-gnulib-version-and-drop-most-gnulib-patches.patch Patch0210: 0210-commands-search-Fix-bug-stopping-iteration-when-no-f.patch Patch0211: 0211-search-new-efidisk-only-option-on-EFI-systems.patch Patch0212: 0212-efi-new-connectefi-command.patch + +Patch1000: 1000-change-to-use-fuse3.patch diff --git a/grub2.spec b/grub2.spec index 34807fe..10b2cc6 100644 --- a/grub2.spec +++ b/grub2.spec @@ -12,7 +12,7 @@ Name: grub2 Epoch: 1 Version: 2.06 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Bootloader with support for Linux, Multiboot and more License: GPLv3+ URL: http://www.gnu.org/software/grub/ @@ -500,5 +500,8 @@ mv ${EFI_HOME}/grub.cfg.stb ${EFI_HOME}/grub.cfg %endif %changelog +* Tue Mar 22 2022 Chunmei Xu - 2.06-2 +- change to use fuse3 + * Fri Mar 11 2022 forrest_ly - 2.06-1 - Init for Anolis OS 23 -- Gitee