V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m55s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m55s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
13
.archive/func/4195_installation_dropbear.sh
Normal file
13
.archive/func/4195_installation_dropbear.sh
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/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
|
||||||
|
|
||||||
|
lsinitramfs /boot/initrd.img-"$(uname -r)" | grep -E 'bin/(bash|sha|reboot|sync|sleep|sh)'
|
||||||
@@ -19,7 +19,7 @@ guard_sourcing
|
|||||||
# Arguments:
|
# Arguments:
|
||||||
# None
|
# None
|
||||||
# Returns:
|
# Returns:
|
||||||
# 0: Successfully executed commands.
|
# 0: on success
|
||||||
#######################################
|
#######################################
|
||||||
check_nic() {
|
check_nic() {
|
||||||
ip -o link show | awk -F': ' '{print $2}' | sed 's!lo!!' | sed '/^$/d' | awk '{$1=$1};1' >| "${DIR_TMP}nic.tmp"
|
ip -o link show | awk -F': ' '{print $2}' | sed 's!lo!!' | sed '/^$/d' | awk '{$1=$1};1' >| "${DIR_TMP}nic.tmp"
|
||||||
|
|||||||
@@ -12,6 +12,13 @@
|
|||||||
|
|
||||||
guard_sourcing
|
guard_sourcing
|
||||||
|
|
||||||
|
#######################################
|
||||||
|
# Use do_in_target() for:
|
||||||
|
# simple commands (e.g., dpkg, ln, mkdir, apt, etc.)
|
||||||
|
# Use do_in_target_script() for:
|
||||||
|
# all shell scripts, redirects, pipes, conditions, loops, or subshells
|
||||||
|
#######################################
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# Wrapper for executing commands in the desired chroot environment.
|
# Wrapper for executing commands in the desired chroot environment.
|
||||||
# Globals:
|
# Globals:
|
||||||
@@ -21,24 +28,84 @@ guard_sourcing
|
|||||||
# 1: Target of the chroot environment.
|
# 1: Target of the chroot environment.
|
||||||
# 2: Commands and options and parameters to be executed in chroot.
|
# 2: Commands and options and parameters to be executed in chroot.
|
||||||
# Returns:
|
# Returns:
|
||||||
# ERR_CHRT_COMMAND: Unsuccessfully executed commands.
|
# 0: on success
|
||||||
# 0: Successfully executed commands.
|
# ERR_CHRT_COMMAND: on failure
|
||||||
#######################################
|
#######################################
|
||||||
do_in_target() {
|
do_in_target() {
|
||||||
declare var_chroot_target="$1"
|
declare var_chroot_target="$1"
|
||||||
shift
|
shift
|
||||||
declare -a ary_chroot_command=("$@")
|
declare -a ary_chroot_command=("$@")
|
||||||
|
|
||||||
|
if (( ${#ary_chroot_command[@]} == 0 )); then
|
||||||
|
do_log "emergency" "true" "Empty command passed to 'do_in_target()'."
|
||||||
|
return "${ERR_CHRT_COMMAND}"
|
||||||
|
fi
|
||||||
|
|
||||||
if chroot "${var_chroot_target}" /usr/bin/env -i \
|
if chroot "${var_chroot_target}" /usr/bin/env -i \
|
||||||
HOME=/root \
|
HOME=/root \
|
||||||
PATH=/usr/sbin:/usr/bin:/sbin:/bin \
|
PATH=/usr/sbin:/usr/bin:/sbin:/bin \
|
||||||
TERM="${TERM}" \
|
TERM="${TERM}" \
|
||||||
"${ary_chroot_command[@]}"
|
"${ary_chroot_command[@]}"
|
||||||
then
|
then
|
||||||
do_log "info" "true" "Success: chroot ${var_chroot_target}: ${ary_chroot_command[*]}"
|
do_log "info" "true" "Success: chroot '${var_chroot_target}': '${ary_chroot_command[*]}'."
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
do_log "emergency" "true" "Failed: chroot ${var_chroot_target}: ${ary_chroot_command[*]}"
|
do_log "emergency" "true" "Failed: chroot '${var_chroot_target}': '${ary_chroot_command[*]}'."
|
||||||
return "${ERR_CHRT_COMMAND}"
|
return "${ERR_CHRT_COMMAND}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#######################################
|
||||||
|
# Execute a full shell script line inside the chroot via bash -c.
|
||||||
|
# Supports interactive debug shell on error.
|
||||||
|
# Globals:
|
||||||
|
# ERR_CHRT_COMMAND
|
||||||
|
# TERM
|
||||||
|
# DEBUG_INTERACTIVE (optional boolean)
|
||||||
|
# Arguments:
|
||||||
|
# 1: Target of the chroot environment
|
||||||
|
# 2: Command string to execute inside a shell (quoted)
|
||||||
|
# Returns:
|
||||||
|
# 0: on success
|
||||||
|
# ERR_CHRT_COMMAND: on failure
|
||||||
|
#######################################
|
||||||
|
do_in_target_script() {
|
||||||
|
declare var_chroot_target="$1"
|
||||||
|
shift
|
||||||
|
declare var_chroot_script="$1"
|
||||||
|
|
||||||
|
if [[ -z "${var_chroot_script}" ]]; then
|
||||||
|
do_log "emergency" "true" "Empty command passed to 'do_in_target_script()'."
|
||||||
|
return "${ERR_CHRT_COMMAND}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
do_log "debug" "true" "Evaluating chroot script in '${var_chroot_target}': '${var_chroot_script}'."
|
||||||
|
|
||||||
|
if chroot "${var_chroot_target}" /usr/bin/env -i \
|
||||||
|
HOME=/root \
|
||||||
|
PATH=/usr/sbin:/usr/bin:/sbin:/bin \
|
||||||
|
TERM="${TERM}" \
|
||||||
|
/bin/bash -c "${var_chroot_script}"
|
||||||
|
|
||||||
|
then
|
||||||
|
|
||||||
|
do_log "info" "true" "Success: chroot '${var_chroot_target}': '${var_chroot_script}'."
|
||||||
|
return 0
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
declare -i var_chroot_rc="${?}"
|
||||||
|
do_log "emergency" "true" "Failure: chroot '${var_chroot_target}': '${var_chroot_script}'."
|
||||||
|
do_log "debug" "true" "Return code: '${var_chroot_rc}'."
|
||||||
|
|
||||||
|
# TODO: Tests with Dialog Wrapper in interactive mode.
|
||||||
|
#if [[ "${DEBUG_INTERACTIVE}" == "true" ]]; then
|
||||||
|
# do_log "warning" "true" "Launching interactive debug shell in chroot: '${var_chroot_target}'."
|
||||||
|
# chroot "${var_chroot_target}" /bin/bash -l
|
||||||
|
#fi
|
||||||
|
|
||||||
|
return "${ERR_CHRT_COMMAND}"
|
||||||
|
|
||||||
|
fi
|
||||||
|
}
|
||||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ guard_sourcing
|
|||||||
# Arguments:
|
# Arguments:
|
||||||
# 1: IPv4 in CCDIR Notation, e.g.,: 192.168.128.128/24
|
# 1: IPv4 in CCDIR Notation, e.g.,: 192.168.128.128/24
|
||||||
# Returns:
|
# Returns:
|
||||||
# 0: In every case a zero return value is delivered.
|
# 0: on success
|
||||||
#######################################
|
#######################################
|
||||||
generate_subnetmask() {
|
generate_subnetmask() {
|
||||||
declare var_arg="$1"
|
declare var_arg="$1"
|
||||||
@@ -35,13 +35,13 @@ generate_subnetmask() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# Helper module for full upgrade, autoremove and autoclean.
|
# Helper module for update, full dist-upgrade, autoclean, autopurge and autoremove.
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# None
|
# None
|
||||||
#######################################
|
#######################################
|
||||||
update_upgrade() {
|
update_upgrade() {
|
||||||
apt-get update -y
|
apt-get update -y
|
||||||
apt-get upgrade -y
|
apt-get dist-upgrade -y
|
||||||
apt-get autoclean -y
|
apt-get autoclean -y
|
||||||
apt-get autopurge -y
|
apt-get autopurge -y
|
||||||
apt-get autoremove -y
|
apt-get autoremove -y
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ guard_sourcing
|
|||||||
# ERR_PART_READ
|
# ERR_PART_READ
|
||||||
# ERR_TABLE_CREATE
|
# ERR_TABLE_CREATE
|
||||||
# ERR_TABLE_DELETE
|
# ERR_TABLE_DELETE
|
||||||
# 0: Successfully executed commands.
|
# 0: on success
|
||||||
#######################################
|
#######################################
|
||||||
partitioning() {
|
partitioning() {
|
||||||
### Declare Arrays and Variables.
|
### Declare Arrays and Variables.
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ guard_sourcing
|
|||||||
# Arguments:
|
# Arguments:
|
||||||
# None
|
# None
|
||||||
# Returns:
|
# Returns:
|
||||||
# 0: Successfully executed commands.
|
# 0: on success
|
||||||
#######################################
|
#######################################
|
||||||
partition_encryption() {
|
partition_encryption() {
|
||||||
### Declare Arrays and Variables.
|
### Declare Arrays and Variables.
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ guard_sourcing
|
|||||||
# Arguments:
|
# Arguments:
|
||||||
# None
|
# None
|
||||||
# Returns:
|
# Returns:
|
||||||
# 0: Successfully executed commands.
|
# 0: on success
|
||||||
#######################################
|
#######################################
|
||||||
partition_formatting() {
|
partition_formatting() {
|
||||||
### Declare Arrays and Variables.
|
### Declare Arrays and Variables.
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ guard_sourcing
|
|||||||
# Arguments:
|
# Arguments:
|
||||||
# None
|
# None
|
||||||
# Returns:
|
# Returns:
|
||||||
# 0: Successfully executed commands.
|
# 0: on success
|
||||||
#######################################
|
#######################################
|
||||||
setup_filesystem() {
|
setup_filesystem() {
|
||||||
### Declare Arrays and Variables.
|
### Declare Arrays and Variables.
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ validate_btrfs_compression() {
|
|||||||
# ERR_BTRFS_SUBVOL
|
# ERR_BTRFS_SUBVOL
|
||||||
# ERR_MOUNTING_DEV
|
# ERR_MOUNTING_DEV
|
||||||
# ERR_MOUNTING_ROOT
|
# ERR_MOUNTING_ROOT
|
||||||
# 0: Successfully executed commands.
|
# 0: on success
|
||||||
#######################################
|
#######################################
|
||||||
mount_partition() {
|
mount_partition() {
|
||||||
### Mount "/"-filesystem
|
### Mount "/"-filesystem
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ guard_sourcing
|
|||||||
# Arguments:
|
# Arguments:
|
||||||
# None
|
# None
|
||||||
# Returns:
|
# Returns:
|
||||||
# 0: Successfully executed commands.
|
# 0: on success
|
||||||
#######################################
|
#######################################
|
||||||
uuid_logger() {
|
uuid_logger() {
|
||||||
declare var_key var_mountpoint var_uuid
|
declare var_key var_mountpoint var_uuid
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ guard_sourcing
|
|||||||
# None
|
# None
|
||||||
# Returns:
|
# Returns:
|
||||||
# ERR_DEBOOTSTRAP
|
# ERR_DEBOOTSTRAP
|
||||||
# 0: Successfully executed commands.
|
# 0: on success
|
||||||
#######################################
|
#######################################
|
||||||
func_debootstrap() {
|
func_debootstrap() {
|
||||||
# shellcheck disable=SC2154 # "${architecture}" "${distribution}"
|
# shellcheck disable=SC2154 # "${architecture}" "${distribution}"
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ guard_sourcing
|
|||||||
# None
|
# None
|
||||||
# Returns:
|
# Returns:
|
||||||
# ERR_CHRT_MOUNTS
|
# ERR_CHRT_MOUNTS
|
||||||
# 0: Successfully executed commands.
|
# 0: on success
|
||||||
#######################################
|
#######################################
|
||||||
configure_system() {
|
configure_system() {
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ guard_sourcing
|
|||||||
# 4: Mount Options
|
# 4: Mount Options
|
||||||
# 5: Pass value, while Dump value is hardcoded always "0", e.g., "1"
|
# 5: Pass value, while Dump value is hardcoded always "0", e.g., "1"
|
||||||
# Returns:
|
# Returns:
|
||||||
# 0: Successfully executed commands.
|
# 0: on success
|
||||||
#######################################
|
#######################################
|
||||||
write_fstab() {
|
write_fstab() {
|
||||||
declare _uuid="$1" _path="$2" _fs="$3" _opts="$4" _pass="$5"
|
declare _uuid="$1" _path="$2" _fs="$3" _opts="$4" _pass="$5"
|
||||||
@@ -44,12 +44,12 @@ write_fstab() {
|
|||||||
# Arguments:
|
# Arguments:
|
||||||
# None
|
# None
|
||||||
# Returns:
|
# Returns:
|
||||||
# 0: Successfully executed commands.
|
# 0: on success
|
||||||
#######################################
|
#######################################
|
||||||
generate_fstab() {
|
generate_fstab() {
|
||||||
### Generate '${TARGET}/etc/fstab' header.
|
### Generate '${TARGET}/etc/fstab' header.
|
||||||
: >| "${TARGET}/etc/fstab"
|
: >| "${TARGET}/etc/fstab"
|
||||||
chmod 0644 "${TARGET}/etc/fstab"
|
chmod 0600 "${TARGET}/etc/fstab"
|
||||||
|
|
||||||
cat << 'EOF' >> "${TARGET}/etc/fstab"
|
cat << 'EOF' >> "${TARGET}/etc/fstab"
|
||||||
# /etc/fstab: static file system information.
|
# /etc/fstab: static file system information.
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ guard_sourcing
|
|||||||
# 3: Keyfile or none
|
# 3: Keyfile or none
|
||||||
# 4: LUKS Options
|
# 4: LUKS Options
|
||||||
# Returns:
|
# Returns:
|
||||||
# 0: Successfully executed commands.
|
# 0: on success
|
||||||
#######################################
|
#######################################
|
||||||
write_crypttab() {
|
write_crypttab() {
|
||||||
declare _label="$1" _device="$2" _key_file="$3" _opts="$4"
|
declare _label="$1" _device="$2" _key_file="$3" _opts="$4"
|
||||||
@@ -43,14 +43,14 @@ write_crypttab() {
|
|||||||
# Arguments:
|
# Arguments:
|
||||||
# None
|
# None
|
||||||
# Returns:
|
# Returns:
|
||||||
# 0: Successfully executed commands.
|
# 0: on success
|
||||||
#######################################
|
#######################################
|
||||||
generate_crypttab() {
|
generate_crypttab() {
|
||||||
declare var_key var_encryption_label var_luks_uuid
|
declare var_key var_encryption_label var_luks_uuid
|
||||||
|
|
||||||
### Generate '${TARGET}/etc/crypttab' header.
|
### Generate '${TARGET}/etc/crypttab' header.
|
||||||
: >| "${TARGET}/etc/crypttab"
|
: >| "${TARGET}/etc/crypttab"
|
||||||
chmod 0644 "${TARGET}/etc/crypttab"
|
chmod 0600 "${TARGET}/etc/crypttab"
|
||||||
|
|
||||||
cat << 'EOF' >> "${TARGET}/etc/crypttab"
|
cat << 'EOF' >> "${TARGET}/etc/crypttab"
|
||||||
# /etc/crypttab: static file system information.
|
# /etc/crypttab: static file system information.
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ guard_sourcing
|
|||||||
# Arguments:
|
# Arguments:
|
||||||
# None
|
# None
|
||||||
# Returns:
|
# Returns:
|
||||||
# 0: Successfully executed commands.
|
# 0: on success
|
||||||
#######################################
|
#######################################
|
||||||
generate_sources() {
|
generate_sources() {
|
||||||
declare -a ary_components
|
declare -a ary_components
|
||||||
|
|||||||
54
func/4090_minimal_toolset.sh
Normal file
54
func/4090_minimal_toolset.sh
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
#!/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
|
||||||
|
|
||||||
|
#######################################
|
||||||
|
# Check and set up the minimum required tools for the next installation steps.
|
||||||
|
# Globals:
|
||||||
|
# TARGET
|
||||||
|
# Arguments:
|
||||||
|
# None
|
||||||
|
# Returns:
|
||||||
|
# 0: on success
|
||||||
|
#######################################
|
||||||
|
minimal_toolset() {
|
||||||
|
declare var_bin
|
||||||
|
|
||||||
|
declare -A hmp_tool_pkg=(
|
||||||
|
["awk"]="gawk"
|
||||||
|
["busybox"]="busybox"
|
||||||
|
["cat"]="coreutils"
|
||||||
|
["chmod"]="coreutils"
|
||||||
|
["chown"]="coreutils"
|
||||||
|
["cp"]="coreutils"
|
||||||
|
["cryptsetup"]="cryptsetup-initramfs"
|
||||||
|
["echo"]="coreutils"
|
||||||
|
["grep"]="grep"
|
||||||
|
["ip"]="iproute2"
|
||||||
|
["ln"]="coreutils"
|
||||||
|
["mkdir"]="coreutils"
|
||||||
|
["ping"]="iputils-ping"
|
||||||
|
["sed"]="sed"
|
||||||
|
["update-initramfs"]="initramfs-tools"
|
||||||
|
)
|
||||||
|
|
||||||
|
for var_bin in "${!hmp_tool_pkg[@]}"; do
|
||||||
|
if ! do_in_target_script "${TARGET}" "command -v ${var_bin} >/dev/null"; then
|
||||||
|
do_in_target "${TARGET}" apt-get install -y "${hmp_tool_pkg[${var_bin}]}"
|
||||||
|
do_log "debug" "true" "Tool '${var_bin}' missing – installing '${hmp_tool_pkg[${var_bin}]}'."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||||
@@ -20,12 +20,11 @@ guard_sourcing
|
|||||||
# Arguments:
|
# Arguments:
|
||||||
# None
|
# None
|
||||||
# Returns:
|
# Returns:
|
||||||
# 0: Successfully executed commands.
|
# 0: on success
|
||||||
#######################################
|
#######################################
|
||||||
setup_timezone() {
|
setup_timezone() {
|
||||||
# shellcheck disable=SC2154 # "${ntp_timezone}"
|
|
||||||
do_in_target "${TARGET}" ln -sf "/usr/share/zoneinfo/${ntp_timezone}" /etc/localtime
|
do_in_target "${TARGET}" ln -sf "/usr/share/zoneinfo/${ntp_timezone}" /etc/localtime
|
||||||
do_in_target "${TARGET}" /bin/bash -c "echo ${ntp_timezone} | tee /etc/timezone"
|
do_in_target_script "${TARGET}" "echo ${ntp_timezone} | tee /etc/timezone"
|
||||||
do_in_target "${TARGET}" dpkg-reconfigure -f noninteractive tzdata
|
do_in_target "${TARGET}" dpkg-reconfigure -f noninteractive tzdata
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ guard_sourcing
|
|||||||
# Arguments:
|
# Arguments:
|
||||||
# None
|
# None
|
||||||
# Returns:
|
# Returns:
|
||||||
# 0: Successfully executed commands.
|
# 0: on success
|
||||||
#######################################
|
#######################################
|
||||||
setup_locales() {
|
setup_locales() {
|
||||||
do_in_target "${TARGET}" apt-get install -y locales
|
do_in_target "${TARGET}" apt-get install -y locales
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ guard_sourcing
|
|||||||
# Arguments:
|
# Arguments:
|
||||||
# None
|
# None
|
||||||
# Returns:
|
# Returns:
|
||||||
# 0: Successfully executed commands.
|
# 0: on success
|
||||||
#######################################
|
#######################################
|
||||||
installation_kernel() {
|
installation_kernel() {
|
||||||
# Installing the chosen Kernel Image according to preseed.yaml
|
# Installing the chosen Kernel Image according to preseed.yaml
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ guard_sourcing
|
|||||||
# Arguments:
|
# Arguments:
|
||||||
# None
|
# None
|
||||||
# Returns:
|
# Returns:
|
||||||
# 0: Successfully executed commands.
|
# 0: on success
|
||||||
#######################################
|
#######################################
|
||||||
setup_network() {
|
setup_network() {
|
||||||
do_in_target "${TARGET}" apt-get install -y isc-dhcp-client ifupdown
|
do_in_target "${TARGET}" apt-get install -y isc-dhcp-client ifupdown
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ guard_sourcing
|
|||||||
# Arguments:
|
# Arguments:
|
||||||
# None
|
# None
|
||||||
# Returns:
|
# Returns:
|
||||||
# 0: Successfully executed commands.
|
# 0: on success
|
||||||
#######################################
|
#######################################
|
||||||
setup_hostname() {
|
setup_hostname() {
|
||||||
### Create '${TARGET}/etc/hostname' file.
|
### Create '${TARGET}/etc/hostname' file.
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ guard_sourcing
|
|||||||
# Returns:
|
# Returns:
|
||||||
# ERR_GRUB_BACKGROUND
|
# ERR_GRUB_BACKGROUND
|
||||||
# ERR_GRUB_EFI_FORCE
|
# ERR_GRUB_EFI_FORCE
|
||||||
# 0: Successfully executed commands.
|
# 0: on success
|
||||||
#######################################
|
#######################################
|
||||||
setup_grub() {
|
setup_grub() {
|
||||||
declare var_update_grub_required="false"
|
declare var_update_grub_required="false"
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ guard_sourcing
|
|||||||
# Arguments:
|
# Arguments:
|
||||||
# None
|
# None
|
||||||
# Returns:
|
# Returns:
|
||||||
# 0: Successfully executed commands.
|
# 0: on success
|
||||||
#######################################
|
#######################################
|
||||||
setup_grub_bootparameter() {
|
setup_grub_bootparameter() {
|
||||||
### Install Kernel Hardening-Presets
|
### Install Kernel Hardening-Presets
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ guard_sourcing
|
|||||||
# Arguments:
|
# Arguments:
|
||||||
# None
|
# None
|
||||||
# Returns:
|
# Returns:
|
||||||
# 0: Successfully executed commands.
|
# 0: on success
|
||||||
#######################################
|
#######################################
|
||||||
installation_microcode() {
|
installation_microcode() {
|
||||||
declare var_microcode_pkgs=""
|
declare var_microcode_pkgs=""
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ guard_sourcing
|
|||||||
# Arguments:
|
# Arguments:
|
||||||
# None
|
# None
|
||||||
# Returns:
|
# Returns:
|
||||||
# 0: Successfully executed commands.
|
# 0: on success
|
||||||
#######################################
|
#######################################
|
||||||
setup_ssh() {
|
setup_ssh() {
|
||||||
do_in_target "${TARGET}" apt-get install -y ssh
|
do_in_target "${TARGET}" apt-get install -y ssh
|
||||||
|
|||||||
51
func/4190_build_dropbear.sh
Normal file
51
func/4190_build_dropbear.sh
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
#!/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
|
||||||
|
|
||||||
|
#######################################
|
||||||
|
# Build Ultra Hardened dropbear-2025.88 from sources.
|
||||||
|
# Globals:
|
||||||
|
# DIR_TMP
|
||||||
|
# ERR_PATH_NOT_VALID
|
||||||
|
# VAR_SETUP_PATH
|
||||||
|
# Arguments:
|
||||||
|
# None
|
||||||
|
# Returns:
|
||||||
|
# ERR_PATH_NOT_VALID
|
||||||
|
# 0: on success
|
||||||
|
#######################################
|
||||||
|
build_dropbear() {
|
||||||
|
declare file
|
||||||
|
mkdir -p "${DIR_TMP}/build"
|
||||||
|
|
||||||
|
cp "${VAR_SETUP_PATH}/upgrades/dropbear/dropbear-2025.88.tar.bz2" "${DIR_TMP}/build"
|
||||||
|
tar xjf "${DIR_TMP}/build/dropbear-2025.88.tar.bz2"
|
||||||
|
cp "${VAR_SETUP_PATH}/upgrades/dropbear/localoptions.h" "${DIR_TMP}/build/dropbear-2025.88"
|
||||||
|
cd "${DIR_TMP}/build/dropbear-2025.88" || return "${ERR_PATH_NOT_VALID}"
|
||||||
|
|
||||||
|
CC=musl-gcc \
|
||||||
|
CFLAGS="-Os -Wno-undef" \
|
||||||
|
LDFLAGS="-static -s -L/usr/local/lib" \
|
||||||
|
./configure \
|
||||||
|
--enable-static \
|
||||||
|
--enable-openpty \
|
||||||
|
--disable-pam \
|
||||||
|
--disable-zlib
|
||||||
|
|
||||||
|
make -j"$(nproc)"
|
||||||
|
|
||||||
|
do_log "info" "true" "Ultra Hardened dropbear-2025.88 build successfully from sources."
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||||
28
func/4191_install_dropbear_initramfs.sh
Normal file
28
func/4191_install_dropbear_initramfs.sh
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
#!/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
|
||||||
|
|
||||||
|
|
||||||
|
# 0: on success
|
||||||
|
#######################################
|
||||||
|
install_dropbear_initramfs() {
|
||||||
|
declare var_file
|
||||||
|
do_in_target "${TARGET}" apt-get install -y dropbear-initramfs
|
||||||
|
|
||||||
|
for var_file in dbclient dropbear dropbearconvert dropbearkey; do
|
||||||
|
install -D -m 0755 -o root -g root "${DIR_TMP}/build/dropbear-2025.88/${var_file}" "${TARGET}/usr/sbin/"
|
||||||
|
done
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||||
@@ -14,10 +14,7 @@ guard_sourcing
|
|||||||
|
|
||||||
# TODO Important insert cryptdevice=UUID=881366ae-61ee-4ee0-893c-0def27c78c9e:cryptroot root=/dev/mapper/vg00-root
|
# TODO Important insert cryptdevice=UUID=881366ae-61ee-4ee0-893c-0def27c78c9e:cryptroot root=/dev/mapper/vg00-root
|
||||||
# TODO Important insert GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=0 biosdevname=0 ip=152.53.66.126::152.53.64.1:255.255.252.0:soc:ens3:none"
|
# TODO Important insert GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=0 biosdevname=0 ip=152.53.66.126::152.53.64.1:255.255.252.0:soc:ens3:none"
|
||||||
###########################################################################################
|
|
||||||
# 3.7.7. Functions - installation - kernel #
|
|
||||||
###########################################################################################
|
|
||||||
lsinitramfs /boot/initrd.img-$(uname -r) | grep -E 'bin/(reboot|sync|sleep|sh)'
|
|
||||||
|
|
||||||
command="/usr/local/bin/coresecret.sh",no-agent-forwarding,no-port-forwarding,no-X11-forwarding ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICp+6S+qM87lLWUtvTGBV/GFNvYyvZ992X4/AcuraKwm 2025_run.coresecret.dev_root
|
command="/usr/local/bin/coresecret.sh",no-agent-forwarding,no-port-forwarding,no-X11-forwarding ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICp+6S+qM87lLWUtvTGBV/GFNvYyvZ992X4/AcuraKwm 2025_run.coresecret.dev_root
|
||||||
|
|
||||||
@@ -43,6 +43,6 @@
|
|||||||
. ./func/4160_grub_bootparameter.sh
|
. ./func/4160_grub_bootparameter.sh
|
||||||
. ./func/4170_installation_microcode.sh
|
. ./func/4170_installation_microcode.sh
|
||||||
. ./func/4180_setup_ssh.sh
|
. ./func/4180_setup_ssh.sh
|
||||||
. ./func/4190_installation_dropbear.sh
|
. ./func/4195_installation_dropbear.sh
|
||||||
. ./func/
|
. ./func/
|
||||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||||
|
|||||||
BIN
upgrades/dropbear/dropbear-2025.88.tar.bz2
Normal file
BIN
upgrades/dropbear/dropbear-2025.88.tar.bz2
Normal file
Binary file not shown.
@@ -42,6 +42,7 @@ declare -girx ERR_CHRT_MOUNTS=228 # Failure occurred while mounting system
|
|||||||
declare -girx ERR_CHRT_COMMAND=227 # Failure occurred while executing chroot environment command.
|
declare -girx ERR_CHRT_COMMAND=227 # Failure occurred while executing chroot environment command.
|
||||||
declare -girx ERR_GRUB_EFI_FORCE=226 # Invalid combination of Partition Table and grub_force_efi.
|
declare -girx ERR_GRUB_EFI_FORCE=226 # Invalid combination of Partition Table and grub_force_efi.
|
||||||
declare -girx ERR_GRUB_BACKGROUND=225 # Failure occurred on setting up the GRUB-background.
|
declare -girx ERR_GRUB_BACKGROUND=225 # Failure occurred on setting up the GRUB-background.
|
||||||
|
declare -girx ERR_PATH_NOT_VALID=224 # Specific path is not existing.
|
||||||
|
|
||||||
|
|
||||||
### Definition of error trap vars
|
### Definition of error trap vars
|
||||||
|
|||||||
Reference in New Issue
Block a user