Toshaan Bharvani
2 years ago
commit
e81051b5bc
39 changed files with 4893 additions and 0 deletions
@ -0,0 +1,474 @@
@@ -0,0 +1,474 @@
|
||||
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 |
||||
|
||||
CI configuration |
||||
--- |
||||
.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(-) |
||||
|
||||
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/.packit.yml b/.packit.yml |
||||
index 482b4c4d..acc1f968 100644 |
||||
--- a/.packit.yml |
||||
+++ b/.packit.yml |
||||
@@ -1,55 +1,45 @@ |
||||
+--- |
||||
# 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 |
||||
+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_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 |
||||
+# 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 |
||||
- |
||||
+# 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 |
||||
+ |
||||
+# 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 |
||||
|
@ -0,0 +1,87 @@
@@ -0,0 +1,87 @@
|
||||
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 |
||||
|
||||
ci: drop the hardcoded repo owner name |
||||
--- |
||||
.github/workflows/container.yml | 6 +++--- |
||||
.github/workflows/integration.yml | 6 +++--- |
||||
.github/workflows/lint.yml | 4 ++-- |
||||
3 files changed, 8 insertions(+), 8 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 ] |
||||
|
||||
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 |
||||
|
||||
on: |
||||
push: |
||||
- branches: [ master ] |
||||
+ branches: [ main ] |
||||
pull_request: |
||||
- branches: [ master ] |
||||
+ branches: [ main ] |
||||
|
||||
jobs: |
||||
lint-c: |
||||
|
@ -0,0 +1,143 @@
@@ -0,0 +1,143 @@
|
||||
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 |
||||
|
||||
ci: add a CentOS 8 Stream job |
||||
--- |
||||
.github/workflows/container.yml | 1 + |
||||
.github/workflows/integration.yml | 41 ++++++++++++++++++++ |
||||
test/container/Dockerfile-CentOS-8-Stream | 63 +++++++++++++++++++++++++++++++ |
||||
3 files changed, 105 insertions(+) |
||||
|
||||
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: |
||||
|
||||
- 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"] |
||||
|
@ -0,0 +1,71 @@
@@ -0,0 +1,71 @@
|
||||
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 |
||||
|
||||
Bz1977347 |
||||
--- |
||||
dracut.sh | 7 +++++-- |
||||
modules.d/99squash/module-setup.sh | 8 ++++---- |
||||
2 files changed, 9 insertions(+), 6 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 |
||||
} |
||||
|
||||
|
@ -0,0 +1,25 @@
@@ -0,0 +1,25 @@
|
||||
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 |
||||
|
||||
fix(network-manager): don't pull in systemd-udev-settle |
||||
--- |
||||
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 |
||||
|
@ -0,0 +1,29 @@
@@ -0,0 +1,29 @@
|
||||
From 7d3226fe3462685a4a0ad6b8cbe704c9d08f4e77 Mon Sep 17 00:00:00 2001 |
||||
From: Lukas Nykryn <lnykryn@redhat.com> |
||||
Date: Thu, 12 Aug 2021 11:46:35 +0200 |
||||
Subject: [PATCH] fix(kernel-modules): add blk_mq_alloc_disk and |
||||
blk_cleanup_disk to blockfuncs |
||||
|
||||
Since kernel 5-14 those are used by many drivers for example: |
||||
xen-blkfront, loop, nbd, pd |
||||
|
||||
Cherry-picked from: rhel-only |
||||
Resolves: #1986909 |
||||
--- |
||||
modules.d/90kernel-modules/module-setup.sh | 2 +- |
||||
1 file changed, 1 insertion(+), 1 deletion(-) |
||||
|
||||
diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh |
||||
index 499fc066..36f8ca3c 100755 |
||||
--- a/modules.d/90kernel-modules/module-setup.sh |
||||
+++ b/modules.d/90kernel-modules/module-setup.sh |
||||
@@ -2,7 +2,7 @@ |
||||
|
||||
# called by dracut |
||||
installkernel() { |
||||
- local _blockfuncs='ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_add_host|scsi_add_host_with_dma' |
||||
+ local _blockfuncs='ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_add_host|scsi_add_host_with_dma|blk_mq_alloc_disk|blk_cleanup_disk' |
||||
local -A _hostonly_drvs |
||||
|
||||
find_kernel_modules_external() { |
||||
|
@ -0,0 +1,45 @@
@@ -0,0 +1,45 @@
|
||||
From 5f8012de4cb73b90d69075e8118d904302d41c20 Mon Sep 17 00:00:00 2001 |
||||
From: Beniamino Galvani <bgalvani@redhat.com> |
||||
Date: Mon, 9 Aug 2021 09:28:46 +0200 |
||||
Subject: [PATCH] fix(network-manager): check for nm-initrd-generator in both |
||||
/usr/{libexec,lib} |
||||
|
||||
Sice commit 22d6863ef1b2 ("fix(network-manager): cope with distributions not |
||||
using `libexec`") nm-initrd-generator can be installed in either /usr/libexec |
||||
or /usr/lib. Change other modules to check for the binary in both locations. |
||||
|
||||
(cherry picked from commit 5ee7e249b8cc74461122ccd7efe954b3402c23da) |
||||
|
||||
Resolves: #1975929 |
||||
--- |
||||
modules.d/40network/module-setup.sh | 2 +- |
||||
modules.d/80cms/cmsifup.sh | 2 +- |
||||
2 files changed, 2 insertions(+), 2 deletions(-) |
||||
|
||||
diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh |
||||
index 60824da6..9fd5d806 100755 |
||||
--- a/modules.d/40network/module-setup.sh |
||||
+++ b/modules.d/40network/module-setup.sh |
||||
@@ -19,7 +19,7 @@ depends() { |
||||
if [ -z "$network_handler" ]; then |
||||
if [[ -x $dracutsysrootdir$systemdsystemunitdir/wicked.service ]]; then |
||||
network_handler="network-wicked" |
||||
- elif [[ -x $dracutsysrootdir/usr/libexec/nm-initrd-generator ]]; then |
||||
+ elif [[ -x $dracutsysrootdir/usr/libexec/nm-initrd-generator ]] || [[ -x $dracutsysrootdir/usr/lib/nm-initrd-generator ]]; then |
||||
network_handler="network-manager" |
||||
elif [[ -x $dracutsysrootdir$systemdutildir/systemd-networkd ]]; then |
||||
network_handler="systemd-networkd" |
||||
diff --git a/modules.d/80cms/cmsifup.sh b/modules.d/80cms/cmsifup.sh |
||||
index a319227a..73d76fbf 100755 |
||||
--- a/modules.d/80cms/cmsifup.sh |
||||
+++ b/modules.d/80cms/cmsifup.sh |
||||
@@ -34,7 +34,7 @@ fi |
||||
IFACES="$IFACES $DEVICE" |
||||
echo "$IFACES" >> /tmp/net.ifaces |
||||
|
||||
-if [ -x /usr/libexec/nm-initrd-generator ]; then |
||||
+if [ -x /usr/libexec/nm-initrd-generator ] || [ -x /usr/lib/nm-initrd-generator ]; then |
||||
type nm_generate_connections > /dev/null 2>&1 || . /lib/nm-lib.sh |
||||
nm_generate_connections |
||||
else |
||||
|
@ -0,0 +1,43 @@
@@ -0,0 +1,43 @@
|
||||
From aa561847a82c2446ead5e41742f453629f112b63 Mon Sep 17 00:00:00 2001 |
||||
From: Beniamino Galvani <bgalvani@redhat.com> |
||||
Date: Wed, 4 Aug 2021 09:37:31 +0200 |
||||
Subject: [PATCH] fix(cms): reload NetworkManager connections |
||||
|
||||
When NetworkManager is running as systemd service, it's not enough to write |
||||
connection files; the module should also tell NetworkManager to reload the |
||||
connections from disk so that any new connection can be auto-activated. |
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1975929 |
||||
(cherry picked from commit 07977ee5c5294a5d30c1f33f292a0b31303750fb) |
||||
|
||||
Resolves: #1975929 |
||||
--- |
||||
modules.d/35network-manager/nm-lib.sh | 4 ++++ |
||||
modules.d/80cms/cmsifup.sh | 1 + |
||||
2 files changed, 5 insertions(+) |
||||
|
||||
diff --git a/modules.d/35network-manager/nm-lib.sh b/modules.d/35network-manager/nm-lib.sh |
||||
index 2d27e079..1f749587 100644 |
||||
--- a/modules.d/35network-manager/nm-lib.sh |
||||
+++ b/modules.d/35network-manager/nm-lib.sh |
||||
@@ -28,3 +28,7 @@ nm_generate_connections() { |
||||
done |
||||
fi |
||||
} |
||||
+ |
||||
+nm_reload_connections() { |
||||
+ [ -n "$DRACUT_SYSTEMD" ] && systemctl is-active nm-initrd.service && nmcli connection reload |
||||
+} |
||||
diff --git a/modules.d/80cms/cmsifup.sh b/modules.d/80cms/cmsifup.sh |
||||
index 73d76fbf..285e20d1 100755 |
||||
--- a/modules.d/80cms/cmsifup.sh |
||||
+++ b/modules.d/80cms/cmsifup.sh |
||||
@@ -37,6 +37,7 @@ echo "$IFACES" >> /tmp/net.ifaces |
||||
if [ -x /usr/libexec/nm-initrd-generator ] || [ -x /usr/lib/nm-initrd-generator ]; then |
||||
type nm_generate_connections > /dev/null 2>&1 || . /lib/nm-lib.sh |
||||
nm_generate_connections |
||||
+ nm_reload_connections |
||||
else |
||||
exec ifup "$DEVICE" |
||||
fi |
||||
|
@ -0,0 +1,42 @@
@@ -0,0 +1,42 @@
|
||||
From 058ffa90669a4dbd2af16e025f22312408ed4ba9 Mon Sep 17 00:00:00 2001 |
||||
From: Lukas Nykryn <lnykryn@redhat.com> |
||||
Date: Tue, 24 Aug 2021 15:39:25 +0200 |
||||
Subject: [PATCH] 95resume: always install this module |
||||
|
||||
We can't always correctly decide if the resume module is needed. |
||||
So let's play safe and always include it. |
||||
|
||||
see: https://github.com/dracutdevs/dracut/issues/924 |
||||
|
||||
RHEL-only |
||||
|
||||
Resolves: #1926544 |
||||
--- |
||||
modules.d/95resume/module-setup.sh | 14 -------------- |
||||
1 file changed, 14 deletions(-) |
||||
|
||||
diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh |
||||
index f0507b13..4f68e947 100755 |
||||
--- a/modules.d/95resume/module-setup.sh |
||||
+++ b/modules.d/95resume/module-setup.sh |
||||
@@ -2,20 +2,6 @@ |
||||
|
||||
# called by dracut |
||||
check() { |
||||
- swap_on_netdevice() { |
||||
- local _dev |
||||
- for _dev in "${swap_devs[@]}"; do |
||||
- block_is_netdevice "$_dev" && return 0 |
||||
- done |
||||
- return 1 |
||||
- } |
||||
- |
||||
- # Only support resume if hibernation is currently on |
||||
- # and no swap is mounted on a net device |
||||
- [[ $hostonly ]] || [[ $mount_needs ]] && { |
||||
- swap_on_netdevice || [[ "$(cat /sys/power/resume)" == "0:0" ]] && return 255 |
||||
- } |
||||
- |
||||
return 0 |
||||
} |
||||
|
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
From 324e6ba13d8abef22c636e64ad0cbd8018704c93 Mon Sep 17 00:00:00 2001 |
||||
From: Frantisek Sumsal <frantisek@sumsal.cz> |
||||
Date: Tue, 9 Nov 2021 12:39:19 +0100 |
||||
Subject: [PATCH] ci: use C9S chroots for Packit/TFT |
||||
|
||||
--- |
||||
.packit.yml | 11 +++-------- |
||||
1 file changed, 3 insertions(+), 8 deletions(-) |
||||
|
||||
diff --git a/.packit.yml b/.packit.yml |
||||
index acc1f968..1b1809ab 100644 |
||||
--- a/.packit.yml |
||||
+++ b/.packit.yml |
||||
@@ -29,17 +29,12 @@ jobs: |
||||
trigger: pull_request |
||||
metadata: |
||||
targets: |
||||
- - epel-8-x86_64 |
||||
- - epel-8-aarch64 |
||||
- # FIXME: change to CentOS 9 once it's available |
||||
- - fedora-34-x86_64 |
||||
- - fedora-34-aarch64 |
||||
- - fedora-34-s390x |
||||
+ - centos-stream-9-x86_64 |
||||
+ - centos-stream-9-aarch64 |
||||
|
||||
# Run tests (via testing farm) |
||||
- job: tests |
||||
trigger: pull_request |
||||
metadata: |
||||
targets: |
||||
- # FIXME: change to CentOS 9 once it's available |
||||
- - fedora-34-x86_64 |
||||
+ - centos-stream-9-x86_64 |
||||
|
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
From 816891a11e3a3b4a792b68257eff4af7df411064 Mon Sep 17 00:00:00 2001 |
||||
From: Frantisek Sumsal <frantisek@sumsal.cz> |
||||
Date: Tue, 9 Nov 2021 12:45:47 +0100 |
||||
Subject: [PATCH] ci: drop patches from the C9S spec before using it |
||||
|
||||
--- |
||||
.packit.yml | 2 ++ |
||||
1 file changed, 2 insertions(+) |
||||
|
||||
diff --git a/.packit.yml b/.packit.yml |
||||
index 1b1809ab..dd3a1fa6 100644 |
||||
--- a/.packit.yml |
||||
+++ b/.packit.yml |
||||
@@ -21,6 +21,8 @@ actions: |
||||
- "git clone https://gitlab.com/redhat/centos-stream/rpms/dracut .packit_rpm --depth=1" |
||||
# Drop the "sources" file so rebase-helper doesn't think we're a dist-git$ |
||||
- "rm -fv .packit_rpm/sources" |
||||
+ # Drop all patches (since they're already applied in this repository) |
||||
+ - "sed -ri '/^Patch[0-9]+:/d' .packit_rpm/dracut.spec" |
||||
|
||||
# Available targets can be listed via `copr-cli list-chroots` |
||||
jobs: |
||||
|
@ -0,0 +1,88 @@
@@ -0,0 +1,88 @@
|
||||
From d19ca83f909ed695f199aa688406f62e3eecadcd Mon Sep 17 00:00:00 2001 |
||||
From: Frantisek Sumsal <frantisek@sumsal.cz> |
||||
Date: Tue, 9 Nov 2021 16:01:51 +0100 |
||||
Subject: [PATCH] ci: bump C8 jobs to C9S |
||||
|
||||
rhel-only |
||||
--- |
||||
.github/workflows/container.yml | 2 +- |
||||
.github/workflows/integration.yml | 4 ++-- |
||||
...ockerfile-CentOS-8-Stream => Dockerfile-CentOS-9-Stream} | 13 ++----------- |
||||
3 files changed, 5 insertions(+), 14 deletions(-) |
||||
|
||||
diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml |
||||
index a8b3f9b8..adcec4f6 100644 |
||||
--- a/.github/workflows/container.yml |
||||
+++ b/.github/workflows/container.yml |
||||
@@ -33,7 +33,7 @@ jobs: |
||||
- { dockerfile: 'Dockerfile-Fedora-rawhide', tag: 'fedora:rawhide' } |
||||
- { dockerfile: 'Dockerfile-OpenSuse-latest', tag: 'opensuse:latest' } |
||||
- { dockerfile: 'Dockerfile-Arch', tag: 'arch:latest' } |
||||
- - { dockerfile: 'Dockerfile-CentOS-8-Stream', tag: 'centos:stream8' } |
||||
+ - { dockerfile: 'Dockerfile-CentOS-9-Stream', tag: 'centos:stream9' } |
||||
steps: |
||||
- name: Check out the repo |
||||
uses: actions/checkout@v2 |
||||
diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml |
||||
index 9ea718f1..990dd079 100644 |
||||
--- a/.github/workflows/integration.yml |
||||
+++ b/.github/workflows/integration.yml |
||||
@@ -79,7 +79,7 @@ jobs: |
||||
|
||||
- name: "${{ matrix.container }} TEST-${{ matrix.test }}" |
||||
run: ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }} |
||||
- centos-8-stream: |
||||
+ centos-9-stream: |
||||
runs-on: ubuntu-latest |
||||
timeout-minutes: 45 |
||||
concurrency: |
||||
@@ -88,7 +88,7 @@ jobs: |
||||
strategy: |
||||
matrix: |
||||
container: [ |
||||
- "centos:stream8", |
||||
+ "centos:stream9", |
||||
] |
||||
# Disabled tests (due to dropped packages in RHEL/CentOS): |
||||
# 03, 04, 15: requires btrfs |
||||
diff --git a/test/container/Dockerfile-CentOS-8-Stream b/test/container/Dockerfile-CentOS-9-Stream |
||||
similarity index 65% |
||||
rename from test/container/Dockerfile-CentOS-8-Stream |
||||
rename to test/container/Dockerfile-CentOS-9-Stream |
||||
index b14cc64a..da94f134 100644 |
||||
--- a/test/container/Dockerfile-CentOS-8-Stream |
||||
+++ b/test/container/Dockerfile-CentOS-9-Stream |
||||
@@ -1,4 +1,4 @@ |
||||
-FROM quay.io/centos/centos:stream8 |
||||
+FROM quay.io/centos/centos:stream9 |
||||
|
||||
MAINTAINER https://github.com/dracutdevs/dracut |
||||
|
||||
@@ -7,17 +7,8 @@ LABEL RUN="docker run -it --name NAME --privileged --ipc=host --net=host --pid=h |
||||
|
||||
RUN echo 'export DRACUT_NO_XATTR=1 KVERSION=$(cd /lib/modules; ls -1 | tail -1)' > /etc/profile.d/dracut-test.sh |
||||
|
||||
-# FIXME: the mirrors were desynchronized at the time of writing, leading to several |
||||
-# conflicts when installing dependencies below |
||||
-RUN sed -i -e 's/^mirrorlist=/#mirrorlist=/g' -e 's/^#baseurl=/baseurl=/g' /etc/yum.repos.d/*.repo |
||||
- |
||||
# Install needed packages for the dracut CI container |
||||
RUN dnf -y install epel-release && \ |
||||
- `# FIXME: this is required to work around a bug in e2fsprogs, remove when CentOS 8.5 is out` && \ |
||||
- dnf -y install dnf-plugins-core && \ |
||||
- dnf -y copr enable mrc0mmand/systemd-centos-ci-centos8 && \ |
||||
- dnf -y install e2fsprogs && \ |
||||
- `# End of FIXME` && \ |
||||
dnf -y install --enablerepo powertools --enablerepo epel --setopt=install_weak_deps=False \ |
||||
qemu-kvm \ |
||||
NetworkManager \ |
||||
@@ -54,7 +45,7 @@ RUN dnf -y install epel-release && \ |
||||
xz \ |
||||
&& dnf -y update && dnf clean all |
||||
|
||||
-# CentOS 8 ships only qemu-kvm, but it disables the KVM accel when it's not |
||||
+# C9S ships only qemu-kvm, but it disables the KVM accel when it's not |
||||
# available |
||||
RUN ln -sv /usr/libexec/qemu-kvm /usr/bin/qemu-kvm && \ |
||||
ln -sv /usr/libexec/qemu-kvm /usr/bin/qemu-system-$(uname -m) |
||||
|
@ -0,0 +1,27 @@
@@ -0,0 +1,27 @@
|
||||
From cc4e8d16b743b8b720b502174df7c934a2d5c5dc Mon Sep 17 00:00:00 2001 |
||||
From: Frantisek Sumsal <frantisek@sumsal.cz> |
||||
Date: Tue, 9 Nov 2021 16:40:17 +0100 |
||||
Subject: [PATCH] ci: drop `epel-release` |
||||
|
||||
since it's not available (yet) for C9S. |
||||
|
||||
rhel-only |
||||
--- |
||||
test/container/Dockerfile-CentOS-9-Stream | 3 +-- |
||||
1 file changed, 1 insertion(+), 2 deletions(-) |
||||
|
||||
diff --git a/test/container/Dockerfile-CentOS-9-Stream b/test/container/Dockerfile-CentOS-9-Stream |
||||
index da94f134..3f643e88 100644 |
||||
--- a/test/container/Dockerfile-CentOS-9-Stream |
||||
+++ b/test/container/Dockerfile-CentOS-9-Stream |
||||
@@ -8,8 +8,7 @@ LABEL RUN="docker run -it --name NAME --privileged --ipc=host --net=host --pid=h |
||||
RUN echo 'export DRACUT_NO_XATTR=1 KVERSION=$(cd /lib/modules; ls -1 | tail -1)' > /etc/profile.d/dracut-test.sh |
||||
|
||||
# Install needed packages for the dracut CI container |
||||
-RUN dnf -y install epel-release && \ |
||||
- dnf -y install --enablerepo powertools --enablerepo epel --setopt=install_weak_deps=False \ |
||||
+RUN dnf -y install --enablerepo powertools --setopt=install_weak_deps=False \ |
||||
qemu-kvm \ |
||||
NetworkManager \ |
||||
asciidoc \ |
||||
|
@ -0,0 +1,24 @@
@@ -0,0 +1,24 @@
|
||||
From 33170038ddc5affa14e9464337983cfad033b8a4 Mon Sep 17 00:00:00 2001 |
||||
From: Frantisek Sumsal <frantisek@sumsal.cz> |
||||
Date: Tue, 9 Nov 2021 16:46:31 +0100 |
||||
Subject: [PATCH] ci: the PowerTools repo was renamed back to CRB in C9S |
||||
|
||||
rhel-only |
||||
--- |
||||
test/container/Dockerfile-CentOS-9-Stream | 2 +- |
||||
1 file changed, 1 insertion(+), 1 deletion(-) |
||||
|
||||
diff --git a/test/container/Dockerfile-CentOS-9-Stream b/test/container/Dockerfile-CentOS-9-Stream |
||||
index 3f643e88..9d0e81e3 100644 |
||||
--- a/test/container/Dockerfile-CentOS-9-Stream |
||||
+++ b/test/container/Dockerfile-CentOS-9-Stream |
||||
@@ -8,7 +8,7 @@ LABEL RUN="docker run -it --name NAME --privileged --ipc=host --net=host --pid=h |
||||
RUN echo 'export DRACUT_NO_XATTR=1 KVERSION=$(cd /lib/modules; ls -1 | tail -1)' > /etc/profile.d/dracut-test.sh |
||||
|
||||
# Install needed packages for the dracut CI container |
||||
-RUN dnf -y install --enablerepo powertools --setopt=install_weak_deps=False \ |
||||
+RUN dnf -y install --enablerepo crb --setopt=install_weak_deps=False \ |
||||
qemu-kvm \ |
||||
NetworkManager \ |
||||
asciidoc \ |
||||
|
@ -0,0 +1,41 @@
@@ -0,0 +1,41 @@
|
||||
From d8f6162d3d86c81744c5f2c8215959aac3a2f9e9 Mon Sep 17 00:00:00 2001 |
||||
From: Frantisek Sumsal <frantisek@sumsal.cz> |
||||
Date: Tue, 9 Nov 2021 17:13:37 +0100 |
||||
Subject: [PATCH] ci: temporarily use an F34 dash package until C9S EPEL is |
||||
available |
||||
|
||||
rhel-only |
||||
--- |
||||
test/container/Dockerfile-CentOS-9-Stream | 4 ++-- |
||||
1 file changed, 2 insertions(+), 2 deletions(-) |
||||
|
||||
diff --git a/test/container/Dockerfile-CentOS-9-Stream b/test/container/Dockerfile-CentOS-9-Stream |
||||
index 9d0e81e3..c9a96020 100644 |
||||
--- a/test/container/Dockerfile-CentOS-9-Stream |
||||
+++ b/test/container/Dockerfile-CentOS-9-Stream |
||||
@@ -8,14 +8,15 @@ LABEL RUN="docker run -it --name NAME --privileged --ipc=host --net=host --pid=h |
||||
RUN echo 'export DRACUT_NO_XATTR=1 KVERSION=$(cd /lib/modules; ls -1 | tail -1)' > /etc/profile.d/dracut-test.sh |
||||
|
||||
# Install needed packages for the dracut CI container |
||||
+# FIXME: properly re-add dash once C9S EPEL is available |
||||
RUN dnf -y install --enablerepo crb --setopt=install_weak_deps=False \ |
||||
+ http://mirrors.kernel.org/fedora/releases/34/Everything/x86_64/os/Packages/d/dash-0.5.10.2-8.fc34.x86_64.rpm \ |
||||
qemu-kvm \ |
||||
NetworkManager \ |
||||
asciidoc \ |
||||
bash-completion \ |
||||
bzip2 \ |
||||
cryptsetup \ |
||||
- dash \ |
||||
dbus-daemon \ |
||||
dhcp-client \ |
||||
dhcp-server \ |
||||
@@ -33,7 +34,6 @@ RUN dnf -y install --enablerepo crb --setopt=install_weak_deps=False \ |
||||
mdadm \ |
||||
nfs-utils \ |
||||
pigz \ |
||||
- python3-imgcreate \ |
||||
rpm-build \ |
||||
strace \ |
||||
sudo \ |
||||
|
@ -0,0 +1,59 @@
@@ -0,0 +1,59 @@
|
||||
From 6e304517801fdfb58df582e37cd4df04b5adc1b6 Mon Sep 17 00:00:00 2001 |
||||
From: Frantisek Sumsal <frantisek@sumsal.cz> |
||||
Date: Fri, 12 Nov 2021 21:43:12 +0100 |
||||
Subject: [PATCH] test: don't use `-cpu max` in GH Actions |
||||
|
||||
There appears to be an issue with newer QEMU versions (spotted with Arch |
||||
Linux and C9S containers) which causes the respective GH Action to hang |
||||
when booting a QEMU VM in combination with the `-cpu max` parameter. |
||||
|
||||
During (a particularly painful) debugging session I once managed to get |
||||
some output from such "frozen" machine (using `earlycon` and |
||||
`earlyprintk` kernel cmdline options), and in that particular case the |
||||
VM died with a trap caused by an invalid opcode. |
||||
|
||||
I couldn't reproduce this locally, only in GH Actions environment with |
||||
Arch Linux and C9S containers. Also, so far I haven't found out which |
||||
specific CPUID flag causes this, but using the `IvyBridge-v2` feature |
||||
set seems to mitigate the issue. |
||||
|
||||
(cherry picked from commit 3f56d481e8a3c67c2e795686e6ec3bfc4ea08e1d) |
||||
--- |
||||
test/run-qemu | 5 +++-- |
||||
tools/test-github.sh | 1 + |
||||
2 files changed, 4 insertions(+), 2 deletions(-) |
||||
|
||||
diff --git a/test/run-qemu b/test/run-qemu |
||||
index 3c521a14..5dc61037 100755 |
||||
--- a/test/run-qemu |
||||
+++ b/test/run-qemu |
||||
@@ -3,13 +3,14 @@ |
||||
# We prefer kvm, kqemu, userspace in that order. |
||||
|
||||
export PATH=/usr/sbin:/usr/bin:/sbin:/bin |
||||
+QEMU_CPU="${QEMU_CPU:-max}" |
||||
|
||||
-[[ -x /usr/bin/qemu ]] && BIN=/usr/bin/qemu && ARGS=(-cpu max) |
||||
+[[ -x /usr/bin/qemu ]] && BIN=/usr/bin/qemu && ARGS=(-cpu "$QEMU_CPU") |
||||
(lsmod | grep -q '^kqemu ') && BIN=/usr/bin/qemu && ARGS=(-kernel-kqemu -cpu host) |
||||
[[ -c /dev/kvm && -x /usr/bin/kvm ]] && BIN=/usr/bin/kvm && ARGS=(-cpu host) |
||||
[[ -c /dev/kvm && -x /usr/bin/qemu-kvm ]] && BIN=/usr/bin/qemu-kvm && ARGS=(-cpu host) |
||||
[[ -c /dev/kvm && -x /usr/libexec/qemu-kvm ]] && BIN=/usr/libexec/qemu-kvm && ARGS=(-cpu host) |
||||
-[[ -x /usr/bin/qemu-system-$(uname -m) ]] && BIN=/usr/bin/qemu-system-$(uname -m) && ARGS=(-cpu max) |
||||
+[[ -x /usr/bin/qemu-system-$(uname -m) ]] && BIN=/usr/bin/qemu-system-$(uname -m) && ARGS=(-cpu "$QEMU_CPU") |
||||
[[ -c /dev/kvm && -x /usr/bin/qemu-system-$(uname -m) ]] && BIN=/usr/bin/qemu-system-$(uname -m) && ARGS=(-enable-kvm -cpu host) |
||||
|
||||
[[ $BIN ]] || { |
||||
diff --git a/tools/test-github.sh b/tools/test-github.sh |
||||
index eab59dcc..1d61b8e3 100755 |
||||
--- a/tools/test-github.sh |
||||
+++ b/tools/test-github.sh |
||||
@@ -41,6 +41,7 @@ else |
||||
cd /lib/modules |
||||
ls -1 | tail -1 |
||||
)" \ |
||||
+ QEMU_CPU="IvyBridge-v2" \ |
||||
DRACUT_NO_XATTR=1 \ |
||||
TEST_RUN_ID="$RUN_ID" \ |
||||
${TESTS:+TESTS="$TESTS"} \ |
||||
|
@ -0,0 +1,41 @@
@@ -0,0 +1,41 @@
|
||||
From cecc1fbae879c189739691ecff3df67d20b0899a Mon Sep 17 00:00:00 2001 |
||||
From: =?UTF-8?q?Renaud=20M=C3=A9trich?= <rmetrich@redhat.com> |
||||
Date: Tue, 16 Nov 2021 11:15:52 +0100 |
||||
Subject: [PATCH] fix(shutdown): be robust against forced shutdown |
||||
|
||||
When a forced shutdown is issued through sending a burst of Ctrl-Alt-Del |
||||
keys, systemd sends SIGTERM to all processes. This ends up killing |
||||
dracut-initramfs-restore as well, preventing the script from detecting |
||||
that the unpack of the initramfs is incomplete, which later causes a |
||||
crash to happen when "shutdown" tries to execute from the unpacked |
||||
initramfs. |
||||
|
||||
This fix makes sure dracut-initramfs-restore remains alive to detect |
||||
the unpack failed (because cpio was killed by systemd too). |
||||
|
||||
Refs: |
||||
* https://bugzilla.redhat.com/show_bug.cgi?id=2023665 |
||||
(cherry picked from commit b9ba3c8bb8f0f1328cd1ffaa8dbf64585b28c474) |
||||
|
||||
Resolves: #2024502 |
||||
--- |
||||
dracut-initramfs-restore.sh | 5 +++++ |
||||
1 file changed, 5 insertions(+) |
||||
|
||||
diff --git a/dracut-initramfs-restore.sh b/dracut-initramfs-restore.sh |
||||
index abe6b1e2..d97030a3 100644 |
||||
--- a/dracut-initramfs-restore.sh |
||||
+++ b/dracut-initramfs-restore.sh |
||||
@@ -6,6 +6,11 @@ set -e |
||||
[ -e /run/initramfs/bin/sh ] && exit 0 |
||||
[ -e /run/initramfs/.need_shutdown ] || exit 0 |
||||
|
||||
+# SIGTERM signal is received upon forced shutdown: ignore the signal |
||||
+# We want to remain alive to be able to trap unpacking errors to avoid |
||||
+# switching root to an incompletely unpacked initramfs |
||||
+trap 'echo "Received SIGTERM signal, ignoring!" >&2' TERM |
||||
+ |
||||
KERNEL_VERSION="$(uname -r)" |
||||
|
||||
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut |
||||
|
@ -0,0 +1,38 @@
@@ -0,0 +1,38 @@
|
||||
From 9e17bed7c0f30f6c557f837592772522c384779b Mon Sep 17 00:00:00 2001 |
||||
From: Lukas Nykryn <lnykryn@redhat.com> |
||||
Date: Tue, 15 Feb 2022 13:44:16 +0100 |
||||
Subject: [PATCH] Revert "95resume: always install this module" |
||||
|
||||
This reverts commit 058ffa90669a4dbd2af16e025f22312408ed4ba9. |
||||
|
||||
Resolves: #2017787 |
||||
--- |
||||
modules.d/95resume/module-setup.sh | 14 ++++++++++++++ |
||||
1 file changed, 14 insertions(+) |
||||
|
||||
diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh |
||||
index 4f68e947..f0507b13 100755 |
||||
--- a/modules.d/95resume/module-setup.sh |
||||
+++ b/modules.d/95resume/module-setup.sh |
||||
@@ -2,6 +2,20 @@ |
||||
|
||||
# called by dracut |
||||
check() { |
||||
+ swap_on_netdevice() { |
||||
+ local _dev |
||||
+ for _dev in "${swap_devs[@]}"; do |
||||
+ block_is_netdevice "$_dev" && return 0 |
||||
+ done |
||||
+ return 1 |
||||
+ } |
||||
+ |
||||
+ # Only support resume if hibernation is currently on |
||||
+ # and no swap is mounted on a net device |
||||
+ [[ $hostonly ]] || [[ $mount_needs ]] && { |
||||
+ swap_on_netdevice || [[ "$(cat /sys/power/resume)" == "0:0" ]] && return 255 |
||||
+ } |
||||
+ |
||||
return 0 |
||||
} |
||||
|
||||
|
@ -0,0 +1,28 @@
@@ -0,0 +1,28 @@
|
||||
From 8b1252ce33d45340a3420568c66790fb53b14d0a Mon Sep 17 00:00:00 2001 |
||||
From: Lukas Nykryn <lnykryn@redhat.com> |
||||
Date: Tue, 15 Feb 2022 13:47:40 +0100 |
||||
Subject: [PATCH] 95resume: only exclude this module, when swap is netdev |
||||
|
||||
Resolves: #2017787 |
||||
--- |
||||
modules.d/95resume/module-setup.sh | 5 ++--- |
||||
1 file changed, 2 insertions(+), 3 deletions(-) |
||||
|
||||
diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh |
||||
index f0507b13..ccf2493f 100755 |
||||
--- a/modules.d/95resume/module-setup.sh |
||||
+++ b/modules.d/95resume/module-setup.sh |
||||
@@ -10,10 +10,9 @@ check() { |
||||
return 1 |
||||
} |
||||
|
||||
- # Only support resume if hibernation is currently on |
||||
- # and no swap is mounted on a net device |
||||
+ # Only support resume if no swap is mounted on a net device |
||||
[[ $hostonly ]] || [[ $mount_needs ]] && { |
||||
- swap_on_netdevice || [[ "$(cat /sys/power/resume)" == "0:0" ]] && return 255 |
||||
+ swap_on_netdevice && return 255 |
||||
} |
||||
|
||||
return 0 |
||||
|
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
From eff17c61ba358d03461b62c95ef593e3b8d65e26 Mon Sep 17 00:00:00 2001 |
||||
From: Coiby Xu <coxu@redhat.com> |
||||
Date: Wed, 14 Jul 2021 15:26:10 +0800 |
||||
Subject: [PATCH] fix(qeth_rules): check the existence of |
||||
/sys/devices/qeth/*/online beforehand |
||||
|
||||
On s390x KVM machines, the follow errors occurred, |
||||
$ kdumpctl rebuild |
||||
kdump: Rebuilding /boot/initramfs-4.18.0-321.el8.s390xkdump.img |
||||
/usr/lib/dracut/modules.d/95qeth_rules/module-setup.sh: line 13: /sys/devices/qeth/*/online: No such file or directory |
||||
/usr/lib/dracut/modules.d/95qeth_rules/module-setup.sh: line 13: /sys/devices/qeth/*/online: No such file or directory |
||||
|
||||
because s390x KVM uses virtual devices and /sys/devices/qeth/*/online |
||||
doesn't exist. Eliminate this error by checking the existence |
||||
beforehand. |
||||
|
||||
(cherry picked from commit 6c71ba4121ae64ccd13fefba68ca327ac623810f) |
||||
|
||||
Resolves: #2050570 |
||||
--- |
||||
modules.d/95qeth_rules/module-setup.sh | 1 + |
||||
1 file changed, 1 insertion(+) |
||||
|
||||
diff --git a/modules.d/95qeth_rules/module-setup.sh b/modules.d/95qeth_rules/module-setup.sh |
||||
index 914a28ce..884ae072 100755 |
||||
--- a/modules.d/95qeth_rules/module-setup.sh |
||||
+++ b/modules.d/95qeth_rules/module-setup.sh |
||||
@@ -10,6 +10,7 @@ check() { |
||||
|
||||
[[ $hostonly ]] && { |
||||
for i in /sys/devices/qeth/*/online; do |
||||
+ [ ! -f "$i" ] && continue |
||||
read -r _online < "$i" |
||||
[ "$_online" -eq 1 ] && return 0 |
||||
done |
||||
|
@ -0,0 +1,85 @@
@@ -0,0 +1,85 @@
|
||||
From a0d8caa8090a78f627f26fcd9b47c4b099cbc1ba Mon Sep 17 00:00:00 2001 |
||||
From: Jonathan Lebon <jonathan@jlebon.com> |
||||
Date: Thu, 17 Jun 2021 10:47:33 -0400 |
||||
Subject: [PATCH] fix(fips): handle s390x OSTree systems |
||||
|
||||
On s390x, the `BOOT_IMAGE` karg injected by the bootloader is not a path |
||||
to the kernel image, but rather an integer describing the index of the |
||||
menu entry selected. Because of the way the s390x bootloader works, |
||||
there is no information retained about e.g. the path of the kernel that |
||||
was loaded. |
||||
|
||||
This causes issues for the FIPS code which assumes that `BOOT_IMAGE` is |
||||
a path to the kernel image to derive the HMAC path. In non-OSTree |
||||
systems, this ends up working anyway, because the kernel is located at |
||||
the root of the boot partition. In OSTree systems, this is not the |
||||
case. However, OSTree systems use BLS configs, and they are named in |
||||
reverse order of precedence (i.e. menu ordering). So from the |
||||
`BOOT_IMAGE` integer, we can figure out which BLS entry was selected. |
||||
|
||||
Add some code to do just this on s390x. This isn't completely foolproof, |
||||
because it presumes that (1) BLS configs were used to populate the |
||||
bootloader (and that they were exactly in the same state they currently |
||||
are when `zipl` was run), and (2) there are no other menu entries |
||||
originating from outside the BLS configs. However, if these assumptions |
||||
are wrong we would simply fail the boot, which is currently what is |
||||
happening anyway. |
||||
|
||||
See also: |
||||
https://github.com/openshift/os/pull/546 |
||||
https://github.com/ibm-s390-linux/s390-tools/issues/78 |
||||
|
||||
Tested-by: Muhammad Adeel <muhammad.adeel@ibm.com> |
||||
|
||||
Resolves: rhbz#2050567 |
||||
--- |
||||
modules.d/01fips/fips.sh | 21 +++++++++++++++++++++ |
||||
modules.d/01fips/module-setup.sh | 2 +- |
||||
2 files changed, 22 insertions(+), 1 deletion(-) |
||||
|
||||
diff --git a/modules.d/01fips/fips.sh b/modules.d/01fips/fips.sh |
||||
index 821c26a2..3297cb17 100755 |
||||
--- a/modules.d/01fips/fips.sh |
||||
+++ b/modules.d/01fips/fips.sh |
||||
@@ -124,6 +124,27 @@ do_fips() { |
||||
else |
||||
BOOT_IMAGE="$(getarg BOOT_IMAGE)" |
||||
|
||||
+ # On s390x, BOOT_IMAGE isn't a path but an integer representing the |
||||
+ # entry number selected. Let's try the root of /boot first, and |
||||
+ # otherwise fallback to trying to parse the BLS entries if it's a |
||||
+ # BLS-based system. |
||||
+ if [ "$(uname -m)" = s390x ]; then |
||||
+ if [ -e "/boot/vmlinuz-${KERNEL}" ]; then |
||||
+ BOOT_IMAGE="vmlinuz-${KERNEL}" |
||||
+ elif [ -d /boot/loader/entries ]; then |
||||
+ i=0 |
||||
+ for bls in $(ls -d /boot/loader/entries/*.conf | sort -rV); do |
||||
+ ((i++)) |
||||
+ |
||||
+ if [ $i -eq ${BOOT_IMAGE:-0} ] && [ -r "$bls" ]; then |
||||
+ BOOT_IMAGE="$(grep -e '^linux' "$bls" | grep -o ' .*$')" |
||||
+ BOOT_IMAGE=${BOOT_IMAGE:1} |
||||
+ break |
||||
+ fi |
||||
+ done |
||||
+ fi |
||||
+ fi |
||||
+ |
||||
# Trim off any leading GRUB boot device (e.g. ($root) ) |
||||
BOOT_IMAGE="$(echo "${BOOT_IMAGE}" | sed 's/^(.*)//')" |
||||
|
||||
diff --git a/modules.d/01fips/module-setup.sh b/modules.d/01fips/module-setup.sh |
||||
index a1e499af..913a660c 100755 |
||||
--- a/modules.d/01fips/module-setup.sh |
||||
+++ b/modules.d/01fips/module-setup.sh |
||||
@@ -67,7 +67,7 @@ install() { |
||||
inst_hook pre-udev 01 "$moddir/fips-load-crypto.sh" |
||||
inst_script "$moddir/fips.sh" /sbin/fips.sh |
||||
|
||||
- inst_multiple sha512hmac rmmod insmod mount uname umount |
||||
+ inst_multiple sha512hmac rmmod insmod mount uname umount grep sort |
||||
|
||||
inst_simple /etc/system-fips |
||||
[ -c "${initdir}"/dev/random ] || mknod "${initdir}"/dev/random c 1 8 \ |
||||
|
@ -0,0 +1,70 @@
@@ -0,0 +1,70 @@
|
||||
From 94ec96c35678f56bc74b9c12c3229971bc40c9b3 Mon Sep 17 00:00:00 2001 |
||||
From: Pavel Valena <pvalena@redhat.com> |
||||
Date: Mon, 22 Nov 2021 16:40:39 +0100 |
||||
Subject: [PATCH] fix(network): add errors and warnings when network interface |
||||
does not exist |
||||
|
||||
End with error, or show a warning when nonexistent device is specified for network setup like |
||||
`ip=10.12.8.12::10.12.255.254:255.255.0.0:xk12:eth0:off`. |
||||
|
||||
I've added the error only for `write-ifcfg.sh`, as I think no such setup should be written. |
||||
|
||||
(cherry picked from commit 7938935267dd8824f074adf84c219340ad4c8db6) |
||||
|
||||
Resolves: #2050562 |
||||
--- |
||||
modules.d/35network-legacy/ifup.sh | 6 +++++- |
||||
modules.d/35network-legacy/parse-ip-opts.sh | 5 +++++ |
||||
modules.d/45ifcfg/write-ifcfg.sh | 5 +++++ |
||||
3 files changed, 15 insertions(+), 1 deletion(-) |
||||
|
||||
diff --git a/modules.d/35network-legacy/ifup.sh b/modules.d/35network-legacy/ifup.sh |
||||
index a05c4698..0dc9541c 100755 |
||||
--- a/modules.d/35network-legacy/ifup.sh |
||||
+++ b/modules.d/35network-legacy/ifup.sh |
||||
@@ -446,7 +446,11 @@ for p in $(getargs ip=); do |
||||
|
||||
# If this option isn't directed at our interface, skip it |
||||
if [ -n "$dev" ]; then |
||||
- [ "$dev" != "$netif" ] && continue |
||||
+ if [ "$dev" != "$netif" ]; then |
||||
+ [ ! -e "/sys/class/net/$dev" ] \ |
||||
+ && warn "Network interface '$dev' does not exist!" |
||||
+ continue |
||||
+ fi |
||||
else |
||||
iface_is_enslaved "$netif" && continue |
||||
fi |
||||
diff --git a/modules.d/35network-legacy/parse-ip-opts.sh b/modules.d/35network-legacy/parse-ip-opts.sh |
||||
index 35917bbf..19af8789 100755 |
||||
--- a/modules.d/35network-legacy/parse-ip-opts.sh |
||||
+++ b/modules.d/35network-legacy/parse-ip-opts.sh |
||||
@@ -97,6 +97,11 @@ for p in $(getargs ip=); do |
||||
fi |
||||
# IFACES list for later use |
||||
IFACES="$IFACES $dev" |
||||
+ |
||||
+ # Interface should exist |
||||
+ if [ ! -e "/sys/class/net/$dev" ]; then |
||||
+ warn "Network interface '$dev' does not exist" |
||||
+ fi |
||||
fi |
||||
|
||||
# Do we need to check for specific options? |
||||
diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh |
||||
index 5f71515a..345863f9 100755 |
||||
--- a/modules.d/45ifcfg/write-ifcfg.sh |
||||
+++ b/modules.d/45ifcfg/write-ifcfg.sh |
||||
@@ -103,6 +103,11 @@ interface_bind() { |
||||
local _netif="$1" |
||||
local _macaddr="$2" |
||||
|
||||
+ if [ ! -e "/sys/class/net/$_netif" ]; then |
||||
+ derror "Cannot find network interface '$_netif'!" |
||||
+ return 1 |
||||
+ fi |
||||
+ |
||||
# see, if we can bind it to some hw parms |
||||
if hw_bind "$_netif" "$_macaddr"; then |
||||
# only print out DEVICE, if it's user assigned |
||||
|
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
From cccc1e9ff2d80c7277563fd8fa35f44db48d2fd9 Mon Sep 17 00:00:00 2001 |
||||
From: The Plumber <50238977+systemd-rhel-bot@users.noreply.github.com> |
||||
Date: Tue, 15 Feb 2022 20:26:33 +0100 |
||||
Subject: [PATCH] (#2050560) fix(url-lib): make pre-pivot hook separetely per |
||||
nfs mount (#24) |
||||
|
||||
* fix(url-lib): make pre-pivot hook separetely per nfs mount |
||||
|
||||
(cherry picked from commit 2f091b17075f81ff490b05d3d566d736fc32f0be) |
||||
(cherry picked from commit acb18869e98687a3f8c172d7e7befaa5326cf67a) |
||||
(cherry picked from commit ec50cec3bd9169410df409e077d0487c63c2a627) |
||||
|
||||
Resolves: #2050560 |
||||
--- |
||||
modules.d/45url-lib/url-lib.sh | 2 +- |
||||
1 file changed, 1 insertion(+), 1 deletion(-) |
||||
|
||||
diff --git a/modules.d/45url-lib/url-lib.sh b/modules.d/45url-lib/url-lib.sh |
||||
index e1e7d5af..b68f72b0 100755 |
||||
--- a/modules.d/45url-lib/url-lib.sh |
||||
+++ b/modules.d/45url-lib/url-lib.sh |
||||
@@ -159,7 +159,7 @@ nfs_fetch_url() { |
||||
mntdir="$(mkuniqdir /run nfs_mnt)" |
||||
mount_nfs "$nfs:$server:$filepath${options:+:$options}" "$mntdir" |
||||
# lazy unmount during pre-pivot hook |
||||
- inst_hook --hook pre-pivot --name 99url-lib-umount-nfs umount -l -- "$mntdir" |
||||
+ inst_hook --hook pre-pivot --name 99url-lib-umount-nfs-"$(basename "$mntdir")" umount -l -- "$mntdir" |
||||
fi |
||||
|
||||
if [ -z "$outloc" ]; then |
||||
|
@ -0,0 +1,51 @@
@@ -0,0 +1,51 @@
|
||||
From 8d3b5eeb684f0872069fbab9e3b6470aa6a04729 Mon Sep 17 00:00:00 2001 |
||||
From: Pavel Valena <pvalena@redhat.com> |
||||
Date: Tue, 15 Feb 2022 21:06:21 +0100 |
||||
Subject: [PATCH] Fix shellcheck for a0d8caa8090a78f627f26fcd9b47c4b099cbc1ba |
||||
|
||||
In modules.d/01fips/fips.sh line 137: |
||||
((i++)) |
||||
^-----^ SC3006: In POSIX sh, standalone ((..)) is undefined. |
||||
^-- SC3018: In POSIX sh, ++ is undefined. |
||||
|
||||
In modules.d/01fips/fips.sh line 139: |
||||
if [ $i -eq ${BOOT_IMAGE:-0} ] && [ -r "$bls" ]; then |
||||
^-- SC2086: Double quote to prevent globbing and word splitting. |
||||
^--------------^ SC2086: Double quote to prevent globbing and word splitting. |
||||
|
||||
In modules.d/01fips/fips.sh line 141: |
||||
BOOT_IMAGE=${BOOT_IMAGE:1} |
||||
^-------------^ SC3057: In POSIX sh, string indexing is undefined. |
||||
|
||||
Related: rhbz#2050567 |
||||
--- |
||||
modules.d/01fips/fips.sh | 13 +++++++------ |
||||
1 file changed, 7 insertions(+), 6 deletions(-) |
||||
|
||||
diff --git a/modules.d/01fips/fips.sh b/modules.d/01fips/fips.sh |
||||
index 3297cb17..bee061ab 100755 |
||||
--- a/modules.d/01fips/fips.sh |
||||
+++ b/modules.d/01fips/fips.sh |
||||
@@ -133,14 +133,15 @@ do_fips() { |
||||
BOOT_IMAGE="vmlinuz-${KERNEL}" |
||||
elif [ -d /boot/loader/entries ]; then |
||||
i=0 |
||||
+ # shellcheck disable=SC2012 |
||||
for bls in $(ls -d /boot/loader/entries/*.conf | sort -rV); do |
||||
- ((i++)) |
||||
+ i=$((i + 1)) |
||||
|
||||
- if [ $i -eq ${BOOT_IMAGE:-0} ] && [ -r "$bls" ]; then |
||||
- BOOT_IMAGE="$(grep -e '^linux' "$bls" | grep -o ' .*$')" |
||||
- BOOT_IMAGE=${BOOT_IMAGE:1} |
||||
- break |
||||
- fi |
||||
+ if [ "$i" -eq "${BOOT_IMAGE:-0}" ] && [ -r "$bls" ]; then |
||||
+ BOOT_IMAGE="$(grep -e '^linux' "$bls" | grep -o ' .*$')" |
||||
+ BOOT_IMAGE=${BOOT_IMAGE## } |
||||
+ break |
||||
+ fi |
||||
done |
||||
fi |
||||
fi |
||||
|
@ -0,0 +1,94 @@
@@ -0,0 +1,94 @@
|
||||
From 865d74e9388dcc6ac6eff21a44e8229ffa8283e9 Mon Sep 17 00:00:00 2001 |
||||
From: =?UTF-8?q?Renaud=20M=C3=A9trich?= <rmetrich@redhat.com> |
||||
Date: Thu, 13 Jan 2022 17:35:59 +0100 |
||||
Subject: [PATCH] fix(dracut-shutdown): add cleanup handler on failure |
||||
|
||||
It may happen that dracut-shutdown.service fails, for example on timeout |
||||
due to very low bandwidth. |
||||
In such case, for hardening purposes, a new dracut-shutdown-onfailure.service |
||||
unit doing dracut-shutdown.service cleanup needs to execute to make sure |
||||
switching root to an incomplete initramfs won't occur later. |
||||
|
||||
See also RHBZ #1924587 (https://bugzilla.redhat.com/show_bug.cgi?id=1924587). |
||||
|
||||
(cherry picked from commit 7ab1d00227cad6f1b86ba01fdc766769faebb031) |
||||
|
||||
Resolves: #2050556 |
||||
--- |
||||
Makefile | 1 + |
||||
.../98dracut-systemd/dracut-shutdown-onfailure.service | 13 +++++++++++++ |
||||
modules.d/98dracut-systemd/dracut-shutdown.service | 1 + |
||||
modules.d/98dracut-systemd/dracut-shutdown.service.8.asc | 3 +++ |
||||
pkgbuild/dracut.spec | 1 + |
||||
5 files changed, 19 insertions(+) |
||||
|
||||
diff --git a/Makefile b/Makefile |
||||
index e7d69e10..1e1d093e 100644 |
||||
--- a/Makefile |
||||
+++ b/Makefile |
||||
@@ -168,6 +168,7 @@ ifneq ($(enable_documentation),no) |
||||
endif |
||||
if [ -n "$(systemdsystemunitdir)" ]; then \ |
||||
mkdir -p $(DESTDIR)$(systemdsystemunitdir); \ |
||||
+ ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98dracut-systemd/dracut-shutdown-onfailure.service $(DESTDIR)$(systemdsystemunitdir)/dracut-shutdown-onfailure.service; \ |
||||
ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98dracut-systemd/dracut-shutdown.service $(DESTDIR)$(systemdsystemunitdir)/dracut-shutdown.service; \ |
||||
mkdir -p $(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants; \ |
||||
ln -s ../dracut-shutdown.service \ |
||||
diff --git a/modules.d/98dracut-systemd/dracut-shutdown-onfailure.service b/modules.d/98dracut-systemd/dracut-shutdown-onfailure.service |
||||
new file mode 100644 |
||||
index 00000000..96de58c5 |
||||
--- /dev/null |
||||
+++ b/modules.d/98dracut-systemd/dracut-shutdown-onfailure.service |
||||
@@ -0,0 +1,13 @@ |
||||
+# This file is part of dracut. |
||||
+# |
||||
+# See dracut.bootup(7) for details |
||||
+ |
||||
+[Unit] |
||||
+Description=Service executing upon dracut-shutdown failure to perform cleanup |
||||
+Documentation=man:dracut-shutdown.service(8) |
||||
+DefaultDependencies=no |
||||
+ |
||||
+[Service] |
||||
+Type=oneshot |
||||
+ExecStart=-/bin/rm /run/initramfs/shutdown |
||||
+StandardError=null |
||||
diff --git a/modules.d/98dracut-systemd/dracut-shutdown.service b/modules.d/98dracut-systemd/dracut-shutdown.service |
||||
index 81043b2d..7c36f14f 100644 |
||||
--- a/modules.d/98dracut-systemd/dracut-shutdown.service |
||||
+++ b/modules.d/98dracut-systemd/dracut-shutdown.service |
||||
@@ -10,6 +10,7 @@ Wants=local-fs.target |
||||
Conflicts=shutdown.target umount.target |
||||
DefaultDependencies=no |
||||
ConditionPathExists=!/run/initramfs/bin/sh |
||||
+OnFailure=dracut-shutdown-onfailure.service |
||||
|
||||
[Service] |
||||
RemainAfterExit=yes |
||||
diff --git a/modules.d/98dracut-systemd/dracut-shutdown.service.8.asc b/modules.d/98dracut-systemd/dracut-shutdown.service.8.asc |
||||
index ba80b187..21ec88ca 100644 |
||||
--- a/modules.d/98dracut-systemd/dracut-shutdown.service.8.asc |
||||
+++ b/modules.d/98dracut-systemd/dracut-shutdown.service.8.asc |
||||
@@ -40,6 +40,9 @@ by injecting "rd.break=pre-shutdown rd.shell" or "rd.break=shutdown rd.shell". |
||||
# touch /run/initramfs/.need_shutdown |
||||
---- |
||||
|
||||
+In case the unpack of the initramfs fails, dracut-shutdown-onfailure.service |
||||
+executes to make sure switch root doesn't happen, since it would result in |
||||
+switching to an incomplete initramfs. |
||||
|
||||
AUTHORS |
||||
------- |
||||
diff --git a/pkgbuild/dracut.spec b/pkgbuild/dracut.spec |
||||
index 04c61f90..d35bbe37 100644 |
||||
--- a/pkgbuild/dracut.spec |
||||
+++ b/pkgbuild/dracut.spec |
||||
@@ -414,6 +414,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ |
||||
%dir %{_sharedstatedir}/initramfs |
||||
%if %{defined _unitdir} |
||||
%{_unitdir}/dracut-shutdown.service |
||||
+%{_unitdir}/dracut-shutdown-onfailure.service |
||||
%{_unitdir}/sysinit.target.wants/dracut-shutdown.service |
||||
%{_unitdir}/dracut-cmdline.service |
||||
%{_unitdir}/dracut-initqueue.service |
||||
|
@ -0,0 +1,51 @@
@@ -0,0 +1,51 @@
|
||||
From edce5bac8f65cee78fcf6c960ffb4e5924f81f78 Mon Sep 17 00:00:00 2001 |
||||
From: David Tardon <dtardon@redhat.com> |
||||
Date: Tue, 1 Jun 2021 15:06:01 +0200 |
||||
Subject: [PATCH] fix(multipath): get config. dir from configuration |
||||
|
||||
(cherry picked from commit 2e3c5444d271cb8f05955858b8fdc367c4ea5c48) |
||||
|
||||
Resolves: #1992464 |
||||
--- |
||||
modules.d/90multipath/module-setup.sh | 13 ++++++++++++- |
||||
1 file changed, 12 insertions(+), 1 deletion(-) |
||||
|
||||
diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh |
||||
index b6002c6a..05222389 100755 |
||||
--- a/modules.d/90multipath/module-setup.sh |
||||
+++ b/modules.d/90multipath/module-setup.sh |
||||
@@ -63,6 +63,7 @@ installkernel() { |
||||
# called by dracut |
||||
install() { |
||||
local -A _allow |
||||
+ local config_dir |
||||
|
||||
add_hostonly_mpath_conf() { |
||||
if is_mpath "$1"; then |
||||
@@ -74,6 +75,16 @@ install() { |
||||
fi |
||||
} |
||||
|
||||
+ local k v |
||||
+ while read -r k v; do |
||||
+ if [[ $k == "config_dir" ]]; then |
||||
+ v="${v#\"}" |
||||
+ config_dir="${v%\"}" |
||||
+ break |
||||
+ fi |
||||
+ done < <(multipath -t 2> /dev/null) |
||||
+ [[ -d $config_dir ]] || config_dir=/etc/multipath/conf.d |
||||
+ |
||||
inst_multiple \ |
||||
pkill \ |
||||
pidof \ |
||||
@@ -91,7 +102,7 @@ install() { |
||||
/etc/xdrdevices.conf \ |
||||
/etc/multipath.conf \ |
||||
/etc/multipath/* \ |
||||
- /etc/multipath/conf.d/* |
||||
+ "$config_dir"/* |
||||
|
||||
[[ $hostonly ]] && [[ $hostonly_mode == "strict" ]] && { |
||||
for_each_host_dev_and_slaves_all add_hostonly_mpath_conf |
||||
|
@ -0,0 +1,34 @@
@@ -0,0 +1,34 @@
|
||||
From 955222afe5bd7f23da48b94087ad7a4256d47605 Mon Sep 17 00:00:00 2001 |
||||
From: Jan Macku <jamacku@redhat.com> |
||||
Date: Tue, 15 Feb 2022 15:29:03 +0100 |
||||
Subject: [PATCH] ci: Add Differential ShellCheck action |
||||
|
||||
Related: #2050567 |
||||
--- |
||||
.github/workflows/differential-shellcheck.yml | 17 +++++++++++++++++ |
||||
1 file changed, 17 insertions(+) |
||||
|
||||
diff --git a/.github/workflows/differential-shellcheck.yml b/.github/workflows/differential-shellcheck.yml |
||||
new file mode 100644 |
||||
index 00000000..095c3fe6 |
||||
--- /dev/null |
||||
+++ b/.github/workflows/differential-shellcheck.yml |
||||
@@ -0,0 +1,17 @@ |
||||
+name: Differential ShellCheck |
||||
+on: |
||||
+ push: |
||||
+ branches: [main] |
||||
+ pull_request: |
||||
+ branches: [main] |
||||
+ |
||||
+jobs: |
||||
+ test: |
||||
+ runs-on: ubuntu-20.04 |
||||
+ |
||||
+ steps: |
||||
+ - name: Repository checkout |
||||
+ uses: actions/checkout@v2 |
||||
+ |
||||
+ - name: Differential ShellCheck |
||||
+ uses: redhat-plumbers-in-action/differential-shellcheck@v1 |
||||
|
@ -0,0 +1,40 @@
@@ -0,0 +1,40 @@
|
||||
From c988ca3aa81026c008bce69810584a651a0e75b3 Mon Sep 17 00:00:00 2001 |
||||
From: Pavel Valena <pvalena@redhat.com> |
||||
Date: Wed, 16 Feb 2022 02:42:11 +0100 |
||||
Subject: [PATCH] Do not use recommends for base packages |
||||
|
||||
Resolves: rhbz#1947892 |
||||
--- |
||||
pkgbuild/dracut.spec | 11 ++++------- |
||||
1 file changed, 4 insertions(+), 7 deletions(-) |
||||
|
||||
diff --git a/pkgbuild/dracut.spec b/pkgbuild/dracut.spec |
||||
index d35bbe37..4c9b1da3 100644 |
||||
--- a/pkgbuild/dracut.spec |
||||
+++ b/pkgbuild/dracut.spec |
||||
@@ -71,20 +71,17 @@ Requires: kmod |
||||
Requires: sed |
||||
Requires: xz |
||||
Requires: gzip |
||||
+Requires: hardlink |
||||
+Requires: pigz |
||||
+Requires: kpartx |
||||
|
||||
%if 0%{?fedora} || 0%{?rhel} |
||||
-Recommends: memstrack |
||||
-Recommends: hardlink |
||||
-Recommends: pigz |
||||
-Recommends: kpartx |
||||
+Suggests: memstrack |
||||
Requires: util-linux >= 2.21 |
||||
Requires: systemd >= 219 |
||||
Requires: systemd-udev >= 219 |
||||
Requires: procps-ng |
||||
%else |
||||
-Requires: hardlink |
||||
-Requires: gzip |
||||
-Requires: kpartx |
||||
Requires: udev > 166 |
||||
Requires: util-linux-ng >= 2.21 |
||||
%endif |
||||
|
@ -0,0 +1,34 @@
@@ -0,0 +1,34 @@
|
||||
From b4f4c927d25b273498d96ee0d367669ee011400e Mon Sep 17 00:00:00 2001 |
||||
From: Lukas Nykryn <lnykryn@redhat.com> |
||||
Date: Mon, 19 Jul 2021 11:27:28 +0200 |
||||
Subject: [PATCH] 95nfs: set correct ownership and permissions for statd |
||||
directory |
||||
|
||||
The directory ownership for the statd directory should be |
||||
rpcuser:rpcuser. |
||||
|
||||
Resolves: #2017846 |
||||
--- |
||||
modules.d/95nfs/module-setup.sh | 9 +++++++-- |
||||
1 file changed, 7 insertions(+), 2 deletions(-) |
||||
|
||||
diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh |
||||
index 38da5957..1c5f780e 100755 |
||||
--- a/modules.d/95nfs/module-setup.sh |
||||
+++ b/modules.d/95nfs/module-setup.sh |
||||
@@ -120,8 +120,13 @@ install() { |
||||
mkdir -m 0755 -p "$initdir/var/lib/nfs" |
||||
mkdir -m 0755 -p "$initdir/var/lib/nfs/rpc_pipefs" |
||||
mkdir -m 0770 -p "$initdir/var/lib/rpcbind" |
||||
- [ -d "/var/lib/nfs/statd/sm" ] && mkdir -m 0755 -p "$initdir/var/lib/nfs/statd/sm" |
||||
- [ -d "/var/lib/nfs/sm" ] && mkdir -m 0755 -p "$initdir/var/lib/nfs/sm" |
||||
+ [ -d "$dracutsysrootdir/var/lib/nfs/statd/sm" ] \ |
||||
+ && mkdir -m 0700 -p "$initdir/var/lib/nfs/statd" \ |
||||
+ && mkdir -m 0755 -p "$initdir/var/lib/nfs/statd/sm" \ |
||||
+ && chown -R rpcuser:rpcuser "$initdir/var/lib/nfs/statd" |
||||
+ [ -d "$dracutsysrootdir/var/lib/nfs/sm" ] \ |
||||
+ && mkdir -m 0755 -p "$initdir/var/lib/nfs/sm" \ |
||||
+ && chown -R rpcuser:rpcuser "$initdir/var/lib/nfs/sm" |
||||
|
||||
# Rather than copy the passwd file in, just set a user for rpcbind |
||||
# We'll save the state and restart the daemon from the root anyway |
@ -0,0 +1,81 @@
@@ -0,0 +1,81 @@
|
||||
From 2bfe8c53280b6c1e18339dddc5bb60b062cad5bb Mon Sep 17 00:00:00 2001 |
||||
From: David Teigland <teigland@redhat.com> |
||||
Date: Wed, 8 Dec 2021 14:04:25 -0600 |
||||
Subject: [PATCH] revert(lvm): remove snapshot feature |
||||
|
||||
The feature of managing lvm snapshots has no known |
||||
recent usage. It is unknown if it works. The lvm |
||||
developers do not wish to maintain or support it. |
||||
|
||||
(cherry picked from commit 1549d5e89818603e1aa6dd8a40981222f59f1548) |
||||
|
||||
Resolves: #2037955 |
||||
--- |
||||
modules.d/90lvm/lvm_scan.sh | 39 ++++----------------------------------- |
||||
1 file changed, 4 insertions(+), 35 deletions(-) |
||||
|
||||
diff --git a/modules.d/90lvm/lvm_scan.sh b/modules.d/90lvm/lvm_scan.sh |
||||
index c42f97d5..43601ad1 100755 |
||||
--- a/modules.d/90lvm/lvm_scan.sh |
||||
+++ b/modules.d/90lvm/lvm_scan.sh |
||||
@@ -7,8 +7,6 @@ type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh |
||||
|
||||
VGS=$(getargs rd.lvm.vg -d rd_LVM_VG=) |
||||
LVS=$(getargs rd.lvm.lv -d rd_LVM_LV=) |
||||
-SNAPSHOT=$(getargs rd.lvm.snapshot -d rd_LVM_SNAPSHOT=) |
||||
-SNAPSIZE=$(getargs rd.lvm.snapsize -d rd_LVM_SNAPSIZE=) |
||||
|
||||
# shellcheck disable=SC2174 |
||||
[ -d /etc/lvm ] || mkdir -m 0755 -p /etc/lvm |
||||
@@ -31,17 +29,10 @@ if [ ! -e /etc/lvm/lvm.conf ]; then |
||||
echo '}' |
||||
|
||||
# establish LVM locking |
||||
- if [ -n "$SNAPSHOT" ]; then |
||||
- echo 'global {' |
||||
- echo ' locking_type = 1' |
||||
- echo ' use_lvmetad = 0' |
||||
- echo '}' |
||||
- else |
||||
- echo 'global {' |
||||
- echo ' locking_type = 4' |
||||
- echo ' use_lvmetad = 0' |
||||
- echo '}' |
||||
- fi |
||||
+ echo 'global {' |
||||
+ echo ' locking_type = 4' |
||||
+ echo ' use_lvmetad = 0' |
||||
+ echo '}' |
||||
} > /etc/lvm/lvm.conf |
||||
lvmwritten=1 |
||||
fi |
||||
@@ -90,28 +81,6 @@ unset extraargs |
||||
|
||||
export LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES=1 |
||||
|
||||
-if [ -n "$SNAPSHOT" ]; then |
||||
- # HACK - this should probably be done elsewhere or turned into a function |
||||
- # Enable read-write LVM locking |
||||
- sed -i -e 's/\(^[[:space:]]*\)locking_type[[:space:]]*=[[:space:]]*[[:digit:]]/\1locking_type = 1/' /etc/lvm/lvm.conf |
||||
- |
||||
- # Expected SNAPSHOT format "<orig lv name>:<snap lv name>" |
||||
- ORIG_LV=${SNAPSHOT%%:*} |
||||
- SNAP_LV=${SNAPSHOT##*:} |
||||
- |
||||
- info "Removing existing LVM snapshot $SNAP_LV" |
||||
- lvm lvremove --force "$SNAP_LV" 2>&1 | vinfo |
||||
- |
||||
- # Determine snapshot size |
||||
- if [ -z "$SNAPSIZE" ]; then |
||||
- SNAPSIZE=$(lvm lvs --noheadings --units m --options lv_size "$ORIG_LV") |
||||
- info "No LVM snapshot size provided, using size of $ORIG_LV ($SNAPSIZE)" |
||||
- fi |
||||
- |
||||
- info "Creating LVM snapshot $SNAP_LV ($SNAPSIZE)" |
||||
- lvm lvcreate -s -n "$SNAP_LV" -L "$SNAPSIZE" "$ORIG_LV" 2>&1 | vinfo |
||||
-fi |
||||
- |
||||
if [ -n "$LVS" ]; then |
||||
info "Scanning devices $lvmdevs for LVM logical volumes $LVS" |
||||
lvm lvscan $lvm_ignorelockingfailure 2>&1 | vinfo |
||||
|
@ -0,0 +1,71 @@
@@ -0,0 +1,71 @@
|
||||
From 441c2c211d3c0fd8003ebb7622f44f360e75cbcd Mon Sep 17 00:00:00 2001 |
||||
From: David Teigland <teigland@redhat.com> |
||||
Date: Wed, 8 Dec 2021 14:07:42 -0600 |
||||
Subject: [PATCH] revert(lvm): remove lvmetad config changes |
||||
|
||||
Remove support for modifying use_lvmetad and locking_type |
||||
settings in lvm.conf for lvm versions 2.2.*. Recent lvm |
||||
versions (2.3.*) do not include lvmetad or locking_type. |
||||
This cleanup simplifies code maintenance. |
||||
|
||||
To use the lvm module with older versions (2.2), a user |
||||
would need to ensure that lvmetad settings are disabled |
||||
in the initrd's lvm.conf rather than relying on the lvm |
||||
dracut mode to modify their lvm.conf. |
||||
|
||||
(cherry picked from commit f6f393f550625e3e1c968ef32d6d7bdd90f51d73) |
||||
|
||||
Resolves: #2037955 |
||||
--- |
||||
modules.d/90lvm/lvm_scan.sh | 3 --- |
||||
modules.d/90lvm/module-setup.sh | 14 -------------- |
||||
2 files changed, 17 deletions(-) |
||||
|
||||
diff --git a/modules.d/90lvm/lvm_scan.sh b/modules.d/90lvm/lvm_scan.sh |
||||
index 43601ad1..80382407 100755 |
||||
--- a/modules.d/90lvm/lvm_scan.sh |
||||
+++ b/modules.d/90lvm/lvm_scan.sh |
||||
@@ -28,10 +28,7 @@ if [ ! -e /etc/lvm/lvm.conf ]; then |
||||
echo '"r/.*/" ]' |
||||
echo '}' |
||||
|
||||
- # establish LVM locking |
||||
echo 'global {' |
||||
- echo ' locking_type = 4' |
||||
- echo ' use_lvmetad = 0' |
||||
echo '}' |
||||
} > /etc/lvm/lvm.conf |
||||
lvmwritten=1 |
||||
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh |
||||
index e1e6c582..0bb491f3 100755 |
||||
--- a/modules.d/90lvm/module-setup.sh |
||||
+++ b/modules.d/90lvm/module-setup.sh |
||||
@@ -61,10 +61,6 @@ install() { |
||||
if [[ $hostonly ]] || [[ $lvmconf == "yes" ]]; then |
||||
if [[ -f $dracutsysrootdir/etc/lvm/lvm.conf ]]; then |
||||
inst_simple -H /etc/lvm/lvm.conf |
||||
- # FIXME: near-term hack to establish read-only locking; |
||||
- # use command-line lvm.conf editor once it is available |
||||
- sed -i -e 's/\(^[[:space:]]*\)locking_type[[:space:]]*=[[:space:]]*[[:digit:]]/\1locking_type = 4/' "${initdir}/etc/lvm/lvm.conf" |
||||
- sed -i -e 's/\(^[[:space:]]*\)use_lvmetad[[:space:]]*=[[:space:]]*[[:digit:]]/\1use_lvmetad = 0/' "${initdir}/etc/lvm/lvm.conf" |
||||
fi |
||||
|
||||
export LVM_SUPPRESS_FD_WARNINGS=1 |
||||
@@ -82,16 +78,6 @@ install() { |
||||
unset LVM_SUPPRESS_FD_WARNINGS |
||||
fi |
||||
|
||||
- if ! [[ -e ${initdir}/etc/lvm/lvm.conf ]]; then |
||||
- mkdir -p "${initdir}/etc/lvm" |
||||
- { |
||||
- echo 'global {' |
||||
- echo 'locking_type = 4' |
||||
- echo 'use_lvmetad = 0' |
||||
- echo '}' |
||||
- } > "${initdir}/etc/lvm/lvm.conf" |
||||
- fi |
||||
- |
||||
inst_rules 11-dm-lvm.rules 69-dm-lvm-metad.rules |
||||
|
||||
# Do not run lvmetad update via pvscan in udev rule - lvmetad is not running yet in dracut! |
||||
|
@ -0,0 +1,46 @@
@@ -0,0 +1,46 @@
|
||||
From a755fb8c0dfa28d57b7bbe900d3bde5d2fe4789f Mon Sep 17 00:00:00 2001 |
||||
From: David Teigland <teigland@redhat.com> |
||||
Date: Wed, 8 Dec 2021 14:11:13 -0600 |
||||
Subject: [PATCH] revert(lvm): remove 69-dm-lvm-metad.rules |
||||
|
||||
This udev rule runs pvscan to autoactivate VGs, which dracut |
||||
does not want to do, and previously disabled by editing the |
||||
rule file and commenting out lines. |
||||
|
||||
This also stops /dev/disk/by-id/lvm-pv-uuid-* symlinks from |
||||
being created in the initrd. |
||||
|
||||
(cherry picked from commit 50e74668434d935db649b5690dc2158b0f87d91c) |
||||
|
||||
Resolves: #2037955 |
||||
--- |
||||
modules.d/90lvm/module-setup.sh | 15 +-------------- |
||||
1 file changed, 1 insertion(+), 14 deletions(-) |
||||
|
||||
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh |
||||
index 0bb491f3..25be0133 100755 |
||||
--- a/modules.d/90lvm/module-setup.sh |
||||
+++ b/modules.d/90lvm/module-setup.sh |
||||
@@ -78,20 +78,7 @@ install() { |
||||
unset LVM_SUPPRESS_FD_WARNINGS |
||||
fi |
||||
|
||||
- inst_rules 11-dm-lvm.rules 69-dm-lvm-metad.rules |
||||
- |
||||
- # Do not run lvmetad update via pvscan in udev rule - lvmetad is not running yet in dracut! |
||||
- if [[ -f ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules ]]; then |
||||
- if grep -q SYSTEMD_WANTS "${initdir}"/lib/udev/rules.d/69-dm-lvm-metad.rules; then |
||||
- sed -i -e 's/^ENV{SYSTEMD_ALIAS}=.*/# No LVM pvscan in dracut - lvmetad is not running yet/' \ |
||||
- "${initdir}"/lib/udev/rules.d/69-dm-lvm-metad.rules |
||||
- sed -i -e 's/^ENV{ID_MODEL}=.*//' "${initdir}"/lib/udev/rules.d/69-dm-lvm-metad.rules |
||||
- sed -i -e 's/^ENV{SYSTEMD_WANTS}+\?=.*//' "${initdir}"/lib/udev/rules.d/69-dm-lvm-metad.rules |
||||
- else |
||||
- sed -i -e 's/.*lvm pvscan.*/# No LVM pvscan for in dracut - lvmetad is not running yet/' \ |
||||
- "${initdir}"/lib/udev/rules.d/69-dm-lvm-metad.rules |
||||
- fi |
||||
- fi |
||||
+ inst_rules 11-dm-lvm.rules |
||||
|
||||
# Gentoo ebuild for LVM2 prior to 2.02.63-r1 doesn't install above rules |
||||
# files, but provides the one below: |
||||
|
@ -0,0 +1,32 @@
@@ -0,0 +1,32 @@
|
||||
From bf521a1e968472b74288046830bd2c85e3cbb023 Mon Sep 17 00:00:00 2001 |
||||
From: David Teigland <teigland@redhat.com> |
||||
Date: Wed, 8 Dec 2021 14:14:27 -0600 |
||||
Subject: [PATCH] fix(lvm): replace --partial option |
||||
|
||||
The --partial option will activate a linear (or other) LV |
||||
without segments for missing devices, which is unlikely to |
||||
be useful. The intention was to activate raid LVs in a useful |
||||
form while missing devices, which is specified with the option |
||||
--activationmode degraded. |
||||
|
||||
(cherry picked from commit 97543cca48dfde849396f11c83f9c320e1b91c46) |
||||
|
||||
Resolves: #2037955 |
||||
--- |
||||
modules.d/90lvm/64-lvm.rules | 2 +- |
||||
1 file changed, 1 insertion(+), 1 deletion(-) |
||||
|
||||
diff --git a/modules.d/90lvm/64-lvm.rules b/modules.d/90lvm/64-lvm.rules |
||||
index 65f65249..ca718ce0 100644 |
||||
--- a/modules.d/90lvm/64-lvm.rules |
||||
+++ b/modules.d/90lvm/64-lvm.rules |
||||
@@ -15,7 +15,7 @@ PROGRAM=="/bin/sh -c 'for i in $sys/$devpath/holders/dm-[0-9]*; do [ -e $$i ] && |
||||
GOTO="lvm_end" |
||||
|
||||
RUN+="/sbin/initqueue --settled --onetime --unique /sbin/lvm_scan" |
||||
-RUN+="/sbin/initqueue --timeout --name 51-lvm_scan --onetime --unique /sbin/lvm_scan --partial" |
||||
+RUN+="/sbin/initqueue --timeout --name 51-lvm_scan --onetime --unique /sbin/lvm_scan --activationmode degraded" |
||||
RUN+="/bin/sh -c '>/tmp/.lvm_scan-%k;'" |
||||
|
||||
LABEL="lvm_end" |
||||
|
@ -0,0 +1,85 @@
@@ -0,0 +1,85 @@
|
||||
From 9ab4c18355df1e55c39ca96f27ddb9b540054286 Mon Sep 17 00:00:00 2001 |
||||
From: David Teigland <teigland@redhat.com> |
||||
Date: Wed, 8 Dec 2021 14:43:58 -0600 |
||||
Subject: [PATCH] feat(lvm): update lvm command options |
||||
|
||||
Drop checking for options that have been available for |
||||
at least ten years. This simplifies code maintenance. |
||||
|
||||
Add the new --nohints option (when available) to disable |
||||
the use of hints which is not useful during startup. |
||||
|
||||
(cherry picked from commit c0a54f2993b1d3c2101202c274a41f925445d54b) |
||||
|
||||
Resolves: #2037955 |
||||
--- |
||||
modules.d/90lvm/lvm_scan.sh | 41 ++++++++++++++++++++++------------------- |
||||
1 file changed, 22 insertions(+), 19 deletions(-) |
||||
|
||||
diff --git a/modules.d/90lvm/lvm_scan.sh b/modules.d/90lvm/lvm_scan.sh |
||||
index 80382407..00143bff 100755 |
||||
--- a/modules.d/90lvm/lvm_scan.sh |
||||
+++ b/modules.d/90lvm/lvm_scan.sh |
||||
@@ -59,39 +59,42 @@ min=$2 |
||||
sub=${3%% *} |
||||
sub=${sub%%\(*} |
||||
|
||||
-lvm_ignorelockingfailure="--ignorelockingfailure" |
||||
-lvm_quirk_args="--ignorelockingfailure --ignoremonitoring" |
||||
- |
||||
-check_lvm_ver 2 2 57 "$maj" "$min" "$sub" \ |
||||
- && lvm_quirk_args="$lvm_quirk_args --poll n" |
||||
- |
||||
-if check_lvm_ver 2 2 65 "$maj" "$min" "$sub"; then |
||||
- lvm_quirk_args=" --sysinit $extraargs" |
||||
-fi |
||||
- |
||||
-if check_lvm_ver 2 2 221 "$maj" "$min" "$sub"; then |
||||
- lvm_quirk_args=" $extraargs" |
||||
- unset lvm_ignorelockingfailure |
||||
-fi |
||||
- |
||||
+# For lvchange and vgchange use --sysinit which: |
||||
+# disables polling (--poll n) |
||||
+# ignores monitoring (--ignoremonitoring) |
||||
+# ignores locking failures (--ignorelockingfailure) |
||||
+# disables hints (--nohints) |
||||
+# |
||||
+# For lvscan and vgscan: |
||||
+# disable locking (--nolocking) |
||||
+# disable hints (--nohints) |
||||
+ |
||||
+activate_args="--sysinit $extraargs" |
||||
unset extraargs |
||||
|
||||
export LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES=1 |
||||
|
||||
+scan_args="--nolocking" |
||||
+ |
||||
+check_lvm_ver 2 3 14 "$maj" "$min" "$sub" \ |
||||
+ && scan_args="$scan_args --nohints" |
||||
+ |
||||
if [ -n "$LVS" ]; then |
||||
info "Scanning devices $lvmdevs for LVM logical volumes $LVS" |
||||
- lvm lvscan $lvm_ignorelockingfailure 2>&1 | vinfo |
||||
+ # shellcheck disable=SC2086 |
||||
+ lvm lvscan $scan_args 2>&1 | vinfo |
||||
for LV in $LVS; do |
||||
# shellcheck disable=SC2086 |
||||
- lvm lvchange --yes -K -ay $lvm_quirk_args "$LV" 2>&1 | vinfo |
||||
+ lvm lvchange --yes -K -ay $activate_args "$LV" 2>&1 | vinfo |
||||
done |
||||
fi |
||||
|
||||
if [ -z "$LVS" ] || [ -n "$VGS" ]; then |
||||
info "Scanning devices $lvmdevs for LVM volume groups $VGS" |
||||
- lvm vgscan $lvm_ignorelockingfailure 2>&1 | vinfo |
||||
# shellcheck disable=SC2086 |
||||
- lvm vgchange -ay $lvm_quirk_args $VGS 2>&1 | vinfo |
||||
+ lvm vgscan $scan_args 2>&1 | vinfo |
||||
+ # shellcheck disable=SC2086 |
||||
+ lvm vgchange -ay $activate_args $VGS 2>&1 | vinfo |
||||
fi |
||||
|
||||
if [ "$lvmwritten" ]; then |
||||
|
@ -0,0 +1,143 @@
@@ -0,0 +1,143 @@
|
||||
From ded4448ba98305b6f0c58cdd67a8b0de9a3db0d3 Mon Sep 17 00:00:00 2001 |
||||
From: David Teigland <teigland@redhat.com> |
||||
Date: Wed, 8 Dec 2021 15:16:03 -0600 |
||||
Subject: [PATCH] feat(lvm): use generated filter when none is set |
||||
|
||||
Previously, the lvm device filter generated by dracut |
||||
would not be used if any lvm.conf file existed in the |
||||
initrd. Change this so that the generated filter will |
||||
be used when the included lvm.conf has no filter set. |
||||
|
||||
(cherry picked from commit 7ffc5e388bcce20785803825bdd260c3c854b34f) |
||||
|
||||
Resolves: #2037955 |
||||
--- |
||||
modules.d/90lvm/lvm_scan.sh | 91 +++++++++++++++++++++++++++++++++++++-------- |
||||
1 file changed, 75 insertions(+), 16 deletions(-) |
||||
|
||||
diff --git a/modules.d/90lvm/lvm_scan.sh b/modules.d/90lvm/lvm_scan.sh |
||||
index 00143bff..bda265f6 100755 |
||||
--- a/modules.d/90lvm/lvm_scan.sh |
||||
+++ b/modules.d/90lvm/lvm_scan.sh |
||||
@@ -10,6 +10,7 @@ LVS=$(getargs rd.lvm.lv -d rd_LVM_LV=) |
||||
|
||||
# shellcheck disable=SC2174 |
||||
[ -d /etc/lvm ] || mkdir -m 0755 -p /etc/lvm |
||||
+[ -d /run/lvm ] || mkdir -m 0755 -p /run/lvm |
||||
# build a list of devices to scan |
||||
lvmdevs=$( |
||||
for f in /tmp/.lvm_scan-*; do |
||||
@@ -18,22 +19,6 @@ lvmdevs=$( |
||||
done |
||||
) |
||||
|
||||
-if [ ! -e /etc/lvm/lvm.conf ]; then |
||||
- { |
||||
- echo 'devices {' |
||||
- printf ' filter = [ ' |
||||
- for dev in $lvmdevs; do |
||||
- printf '"a|^/dev/%s$|", ' "$dev" |
||||
- done |
||||
- echo '"r/.*/" ]' |
||||
- echo '}' |
||||
- |
||||
- echo 'global {' |
||||
- echo '}' |
||||
- } > /etc/lvm/lvm.conf |
||||
- lvmwritten=1 |
||||
-fi |
||||
- |
||||
check_lvm_ver() { |
||||
maj=$1 |
||||
min=$2 |
||||
@@ -47,6 +32,75 @@ check_lvm_ver() { |
||||
return 1 |
||||
} |
||||
|
||||
+no_lvm_conf_filter() { |
||||
+ if [ ! -e /etc/lvm/lvm.conf ]; then |
||||
+ return 0 |
||||
+ fi |
||||
+ |
||||
+ if [ -e /run/lvm/initrd_no_filter ]; then |
||||
+ return 0 |
||||
+ fi |
||||
+ |
||||
+ if [ -e /run/lvm/initrd_filter ]; then |
||||
+ return 1 |
||||
+ fi |
||||
+ |
||||
+ if [ -e /run/lvm/initrd_global_filter ]; then |
||||
+ return 1 |
||||
+ fi |
||||
+ |
||||
+ # Save lvm config results in /run to avoid running |
||||
+ # lvm config commands for every PV that's scanned. |
||||
+ |
||||
+ filter=$(lvm config devices/filter | grep "$filter=") |
||||
+ if [ -n "$filter" ]; then |
||||
+ printf '%s\n' "$filter" > /run/lvm/initrd_filter |
||||
+ return 1 |
||||
+ fi |
||||
+ |
||||
+ global_filter=$(lvm config devices/global_filter | grep "$global_filter=") |
||||
+ if [ -n "$global_filter" ]; then |
||||
+ printf '%s\n' "$global_filter" > /run/lvm/initrd_global_filter |
||||
+ return 1 |
||||
+ fi |
||||
+ |
||||
+ # /etc/lvm/lvm.conf exists with no filter setting |
||||
+ true > /run/lvm/initrd_no_filter |
||||
+ return 0 |
||||
+} |
||||
+ |
||||
+# If no lvm.conf exists, create a basic one with a global section. |
||||
+if [ ! -e /etc/lvm/lvm.conf ]; then |
||||
+ { |
||||
+ echo 'global {' |
||||
+ echo '}' |
||||
+ } > /etc/lvm/lvm.conf |
||||
+ lvmwritten=1 |
||||
+fi |
||||
+ |
||||
+# Save the original lvm.conf before appending a filter setting. |
||||
+if [ ! -e /etc/lvm/lvm.conf.orig ]; then |
||||
+ cp /etc/lvm/lvm.conf /etc/lvm/lvm.conf.orig |
||||
+fi |
||||
+ |
||||
+# If the original lvm.conf does not contain a filter setting, |
||||
+# then generate a filter and append it to the original lvm.conf. |
||||
+# The filter is generated from the list PVs that have been seen |
||||
+# so far (each has been processed by the lvm udev rule.) |
||||
+if no_lvm_conf_filter; then |
||||
+ { |
||||
+ echo 'devices {' |
||||
+ printf ' filter = [ ' |
||||
+ for dev in $lvmdevs; do |
||||
+ printf '"a|^/dev/%s$|", ' "$dev" |
||||
+ done |
||||
+ echo '"r/.*/" ]' |
||||
+ echo '}' |
||||
+ } > /etc/lvm/lvm.conf.filter |
||||
+ lvmfilter=1 |
||||
+ cat /etc/lvm/lvm.conf.orig /etc/lvm/lvm.conf.filter > /etc/lvm/lvm.conf |
||||
+fi |
||||
+ |
||||
# hopefully this output format will never change, e.g.: |
||||
# LVM version: 2.02.53(1) (2009-09-25) |
||||
OLDIFS=$IFS |
||||
@@ -99,8 +153,13 @@ fi |
||||
|
||||
if [ "$lvmwritten" ]; then |
||||
rm -f -- /etc/lvm/lvm.conf |
||||
+elif [ "$lvmfilter" ]; then |
||||
+ # revert filter that was appended to existing lvm.conf |
||||
+ cp /etc/lvm/lvm.conf.orig /etc/lvm/lvm.conf |
||||
+ rm -f -- /etc/lvm/lvm.conf.filter |
||||
fi |
||||
unset lvmwritten |
||||
+unset lvmfilter |
||||
|
||||
udevadm settle |
||||
|
||||
|
@ -0,0 +1,56 @@
@@ -0,0 +1,56 @@
|
||||
From ec9b1e872ad3be0ec9440927a0f702c7bfa80932 Mon Sep 17 00:00:00 2001 |
||||
From: David Teigland <teigland@redhat.com> |
||||
Date: Fri, 10 Dec 2021 12:51:26 -0600 |
||||
Subject: [PATCH] feat(lvm): only run lvchange for LV that is seen on devices |
||||
|
||||
Change the command listing LVs from lvscan to lvs, and list |
||||
only the LV names that are being activated. Before attempting |
||||
to activate an LV, check that that LV name appears in the |
||||
lvs command output. This avoids wasting time running an |
||||
lvchange command that we know will fail. |
||||
|
||||
(cherry picked from commit 1af46743195422aaebcde5c508a5dd479eff51ea) |
||||
|
||||
Resolves: #2037955 |
||||
--- |
||||
modules.d/90lvm/lvm_scan.sh | 18 ++++++++++++++---- |
||||
1 file changed, 14 insertions(+), 4 deletions(-) |
||||
|
||||
diff --git a/modules.d/90lvm/lvm_scan.sh b/modules.d/90lvm/lvm_scan.sh |
||||
index bda265f6..89f077ae 100755 |
||||
--- a/modules.d/90lvm/lvm_scan.sh |
||||
+++ b/modules.d/90lvm/lvm_scan.sh |
||||
@@ -119,7 +119,7 @@ sub=${sub%%\(*} |
||||
# ignores locking failures (--ignorelockingfailure) |
||||
# disables hints (--nohints) |
||||
# |
||||
-# For lvscan and vgscan: |
||||
+# For lvs and vgscan: |
||||
# disable locking (--nolocking) |
||||
# disable hints (--nohints) |
||||
|
||||
@@ -136,10 +136,20 @@ check_lvm_ver 2 3 14 "$maj" "$min" "$sub" \ |
||||
if [ -n "$LVS" ]; then |
||||
info "Scanning devices $lvmdevs for LVM logical volumes $LVS" |
||||
# shellcheck disable=SC2086 |
||||
- lvm lvscan $scan_args 2>&1 | vinfo |
||||
+ LVSLIST=$(lvm lvs $scan_args --noheading -o lv_full_name,segtype $LVS) |
||||
+ info "$LVSLIST" |
||||
+ |
||||
+ # Only attempt to activate an LV if it appears in the lvs output. |
||||
for LV in $LVS; do |
||||
- # shellcheck disable=SC2086 |
||||
- lvm lvchange --yes -K -ay $activate_args "$LV" 2>&1 | vinfo |
||||
+ if strstr "$LVSLIST" "$LV"; then |
||||
+ # This lvchange is expected to fail if all PVs used by |
||||
+ # the LV are not yet present. Premature/failed lvchange |
||||
+ # could be avoided by reporting if an LV is complete |
||||
+ # from the lvs command above and skipping this lvchange |
||||
+ # if the LV is not lised as complete. |
||||
+ # shellcheck disable=SC2086 |
||||
+ lvm lvchange --yes -K -ay $activate_args "$LV" 2>&1 | vinfo |
||||
+ fi |
||||
done |
||||
fi |
||||
|
||||
|
@ -0,0 +1,39 @@
@@ -0,0 +1,39 @@
|
||||
From f659bd462a6b605c36a89fa205b41bf8f55c41be Mon Sep 17 00:00:00 2001 |
||||
From: David Teigland <teigland@redhat.com> |
||||
Date: Fri, 17 Dec 2021 12:14:51 -0600 |
||||
Subject: [PATCH] fix(lvm): restore setting LVM_MD_PV_ACTIVATED |
||||
|
||||
The 69-dm-lvm-metad.rules udev rule has been removed from |
||||
the initrd, because it's been dropped by recent upstream |
||||
lvm versions, and it never performed any primary function |
||||
within the initrd. But, it did have the job of setting |
||||
LVM_MD_PV_ACTIVATED=1 for active md devices used by PVs. |
||||
That step needs to be restored, and is now included in |
||||
64-lvm.rules. |
||||
|
||||
(cherry picked from commit 164e5ebb1199ea3e3d641ce402d8257f0055a529) |
||||
|
||||
Resolves: #2037955 |
||||
--- |
||||
modules.d/90lvm/64-lvm.rules | 8 ++++++++ |
||||
1 file changed, 8 insertions(+) |
||||
|
||||
diff --git a/modules.d/90lvm/64-lvm.rules b/modules.d/90lvm/64-lvm.rules |
||||
index ca718ce0..1ad49111 100644 |
||||
--- a/modules.d/90lvm/64-lvm.rules |
||||
+++ b/modules.d/90lvm/64-lvm.rules |
||||
@@ -6,6 +6,14 @@ |
||||
|
||||
SUBSYSTEM!="block", GOTO="lvm_end" |
||||
ACTION!="add|change", GOTO="lvm_end" |
||||
+ |
||||
+# If the md device is active (indicated by array_state), then set the flag |
||||
+# LVM_MD_PV_ACTIVATED=1 indicating that the md device for the PV is ready |
||||
+# to be used. The lvm udev rule running in root will check that this flag |
||||
+# is set before it will process the md device (it wants to avoid |
||||
+# processing an md device that exists but is not yet ready to be used.) |
||||
+KERNEL=="md[0-9]*", ACTION=="change", ENV{ID_FS_TYPE}=="LVM2_member", ENV{LVM_MD_PV_ACTIVATED}!="1", TEST=="md/array_state", ENV{LVM_MD_PV_ACTIVATED}="1" |
||||
+ |
||||
# Also don't process disks that are slated to be a multipath device |
||||
ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="lvm_end" |
||||
KERNEL=="dm-[0-9]*", ACTION=="add", GOTO="lvm_end" |
Loading…
Reference in new issue