From e38f864017a06cab61ad878db8bca02b26f2e0d5 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 20 Apr 2023 08:25:31 +0200 Subject: [PATCH] gitlab-ci: Update Fedora to version 38 Signed-off-by: Andreas Schneider Reviewed-by: Andrew Bartlett Autobuild-User(master): Andreas Schneider Autobuild-Date(master): Thu Apr 27 08:22:58 UTC 2023 on atb-devel-224 --- .gitlab-ci-main.yml | 44 ++---- bootstrap/.gitlab-ci.yml | 5 +- bootstrap/config.py | 20 +-- bootstrap/generated-dists/Vagrantfile | 17 +-- .../generated-dists/centos7/bootstrap.sh | 1 + .../generated-dists/centos7/packages.yml | 1 + .../generated-dists/centos8s/bootstrap.sh | 1 + .../generated-dists/centos8s/packages.yml | 1 + bootstrap/generated-dists/fedora38/Dockerfile | 29 ++++ .../generated-dists/fedora38/bootstrap.sh | 126 ++++++++++++++++++ bootstrap/generated-dists/fedora38/locale.sh | 55 ++++++++ .../generated-dists/fedora38/packages.yml | 111 +++++++++++++++ .../generated-dists/opensuse154/bootstrap.sh | 1 + .../generated-dists/opensuse154/packages.yml | 1 + bootstrap/sha1sum.txt | 2 +- 15 files changed, 349 insertions(+), 66 deletions(-) create mode 100644 bootstrap/generated-dists/fedora38/Dockerfile create mode 100755 bootstrap/generated-dists/fedora38/bootstrap.sh create mode 100755 bootstrap/generated-dists/fedora38/locale.sh create mode 100644 bootstrap/generated-dists/fedora38/packages.yml diff --git a/.gitlab-ci-main.yml b/.gitlab-ci-main.yml index e725bfd0775..4208cbcc104 100644 --- a/.gitlab-ci-main.yml +++ b/.gitlab-ci-main.yml @@ -47,7 +47,7 @@ variables: # Set this to the contents of bootstrap/sha1sum.txt # which is generated by bootstrap/template.py --render # - SAMBA_CI_CONTAINER_TAG: 790c229c42a67336099420d137fa9dc9974a133a + SAMBA_CI_CONTAINER_TAG: cfddaa8d36c3f512827bd96fe05c30f7f8337f4b # # We use the ubuntu2204 image as default as # it matches what we have on atb-devel-224 @@ -64,8 +64,7 @@ variables: SAMBA_CI_CONTAINER_IMAGE_ubuntu2204: ubuntu2204 SAMBA_CI_CONTAINER_IMAGE_debian11: debian11 SAMBA_CI_CONTAINER_IMAGE_opensuse154: opensuse154 - SAMBA_CI_CONTAINER_IMAGE_fedora37: fedora37 - SAMBA_CI_CONTAINER_IMAGE_f37mit120: f37mit120 + SAMBA_CI_CONTAINER_IMAGE_fedora38: fedora38 SAMBA_CI_CONTAINER_IMAGE_centos7: centos7 SAMBA_CI_CONTAINER_IMAGE_centos8s: centos8s @@ -263,33 +262,18 @@ samba-def-build: samba-mit-build: extends: .shared_template_build_only variables: - SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_fedora37} - stage: build_first - -samba-mit120-build: - extends: .shared_template_build_only - variables: - AUTOBUILD_JOB_NAME: samba-mit-build - SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_f37mit120} + SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_fedora38} stage: build_first .needs_samba-mit-build: extends: .shared_template_test_only variables: - SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_fedora37} + SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_fedora38} needs: - job: samba-mit-build artifacts: true - job: samba-shellcheck -.needs_samba-mit120-build: - extends: .shared_template_test_only - variables: - SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_f37mit120} - needs: - - job: samba-mit120-build - artifacts: true - samba-h5l-build: extends: .shared_template_build_only @@ -332,7 +316,7 @@ samba: samba-mitkrb5: extends: .shared_template variables: - SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_fedora37} + SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_fedora38} samba-minimal-smbd: extends: .shared_template @@ -402,13 +386,13 @@ samba-addc-mit-4b: samba-fips: extends: .shared_template variables: - SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_fedora37} + SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_fedora38} samba-shellcheck: extends: .shared_template needs: variables: - SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_fedora37} + SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_fedora38} stage: build_first .private_test_only: @@ -435,11 +419,6 @@ samba-shellcheck: - .needs_samba-mit-build - .private_test_only -.needs_samba-mit120-build-private: - extends: - - .needs_samba-mit120-build - - .private_test_only - .needs_samba-h5l-build-private: extends: - .needs_samba-h5l-build @@ -482,11 +461,6 @@ samba-nt4: samba-addc-mit-1: extends: .needs_samba-mit-build-private -samba-addc-mit120: - extends: .needs_samba-mit120-build-private - variables: - AUTOBUILD_JOB_NAME: samba-addc-mit-1 - samba-no-opath1: extends: .needs_samba-no-opath-build-private @@ -662,10 +636,10 @@ centos8s-samba-o3: variables: SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_centos8s} -fedora37-samba-o3: +fedora38-samba-o3: extends: .samba-o3-template variables: - SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_fedora37} + SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_fedora38} # # Keep the samba-o3 sections at the end ... diff --git a/bootstrap/.gitlab-ci.yml b/bootstrap/.gitlab-ci.yml index be1e14b4b14..ef72d1538f1 100644 --- a/bootstrap/.gitlab-ci.yml +++ b/bootstrap/.gitlab-ci.yml @@ -105,10 +105,7 @@ ubuntu2204: debian11: extends: .build_image_template -fedora37: - extends: .build_image_template - -f37mit120: +fedora38: extends: .build_image_template centos8s: diff --git a/bootstrap/config.py b/bootstrap/config.py index d2ad4503430..fd1753fb3e1 100644 --- a/bootstrap/config.py +++ b/bootstrap/config.py @@ -135,6 +135,7 @@ PKGS = [ ('', 'mold'), ('', 'ShellCheck'), ('', 'shfmt'), + ('', 'crypto-policies-scripts'), ('python3', 'python3'), ('python3-cryptography', 'python3-cryptography'), # for krb5 tests @@ -268,6 +269,8 @@ dnf install -y \ {pkgs} dnf clean all + +update-crypto-policies --set DEFAULT:AD-SUPPORT """ DNF_BOOTSTRAP_MIT = r""" @@ -508,9 +511,9 @@ RPM_DISTS = { 'shfmt': '', } }, - 'fedora37': { - 'docker_image': 'quay.io/fedora/fedora:37', - 'vagrant_box': 'fedora/37-cloud-base', + 'fedora38': { + 'docker_image': 'quay.io/fedora/fedora:38', + 'vagrant_box': 'fedora/38-cloud-base', 'bootstrap': DNF_BOOTSTRAP, 'replace': { 'lsb-release': 'redhat-lsb', @@ -519,17 +522,6 @@ RPM_DISTS = { 'libtracker-sparql-2.0-dev': '', # only tracker 3.x is available } }, - 'f37mit120': { - 'docker_image': 'quay.io/fedora/fedora:37', - 'vagrant_box': 'fedora/37-cloud-base', - 'bootstrap': DNF_BOOTSTRAP_MIT, - 'replace': { - 'lsb-release': 'redhat-lsb', - 'perl-FindBin': '', - 'python3-iso8601': 'python3-dateutil', - 'libtracker-sparql-2.0-dev': '', # only tracker 3.x is available - } - }, 'opensuse154': { 'docker_image': 'opensuse/leap:15.4', 'vagrant_box': 'opensuse/openSUSE-15.4-x86_64', diff --git a/bootstrap/generated-dists/Vagrantfile b/bootstrap/generated-dists/Vagrantfile index d67db745c8d..e744511d360 100644 --- a/bootstrap/generated-dists/Vagrantfile +++ b/bootstrap/generated-dists/Vagrantfile @@ -31,18 +31,11 @@ Vagrant.configure("2") do |config| v.vm.provision :shell, path: "debian11/locale.sh" end - config.vm.define "f37mit120" do |v| - v.vm.box = "fedora/37-cloud-base" - v.vm.hostname = "f37mit120" - v.vm.provision :shell, path: "f37mit120/bootstrap.sh" - v.vm.provision :shell, path: "f37mit120/locale.sh" - end - - config.vm.define "fedora37" do |v| - v.vm.box = "fedora/37-cloud-base" - v.vm.hostname = "fedora37" - v.vm.provision :shell, path: "fedora37/bootstrap.sh" - v.vm.provision :shell, path: "fedora37/locale.sh" + config.vm.define "fedora38" do |v| + v.vm.box = "fedora/38-cloud-base" + v.vm.hostname = "fedora38" + v.vm.provision :shell, path: "fedora38/bootstrap.sh" + v.vm.provision :shell, path: "fedora38/locale.sh" end config.vm.define "opensuse154" do |v| diff --git a/bootstrap/generated-dists/centos7/bootstrap.sh b/bootstrap/generated-dists/centos7/bootstrap.sh index ad8488b596f..c8bbd9d62f1 100755 --- a/bootstrap/generated-dists/centos7/bootstrap.sh +++ b/bootstrap/generated-dists/centos7/bootstrap.sh @@ -25,6 +25,7 @@ yum install -y \ ccache \ chrpath \ compat-gnutls37-devel \ + crypto-policies-scripts \ cups-devel \ curl \ dbus-devel \ diff --git a/bootstrap/generated-dists/centos7/packages.yml b/bootstrap/generated-dists/centos7/packages.yml index 09b3d4b3f06..9b0f5285f19 100644 --- a/bootstrap/generated-dists/centos7/packages.yml +++ b/bootstrap/generated-dists/centos7/packages.yml @@ -11,6 +11,7 @@ packages: - ccache - chrpath - compat-gnutls37-devel + - crypto-policies-scripts - cups-devel - curl - dbus-devel diff --git a/bootstrap/generated-dists/centos8s/bootstrap.sh b/bootstrap/generated-dists/centos8s/bootstrap.sh index 0dc04a843dd..6a1df119535 100755 --- a/bootstrap/generated-dists/centos8s/bootstrap.sh +++ b/bootstrap/generated-dists/centos8s/bootstrap.sh @@ -28,6 +28,7 @@ yum install -y \ bison \ ccache \ chrpath \ + crypto-policies-scripts \ cups-devel \ curl \ dbus-devel \ diff --git a/bootstrap/generated-dists/centos8s/packages.yml b/bootstrap/generated-dists/centos8s/packages.yml index 5da7f2ac0d9..0bae860437b 100644 --- a/bootstrap/generated-dists/centos8s/packages.yml +++ b/bootstrap/generated-dists/centos8s/packages.yml @@ -10,6 +10,7 @@ packages: - bison - ccache - chrpath + - crypto-policies-scripts - cups-devel - curl - dbus-devel diff --git a/bootstrap/generated-dists/fedora38/Dockerfile b/bootstrap/generated-dists/fedora38/Dockerfile new file mode 100644 index 00000000000..10002774e20 --- /dev/null +++ b/bootstrap/generated-dists/fedora38/Dockerfile @@ -0,0 +1,29 @@ +# +# This file is generated by 'bootstrap/template.py --render' +# See also bootstrap/config.py +# + +FROM quay.io/fedora/fedora:38 + +# pass in with --build-arg while build +ARG SHA1SUM +RUN [ -n $SHA1SUM ] && echo $SHA1SUM > /sha1sum.txt + +ADD *.sh /tmp/ +# need root permission, do it before USER samba +RUN /tmp/bootstrap.sh && /tmp/locale.sh + +# if ld.gold exists, force link it to ld +RUN set -x; ! LD_GOLD=$(which ld.gold) || { LD=$(which ld) && ln -sf $LD_GOLD $LD && test -x $LD && echo "$LD is now $LD_GOLD"; } +# if ld.mold exists, force link it to ld (prefer mold over gold! ;-) +RUN set -x; ! LD_MOLD=$(which ld.mold) || { LD=$(which ld) && ln -sf $LD_MOLD $LD && test -x $LD && echo "$LD is now $LD_MOLD"; } + +# make test can not work with root, so we have to create a new user +RUN useradd -m -U -s /bin/bash samba && \ + mkdir -p /etc/sudoers.d && \ + echo "samba ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/samba + +USER samba +WORKDIR /home/samba +# samba tests rely on this +ENV USER=samba LC_ALL=en_US.utf8 LANG=en_US.utf8 \ No newline at end of file diff --git a/bootstrap/generated-dists/fedora38/bootstrap.sh b/bootstrap/generated-dists/fedora38/bootstrap.sh new file mode 100755 index 00000000000..1e76edbb982 --- /dev/null +++ b/bootstrap/generated-dists/fedora38/bootstrap.sh @@ -0,0 +1,126 @@ +#!/bin/bash + +# +# This file is generated by 'bootstrap/template.py --render' +# See also bootstrap/config.py +# + +set -xueo pipefail + +dnf update -y + +dnf install -y \ + --setopt=install_weak_deps=False \ + @development-tools \ + ShellCheck \ + acl \ + attr \ + autoconf \ + avahi-devel \ + bind-utils \ + binutils \ + bison \ + ccache \ + chrpath \ + crypto-policies-scripts \ + cups-devel \ + curl \ + dbus-devel \ + docbook-dtds \ + docbook-style-xsl \ + flex \ + gawk \ + gcc \ + gdb \ + git \ + glib2-devel \ + glibc-common \ + glibc-langpack-en \ + glusterfs-api-devel \ + glusterfs-devel \ + gnutls-devel \ + gpgme-devel \ + gzip \ + hostname \ + htop \ + jansson-devel \ + jq \ + keyutils-libs-devel \ + krb5-devel \ + krb5-server \ + krb5-workstation \ + lcov \ + libacl-devel \ + libarchive-devel \ + libattr-devel \ + libblkid-devel \ + libbsd-devel \ + libcap-devel \ + libcephfs-devel \ + libicu-devel \ + libpcap-devel \ + libtasn1-devel \ + libtasn1-tools \ + libtirpc-devel \ + libunwind-devel \ + liburing-devel \ + libuuid-devel \ + libxslt \ + lmdb \ + lmdb-devel \ + make \ + mingw64-gcc \ + mold \ + ncurses-devel \ + openldap-devel \ + pam-devel \ + patch \ + perl \ + perl-Archive-Tar \ + perl-ExtUtils-MakeMaker \ + perl-JSON \ + perl-JSON-Parse \ + perl-Parse-Yapp \ + perl-Test-Base \ + perl-generators \ + perl-interpreter \ + pkgconfig \ + popt-devel \ + procps-ng \ + psmisc \ + python3 \ + python3-cryptography \ + python3-dateutil \ + python3-devel \ + python3-dns \ + python3-gpg \ + python3-libsemanage \ + python3-markdown \ + python3-policycoreutils \ + python3-pyasn1 \ + python3-requests \ + python3-setproctitle \ + quota-devel \ + readline-devel \ + redhat-lsb \ + rng-tools \ + rpcgen \ + rpcsvc-proto-devel \ + rsync \ + sed \ + shfmt \ + sudo \ + systemd-devel \ + tar \ + tracker-devel \ + tree \ + wget \ + which \ + xfsprogs-devel \ + xz \ + yum-utils \ + zlib-devel + +dnf clean all + +update-crypto-policies --set DEFAULT:AD-SUPPORT \ No newline at end of file diff --git a/bootstrap/generated-dists/fedora38/locale.sh b/bootstrap/generated-dists/fedora38/locale.sh new file mode 100755 index 00000000000..cc64e180483 --- /dev/null +++ b/bootstrap/generated-dists/fedora38/locale.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +# +# This file is generated by 'bootstrap/template.py --render' +# See also bootstrap/config.py +# + +set -xueo pipefail + +# refer to /usr/share/i18n/locales +INPUTFILE=en_US +# refer to /usr/share/i18n/charmaps +CHARMAP=UTF-8 +# locale to generate in /usr/lib/locale +# glibc/localedef will normalize UTF-8 to utf8, follow the naming style +LOCALE=$INPUTFILE.utf8 + +# if locale is already correct, exit +( locale | grep LC_ALL | grep -i $LOCALE ) && exit 0 + +# if locale not available, generate locale into /usr/lib/locale +if ! ( locale --all-locales | grep -i $LOCALE ) +then + # no-archive means create its own dir + localedef --inputfile $INPUTFILE --charmap $CHARMAP --no-archive $LOCALE +fi + +# update locale conf and global env file +# set both LC_ALL and LANG for safe + +# update conf for Debian family +FILE=/etc/default/locale +if [ -f $FILE ] +then + echo LC_ALL="$LOCALE" > $FILE + echo LANG="$LOCALE" >> $FILE +fi + +# update conf for RedHat family +FILE=/etc/locale.conf +if [ -f $FILE ] +then + # LC_ALL is not valid in this file, set LANG only + echo LANG="$LOCALE" > $FILE +fi + +# update global env file +FILE=/etc/environment +if [ -f $FILE ] +then + # append LC_ALL if not exist + grep LC_ALL $FILE || echo LC_ALL="$LOCALE" >> $FILE + # append LANG if not exist + grep LANG $FILE || echo LANG="$LOCALE" >> $FILE +fi \ No newline at end of file diff --git a/bootstrap/generated-dists/fedora38/packages.yml b/bootstrap/generated-dists/fedora38/packages.yml new file mode 100644 index 00000000000..3b4d6fb3628 --- /dev/null +++ b/bootstrap/generated-dists/fedora38/packages.yml @@ -0,0 +1,111 @@ +--- +packages: + - @development-tools + - ShellCheck + - acl + - attr + - autoconf + - avahi-devel + - bind-utils + - binutils + - bison + - ccache + - chrpath + - crypto-policies-scripts + - cups-devel + - curl + - dbus-devel + - docbook-dtds + - docbook-style-xsl + - flex + - gawk + - gcc + - gdb + - git + - glib2-devel + - glibc-common + - glibc-langpack-en + - glusterfs-api-devel + - glusterfs-devel + - gnutls-devel + - gpgme-devel + - gzip + - hostname + - htop + - jansson-devel + - jq + - keyutils-libs-devel + - krb5-devel + - krb5-server + - krb5-workstation + - lcov + - libacl-devel + - libarchive-devel + - libattr-devel + - libblkid-devel + - libbsd-devel + - libcap-devel + - libcephfs-devel + - libicu-devel + - libpcap-devel + - libtasn1-devel + - libtasn1-tools + - libtirpc-devel + - libunwind-devel + - liburing-devel + - libuuid-devel + - libxslt + - lmdb + - lmdb-devel + - make + - mingw64-gcc + - mold + - ncurses-devel + - openldap-devel + - pam-devel + - patch + - perl + - perl-Archive-Tar + - perl-ExtUtils-MakeMaker + - perl-JSON + - perl-JSON-Parse + - perl-Parse-Yapp + - perl-Test-Base + - perl-generators + - perl-interpreter + - pkgconfig + - popt-devel + - procps-ng + - psmisc + - python3 + - python3-cryptography + - python3-dateutil + - python3-devel + - python3-dns + - python3-gpg + - python3-libsemanage + - python3-markdown + - python3-policycoreutils + - python3-pyasn1 + - python3-requests + - python3-setproctitle + - quota-devel + - readline-devel + - redhat-lsb + - rng-tools + - rpcgen + - rpcsvc-proto-devel + - rsync + - sed + - shfmt + - sudo + - systemd-devel + - tar + - tracker-devel + - tree + - wget + - which + - xfsprogs-devel + - xz + - yum-utils + - zlib-devel \ No newline at end of file diff --git a/bootstrap/generated-dists/opensuse154/bootstrap.sh b/bootstrap/generated-dists/opensuse154/bootstrap.sh index 33f46c41284..721f7a67a76 100755 --- a/bootstrap/generated-dists/opensuse154/bootstrap.sh +++ b/bootstrap/generated-dists/opensuse154/bootstrap.sh @@ -22,6 +22,7 @@ zypper --non-interactive install \ bison \ ccache \ chrpath \ + crypto-policies-scripts \ cups-devel \ curl \ dbus-1-devel \ diff --git a/bootstrap/generated-dists/opensuse154/packages.yml b/bootstrap/generated-dists/opensuse154/packages.yml index ddb2d37c4b7..18921cf0751 100644 --- a/bootstrap/generated-dists/opensuse154/packages.yml +++ b/bootstrap/generated-dists/opensuse154/packages.yml @@ -10,6 +10,7 @@ packages: - bison - ccache - chrpath + - crypto-policies-scripts - cups-devel - curl - dbus-1-devel diff --git a/bootstrap/sha1sum.txt b/bootstrap/sha1sum.txt index 733069047b7..3a6671d4fb8 100644 --- a/bootstrap/sha1sum.txt +++ b/bootstrap/sha1sum.txt @@ -1 +1 @@ -790c229c42a67336099420d137fa9dc9974a133a +cfddaa8d36c3f512827bd96fe05c30f7f8337f4b