Skip to content

Commit

Permalink
Merge pull request #107 from DrDaveD/add-deb
Browse files Browse the repository at this point in the history
Add support in makedist for debian 11 & 12 and ubuntu 22 & 24
  • Loading branch information
DrDaveD authored Feb 5, 2025
2 parents 1f80363 + 925a695 commit a0cc403
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 5 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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
Expand Down
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions ci/make-and-test
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
6 changes: 5 additions & 1 deletion ci/privileged-run
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 *
Expand Down
37 changes: 37 additions & 0 deletions makedist
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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"
Expand Down

0 comments on commit a0cc403

Please sign in to comment.