fix: dropbear/network boot ordering — dropbear starts without network

- dropbear: custom init removes 'need net', only needs localmount + bee-sshsetup
- bee-network: removed 'before dropbear' dependency
- bee-network.sh: removed set -e so single iface failure does not abort script
This commit is contained in:
2026-03-05 14:59:23 +03:00
parent ab22e3ad74
commit 8502100074
4 changed files with 40 additions and 3 deletions

View File

@@ -82,8 +82,11 @@ if [ -d "$OVERLAY/root" ]; then
fi fi
mkdir -p "$tmp/etc/dropbear" "$tmp/etc/conf.d" mkdir -p "$tmp/etc/dropbear" "$tmp/etc/conf.d"
# -R: auto-generate host keys if missing
# no dependency on networking service — bee-network handles DHCP independently
makefile root:root 0644 "$tmp/etc/conf.d/dropbear" <<EOF makefile root:root 0644 "$tmp/etc/conf.d/dropbear" <<EOF
DROPBEAR_OPTS="-R" DROPBEAR_OPTS="-R"
EOF EOF
tar -c -C "$tmp" etc usr root 2>/dev/null | gzip -9n > "$HOSTNAME.apkovl.tar.gz" tar -c -C "$tmp" etc usr root 2>/dev/null | gzip -9n > "$HOSTNAME.apkovl.tar.gz"

View File

@@ -5,7 +5,6 @@ description="Bee: bring up network interfaces via DHCP"
depend() { depend() {
need localmount need localmount
before bee-audit-debug before bee-audit-debug
before dropbear
} }
start() { start() {

View File

@@ -0,0 +1,37 @@
#!/sbin/openrc-run
description="Dropbear SSH server"
depend() {
need localmount
after bee-sshsetup
use logger
}
check_config() {
if [ ! -e /etc/dropbear/dropbear_rsa_host_key ]; then
einfo "Generating RSA host key..."
/usr/bin/dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
fi
if [ ! -e /etc/dropbear/dropbear_ecdsa_host_key ]; then
einfo "Generating ECDSA host key..."
/usr/bin/dropbearkey -t ecdsa -f /etc/dropbear/dropbear_ecdsa_host_key
fi
if [ ! -e /etc/dropbear/dropbear_ed25519_host_key ]; then
einfo "Generating ED25519 host key..."
/usr/bin/dropbearkey -t ed25519 -f /etc/dropbear/dropbear_ed25519_host_key
fi
}
start() {
check_config || return 1
ebegin "Starting dropbear"
/usr/sbin/dropbear ${DROPBEAR_OPTS}
eend $?
}
stop() {
ebegin "Stopping dropbear"
start-stop-daemon --stop --pidfile /var/run/dropbear.pid
eend $?
}

View File

@@ -2,8 +2,6 @@
# bee-network.sh — bring up all physical network interfaces via DHCP # bee-network.sh — bring up all physical network interfaces via DHCP
# Unattended: runs silently, logs results, never blocks. # Unattended: runs silently, logs results, never blocks.
set -e
LOG_PREFIX="bee-network" LOG_PREFIX="bee-network"
log() { echo "[$LOG_PREFIX] $*"; } log() { echo "[$LOG_PREFIX] $*"; }