detect install drive

This commit is contained in:
rootzoll 2025-01-19 10:30:27 +01:00
parent 8656d2179f
commit 58233df141

View File

@ -493,6 +493,19 @@ if [ "$action" = "status" ] || [ "$action" = "mount" ] || [ "$action" = "unmount
dataDeviceName=$(find_by_id_filename "${dataDevice}")
fi
#################
# Install Device
# find the first device (sd card, usb, cd rom) with a boot partition
installDevice=""
possibleInstallDevices = $(lsblk -o NAME,TRAN -d | grep -E 'mmc|usb|sr' | cut -d' ' -f1)
for device in ${possibleInstallDevices}; do
if parted "/dev/${device}" print 2>/dev/null | grep "^ *[0-9]" | grep -q "boot\|esp\|lba"; then
installDevice="${device}"
break
fi
done
#################
# Define Scenario
@ -564,6 +577,7 @@ if [ "$action" = "status" ] || [ "$action" = "mount" ] || [ "$action" = "unmount
echo "dataMountedPath='${dataMountedPath}'"
echo "dataConfigFound='${dataConfigFound}'"
echo "dataInspectSuccess='${dataInspectSuccess}'"
echo "installDevice='${installDevice}'"
echo "combinedDataStorage='${combinedDataStorage}'"
echo "bootFromStorage='${bootFromStorage}'"
echo "bootFromSD='${bootFromSD}'"