Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1246 from openshift-cherrypick-robot/cherry-pick-…
…1243-to-release-4.13 OCPBUGS-11485: [release-4.13] overlay: add 30rhcos-nvme-compat-udev
- Loading branch information
Showing
7 changed files
with
84 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Config file for overriding permission bits on overlay files/dirs | ||
# Format: =<file mode in decimal> <absolute path to a file or directory> |
13 changes: 13 additions & 0 deletions
13
...0rhcos-nvme-compat-udev/usr/lib/dracut/modules.d/30rhcos-nvme-compat-udev/module-setup.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
# NVMe by-id/ symlinks changed wrt leading spaces from RHEL8 to RHEL9: | ||
# https://issues.redhat.com/browse/OCPBUGS-11375 | ||
# https://github.com/systemd/systemd/issues/27155 | ||
|
||
# This rule adds back the previous symlinks for backwards compatibility. We want | ||
# it in the initramfs in case there are Ignition configs which referenced the | ||
# old symlinks. | ||
|
||
install() { | ||
inst_multiple /usr/lib/udev/rules.d/61-persistent-storage-nvme-compat.rules | ||
} |
20 changes: 20 additions & 0 deletions
20
...y.d/30rhcos-nvme-compat-udev/usr/lib/udev/rules.d/61-persistent-storage-nvme-compat.rules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# NVMe by-id/ symlinks changed wrt leading spaces from RHEL8 to RHEL9: | ||
# https://issues.redhat.com/browse/OCPBUGS-11375 | ||
# https://github.com/systemd/systemd/issues/27155 | ||
|
||
# This rule adds back the previous symlinks for backwards compatibility. | ||
|
||
# They're the same as the regular rules in 60-persistent-storage.rules, except | ||
# they don't include the `OPTIONS="string_escape=replace"` directive. | ||
|
||
ACTION=="remove", GOTO="persistent_storage_nvme_compat_end" | ||
ENV{UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG}=="1", GOTO="persistent_storage_nvme_compat_end" | ||
SUBSYSTEM!="block", GOTO="persistent_storage_nvme_compat_end" | ||
|
||
KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ENV{ID_MODEL}=="?*", ENV{ID_SERIAL_SHORT}=="?*", \ | ||
ENV{ID_SERIAL}="$env{ID_MODEL}_$env{ID_SERIAL_SHORT}", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}" | ||
|
||
KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ENV{ID_MODEL}=="?*", ENV{ID_SERIAL_SHORT}=="?*", \ | ||
ENV{ID_SERIAL}="$env{ID_MODEL}_$env{ID_SERIAL_SHORT}", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}-part%n" | ||
|
||
LABEL="persistent_storage_nvme_compat_end" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
## kola: | ||
## exclusive: true | ||
## additionalDisks: ["1G:channel=nvme,serial= foobar"] | ||
## platforms: qemu | ||
## # qemu on s390x does not support nvme emulation | ||
## architectures: "!s390x" | ||
# | ||
# By default coreos-generate-iscsi-initiatorname.service is active on RHCOS, | ||
# inactive on FCOS | ||
# https://github.com/openshift/os/pull/453 | ||
|
||
set -xeuo pipefail | ||
|
||
. $KOLA_EXT_DATA/commonlib.sh | ||
|
||
# the canonical symlink | ||
s=/dev/disk/by-id/nvme-QEMU_NVMe_Ctrl_____foobar | ||
if ! test -L "${s}"; then | ||
fatal "missing canonical symlink ${s}" | ||
fi | ||
|
||
# the compat symlink | ||
s=/dev/disk/by-id/nvme-QEMU_NVMe_Ctrl__foobar | ||
if ! test -L "${s}"; then | ||
fatal "missing compat symlink ${s}" | ||
fi | ||
|
||
ok "nvme compat symlink" |