diff --git a/scripts/config.sh b/scripts/config.sh index d764868..6519aaf 100644 --- a/scripts/config.sh +++ b/scripts/config.sh @@ -116,6 +116,7 @@ function register_existing() { local new_id="${arguments[new_id]}" local device="${arguments[device]}" create_resolve_entry_device "$new_id" "$device" + DISK_ACTIONS+=("action=existing" "$@" ";") } # Named arguments: @@ -348,7 +349,7 @@ function create_single_disk_layout() { die "'create_single_disk_layout' is deprecated, please use 'create_classic_single_disk_layout' instead. It is fully option-compatible to the old version." } -# Skip partitioning, and use existing partitions. +# Skip partitioning, and use existing pre-formatted partitions. These must be trivially mountable. # Parameters: # swap= Use the given device as swap, or no swap at all if set to false # boot= Use the given device as the bios/efi partition. diff --git a/scripts/functions.sh b/scripts/functions.sh index 43f3583..ce9c0a1 100644 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -163,6 +163,14 @@ function summary_color_args() { done } +function disk_existing() { + local new_id="${arguments[new_id]}" + if [[ ${disk_action_summarize_only-false} == "true" ]]; then + add_summary_entry __root__ "$new_id" "${arguments[device]}" "(no-format, existing)" "" + fi + # no-op; +} + function disk_create_gpt() { local new_id="${arguments[new_id]}" if [[ ${disk_action_summarize_only-false} == "true" ]]; then @@ -563,6 +571,7 @@ function apply_disk_action() { unset known_arguments unset arguments; declare -A arguments; parse_arguments "$@" case "${arguments[action]}" in + 'existing') disk_existing ;; 'create_gpt') disk_create_gpt ;; 'create_partition') disk_create_partition ;; 'create_raid') disk_create_raid ;;