V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 48s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 48s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -41,7 +41,7 @@ yaml_reader() {
|
|||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
declare -Ag HMP_RECIPE_DEV_PARTITIONS=()
|
declare -Ag HMP_RECIPE_DEV_PARTITIONS=()
|
||||||
declare -gx VAR_RECIPE_STRING="" VAR_RECIPE_HIGHEST_DEVICE="" VAR_ARCHITECTURE="" VAR_RECIPE_FIRMWARE="" VAR_NUKE="" \
|
declare -gx VAR_RECIPE_STRING="" VAR_RECIPE_HIGHEST_DEVICE="" VAR_ARCHITECTURE="" VAR_RECIPE_FIRMWARE="" VAR_NUKE="" \
|
||||||
VAR_RECIPE_TABLE="" VAR_NEED_RUN_IN_TARGET="false" VAR_CODENAME="" VAR_RECOVERY=""
|
VAR_RECIPE_TABLE="" VAR_NEED_RUN_IN_TARGET="false" VAR_CODENAME="" VAR_DROPBEAR="" VAR_RECOVERY=""
|
||||||
### Declare and substitute input files.
|
### Declare and substitute input files.
|
||||||
declare -r var_if="${VAR_PRESEED}"
|
declare -r var_if="${VAR_PRESEED}"
|
||||||
declare var_line="" var_middle_part="" var_highest_dev="" var_device="" var_fields="" var_partition="" \
|
declare var_line="" var_middle_part="" var_highest_dev="" var_device="" var_fields="" var_partition="" \
|
||||||
@@ -144,6 +144,9 @@ END { print max }
|
|||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
VAR_CODENAME="${distribution,,}"
|
VAR_CODENAME="${distribution,,}"
|
||||||
|
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
VAR_DROPBEAR="${dropbear_boot,,}"
|
||||||
|
|
||||||
### Extract chroot secure '/run' mounting strategy.
|
### Extract chroot secure '/run' mounting strategy.
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
VAR_NEED_RUN_IN_TARGET="${needrun,,}"
|
VAR_NEED_RUN_IN_TARGET="${needrun,,}"
|
||||||
|
|||||||
@@ -98,7 +98,6 @@ insert_chrony_comments() {
|
|||||||
# /etc/chrony/conf.d : Generated by CISS.debian.installer '"${VAR_VERSION}"'\
|
# /etc/chrony/conf.d : Generated by CISS.debian.installer '"${VAR_VERSION}"'\
|
||||||
# Architecture : '"${VAR_ARCHITECTURE}"'\
|
# Architecture : '"${VAR_ARCHITECTURE}"'\
|
||||||
# Distribution : '"${VAR_CODENAME}"'\
|
# Distribution : '"${VAR_CODENAME}"'\
|
||||||
\
|
|
||||||
' "${file}"
|
' "${file}"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,9 +41,9 @@ write_crypttab() {
|
|||||||
# HMP_PATH_FSUUID
|
# HMP_PATH_FSUUID
|
||||||
# HMP_PATH_LUKSUUID
|
# HMP_PATH_LUKSUUID
|
||||||
# TARGET
|
# TARGET
|
||||||
|
# VAR_DROPBEAR
|
||||||
# VAR_NUKE
|
# VAR_NUKE
|
||||||
# VAR_VERSION
|
# VAR_VERSION
|
||||||
# dropbear_boot
|
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# None
|
# None
|
||||||
# Returns:
|
# Returns:
|
||||||
@@ -53,6 +53,8 @@ generate_crypttab() {
|
|||||||
### Declare Arrays, HashMaps, and Variables.
|
### Declare Arrays, HashMaps, and Variables.
|
||||||
declare var_key="" var_encryption_label="" var_luks_uuid="" var_ephemeral_enclabel="" var_host_uuid=""
|
declare var_key="" var_encryption_label="" var_luks_uuid="" var_ephemeral_enclabel="" var_host_uuid=""
|
||||||
|
|
||||||
|
ensure_lowercase "VAR_DROPBEAR"
|
||||||
|
|
||||||
### Generate '${TARGET}/etc/crypttab' header.
|
### Generate '${TARGET}/etc/crypttab' header.
|
||||||
: >| "${TARGET}/etc/crypttab"
|
: >| "${TARGET}/etc/crypttab"
|
||||||
chmod 0600 "${TARGET}/etc/crypttab"
|
chmod 0600 "${TARGET}/etc/crypttab"
|
||||||
@@ -94,10 +96,18 @@ EOF
|
|||||||
var_encryption_label="${HMP_PATH_ENCLABEL["${var_key}"]}"
|
var_encryption_label="${HMP_PATH_ENCLABEL["${var_key}"]}"
|
||||||
var_luks_uuid="${HMP_PATH_LUKSUUID["${var_key}"]}"
|
var_luks_uuid="${HMP_PATH_LUKSUUID["${var_key}"]}"
|
||||||
|
|
||||||
if [[ "${dropbear_boot,,}" == "true" ]]; then
|
if [[ "${VAR_DROPBEAR}" == "true" ]]; then
|
||||||
|
|
||||||
|
if [[ "${var_key}" == "/" ]]; then
|
||||||
|
|
||||||
|
write_crypttab "${var_encryption_label}" "UUID=${var_luks_uuid}" "none" "luks,discard,initramfs,keyscript=/lib/cryptsetup/scripts/unlock_wrapper.sh"
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
write_crypttab "${var_encryption_label}" "UUID=${var_luks_uuid}" "none" "luks,discard,initramfs"
|
write_crypttab "${var_encryption_label}" "UUID=${var_luks_uuid}" "none" "luks,discard,initramfs"
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
write_crypttab "${var_encryption_label}" "UUID=${var_luks_uuid}" "none" "luks,discard"
|
write_crypttab "${var_encryption_label}" "UUID=${var_luks_uuid}" "none" "luks,discard"
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ guard_sourcing
|
|||||||
#######################################
|
#######################################
|
||||||
update_grub_bootparameter() {
|
update_grub_bootparameter() {
|
||||||
### Declare Arrays, HashMaps, and Variables.
|
### Declare Arrays, HashMaps, and Variables.
|
||||||
declare var_nuke_string="" var_param=""
|
declare var_nuke_string="" var_param="" var_label=""
|
||||||
|
|
||||||
grub_extract_current_string
|
grub_extract_current_string
|
||||||
|
|
||||||
@@ -47,14 +47,19 @@ update_grub_bootparameter() {
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
VAR_GRUB_CMDLINE_LINUX_DEFAULT+=" ${var_param}"
|
VAR_GRUB_CMDLINE_LINUX_DEFAULT="${VAR_GRUB_CMDLINE_LINUX_DEFAULT} ${var_param}"
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [[ "${VAR_DROPBEAR}" == "true" ]]; then
|
||||||
|
var_label="${HMP_PATH_ENCLABEL["/"]}"
|
||||||
|
VAR_GRUB_CMDLINE_LINUX+="${VAR_GRUB_CMDLINE_LINUX} cryptdevice=${VAR_CRYPT_ROOT}:cryptroot root=/dev/mapper/${var_label}"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "${VAR_NUKE}" == "true" ]]; then
|
if [[ "${VAR_NUKE}" == "true" ]]; then
|
||||||
var_nuke_string="nuke=${VAR_NUKE_HASH}"
|
var_nuke_string="nuke=${VAR_NUKE_HASH}"
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
VAR_GRUB_CMDLINE_LINUX+=" ${var_nuke_string}"
|
VAR_GRUB_CMDLINE_LINUX="${VAR_GRUB_CMDLINE_LINUX} ${var_nuke_string}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
grub_finalize_string
|
grub_finalize_string
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ dropbear_build() {
|
|||||||
declare var_tar="${VAR_SETUP_PATH}/upgrades/dropbear/dropbear-${var_dropbear_version}.tar.bz2"
|
declare var_tar="${VAR_SETUP_PATH}/upgrades/dropbear/dropbear-${var_dropbear_version}.tar.bz2"
|
||||||
declare var_build_dir="${DIR_TMP}/build/dropbear-${var_dropbear_version}"
|
declare var_build_dir="${DIR_TMP}/build/dropbear-${var_dropbear_version}"
|
||||||
|
|
||||||
|
apt-get install -y autoconf automake build-essential libtool libtomcrypt-dev libtommath-dev musl-tools
|
||||||
|
|
||||||
mkdir -p "${DIR_TMP}/build"
|
mkdir -p "${DIR_TMP}/build"
|
||||||
cp "${var_tar}" "${DIR_TMP}/build"
|
cp "${var_tar}" "${DIR_TMP}/build"
|
||||||
tar xjf "${DIR_TMP}/build/dropbear-${var_dropbear_version}.tar.bz2" -C "${DIR_TMP}/build" || return "${ERR_PATH_NOT_VALID}"
|
tar xjf "${DIR_TMP}/build/dropbear-${var_dropbear_version}.tar.bz2" -C "${DIR_TMP}/build" || return "${ERR_PATH_NOT_VALID}"
|
||||||
|
|||||||
@@ -12,13 +12,6 @@
|
|||||||
|
|
||||||
guard_sourcing
|
guard_sourcing
|
||||||
|
|
||||||
# TODO: Implement this update:
|
|
||||||
# if [[ "${VAR_NUKE,,}" == "true" && "${var_key,,}" == "/" ]]; then
|
|
||||||
# #write_crypttab "${var_encryption_label}" "UUID=${var_luks_uuid}" "none" "luks,discard,initramfs,keyscript=/lib/cryptsetup/scripts/unlock_wrapper.sh"
|
|
||||||
# write_crypttab "${var_encryption_label}" "UUID=${var_luks_uuid}" "none" "luks,discard,initramfs"
|
|
||||||
# continue
|
|
||||||
#fi
|
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# Set up Dropbear Initramfs Environment.
|
# Set up Dropbear Initramfs Environment.
|
||||||
# Globals:
|
# Globals:
|
||||||
@@ -84,13 +77,7 @@ dropbear_setup() {
|
|||||||
### Generate dropbear configuration file
|
### Generate dropbear configuration file
|
||||||
write_dropbear_conf
|
write_dropbear_conf
|
||||||
|
|
||||||
### Prepare Grub Bootparameter for LUKS decryption of '/root' and '/recovery'.
|
|
||||||
# Options in "GRUB_CMDLINE_LINUX" are always effective.
|
|
||||||
# Options in "GRUB_CMDLINE_LINUX_DEFAULT" are effective ONLY during normal boot (NOT during recovery mode).
|
|
||||||
grub_extract_current_string
|
|
||||||
declare var_label="${HMP_PATH_ENCLABEL["LABEL_/"]}"
|
|
||||||
VAR_GRUB_CMDLINE_LINUX="${VAR_GRUB_CMDLINE_LINUX} cryptdevice=${VAR_CRYPT_ROOT}:cryptroot root=/dev/mapper/${var_label}"
|
|
||||||
grub_finalize_string
|
|
||||||
|
|
||||||
### Install the script to be called by 'update-initramfs' for updating 'PATH'-variable inside initramfs.
|
### Install the script to be called by 'update-initramfs' for updating 'PATH'-variable inside initramfs.
|
||||||
install -D -m 0755 -o root -g root "${VAR_SETUP_PATH}/includes/initramfs-tools/scripts/init-top/fixpath.sh" \
|
install -D -m 0755 -o root -g root "${VAR_SETUP_PATH}/includes/initramfs-tools/scripts/init-top/fixpath.sh" \
|
||||||
|
|||||||
Reference in New Issue
Block a user