From 1b5553c289553cc15c9f29825af1fe5e26d194b1 Mon Sep 17 00:00:00 2001 From: YZ775 Date: Mon, 23 Dec 2024 01:53:24 +0000 Subject: [PATCH] ignore BOSS disk in crypt-base-path for ss2 --- .../roles/ss2/files/etc/udev/crypt-base-path | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/ignitions/roles/ss2/files/etc/udev/crypt-base-path b/ignitions/roles/ss2/files/etc/udev/crypt-base-path index 08199f91b..3f3f2f048 100755 --- a/ignitions/roles/ss2/files/etc/udev/crypt-base-path +++ b/ignitions/roles/ss2/files/etc/udev/crypt-base-path @@ -14,18 +14,25 @@ UDEV_LINKS=$(udevadm info -q symlink -n /dev/$CRYPT_DEV) output_log "CRYPT_DEV: $CRYPT_DEV DISK_DEV:$DISK_DEV" output_log "UDEV_LINKS:$UDEV_LINKS" -for symlink in $UDEV_LINKS; do - case ${symlink} in - disk/by-path/virtio-*) - ;; - disk/by-path/*-ata-*) - ;; - disk/by-path/*) - output_log "find a symlink:$symlink" - CRYPT_BASE_PATH=${symlink#disk/by-path/} - ;; - esac -done +if grep -q BOSS /sys/block/$CRYPT_DEV/device/model; then + # ignore the BOSS disk +else + for symlink in $UDEV_LINKS; do + if grep -q BOSS /sys/block/$sd/device/model; then + echo /dev/mapper/crypt-$sd + fi + case ${symlink} in + disk/by-path/virtio-*) + ;; + disk/by-path/*-ata-*) + ;; + disk/by-path/*) + output_log "find a symlink:$symlink" + CRYPT_BASE_PATH=${symlink#disk/by-path/} + ;; + esac + done +fi if [ -z "$CRYPT_BASE_PATH" ]; then output_log "could not find symlinks"