Skip to content

Commit

Permalink
Merge pull request #1246 from openshift-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…1243-to-release-4.13

OCPBUGS-11485: [release-4.13] overlay: add 30rhcos-nvme-compat-udev
  • Loading branch information
cgwalters committed Apr 6, 2023
2 parents ee2b02f + bc6f497 commit cc26b0b
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ci/prow-entrypoint.sh
Expand Up @@ -264,12 +264,16 @@ main () {
kola_test_metal
;;
"rhcos-92-build-test-qemu"|"rhcos-90-build-test-qemu")
echo "FIXME skipped until we have updated mirrors in Prow"
exit 0
setup_user
cosa_init "rhel-coreos-9"
cosa_build
kola_test_qemu
;;
"rhcos-92-build-test-metal"|"rhcos-90-build-test-metal")
echo "FIXME skipped until we have updated mirrors in Prow"
exit 0
setup_user
cosa_init "rhel-coreos-9"
cosa_build
Expand Down
1 change: 1 addition & 0 deletions common.yaml
Expand Up @@ -22,6 +22,7 @@ ostree-layers:
- overlay/20platform-chrony
- overlay/21dhcp-chrony
- overlay/25azure-udev-rules
- overlay/30rhcos-nvme-compat-udev

arch-include:
x86_64:
Expand Down
2 changes: 2 additions & 0 deletions overlay.d/30rhcos-nvme-compat-udev/statoverride
@@ -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>
@@ -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
}
@@ -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"
16 changes: 15 additions & 1 deletion overlay.d/README.md
Expand Up @@ -39,9 +39,23 @@ lands in downstream packages. See upstream thread:
https://listengine.tuxfamily.org/chrony.tuxfamily.org/chrony-dev/2020/05/msg00022.html

25rhcos-azure-udev
-------------
------------------

We want to provide Azure udev rules as part of the initrd, so that Ignition
is able to detect disks and act on them. The WALinuxAgent-udev has been
changed to install udev rules into the initramfs, but that change isn't
in el8 yet. This can be dropped when moving to el9.

30rhcos-nvme-compat-udev
------------------------

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 overlay ships a rule that adds back the previous symlinks for backwards
compatibility. TBD when we can drop this, e.g. by having layered software use
the `eui` links instead or pivoting to GPT partition UUIDs. Customers may have
also manually typed the old symlink in their Ignition configs and other k8s
resources though. Those would require some communication before we can rip this
out.
29 changes: 29 additions & 0 deletions tests/kola/disk/nvme-compat-symlink
@@ -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"

0 comments on commit cc26b0b

Please sign in to comment.