Browse Source

update dractu 0.57

Signed-off-by: Toshaan Bharvani <toshaan@powerel.org>
master
Toshaan Bharvani 11 months ago
parent
commit
f1f0371ea3
  1. 700
      SOURCES/0001.patch
  2. 128
      SOURCES/0002.patch
  3. 174
      SOURCES/0003.patch
  4. 96
      SOURCES/0004.patch
  5. 46
      SOURCES/0005.patch
  6. 82
      SOURCES/0006.patch
  7. 79
      SOURCES/0007.patch
  8. 58
      SOURCES/0008.patch
  9. 81
      SOURCES/0009.patch
  10. 56
      SOURCES/0010.patch
  11. 45
      SOURCES/0011.patch
  12. 129
      SOURCES/0012.patch
  13. 44
      SOURCES/0013.patch
  14. 58
      SOURCES/0014.patch
  15. 76
      SOURCES/0015.patch
  16. 74
      SOURCES/0016.patch
  17. 122
      SOURCES/0017.patch
  18. 83
      SOURCES/0018.patch
  19. 447
      SOURCES/0019.patch
  20. 63
      SOURCES/0020.patch
  21. 0
      SOURCES/0021.patch
  22. 0
      SOURCES/0022.patch
  23. 0
      SOURCES/0023.patch
  24. 0
      SOURCES/0024.patch
  25. 0
      SOURCES/0025.patch
  26. 0
      SOURCES/0026.patch
  27. 0
      SOURCES/0027.patch
  28. 0
      SOURCES/0028.patch
  29. 0
      SOURCES/0029.patch
  30. 0
      SOURCES/0030.patch
  31. 0
      SOURCES/0031.patch
  32. 0
      SOURCES/0032.patch
  33. 0
      SOURCES/0033.patch
  34. 0
      SOURCES/0034.patch
  35. 0
      SOURCES/0035.patch
  36. 0
      SOURCES/0036.patch
  37. 0
      SOURCES/0037.patch
  38. 65
      SPECS/dracut.spec

700
SOURCES/0001.patch

@ -1,474 +1,270 @@ @@ -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"]


128
SOURCES/0002.patch

@ -1,87 +1,55 @@ @@ -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
on:
pull_request:
- branches: [ master ]
+ branches: [ main ]
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
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
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
on:
push:
- branches: [ master ]
+ branches: [ main ]
pull_request:
- branches: [ master ]
+ branches: [ main ]
- inst_multiple sha512hmac rmmod insmod mount uname umount grep sed cut find sort
+ inst_multiple sha512hmac rmmod insmod mount uname umount grep sed sort
jobs:
lint-c:
inst_simple /etc/system-fips
[ -c "${initdir}"/dev/random ] || mknod "${initdir}"/dev/random c 1 8 \


174
SOURCES/0003.patch

@ -1,143 +1,41 @@ @@ -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


96
SOURCES/0004.patch

@ -1,71 +1,35 @@ @@ -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


46
SOURCES/0005.patch

@ -1,25 +1,27 @@ @@ -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

82
SOURCES/0006.patch

@ -1,29 +1,65 @@ @@ -1,29 +1,65 @@
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
From c1dee82d80d1b4d76a476d822cdf817686da7ebb Mon Sep 17 00:00:00 2001
From: Pavel Valena <pvalena@redhat.com>
Date: Tue, 19 Jul 2022 16:42:59 +0200
Subject: [PATCH] ci: fix branch to run integration tests in

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(-)
.github/workflows/container.yml | 2 +-
.github/workflows/differential-shellcheck.yml | 2 +-
.github/workflows/integration.yml | 2 +-
.github/workflows/lint.yml | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)

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 @@
diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml
index 99d57f5b..82d7a097 100644
--- a/.github/workflows/container.yml
+++ b/.github/workflows/container.yml
@@ -8,7 +8,7 @@ on:
- 'test/container/**'
- '.github/workflows/container.yml'
pull_request:
- branches: [ main new-main ]
+ branches: [ main ]
paths:
- 'test/container/**'
- '.github/workflows/container.yml'
diff --git a/.github/workflows/differential-shellcheck.yml b/.github/workflows/differential-shellcheck.yml
index c4b05fad..63a022bf 100644
--- a/.github/workflows/differential-shellcheck.yml
+++ b/.github/workflows/differential-shellcheck.yml
@@ -1,7 +1,7 @@
name: Differential ShellCheck
on:
pull_request:
- branches: [ main new-main ]
+ branches: [ main ]
jobs:
test:
diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml
index aa354e3e..82d01457 100644
--- a/.github/workflows/integration.yml
+++ b/.github/workflows/integration.yml
@@ -2,7 +2,7 @@ name: Integration Test
on:
pull_request:
- branches: [ main new-main ]
+ branches: [ main ]
# 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
jobs:
basic:
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 5e3a299f..f6778a65 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -4,7 +4,7 @@ on:
push:
branches: [ main ]
pull_request:
- branches: [ main new-main ]
+ branches: [ main ]
find_kernel_modules_external() {
jobs:
lint-c:


79
SOURCES/0007.patch

@ -1,45 +1,42 @@ @@ -1,45 +1,42 @@
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}
From d754571fea528af061db46a0284e996d012f14c9 Mon Sep 17 00:00:00 2001
From: Pavel Valena <pvalena@redhat.com>
Date: Tue, 19 Jul 2022 17:06:25 +0200
Subject: [PATCH] ci: run integration tests only on C9s

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(-)
.github/workflows/container.yml | 4 ----
.github/workflows/integration.yml | 3 ---
2 files changed, 7 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
diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml
index 82d7a097..34038f57 100644
--- a/.github/workflows/container.yml
+++ b/.github/workflows/container.yml
@@ -28,11 +28,7 @@ jobs:
fail-fast: false
matrix:
config:
- - { 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
uses: actions/checkout@v2
diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml
index 82d01457..40da300c 100644
--- a/.github/workflows/integration.yml
+++ b/.github/workflows/integration.yml
@@ -14,10 +14,7 @@ jobs:
strategy:
matrix:
container: [
- "arch:latest",
- "debian:latest",
"fedora:latest",
- "opensuse:latest",
]
test: [
"04",


58
SOURCES/0008.patch

@ -1,43 +1,29 @@ @@ -1,43 +1,29 @@
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
From 263b9095200cf277db3bff4753b06306175b1534 Mon Sep 17 00:00:00 2001
From: Pavel Valena <pvalena@redhat.com>
Date: Thu, 21 Jul 2022 17:40:20 +0200
Subject: [PATCH] fix(dracut.sh): do not fail on irregular files

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.
If file is not a regular file (test -f), dracut.sh fails,
which is unexpected change of behaviour.
The workaround would be to create an empty file.

https://bugzilla.redhat.com/show_bug.cgi?id=1975929
(cherry picked from commit 07977ee5c5294a5d30c1f33f292a0b31303750fb)

Resolves: #1975929
rhel-only
Fixes: #1835
---
modules.d/35network-manager/nm-lib.sh | 4 ++++
modules.d/80cms/cmsifup.sh | 1 +
2 files changed, 5 insertions(+)
dracut.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

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
diff --git a/dracut.sh b/dracut.sh
index a1ea1bc3..210a8275 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -905,7 +905,7 @@ if [[ -z $conffile ]]; then
else
conffile="$dracutsysrootdir/etc/dracut.conf"
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"
-elif [[ ! -f $conffile ]]; then
+elif [[ ! -e $conffile ]]; then
printf "%s\n" "dracut: Configuration file '$conffile' not found." >&2
exit 1
fi


81
SOURCES/0009.patch

@ -1,42 +1,61 @@ @@ -1,42 +1,61 @@
From 058ffa90669a4dbd2af16e025f22312408ed4ba9 Mon Sep 17 00:00:00 2001
From 96116c784edda6675c80fdf95823188c72b28652 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
Date: Mon, 18 Jul 2022 16:29:27 +0200
Subject: [PATCH] fix(98dracut-systemd): partly revert "emergency mode: use
sulogin"

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
Partly reverts 32f68c1f9ac3720e8ce4b95a09c0ce680d5da786
In RHEL we don't want to have a password to log in into emergency mode.

RHEL-only

Resolves: #1926544
Resolves: #2057365
---
modules.d/95resume/module-setup.sh | 14 --------------
1 file changed, 14 deletions(-)
modules.d/98dracut-systemd/dracut-emergency.sh | 2 +-
modules.d/98dracut-systemd/module-setup.sh | 2 --
modules.d/99base/module-setup.sh | 8 ++------
3 files changed, 3 insertions(+), 9 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 @@
diff --git a/modules.d/98dracut-systemd/dracut-emergency.sh b/modules.d/98dracut-systemd/dracut-emergency.sh
index c6637a5c..48062f49 100755
--- a/modules.d/98dracut-systemd/dracut-emergency.sh
+++ b/modules.d/98dracut-systemd/dracut-emergency.sh
@@ -34,7 +34,7 @@ if getargbool 1 rd.shell -d -y rdshell || getarg rd.break -d rdbreak; then
done < /proc/consoles
[ -f /etc/profile ] && . /etc/profile
[ -z "$PS1" ] && export PS1="$_name:\${PWD}# "
- exec sulogin -e
+ exec sh -i -l
else
export hook="shutdown-emergency"
warn "$action has failed. To debug this issue add \"rd.shell rd.debug\" to the kernel command line."
diff --git a/modules.d/98dracut-systemd/module-setup.sh b/modules.d/98dracut-systemd/module-setup.sh
index b7da86db..6fb26efa 100755
--- a/modules.d/98dracut-systemd/module-setup.sh
+++ b/modules.d/98dracut-systemd/module-setup.sh
@@ -51,6 +51,4 @@ install() {
done
# 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
- }
inst_simple "$moddir/dracut-tmpfiles.conf" "$tmpfilesdir/dracut-tmpfiles.conf"
-
return 0
- inst_multiple sulogin
}
diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh
index 10a44d91..3fa2659a 100755
--- a/modules.d/99base/module-setup.sh
+++ b/modules.d/99base/module-setup.sh
@@ -30,12 +30,8 @@ install() {
fi
# add common users in /etc/passwd, it will be used by nfs/ssh currently
- # use password for hostonly images to facilitate secure sulogin in emergency console
- [[ $hostonly ]] && pwshadow='x'
- grep '^root:' "$initdir/etc/passwd" 2> /dev/null || echo "root:$pwshadow:0:0::/root:/bin/sh" >> "$initdir/etc/passwd"
- grep '^nobody:' "$dracutsysrootdir"/etc/passwd >> "$initdir/etc/passwd"
-
- [[ $hostonly ]] && grep '^root:' "$dracutsysrootdir"/etc/shadow >> "$initdir/etc/shadow"
+ grep '^root:' "$initdir/etc/passwd" 2> /dev/null || echo 'root:x:0:0::/root:/bin/sh' >> "$initdir/etc/passwd"
+ grep '^nobody:' /etc/passwd >> "$initdir/etc/passwd"
# install our scripts and hooks
inst_script "$moddir/init.sh" "/init"

56
SOURCES/0010.patch

@ -1,35 +1,29 @@ @@ -1,35 +1,29 @@
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
From 733d47fb873c2b821a430a614d83b60475df2d13 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Mon, 15 Aug 2022 16:25:53 +0200
Subject: [PATCH] fix(kernel-modules): always include nvmem driver on
nvmem_on_arm

These drivers are needed to boot on some SoCs like NXP i.MX
We should include them so installation images will work.

(cherry picked from commit bc965cd8890013a6362733d217c18756134bbcdf)

Resolves: #2109498
---
.packit.yml | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
modules.d/90kernel-modules/module-setup.sh | 1 +
1 file changed, 1 insertion(+)

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
diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh
index e2073a04..191af041 100755
--- a/modules.d/90kernel-modules/module-setup.sh
+++ b/modules.d/90kernel-modules/module-setup.sh
@@ -85,6 +85,7 @@ installkernel() {
"=drivers/mfd" \
"=drivers/mmc/core" \
"=drivers/mmc/host" \
+ "=drivers/nvmem" \
"=drivers/phy" \
"=drivers/power" \
"=drivers/regulator" \


45
SOURCES/0011.patch

@ -1,23 +1,32 @@ @@ -1,23 +1,32 @@
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
From 58a310fdbfc1a7e07703c6ab9b21c43a73330a92 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Mon, 15 Aug 2022 16:32:51 +0200
Subject: [PATCH] fix(drm): add video drivers needed on hyper-v and similar

Due to non-availability of Hyper-V video driver hyperv_drm in kdump
initramfs, the console seems to be in hang state with no text over it.

We should also go through the /sys/bus/vmbus/devices and include drivers
referenced there.

(cherry picked from commit 85149b85961aa535a3c61d492cd3594794e5cc3f)

Resolves: #2099502
---
.packit.yml | 2 ++
1 file changed, 2 insertions(+)
modules.d/50drm/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

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"
diff --git a/modules.d/50drm/module-setup.sh b/modules.d/50drm/module-setup.sh
index cff0550c..1fb38677 100755
--- a/modules.d/50drm/module-setup.sh
+++ b/modules.d/50drm/module-setup.sh
@@ -31,7 +31,7 @@ installkernel() {
if [[ $hostonly ]]; then
local i modlink modname
# Available targets can be listed via `copr-cli list-chroots`
jobs:
- for i in /sys/bus/{pci/devices,platform/devices,virtio/devices,soc/devices/soc?}/*/modalias; do
+ for i in /sys/bus/{pci/devices,platform/devices,virtio/devices,soc/devices/soc?,vmbus/devices}/*/modalias; do
[[ -e $i ]] || continue
[[ -n $(< "$i") ]] || continue
# shellcheck disable=SC2046


129
SOURCES/0012.patch

@ -1,88 +1,51 @@ @@ -1,88 +1,51 @@
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
From a84df47afae75a0b4068c78d8201a515a841f353 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Tue, 16 Aug 2022 13:30:16 +0200
Subject: [PATCH] fix(skipcpio): ignore broken pipe

rhel-only
If lsinitrd is called from a context in which SIGPIPE is ignored (e.g.,
from a systemd unit with default setting of IgnoreSIGPIPE=), the
following line will result in an error being issued:

bin="$($SKIP "$image" | { read -r -N 6 bin && echo "$bin"; })"

An example error from `kdumpctl start` (which internally just calls
`systemctl start kdump.service`):

kdumpctl[1287]: ERROR: src/skipcpio/skipcpio.c:191:main(): fwrite

A minimal reproducer:

systemd-run -t sh -c '/path/to/skipcpio /path/to/any/file | false'

(cherry-picked from e9a4d73b73b716a9d2d5f01ceb7b427ef544ed9b)

Resolves: #2109803
---
.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(-)
src/skipcpio/skipcpio.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

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
diff --git a/src/skipcpio/skipcpio.c b/src/skipcpio/skipcpio.c
index 13bfaf53..f66c1869 100644
--- a/src/skipcpio/skipcpio.c
+++ b/src/skipcpio/skipcpio.c
@@ -23,6 +23,7 @@
#define _GNU_SOURCE
#endif
@@ -7,17 +7,8 @@ LABEL RUN="docker run -it --name NAME --privileged --ipc=host --net=host --pid=h
+#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -187,8 +188,10 @@ cat_rest:
goto end;
}
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)

+ errno = 0;
if (fwrite(buf.copy_buffer, 1, s, stdout) != s) {
- pr_err("fwrite\n");
+ if (errno != EPIPE)
+ pr_err("fwrite\n");
goto end;
}
}

44
SOURCES/0013.patch

@ -1,27 +1,29 @@ @@ -1,27 +1,29 @@
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.
From bdd3fa585fcfa21f20d66f01568967c0d7a771d6 Mon Sep 17 00:00:00 2001
From: Pavel Valena <pvalena@redhat.com>
Date: Tue, 16 Aug 2022 15:21:05 +0200
Subject: [PATCH] ci: pull request template

rhel-only
---
test/container/Dockerfile-CentOS-9-Stream | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
.github/pull_request_template.md | 11 +++--------
1 file changed, 3 insertions(+), 8 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
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index ef281c3d..8fcf4d33 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -1,10 +1,5 @@
-This pull request changes...
+<description/>
-## Changes
+(cherry picked from commit ... )
# 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 \
-## Checklist
-- [ ] I have tested it locally
-- [ ] I have reviewed and updated any documentation if relevant
-- [ ] I am providing new code and test(s) for it
-
-Fixes #
+Resolves: #


58
SOURCES/0014.patch

@ -1,24 +1,42 @@ @@ -1,24 +1,42 @@
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
From f93ac80a0b3e9017bf2c374b72126908a7f5cbde Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Mon, 8 Aug 2022 13:42:51 +0200
Subject: [PATCH] refactor(url-lib): write curl output directly to file

rhel-only
The redirection to stdout was originally added to workaround
https://bugzilla.redhat.com/show_bug.cgi?id=989133 (curl would create no
file if the source was empty), but I don't see that problem with current
curl.

A nice side-effect of this change is that curl shows download progress.

(cherry picked from commit 1343d21d8c0d1f7239e27165e9c7633b504f777f)

Resolves: #2112475
---
test/container/Dockerfile-CentOS-9-Stream | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
modules.d/45url-lib/url-lib.sh | 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 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 \
diff --git a/modules.d/45url-lib/url-lib.sh b/modules.d/45url-lib/url-lib.sh
index e88fbc14..b009fd09 100755
--- a/modules.d/45url-lib/url-lib.sh
+++ b/modules.d/45url-lib/url-lib.sh
@@ -67,7 +67,7 @@ curl_fetch_url() {
echo "$url" > /proc/self/fd/0
if [ -n "$outloc" ]; then
# shellcheck disable=SC2086
- curl $curl_args --output - -- "$url" > "$outloc" || return $?
+ curl $curl_args --output "$outloc" -- "$url" || return $?
else
local outdir
outdir="$(mkuniqdir /tmp curl_fetch_url)"
@@ -101,7 +101,7 @@ ctorrent_fetch_url() {
echo "$url" > /proc/self/fd/0
if [ -n "$outloc" ]; then
# shellcheck disable=SC2086
- curl $curl_args --output - -- "$url" > "$torrent_outloc" || return $?
+ curl $curl_args --output "$torrent_outloc" -- "$url" || return $?
else
local outdir
outdir="$(mkuniqdir /tmp torrent_fetch_url)"


76
SOURCES/0015.patch

@ -1,41 +1,45 @@ @@ -1,41 +1,45 @@
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
From f5ef6694eae2696b10b4f6e5a0d72a29223651ce Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong@tencent.com>
Date: Tue, 20 Sep 2022 02:13:01 +0800
Subject: [PATCH] fix(dracut-initramfs-restore.sh): initramfs detection not
working

rhel-only
The path detection is not working on latest Fedora and some other
distros, and it fails to extract the initramfs. It seems the if
statement is broken by a previous commit, so let's fix it.

Fixes: 3d8e1ad ('fix(dracut-initramfs-restore.sh): add missing default paths')
Signed-off-by: Kairui Song <kasong@tencent.com>
(cherry picked from commit 481b87fa7a82be54663071ad9ad76c34e378ddc7)

Resolves: #2149232
---
test/container/Dockerfile-CentOS-9-Stream | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
dracut-initramfs-restore.sh | 12 ++++++------
1 file changed, 6 insertions(+), 6 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
diff --git a/dracut-initramfs-restore.sh b/dracut-initramfs-restore.sh
index 68ea3873..df6cb9a8 100644
--- a/dracut-initramfs-restore.sh
+++ b/dracut-initramfs-restore.sh
@@ -27,14 +27,14 @@ fi
mount -o ro /boot &> /dev/null || true
# 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 \
-if [[ -d /efi/loader/entries ]] || [[ -L /efi/loader/entries ]] \
- || [[ -d /efi/$MACHINE_ID ]] || [[ -L /efi/$MACHINE_ID ]]; then
+if [[ -d /efi/loader/entries || -L /efi/loader/entries ]] \
+ && [[ -d /efi/$MACHINE_ID || -L /efi/$MACHINE_ID ]]; then
IMG="/efi/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
-elif [[ -d /boot/loader/entries ]] || [[ -L /boot/loader/entries ]] \
- || [[ -d /boot/$MACHINE_ID ]] || [[ -L /boot/$MACHINE_ID ]]; then
+elif [[ -d /boot/loader/entries || -L /boot/loader/entries ]] \
+ && [[ -d /boot/$MACHINE_ID || -L /boot/$MACHINE_ID ]]; then
IMG="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
-elif [[ -d /boot/efi/loader/entries ]] || [[ -L /boot/efi/loader/entries ]] \
- || [[ -d /boot/efi/$MACHINE_ID ]] || [[ -L /boot/efi/$MACHINE_ID ]]; then
+elif [[ -d /boot/efi/loader/entries || -L /boot/efi/loader/entries ]] \
+ && [[ -d /boot/efi/$MACHINE_ID || -L /boot/efi/$MACHINE_ID ]]; then
IMG="/boot/efi/$MACHINE_ID/$KERNEL_VERSION/initrd"
elif [[ -f /lib/modules/${KERNEL_VERSION}/initrd ]]; then
IMG="/lib/modules/${KERNEL_VERSION}/initrd"


74
SOURCES/0016.patch

@ -1,59 +1,31 @@ @@ -1,59 +1,31 @@
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
From 6a1d39e50d9f8a7f3765fa6cb85b34e6597d864d Mon Sep 17 00:00:00 2001
From: Pavel Valena <pvalena@redhat.com>
Date: Tue, 6 Dec 2022 21:46:01 +0100
Subject: [PATCH] fix(90kernel-modules): install blk modules using symbol
blk_alloc_disk

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.
Corresponding kernel symbol blk_cleanup_disk is no longer used in the nvdimm
driver and calls are made directly instead.

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.
blk_alloc_disk is used:
https://elixir.bootlin.com/linux/v6.1-rc8/source/drivers/nvdimm/pmem.c#L522

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)
Resolves: #2149781
---
test/run-qemu | 5 +++--
tools/test-github.sh | 1 +
2 files changed, 4 insertions(+), 2 deletions(-)
modules.d/90kernel-modules/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

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}"
diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh
index 191af041..0b9488c3 100755
--- a/modules.d/90kernel-modules/module-setup.sh
+++ b/modules.d/90kernel-modules/module-setup.sh
@@ -2,7 +2,7 @@
-[[ -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)
# 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|blk_mq_alloc_disk|blk_cleanup_disk'
+ 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_alloc_disk|blk_mq_alloc_disk|blk_cleanup_disk'
local -A _hostonly_drvs
[[ $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"} \
find_kernel_modules_external() {


122
SOURCES/0017.patch

@ -1,41 +1,99 @@ @@ -1,41 +1,99 @@
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
From 8ab3020205ea92cbef3ca250c924d9b500c5d9aa Mon Sep 17 00:00:00 2001
From: Hari Bathini <hbathini@linux.ibm.com>
Date: Tue, 12 Jul 2022 13:55:47 +0530
Subject: [PATCH] fix(squash): build ld cache for squash loader

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.
Commit dc21638c3f0a fixes kdump kernel crash, due to non-conventional
library path in powerpc, by copying /etc/ld.so.cache under initdir.
While that works in general, it is vulnerable to failure because of
missing links, when the CPU is reconfigured to run in compatibility
mode of older CPU version. Avoid this by running ldconfig for squash
loader to create the necessary links & ld cache for it. Doing this
also saves a few kilobyes of space as the copied ld cache is bigger
in size than the one needed for squash loader environment.

This fix makes sure dracut-initramfs-restore remains alive to detect
the unpack failed (because cpio was killed by systemd too).
Fixes: dc21638c3f0a ("fix(squash): keep ld cache under initdir")
Cc: Pingfan Liu <piliu@redhat.com>
Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>

Refs:
* https://bugzilla.redhat.com/show_bug.cgi?id=2023665
(cherry picked from commit b9ba3c8bb8f0f1328cd1ffaa8dbf64585b28c474)

Resolves: #2024502
Resolves: rhbz#2122274
---
dracut-initramfs-restore.sh | 5 +++++
1 file changed, 5 insertions(+)
dracut-init.sh | 14 ++++++++++++++
dracut.sh | 11 +----------
modules.d/99squash/module-setup.sh | 8 +++-----
3 files changed, 18 insertions(+), 15 deletions(-)

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
diff --git a/dracut-init.sh b/dracut-init.sh
index 900e8b83..fe1b1426 100644
--- a/dracut-init.sh
+++ b/dracut-init.sh
@@ -504,6 +504,20 @@ inst_rules_wildcard() {
[[ $_found ]] || dinfo "Skipping udev rule: $_rule"
}
+# make sure that library links are correct and up to date
+build_ld_cache() {
+ for f in "$dracutsysrootdir"/etc/ld.so.conf "$dracutsysrootdir"/etc/ld.so.conf.d/*; do
+ [[ -f $f ]] && inst_simple "${f#$dracutsysrootdir}"
+ done
+ if ! $DRACUT_LDCONFIG -r "$initdir" -f /etc/ld.so.conf; then
+ if [[ $EUID == 0 ]]; then
+ derror "ldconfig exited ungracefully"
+ else
+ derror "ldconfig might need uid=0 (root) for chroot()"
+ fi
+ fi
+}
+
prepare_udev_rules() {
if [ -z "$UDEVVERSION" ]; then
UDEVVERSION=$(udevadm --version)
diff --git a/dracut.sh b/dracut.sh
index 210a8275..d2f07ac6 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -2360,16 +2360,7 @@ fi
if [[ $kernel_only != yes ]]; then
# make sure that library links are correct and up to date
- for f in "$dracutsysrootdir"/etc/ld.so.conf "$dracutsysrootdir"/etc/ld.so.conf.d/*; do
- [[ -f $f ]] && inst_simple "${f#$dracutsysrootdir}"
- done
- if ! $DRACUT_LDCONFIG -r "$initdir" -f /etc/ld.so.conf; then
- if [[ $EUID == 0 ]]; then
- derror "ldconfig exited ungracefully"
- else
- derror "ldconfig might need uid=0 (root) for chroot()"
- fi
- fi
+ build_ld_cache
fi
if dracut_module_included "squash"; then
diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh
index c42eb679..f31ff556 100644
--- a/modules.d/99squash/module-setup.sh
+++ b/modules.d/99squash/module-setup.sh
@@ -28,11 +28,6 @@ installpost() {
[[ $squash_dir == "$i"/* ]] || mv "$i" "$squash_dir"/
done
+# 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
- # initdir also needs ld.so.* to make ld.so work
- inst /etc/ld.so.cache
- inst /etc/ld.so.conf
- inst_dir /etc/ld.so.conf.d
-
# Create mount points for squash loader
mkdir -p "$initdir"/squash/
mkdir -p "$squash_dir"/squash/
@@ -67,6 +62,9 @@ installpost() {
ln_r /usr/bin /bin
ln_r /usr/sbin /sbin
inst_simple "$moddir"/init-squash.sh /init
+
KERNEL_VERSION="$(uname -r)"
+ # make sure that library links are correct and up to date for squash loader
+ build_ld_cache
}
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
install() {


83
SOURCES/0018.patch

@ -1,38 +1,59 @@ @@ -1,38 +1,59 @@
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"
From 37e73a30c5b75a57de9e2bb6843eb9a1dab12abf Mon Sep 17 00:00:00 2001
From: Laszlo Gombos <laszlo.gombos@gmail.com>
Date: Sun, 14 Aug 2022 22:46:10 +0000
Subject: [PATCH] test(16-DMSQUASH): make it pass on arch

This reverts commit 058ffa90669a4dbd2af16e025f22312408ed4ba9.
Include additional kernel drivers and install squashfs-tools
into the arch container.

Resolves: #2017787
(cherry picked from commit b8ffc87d13989f95c8f48ec64613dd9138835618)

Related: #2135060
---
modules.d/95resume/module-setup.sh | 14 ++++++++++++++
1 file changed, 14 insertions(+)
test/TEST-16-DMSQUASH/test.sh | 4 +++-
test/container/Dockerfile-Arch | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)

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 @@
diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh
index cf433489..52029375 100755
--- a/test/TEST-16-DMSQUASH/test.sh
+++ b/test/TEST-16-DMSQUASH/test.sh
@@ -6,7 +6,7 @@ TEST_DESCRIPTION="live root on a squash filesystem"
KVERSION="${KVERSION-$(uname -r)}"
# Uncomment this to debug failures
-# DEBUGFAIL="rd.shell rd.debug loglevel=7"
+#DEBUGFAIL="rd.shell rd.debug loglevel=7"
test_run() {
dd if=/dev/zero of="$TESTDIR"/marker.img bs=1MiB count=1
@@ -72,6 +72,7 @@ test_setup() {
# devices, volume groups, encrypted partitions, etc.
"$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \
--modules "rootfs-block qemu" \
+ --drivers "ext4 sd_mod" \
--no-hostonly --no-hostonly-cmdline --no-early-microcode --nofscks --nomdadmconf --nohardlink --nostrip \
--force "$TESTDIR"/initramfs.makeroot "$KVERSION" || return 1
rm -rf -- "$TESTDIR"/overlay
@@ -109,6 +110,7 @@ test_setup() {
"$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \
--modules "dmsquash-live qemu" \
--omit "rngd" \
+ --drivers "ext4 sd_mod" \
--no-hostonly --no-hostonly-cmdline \
--force "$TESTDIR"/initramfs.testing "$KVERSION" || return 1
# 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
}
diff --git a/test/container/Dockerfile-Arch b/test/container/Dockerfile-Arch
index 922b8ede..ac1513a1 100644
--- a/test/container/Dockerfile-Arch
+++ b/test/container/Dockerfile-Arch
@@ -9,7 +9,7 @@ RUN echo 'export DRACUT_NO_XATTR=1 KVERSION=$(cd /lib/modules; ls -1 | tail -1)'
# Install needed packages for the dracut CI container
RUN pacman --noconfirm -Sy \
- linux dash strace dhclient asciidoc cpio pigz \
+ linux dash strace dhclient asciidoc cpio pigz squashfs-tools \
qemu btrfs-progs mdadm dmraid nfs-utils nfsidmap lvm2 nbd \
dhcp networkmanager multipath-tools vi tcpdump open-iscsi \
git shfmt shellcheck astyle which base-devel && yes | pacman -Scc


447
SOURCES/0019.patch

@ -1,28 +1,425 @@ @@ -1,28 +1,425 @@
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
From 8aa62b8cb28a41d4739633aee9b02e40dc4a75d0 Mon Sep 17 00:00:00 2001
From: Matt Coleman <matt@datto.com>
Date: Fri, 23 Sep 2022 19:28:25 -0400
Subject: [PATCH] feat(dmsquash-live): add new dmsquash-live-autooverlay module

Resolves: #2017787
---
modules.d/95resume/module-setup.sh | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
Adapt to test properly with the CentOS Stream 9 container too.

(cherry picked from commit a3c67d27e75223bb45df19f850d246ced9a09938)

Co-authored-by: Neal Gompa <ngompa@datto.com>

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
Resolves: #2135060
---
.github/workflows/integration.yml | 1 +
man/dracut.cmdline.7.asc | 4 +
.../create-overlay-genrules.sh | 10 ++
.../90dmsquash-live-autooverlay/create-overlay.sh | 119 +++++++++++++++++++++
.../90dmsquash-live-autooverlay/module-setup.sh | 25 +++++
pkgbuild/dracut.spec | 3 +-
test/TEST-16-DMSQUASH/create-root.sh | 12 ++-
test/TEST-16-DMSQUASH/test-init.sh | 6 ++
test/TEST-16-DMSQUASH/test.sh | 38 ++++++-
test/container/Dockerfile-Arch | 2 +-
test/container/Dockerfile-CentOS-9-Stream | 2 +
test/container/Dockerfile-Debian | 1 +
test/container/Dockerfile-Fedora-latest | 1 +
test/container/Dockerfile-OpenSuse-latest | 2 +-
14 files changed, 218 insertions(+), 8 deletions(-)

diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml
index 40da300c..c22bf916 100644
--- a/.github/workflows/integration.yml
+++ b/.github/workflows/integration.yml
@@ -98,6 +98,7 @@ jobs:
"11",
"12",
"13",
+ "16",
"17",
"20",
"21",
diff --git a/man/dracut.cmdline.7.asc b/man/dracut.cmdline.7.asc
index fda62fd1..40d13d83 100644
--- a/man/dracut.cmdline.7.asc
+++ b/man/dracut.cmdline.7.asc
@@ -1161,6 +1161,10 @@ rd.live.overlay=/dev/sdb1:persistent-overlay.img
rd.live.overlay=UUID=99440c1f-8daa-41bf-b965-b7240a8996f4
--
+**rd.live.overlay.cowfs=**__[btrfs|ext4|xfs]__::
+Specifies the filesystem to use when formatting the overlay partition.
+The default is ext4.
+
**rd.live.overlay.size=**__<size_MiB>__::
Specifies a non-persistent Device-mapper overlay size in MiB. The default is
_32768_.
diff --git a/modules.d/90dmsquash-live-autooverlay/create-overlay-genrules.sh b/modules.d/90dmsquash-live-autooverlay/create-overlay-genrules.sh
new file mode 100755
index 00000000..ed168d9f
--- /dev/null
+++ b/modules.d/90dmsquash-live-autooverlay/create-overlay-genrules.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# shellcheck disable=SC2154
+case "$root" in
+ live:/dev/*)
+ printf 'SYMLINK=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/create-overlay %s"\n' \
+ "${root#live:/dev/}" "${root#live:}" >> /etc/udev/rules.d/95-create-overlay.rules
+ wait_for_dev -n "${root#live:}"
+ ;;
+esac
diff --git a/modules.d/90dmsquash-live-autooverlay/create-overlay.sh b/modules.d/90dmsquash-live-autooverlay/create-overlay.sh
new file mode 100755
index 00000000..c89bda2b
--- /dev/null
+++ b/modules.d/90dmsquash-live-autooverlay/create-overlay.sh
@@ -0,0 +1,119 @@
+#!/bin/sh
+
+type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+
+if getargbool 0 rd.live.debug -n -y rdlivedebug; then
+ exec > /tmp/create-overlay.$$.out
+ exec 2>> /tmp/create-overlay.$$.out
+ set -x
+fi
+
+gatherData() {
+ overlay=$(getarg rd.live.overlay)
+ if [ -z "$overlay" ]; then
+ info "Skipping overlay creation: kernel command line parameter 'rd.live.overlay' is not set"
+ exit 0
+ fi
+ # shellcheck disable=SC2086
+ if ! str_starts ${overlay} LABEL=; then
+ die "Overlay creation failed: the partition must be set by LABEL in the 'rd.live.overlay' kernel parameter"
+ fi
+
+ overlayLabel=${overlay#LABEL=}
+ # shellcheck disable=SC2086
+ if [ -b /dev/disk/by-label/${overlayLabel} ]; then
+ info "Skipping overlay creation: overlay already exists"
+ exit 0
+ fi
+
+ filesystem=$(getarg rd.live.overlay.cowfs)
+ [ -z "$filesystem" ] && filesystem="ext4"
+ if [ "$filesystem" != "ext4" ] && [ "$filesystem" != "xfs" ] && [ "$filesystem" != "btrfs" ]; then
+ die "Overlay creation failed: only ext4, xfs, and btrfs are supported in the 'rd.live.overlay.cowfs' kernel parameter"
+ fi
+
+ live_dir=$(getarg rd.live.dir)
+ [ -z "$live_dir" ] && live_dir="LiveOS"
+
+ [ -z "$1" ] && exit 1
+ rootDevice=$1
+
+ # The kernel command line's 'root=' parameter was parsed into the $root variable by the dmsquash-live module.
+ # $root contains the path to a symlink within /dev/disk/by-label, which points to a partition.
+ # This script needs that partition's parent block device.
+ # shellcheck disable=SC2046
+ # shellcheck disable=SC2086
+ rootDeviceAbsolutePath=$(readlink -f ${rootDevice})
+ rootDeviceSysfsPath=/sys/class/block/${rootDeviceAbsolutePath##*/}
+ if [ -f "${rootDeviceSysfsPath}/partition" ]; then
+ # shellcheck disable=SC2086
+ partition=$(cat ${rootDeviceSysfsPath}/partition)
+ else
+ partition=0
+ fi
+ # shellcheck disable=SC2086
+ readonly=$(cat ${rootDeviceSysfsPath}/ro)
+ # shellcheck disable=SC2086
+ if [ "$partition" != "1" ] || [ "$readonly" != "0" ]; then
+ info "Skipping overlay creation: unpartitioned or read-only media detected"
+ exit 0
+ fi
+ # shellcheck disable=SC2046
+ # shellcheck disable=SC2086
+ fullDriveSysfsPath=$(readlink -f ${rootDeviceSysfsPath}/..)
+ blockDevice=/dev/${fullDriveSysfsPath##*/}
+ currentPartitionCount=$(grep --count -E "${blockDevice#/dev/}[0-9]+" /proc/partitions)
+
+ # shellcheck disable=SC2086
+ freeSpaceStart=$(parted --script ${blockDevice} unit % print free \
+ | awk -v x=${currentPartitionCount} '$1 == x {getline; print $1}')
+ if [ -z "$freeSpaceStart" ]; then
+ info "Skipping overlay creation: there is no free space after the last partition"
+ exit 0
+ fi
+ partitionStart=$((${freeSpaceStart%.*} + 1))
+ if [ $partitionStart -eq 100 ]; then
+ info "Skipping overlay creation: there is not enough free space after the last partition"
+ exit 0
+ fi
+
+ overlayPartition=${blockDevice}$((currentPartitionCount + 1))
+
+ label=$(blkid --match-tag LABEL --output value "$rootDevice")
+ uuid=$(blkid --match-tag UUID --output value "$rootDevice")
+ if [ -z "$label" ] || [ -z "$uuid" ]; then
+ die "Overlay creation failed: failed to look up root device label and UUID"
+ fi
+}
+
+createPartition() {
+ # shellcheck disable=SC2086
+ parted --script --align optimal ${blockDevice} mkpart primary ${partitionStart}% 100%
+}
+
+createFilesystem() {
+ # shellcheck disable=SC2086
+ mkfs.${filesystem} -L ${overlayLabel} ${overlayPartition}
+
+ baseDir=/run/initramfs/create-overlayfs
+ mkdir -p ${baseDir}
+ # shellcheck disable=SC2086
+ mount -t auto ${overlayPartition} ${baseDir}
+
+ mkdir -p ${baseDir}/${live_dir}/ovlwork
+ # shellcheck disable=SC2086
+ mkdir ${baseDir}/${live_dir}/overlay-${label}-${uuid}
+
+ umount ${baseDir}
+ rm -r ${baseDir}
+}
+
+main() {
+ gatherData "$1"
+ createPartition
+ udevsettle
+ createFilesystem
+ udevsettle
+}
+
+main "$1"
diff --git a/modules.d/90dmsquash-live-autooverlay/module-setup.sh b/modules.d/90dmsquash-live-autooverlay/module-setup.sh
new file mode 100755
index 00000000..c3712eba
--- /dev/null
+++ b/modules.d/90dmsquash-live-autooverlay/module-setup.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+check() {
+ # including a module dedicated to live environments in a host-only initrd doesn't make sense
+ [[ $hostonly ]] && return 1
+ return 255
+}
+
+depends() {
+ echo dmsquash-live
+ return 0
+}
+
+installkernel() {
+ instmods btrfs ext4 xfs
+}
+
+install() {
+ inst_multiple awk blkid cat grep mkdir mount parted readlink rmdir tr umount
+ inst_multiple -o mkfs.btrfs mkfs.ext4 mkfs.xfs
+ # shellcheck disable=SC2154
+ inst_hook pre-udev 25 "$moddir/create-overlay-genrules.sh"
+ inst_script "$moddir/create-overlay.sh" "/sbin/create-overlay"
+ dracut_need_initqueue
+}
diff --git a/pkgbuild/dracut.spec b/pkgbuild/dracut.spec
index 38de47b4..e148bbf7 100644
--- a/pkgbuild/dracut.spec
+++ b/pkgbuild/dracut.spec
@@ -138,7 +138,7 @@ Requires: %{name} >= %{version}-%{dist_free_release}
Requires: %{name} = %{version}-%{release}
%endif
Requires: %{name}-network = %{version}-%{release}
-Requires: tar gzip coreutils bash device-mapper curl
+Requires: tar gzip coreutils bash device-mapper curl parted
%if 0%{?fedora}
Requires: fuse ntfs-3g
%endif
@@ -461,6 +461,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
%files live
%{dracutlibdir}/modules.d/99img-lib
%{dracutlibdir}/modules.d/90dmsquash-live
+%{dracutlibdir}/modules.d/90dmsquash-live-autooverlay
%{dracutlibdir}/modules.d/90dmsquash-live-ntfs
%{dracutlibdir}/modules.d/90livenet
diff --git a/test/TEST-16-DMSQUASH/create-root.sh b/test/TEST-16-DMSQUASH/create-root.sh
index 9bc1aa5d..c11e17e0 100755
--- a/test/TEST-16-DMSQUASH/create-root.sh
+++ b/test/TEST-16-DMSQUASH/create-root.sh
@@ -11,9 +11,17 @@ udevadm control --reload
set -e
udevadm settle
-mkfs.ext4 -q -L dracut /dev/disk/by-id/ata-disk_root
+
+# create a single partition using 50% of the capacity of the image file created by test_setup() in test.sh
+sfdisk /dev/disk/by-id/ata-disk_root << EOF
+2048,161792
+EOF
+
+udevadm settle
+
+mkfs.ext4 -q -L dracut /dev/disk/by-id/ata-disk_root-part1
mkdir -p /root
-mount /dev/disk/by-id/ata-disk_root /root
+mount /dev/disk/by-id/ata-disk_root-part1 /root
mkdir -p /root/run /root/testdir
echo "Creating squashfs"
mksquashfs /source /root/testdir/rootfs.img -quiet
diff --git a/test/TEST-16-DMSQUASH/test-init.sh b/test/TEST-16-DMSQUASH/test-init.sh
index 068e8f38..959fa25f 100755
--- a/test/TEST-16-DMSQUASH/test-init.sh
+++ b/test/TEST-16-DMSQUASH/test-init.sh
@@ -9,6 +9,12 @@ exec > /dev/console 2>&1
echo "dracut-root-block-success" | dd oflag=direct,dsync of=/dev/disk/by-id/ata-disk_marker
+if grep -qF ' rd.live.overlay=LABEL=persist ' /proc/cmdline; then
+ # Writing to a file in the root filesystem lets test_run() verify that the autooverlay module successfully created
+ # and formatted the overlay partition and that the dmsquash-live module used it when setting up the rootfs overlay.
+ echo "dracut-autooverlay-success" > /overlay-marker
+fi
+
export TERM=linux
export PS1='initramfs-test:\w\$ '
[ -f /etc/mtab ] || ln -sfn /proc/mounts /etc/mtab
diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh
index 52029375..58d73b0d 100755
--- a/test/TEST-16-DMSQUASH/test.sh
+++ b/test/TEST-16-DMSQUASH/test.sh
@@ -5,8 +5,9 @@ TEST_DESCRIPTION="live root on a squash filesystem"
KVERSION="${KVERSION-$(uname -r)}"
-# Uncomment this to debug failures
-#DEBUGFAIL="rd.shell rd.debug loglevel=7"
+# Uncomment these to debug failures
+#DEBUGFAIL="rd.shell rd.debug rd.live.debug loglevel=7"
+#DEBUGTOOLS="setsid ls cat sfdisk"
test_run() {
dd if=/dev/zero of="$TESTDIR"/marker.img bs=1MiB count=1
@@ -23,6 +24,27 @@ test_run() {
-initrd "$TESTDIR"/initramfs.testing
grep -U --binary-files=binary -F -m 1 -q dracut-root-block-success -- "$TESTDIR"/marker.img || return 1
+
+ rootPartitions=$(sfdisk -d "$TESTDIR"/root.img | grep -c 'root\.img[0-9]')
+ [ "$rootPartitions" -eq 1 ] || return 1
+
+ "$testdir"/run-qemu \
+ "${disk_args[@]}" \
+ -boot order=d \
+ -append "rd.live.image rd.live.overlay.overlayfs=1 rd.live.overlay=LABEL=persist rd.live.dir=testdir root=LABEL=dracut console=ttyS0,115200n81 quiet selinux=0 rd.info rd.shell=0 panic=1 oops=panic softlockup_panic=1 $DEBUGFAIL" \
+ -initrd "$TESTDIR"/initramfs.testing-autooverlay
+
+ rootPartitions=$(sfdisk -d "$TESTDIR"/root.img | grep -c 'root\.img[0-9]')
+ [ "$rootPartitions" -eq 2 ] || return 1
+
+ (
+ # Ensure that this test works when run with the `V=1` parameter, which runs the script with `set -o pipefail`.
+ set +o pipefail
+
+ # Verify that the string "dracut-autooverlay-success" occurs in the second partition in the image file.
+ dd if="$TESTDIR"/root.img bs=1MiB skip=80 status=none \
+ | grep -U --binary-files=binary -F -m 1 -q dracut-autooverlay-success
+ ) || return 1
}
test_setup() {
@@ -49,7 +71,7 @@ test_setup() {
ln -s dracut-util "${initdir}/usr/bin/dracut-getarg"
ln -s dracut-util "${initdir}/usr/bin/dracut-getargs"
- inst_multiple mkdir ln dd stty mount poweroff
+ inst_multiple mkdir ln dd stty mount poweroff grep "$DEBUGTOOLS"
cp -a -- /etc/ld.so.conf* "$initdir"/etc
ldconfig -r "$initdir"
@@ -115,6 +137,16 @@ test_setup() {
--force "$TESTDIR"/initramfs.testing "$KVERSION" || return 1
ls -sh "$TESTDIR"/initramfs.testing
+
+ "$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \
+ --modules "dmsquash-live-autooverlay qemu" \
+ --omit "rngd" \
+ --drivers "ext4 sd_mod" \
+ --no-hostonly --no-hostonly-cmdline \
+ --force "$TESTDIR"/initramfs.testing-autooverlay "$KVERSION" || return 1
+
+ ls -sh "$TESTDIR"/initramfs.testing-autooverlay
+
rm -rf -- "$TESTDIR"/overlay
}
diff --git a/test/container/Dockerfile-Arch b/test/container/Dockerfile-Arch
index ac1513a1..4112cc5b 100644
--- a/test/container/Dockerfile-Arch
+++ b/test/container/Dockerfile-Arch
@@ -12,7 +12,7 @@ RUN pacman --noconfirm -Sy \
linux dash strace dhclient asciidoc cpio pigz squashfs-tools \
qemu btrfs-progs mdadm dmraid nfs-utils nfsidmap lvm2 nbd \
dhcp networkmanager multipath-tools vi tcpdump open-iscsi \
- git shfmt shellcheck astyle which base-devel && yes | pacman -Scc
+ git shfmt shellcheck astyle which base-devel glibc parted && yes | pacman -Scc
RUN useradd -m build
RUN su build -c 'cd && git clone https://aur.archlinux.org/perl-config-general.git && cd perl-config-general && makepkg -s --noconfirm'
diff --git a/test/container/Dockerfile-CentOS-9-Stream b/test/container/Dockerfile-CentOS-9-Stream
index c9a96020..abcc067e 100644
--- a/test/container/Dockerfile-CentOS-9-Stream
+++ b/test/container/Dockerfile-CentOS-9-Stream
@@ -33,8 +33,10 @@ RUN dnf -y install --enablerepo crb --setopt=install_weak_deps=False \
make \
mdadm \
nfs-utils \
+ parted \
pigz \
rpm-build \
+ squashfs-tools \
strace \
sudo \
tar \
diff --git a/test/container/Dockerfile-Debian b/test/container/Dockerfile-Debian
index b4c1704e..15eb9958 100644
--- a/test/container/Dockerfile-Debian
+++ b/test/container/Dockerfile-Debian
@@ -42,6 +42,7 @@ RUN apt-get update -y -qq && apt-get upgrade -y -qq && DEBIAN_FRONTEND=nonintera
network-manager \
nfs-common \
open-iscsi \
+ parted \
pigz \
pkg-config \
procps \
diff --git a/test/container/Dockerfile-Fedora-latest b/test/container/Dockerfile-Fedora-latest
index 87c749f9..a38a72ef 100644
--- a/test/container/Dockerfile-Fedora-latest
+++ b/test/container/Dockerfile-Fedora-latest
@@ -49,6 +49,7 @@ RUN dnf -y install --setopt=install_weak_deps=False \
which \
ShellCheck \
shfmt \
+ parted \
&& dnf -y update && dnf clean all
# Set default command
diff --git a/test/container/Dockerfile-OpenSuse-latest b/test/container/Dockerfile-OpenSuse-latest
index 637d50c6..9aaf07b1 100644
--- a/test/container/Dockerfile-OpenSuse-latest
+++ b/test/container/Dockerfile-OpenSuse-latest
@@ -13,7 +13,7 @@ RUN dnf -y install --setopt=install_weak_deps=False \
strace libkmod-devel gcc bzip2 xz tar wget rpm-build make git bash-completion \
sudo kernel dhcp-client qemu-kvm /usr/bin/qemu-system-$(uname -m) e2fsprogs \
tcpdump iproute iputils kbd NetworkManager btrfsprogs tgt dbus-broker \
- iscsiuio open-iscsi which ShellCheck procps pigz \
+ iscsiuio open-iscsi which ShellCheck procps pigz parted squashfs \
&& dnf -y update && dnf clean all
RUN shfmt_version=3.2.4; wget "https://github.com/mvdan/sh/releases/download/v${shfmt_version}/shfmt_v${shfmt_version}_linux_amd64" -O /usr/local/bin/shfmt \

63
SOURCES/0020.patch

@ -1,36 +1,39 @@ @@ -1,36 +1,39 @@
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
From 3e912f878de8d310bd06199e03602c63d2b60dba Mon Sep 17 00:00:00 2001
From: Radek Vykydal <rvykydal@redhat.com>
Date: Tue, 20 Dec 2022 16:40:23 +0100
Subject: [PATCH] fix(network-manager): allow running nm-run.sh multiple times

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
This partially reverts
https://github.com/redhat-plumbers/dracut-rhel9/commit/77630365aed201a729c73a9ffda0733a75f3fee4

because s390x KVM uses virtual devices and /sys/devices/qeth/*/online
doesn't exist. Eliminate this error by checking the existence
beforehand.
Anaconda needs to be able to run nm-run.sh to trigger online hooks again
after kickstart is fetched from storage and network is configured
accordingly.

(cherry picked from commit 6c71ba4121ae64ccd13fefba68ca327ac623810f)

Resolves: #2050570
rhel-only
Resolves: rhbz#2157082
---
modules.d/95qeth_rules/module-setup.sh | 1 +
1 file changed, 1 insertion(+)
modules.d/35network-manager/nm-run.sh | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

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() {
diff --git a/modules.d/35network-manager/nm-run.sh b/modules.d/35network-manager/nm-run.sh
index 7d8d61fa..6110733d 100755
--- a/modules.d/35network-manager/nm-run.sh
+++ b/modules.d/35network-manager/nm-run.sh
@@ -2,11 +2,12 @@
[[ $hostonly ]] && {
for i in /sys/devices/qeth/*/online; do
+ [ ! -f "$i" ] && continue
read -r _online < "$i"
[ "$_online" -eq 1 ] && return 0
done

type source_hook > /dev/null 2>&1 || . /lib/dracut-lib.sh
-if [ -e /tmp/nm.done ]; then
- return
-fi
-
if [ -z "$DRACUT_SYSTEMD" ]; then
+
+ if [ -e /tmp/nm.done ]; then
+ return
+ fi
+
# Only start NM if networking is needed
if [ -e /run/NetworkManager/initrd/neednet ]; then
for i in /usr/lib/NetworkManager/system-connections/* \

0
SOURCES/0021.patch

0
SOURCES/0022.patch

0
SOURCES/0023.patch

0
SOURCES/0024.patch

0
SOURCES/0025.patch

0
SOURCES/0026.patch

0
SOURCES/0027.patch

0
SOURCES/0028.patch

0
SOURCES/0029.patch

0
SOURCES/0030.patch

0
SOURCES/0031.patch

0
SOURCES/0032.patch

0
SOURCES/0033.patch

0
SOURCES/0034.patch

0
SOURCES/0035.patch

0
SOURCES/0036.patch

0
SOURCES/0037.patch

65
SPECS/dracut.spec

@ -5,10 +5,10 @@ @@ -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 38.git20220322
%define dist_free_release 21.git20230214

Name: dracut
Version: 055
Version: 057
Release: %{dist_free_release}%{?dist}

Summary: Initramfs generator using udev
@ -49,23 +49,6 @@ Patch17: 0017.patch @@ -49,23 +49,6 @@ 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
Patch30: 0030.patch
Patch31: 0031.patch
Patch32: 0032.patch
Patch33: 0033.patch
Patch34: 0034.patch
Patch35: 0035.patch
Patch36: 0036.patch
Patch37: 0037.patch

Source1: https://www.gnu.org/licenses/lgpl-2.1.txt

@ -176,7 +159,7 @@ Requires: %{name} >= %{version}-%{dist_free_release} @@ -176,7 +159,7 @@ Requires: %{name} >= %{version}-%{dist_free_release}
Requires: %{name} = %{version}-%{release}
%endif
Requires: %{name}-network = %{version}-%{release}
Requires: tar gzip coreutils bash device-mapper curl
Requires: tar gzip coreutils bash device-mapper curl parted
%if 0%{?fedora}
Requires: fuse ntfs-3g
%endif
@ -252,9 +235,6 @@ rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00dash @@ -252,9 +235,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
@ -363,6 +343,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ @@ -363,6 +343,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
@ -393,6 +374,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ @@ -393,6 +374,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
@ -407,6 +389,9 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ @@ -407,6 +389,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
@ -417,6 +402,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ @@ -417,6 +402,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
@ -470,6 +456,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ @@ -470,6 +456,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
@ -495,6 +482,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ @@ -495,6 +482,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
%files live
%{dracutlibdir}/modules.d/99img-lib
%{dracutlibdir}/modules.d/90dmsquash-live
%{dracutlibdir}/modules.d/90dmsquash-live-autooverlay
%{dracutlibdir}/modules.d/90dmsquash-live-ntfs
%{dracutlibdir}/modules.d/90livenet

@ -519,15 +507,28 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ @@ -519,15 +507,28 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
%{_prefix}/lib/kernel/install.d/51-dracut-rescue.install

%changelog
* Tue Mar 22 2022 Pavel Valena <pvalena@redhat.com> - 055-38.git20220322
- revert(lvm): remove snapshot feature
- revert(lvm): remove lvmetad config changes
- revert(lvm): remove 69-dm-lvm-metad.rules
- fix(lvm): replace --partial option
- feat(lvm): update lvm command options
- feat(lvm): use generated filter when none is set
- feat(lvm): only run lvchange for LV that is seen on devices
- fix(lvm): restore setting LVM_MD_PV_ACTIVATED
* Tue Feb 14 2023 Pavel Valena <pvalena@redhat.com> - 057-21.git20230214
- fix(network-manager): allow running nm-run.sh multiple times

* Tue Dec 13 2022 Pavel Valena <pvalena@redhat.com> - 057-20.git20221213
- refactor(url-lib): write curl output directly to file
- fix(dracut-initramfs-restore.sh): initramfs detection not
- fix(90kernel-modules): install blk modules using symbol
- fix(squash): build ld cache for squash loader
- test(16-DMSQUASH): make it pass on arch
- feat(dmsquash-live): add new dmsquash-live-autooverlay module

* Tue Aug 16 2022 Pavel Valena <pvalena@redhat.com> - 057-13.git20220816
- fix(kernel-modules): always include nvmem driver on
- fix(drm): add video drivers needed on hyper-v and similar
- fix(skipcpio): ignore broken pipe

* Thu Jul 21 2022 Pavel Valena <pvalena@redhat.com> - 057-10.git20220721
- fix(dracut.sh): do not fail on irregular files
- fix(98dracut-systemd): partly revert "emergency mode: use

* 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

Loading…
Cancel
Save