From: Ian Kelling Date: Wed, 11 Sep 2024 19:46:45 +0000 (-0400) Subject: minor partioning fixes X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=37e4b73e1af54fc97e4b4cb69773276283635266;p=automated-distro-installer minor partioning fixes --- diff --git a/fai/config/hooks/partition.DEFAULT b/fai/config/hooks/partition.DEFAULT index b47b5ba..5d13b99 100755 --- a/fai/config/hooks/partition.DEFAULT +++ b/fai/config/hooks/partition.DEFAULT @@ -16,6 +16,9 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # todo /boot/chboot needs update for lvm i think? +# +# todo: this is complicated enough that set -u is appropriate, but +# needs some changes in how we check for empty vars. PS4='+ $LINENO ' set -eE -o pipefail @@ -472,7 +475,7 @@ lvmwipe() { vg_wipes+=($vg) lvs=$(vgs --noheadings -o lv_path $vg) for lv in $lvs; do - d wipefs -a $lv + d wipefs --backup -a $lv done done fi @@ -499,7 +502,7 @@ devwipe() { # we don't want any old fses hanging around. count_down=10 # wipefs has failed, manual run works, google suggests timing issue - while ! wipefs -a $dev; do + while ! wipefs --backup -a $dev*; do sleep 2 count_down=$((count_down - 1)) if (( count_down <= 0 )); then @@ -883,7 +886,7 @@ if $partition; then if [[ $SPECIAL_DISK ]]; then lvmwipe -n $SPECIAL_DISK if $would_wipe; then - echo "wipefs -a $SPECIAL_DISK" + echo wipefs --backup -a $SPECIAL_DISK* echo "$0: exiting. review and execute above wipefs commands manually" exit 0 fi @@ -976,7 +979,7 @@ if $partition; then fi fi - if [[ $SPECIAL_DISK ]]; then + if [[ $SPECIAL_DISK ]] && ! $fsf; then lvcreate -y -L $root_mib $vg -n data else # -L unit default mebibyte @@ -1039,7 +1042,9 @@ if $partition; then done sleep 3 - mkfs.fat -F32 $dev$efisuf + if ! $fsf; then + mkfs.fat -F32 $dev$efisuf + fi if ! fsf && $even_big_part && [[ $dev == "$even_big_dev" ]]; then luks-setup $even_big_dev$even_bigsuf ${even_big_dev##*/}$even_bigsuf