tree: fix proxmox/unraid boot issue

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-08-08 13:48:38 +02:00
parent abac77944a
commit 1cb8bf76f1
5 changed files with 8 additions and 6 deletions

View File

@ -58,7 +58,7 @@ function bootDSM () {
HASATA=0
for D in $(lsblk -dpno NAME); do
[ "${D}" == "${LOADER_DISK}" ] && continue
if [ "$(getBus "${D}")" == "sata" ] || [ "$(getBus "${D}")" == "scsi" ]; then
if echo "sata sas scsi" | grep -qw "$(getBus "${D}")"; then
HASATA=1
break
fi

View File

@ -263,8 +263,8 @@ function _sort_netif() {
# 1 - device path
function getBus() {
local BUS=""
# usb/ata(ide)/sata/sas/virtio/mmc/nvme
[ -z "${BUS}" ] && BUS=$(lsblk -dpno KNAME,TRAN 2>/dev/null | grep "${1} " | awk '{print $2}' | sed 's/^ata$/ide/') #Spaces are intentional
# usb/ata(ide)/sata/sas/spi(scsi)/virtio/mmc/nvme
[ -z "${BUS}" ] && BUS=$(lsblk -dpno KNAME,TRAN 2>/dev/null | grep "${1} " | awk '{print $2}' | sed 's/^ata$/ide/' | sed 's/^spi$/scsi/') #Spaces are intentional
# usb/scsi(ide/sata/sas)/virtio/mmc/nvme/vmbus/xen(xvd)
[ -z "${BUS}" ] && BUS=$(lsblk -dpno KNAME,SUBSYSTEMS 2>/dev/null | grep "${1} " | awk '{print $2}' | awk -F':' '{print $(NF-1)}' | sed 's/_host//' | sed 's/^.*xen.*$/xen/') # Spaces are intentional
[ -z "${BUS}" ] && BUS="unknown"

View File

@ -85,7 +85,7 @@ if grep -q "automated_arc" /proc/cmdline; then
else
writeConfigKey "automated" "false" "${USER_CONFIG_FILE}"
fi
[ "${ARC_BRANCH}" == "next" ] && initConfigKey "arc.branch" "next" "${USER_CONFIG_FILE}" || initConfigKey "arc.branch" "" "${USER_CONFIG_FILE}"
[ -f "${PART1_PATH}/ARC-BRANCH" ] && initConfigKey "arc.branch" "next" "${USER_CONFIG_FILE}" || initConfigKey "arc.branch" "" "${USER_CONFIG_FILE}"
[ -f "${PART3_PATH}/automated" ] && rm -f "${PART3_PATH}/automated" >/dev/null 2>&1 || true
# Check for compatibility
compatboot
@ -127,12 +127,12 @@ echo
VID="0x46f4"
PID="0x0001"
BUSLIST="usb sata scsi nvme mmc ide vmbus xen"
BUSLIST="usb sata sas scsi nvme mmc ide virtio vmbus 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 isn't USB or SATA/SCSI/NVME/MMC/IDE/VMBUS/XEN"
die "$(printf "The boot disk does not support the current %s, only %s are supported." "${BUS}" "${BUSLIST// /\/}")"
fi
# Inform user and check bus

View File

@ -84,6 +84,7 @@ sudo mount ${LOOPX}p3 "/tmp/p3"
VERSION=$(date +'%y.%-m.dev')
echo "${VERSION}" >files/p1/ARC-VERSION
echo "${VERSION}" >VERSION
echo "next" >files/p1/ARC-BRANCH
sed 's/^ARC_VERSION=.*/ARC_VERSION="'${VERSION}'"/' -i files/initrd/opt/arc/include/consts.sh
echo "Repack initrd"

View File

@ -39,6 +39,7 @@ sudo mount ${LOOPX}p3 "/tmp/p3"
VERSION=$(date +'%y.%-m.dev')
echo "${VERSION}" >files/p1/ARC-VERSION
echo "${VERSION}" >VERSION
echo "next" >files/p1/ARC-BRANCH
sed 's/^ARC_VERSION=.*/ARC_VERSION="'${VERSION}'"/' -i files/initrd/opt/arc/include/consts.sh
echo "Repack initrd"