Fixed a bug in install to disk that was excluding some types of drives like nvmes.
This commit is contained in:
@@ -35,7 +35,8 @@ detect_target_disks() {
|
|||||||
|
|
||||||
while IFS= read -r disk; do
|
while IFS= read -r disk; do
|
||||||
# Skip if it's a partition, loop device, CD-ROM, or the source device
|
# 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
|
if [[ -b "$disk" ]]; then
|
||||||
disks+=("$disk")
|
disks+=("$disk")
|
||||||
fi
|
fi
|
||||||
@@ -162,7 +163,7 @@ fi
|
|||||||
# Find the actual root partition (might not be partition 1)
|
# Find the actual root partition (might not be partition 1)
|
||||||
for part in "${TARGET_DEVICE}"*; do
|
for part in "${TARGET_DEVICE}"*; do
|
||||||
if [[ "$part" != "$TARGET_DEVICE" ]]; then
|
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
|
if [[ "$fstype" == "ext4" ]]; then
|
||||||
TARGET_ROOT_PART="$part"
|
TARGET_ROOT_PART="$part"
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user