Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion configs/airootfs/root/configurator
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,36 @@ get_disk_info() {
echo "$display"
}

get_root_disk() {
local device="$1"
local parent

[[ -n $device ]] || return 1

# /run/archiso/bootmnt usually resolves to the boot partition, but the
# installer picker works with whole disks. Walk back to the parent disk so
# the install media itself never shows up as a wipe target.
device=$(readlink -f "$device" 2>/dev/null || printf "%s\n" "$device")

while true; do
parent=$(lsblk -no PKNAME "$device" 2>/dev/null | tail -n1)
[[ -n $parent ]] || break
device="/dev/$parent"
done

if [[ $(lsblk -dno TYPE "$device" 2>/dev/null) == "disk" ]]; then
printf "%s\n" "$device"
fi
}

disk_form() {
step "Let's select where to install Omarchy..."

# Don't offer the install media as an option (Arch ISO mounts it here)
local boot_source
local exclude_disk
exclude_disk=$(findmnt -no SOURCE /run/archiso/bootmnt 2>/dev/null || true)
boot_source=$(findmnt -no SOURCE /run/archiso/bootmnt 2>/dev/null || true)
exclude_disk=$(get_root_disk "$boot_source")

# List all installable disks, excluding the boot device if present
local available_disks
Expand Down