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

Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
2025-08-26 20:22:09 +02:00
parent 383a3b30f5
commit 6e5cd03d98
3 changed files with 23 additions and 14 deletions

View File

@@ -52,7 +52,7 @@ declare -grx VAR_SETUP_FULL="$(cd "$(dirname "${0}")" && pwd)/${0##*/}" # '/opt
### PRELIMINARY CHECKS. ### PRELIMINARY CHECKS.
### No ash, dash, ksh, sh. ### No ash, dash, ksh, sh.
# shellcheck disable=2292 # shellcheck disable=SC2292
[ -z "${BASH_VERSINFO[0]}" ] && { [ -z "${BASH_VERSINFO[0]}" ] && {
. ./meta_loader_early.sh . ./meta_loader_early.sh
printf "%b❌ Please make sure you are using 'bash'! Bye... %b%b" "${RED}" "${RES}" "${NL}" >&2 printf "%b❌ Please make sure you are using 'bash'! Bye... %b%b" "${RED}" "${RES}" "${NL}" >&2

View File

@@ -44,8 +44,8 @@ dropbear_setup() {
chroot_exec "${TARGET}" /usr/bin/dropbearkey -t rsa -s 4096 -f /etc/dropbear/initramfs/dropbear_rsa_host_key chroot_exec "${TARGET}" /usr/bin/dropbearkey -t rsa -s 4096 -f /etc/dropbear/initramfs/dropbear_rsa_host_key
chroot_exec "${TARGET}" /usr/bin/dropbearkey -t ed25519 -f /etc/dropbear/initramfs/dropbear_ed25519_host_key chroot_exec "${TARGET}" /usr/bin/dropbearkey -t ed25519 -f /etc/dropbear/initramfs/dropbear_ed25519_host_key
chmod 0600 "${TARGET}"/etc/dropbear/initramfs/dropbear*key chmod 0600 "${TARGET}"/etc/dropbear/initramfs/dropbear*key*
chown root:root "${TARGET}"/etc/dropbear/initramfs/dropbear*key chown root:root "${TARGET}"/etc/dropbear/initramfs/dropbear*key*
### Prepare dropbear authorized_keys ### Prepare dropbear authorized_keys
touch "${TARGET}/etc/dropbear/initramfs/authorized_keys" && chmod 0600 "${TARGET}/etc/dropbear/initramfs/authorized_keys" touch "${TARGET}/etc/dropbear/initramfs/authorized_keys" && chmod 0600 "${TARGET}/etc/dropbear/initramfs/authorized_keys"
@@ -98,7 +98,7 @@ dropbear_setup() {
"${TARGET}/etc/initramfs-tools/files/" "${TARGET}/etc/initramfs-tools/files/"
### Install the script to be called inside the initramfs environment for preparing dropbear execution. ### Install the script to be called inside the initramfs environment for preparing dropbear execution.
chroot_exec "${TARGET}" mv /usr/share/initramfs-tools/scripts/init-premount/dropbear /usr/share/initramfs-tools/scripts/init-premount/dropbear.2022.83 chroot_exec "${TARGET}" mv /usr/share/initramfs-tools/scripts/init-premount/dropbear /usr/share/initramfs-tools/scripts/init-premount/dropbear.trixie
install -D -m 0755 -o root -g root "${VAR_SETUP_PATH}/includes/target/usr/share/initramfs-tools/scripts/init-premount/dropbear" \ install -D -m 0755 -o root -g root "${VAR_SETUP_PATH}/includes/target/usr/share/initramfs-tools/scripts/init-premount/dropbear" \
"${TARGET}/usr/share/initramfs-tools/scripts/init-premount/" "${TARGET}/usr/share/initramfs-tools/scripts/init-premount/"

View File

@@ -3,7 +3,7 @@
PREREQ="udev" PREREQ="udev"
prereqs() { prereqs() {
echo "$PREREQ" echo "${PREREQ}"
} }
case "$1" in case "$1" in
@@ -13,27 +13,34 @@ case "$1" in
;; ;;
esac esac
# shellcheck disable=SC2292
[ -x /sbin/dropbear ] || exit 0 [ -x /sbin/dropbear ] || exit 0
run_dropbear() { run_dropbear() {
# Remove old flags for dropbear version 2022.83 ### CISS.debian.installer
# only accepts flags from /etc/dropbear/dropbear.conf ### Remove old flags for dropbear version 2025.88-2.
#local flags="Fs" ### Only accepts flags from '/etc/dropbear/dropbear.conf'.
#[ "$debug" != y ] || flags="E$flags" # log to standard error
# always run configure_networking() before dropbear(8); on NFS #local flags="Fs"
# shellcheck disable=SC2292
[ "${debug}" != y ] || flags="E${flags}" # log to standard error
# Always run configure_networking() before dropbear(8); on NFS
# mounts this has been done already # mounts this has been done already
[ "$BOOT" = nfs ] || configure_networking
# shellcheck disable=SC2292
[ "${BOOT}" = nfs ] || configure_networking
log_begin_msg "Starting dropbear" log_begin_msg "Starting dropbear"
# using exec and keeping dropbear in the foreground enables the # Using exec and keeping dropbear in the foreground enables the
# init-bottom script to kill the remaining ipconfig processes if # init-bottom script to kill the remaining ipconfig processes if
# someone unlocks the rootfs from the console while the network is # someone unlocks the rootfs from the console while the network is
# being configured # being configured
exec /sbin/dropbear ${DROPBEAR_OPTIONS-} exec /sbin/dropbear "${DROPBEAR_OPTIONS-}"
} }
# shellcheck disable=SC2292
if [ -e /etc/dropbear/dropbear.conf ]; then if [ -e /etc/dropbear/dropbear.conf ]; then
. /etc/dropbear/dropbear.conf . /etc/dropbear/dropbear.conf
fi fi
@@ -44,7 +51,9 @@ fi
# with console access can enter the passphrase immediately. (With the # with console access can enter the passphrase immediately. (With the
# default ip=dhcp, configure_networking hangs for 5mins or so when the # default ip=dhcp, configure_networking hangs for 5mins or so when the
# network is unavailable, for instance.) # network is unavailable, for instance.)
[ "$BOOT" != nfs ] || configure_networking
# shellcheck disable=SC2292
[ "${BOOT}" != nfs ] || configure_networking
run_dropbear & run_dropbear &
echo $! >/run/dropbear.pid echo $! >/run/dropbear.pid