dracut-057-6.git20220718

- Upgrade to 057

Resolves: #2066816
This commit is contained in:
Pavel Valena 2022-06-29 17:00:15 +02:00
parent 6fa68a6f90
commit 6719a03b6f
31 changed files with 399 additions and 1877 deletions

View File

@ -1,474 +1,270 @@
From 0cdd05ba6644ef6215e4cfa83e1759f7059b5d6d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Nykr=C3=BDn?= <lnykryn@redhat.com>
Date: Mon, 7 Jun 2021 14:02:29 +0200
Subject: [PATCH] Merge pull request #1 from mrc0mmand/ci-config
From b13e8ee2caaa84046e25a73e52dedb9c0f5c57a3 Mon Sep 17 00:00:00 2001
From: Pavel Valena <pvalena@redhat.com>
Date: Tue, 12 Jul 2022 14:12:04 +0200
Subject: [PATCH] ci: all layered RHEL-9 changes
CI configuration
- previous downstream changes
- use dracut.spec as submitted in the PR
- sync selected changes from upstream
- add new-main for pull-requests temporarily
rhel-only
Related: #2066816
---
.github/labeler.yml | 293 -------------------------------------------
.github/stale.yml | 21 ----
.github/workflows/labels.yml | 11 --
.github/workflows/pr.yml | 19 ---
.packit.yml | 72 +++++------
5 files changed, 31 insertions(+), 385 deletions(-)
.github/workflows/container.yml | 7 ++--
.github/workflows/differential-shellcheck.yml | 19 ++++++++++
.github/workflows/integration.yml | 47 ++++++++++++++++++++++--
.github/workflows/lint.yml | 4 +-
.packit.yml | 36 ++++++++++++++++++
test/container/Dockerfile-CentOS-9-Stream | 53 +++++++++++++++++++++++++++
6 files changed, 158 insertions(+), 8 deletions(-)
diff --git a/.github/labeler.yml b/.github/labeler.yml
deleted file mode 100644
index 73f51875..00000000
--- a/.github/labeler.yml
+++ /dev/null
@@ -1,293 +0,0 @@
-repository:
- - ./*
-
-github:
- - .github/*
- - .github/**/*
-
-dracut-install:
- - install/*
- - install/**/*
-
-example:
- - examples/*
- - examples/**/*
- - examples/**/**/*
-
-modules:
- - modules.d/*
- - modules.d/**/*
-
-bash:
- - modules.d/00bash/*
-
-bootchart:
- - modules.d/00bootchart/*
-
-dash:
- - modules.d/00dash/*
-
-mksh:
- - modules.d/00mksh/*
-
-systemd:
- - modules.d/00systemd/*
-
-warpclock:
- - modules.d/00warpclock/*
-
-fips:
- - modules.d/01fips/*
-
-systemd-initrd:
- - modules.d/01systemd-initrd/*
-
-caps:
- - modules.d/02caps/*
-
-systemd-networkd:
- - modules.d/02systemd-networkd/*
-
-modsign:
- - modules.d/03modsign/*
-
-rescue:
- - modules.d/03rescue/*
-
-watchdog:
- - modules.d/04watchdog/*
-
-busybox:
- - modules.d/05busybox/*
-
-rngd:
- - modules.d/06rngd/*
-
-i18n:
- - modules.d/10i18n/*
-
-convertfs:
- - modules.d/30convertfs/*
-
-network-legacy:
- - modules.d/35network-legacy/*
-
-network-manager:
- - modules.d/35network-manager/*
-
-network:
- - modules.d/40network/*
-
-ifcfg:
- - modules.d/45ifcfg/*
-
-url-lib:
- - modules.d/45url-lib/*
-
-drm:
- - modules.d/50drm/*
-
-gensplash:
- - modules.d/50gensplash/*
-
-plymouth:
- - modules.d/50plymouth/*
-
-cms:
- - modules.d/80cms/*
-
-lvmmerge:
- - modules.d/80lvmmerge/*
-
-cio_ignore:
- - modules.d/81cio_ignore/*
-
-btrfs:
- - modules.d/90btrfs/*
-
-crypt:
- - modules.d/90crypt/*
-
-dm:
- - modules.d/90dm/*
-
-dmraid:
- - modules.d/90dmraid/*
-
-dmsquash-live:
- - modules.d/90dmsquash-live/*
-
-dmsquash-live-ntfs:
- - modules.d/90dmsquash-live-ntfs/*
-
-kernel-modules:
- - modules.d/90kernel-modules/*
-
-kernel-modules-extra:
- - modules.d/90kernel-modules-extra/*
-
-kernel-network-modules:
- - modules.d/90kernel-network-modules/*
-
-livenet:
- - modules.d/90livenet/*
-
-lvm:
- - modules.d/90lvm/*
-
-mdraid:
- - modules.d/90mdraid/*
-
-multipath:
- - modules.d/90multipath/*
-
-nvdimm:
- - modules.d/90nvdimm/*
-
-ppcmac:
- - modules.d/90ppcmac/*
-
-qemu:
- - modules.d/90qemu/*
-
-qemu-net:
- - modules.d/90qemu-net/*
-
-stratis:
- - modules.d/90stratis/*
-
-crypt-gpg:
- - modules.d/91crypt-gpg/*
-
-crypt-loop:
- - modules.d/91crypt-loop/*
-
-zipl:
- - modules.d/91zipl/*
-
-cifs:
- - modules.d/95cifs/*
-
-dasd:
- - modules.d/95dasd/*
-
-dasd_mod:
- - modules.d/95dasd_mod/*
-
-dasd_rules:
- - modules.d/95dasd_rules/*
-
-dcssblk:
- - modules.d/95dcssblk/*
-
-debug:
- - modules.d/95debug/*
-
-fcoe:
- - modules.d/95fcoe/*
-
-fcoe-uefi:
- - modules.d/95fcoe-uefi/*
-
-fstab-sys:
- - modules.d/95fstab-sys/*
-
-iscsi:
- - modules.d/95iscsi/*
-
-lunmask:
- - modules.d/95lunmask/*
-
-nbd:
- - modules.d/95nbd/*
-
-nfs:
- - modules.d/95nfs/*
-
-nvmf:
- - modules.d/95nvmf/*
-
-qeth_rules:
- - modules.d/95qeth_rules/*
-
-resume:
- - modules.d/95resume/*
-
-rootfs-block:
- - modules.d/95rootfs-block/*
-
-ssh-client:
- - modules.d/95ssh-client/*
-
-terminfo:
- - modules.d/95terminfo/*
-
-udev-rules:
- - modules.d/95udev-rules/*
-
-virtfs:
- - modules.d/95virtfs/*
-
-zfcp:
- - modules.d/95zfcp/*
-
-zfcp_rules:
- - modules.d/95zfcp_rules/*
-
-znet:
- - modules.d/95znet/*
-
-securityfs:
- - modules.d/96securityfs/*
-
-biosdevname:
- - modules.d/97biosdevname/*
-
-masterkey:
-- modules.d/97masterkey/*
-
-dracut-systemd:
- - modules.d/98dracut-systemd/*
-
-ecryptfs:
- - modules.d/98ecryptfs/*
-
-integrity:
- - modules.d/98integrity/*
-
-pollcdrom:
- - modules.d/98pollcdrom/*
-
-selinux:
- - modules.d/98selinux/*
-
-syslog:
- - modules.d/98syslog/*
-
-usrmount:
- - modules.d/98usrmount/*
-
-base:
- - modules.d/99base/*
-
-fs-lib:
- - modules.d/99fs-lib/*
-
-img-lib:
- - modules.d/99img-lib/*
-
-memstrack:
- - modules.d/99memstrack/*
-
-shutdown:
- - modules.d/99shutdown/*
-
-squash:
- - modules.d/99squash/*
-
-uefi-lib:
- - modules.d/99uefi-lib/*
-
-test:
- - test/*
- - test/**/*
diff --git a/.github/stale.yml b/.github/stale.yml
deleted file mode 100644
index 1e873606..00000000
--- a/.github/stale.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-# Number of days of inactivity before an issue becomes stale
-daysUntilStale: 30
-# Number of days of inactivity before a stale issue is closed
-daysUntilClose: 7
-# Issues with these labels will never be considered stale
-exemptLabels:
- - documents
- - enhancement
- - regression
- - wiki
- - bug
-# Label to use when marking an issue as stale
-staleLabel: stale
-# Comment to post when marking an issue as stale. Set to `false` to disable
-markComment: >
- This issue is being marked as stale because it has not had any recent activity.
- It will be closed if no further activity occurs.
- If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days.
- Thank you for your contributions.
-# Comment to post when closing a stale issue. Set to `false` to disable
-closeComment: false
diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml
deleted file mode 100644
index 9fa7a929..00000000
--- a/.github/workflows/labels.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-name: "Pull Request Labeler"
-
-on: pull_request_target
-
-jobs:
- triage:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/labeler@main
- with:
- repo-token: "${{ secrets.GITHUB_TOKEN }}"
diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
deleted file mode 100644
index ee46168e..00000000
--- a/.github/workflows/pr.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-name: Commisery
-on:
- pull_request:
- types: [edited, opened, synchronize, reopened]
-
-jobs:
- commit-message:
- name: Conventional Commit Message Checker (Commisery)
- runs-on: ubuntu-latest
- steps:
- - name: Check-out the repo under $GITHUB_WORKSPACE
- uses: actions/checkout@v2
-
- - name: Run Commisery
- uses: dracutdevs/commisery-action@master
- with:
- token: ${{ secrets.GITHUB_TOKEN }}
- pull_request: ${{ github.event.number }}
-
diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml
index 03c9c5ec..99d57f5b 100644
--- a/.github/workflows/container.yml
+++ b/.github/workflows/container.yml
@@ -3,12 +3,12 @@ on:
schedule:
- cron: '30 11 * * *' # every day at 4:40
push:
- branches: [ master ]
+ branches: [ main ]
paths:
- 'test/container/**'
- '.github/workflows/container.yml'
pull_request:
- branches: [ master ]
+ branches: [ main new-main ]
paths:
- 'test/container/**'
- '.github/workflows/container.yml'
@@ -31,6 +31,7 @@ jobs:
- { dockerfile: 'Dockerfile-Fedora-latest', tag: 'fedora:latest' }
- { dockerfile: 'Dockerfile-OpenSuse-latest', tag: 'opensuse:latest' }
- { dockerfile: 'Dockerfile-Arch', tag: 'arch:latest' }
+ - { dockerfile: 'Dockerfile-CentOS-9-Stream', tag: 'centos:stream9' }
- { dockerfile: 'Dockerfile-Debian', tag: 'debian:latest' }
steps:
- name: Check out the repo
@@ -49,5 +50,5 @@ jobs:
uses: docker/build-push-action@v2
with:
file: test/container/${{ matrix.config.dockerfile }}
- tags: ghcr.io/dracutdevs/${{ matrix.config.tag }}
+ tags: ghcr.io/${{ github.repository_owner }}/${{ matrix.config.tag }}
push: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
diff --git a/.github/workflows/differential-shellcheck.yml b/.github/workflows/differential-shellcheck.yml
new file mode 100644
index 00000000..c4b05fad
--- /dev/null
+++ b/.github/workflows/differential-shellcheck.yml
@@ -0,0 +1,19 @@
+name: Differential ShellCheck
+on:
+ pull_request:
+ branches: [ main new-main ]
+
+jobs:
+ test:
+ runs-on: ubuntu-20.04
+
+ steps:
+ - name: Repository checkout
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+
+ - name: Differential ShellCheck
+ uses: redhat-plumbers-in-action/differential-shellcheck@v2
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml
index 3d78555f..aa354e3e 100644
--- a/.github/workflows/integration.yml
+++ b/.github/workflows/integration.yml
@@ -2,7 +2,7 @@ name: Integration Test
on:
pull_request:
- branches: [ master ]
+ branches: [ main new-main ]
jobs:
basic:
@@ -24,7 +24,7 @@ jobs:
]
fail-fast: false
container:
- image: ghcr.io/dracutdevs/${{ matrix.container }}
+ image: ghcr.io/${{ github.repository_owner }}/${{ matrix.container }}
options: "--privileged -v /dev:/dev"
steps:
- name: "Checkout Repository"
@@ -69,7 +69,48 @@ jobs:
]
fail-fast: false
container:
- image: ghcr.io/dracutdevs/${{ matrix.container }}
+ image: ghcr.io/${{ github.repository_owner }}/${{ matrix.container }}
+ options: "--privileged -v /dev:/dev"
+ steps:
+ - name: "Checkout Repository"
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+
+ - name: "${{ matrix.container }} TEST-${{ matrix.test }}"
+ run: ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}
+ centos-9-stream:
+ runs-on: ubuntu-latest
+ timeout-minutes: 45
+ concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.container }}-${{ matrix.test }}
+ cancel-in-progress: true
+ strategy:
+ matrix:
+ container: [
+ "centos:stream9",
+ ]
+ # Disabled tests (due to dropped packages in RHEL/CentOS):
+ # 03, 04, 15: requires btrfs
+ # 14: requires dmraid
+ # 30, 31, 35, 36: requires scsi-target-utils
+ test: [
+ "01",
+ "02",
+ "10",
+ "11",
+ "12",
+ "13",
+ "17",
+ "20",
+ "21",
+ "40",
+ "41",
+ "98",
+ ]
+ fail-fast: false
+ container:
+ image: ghcr.io/${{ github.repository_owner }}/${{ matrix.container }}
options: "--privileged -v /dev:/dev"
steps:
- name: "Checkout Repository"
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 7b1b8ee7..5e3a299f 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -2,9 +2,9 @@ name: Lint
on:
push:
- branches: [ master ]
+ branches: [ main ]
pull_request:
- branches: [ master ]
+ branches: [ main new-main ]
jobs:
lint-c:
diff --git a/.packit.yml b/.packit.yml
index 482b4c4d..acc1f968 100644
--- a/.packit.yml
new file mode 100644
index 00000000..86ba83d2
--- /dev/null
+++ b/.packit.yml
@@ -1,55 +1,45 @@
@@ -0,0 +1,36 @@
+---
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later
+# This file is part of dracut.
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# vi:ts=2 sw=2 et:
+#
+# Docs: https://packit.dev/docs/
-# The name of the upstream package
+specfile_path: .packit_rpm/dracut.spec
+
+specfile_path: pkgbuild/dracut.spec
+synced_files:
+ - .packit.yaml
+ - src: .packit_rpm/dracut.spec
+ dest: dracut.spec
upstream_package_name: dracut
-
-# The upstream tag versioning scheme
-upstream_tag_template: "{version}"
-
-# The URL of the upstream project
-upstream_project_url: https://github.com/dracutdevs/dracut
-
-# Relative path to a spec file within the upstream repository
-specfile_path: pkgbuild/dracut.spec
-
-# Name of the downstream package
downstream_package_name: dracut
+upstream_package_name: dracut
+downstream_package_name: dracut
+upstream_tag_template: "{version}"
-# The URL of the downstream project
-dist_git_base_url: https://src.fedoraproject.org/
-
-# Sync file(s) from upstream repo to dist-git
-synced_files:
- # The dracut spec file is maintained upstream so we sync it downstream.
- - dracut.spec
- # We sync the packit file downstream be able to optionally use the sync-from-downstream command
- - .packit.yaml
+
+actions:
+ post-upstream-clone:
+ # Use the CentOS Stream specfile
+ - "git clone https://gitlab.com/redhat/centos-stream/rpms/dracut .packit_rpm --depth=1"
+ # Drop the "sources" file so rebase-helper doesn't think we're a dist-git$
+ - "rm -fv .packit_rpm/sources"
-# We want new releases to be automatically built on rawhide and have few jobs
-# on copr.
-create_pr: false
+ # Use the current specfile
+ - "cp pkgbuild/dracut.spec ."
+
+# Available targets can be listed via `copr-cli list-chroots`
jobs:
-- job: propose_downstream
- trigger: release
- metadata:
- dist_git_branches: main
-
-- job: tests
- trigger: pull_request
- metadata:
- targets:
- - fedora-rawhide
-
+jobs:
+# Build test
- job: copr_build
trigger: pull_request
metadata:
targets:
- - fedora-development
-
-- job: copr_build
- trigger: commit
+ - epel-8-x86_64
+ - epel-8-aarch64
+ # FIXME: change to CentOS 9 once it's available
+ - fedora-34-x86_64
+ - fedora-34-aarch64
+ - fedora-34-s390x
+- job: copr_build
+ trigger: pull_request
+ metadata:
+ targets:
+ - centos-stream-9-x86_64
+ - centos-stream-9-aarch64
+
+# Run tests (via testing farm)
+- job: tests
+ trigger: pull_request
metadata:
targets:
- - fedora-all
- - fedora-development
+ # FIXME: change to CentOS 9 once it's available
+ - fedora-34-x86_64
+ metadata:
+ targets:
+ - centos-stream-9-x86_64
diff --git a/test/container/Dockerfile-CentOS-9-Stream b/test/container/Dockerfile-CentOS-9-Stream
new file mode 100644
index 00000000..c9a96020
--- /dev/null
+++ b/test/container/Dockerfile-CentOS-9-Stream
@@ -0,0 +1,53 @@
+FROM quay.io/centos/centos:stream9
+
+MAINTAINER https://github.com/dracutdevs/dracut
+
+ENV container docker
+LABEL RUN="docker run -it --name NAME --privileged --ipc=host --net=host --pid=host -e NAME=NAME -e IMAGE=IMAGE IMAGE"
+
+RUN echo 'export DRACUT_NO_XATTR=1 KVERSION=$(cd /lib/modules; ls -1 | tail -1)' > /etc/profile.d/dracut-test.sh
+
+# Install needed packages for the dracut CI container
+# FIXME: properly re-add dash once C9S EPEL is available
+RUN dnf -y install --enablerepo crb --setopt=install_weak_deps=False \
+ http://mirrors.kernel.org/fedora/releases/34/Everything/x86_64/os/Packages/d/dash-0.5.10.2-8.fc34.x86_64.rpm \
+ qemu-kvm \
+ NetworkManager \
+ asciidoc \
+ bash-completion \
+ bzip2 \
+ cryptsetup \
+ dbus-daemon \
+ dhcp-client \
+ dhcp-server \
+ e2fsprogs \
+ gcc \
+ git \
+ iproute \
+ iputils \
+ iscsi-initiator-utils \
+ kbd \
+ kernel \
+ kmod-devel \
+ lvm2 \
+ make \
+ mdadm \
+ nfs-utils \
+ pigz \
+ rpm-build \
+ strace \
+ sudo \
+ tar \
+ tcpdump \
+ wget \
+ which \
+ xz \
+ && dnf -y update && dnf clean all
+
+# C9S ships only qemu-kvm, but it disables the KVM accel when it's not
+# available
+RUN ln -sv /usr/libexec/qemu-kvm /usr/bin/qemu-kvm && \
+ ln -sv /usr/libexec/qemu-kvm /usr/bin/qemu-system-$(uname -m)
+
+# Set default command
+CMD ["/usr/bin/bash"]

View File

@ -1,87 +1,55 @@
From 976f5e053537e424edcdcb2325230d370454efd5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Nykr=C3=BDn?= <lnykryn@redhat.com>
Date: Mon, 7 Jun 2021 19:40:22 +0200
Subject: [PATCH] Merge pull request #3 from
redhat-plumbers/reconfigure-gh-actions
From a6c4171117924cacaa727a9828e72f70e09b1fa9 Mon Sep 17 00:00:00 2001
From: Pavel Valena <pvalena@redhat.com>
Date: Tue, 12 Jul 2022 14:15:25 +0200
Subject: [PATCH] fix(fips): enhance commit 'handle s390x OSTree systems'
ci: drop the hardcoded repo owner name
78557f05a69fe718a97df85d2ed741ce10d3f806
Refactored to enhance readability.
Related: rhbz#2050567
---
.github/workflows/container.yml | 6 +++---
.github/workflows/integration.yml | 6 +++---
.github/workflows/lint.yml | 4 ++--
3 files changed, 8 insertions(+), 8 deletions(-)
modules.d/01fips/fips.sh | 15 +++++++++++----
modules.d/01fips/module-setup.sh | 2 +-
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml
index 0706bf48..32bb7f16 100644
--- a/.github/workflows/container.yml
+++ b/.github/workflows/container.yml
@@ -3,12 +3,12 @@ on:
schedule:
- cron: '30 11 * * *' # every day at 4:40
push:
- branches: [ master ]
+ branches: [ main ]
paths:
- 'test/container/**'
- '.github/workflows/container.yml'
pull_request:
- branches: [ master ]
+ branches: [ main ]
paths:
- 'test/container/**'
- '.github/workflows/container.yml'
@@ -50,5 +50,5 @@ jobs:
uses: docker/build-push-action@v2
with:
file: test/container/${{ matrix.config.dockerfile }}
- tags: ghcr.io/dracutdevs/${{ matrix.config.tag }}
+ tags: ghcr.io/${{ github.repository_owner }}/${{ matrix.config.tag }}
push: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml
index 89310d44..18582364 100644
--- a/.github/workflows/integration.yml
+++ b/.github/workflows/integration.yml
@@ -2,7 +2,7 @@ name: Integration Test
diff --git a/modules.d/01fips/fips.sh b/modules.d/01fips/fips.sh
index 26f65414..6ad61df8 100755
--- a/modules.d/01fips/fips.sh
+++ b/modules.d/01fips/fips.sh
@@ -132,10 +132,17 @@ do_fips() {
if [ -e "/boot/vmlinuz-${KERNEL}" ]; then
BOOT_IMAGE="vmlinuz-${KERNEL}"
elif [ -d /boot/loader/entries ]; then
- bls=$(find /boot/loader/entries -name '*.conf' | sort -rV | sed -n "$((BOOT_IMAGE + 1))p")
- if [ -e "${bls}" ]; then
- BOOT_IMAGE=$(grep ^linux "${bls}" | cut -d' ' -f2)
- fi
+ i=0
+ # shellcheck disable=SC2012
+ for bls in $(ls -d /boot/loader/entries/*.conf | sort -rV); do
+ if [ "$i" -eq "${BOOT_IMAGE:-0}" ] && [ -r "$bls" ]; then
+ BOOT_IMAGE="$(grep -e '^linux' "$bls" | grep -o ' .*$')"
+ BOOT_IMAGE=${BOOT_IMAGE## }
+ break
+ fi
+
+ i=$((i + 1))
+ done
fi
fi
on:
pull_request:
- branches: [ master ]
+ branches: [ main ]
diff --git a/modules.d/01fips/module-setup.sh b/modules.d/01fips/module-setup.sh
index 8860159d..cc9d15ce 100755
--- a/modules.d/01fips/module-setup.sh
+++ b/modules.d/01fips/module-setup.sh
@@ -67,7 +67,7 @@ install() {
inst_hook pre-udev 01 "$moddir/fips-load-crypto.sh"
inst_script "$moddir/fips.sh" /sbin/fips.sh
jobs:
basic:
@@ -24,7 +24,7 @@ jobs:
]
fail-fast: false
container:
- image: ghcr.io/dracutdevs/${{ matrix.container }}
+ image: ghcr.io/${{ github.repository_owner }}/${{ matrix.container }}
options: "--privileged -v /dev:/dev"
steps:
- name: "Checkout Repository"
@@ -69,7 +69,7 @@ jobs:
]
fail-fast: false
container:
- image: ghcr.io/dracutdevs/${{ matrix.container }}
+ image: ghcr.io/${{ github.repository_owner }}/${{ matrix.container }}
options: "--privileged -v /dev:/dev"
steps:
- name: "Checkout Repository"
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 7b1b8ee7..f6778a65 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -2,9 +2,9 @@ name: Lint
- inst_multiple sha512hmac rmmod insmod mount uname umount grep sed cut find sort
+ inst_multiple sha512hmac rmmod insmod mount uname umount grep sed sort
on:
push:
- branches: [ master ]
+ branches: [ main ]
pull_request:
- branches: [ master ]
+ branches: [ main ]
jobs:
lint-c:
inst_simple /etc/system-fips
[ -c "${initdir}"/dev/random ] || mknod "${initdir}"/dev/random c 1 8 \

View File

@ -1,143 +1,41 @@
From 5384368467e20c3243223ed46b997954c0d9eea0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Nykr=C3=BDn?= <lnykryn@redhat.com>
Date: Wed, 9 Jun 2021 14:12:25 +0200
Subject: [PATCH] Merge pull request #6 from redhat-plumbers/centos-stream-job
From ec58df436c7ecaa04a9a4a8f72615c59739f890d Mon Sep 17 00:00:00 2001
From: Pavel Valena <pvalena@redhat.com>
Date: Wed, 16 Feb 2022 02:42:11 +0100
Subject: [PATCH] build(spec): do not use recommends for base packages
ci: add a CentOS 8 Stream job
rhel-only
Resolves: rhbz#1947892
---
.github/workflows/container.yml | 1 +
.github/workflows/integration.yml | 41 ++++++++++++++++++++
test/container/Dockerfile-CentOS-8-Stream | 63 +++++++++++++++++++++++++++++++
3 files changed, 105 insertions(+)
pkgbuild/dracut.spec | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml
index 32bb7f16..a8b3f9b8 100644
--- a/.github/workflows/container.yml
+++ b/.github/workflows/container.yml
@@ -33,6 +33,7 @@ jobs:
- { dockerfile: 'Dockerfile-Fedora-rawhide', tag: 'fedora:rawhide' }
- { dockerfile: 'Dockerfile-OpenSuse-latest', tag: 'opensuse:latest' }
- { dockerfile: 'Dockerfile-Arch', tag: 'arch:latest' }
+ - { dockerfile: 'Dockerfile-CentOS-8-Stream', tag: 'centos:stream8' }
steps:
- name: Check out the repo
uses: actions/checkout@v2
diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml
index 18582364..9ea718f1 100644
--- a/.github/workflows/integration.yml
+++ b/.github/workflows/integration.yml
@@ -79,3 +79,44 @@ jobs:
diff --git a/pkgbuild/dracut.spec b/pkgbuild/dracut.spec
index 71b7421c..38de47b4 100644
--- a/pkgbuild/dracut.spec
+++ b/pkgbuild/dracut.spec
@@ -71,20 +71,17 @@ Requires: kmod
Requires: sed
Requires: xz
Requires: gzip
+Requires: hardlink
+Requires: pigz
+Requires: kpartx
- name: "${{ matrix.container }} TEST-${{ matrix.test }}"
run: ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}
+ centos-8-stream:
+ runs-on: ubuntu-latest
+ timeout-minutes: 45
+ concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.container }}-${{ matrix.test }}
+ cancel-in-progress: true
+ strategy:
+ matrix:
+ container: [
+ "centos:stream8",
+ ]
+ # Disabled tests (due to dropped packages in RHEL/CentOS):
+ # 03, 04, 15: requires btrfs
+ # 14: requires dmraid
+ # 30, 31, 35, 36: requires scsi-target-utils
+ test: [
+ "01",
+ "02",
+ "10",
+ "11",
+ "12",
+ "13",
+ "17",
+ "20",
+ "21",
+ "40",
+ "41",
+ "98",
+ ]
+ fail-fast: false
+ container:
+ image: ghcr.io/${{ github.repository_owner }}/${{ matrix.container }}
+ options: "--privileged -v /dev:/dev"
+ steps:
+ - name: "Checkout Repository"
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+
+ - name: "${{ matrix.container }} TEST-${{ matrix.test }}"
+ run: ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}
diff --git a/test/container/Dockerfile-CentOS-8-Stream b/test/container/Dockerfile-CentOS-8-Stream
new file mode 100644
index 00000000..b14cc64a
--- /dev/null
+++ b/test/container/Dockerfile-CentOS-8-Stream
@@ -0,0 +1,63 @@
+FROM quay.io/centos/centos:stream8
+
+MAINTAINER https://github.com/dracutdevs/dracut
+
+ENV container docker
+LABEL RUN="docker run -it --name NAME --privileged --ipc=host --net=host --pid=host -e NAME=NAME -e IMAGE=IMAGE IMAGE"
+
+RUN echo 'export DRACUT_NO_XATTR=1 KVERSION=$(cd /lib/modules; ls -1 | tail -1)' > /etc/profile.d/dracut-test.sh
+
+# FIXME: the mirrors were desynchronized at the time of writing, leading to several
+# conflicts when installing dependencies below
+RUN sed -i -e 's/^mirrorlist=/#mirrorlist=/g' -e 's/^#baseurl=/baseurl=/g' /etc/yum.repos.d/*.repo
+
+# Install needed packages for the dracut CI container
+RUN dnf -y install epel-release && \
+ `# FIXME: this is required to work around a bug in e2fsprogs, remove when CentOS 8.5 is out` && \
+ dnf -y install dnf-plugins-core && \
+ dnf -y copr enable mrc0mmand/systemd-centos-ci-centos8 && \
+ dnf -y install e2fsprogs && \
+ `# End of FIXME` && \
+ dnf -y install --enablerepo powertools --enablerepo epel --setopt=install_weak_deps=False \
+ qemu-kvm \
+ NetworkManager \
+ asciidoc \
+ bash-completion \
+ bzip2 \
+ cryptsetup \
+ dash \
+ dbus-daemon \
+ dhcp-client \
+ dhcp-server \
+ e2fsprogs \
+ gcc \
+ git \
+ iproute \
+ iputils \
+ iscsi-initiator-utils \
+ kbd \
+ kernel \
+ kmod-devel \
+ lvm2 \
+ make \
+ mdadm \
+ nfs-utils \
+ pigz \
+ python3-imgcreate \
+ rpm-build \
+ strace \
+ sudo \
+ tar \
+ tcpdump \
+ wget \
+ which \
+ xz \
+ && dnf -y update && dnf clean all
+
+# CentOS 8 ships only qemu-kvm, but it disables the KVM accel when it's not
+# available
+RUN ln -sv /usr/libexec/qemu-kvm /usr/bin/qemu-kvm && \
+ ln -sv /usr/libexec/qemu-kvm /usr/bin/qemu-system-$(uname -m)
+
+# Set default command
+CMD ["/usr/bin/bash"]
%if 0%{?fedora} || 0%{?rhel}
-Recommends: memstrack
-Recommends: hardlink
-Recommends: pigz
-Recommends: kpartx
+Suggests: memstrack
Requires: util-linux >= 2.21
Requires: systemd >= 219
Requires: systemd-udev >= 219
Requires: procps-ng
%else
-Requires: hardlink
-Requires: gzip
-Requires: kpartx
Requires: udev > 166
Requires: util-linux-ng >= 2.21
%endif

View File

@ -1,71 +1,35 @@
From 456c3badc622cb8c4b6ec59bc37436f3d50f7ed5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Nykr=C3=BDn?= <lnykryn@redhat.com>
Date: Fri, 9 Jul 2021 12:32:00 +0200
Subject: [PATCH] Merge pull request #7 from lnykryn/bz1977347
From 3a0a1774798178f709fc4aa54b6fc3c78e30add7 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Mon, 19 Jul 2021 11:27:28 +0200
Subject: [PATCH] fix(95nfs): set correct ownership and permissions for statd
directory
Bz1977347
The directory ownership for the statd directory should be
rpcuser:rpcuser.
Resolves: #2017846
---
dracut.sh | 7 +++++--
modules.d/99squash/module-setup.sh | 8 ++++----
2 files changed, 9 insertions(+), 6 deletions(-)
modules.d/95nfs/module-setup.sh | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index 60ac46f4..78917763 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -2067,9 +2067,11 @@ for ((i = 0; i < ${#include_src[@]}; i++)); do
# check for preexisting symlinks, so we can cope with the
# symlinks to $prefix
# Objectname is a file or a directory
+ reset_dotglob="$(shopt -p dotglob)"
+ shopt -q -s dotglob
for objectname in "$src"/*; do
[[ -e $objectname || -L $objectname ]] || continue
- if [[ -d $objectname ]]; then
+ if [[ -d $objectname ]] && [[ ! -L $objectname ]]; then
# objectname is a directory, let's compute the final directory name
object_destdir=${destdir}/${objectname#$src/}
if ! [[ -e $object_destdir ]]; then
@@ -2077,11 +2079,12 @@ for ((i = 0; i < ${#include_src[@]}; i++)); do
mkdir -m 0755 -p "$object_destdir"
chmod --reference="$objectname" "$object_destdir"
fi
- $DRACUT_CP -t "$object_destdir" "$dracutsysrootdir$objectname"/*
+ $DRACUT_CP -t "$object_destdir" "$dracutsysrootdir$objectname"/.
else
$DRACUT_CP -t "$destdir" "$dracutsysrootdir$objectname"
fi
done
+ eval "$reset_dotglob"
elif [[ -e $src ]]; then
derror "$src is neither a directory nor a regular file"
else
diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh
index e3196213..a2525cff 100644
--- a/modules.d/99squash/module-setup.sh
+++ b/modules.d/99squash/module-setup.sh
@@ -42,19 +42,19 @@ installpost() {
# Install required modules and binaries for the squash image init script.
if [[ $_busybox ]]; then
inst "$_busybox" /usr/bin/busybox
- for _i in sh echo mount modprobe mkdir switch_root grep; do
+ for _i in sh echo mount modprobe mkdir switch_root grep umount; do
ln_r /usr/bin/busybox /usr/bin/$_i
done
else
- DRACUT_RESOLVE_DEPS=1 inst_multiple sh mount modprobe mkdir switch_root grep
+ DRACUT_RESOLVE_DEPS=1 inst_multiple sh mount modprobe mkdir switch_root grep umount
fi
hostonly="" instmods "loop" "squashfs" "overlay"
dracut_kernel_post
# Install squash image init script.
- ln -sfn /usr/bin "$initdir/bin"
- ln -sfn /usr/sbin "$initdir/sbin"
+ ln_r /usr/bin /bin
+ ln_r /usr/sbin /sbin
inst_simple "$moddir"/init-squash.sh /init
}
diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh
index 16bafe30..5351c2d5 100755
--- a/modules.d/95nfs/module-setup.sh
+++ b/modules.d/95nfs/module-setup.sh
@@ -120,8 +120,13 @@ install() {
mkdir -m 0755 -p "$initdir/var/lib/nfs"
mkdir -m 0755 -p "$initdir/var/lib/nfs/rpc_pipefs"
mkdir -m 0770 -p "$initdir/var/lib/rpcbind"
- [ -d "/var/lib/nfs/statd/sm" ] && mkdir -m 0755 -p "$initdir/var/lib/nfs/statd/sm"
- [ -d "/var/lib/nfs/sm" ] && mkdir -m 0755 -p "$initdir/var/lib/nfs/sm"
+ [ -d "$dracutsysrootdir/var/lib/nfs/statd/sm" ] \
+ && mkdir -m 0700 -p "$initdir/var/lib/nfs/statd" \
+ && mkdir -m 0755 -p "$initdir/var/lib/nfs/statd/sm" \
+ && chown -R rpcuser:rpcuser "$initdir/var/lib/nfs/statd"
+ [ -d "$dracutsysrootdir/var/lib/nfs/sm" ] \
+ && mkdir -m 0755 -p "$initdir/var/lib/nfs/sm" \
+ && chown -R rpcuser:rpcuser "$initdir/var/lib/nfs/sm"
# Rather than copy the passwd file in, just set a user for rpcbind
# We'll save the state and restart the daemon from the root anyway

View File

@ -1,25 +1,27 @@
From 1b02912a8ed0767dc7881c45d55856f825e52b3c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Nykr=C3=BDn?= <lnykryn@redhat.com>
Date: Fri, 9 Jul 2021 12:32:10 +0200
Subject: [PATCH] Merge pull request #8 from lnykryn/bz1970712
From 21b7898d5c3a074203d6cb8a71962010874f87bb Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Tue, 15 Feb 2022 13:47:40 +0100
Subject: [PATCH] fix(95resume): only exclude this module, when swap is netdev
fix(network-manager): don't pull in systemd-udev-settle
Resolves: #2017787
---
modules.d/35network-manager/nm-initrd.service | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules.d/35network-manager/nm-initrd.service b/modules.d/35network-manager/nm-initrd.service
index 815797a4..e076f50b 100644
--- a/modules.d/35network-manager/nm-initrd.service
+++ b/modules.d/35network-manager/nm-initrd.service
@@ -1,7 +1,7 @@
[Unit]
DefaultDependencies=no
-Wants=systemd-udev-settle.service
-After=systemd-udev-settle.service
+Wants=systemd-udev-trigger.service
+After=systemd-udev-trigger.service
After=dracut-cmdline.service
Before=network.target
ConditionPathExists=/run/NetworkManager/initrd/neednet
modules.d/95resume/module-setup.sh | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh
index 5e891048..4b8d8422 100755
--- a/modules.d/95resume/module-setup.sh
+++ b/modules.d/95resume/module-setup.sh
@@ -10,10 +10,9 @@ check() {
return 1
}
- # Only support resume if hibernation is currently on
- # and no swap is mounted on a net device
+ # Only support resume if no swap is mounted on a net device
[[ $hostonly ]] || [[ $mount_needs ]] && {
- swap_on_netdevice || [[ -f /sys/power/resume && "$(cat /sys/power/resume)" == "0:0" ]] && return 255
+ swap_on_netdevice && return 255
}
return 0

View File

@ -1,29 +0,0 @@
From 7d3226fe3462685a4a0ad6b8cbe704c9d08f4e77 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Thu, 12 Aug 2021 11:46:35 +0200
Subject: [PATCH] fix(kernel-modules): add blk_mq_alloc_disk and
blk_cleanup_disk to blockfuncs
Since kernel 5-14 those are used by many drivers for example:
xen-blkfront, loop, nbd, pd
Cherry-picked from: rhel-only
Resolves: #1986909
---
modules.d/90kernel-modules/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh
index 499fc066..36f8ca3c 100755
--- a/modules.d/90kernel-modules/module-setup.sh
+++ b/modules.d/90kernel-modules/module-setup.sh
@@ -2,7 +2,7 @@
# called by dracut
installkernel() {
- local _blockfuncs='ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_add_host|scsi_add_host_with_dma'
+ local _blockfuncs='ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_add_host|scsi_add_host_with_dma|blk_mq_alloc_disk|blk_cleanup_disk'
local -A _hostonly_drvs
find_kernel_modules_external() {

View File

@ -1,45 +0,0 @@
From 5f8012de4cb73b90d69075e8118d904302d41c20 Mon Sep 17 00:00:00 2001
From: Beniamino Galvani <bgalvani@redhat.com>
Date: Mon, 9 Aug 2021 09:28:46 +0200
Subject: [PATCH] fix(network-manager): check for nm-initrd-generator in both
/usr/{libexec,lib}
Sice commit 22d6863ef1b2 ("fix(network-manager): cope with distributions not
using `libexec`") nm-initrd-generator can be installed in either /usr/libexec
or /usr/lib. Change other modules to check for the binary in both locations.
(cherry picked from commit 5ee7e249b8cc74461122ccd7efe954b3402c23da)
Resolves: #1975929
---
modules.d/40network/module-setup.sh | 2 +-
modules.d/80cms/cmsifup.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh
index 60824da6..9fd5d806 100755
--- a/modules.d/40network/module-setup.sh
+++ b/modules.d/40network/module-setup.sh
@@ -19,7 +19,7 @@ depends() {
if [ -z "$network_handler" ]; then
if [[ -x $dracutsysrootdir$systemdsystemunitdir/wicked.service ]]; then
network_handler="network-wicked"
- elif [[ -x $dracutsysrootdir/usr/libexec/nm-initrd-generator ]]; then
+ elif [[ -x $dracutsysrootdir/usr/libexec/nm-initrd-generator ]] || [[ -x $dracutsysrootdir/usr/lib/nm-initrd-generator ]]; then
network_handler="network-manager"
elif [[ -x $dracutsysrootdir$systemdutildir/systemd-networkd ]]; then
network_handler="systemd-networkd"
diff --git a/modules.d/80cms/cmsifup.sh b/modules.d/80cms/cmsifup.sh
index a319227a..73d76fbf 100755
--- a/modules.d/80cms/cmsifup.sh
+++ b/modules.d/80cms/cmsifup.sh
@@ -34,7 +34,7 @@ fi
IFACES="$IFACES $DEVICE"
echo "$IFACES" >> /tmp/net.ifaces
-if [ -x /usr/libexec/nm-initrd-generator ]; then
+if [ -x /usr/libexec/nm-initrd-generator ] || [ -x /usr/lib/nm-initrd-generator ]; then
type nm_generate_connections > /dev/null 2>&1 || . /lib/nm-lib.sh
nm_generate_connections
else

View File

@ -1,43 +0,0 @@
From aa561847a82c2446ead5e41742f453629f112b63 Mon Sep 17 00:00:00 2001
From: Beniamino Galvani <bgalvani@redhat.com>
Date: Wed, 4 Aug 2021 09:37:31 +0200
Subject: [PATCH] fix(cms): reload NetworkManager connections
When NetworkManager is running as systemd service, it's not enough to write
connection files; the module should also tell NetworkManager to reload the
connections from disk so that any new connection can be auto-activated.
https://bugzilla.redhat.com/show_bug.cgi?id=1975929
(cherry picked from commit 07977ee5c5294a5d30c1f33f292a0b31303750fb)
Resolves: #1975929
---
modules.d/35network-manager/nm-lib.sh | 4 ++++
modules.d/80cms/cmsifup.sh | 1 +
2 files changed, 5 insertions(+)
diff --git a/modules.d/35network-manager/nm-lib.sh b/modules.d/35network-manager/nm-lib.sh
index 2d27e079..1f749587 100644
--- a/modules.d/35network-manager/nm-lib.sh
+++ b/modules.d/35network-manager/nm-lib.sh
@@ -28,3 +28,7 @@ nm_generate_connections() {
done
fi
}
+
+nm_reload_connections() {
+ [ -n "$DRACUT_SYSTEMD" ] && systemctl is-active nm-initrd.service && nmcli connection reload
+}
diff --git a/modules.d/80cms/cmsifup.sh b/modules.d/80cms/cmsifup.sh
index 73d76fbf..285e20d1 100755
--- a/modules.d/80cms/cmsifup.sh
+++ b/modules.d/80cms/cmsifup.sh
@@ -37,6 +37,7 @@ echo "$IFACES" >> /tmp/net.ifaces
if [ -x /usr/libexec/nm-initrd-generator ] || [ -x /usr/lib/nm-initrd-generator ]; then
type nm_generate_connections > /dev/null 2>&1 || . /lib/nm-lib.sh
nm_generate_connections
+ nm_reload_connections
else
exec ifup "$DEVICE"
fi

View File

@ -1,42 +0,0 @@
From 058ffa90669a4dbd2af16e025f22312408ed4ba9 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Tue, 24 Aug 2021 15:39:25 +0200
Subject: [PATCH] 95resume: always install this module
We can't always correctly decide if the resume module is needed.
So let's play safe and always include it.
see: https://github.com/dracutdevs/dracut/issues/924
RHEL-only
Resolves: #1926544
---
modules.d/95resume/module-setup.sh | 14 --------------
1 file changed, 14 deletions(-)
diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh
index f0507b13..4f68e947 100755
--- a/modules.d/95resume/module-setup.sh
+++ b/modules.d/95resume/module-setup.sh
@@ -2,20 +2,6 @@
# called by dracut
check() {
- swap_on_netdevice() {
- local _dev
- for _dev in "${swap_devs[@]}"; do
- block_is_netdevice "$_dev" && return 0
- done
- return 1
- }
-
- # Only support resume if hibernation is currently on
- # and no swap is mounted on a net device
- [[ $hostonly ]] || [[ $mount_needs ]] && {
- swap_on_netdevice || [[ "$(cat /sys/power/resume)" == "0:0" ]] && return 255
- }
-
return 0
}

View File

@ -1,35 +0,0 @@
From 324e6ba13d8abef22c636e64ad0cbd8018704c93 Mon Sep 17 00:00:00 2001
From: Frantisek Sumsal <frantisek@sumsal.cz>
Date: Tue, 9 Nov 2021 12:39:19 +0100
Subject: [PATCH] ci: use C9S chroots for Packit/TFT
---
.packit.yml | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/.packit.yml b/.packit.yml
index acc1f968..1b1809ab 100644
--- a/.packit.yml
+++ b/.packit.yml
@@ -29,17 +29,12 @@ jobs:
trigger: pull_request
metadata:
targets:
- - epel-8-x86_64
- - epel-8-aarch64
- # FIXME: change to CentOS 9 once it's available
- - fedora-34-x86_64
- - fedora-34-aarch64
- - fedora-34-s390x
+ - centos-stream-9-x86_64
+ - centos-stream-9-aarch64
# Run tests (via testing farm)
- job: tests
trigger: pull_request
metadata:
targets:
- # FIXME: change to CentOS 9 once it's available
- - fedora-34-x86_64
+ - centos-stream-9-x86_64

View File

@ -1,23 +0,0 @@
From 816891a11e3a3b4a792b68257eff4af7df411064 Mon Sep 17 00:00:00 2001
From: Frantisek Sumsal <frantisek@sumsal.cz>
Date: Tue, 9 Nov 2021 12:45:47 +0100
Subject: [PATCH] ci: drop patches from the C9S spec before using it
---
.packit.yml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.packit.yml b/.packit.yml
index 1b1809ab..dd3a1fa6 100644
--- a/.packit.yml
+++ b/.packit.yml
@@ -21,6 +21,8 @@ actions:
- "git clone https://gitlab.com/redhat/centos-stream/rpms/dracut .packit_rpm --depth=1"
# Drop the "sources" file so rebase-helper doesn't think we're a dist-git$
- "rm -fv .packit_rpm/sources"
+ # Drop all patches (since they're already applied in this repository)
+ - "sed -ri '/^Patch[0-9]+:/d' .packit_rpm/dracut.spec"
# Available targets can be listed via `copr-cli list-chroots`
jobs:

View File

@ -1,88 +0,0 @@
From d19ca83f909ed695f199aa688406f62e3eecadcd Mon Sep 17 00:00:00 2001
From: Frantisek Sumsal <frantisek@sumsal.cz>
Date: Tue, 9 Nov 2021 16:01:51 +0100
Subject: [PATCH] ci: bump C8 jobs to C9S
rhel-only
---
.github/workflows/container.yml | 2 +-
.github/workflows/integration.yml | 4 ++--
...ockerfile-CentOS-8-Stream => Dockerfile-CentOS-9-Stream} | 13 ++-----------
3 files changed, 5 insertions(+), 14 deletions(-)
diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml
index a8b3f9b8..adcec4f6 100644
--- a/.github/workflows/container.yml
+++ b/.github/workflows/container.yml
@@ -33,7 +33,7 @@ jobs:
- { dockerfile: 'Dockerfile-Fedora-rawhide', tag: 'fedora:rawhide' }
- { dockerfile: 'Dockerfile-OpenSuse-latest', tag: 'opensuse:latest' }
- { dockerfile: 'Dockerfile-Arch', tag: 'arch:latest' }
- - { dockerfile: 'Dockerfile-CentOS-8-Stream', tag: 'centos:stream8' }
+ - { dockerfile: 'Dockerfile-CentOS-9-Stream', tag: 'centos:stream9' }
steps:
- name: Check out the repo
uses: actions/checkout@v2
diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml
index 9ea718f1..990dd079 100644
--- a/.github/workflows/integration.yml
+++ b/.github/workflows/integration.yml
@@ -79,7 +79,7 @@ jobs:
- name: "${{ matrix.container }} TEST-${{ matrix.test }}"
run: ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}
- centos-8-stream:
+ centos-9-stream:
runs-on: ubuntu-latest
timeout-minutes: 45
concurrency:
@@ -88,7 +88,7 @@ jobs:
strategy:
matrix:
container: [
- "centos:stream8",
+ "centos:stream9",
]
# Disabled tests (due to dropped packages in RHEL/CentOS):
# 03, 04, 15: requires btrfs
diff --git a/test/container/Dockerfile-CentOS-8-Stream b/test/container/Dockerfile-CentOS-9-Stream
similarity index 65%
rename from test/container/Dockerfile-CentOS-8-Stream
rename to test/container/Dockerfile-CentOS-9-Stream
index b14cc64a..da94f134 100644
--- a/test/container/Dockerfile-CentOS-8-Stream
+++ b/test/container/Dockerfile-CentOS-9-Stream
@@ -1,4 +1,4 @@
-FROM quay.io/centos/centos:stream8
+FROM quay.io/centos/centos:stream9
MAINTAINER https://github.com/dracutdevs/dracut
@@ -7,17 +7,8 @@ LABEL RUN="docker run -it --name NAME --privileged --ipc=host --net=host --pid=h
RUN echo 'export DRACUT_NO_XATTR=1 KVERSION=$(cd /lib/modules; ls -1 | tail -1)' > /etc/profile.d/dracut-test.sh
-# FIXME: the mirrors were desynchronized at the time of writing, leading to several
-# conflicts when installing dependencies below
-RUN sed -i -e 's/^mirrorlist=/#mirrorlist=/g' -e 's/^#baseurl=/baseurl=/g' /etc/yum.repos.d/*.repo
-
# Install needed packages for the dracut CI container
RUN dnf -y install epel-release && \
- `# FIXME: this is required to work around a bug in e2fsprogs, remove when CentOS 8.5 is out` && \
- dnf -y install dnf-plugins-core && \
- dnf -y copr enable mrc0mmand/systemd-centos-ci-centos8 && \
- dnf -y install e2fsprogs && \
- `# End of FIXME` && \
dnf -y install --enablerepo powertools --enablerepo epel --setopt=install_weak_deps=False \
qemu-kvm \
NetworkManager \
@@ -54,7 +45,7 @@ RUN dnf -y install epel-release && \
xz \
&& dnf -y update && dnf clean all
-# CentOS 8 ships only qemu-kvm, but it disables the KVM accel when it's not
+# C9S ships only qemu-kvm, but it disables the KVM accel when it's not
# available
RUN ln -sv /usr/libexec/qemu-kvm /usr/bin/qemu-kvm && \
ln -sv /usr/libexec/qemu-kvm /usr/bin/qemu-system-$(uname -m)

View File

@ -1,27 +0,0 @@
From cc4e8d16b743b8b720b502174df7c934a2d5c5dc Mon Sep 17 00:00:00 2001
From: Frantisek Sumsal <frantisek@sumsal.cz>
Date: Tue, 9 Nov 2021 16:40:17 +0100
Subject: [PATCH] ci: drop `epel-release`
since it's not available (yet) for C9S.
rhel-only
---
test/container/Dockerfile-CentOS-9-Stream | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/test/container/Dockerfile-CentOS-9-Stream b/test/container/Dockerfile-CentOS-9-Stream
index da94f134..3f643e88 100644
--- a/test/container/Dockerfile-CentOS-9-Stream
+++ b/test/container/Dockerfile-CentOS-9-Stream
@@ -8,8 +8,7 @@ LABEL RUN="docker run -it --name NAME --privileged --ipc=host --net=host --pid=h
RUN echo 'export DRACUT_NO_XATTR=1 KVERSION=$(cd /lib/modules; ls -1 | tail -1)' > /etc/profile.d/dracut-test.sh
# Install needed packages for the dracut CI container
-RUN dnf -y install epel-release && \
- dnf -y install --enablerepo powertools --enablerepo epel --setopt=install_weak_deps=False \
+RUN dnf -y install --enablerepo powertools --setopt=install_weak_deps=False \
qemu-kvm \
NetworkManager \
asciidoc \

View File

@ -1,24 +0,0 @@
From 33170038ddc5affa14e9464337983cfad033b8a4 Mon Sep 17 00:00:00 2001
From: Frantisek Sumsal <frantisek@sumsal.cz>
Date: Tue, 9 Nov 2021 16:46:31 +0100
Subject: [PATCH] ci: the PowerTools repo was renamed back to CRB in C9S
rhel-only
---
test/container/Dockerfile-CentOS-9-Stream | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/container/Dockerfile-CentOS-9-Stream b/test/container/Dockerfile-CentOS-9-Stream
index 3f643e88..9d0e81e3 100644
--- a/test/container/Dockerfile-CentOS-9-Stream
+++ b/test/container/Dockerfile-CentOS-9-Stream
@@ -8,7 +8,7 @@ LABEL RUN="docker run -it --name NAME --privileged --ipc=host --net=host --pid=h
RUN echo 'export DRACUT_NO_XATTR=1 KVERSION=$(cd /lib/modules; ls -1 | tail -1)' > /etc/profile.d/dracut-test.sh
# Install needed packages for the dracut CI container
-RUN dnf -y install --enablerepo powertools --setopt=install_weak_deps=False \
+RUN dnf -y install --enablerepo crb --setopt=install_weak_deps=False \
qemu-kvm \
NetworkManager \
asciidoc \

View File

@ -1,41 +0,0 @@
From d8f6162d3d86c81744c5f2c8215959aac3a2f9e9 Mon Sep 17 00:00:00 2001
From: Frantisek Sumsal <frantisek@sumsal.cz>
Date: Tue, 9 Nov 2021 17:13:37 +0100
Subject: [PATCH] ci: temporarily use an F34 dash package until C9S EPEL is
available
rhel-only
---
test/container/Dockerfile-CentOS-9-Stream | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/container/Dockerfile-CentOS-9-Stream b/test/container/Dockerfile-CentOS-9-Stream
index 9d0e81e3..c9a96020 100644
--- a/test/container/Dockerfile-CentOS-9-Stream
+++ b/test/container/Dockerfile-CentOS-9-Stream
@@ -8,14 +8,15 @@ LABEL RUN="docker run -it --name NAME --privileged --ipc=host --net=host --pid=h
RUN echo 'export DRACUT_NO_XATTR=1 KVERSION=$(cd /lib/modules; ls -1 | tail -1)' > /etc/profile.d/dracut-test.sh
# Install needed packages for the dracut CI container
+# FIXME: properly re-add dash once C9S EPEL is available
RUN dnf -y install --enablerepo crb --setopt=install_weak_deps=False \
+ http://mirrors.kernel.org/fedora/releases/34/Everything/x86_64/os/Packages/d/dash-0.5.10.2-8.fc34.x86_64.rpm \
qemu-kvm \
NetworkManager \
asciidoc \
bash-completion \
bzip2 \
cryptsetup \
- dash \
dbus-daemon \
dhcp-client \
dhcp-server \
@@ -33,7 +34,6 @@ RUN dnf -y install --enablerepo crb --setopt=install_weak_deps=False \
mdadm \
nfs-utils \
pigz \
- python3-imgcreate \
rpm-build \
strace \
sudo \

View File

@ -1,59 +0,0 @@
From 6e304517801fdfb58df582e37cd4df04b5adc1b6 Mon Sep 17 00:00:00 2001
From: Frantisek Sumsal <frantisek@sumsal.cz>
Date: Fri, 12 Nov 2021 21:43:12 +0100
Subject: [PATCH] test: don't use `-cpu max` in GH Actions
There appears to be an issue with newer QEMU versions (spotted with Arch
Linux and C9S containers) which causes the respective GH Action to hang
when booting a QEMU VM in combination with the `-cpu max` parameter.
During (a particularly painful) debugging session I once managed to get
some output from such "frozen" machine (using `earlycon` and
`earlyprintk` kernel cmdline options), and in that particular case the
VM died with a trap caused by an invalid opcode.
I couldn't reproduce this locally, only in GH Actions environment with
Arch Linux and C9S containers. Also, so far I haven't found out which
specific CPUID flag causes this, but using the `IvyBridge-v2` feature
set seems to mitigate the issue.
(cherry picked from commit 3f56d481e8a3c67c2e795686e6ec3bfc4ea08e1d)
---
test/run-qemu | 5 +++--
tools/test-github.sh | 1 +
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/test/run-qemu b/test/run-qemu
index 3c521a14..5dc61037 100755
--- a/test/run-qemu
+++ b/test/run-qemu
@@ -3,13 +3,14 @@
# We prefer kvm, kqemu, userspace in that order.
export PATH=/usr/sbin:/usr/bin:/sbin:/bin
+QEMU_CPU="${QEMU_CPU:-max}"
-[[ -x /usr/bin/qemu ]] && BIN=/usr/bin/qemu && ARGS=(-cpu max)
+[[ -x /usr/bin/qemu ]] && BIN=/usr/bin/qemu && ARGS=(-cpu "$QEMU_CPU")
(lsmod | grep -q '^kqemu ') && BIN=/usr/bin/qemu && ARGS=(-kernel-kqemu -cpu host)
[[ -c /dev/kvm && -x /usr/bin/kvm ]] && BIN=/usr/bin/kvm && ARGS=(-cpu host)
[[ -c /dev/kvm && -x /usr/bin/qemu-kvm ]] && BIN=/usr/bin/qemu-kvm && ARGS=(-cpu host)
[[ -c /dev/kvm && -x /usr/libexec/qemu-kvm ]] && BIN=/usr/libexec/qemu-kvm && ARGS=(-cpu host)
-[[ -x /usr/bin/qemu-system-$(uname -m) ]] && BIN=/usr/bin/qemu-system-$(uname -m) && ARGS=(-cpu max)
+[[ -x /usr/bin/qemu-system-$(uname -m) ]] && BIN=/usr/bin/qemu-system-$(uname -m) && ARGS=(-cpu "$QEMU_CPU")
[[ -c /dev/kvm && -x /usr/bin/qemu-system-$(uname -m) ]] && BIN=/usr/bin/qemu-system-$(uname -m) && ARGS=(-enable-kvm -cpu host)
[[ $BIN ]] || {
diff --git a/tools/test-github.sh b/tools/test-github.sh
index eab59dcc..1d61b8e3 100755
--- a/tools/test-github.sh
+++ b/tools/test-github.sh
@@ -41,6 +41,7 @@ else
cd /lib/modules
ls -1 | tail -1
)" \
+ QEMU_CPU="IvyBridge-v2" \
DRACUT_NO_XATTR=1 \
TEST_RUN_ID="$RUN_ID" \
${TESTS:+TESTS="$TESTS"} \

View File

@ -1,41 +0,0 @@
From cecc1fbae879c189739691ecff3df67d20b0899a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Renaud=20M=C3=A9trich?= <rmetrich@redhat.com>
Date: Tue, 16 Nov 2021 11:15:52 +0100
Subject: [PATCH] fix(shutdown): be robust against forced shutdown
When a forced shutdown is issued through sending a burst of Ctrl-Alt-Del
keys, systemd sends SIGTERM to all processes. This ends up killing
dracut-initramfs-restore as well, preventing the script from detecting
that the unpack of the initramfs is incomplete, which later causes a
crash to happen when "shutdown" tries to execute from the unpacked
initramfs.
This fix makes sure dracut-initramfs-restore remains alive to detect
the unpack failed (because cpio was killed by systemd too).
Refs:
* https://bugzilla.redhat.com/show_bug.cgi?id=2023665
(cherry picked from commit b9ba3c8bb8f0f1328cd1ffaa8dbf64585b28c474)
Resolves: #2024502
---
dracut-initramfs-restore.sh | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/dracut-initramfs-restore.sh b/dracut-initramfs-restore.sh
index abe6b1e2..d97030a3 100644
--- a/dracut-initramfs-restore.sh
+++ b/dracut-initramfs-restore.sh
@@ -6,6 +6,11 @@ set -e
[ -e /run/initramfs/bin/sh ] && exit 0
[ -e /run/initramfs/.need_shutdown ] || exit 0
+# SIGTERM signal is received upon forced shutdown: ignore the signal
+# We want to remain alive to be able to trap unpacking errors to avoid
+# switching root to an incompletely unpacked initramfs
+trap 'echo "Received SIGTERM signal, ignoring!" >&2' TERM
+
KERNEL_VERSION="$(uname -r)"
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut

View File

@ -1,38 +0,0 @@
From 9e17bed7c0f30f6c557f837592772522c384779b Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Tue, 15 Feb 2022 13:44:16 +0100
Subject: [PATCH] Revert "95resume: always install this module"
This reverts commit 058ffa90669a4dbd2af16e025f22312408ed4ba9.
Resolves: #2017787
---
modules.d/95resume/module-setup.sh | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh
index 4f68e947..f0507b13 100755
--- a/modules.d/95resume/module-setup.sh
+++ b/modules.d/95resume/module-setup.sh
@@ -2,6 +2,20 @@
# called by dracut
check() {
+ swap_on_netdevice() {
+ local _dev
+ for _dev in "${swap_devs[@]}"; do
+ block_is_netdevice "$_dev" && return 0
+ done
+ return 1
+ }
+
+ # Only support resume if hibernation is currently on
+ # and no swap is mounted on a net device
+ [[ $hostonly ]] || [[ $mount_needs ]] && {
+ swap_on_netdevice || [[ "$(cat /sys/power/resume)" == "0:0" ]] && return 255
+ }
+
return 0
}

View File

@ -1,28 +0,0 @@
From 8b1252ce33d45340a3420568c66790fb53b14d0a Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Tue, 15 Feb 2022 13:47:40 +0100
Subject: [PATCH] 95resume: only exclude this module, when swap is netdev
Resolves: #2017787
---
modules.d/95resume/module-setup.sh | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh
index f0507b13..ccf2493f 100755
--- a/modules.d/95resume/module-setup.sh
+++ b/modules.d/95resume/module-setup.sh
@@ -10,10 +10,9 @@ check() {
return 1
}
- # Only support resume if hibernation is currently on
- # and no swap is mounted on a net device
+ # Only support resume if no swap is mounted on a net device
[[ $hostonly ]] || [[ $mount_needs ]] && {
- swap_on_netdevice || [[ "$(cat /sys/power/resume)" == "0:0" ]] && return 255
+ swap_on_netdevice && return 255
}
return 0

View File

@ -1,36 +0,0 @@
From eff17c61ba358d03461b62c95ef593e3b8d65e26 Mon Sep 17 00:00:00 2001
From: Coiby Xu <coxu@redhat.com>
Date: Wed, 14 Jul 2021 15:26:10 +0800
Subject: [PATCH] fix(qeth_rules): check the existence of
/sys/devices/qeth/*/online beforehand
On s390x KVM machines, the follow errors occurred,
$ kdumpctl rebuild
kdump: Rebuilding /boot/initramfs-4.18.0-321.el8.s390xkdump.img
/usr/lib/dracut/modules.d/95qeth_rules/module-setup.sh: line 13: /sys/devices/qeth/*/online: No such file or directory
/usr/lib/dracut/modules.d/95qeth_rules/module-setup.sh: line 13: /sys/devices/qeth/*/online: No such file or directory
because s390x KVM uses virtual devices and /sys/devices/qeth/*/online
doesn't exist. Eliminate this error by checking the existence
beforehand.
(cherry picked from commit 6c71ba4121ae64ccd13fefba68ca327ac623810f)
Resolves: #2050570
---
modules.d/95qeth_rules/module-setup.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/modules.d/95qeth_rules/module-setup.sh b/modules.d/95qeth_rules/module-setup.sh
index 914a28ce..884ae072 100755
--- a/modules.d/95qeth_rules/module-setup.sh
+++ b/modules.d/95qeth_rules/module-setup.sh
@@ -10,6 +10,7 @@ check() {
[[ $hostonly ]] && {
for i in /sys/devices/qeth/*/online; do
+ [ ! -f "$i" ] && continue
read -r _online < "$i"
[ "$_online" -eq 1 ] && return 0
done

View File

@ -1,85 +0,0 @@
From a0d8caa8090a78f627f26fcd9b47c4b099cbc1ba Mon Sep 17 00:00:00 2001
From: Jonathan Lebon <jonathan@jlebon.com>
Date: Thu, 17 Jun 2021 10:47:33 -0400
Subject: [PATCH] fix(fips): handle s390x OSTree systems
On s390x, the `BOOT_IMAGE` karg injected by the bootloader is not a path
to the kernel image, but rather an integer describing the index of the
menu entry selected. Because of the way the s390x bootloader works,
there is no information retained about e.g. the path of the kernel that
was loaded.
This causes issues for the FIPS code which assumes that `BOOT_IMAGE` is
a path to the kernel image to derive the HMAC path. In non-OSTree
systems, this ends up working anyway, because the kernel is located at
the root of the boot partition. In OSTree systems, this is not the
case. However, OSTree systems use BLS configs, and they are named in
reverse order of precedence (i.e. menu ordering). So from the
`BOOT_IMAGE` integer, we can figure out which BLS entry was selected.
Add some code to do just this on s390x. This isn't completely foolproof,
because it presumes that (1) BLS configs were used to populate the
bootloader (and that they were exactly in the same state they currently
are when `zipl` was run), and (2) there are no other menu entries
originating from outside the BLS configs. However, if these assumptions
are wrong we would simply fail the boot, which is currently what is
happening anyway.
See also:
https://github.com/openshift/os/pull/546
https://github.com/ibm-s390-linux/s390-tools/issues/78
Tested-by: Muhammad Adeel <muhammad.adeel@ibm.com>
Resolves: rhbz#2050567
---
modules.d/01fips/fips.sh | 21 +++++++++++++++++++++
modules.d/01fips/module-setup.sh | 2 +-
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/modules.d/01fips/fips.sh b/modules.d/01fips/fips.sh
index 821c26a2..3297cb17 100755
--- a/modules.d/01fips/fips.sh
+++ b/modules.d/01fips/fips.sh
@@ -124,6 +124,27 @@ do_fips() {
else
BOOT_IMAGE="$(getarg BOOT_IMAGE)"
+ # On s390x, BOOT_IMAGE isn't a path but an integer representing the
+ # entry number selected. Let's try the root of /boot first, and
+ # otherwise fallback to trying to parse the BLS entries if it's a
+ # BLS-based system.
+ if [ "$(uname -m)" = s390x ]; then
+ if [ -e "/boot/vmlinuz-${KERNEL}" ]; then
+ BOOT_IMAGE="vmlinuz-${KERNEL}"
+ elif [ -d /boot/loader/entries ]; then
+ i=0
+ for bls in $(ls -d /boot/loader/entries/*.conf | sort -rV); do
+ ((i++))
+
+ if [ $i -eq ${BOOT_IMAGE:-0} ] && [ -r "$bls" ]; then
+ BOOT_IMAGE="$(grep -e '^linux' "$bls" | grep -o ' .*$')"
+ BOOT_IMAGE=${BOOT_IMAGE:1}
+ break
+ fi
+ done
+ fi
+ fi
+
# Trim off any leading GRUB boot device (e.g. ($root) )
BOOT_IMAGE="$(echo "${BOOT_IMAGE}" | sed 's/^(.*)//')"
diff --git a/modules.d/01fips/module-setup.sh b/modules.d/01fips/module-setup.sh
index a1e499af..913a660c 100755
--- a/modules.d/01fips/module-setup.sh
+++ b/modules.d/01fips/module-setup.sh
@@ -67,7 +67,7 @@ install() {
inst_hook pre-udev 01 "$moddir/fips-load-crypto.sh"
inst_script "$moddir/fips.sh" /sbin/fips.sh
- inst_multiple sha512hmac rmmod insmod mount uname umount
+ inst_multiple sha512hmac rmmod insmod mount uname umount grep sort
inst_simple /etc/system-fips
[ -c "${initdir}"/dev/random ] || mknod "${initdir}"/dev/random c 1 8 \

View File

@ -1,70 +0,0 @@
From 94ec96c35678f56bc74b9c12c3229971bc40c9b3 Mon Sep 17 00:00:00 2001
From: Pavel Valena <pvalena@redhat.com>
Date: Mon, 22 Nov 2021 16:40:39 +0100
Subject: [PATCH] fix(network): add errors and warnings when network interface
does not exist
End with error, or show a warning when nonexistent device is specified for network setup like
`ip=10.12.8.12::10.12.255.254:255.255.0.0:xk12:eth0:off`.
I've added the error only for `write-ifcfg.sh`, as I think no such setup should be written.
(cherry picked from commit 7938935267dd8824f074adf84c219340ad4c8db6)
Resolves: #2050562
---
modules.d/35network-legacy/ifup.sh | 6 +++++-
modules.d/35network-legacy/parse-ip-opts.sh | 5 +++++
modules.d/45ifcfg/write-ifcfg.sh | 5 +++++
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/modules.d/35network-legacy/ifup.sh b/modules.d/35network-legacy/ifup.sh
index a05c4698..0dc9541c 100755
--- a/modules.d/35network-legacy/ifup.sh
+++ b/modules.d/35network-legacy/ifup.sh
@@ -446,7 +446,11 @@ for p in $(getargs ip=); do
# If this option isn't directed at our interface, skip it
if [ -n "$dev" ]; then
- [ "$dev" != "$netif" ] && continue
+ if [ "$dev" != "$netif" ]; then
+ [ ! -e "/sys/class/net/$dev" ] \
+ && warn "Network interface '$dev' does not exist!"
+ continue
+ fi
else
iface_is_enslaved "$netif" && continue
fi
diff --git a/modules.d/35network-legacy/parse-ip-opts.sh b/modules.d/35network-legacy/parse-ip-opts.sh
index 35917bbf..19af8789 100755
--- a/modules.d/35network-legacy/parse-ip-opts.sh
+++ b/modules.d/35network-legacy/parse-ip-opts.sh
@@ -97,6 +97,11 @@ for p in $(getargs ip=); do
fi
# IFACES list for later use
IFACES="$IFACES $dev"
+
+ # Interface should exist
+ if [ ! -e "/sys/class/net/$dev" ]; then
+ warn "Network interface '$dev' does not exist"
+ fi
fi
# Do we need to check for specific options?
diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh
index 5f71515a..345863f9 100755
--- a/modules.d/45ifcfg/write-ifcfg.sh
+++ b/modules.d/45ifcfg/write-ifcfg.sh
@@ -103,6 +103,11 @@ interface_bind() {
local _netif="$1"
local _macaddr="$2"
+ if [ ! -e "/sys/class/net/$_netif" ]; then
+ derror "Cannot find network interface '$_netif'!"
+ return 1
+ fi
+
# see, if we can bind it to some hw parms
if hw_bind "$_netif" "$_macaddr"; then
# only print out DEVICE, if it's user assigned

View File

@ -1,31 +0,0 @@
From cccc1e9ff2d80c7277563fd8fa35f44db48d2fd9 Mon Sep 17 00:00:00 2001
From: The Plumber <50238977+systemd-rhel-bot@users.noreply.github.com>
Date: Tue, 15 Feb 2022 20:26:33 +0100
Subject: [PATCH] (#2050560) fix(url-lib): make pre-pivot hook separetely per
nfs mount (#24)
* fix(url-lib): make pre-pivot hook separetely per nfs mount
(cherry picked from commit 2f091b17075f81ff490b05d3d566d736fc32f0be)
(cherry picked from commit acb18869e98687a3f8c172d7e7befaa5326cf67a)
(cherry picked from commit ec50cec3bd9169410df409e077d0487c63c2a627)
Resolves: #2050560
---
modules.d/45url-lib/url-lib.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/45url-lib/url-lib.sh b/modules.d/45url-lib/url-lib.sh
index e1e7d5af..b68f72b0 100755
--- a/modules.d/45url-lib/url-lib.sh
+++ b/modules.d/45url-lib/url-lib.sh
@@ -159,7 +159,7 @@ nfs_fetch_url() {
mntdir="$(mkuniqdir /run nfs_mnt)"
mount_nfs "$nfs:$server:$filepath${options:+:$options}" "$mntdir"
# lazy unmount during pre-pivot hook
- inst_hook --hook pre-pivot --name 99url-lib-umount-nfs umount -l -- "$mntdir"
+ inst_hook --hook pre-pivot --name 99url-lib-umount-nfs-"$(basename "$mntdir")" umount -l -- "$mntdir"
fi
if [ -z "$outloc" ]; then

View File

@ -1,51 +0,0 @@
From 8d3b5eeb684f0872069fbab9e3b6470aa6a04729 Mon Sep 17 00:00:00 2001
From: Pavel Valena <pvalena@redhat.com>
Date: Tue, 15 Feb 2022 21:06:21 +0100
Subject: [PATCH] Fix shellcheck for a0d8caa8090a78f627f26fcd9b47c4b099cbc1ba
In modules.d/01fips/fips.sh line 137:
((i++))
^-----^ SC3006: In POSIX sh, standalone ((..)) is undefined.
^-- SC3018: In POSIX sh, ++ is undefined.
In modules.d/01fips/fips.sh line 139:
if [ $i -eq ${BOOT_IMAGE:-0} ] && [ -r "$bls" ]; then
^-- SC2086: Double quote to prevent globbing and word splitting.
^--------------^ SC2086: Double quote to prevent globbing and word splitting.
In modules.d/01fips/fips.sh line 141:
BOOT_IMAGE=${BOOT_IMAGE:1}
^-------------^ SC3057: In POSIX sh, string indexing is undefined.
Related: rhbz#2050567
---
modules.d/01fips/fips.sh | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/modules.d/01fips/fips.sh b/modules.d/01fips/fips.sh
index 3297cb17..bee061ab 100755
--- a/modules.d/01fips/fips.sh
+++ b/modules.d/01fips/fips.sh
@@ -133,14 +133,15 @@ do_fips() {
BOOT_IMAGE="vmlinuz-${KERNEL}"
elif [ -d /boot/loader/entries ]; then
i=0
+ # shellcheck disable=SC2012
for bls in $(ls -d /boot/loader/entries/*.conf | sort -rV); do
- ((i++))
+ i=$((i + 1))
- if [ $i -eq ${BOOT_IMAGE:-0} ] && [ -r "$bls" ]; then
- BOOT_IMAGE="$(grep -e '^linux' "$bls" | grep -o ' .*$')"
- BOOT_IMAGE=${BOOT_IMAGE:1}
- break
- fi
+ if [ "$i" -eq "${BOOT_IMAGE:-0}" ] && [ -r "$bls" ]; then
+ BOOT_IMAGE="$(grep -e '^linux' "$bls" | grep -o ' .*$')"
+ BOOT_IMAGE=${BOOT_IMAGE## }
+ break
+ fi
done
fi
fi

View File

@ -1,94 +0,0 @@
From 865d74e9388dcc6ac6eff21a44e8229ffa8283e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Renaud=20M=C3=A9trich?= <rmetrich@redhat.com>
Date: Thu, 13 Jan 2022 17:35:59 +0100
Subject: [PATCH] fix(dracut-shutdown): add cleanup handler on failure
It may happen that dracut-shutdown.service fails, for example on timeout
due to very low bandwidth.
In such case, for hardening purposes, a new dracut-shutdown-onfailure.service
unit doing dracut-shutdown.service cleanup needs to execute to make sure
switching root to an incomplete initramfs won't occur later.
See also RHBZ #1924587 (https://bugzilla.redhat.com/show_bug.cgi?id=1924587).
(cherry picked from commit 7ab1d00227cad6f1b86ba01fdc766769faebb031)
Resolves: #2050556
---
Makefile | 1 +
.../98dracut-systemd/dracut-shutdown-onfailure.service | 13 +++++++++++++
modules.d/98dracut-systemd/dracut-shutdown.service | 1 +
modules.d/98dracut-systemd/dracut-shutdown.service.8.asc | 3 +++
pkgbuild/dracut.spec | 1 +
5 files changed, 19 insertions(+)
diff --git a/Makefile b/Makefile
index e7d69e10..1e1d093e 100644
--- a/Makefile
+++ b/Makefile
@@ -168,6 +168,7 @@ ifneq ($(enable_documentation),no)
endif
if [ -n "$(systemdsystemunitdir)" ]; then \
mkdir -p $(DESTDIR)$(systemdsystemunitdir); \
+ ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98dracut-systemd/dracut-shutdown-onfailure.service $(DESTDIR)$(systemdsystemunitdir)/dracut-shutdown-onfailure.service; \
ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98dracut-systemd/dracut-shutdown.service $(DESTDIR)$(systemdsystemunitdir)/dracut-shutdown.service; \
mkdir -p $(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants; \
ln -s ../dracut-shutdown.service \
diff --git a/modules.d/98dracut-systemd/dracut-shutdown-onfailure.service b/modules.d/98dracut-systemd/dracut-shutdown-onfailure.service
new file mode 100644
index 00000000..96de58c5
--- /dev/null
+++ b/modules.d/98dracut-systemd/dracut-shutdown-onfailure.service
@@ -0,0 +1,13 @@
+# This file is part of dracut.
+#
+# See dracut.bootup(7) for details
+
+[Unit]
+Description=Service executing upon dracut-shutdown failure to perform cleanup
+Documentation=man:dracut-shutdown.service(8)
+DefaultDependencies=no
+
+[Service]
+Type=oneshot
+ExecStart=-/bin/rm /run/initramfs/shutdown
+StandardError=null
diff --git a/modules.d/98dracut-systemd/dracut-shutdown.service b/modules.d/98dracut-systemd/dracut-shutdown.service
index 81043b2d..7c36f14f 100644
--- a/modules.d/98dracut-systemd/dracut-shutdown.service
+++ b/modules.d/98dracut-systemd/dracut-shutdown.service
@@ -10,6 +10,7 @@ Wants=local-fs.target
Conflicts=shutdown.target umount.target
DefaultDependencies=no
ConditionPathExists=!/run/initramfs/bin/sh
+OnFailure=dracut-shutdown-onfailure.service
[Service]
RemainAfterExit=yes
diff --git a/modules.d/98dracut-systemd/dracut-shutdown.service.8.asc b/modules.d/98dracut-systemd/dracut-shutdown.service.8.asc
index ba80b187..21ec88ca 100644
--- a/modules.d/98dracut-systemd/dracut-shutdown.service.8.asc
+++ b/modules.d/98dracut-systemd/dracut-shutdown.service.8.asc
@@ -40,6 +40,9 @@ by injecting "rd.break=pre-shutdown rd.shell" or "rd.break=shutdown rd.shell".
# touch /run/initramfs/.need_shutdown
----
+In case the unpack of the initramfs fails, dracut-shutdown-onfailure.service
+executes to make sure switch root doesn't happen, since it would result in
+switching to an incomplete initramfs.
AUTHORS
-------
diff --git a/pkgbuild/dracut.spec b/pkgbuild/dracut.spec
index 04c61f90..d35bbe37 100644
--- a/pkgbuild/dracut.spec
+++ b/pkgbuild/dracut.spec
@@ -414,6 +414,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
%dir %{_sharedstatedir}/initramfs
%if %{defined _unitdir}
%{_unitdir}/dracut-shutdown.service
+%{_unitdir}/dracut-shutdown-onfailure.service
%{_unitdir}/sysinit.target.wants/dracut-shutdown.service
%{_unitdir}/dracut-cmdline.service
%{_unitdir}/dracut-initqueue.service

View File

@ -1,51 +0,0 @@
From edce5bac8f65cee78fcf6c960ffb4e5924f81f78 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Tue, 1 Jun 2021 15:06:01 +0200
Subject: [PATCH] fix(multipath): get config. dir from configuration
(cherry picked from commit 2e3c5444d271cb8f05955858b8fdc367c4ea5c48)
Resolves: #1992464
---
modules.d/90multipath/module-setup.sh | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh
index b6002c6a..05222389 100755
--- a/modules.d/90multipath/module-setup.sh
+++ b/modules.d/90multipath/module-setup.sh
@@ -63,6 +63,7 @@ installkernel() {
# called by dracut
install() {
local -A _allow
+ local config_dir
add_hostonly_mpath_conf() {
if is_mpath "$1"; then
@@ -74,6 +75,16 @@ install() {
fi
}
+ local k v
+ while read -r k v; do
+ if [[ $k == "config_dir" ]]; then
+ v="${v#\"}"
+ config_dir="${v%\"}"
+ break
+ fi
+ done < <(multipath -t 2> /dev/null)
+ [[ -d $config_dir ]] || config_dir=/etc/multipath/conf.d
+
inst_multiple \
pkill \
pidof \
@@ -91,7 +102,7 @@ install() {
/etc/xdrdevices.conf \
/etc/multipath.conf \
/etc/multipath/* \
- /etc/multipath/conf.d/*
+ "$config_dir"/*
[[ $hostonly ]] && [[ $hostonly_mode == "strict" ]] && {
for_each_host_dev_and_slaves_all add_hostonly_mpath_conf

View File

@ -1,34 +0,0 @@
From 955222afe5bd7f23da48b94087ad7a4256d47605 Mon Sep 17 00:00:00 2001
From: Jan Macku <jamacku@redhat.com>
Date: Tue, 15 Feb 2022 15:29:03 +0100
Subject: [PATCH] ci: Add Differential ShellCheck action
Related: #2050567
---
.github/workflows/differential-shellcheck.yml | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/.github/workflows/differential-shellcheck.yml b/.github/workflows/differential-shellcheck.yml
new file mode 100644
index 00000000..095c3fe6
--- /dev/null
+++ b/.github/workflows/differential-shellcheck.yml
@@ -0,0 +1,17 @@
+name: Differential ShellCheck
+on:
+ push:
+ branches: [main]
+ pull_request:
+ branches: [main]
+
+jobs:
+ test:
+ runs-on: ubuntu-20.04
+
+ steps:
+ - name: Repository checkout
+ uses: actions/checkout@v2
+
+ - name: Differential ShellCheck
+ uses: redhat-plumbers-in-action/differential-shellcheck@v1

View File

@ -1,40 +0,0 @@
From c988ca3aa81026c008bce69810584a651a0e75b3 Mon Sep 17 00:00:00 2001
From: Pavel Valena <pvalena@redhat.com>
Date: Wed, 16 Feb 2022 02:42:11 +0100
Subject: [PATCH] Do not use recommends for base packages
Resolves: rhbz#1947892
---
pkgbuild/dracut.spec | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/pkgbuild/dracut.spec b/pkgbuild/dracut.spec
index d35bbe37..4c9b1da3 100644
--- a/pkgbuild/dracut.spec
+++ b/pkgbuild/dracut.spec
@@ -71,20 +71,17 @@ Requires: kmod
Requires: sed
Requires: xz
Requires: gzip
+Requires: hardlink
+Requires: pigz
+Requires: kpartx
%if 0%{?fedora} || 0%{?rhel}
-Recommends: memstrack
-Recommends: hardlink
-Recommends: pigz
-Recommends: kpartx
+Suggests: memstrack
Requires: util-linux >= 2.21
Requires: systemd >= 219
Requires: systemd-udev >= 219
Requires: procps-ng
%else
-Requires: hardlink
-Requires: gzip
-Requires: kpartx
Requires: udev > 166
Requires: util-linux-ng >= 2.21
%endif

View File

@ -1,34 +0,0 @@
From b4f4c927d25b273498d96ee0d367669ee011400e Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Mon, 19 Jul 2021 11:27:28 +0200
Subject: [PATCH] 95nfs: set correct ownership and permissions for statd
directory
The directory ownership for the statd directory should be
rpcuser:rpcuser.
Resolves: #2017846
---
modules.d/95nfs/module-setup.sh | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh
index 38da5957..1c5f780e 100755
--- a/modules.d/95nfs/module-setup.sh
+++ b/modules.d/95nfs/module-setup.sh
@@ -120,8 +120,13 @@ install() {
mkdir -m 0755 -p "$initdir/var/lib/nfs"
mkdir -m 0755 -p "$initdir/var/lib/nfs/rpc_pipefs"
mkdir -m 0770 -p "$initdir/var/lib/rpcbind"
- [ -d "/var/lib/nfs/statd/sm" ] && mkdir -m 0755 -p "$initdir/var/lib/nfs/statd/sm"
- [ -d "/var/lib/nfs/sm" ] && mkdir -m 0755 -p "$initdir/var/lib/nfs/sm"
+ [ -d "$dracutsysrootdir/var/lib/nfs/statd/sm" ] \
+ && mkdir -m 0700 -p "$initdir/var/lib/nfs/statd" \
+ && mkdir -m 0755 -p "$initdir/var/lib/nfs/statd/sm" \
+ && chown -R rpcuser:rpcuser "$initdir/var/lib/nfs/statd"
+ [ -d "$dracutsysrootdir/var/lib/nfs/sm" ] \
+ && mkdir -m 0755 -p "$initdir/var/lib/nfs/sm" \
+ && chown -R rpcuser:rpcuser "$initdir/var/lib/nfs/sm"
# Rather than copy the passwd file in, just set a user for rpcbind
# We'll save the state and restart the daemon from the root anyway

View File

@ -5,10 +5,10 @@
# strip the automatically generated dep here and instead co-own the
# directory.
%global __requires_exclude pkg-config
%define dist_free_release 30.git20220216
%define dist_free_release 6.git20220718
Name: dracut
Version: 055
Version: 057
Release: %{dist_free_release}%{?dist}
Summary: Initramfs generator using udev
@ -34,30 +34,6 @@ Patch2: 0002.patch
Patch3: 0003.patch
Patch4: 0004.patch
Patch5: 0005.patch
Patch6: 0006.patch
Patch7: 0007.patch
Patch8: 0008.patch
Patch9: 0009.patch
Patch10: 0010.patch
Patch11: 0011.patch
Patch12: 0012.patch
Patch13: 0013.patch
Patch14: 0014.patch
Patch15: 0015.patch
Patch16: 0016.patch
Patch17: 0017.patch
Patch18: 0018.patch
Patch19: 0019.patch
Patch20: 0020.patch
Patch21: 0021.patch
Patch22: 0022.patch
Patch23: 0023.patch
Patch24: 0024.patch
Patch25: 0025.patch
Patch26: 0026.patch
Patch27: 0027.patch
Patch28: 0028.patch
Patch29: 0029.patch
Source1: https://www.gnu.org/licenses/lgpl-2.1.txt
@ -244,9 +220,6 @@ rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00dash
# we do not support mksh in the initramfs
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00mksh
# remove gentoo specific modules
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/50gensplash
%if %{defined _unitdir}
# with systemd IMA and selinux modules do not make sense
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/96securityfs
@ -355,6 +328,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
%{dracutlibdir}/modules.d/01systemd-coredump
%{dracutlibdir}/modules.d/01systemd-hostnamed
%{dracutlibdir}/modules.d/01systemd-initrd
%{dracutlibdir}/modules.d/01systemd-integritysetup
%{dracutlibdir}/modules.d/01systemd-journald
%{dracutlibdir}/modules.d/01systemd-ldconfig
%{dracutlibdir}/modules.d/01systemd-modules-load
@ -385,6 +359,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
%{dracutlibdir}/modules.d/50plymouth
%{dracutlibdir}/modules.d/62bluetooth
%{dracutlibdir}/modules.d/80lvmmerge
%{dracutlibdir}/modules.d/80lvmthinpool-monitor
%{dracutlibdir}/modules.d/90btrfs
%{dracutlibdir}/modules.d/90crypt
%{dracutlibdir}/modules.d/90dm
@ -399,6 +374,9 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
%{dracutlibdir}/modules.d/90qemu
%{dracutlibdir}/modules.d/91crypt-gpg
%{dracutlibdir}/modules.d/91crypt-loop
%{dracutlibdir}/modules.d/91fido2
%{dracutlibdir}/modules.d/91pcsc
%{dracutlibdir}/modules.d/91pkcs11
%{dracutlibdir}/modules.d/91tpm2-tss
%{dracutlibdir}/modules.d/95debug
%{dracutlibdir}/modules.d/95fstab-sys
@ -409,6 +387,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
%{dracutlibdir}/modules.d/95terminfo
%{dracutlibdir}/modules.d/95udev-rules
%{dracutlibdir}/modules.d/95virtfs
%{dracutlibdir}/modules.d/95virtiofs
%ifarch s390 s390x
%{dracutlibdir}/modules.d/80cms
%{dracutlibdir}/modules.d/81cio_ignore
@ -462,6 +441,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
%files network
%{dracutlibdir}/modules.d/01systemd-networkd
%{dracutlibdir}/modules.d/35connman
%{dracutlibdir}/modules.d/35network-manager
%{dracutlibdir}/modules.d/35network-legacy
%{dracutlibdir}/modules.d/35network-wicked
@ -511,6 +491,9 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
%{_prefix}/lib/kernel/install.d/51-dracut-rescue.install
%changelog
* Mon Jul 18 2022 Pavel Valena <pvalena@redhat.com> - 057-6.git20220718
- Upgrade to Dracut version 057
* Wed Feb 16 2022 Pavel Valena <pvalena@redhat.com> - 055-30.git20220216
- fix(shutdown): be robust against forced shutdown
- 95resume: only exclude this module, when swap is netdev

View File

@ -1 +1 @@
SHA512 (dracut-055.tar.xz) = 5d2450d0b08acb4cf4f927856fad5c243d1c8f04ac3a47e4d2c866d5d1a26a8121baaf604a21f7a18a36c01960c247689cf95317a90cb63be139a3a0a87a6a92
SHA512 (dracut-057.tar.xz) = 5169dd42c59a1a3fde21da984ab998eb04bf4aac384a6aa4ada3b0febd1e8f0c7fc727b1e8aed30f6584acbe323cbdb4021d18109b8baec907dadcc8cd4ceec9