From 925a695bb7001f223e3d036bd8783676369c715b Mon Sep 17 00:00:00 2001 From: Dave Dykstra <2129743+DrDaveD@users.noreply.github.com> Date: Wed, 5 Feb 2025 14:34:57 -0600 Subject: [PATCH] Add support in makedist for debian 11 & 12 and ubuntu 22 & 24 --- .github/workflows/build.yml | 8 ++++++++ ChangeLog | 3 +++ README.md | 17 +++++++++++++---- ci/make-and-test | 4 ++++ ci/privileged-run | 6 +++++- makedist | 37 +++++++++++++++++++++++++++++++++++++ 6 files changed, 70 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1fe2ee9..a081b45 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,6 +34,14 @@ jobs: version: 9 - distro: opensuse/leap version: 15 + - distro: debian + version: 11 + - distro: debian + version: 12 + - distro: ubuntu + version: 22.04 + - distro: ubuntu + version: 24.04 runs-on: ubuntu-24.04 steps: - name: Get source code diff --git a/ChangeLog b/ChangeLog index 333dc96..d56dbbe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +- Add translations in makedist from debian 11 & 12 and ubuntu 22 & 24 to + rhel8 & rhel9. + cvmfsexec-4.43 - 6 January 2025 - Adjust the URL for downloading osg packages after the layout changed. - Add the variable SINGCVMFS_LOGDIR to override the location of the diff --git a/README.md b/README.md index 99fd43b..f4cc1fe 100644 --- a/README.md +++ b/README.md @@ -48,10 +48,13 @@ Operating systems currently supported by this package are Red Hat Enterprise Linux (versions 7, 8, and 9) and its derivatives (CentOS, Scientific Linux, Rocky Linux, Alma Linux) and SUSE Linux Enterprise (version 15) -and its derivatives (openSUSE Leap). All of those support the -x86_64 architecture, and RHEL8 also supports ppc64le and aarch64. -Debian/Ubuntu probably could be supported but it would require some -development in the `makedist` command. +and its derivatives (openSUSE Leap). +Debian (11 and 12) and Ubuntu (22.04 & 24.04) are also supported +with modes 1 to 3, +by using rhel8 and rhel9 binaries; +those binaries aren't compatible enough for mode 4, however. +All of those support the x86_64 architecture, +and rhel8 also supports ppc64le and aarch64. Even though RHEL7 is now officially End of Life, cvmfsexec will still support it for a while because some people continue to use it with @@ -69,6 +72,12 @@ currently provide rpms for RHEL8 or 9. Additionally, specifying `none` will download from the `default` source but exclude the `cvmfs-config-default` package. +The `makedist` command does require 3 tools that are not always +installed on Linux distributions: `curl`, `rpm2cpio`, and `cpio`. +If those cannot be installed, you should be able to run the makedist +command on a host that does have them and copy the distribution to +the system where you need it. + By default a distribution for `cvmfsexec` and `mountrepo/umountrepo` is created. To instead make a distribution for `singcvmfs`, add the `-s` makedist option. By default the distribution made will match the diff --git a/ci/make-and-test b/ci/make-and-test index 13bb98c..21b4d48 100755 --- a/ci/make-and-test +++ b/ci/make-and-test @@ -57,6 +57,10 @@ for DIST in default osg egi; do fi ./umountrepo -a rm -rf dist /tmp/cvmfsexec + if [ "$ID" = debian ] || [ "$ID" = ubuntu ]; then + # skip singcvmfs test on debian & ubuntu + continue + fi ./makedist -s $DIST ./makedist -s -o /tmp/cvmfsexec SINGCVMFS_REPOSITORIES=atlas.cern.ch PATH=$PATH:$PWD/apptainer/bin \ diff --git a/ci/privileged-run b/ci/privileged-run index a48e10a..94ec394 100755 --- a/ci/privileged-run +++ b/ci/privileged-run @@ -6,6 +6,10 @@ set -ex if [ -f /usr/bin/zypper ]; then # suse zypper install -y tar gzip procps openssl-1_1 fuse fuse3 e2fsprogs fuse2fs +elif [ -f /usr/bin/apt ]; then + # debian or ubuntu + apt-get update + apt-get install -y procps curl rpm2cpio cpio fuse3 fuse2fs else # rhel yum install -y procps-ng cpio findutils fuse fuse3 e2fsprogs @@ -18,7 +22,7 @@ fi sysctl kernel.apparmor_restrict_unprivileged_userns=0 # switch to an unprivileged user -useradd -u 1000 --create-home -s /bin/bash testuser +useradd -u 1001 --create-home -s /bin/bash testuser # leave .git as original owner for post job cleanup chown testuser . chown -R testuser * diff --git a/makedist b/makedist index 0f78f94..c61a7dd 100755 --- a/makedist +++ b/makedist @@ -6,6 +6,7 @@ # SUPPORTEDTYPES="rhel7-x86_64 rhel8-aarch64 rhel8-x86_64 rhel8-ppc64le rhel9-aarch64 rhel9-x86_64 rhel9-ppc64le suse15-x86_64" +REQUIREDCMDS="curl rpm2cpio cpio" supportedtypes() { typeset LASTDISTRO="" @@ -35,6 +36,7 @@ usage() echo " The -m option selects machinetype for the distribution." echo " The default is the current machine. Supported types:" supportedtypes " " + echo " Debian and Ubuntu hosts get translated to corresponding rhel types." echo " The second usage puts 'dist' and cvmfsexec tools into one script with the" echo " given file name that self extracts and executes cvmfsexec." echo " After extraction, files are left behind under '.cvmfsexec' in the same" @@ -67,6 +69,8 @@ distroname() { case " $ID $ID_LIKE " in *" rhel "*) echo rhel;; *" suse "*) echo suse;; + *" ubuntu "*) echo ubuntu;; + *" debian "*) echo debian;; *) echo "Operating system in /etc/os-release not supported" >&2 exit 2;; esac @@ -104,6 +108,28 @@ VERS="`distroversion`" ARCH="`distroarch`" if [ -z "$MACHTYPE" ]; then + if [ "$DISTRO" = "debian" ]; then + if $SING; then + echo "debian not supported with -s" >&2 + exit 2 + fi + case "$VERS" in + 11) DISTRO=rhel; VERS=8;; + 12) DISTRO=rhel; VERS=9;; + *) echo "debian$VERS not supported, only 11 & 12 are" >&2 + exit 2;; + esac + elif [ "$DISTRO" = "ubuntu" ]; then + if $SING; then + echo "ubuntu not supported with -s" >&2 + exit 2 + fi + case "$VERS" in + 22|24) DISTRO=rhel; VERS=9;; + *) echo "ubuntu$VERS not supported, only 22 & 24 are" >&2 + exit 2;; + esac + fi MACHTYPE=$DISTRO$VERS-$ARCH fi @@ -121,6 +147,17 @@ if [ "$DISTRO" = "suse" ]; then MACH=sle fi +MISSINGCMDS="" +for CMD in $REQUIREDCMDS; do + if [ -z "$(type -p "$CMD")" ]; then + MISSINGCMDS="$MISSINGCMDS $CMD" + fi +done +if [ -n "$MISSINGCMDS" ]; then + echo "Required command(s)$MISSINGCMDS not found" >&2 + exit 2 +fi + HERE="$(cd `dirname $0` && pwd)" DIST="$HERE/dist"