Files
CISS.debian.installer/func/cdi_3200_partitioning/3290_uuid_logger.sh
Marc S. Weidner 72dcf355d9
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 2m28s
V8.00.000.2025.06.17
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
2025-10-07 17:27:17 +01:00

70 lines
2.2 KiB
Bash

#!/bin/bash
# SPDX-Version: 3.0
# SPDX-CreationInfo: 2025-06-17; WEIDNER, Marc S.; <msw@coresecret.dev>
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.installer.git
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
# SPDX-FileCopyrightText: 2024-2025; WEIDNER, Marc S.; <msw@coresecret.dev>
# SPDX-FileType: SOURCE
# SPDX-License-Identifier: EUPL-1.2 OR LicenseRef-CCLA-1.0
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
# SPDX-PackageName: CISS.debian.installer
# SPDX-Security-Contact: security@coresecret.eu
guard_sourcing
#######################################
# Logger for all generated partition, LUKS container and file system UUIDs.
# Globals:
# HMP_PATH_FSUUID
# HMP_PATH_LUKSUUID
# HMP_PATH_PARTUUID
# LOG_UID
# Arguments:
# None
# Returns:
# 0: on success
#######################################
uuid_logger() {
declare var_key="" var_mountpoint="" var_uuid=""
printf 'PARTITION UUID Partition:\n' >> "${LOG_UID}"
for var_key in "${!HMP_PATH_PARTUUID[@]}"; do
var_mountpoint="${var_key}"
var_uuid="${HMP_PATH_PARTUUID[${var_key}]}"
### Left-aligned field width 63; "UUID=" starts directly after column 64.
printf '%-63sUUID=%s\n' "${var_mountpoint}" "${var_uuid}" >> "${LOG_UID}"
done
printf '\n' >> "${LOG_UID}"
printf 'LUKS CONTAINER UUID:\n' >> "${LOG_UID}"
for var_key in "${!HMP_PATH_LUKSUUID[@]}"; do
var_mountpoint="${var_key}"
var_uuid="${HMP_PATH_LUKSUUID[${var_key}]}"
### Left-aligned field width 63; "UUID=" starts directly after column 64.
printf '%-63sUUID=%s\n' "${var_mountpoint}" "${var_uuid}" >> "${LOG_UID}"
done
printf '\n' >> "${LOG_UID}"
printf 'FILESYSTEM UUID:\n' >> "${LOG_UID}"
for var_key in "${!HMP_PATH_FSUUID[@]}"; do
var_mountpoint="${var_key}"
var_uuid="${HMP_PATH_FSUUID[${var_key}]}"
### Left-aligned field width 63; "UUID=" starts directly after column 64.
printf '%-63sUUID=%s\n' "${var_mountpoint}" "${var_uuid}" >> "${LOG_UID}"
done
guard_dir && return 0
}
### Prevents accidental 'unset -f'.
# shellcheck disable=SC2034
readonly -f uuid_logger
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh