home · contact · privacy
With NAME_LUKSVG hardcoded, less need for illegal-chars testing.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 3 Sep 2026 06:51:58 +0000 (06:51 +0000)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 3 Sep 2026 06:51:58 +0000 (06:51 +0000)
_lib.sh
install_debian.sh

diff --git a/_lib.sh b/_lib.sh
index f6293cdc22c1ebc679f758bfd4a03db3f6020791..7f4bcc3c4ae75b4d664e4d6415dea476f05b571a 100644 (file)
--- 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}" ]\
index 040ddc209b9399c015a6c6d1a25431fcc3085757..f2f801f9585b6656317803cab3a36d76d2f9ffde 100755 (executable)
@@ -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 \