From 44f68e6bac39c8f75c0e8704b05b9361f7c221b4 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Thu, 3 Sep 2026 06:51:58 +0000 Subject: [PATCH] With NAME_LUKSVG hardcoded, less need for illegal-chars testing. --- _lib.sh | 6 ------ install_debian.sh | 4 +++- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/_lib.sh b/_lib.sh index f6293cd..7f4bcc3 100644 --- a/_lib.sh +++ b/_lib.sh @@ -44,11 +44,6 @@ try_quiet() { } # helpers: more involved testing -check_chars_legality() { - case "$1" in *[!A-Za-z0-9_.-]*|"") - error "illegal characters in $2 '$1'" ;; - esac -} check_tools() { for CMD in "$@"; do try_quiet command -v "${CMD}"\ @@ -66,7 +61,6 @@ check_input_partition_mountable() { check_new_luksvg() { local PATH_LUKS_MAPPER PATH_LUKS_MAPPER=$(path_luks_mapper "${NAME_LUKSVG}") - check_chars_legality "${NAME_LUKSVG}" "volume group name" try_quiet vgs "${NAME_LUKSVG}"\ && error "volume group '${NAME_LUKSVG}' already exists" [ -e "${PATH_LUKS_MAPPER}" ]\ diff --git a/install_debian.sh b/install_debian.sh index 040ddc2..f2f801f 100755 --- a/install_debian.sh +++ b/install_debian.sh @@ -38,7 +38,9 @@ PATH_VG_SWAP=${PATH_VG}/${NAME_SWAP} check_tools cryptsetup debootstrap efibootmgr lvcreate mkfs.ext4 vgs check_input_partition_mountable "${PARTITION}" check_input_openable_luksvg "${PARTITION}" -check_chars_legality "${NAME_BOOT}" "boot label" +case "$1" in *[!A-Za-z0-9_.-]*|"") + error "illegal characters in boot label '${NAME_BOOT}'" ;; +esac [ -e "${PATH_EFI}/${NAME_BOOT}" ]\ && error "${PATH_EFI}/${NAME_BOOT} already exists" efibootmgr \ -- 2.30.2