V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 45s

Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
2025-07-29 18:50:39 +02:00
parent ca72cf915b
commit 6ff5ebb430
9 changed files with 157 additions and 178 deletions

View File

@@ -26,9 +26,9 @@ guard_sourcing
#######################################
mount_with_dir() {
declare var_mount_path="$1" var_mount_device="$2" var_mount_options="${3:-}"
declare -a ary_cmd=(mount)
declare -a ary_cmd=( mount )
if [[ "${var_mount_device}" =~ ^[0-9a-fA-F-]{8,}$ ]]; then
if [[ "${var_mount_device}" =~ ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}$ ]] || [[ "${var_mount_device}" =~ ^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$ ]]; then
if [[ -e "/dev/disk/by-uuid/${var_mount_device}" ]]; then
@@ -149,6 +149,11 @@ mount_partition() {
var_encryption_label=$(get_label "${var_mount_path}" "${var_fs_version}" "luks")
var_fs_uuid="${HMP_PATH_FSUUID["${var_mount_path}"]}"
if [[ -z "${var_fs_uuid}" ]]; then
do_log "error" "file_only" "3280() FS-UUID for mount path: '${var_mount_path}' not found in: 'HMP_PATH_FSUUID'."
return "${ERR_MOUNTING_DEV}"
fi
### Mounting of Ephemeral 'SWAP' and '/tmp' as per https://wiki.archlinux.org/title/Dm-crypt/Swap_encryption#UUID_and_LABEL
if [[ "${var_mount_path,,}" == "swap" ]]; then
@@ -175,7 +180,7 @@ mount_partition() {
mkdir -p "${TARGET}/tmp"
safe_exec mkfs.ext4 -E nodiscard,lazy_itable_init=1,lazy_journal_init=1 "/dev/mapper/${var_encryption_label}" "${ERR_MOUNTING_DEV}" || return "${ERR_MOUNTING_DEV}"
safe_exec mkfs.ext4 -E lazy_itable_init=1,lazy_journal_init=1 "/dev/mapper/${var_encryption_label}" "${ERR_MOUNTING_DEV}" || return "${ERR_MOUNTING_DEV}"
### Gathering information for '/etc/fstab'-generation in 4040().
HMP_FSTAB_MOUNT_OPTS["${var_mount_path}"]="${var_mount_options}"
@@ -225,10 +230,11 @@ mount_partition() {
validate_btrfs_compression "${var_fs_btrfs_compress}" "${var_fs_btrfs_level}" || return "${ERR_BTRFS_OPTION}"
var_btrfs_options="compress=${var_fs_btrfs_compress}:${var_fs_btrfs_level}"
[[ -n "${var_mount_options}" ]] && var_btrfs_options+="${var_mount_options},${var_btrfs_options},subvol=${var_fs_btrfs_subvolume}"
[[ -z "${var_mount_options}" ]] && var_btrfs_options+="${var_btrfs_options},subvol=${var_fs_btrfs_subvolume}"
if [[ -n "${var_mount_options}" ]]; then
var_btrfs_options="${var_mount_options},compress=${var_fs_btrfs_compress}:${var_fs_btrfs_level},subvol=${var_fs_btrfs_subvolume}"
else
var_btrfs_options="compress=${var_fs_btrfs_compress}:${var_fs_btrfs_level},subvol=${var_fs_btrfs_subvolume}"
fi
### Gathering information for '/etc/fstab'-generation in 4040().
HMP_FSTAB_MOUNT_OPTS["${var_mount_path}"]="${var_btrfs_options}"
@@ -243,7 +249,11 @@ mount_partition() {
mkdir -p "${TARGET}${var_mount_path}/.snapshots"
do_log "info" "file_only" "3280() Created: '${TARGET}${var_mount_path}/.snapshots'."
var_mount_optsnap="${var_mount_optsnap},subvol=${var_snapshot}"
if [[ -n "${var_mount_optsnap}" ]]; then
var_mount_optsnap+=",subvol=${var_snapshot}"
else
var_mount_optsnap="subvol=${var_snapshot}"
fi
### Gathering information for '/etc/fstab'-generation in 4040().
HMP_FSTAB_MOUNT_OPTS["${var_mount_path}/.snapshots"]="${var_mount_optsnap}"