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

Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
2025-08-29 00:15:16 +02:00
parent 495b28d89d
commit 775f68d79e
3 changed files with 22 additions and 22 deletions

View File

@@ -343,20 +343,20 @@ partitioning() {
### Prepare mount ordering scheme. ### Prepare mount ordering scheme.
# shellcheck disable=SC2312 # shellcheck disable=SC2312
IFS=$'\n' read -r -d '' -a ARY_PATHS_SORTED < <( #IFS=$'\n' read -r -d '' -a ARY_PATHS_SORTED < <(
printf "%s\n" "${ary_paths_unsorted[@]}" \ # printf "%s\n" "${ary_paths_unsorted[@]}" \
| sort -u \ # | sort -u \
| awk ' # | awk '
BEGIN{root_seen=0} # BEGIN{root_seen=0}
$0=="/"{root_seen=1; print; next} # $0=="/"{root_seen=1; print; next}
$0=="SWAP"{swap=1; next} # $0=="SWAP"{swap=1; next}
/^\//{print; next} # /^\//{print; next}
{print} # any other tokens if ever used # {print} # any other tokens if ever used
END{ if (swap) print "SWAP" } # END{ if (swap) print "SWAP" }
' \ # ' \
&& printf "\0" # && printf "\0"
) #)
#IFS=$'\n' read -r -d '' -a ARY_PATHS_SORTED < <(printf "%s\n" "${ary_paths_unsorted[@]}" | sort -u | awk 'BEGIN{FS="/"}{print NF, $0}' | sort -n | cut -d' ' -f2- && printf '\0') IFS=$'\n' read -r -d '' -a ARY_PATHS_SORTED < <(printf "%s\n" "${ary_paths_unsorted[@]}" | sort -u | awk 'BEGIN{FS="/"}{print NF, $0}' | sort -n | cut -d' ' -f2- && printf '\0')
printf "%s\n" "${ary_paths_unsorted[@]}" >| "${DIR_LOG}/mount_paths_unsorted.log" printf "%s\n" "${ary_paths_unsorted[@]}" >| "${DIR_LOG}/mount_paths_unsorted.log"
printf "%s\n" "${ARY_PATHS_SORTED[@]}" >| "${DIR_LOG}/mount_paths_sorted.log" printf "%s\n" "${ARY_PATHS_SORTED[@]}" >| "${DIR_LOG}/mount_paths_sorted.log"

View File

@@ -29,16 +29,18 @@ write_fstab() {
declare write_maps="$1" write_path="$2" write_type="$3" write_opts="$4" write_pass="$5" declare write_maps="$1" write_path="$2" write_type="$3" write_opts="$4" write_pass="$5"
#if [[ "${write_maps}" =~ ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}$ ]] || [[ "${write_maps}" =~ ^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$ ]]; then #if [[ "${write_maps}" =~ ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}$ ]] || [[ "${write_maps}" =~ ^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$ ]]; then
if [[ "${write_maps}" =~ ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}$ ]] || [[ "${write_maps}" =~ ^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}$ ]] || [[ "${write_maps}" =~ ^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$ ]]; then #if [[ "${write_maps}" =~ ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}$ ]] || [[ "${write_maps}" =~ ^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}$ ]] || [[ "${write_maps}" =~ ^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$ ]]; then
printf "%-43s%-28s%-18s%-100s0 %s\n" "UUID=${write_maps}" "${write_path}" "${write_type}" "${write_opts}" "${write_pass}" >> "${TARGET}/etc/fstab" if [[ "${write_maps}" == /dev/mapper/* ]]; then
do_log "info" "file_only" "4200() fstab entry generated: [UUID=${write_maps} ${write_path} ${write_type} ${write_opts} 0 ${write_pass}]."
elif [[ "${write_maps}" == /dev/mapper/* ]]; then
printf "%-43s%-28s%-18s%-100s0 %s\n" "${write_maps}" "${write_path}" "${write_type}" "${write_opts}" "${write_pass}" >> "${TARGET}/etc/fstab" printf "%-43s%-28s%-18s%-100s0 %s\n" "${write_maps}" "${write_path}" "${write_type}" "${write_opts}" "${write_pass}" >> "${TARGET}/etc/fstab"
do_log "info" "file_only" "4200() fstab entry generated: [${write_maps} ${write_path} ${write_type} ${write_opts} 0 ${write_pass}]." do_log "info" "file_only" "4200() fstab entry generated: [${write_maps} ${write_path} ${write_type} ${write_opts} 0 ${write_pass}]."
else
printf "%-43s%-28s%-18s%-100s0 %s\n" "UUID=${write_maps}" "${write_path}" "${write_type}" "${write_opts}" "${write_pass}" >> "${TARGET}/etc/fstab"
do_log "info" "file_only" "4200() fstab entry generated: [UUID=${write_maps} ${write_path} ${write_type} ${write_opts} 0 ${write_pass}]."
fi fi
return 0 return 0

View File

@@ -51,9 +51,7 @@ gen_dir_files() {
touch "${LOG_DBS}" && chmod 0600 "${LOG_DBS}" touch "${LOG_DBS}" && chmod 0600 "${LOG_DBS}"
touch "${VAR_PRESEED}" && chmod 0600 "${VAR_PRESEED}" touch "${VAR_PRESEED}" && chmod 0600 "${VAR_PRESEED}"
touch "${DIR_LOG}/btrfs.log" && chmod 0600 "${DIR_LOG}/btrfs.log" touch "${DIR_LOG}/btrfs.log" && chmod 0600 "${DIR_LOG}/btrfs.log"
touch "${DIR_LOG}/cpu.log" && chmod 0600 "${DIR_LOG}/cpu.log"
touch "${DIR_LOG}/ext4.log" && chmod 0600 "${DIR_LOG}/ext4.log" touch "${DIR_LOG}/ext4.log" && chmod 0600 "${DIR_LOG}/ext4.log"
touch "${DIR_LOG}/sshd_config.log" && chmod 0600 "${DIR_LOG}/sshd_config.log"
return 0 return 0
} }