From 529edde6a249b3121a217b7c0ceca2af13549f05 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Fri, 15 Aug 2025 13:54:16 -0400 Subject: [PATCH] Fixed a bug in install to disk that was excluding some types of drives like nvmes. --- usr/local/bin/install_to_disk.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr/local/bin/install_to_disk.sh b/usr/local/bin/install_to_disk.sh index 8b07a5f..8fb873e 100755 --- a/usr/local/bin/install_to_disk.sh +++ b/usr/local/bin/install_to_disk.sh @@ -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