From 32958d2e9f076853284d63b0fc5460bf21ece10d Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Mon, 16 Feb 2026 02:19:00 -0500 Subject: [PATCH] minor improvements --- fai/config/hooks/partition.DEFAULT | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/fai/config/hooks/partition.DEFAULT b/fai/config/hooks/partition.DEFAULT index 34abf44..82cc314 100755 --- a/fai/config/hooks/partition.DEFAULT +++ b/fai/config/hooks/partition.DEFAULT @@ -66,7 +66,10 @@ Options -s SPECIAL_DISK For use outside of fai. A base disk name like /dev/sdk. If set, we just cryptsetup and partition this one disk then -exit. This also sets REPARTITION. +exit. This also sets REPARTITION & prompts. REMINDER! Collect /tmp/fai/{crypttab,fstab} +before running the script again. + +-y Disable prompt from -s. ARGS (only 0 or 1 is valid). All args are for use outside of fai. @@ -140,9 +143,11 @@ fi ##### begin command line parsing ######## +skip_o=false data_part=false max_size=false -temp=$(getopt -l help hc:dms: "$@") || usage 1 +do_special_disk_prompt=true +temp=$(getopt -l help hc:dms:y "$@") || usage 1 eval set -- "$temp" while true; do case $1 in @@ -154,9 +159,15 @@ while true; do boot_devs_count=$2 shift ;; - -d) data_part=true ;; + -d) + data_part=true + skip_o=true + ;; -m) max_size=true ;; -s) special_disk="$2"; shift ;; + -y) + do_special_disk_prompt=false + ;; -h|--help) usage ;; --) shift; break ;; *) echo "$0: Internal error! unexpected args: $*" ; exit 1 ;; @@ -385,7 +396,7 @@ crypt-$vg-root /dev/$vg/root none keyscript=/root/keyscript,discard,luks,initr crypt-$vg-swap /dev/$vg/swap /dev/urandom nofail,swap,cipher=aes-xts-plain64,size=256,hash=ripemd160 EOF if ! $skip_o; then - cat >>/tmp/fai/crypttab <>/tmp/fai/crypttab <