From: Christian Heller Date: Thu, 3 Sep 2026 08:13:05 +0000 (+0000) Subject: Minor code consistency fixes. X-Git-Url: https://plomlompom.com/repos/%22https:/validator.w3.org/edit?a=commitdiff_plain;ds=inline;p=confplom Minor code consistency fixes. --- diff --git a/_lib.sh b/_lib.sh index 26dde06..c7002c6 100644 --- a/_lib.sh +++ b/_lib.sh @@ -22,7 +22,7 @@ path_vg() { printf '%s/%s' "${PATH_DEV}" "$1" } -# helpers: logging, testing, failing basics +# helpers: logging, testing, failing basics msg_nonl() { printf '[## %s ##] ' "${SCRIPT_NAME}" # shellcheck disable=SC2059 @@ -44,7 +44,7 @@ try_quiet() { "$@" >/dev/null 2>&1 } -# helpers: more involved testing +# helpers: more involved testing check_tools() { for CMD in "$@"; do try_quiet command -v "${CMD}"\ @@ -76,18 +76,18 @@ check_input_openable_luksvg() { } # helpers: luks open/close -open_luksvg () { +open_luksvg() { local PARTITION=$1 msg 'Opening LUKS container as "%s" …' "${NAME_LUKSVG}" cryptsetup luksOpen "${PARTITION}" "${NAME_LUKSVG}" } -close_luksvg () { +close_luksvg() { msg 'Deactivating volume group and closing LUKS container …' vgchange -an "${NAME_LUKSVG}" cryptsetup luksClose "${NAME_LUKSVG}" } -# helpers: mount/unmount root +# helpers: mount/unmount root mount_privately() { local TO_MOUNT=$1 local DEST=$2 diff --git a/chrooted_command.sh b/chrooted_command.sh index 8e0033a..9c1f74f 100755 --- a/chrooted_command.sh +++ b/chrooted_command.sh @@ -11,7 +11,7 @@ COMMAND=$3 PATH_VG_ROOT=$(path_vg "${NAME_LUKSVG}")/${NAME_ROOT} # sanity checks -check_tools cryptsetup vgs +check_tools cryptsetup vgchange vgs check_input_partition_mountable "${PARTITION}" check_input_openable_luksvg "${PARTITION}" diff --git a/install_debian.sh b/install_debian.sh index 6dce243..a8a3330 100755 --- a/install_debian.sh +++ b/install_debian.sh @@ -35,7 +35,7 @@ PATH_VG_ROOT=${PATH_VG}/${NAME_ROOT} PATH_VG_SWAP=${PATH_VG}/${NAME_SWAP} # sanity checks -check_tools cryptsetup debootstrap efibootmgr lvcreate mkfs.ext4 vgs +check_tools cryptsetup debootstrap efibootmgr lvcreate mkfs.ext4 vgchange vgs check_input_partition_mountable "${PARTITION}" check_input_openable_luksvg "${PARTITION}" case "${NAME_BOOT}" in *[!A-Za-z0-9_.-]*|"") diff --git a/setup_luksvg.sh b/setup_luksvg.sh index 885966c..9b7d99e 100755 --- a/setup_luksvg.sh +++ b/setup_luksvg.sh @@ -17,7 +17,7 @@ PATH_VG_DATA=${PATH_VG}/${NAME_DATA} PATH_VG_SWAP=${PATH_VG}/${NAME_SWAP} # sanity checks -check_tools cryptsetup lvcreate mkfs.ext4 mkswap pvcreate vgcreate vgs +check_tools cryptsetup lvcreate mkfs.ext4 mkswap vgchange vgcreate vgs check_input_partition_mountable "${PARTITION}" check_new_luksvg try_quiet cryptsetup isLuks "${PARTITION}"\