From fd7a433d10464705cc99dcde93237a24d6785c02 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Thu, 4 Jul 2024 22:08:50 +0200 Subject: [PATCH] init/functions: fix loader disk bus Signed-off-by: AuxXxilium --- files/initrd/opt/arc/include/functions.sh | 4 ++-- files/initrd/opt/arc/init.sh | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/files/initrd/opt/arc/include/functions.sh b/files/initrd/opt/arc/include/functions.sh index f0ebdd16..86c3d80d 100755 --- a/files/initrd/opt/arc/include/functions.sh +++ b/files/initrd/opt/arc/include/functions.sh @@ -212,8 +212,8 @@ function _sort_netif() { ETHX="$(ls /sys/class/net/ 2>/dev/null | grep eth)" # real network cards list for ETH in ${ETHX}; do MAC="$(cat /sys/class/net/${ETH}/address 2>/dev/null | sed 's/://g' | tr '[:upper:]' '[:lower:]')" - BUS="$(ethtool -i ${ETH} 2>/dev/null | grep bus-info | cut -d' ' -f2)" - ETHLIST="${ETHLIST}${BUS} ${MAC} ${ETH}\n" + ETHBUS="$(ethtool -i ${ETH} 2>/dev/null | grep bus-info | cut -d' ' -f2)" + ETHLIST="${ETHLIST}${ETHBUS} ${MAC} ${ETH}\n" done ETHLISTTMPM="" ETHLISTTMPB="$(echo -e "${ETHLIST}" | sort)" diff --git a/files/initrd/opt/arc/init.sh b/files/initrd/opt/arc/init.sh index 2cb038d6..be0e2015 100755 --- a/files/initrd/opt/arc/init.sh +++ b/files/initrd/opt/arc/init.sh @@ -120,18 +120,18 @@ echo VID="0x46f4" PID="0x0001" -# Inform user and check bus -echo -e "Loader Disk: \033[1;34m${LOADER_DISK}\033[0m" -echo -e "Loader Disk Type: \033[1;34m${BUS}\033[0m" - BUSLIST="usb sata scsi nvme mmc xen" if [ "${BUS}" == "usb" ]; then VID="0x$(udevadm info --query property --name "${LOADER_DISK}" | grep ID_VENDOR_ID | cut -d= -f2)" PID="0x$(udevadm info --query property --name "${LOADER_DISK}" | grep ID_MODEL_ID | cut -d= -f2)" elif ! echo "${BUSLIST}" | grep -wq "${BUS}"; then - die "Loader Disk ${BUS} is not USB or SATA/SCSI/NVME/eMMC" + die "Loader Disk (${BUS}) is not USB or SATA/SCSI/NVME/eMMC" fi +# Inform user and check bus +echo -e "Loader Disk: \033[1;34m${LOADER_DISK}\033[0m" +echo -e "Loader Disk Type: \033[1;34m${BUS}\033[0m" + # Save variables to user config file writeConfigKey "vid" ${VID} "${USER_CONFIG_FILE}" writeConfigKey "pid" ${PID} "${USER_CONFIG_FILE}"