V8.00.000.2025.06.17
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
59
func/partitioning/3290_uuid_logger.sh
Normal file
59
func/partitioning/3290_uuid_logger.sh
Normal file
@@ -0,0 +1,59 @@
|
||||
#!/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_ENCLABEL
|
||||
# HMP_PATH_FSUUID
|
||||
# HMP_PATH_PARTUUID
|
||||
# LOG_UID
|
||||
# Arguments:
|
||||
# None
|
||||
# Returns:
|
||||
# 0: on success
|
||||
#######################################
|
||||
uuid_logger() {
|
||||
declare var_key var_mountpoint var_uuid
|
||||
printf 'UUID Partition:\n' >> "${LOG_UID}"
|
||||
for var_key in "${!HMP_PATH_PARTUUID[@]}"; do
|
||||
# Remove Prefix "UUID_"
|
||||
var_mountpoint="${var_key#UUID_}"
|
||||
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 'UUID LUKS Container:\n' >> "${LOG_UID}"
|
||||
for var_key in "${!HMP_PATH_ENCLABEL[@]}"; do
|
||||
var_mountpoint="${HMP_PATH_ENCLABEL[${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 'UUID Filesystem:\n' >> "${LOG_UID}"
|
||||
for var_key in "${!HMP_PATH_FSUUID[@]}"; do
|
||||
# Remove Prefix "UUID_"
|
||||
var_mountpoint="${var_key#UUID_}"
|
||||
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
|
||||
|
||||
return 0
|
||||
}
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
Reference in New Issue
Block a user