From 583d78af2d6785e40b5ce4e1381ba81076443e7f Mon Sep 17 00:00:00 2001 From: Ievgen Sliusar Date: Wed, 17 Jul 2024 09:33:44 +0200 Subject: [PATCH 1/5] mountrepo: detect fuse3 library presence --- mountrepo | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/mountrepo b/mountrepo index 350de69..c98226d 100755 --- a/mountrepo +++ b/mountrepo @@ -141,18 +141,16 @@ fi mkdir -p $DIST/var/run/cvmfs mkdir -p $DIST/cvmfs/$REPO if [ -f $DIST/usr/lib/libcvmfs_fuse.so ]; then - LPATH=$DIST/usr/lib - LDPATH=$LPATH - if [ ! -f $LPATH/libfuse.so.2 ]; then - # for el6 - LDPATH=$LPATH:$DIST/lib - fi + LIBDIR=lib else - LPATH=$DIST/usr/lib64 - LDPATH=$LPATH + LIBDIR=lib64 +fi +LPATH=$DIST/usr/$LIBDIR +LDPATH=$LPATH +if [ ! -f $LPATH/libfuse3.so.3 ]; then if [ ! -f $LPATH/libfuse.so.2 ]; then # for el6 - LDPATH=$LPATH:$DIST/lib64 + LDPATH=$LPATH:$DIST/$LIBDIR fi fi LD_LIBRARY_PATH=$LDPATH CVMFS_LIBRARY_PATH=$LPATH $DIST/usr/bin/cvmfs2 -o config=$CONFFILE$OPTS $REPO $DIST/cvmfs/$REPO From 1ce933c586d12942458f44346663e216505c035e Mon Sep 17 00:00:00 2001 From: Ievgen Sliusar Date: Wed, 17 Jul 2024 09:34:45 +0200 Subject: [PATCH 2/5] umountrepo: detect fusermount helper version available on the system --- umountrepo | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/umountrepo b/umountrepo index a8472bd..76aa4a6 100755 --- a/umountrepo +++ b/umountrepo @@ -62,22 +62,28 @@ if [ "`id -u`" == 0 ]; then ISROOT=true else ISROOT=false + # detect fusermount helper available on the system + FUSERMOUNT=$(command -pv fusermount) + if [ -z "$FUSERMOUNT" ]; then + FUSERMOUNT=$(command -pv fusermount3) + fi fi + for REPO; do if $LAZY; then echo "Lazily unmounting $REPO" if $ISROOT; then umount -l $REPO else - fusermount -uz $REPO + $FUSERMOUNT -uz $REPO fi else echo "Unmounting $REPO" if $ISROOT; then umount $REPO else - fusermount -u $REPO + $FUSERMOUNT -u $REPO fi rmdir $REPO fi From 806dd7cfd598a733cb7a3ae21f487484d72e75ea Mon Sep 17 00:00:00 2001 From: Ievgen Sliusar Date: Wed, 17 Jul 2024 09:36:18 +0200 Subject: [PATCH 3/5] makedist: allow explicit fuse3-based distribution creation --- makedist | 94 ++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 58 insertions(+), 36 deletions(-) diff --git a/makedist b/makedist index 3db1ec5..3566c16 100755 --- a/makedist +++ b/makedist @@ -10,8 +10,8 @@ SUPPORTEDTYPES="rhel7-x86_64 rhel8-aarch64 rhel8-x86_64 rhel8-ppc64le rhel9-x86_ usage() { ( - echo "Usage: makedist [-s] [ -m machinetype ] {osg|egi|default|none}" - echo " makedist [-s] -o " + echo "Usage: makedist [-s] [-3] [ -m machinetype ] {osg|egi|default|none}" + echo " makedist [-s] [-3] -o " echo " The first usage creates a distribution in 'dist' directory." echo " The -m option selects machinetype for the distribution." echo " The default is the current machine. Supported types:" @@ -22,11 +22,13 @@ usage() echo " directory as the script." echo " The -s option makes both operations work for singcvmfs instead" echo " of cvmfsexec, and files are left in .singcvmfs" + echo " The -3 option forces use of fuse3 backend for all machine types." ) >&2 exit 2 } SING=false +FUSE3=false MACHTYPE="" while true; do if [ "$1" = "-s" ]; then @@ -35,6 +37,9 @@ while true; do elif [ "$1" = "-m" ]; then MACHTYPE="$2" shift 2 + elif [ "$1" = "-3" ]; then + FUSE3=true + shift else break fi @@ -302,49 +307,66 @@ if $INCLUDEHELPER; then fi FUSESUBDIR=false -CVMFSFUSE3URL="$CVMFSURL/`echo $CVMFSRPMNAME|sed 's/cvmfs-/cvmfs-fuse3-/'`" +CVMFSFUSE3RPMNAME=`echo $CVMFSRPMNAME|sed 's/cvmfs-/cvmfs-fuse3-/'` +CVMFSFUSE3URL="$CVMFSURL/$CVMFSFUSE3RPMNAME" + +USEFUSE3=false if $SING; then + USEFUSE3=true +fi +if $FUSE3; then + USEFUSE3=true +fi +if [ "$EL" -ge 9 ]; then + USEFUSE3=true +fi + +if [ "$DISTRO" = suse ]; then + if $USEFUSE3; then + # hack to check if package is available in current dir + if [ ! -f "$HERE/$CVMFSFUSE3RPMNAME" ]; then + echo "No cvmfs-fuse3 for suse15 available." >&2 + echo "Please provide custom-built $CVMFSFUSE3RPMNAME in the $HERE directory to continue." >&2 + exit 1 + else + CVMFSFUSE3URL="file://$HERE/$CVMFSFUSE3RPMNAME" + fi + fi +fi + +if $USEFUSE3; then URLS="$URLS $CVMFSFUSE3URL" - if [ "$EL" -lt 8 ]; then - FUSEURL="https://archives.fedoraproject.org/pub/archive/epel/$EL/$ARCH/Packages" - FUSESUBDIR=true - elif [ "$EL" -eq 8 ]; then - FUSEURL="https://repo.almalinux.org/almalinux/$EL/BaseOS/$ARCH/os/Packages" + FUSELIB=fuse3-libs +else + FUSELIB=fuse-libs +fi +if [ "$DISTRO" = suse ]; then + FUSEURL="https://download.opensuse.org/distribution/openSUSE-stable/repo/oss/x86_64" + if $USEFUSE3; then + FUSELIB=libfuse3 else - FUSEURL="https://repo.almalinux.org/almalinux/$EL/AppStream/$ARCH/os/Packages" - fi - URL="`latesturl $FUSEURL fuse3-libs $FUSESUBDIR`" - if [ -z "$URL" ]; then - echo "No fuse3-libs package found from $FUSEURL" >&2 - exit 1 + FUSELIB=libfuse2 fi - URLS="$URLS $URL" else - if [ "$DISTRO" = suse ]; then - FUSEURL="https://download.opensuse.org/distribution/openSUSE-stable/repo/oss/x86_64" - FUSELIB=libfuse2 - else - if [ "$EL" -lt 8 ]; then - FUSEURL="https://vault.centos.org/centos/$EL/os/$ARCH/Packages/" - elif [ "$EL" -eq 8 ]; then - FUSEURL="https://repo.almalinux.org/almalinux/$EL/BaseOS/$ARCH/os/Packages" - else - FUSEURL="https://repo.almalinux.org/almalinux/$EL/AppStream/$ARCH/os/Packages" - fi - if [ "$EL" -lt 9 ]; then - FUSELIB=fuse-libs + if [ "$EL" -lt 8 ]; then + if $USEFUSE3; then + FUSEURL="https://archives.fedoraproject.org/pub/archive/epel/$EL/$ARCH/Packages" + FUSESUBDIR=true else - FUSELIB=fuse3-libs - URLS="$URLS $CVMFSFUSE3URL" + FUSEURL="https://vault.centos.org/centos/$EL/os/$ARCH/Packages/" fi + elif [ "$EL" -eq 8 ]; then + FUSEURL="https://repo.almalinux.org/almalinux/$EL/BaseOS/$ARCH/os/Packages" + else + FUSEURL="https://repo.almalinux.org/almalinux/$EL/AppStream/$ARCH/os/Packages" fi - URL="`latesturl $FUSEURL $FUSELIB $FUSESUBDIR`" - if [ -z "$URL" ]; then - echo "No $FUSELIB package found from $FUSEURL" >&2 - exit 1 - fi - URLS="$URLS $URL" fi +URL="`latesturl $FUSEURL $FUSELIB $FUSESUBDIR`" +if [ -z "$URL" ]; then + echo "No $FUSELIB package found from $FUSEURL" >&2 + exit 1 +fi +URLS="$URLS $URL" if [ "$EL" -eq 7 ]; then # add fuse2fs only on EL7, it is standard elsewhere From a8b62bd75fe63055fcd7fd9e511de90f450187f4 Mon Sep 17 00:00:00 2001 From: Ievgen Sliusar Date: Wed, 14 Aug 2024 14:16:12 +0200 Subject: [PATCH 4/5] Generalize SuSE distro version in message --- makedist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makedist b/makedist index 3566c16..6de2330 100755 --- a/makedist +++ b/makedist @@ -325,7 +325,7 @@ if [ "$DISTRO" = suse ]; then if $USEFUSE3; then # hack to check if package is available in current dir if [ ! -f "$HERE/$CVMFSFUSE3RPMNAME" ]; then - echo "No cvmfs-fuse3 for suse15 available." >&2 + echo "No cvmfs-fuse3 for SuSE available." >&2 echo "Please provide custom-built $CVMFSFUSE3RPMNAME in the $HERE directory to continue." >&2 exit 1 else From 0cbbecb973aeff4e5bbaab176bf2879a7572be88 Mon Sep 17 00:00:00 2001 From: Ievgen Sliusar Date: Wed, 14 Aug 2024 14:19:09 +0200 Subject: [PATCH 5/5] Use single USEFUSE3 variable --- makedist | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/makedist b/makedist index 6de2330..d0bd97b 100755 --- a/makedist +++ b/makedist @@ -28,7 +28,7 @@ usage() } SING=false -FUSE3=false +USEFUSE3=false MACHTYPE="" while true; do if [ "$1" = "-s" ]; then @@ -38,7 +38,7 @@ while true; do MACHTYPE="$2" shift 2 elif [ "$1" = "-3" ]; then - FUSE3=true + USEFUSE3=true shift else break @@ -310,13 +310,9 @@ FUSESUBDIR=false CVMFSFUSE3RPMNAME=`echo $CVMFSRPMNAME|sed 's/cvmfs-/cvmfs-fuse3-/'` CVMFSFUSE3URL="$CVMFSURL/$CVMFSFUSE3RPMNAME" -USEFUSE3=false if $SING; then USEFUSE3=true fi -if $FUSE3; then - USEFUSE3=true -fi if [ "$EL" -ge 9 ]; then USEFUSE3=true fi