From 8be8973f165b383331ecee2269f787126c799062 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Wed, 3 Jul 2024 20:51:07 +0200 Subject: [PATCH] functions: reset getbus Signed-off-by: AuxXxilium --- files/initrd/opt/arc/include/functions.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/files/initrd/opt/arc/include/functions.sh b/files/initrd/opt/arc/include/functions.sh index 175e6c19..8424f356 100755 --- a/files/initrd/opt/arc/include/functions.sh +++ b/files/initrd/opt/arc/include/functions.sh @@ -255,9 +255,7 @@ function getBus() { # usb/sata(sata/ide)/nvme [ -z "${BUS}" ] && BUS=$(lsblk -dpno KNAME,TRAN 2>/dev/null | grep "${1} " | awk '{print $2}') #Spaces are intentional # usb/scsi(sata/ide)/virtio(scsi/virtio)/mmc/nvme - [ -z "${BUS}" ] && BUS=$(lsblk -dpno KNAME,SUBSYSTEMS 2>/dev/null | grep "${1} " | awk '{print $2}' | awk -F':' '{print $(NF-1)}' | sed 's/_host//') # Spaces are intentional - # xen - [ -z "${BUS}" ] && BUS=$(lsblk -dpno KNAME,SUBSYSTEMS 2>/dev/null | grep "${1} " | grep -q "xen" && echo "xen") + [ -z "${BUS}" ] && BUS=$(lsblk -dpno KNAME,SUBSYSTEMS 2>/dev/null | grep "${1} " | awk -F':' '{print $(NF-1)}' | sed 's/_host//') #Spaces are intentional echo "${BUS}" return 0 }