Fixed a bug in install to disk that was excluding some types of drives like nvmes.

This commit is contained in:
Storm Dragon
2025-08-15 13:54:16 -04:00
parent d80352f4c8
commit 529edde6a2

View File

@@ -35,7 +35,8 @@ detect_target_disks() {
while IFS= read -r disk; do
# Skip if it's a partition, loop device, CD-ROM, or the source device
if [[ ! "$disk" =~ [0-9]$ ]] && [[ ! "$disk" =~ ^/dev/loop ]] && [[ ! "$disk" =~ ^/dev/sr ]] && [[ "$disk" != "$source_device" ]]; then
# For partitions: skip sda1, nvme0n1p1, mmcblk0p1, but keep sda, nvme0n1, mmcblk0
if [[ ! "$disk" =~ (sd[a-z][0-9]+|nvme[0-9]+n[0-9]+p[0-9]+|mmcblk[0-9]+p[0-9]+)$ ]] && [[ ! "$disk" =~ ^/dev/loop ]] && [[ ! "$disk" =~ ^/dev/sr ]] && [[ "$disk" != "$source_device" ]]; then
if [[ -b "$disk" ]]; then
disks+=("$disk")
fi
@@ -162,7 +163,7 @@ fi
# Find the actual root partition (might not be partition 1)
for part in "${TARGET_DEVICE}"*; do
if [[ "$part" != "$TARGET_DEVICE" ]]; then
local fstype=$(lsblk -no FSTYPE "$part" 2>/dev/null)
fstype=$(lsblk -no FSTYPE "$part" 2>/dev/null)
if [[ "$fstype" == "ext4" ]]; then
TARGET_ROOT_PART="$part"
break