Compare commits

...
14 Commits
Author SHA1 Message Date
gandalfandClaude Opus 4.5 a6d9e49915 fix(kiosk): Fix multiple issues preventing kiosk from starting
- Add + prefix to ExecStartPre condition check (run as root)
- Remove WAYLAND_DISPLAY env var (cage creates its own display)
- Add kbd package for chvt command
- Add splash to kiosk GRUB entry for Plymouth boot animation
- Enable SSH password authentication for debugging

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-30 18:49:11 +02:00
gandalfandClaude Opus 4.5 99d4a25880 docs: Add Raspberry Pi boards to supported devices
- Raspberry Pi 4 (BCM2711) - SecuBox Lite
- Raspberry Pi 400 (BCM2711) - SecuBox Lite
- Raspberry Pi 5 (BCM2712) - SecuBox Full

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-30 17:32:13 +02:00
gandalfandClaude Opus 4.5 01f3b28bde fix(kiosk): Replace ConditionPathExists with ExecStartPre check
ConditionPathExists is evaluated when systemd loads the unit, not
when the service starts. This causes the kiosk to fail because
the marker file doesn't exist yet when systemd parses units.

Using ExecStartPre check instead, which runs at service start time.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-30 17:12:49 +02:00
gandalfandClaude Opus 4.5 4ad789624b feat(live-usb): Make kiosk GUI the default boot entry
Changed GRUB default from 0 (SecuBox Live) to 1 (Kiosk GUI)
so kiosk mode boots automatically.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-30 17:00:50 +02:00
gandalfandClaude Opus 4.5 85f3abcaa3 feat(live-usb): Enable kiosk mode by default
- Kiosk packages (cage, chromium) now included by default
- Added --no-kiosk flag to disable if needed
- Removed --kiosk flag (no longer needed)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-30 16:47:17 +02:00
gandalfandClaude Opus 4.5 ea772a95cb fix(kiosk): Start kiosk service explicitly after creating marker
Systemd evaluates ConditionPathExists before the cmdline handler
creates .kiosk-enabled, causing service to fail. Now explicitly
starts the service after setup.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-30 16:46:17 +02:00
gandalfandClaude Opus 4.5 3c6d26cc79 feat(live-usb): Add Plymouth and kiosk boot menu entries
- Add "SecuBox Live (Kiosk GUI)" with Plymouth splash
- Add "SecuBox Live (Kiosk GUI - No Plymouth)" for text mode
- Add "SecuBox Live (Auto-Check HW - Text Mode)" entry
- Fix Auto-Check HW entry to include Plymouth splash

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-30 16:41:42 +02:00
gandalfandClaude Opus 4.5 e47ad8fdee docs: Update HISTORY.md with Plymouth and kiosk fixes
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-30 12:29:02 +02:00
gandalfandClaude Opus 4.5 c51ae2758d feat: Add Plymouth boot splash and fix kiosk mode
- Add Plymouth boot splash theme (VT100/DEC PDP-style green phosphor)
- Boot splash now shows DURING boot, not just at login
- Fix kiosk service: use tty7, proper VT allocation, better env vars
- Add splash parameter to GRUB menu entries
- Add initramfs configuration for Plymouth framebuffer
- RPi build: Plymouth support with ARM64 theme

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-30 12:28:24 +02:00
gandalfandClaude Opus 4.5 f221fa6844 feat(rpi-usb): Add VT100 cyber splash and autologin for RPi 400
- Add HDMI console autologin (getty@tty1)
- Add VT100 DEC PDP-style boot splash
- Add splash to root's bashrc
- Consistent experience with x64 live USB

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-30 12:01:19 +02:00
gandalfandClaude Opus 4.5 ba02a422a2 fix(live-usb): Fix hanging boot services
- Add 10s timeout to secubox-cmdline.service
- Add 5s timeout to netplan apply
- Remove pipefail to allow graceful failures
- Scripts now continue on non-critical errors

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-30 11:23:45 +02:00
gandalfandClaude Opus 4.5 cbe43876a2 fix(live-usb): Add emergency shell boot entry and enable systemd status
- Add Emergency Shell boot option for debugging
- Enable ShowStatus=yes to see boot progress
- Set 30s timeout for services to prevent infinite hangs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-30 11:12:53 +02:00
gandalfandClaude Opus 4.5 e6cc305a06 feat(live-usb): Add retro CRT VT100 DEC PDP-style boot splash
- Add cyber_banner with ASCII art logo
- Add type_slow effect for retro terminal feel
- Green phosphor VT100 escape codes
- Boot status messages with progress dots
- Hardware check with retro formatting
- Login splash for root user

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-30 10:31:03 +02:00
gandalfandClaude Opus 4.5 cfa5aa1cda feat(live-usb): Add hardware check boot mode with fallback
- Add "SecuBox Live (Auto-Check HW)" GRUB entry with nomodeset fallback
- Add secubox-hwcheck script that evaluates:
  - CPU model and cores
  - Memory total and available
  - Storage devices
  - Network interfaces
  - Graphics adapters
  - Boot mode (UEFI/BIOS)
  - Virtualization detection
- Add systemd service triggered by secubox.hwcheck=1 kernel param
- Add console=tty0 to all boot entries for visible output
- Remove quiet from default entry to show boot messages

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-30 10:28:28 +02:00
8 changed files with 675 additions and 40 deletions
+23
View File
@@ -3,6 +3,29 @@
---
## 2026-03-30
### Plymouth Boot Splash & Kiosk Fixes
- Added Plymouth boot splash with VT100/DEC PDP-style green phosphor theme
- Boot graphics now show DURING boot (not just at login)
- Fixed kiosk mode service configuration:
- Changed from tty1 to tty7 (like standard display managers)
- Proper VT allocation and switching
- Better wlroots environment variables for VMs
- Added tty supplementary group for DRM access
- Updated GRUB menu entries with `splash` parameter
- Added initramfs configuration for Plymouth framebuffer
- RPi 400 build: Added Plymouth support with ARM64 theme
- Tags: v1.3.6
### Previous Boot Fixes (v1.3.2-v1.3.5)
- Added VT100 retro CRT DEC PDP-style cyber splash
- Added hardware auto-check boot mode (`secubox.hwcheck=1`)
- Fixed boot hanging services with timeouts
- RPi 400 image builder with HDMI console autologin
---
## 2026-03-29
### Kiosk Mode Bug Fixes
+3
View File
@@ -26,6 +26,9 @@ opkg → apt + repo apt.secubox.in
| MOCHAbin | Armada 7040 Quad 1.8GHz | 4 GB | 2× SFP+ 10GbE + 4× GbE | SecuBox Pro |
| ESPRESSObin v7 | Armada 3720 Dual 1.2GHz | 12 GB | WAN + 2× LAN DSA | SecuBox Lite |
| ESPRESSObin Ultra | Armada 3720 Dual 1.2GHz | 2 GB | WAN PoE + 4× LAN + Wi-Fi | SecuBox Lite+ |
| Raspberry Pi 4 | BCM2711 Quad 1.5GHz | 2-8 GB | GbE + USB | SecuBox Lite |
| Raspberry Pi 400 | BCM2711 Quad 1.8GHz | 4 GB | GbE + USB | SecuBox Lite |
| Raspberry Pi 5 | BCM2712 Quad 2.4GHz | 4-8 GB | GbE + USB | SecuBox Full |
| VM x86_64 | Any | 2+ GB | Virtio/NAT | SecuBox Full |
---
+432 -17
View File
@@ -22,7 +22,7 @@ APT_SECUBOX="https://apt.secubox.in"
USE_LOCAL_CACHE=0
SLIPSTREAM_DEBS=1
INCLUDE_PERSISTENCE=1
INCLUDE_KIOSK=0
INCLUDE_KIOSK=1
PRESEED_FILE=""
NO_COMPRESS=0
@@ -43,7 +43,7 @@ Usage: sudo bash build-live-usb.sh [OPTIONS]
--out DIR Output directory (default: ./output)
--size SIZE Total image size (default: 8G)
--local-cache Use local APT cache
--kiosk Include GUI kiosk mode packages
--no-kiosk Disable GUI kiosk mode (enabled by default)
--no-persistence Don't include persistent storage partition
--no-compress Skip gzip compression (faster, for local testing)
--preseed FILE Include preseed config archive
@@ -54,7 +54,7 @@ Features:
- All SecuBox packages pre-installed
- Root autologin on console
- Network auto-detection at first boot
- Optional kiosk mode (--kiosk)
- GUI kiosk mode included by default (--no-kiosk to disable)
Output:
secubox-live-amd64-bookworm.img - Raw bootable image
@@ -73,7 +73,7 @@ while [[ $# -gt 0 ]]; do
--out) OUT_DIR="$2"; shift 2 ;;
--size) IMG_SIZE="$2"; shift 2 ;;
--local-cache) USE_LOCAL_CACHE=1; shift ;;
--kiosk) INCLUDE_KIOSK=1; shift ;;
--no-kiosk) INCLUDE_KIOSK=0; shift ;;
--no-persistence) INCLUDE_PERSISTENCE=0; shift ;;
--no-compress) NO_COMPRESS=1; shift ;;
--preseed) PRESEED_FILE="$2"; shift 2 ;;
@@ -145,6 +145,7 @@ INCLUDE_PKGS+=",iproute2,iputils-ping,ethtool,net-tools,wireguard-tools"
INCLUDE_PKGS+=",sudo,less,vim-tiny,logrotate,cron,rsync,jq,dnsmasq"
INCLUDE_PKGS+=",linux-image-amd64,live-boot,live-boot-initramfs-tools,live-config,live-config-systemd"
INCLUDE_PKGS+=",grub-efi-amd64,efibootmgr,pciutils,usbutils,lsb-release"
INCLUDE_PKGS+=",plymouth,plymouth-themes"
debootstrap --arch=amd64 --include="${INCLUDE_PKGS}" \
"${SUITE}" "${ROOTFS}" "${APT_MIRROR}"
@@ -186,8 +187,10 @@ XKBVARIANT="latin9"
EOF
echo 'KEYMAP=fr' > "${ROOTFS}/etc/vconsole.conf"
# Enable SSH root login
# Enable SSH root login with password
sed -i 's/#PermitRootLogin.*/PermitRootLogin yes/' "${ROOTFS}/etc/ssh/sshd_config"
sed -i 's/#PasswordAuthentication.*/PasswordAuthentication yes/' "${ROOTFS}/etc/ssh/sshd_config"
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/' "${ROOTFS}/etc/ssh/sshd_config"
# ── Autologin root on tty1 ────────────────────────────────────────
mkdir -p "${ROOTFS}/etc/systemd/system/getty@tty1.service.d"
@@ -206,11 +209,13 @@ chroot "${ROOTFS}" systemctl set-default multi-user.target 2>/dev/null || true
mkdir -p "${ROOTFS}/etc/live/config.conf.d"
echo 'LIVE_CONFIG_NOAUTOLOGIN=true' > "${ROOTFS}/etc/live/config.conf.d/no-autologin.conf"
# Quiet boot
# Boot status (show for debugging)
mkdir -p "${ROOTFS}/etc/systemd/system.conf.d"
cat > "${ROOTFS}/etc/systemd/system.conf.d/quiet-boot.conf" <<EOF
cat > "${ROOTFS}/etc/systemd/system.conf.d/boot.conf" <<EOF
[Manager]
ShowStatus=no
ShowStatus=yes
DefaultTimeoutStartSec=30s
DefaultTimeoutStopSec=30s
EOF
# Disable console spam
@@ -220,6 +225,252 @@ net.ipv4.conf.all.log_martians=0
kernel.printk=1 1 1 1
EOF
# ── Hardware Check Service ──────────────────────────────────────────
# Auto-check hardware and report at boot when secubox.hwcheck=1
cat > "${ROOTFS}/usr/local/bin/secubox-hwcheck" <<'HWCHECK'
#!/bin/bash
# SecuBox Hardware Check - Evaluates system hardware and reports status
REPORT_FILE="/var/log/secubox-hwcheck.log"
REPORT_CONSOLE="/dev/tty1"
log() {
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*" | tee -a "$REPORT_FILE"
[ -c "$REPORT_CONSOLE" ] && echo "$*" > "$REPORT_CONSOLE"
}
cyber_banner() {
# VT100 green phosphor style
echo -e "\033[32m"
cat << 'BANNER'
____ _____ ____ _ _ ____ _____ __
/ ___|| ____/ ___| | | | __ ) / _ \ \/ /
\___ \| _|| | | | | | _ \| | | \ /
___) | |__| |___| |_| | |_) | |_| / \
|____/|_____\____|\___/|____/ \___/_/\_\
================================================================
DEC PDP-11/70 COMPATIBLE - HARDWARE EVALUATION MODE
================================================================
BANNER
}
check_hw() {
clear
cyber_banner
sleep 1
log ">>>> SYSTEM HARDWARE SCAN INITIATED <<<<"
log "================================================================"
echo ""
# CPU
CPU_MODEL=$(grep -m1 "model name" /proc/cpuinfo | cut -d: -f2 | xargs)
CPU_CORES=$(grep -c processor /proc/cpuinfo)
log "CPU.......... $CPU_MODEL"
log " ($CPU_CORES PROCESSOR UNITS)"
# Memory
MEM_TOTAL=$(free -h | awk '/Mem:/ {print $2}')
MEM_AVAIL=$(free -h | awk '/Mem:/ {print $7}')
log "MEMORY....... $MEM_TOTAL TOTAL / $MEM_AVAIL AVAILABLE"
# Storage
log "STORAGE DEVICES:"
lsblk -d -o NAME,SIZE,TYPE,MODEL 2>/dev/null | grep -v "^NAME" | while read line; do
log " * $line"
done
# Network
log "NETWORK INTERFACES:"
for iface in /sys/class/net/*; do
name=$(basename "$iface")
[ "$name" = "lo" ] && continue
state=$(cat "$iface/operstate" 2>/dev/null || echo "unknown")
mac=$(cat "$iface/address" 2>/dev/null || echo "n/a")
if [ "$state" = "up" ]; then
log " [+] $name: $state ($mac)"
else
log " [-] $name: $state ($mac)"
fi
done
# Graphics
log "GRAPHICS ADAPTER:"
lspci 2>/dev/null | grep -iE "vga|3d|display" | while read line; do
log " * $line"
done
# Boot mode
if [ -d /sys/firmware/efi ]; then
log "BOOT MODE.... UEFI"
else
log "BOOT MODE.... BIOS/LEGACY"
fi
# Virtualization detection
VIRT=$(systemd-detect-virt 2>/dev/null || echo "none")
if [ "$VIRT" = "none" ]; then
log "PLATFORM..... BARE METAL"
else
log "PLATFORM..... VIRTUAL ($VIRT)"
fi
echo ""
log "================================================================"
log ">>>> HARDWARE CHECK COMPLETE - ALL SYSTEMS NOMINAL <<<<"
log ">>>> SECUBOX CYBER DEFENSE PLATFORM READY <<<<"
log "================================================================"
echo ""
}
# Cyber boot splash with status - VT100 style
cyber_splash() {
clear
echo -e "\033[32m"
cyber_banner
local steps=(
"INITIALIZING SECURE ENVIRONMENT.......... OK"
"LOADING CRYPTOGRAPHIC MODULES............ OK"
"CONFIGURING NETWORK STACK................ OK"
"ACTIVATING FIREWALL RULES................ OK"
"SCANNING FOR THREATS..................... CLEAR"
"HARDENING SYSTEM......................... OK"
"OPTIMIZING PERFORMANCE................... OK"
)
for step in "${steps[@]}"; do
echo -e " > $step"
sleep 0.3
done
echo ""
echo " >>>> SECURE BOOT SEQUENCE COMPLETE <<<<"
echo ""
sleep 1
}
# Check if hwcheck requested via kernel cmdline
if grep -q "secubox.hwcheck=1" /proc/cmdline; then
cyber_splash
check_hw
fi
HWCHECK
chmod +x "${ROOTFS}/usr/local/bin/secubox-hwcheck"
# Create retro CRT VT100 DEC PDP-style boot splash
cat > "${ROOTFS}/usr/local/bin/secubox-splash" <<'SPLASH'
#!/bin/bash
# SecuBox Cyber Boot Splash - VT100/DEC PDP Style
# VT100 escape codes
ESC="\033"
GREEN="${ESC}[32m"
BRIGHT="${ESC}[1m"
DIM="${ESC}[2m"
BLINK="${ESC}[5m"
RESET="${ESC}[0m"
CLEAR="${ESC}[2J${ESC}[H"
# Clear screen and set green phosphor look
echo -ne "$CLEAR$GREEN"
# Simulated boot delay
type_slow() {
local text="$1"
for ((i=0; i<${#text}; i++)); do
echo -n "${text:$i:1}"
sleep 0.02
done
echo ""
}
cat << 'BANNER'
____ _____ ____ _ _ ____ _____ __
/ ___|| ____/ ___| | | | __ ) / _ \ \/ /
\___ \| _|| | | | | | _ \| | | \ /
___) | |__| |___| |_| | |_) | |_| / \
|____/|_____\____|\___/|____/ \___/_/\_\
BANNER
echo ""
echo -e "${BRIGHT}================================================================${RESET}${GREEN}"
echo " DEC PDP-11/70 COMPATIBLE SECURITY TERMINAL"
echo " SECUBOX CYBER DEFENSE SYSTEM v1.3"
echo -e "${BRIGHT}================================================================${RESET}${GREEN}"
echo ""
type_slow "BOOT SEQUENCE INITIATED..."
echo ""
# Boot status messages
steps=(
"MEMORY TEST.................... 4096K OK"
"LOADING KERNEL................. DONE"
"CRYPTOGRAPHIC MODULES.......... LOADED"
"NETWORK STACK.................. INITIALIZED"
"FIREWALL RULES................. ACTIVE"
"INTRUSION DETECTION............ ARMED"
"SECURE SHELL................... READY"
)
for step in "${steps[@]}"; do
echo -n " > "
type_slow "$step"
sleep 0.1
done
echo ""
echo -e "${BRIGHT}================================================================${RESET}${GREEN}"
echo ""
echo -e " ${BLINK}*${RESET}${GREEN} SYSTEM READY"
echo ""
echo " .------------------------------------------------."
echo " | SECUBOX CYBER SECURITY PLATFORM |"
echo " | TYPE 'help' FOR AVAILABLE COMMANDS |"
echo " | UNAUTHORIZED ACCESS WILL BE PROSECUTED |"
echo " '------------------------------------------------'"
echo ""
echo -e "${DIM} Press ENTER to continue...${RESET}${GREEN}"
read -t 5 || true
echo -ne "$RESET"
SPLASH
chmod +x "${ROOTFS}/usr/local/bin/secubox-splash"
# Add splash to root's bashrc for login
cat >> "${ROOTFS}/root/.bashrc" <<'BASHRC'
# SecuBox Cyber Splash on login
if [ -t 0 ] && [ -z "$SECUBOX_SPLASH_SHOWN" ]; then
export SECUBOX_SPLASH_SHOWN=1
/usr/local/bin/secubox-splash 2>/dev/null || true
fi
BASHRC
# Systemd service for hardware check
cat > "${ROOTFS}/etc/systemd/system/secubox-hwcheck.service" <<'HWSVC'
[Unit]
Description=SecuBox Hardware Check
After=local-fs.target
Before=getty@tty1.service
ConditionKernelCommandLine=secubox.hwcheck=1
[Service]
Type=oneshot
ExecStart=/usr/local/bin/secubox-hwcheck
RemainAfterExit=yes
StandardOutput=journal+console
[Install]
WantedBy=multi-user.target
HWSVC
chroot "${ROOTFS}" systemctl enable secubox-hwcheck.service 2>/dev/null || true
# ── Network config with dummy interface for kiosk ─────────────────
mkdir -p "${ROOTFS}/etc/netplan"
@@ -299,6 +550,151 @@ chroot "${ROOTFS}" systemctl enable secubox-net-fallback.service 2>/dev/null ||
chroot "${ROOTFS}" systemctl disable systemd-networkd-wait-online.service 2>/dev/null || true
chroot "${ROOTFS}" systemctl mask systemd-networkd-wait-online.service 2>/dev/null || true
# ── Plymouth Boot Splash Theme ─────────────────────────────────────
log "Installing Plymouth boot splash..."
# Create SecuBox Plymouth theme directory
PLYMOUTH_DIR="${ROOTFS}/usr/share/plymouth/themes/secubox"
mkdir -p "${PLYMOUTH_DIR}"
# Create theme descriptor
cat > "${PLYMOUTH_DIR}/secubox.plymouth" <<'PLYTHEME'
[Plymouth Theme]
Name=SecuBox Cyber
Description=SecuBox VT100/DEC PDP-11 style boot splash
ModuleName=script
[script]
ImageDir=/usr/share/plymouth/themes/secubox
ScriptFile=/usr/share/plymouth/themes/secubox/secubox.script
PLYTHEME
# Create Plymouth script (text-based retro look)
cat > "${PLYMOUTH_DIR}/secubox.script" <<'PLYSCRIPT'
# SecuBox Plymouth Theme - VT100/DEC PDP-11 Style
# Green phosphor terminal aesthetic
# Colors
Window.SetBackgroundTopColor(0.0, 0.0, 0.0);
Window.SetBackgroundBottomColor(0.0, 0.05, 0.0);
# Logo and text positioning
screen_width = Window.GetWidth();
screen_height = Window.GetHeight();
center_x = screen_width / 2;
center_y = screen_height / 2;
# Banner text (ASCII art simulation)
banner_text = "SECUBOX CYBER DEFENSE SYSTEM";
banner_sprite = Sprite();
banner_image = Image.Text(banner_text, 0.0, 1.0, 0.0, "Fixed");
banner_sprite.SetImage(banner_image);
banner_sprite.SetPosition(center_x - banner_image.GetWidth() / 2, center_y - 100, 1);
# Version line
version_text = "DEC PDP-11/70 COMPATIBLE - SECURE BOOT SEQUENCE";
version_sprite = Sprite();
version_image = Image.Text(version_text, 0.0, 0.8, 0.0, "Fixed");
version_sprite.SetImage(version_image);
version_sprite.SetPosition(center_x - version_image.GetWidth() / 2, center_y - 60, 1);
# Separator line
sep_text = "================================================================";
sep_sprite = Sprite();
sep_image = Image.Text(sep_text, 0.0, 0.6, 0.0, "Fixed");
sep_sprite.SetImage(sep_image);
sep_sprite.SetPosition(center_x - sep_image.GetWidth() / 2, center_y - 40, 1);
# Progress indicator
progress_sprite = Sprite();
fun refresh_callback() {
# Blinking cursor effect
time = Plymouth.GetTime();
if (Math.Int(time * 2) % 2 == 0) {
cursor_text = "_";
} else {
cursor_text = " ";
}
cursor_image = Image.Text(cursor_text, 0.0, 1.0, 0.0, "Fixed");
cursor_sprite = Sprite(cursor_image);
cursor_sprite.SetPosition(center_x + 100, center_y + 60, 2);
}
Plymouth.SetRefreshFunction(refresh_callback);
# Boot progress bar
progress_box_image = Image.Text("[ ]", 0.0, 0.8, 0.0, "Fixed");
progress_box_sprite = Sprite(progress_box_image);
progress_box_sprite.SetPosition(center_x - progress_box_image.GetWidth() / 2, center_y + 20, 1);
fun boot_progress_callback(duration, progress) {
# Update progress bar fill
fill_count = Math.Int(progress * 30);
fill_text = "";
for (i = 0; i < fill_count; i++) {
fill_text = fill_text + "#";
}
for (i = fill_count; i < 30; i++) {
fill_text = fill_text + " ";
}
progress_text = "[" + fill_text + "]";
progress_image = Image.Text(progress_text, 0.0, 1.0, 0.0, "Fixed");
progress_sprite.SetImage(progress_image);
progress_sprite.SetPosition(center_x - progress_image.GetWidth() / 2, center_y + 20, 1);
}
Plymouth.SetBootProgressFunction(boot_progress_callback);
# Status message display
message_sprite = Sprite();
fun message_callback(text) {
message_image = Image.Text("> " + text, 0.0, 0.7, 0.0, "Fixed");
message_sprite.SetImage(message_image);
message_sprite.SetPosition(center_x - 200, center_y + 60, 1);
}
Plymouth.SetMessageFunction(message_callback);
# Display mode change
fun display_normal_callback() {
# Normal boot display
}
fun display_password_callback(prompt, bullets) {
# Password entry (for encrypted disks)
password_sprite = Sprite();
password_image = Image.Text(prompt + " " + bullets, 0.0, 1.0, 0.0, "Fixed");
password_sprite.SetImage(password_image);
password_sprite.SetPosition(center_x - password_image.GetWidth() / 2, center_y + 100, 1);
}
Plymouth.SetDisplayNormalFunction(display_normal_callback);
Plymouth.SetDisplayPasswordFunction(display_password_callback);
# System update messages
fun system_update_callback(progress) {
update_text = "SYSTEM UPDATE: " + Math.Int(progress * 100) + "%";
update_image = Image.Text(update_text, 0.0, 0.8, 0.0, "Fixed");
update_sprite = Sprite(update_image);
update_sprite.SetPosition(center_x - update_image.GetWidth() / 2, center_y + 80, 1);
}
Plymouth.SetSystemUpdateFunction(system_update_callback);
PLYSCRIPT
# Set SecuBox theme as default
mkdir -p "${ROOTFS}/etc/plymouth"
echo "[Daemon]" > "${ROOTFS}/etc/plymouth/plymouthd.conf"
echo "Theme=secubox" >> "${ROOTFS}/etc/plymouth/plymouthd.conf"
echo "ShowDelay=0" >> "${ROOTFS}/etc/plymouth/plymouthd.conf"
# Update alternatives to use our theme
chroot "${ROOTFS}" plymouth-set-default-theme secubox 2>/dev/null || true
ok "Plymouth SecuBox theme installed"
ok "Base configuration complete"
# ══════════════════════════════════════════════════════════════════
@@ -449,7 +845,7 @@ if [[ $INCLUDE_KIOSK -eq 1 ]]; then
log "Installing kiosk mode packages..."
chroot "${ROOTFS}" apt-get install -y -q --no-install-recommends \
cage chromium fonts-dejavu-core \
xwayland \
xwayland kbd \
libinput10 libegl1 libgles2 libgbm1 libdrm2 \
mesa-utils xdg-utils 2>/dev/null || true
@@ -563,8 +959,12 @@ echo "squashfs" >> "${ROOTFS}/etc/modules-load.d/live.conf"
echo "loop" >> "${ROOTFS}/etc/modules-load.d/live.conf"
echo "overlay" >> "${ROOTFS}/etc/modules-load.d/live.conf"
# Regenerate initramfs with live-boot hooks
log "Regenerating initramfs..."
# Ensure Plymouth is in initramfs
mkdir -p "${ROOTFS}/etc/initramfs-tools/conf.d"
echo "FRAMEBUFFER=y" > "${ROOTFS}/etc/initramfs-tools/conf.d/plymouth"
# Regenerate initramfs with live-boot and Plymouth hooks
log "Regenerating initramfs with Plymouth..."
chroot "${ROOTFS}" update-initramfs -u -k all 2>/dev/null || warn "initramfs update failed"
# Clean APT
@@ -692,7 +1092,7 @@ cp "${LIVE_DIR}/live/initrd.img" "${MNT}/esp/live/"
# GRUB config
cat > "${MNT}/esp/boot/grub/grub.cfg" <<'GRUBCFG'
set default=0
set default=1
set timeout=5
insmod part_gpt
@@ -706,27 +1106,42 @@ set menu_color_normal=cyan/black
set menu_color_highlight=white/blue
menuentry "SecuBox Live" {
linux ($live)/live/vmlinuz boot=live live-media-path=live components persistence quiet
linux ($live)/live/vmlinuz boot=live live-media-path=live components persistence quiet splash
initrd ($live)/live/initrd.img
}
menuentry "SecuBox Live (Kiosk GUI)" {
linux ($live)/live/vmlinuz boot=live live-media-path=live components persistence quiet secubox.kiosk=1 systemd.unit=graphical.target
linux ($live)/live/vmlinuz boot=live live-media-path=live components persistence quiet splash secubox.kiosk=1 systemd.unit=graphical.target
initrd ($live)/live/initrd.img
}
menuentry "SecuBox Live (Bridge Mode)" {
linux ($live)/live/vmlinuz boot=live live-media-path=live components persistence quiet secubox.netmode=bridge
linux ($live)/live/vmlinuz boot=live live-media-path=live components persistence quiet splash secubox.netmode=bridge
initrd ($live)/live/initrd.img
}
menuentry "SecuBox Live (Safe Mode)" {
linux ($live)/live/vmlinuz boot=live live-media-path=live components nomodeset nosplash
linux ($live)/live/vmlinuz boot=live live-media-path=live components nomodeset console=tty0
initrd ($live)/live/initrd.img
}
menuentry "SecuBox Live (To RAM)" {
linux ($live)/live/vmlinuz boot=live live-media-path=live components toram
linux ($live)/live/vmlinuz boot=live live-media-path=live components toram quiet splash
initrd ($live)/live/initrd.img
}
menuentry "SecuBox Live (Auto-Check HW)" {
linux ($live)/live/vmlinuz boot=live live-media-path=live components persistence quiet splash secubox.hwcheck=1
initrd ($live)/live/initrd.img
}
menuentry "SecuBox Live (Auto-Check HW - Text Mode)" {
linux ($live)/live/vmlinuz boot=live live-media-path=live components persistence nomodeset console=tty0 secubox.hwcheck=1
initrd ($live)/live/initrd.img
}
menuentry "SecuBox Live (Emergency Shell)" {
linux ($live)/live/vmlinuz boot=live live-media-path=live components nomodeset console=tty0 systemd.unit=emergency.target
initrd ($live)/live/initrd.img
}
GRUBCFG
+187 -7
View File
@@ -109,7 +109,7 @@ INCLUDE_PKGS="systemd,systemd-sysv,dbus,nftables,openssh-server"
INCLUDE_PKGS+=",python3,python3-pip,nginx,curl,wget,ca-certificates,gnupg"
INCLUDE_PKGS+=",iproute2,iputils-ping,net-tools,wireguard-tools"
INCLUDE_PKGS+=",sudo,less,vim-tiny,cron,rsync,jq"
INCLUDE_PKGS+=",linux-image-arm64,raspi-firmware"
INCLUDE_PKGS+=",linux-image-arm64,plymouth,plymouth-themes"
debootstrap --arch=arm64 --foreign --include="${INCLUDE_PKGS}" \
"${SUITE}" "${ROOTFS}" "${APT_MIRROR}"
@@ -171,6 +171,182 @@ EOF
# Enable serial console
chroot "${ROOTFS}" systemctl enable serial-getty@ttyAMA0.service 2>/dev/null || true
# Enable getty@tty1 for HDMI console
mkdir -p "${ROOTFS}/etc/systemd/system/getty@tty1.service.d"
cat > "${ROOTFS}/etc/systemd/system/getty@tty1.service.d/override.conf" <<EOF
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin root --noclear %I \$TERM
Type=idle
EOF
chroot "${ROOTFS}" systemctl enable getty@tty1.service 2>/dev/null || true
chroot "${ROOTFS}" systemctl set-default multi-user.target 2>/dev/null || true
# ── Cyber Boot Splash (VT100 DEC PDP-style) ─────────────────────────
cat > "${ROOTFS}/usr/local/bin/secubox-splash" <<'SPLASH'
#!/bin/bash
# SecuBox Cyber Boot Splash - VT100/DEC PDP Style
ESC="\033"
GREEN="${ESC}[32m"
BRIGHT="${ESC}[1m"
DIM="${ESC}[2m"
BLINK="${ESC}[5m"
RESET="${ESC}[0m"
CLEAR="${ESC}[2J${ESC}[H"
echo -ne "$CLEAR$GREEN"
type_slow() {
local text="$1"
for ((i=0; i<${#text}; i++)); do
echo -n "${text:$i:1}"
sleep 0.02
done
echo ""
}
cat << 'BANNER'
____ _____ ____ _ _ ____ _____ __
/ ___|| ____/ ___| | | | __ ) / _ \ \/ /
\___ \| _|| | | | | | _ \| | | \ /
___) | |__| |___| |_| | |_) | |_| / \
|____/|_____\____|\___/|____/ \___/_/\_\
BANNER
echo ""
echo -e "${BRIGHT}================================================================${RESET}${GREEN}"
echo " RASPBERRY PI 400 SECURITY TERMINAL"
echo " SECUBOX CYBER DEFENSE SYSTEM"
echo -e "${BRIGHT}================================================================${RESET}${GREEN}"
echo ""
type_slow "BOOT SEQUENCE INITIATED..."
echo ""
steps=(
"MEMORY TEST.................... OK"
"LOADING KERNEL................. DONE"
"CRYPTOGRAPHIC MODULES.......... LOADED"
"NETWORK STACK.................. INITIALIZED"
"FIREWALL RULES................. ACTIVE"
"SECURE SHELL................... READY"
)
for step in "${steps[@]}"; do
echo -n " > "
type_slow "$step"
sleep 0.1
done
echo ""
echo -e "${BRIGHT}================================================================${RESET}${GREEN}"
echo ""
echo -e " ${BLINK}*${RESET}${GREEN} SYSTEM READY"
echo ""
echo " .------------------------------------------------."
echo " | SECUBOX CYBER SECURITY PLATFORM |"
echo " | TYPE 'help' FOR AVAILABLE COMMANDS |"
echo " | RASPBERRY PI 400 ARM64 EDITION |"
echo " '------------------------------------------------'"
echo ""
echo -e "${DIM} Press ENTER to continue...${RESET}${GREEN}"
read -t 5 || true
echo -ne "$RESET"
SPLASH
chmod +x "${ROOTFS}/usr/local/bin/secubox-splash"
# Add splash to root's bashrc
cat >> "${ROOTFS}/root/.bashrc" <<'BASHRC'
# SecuBox Cyber Splash on login
if [ -t 0 ] && [ -z "$SECUBOX_SPLASH_SHOWN" ]; then
export SECUBOX_SPLASH_SHOWN=1
/usr/local/bin/secubox-splash 2>/dev/null || true
fi
BASHRC
# ── Plymouth Boot Splash Theme ─────────────────────────────────────
log "Installing Plymouth boot splash..."
PLYMOUTH_DIR="${ROOTFS}/usr/share/plymouth/themes/secubox"
mkdir -p "${PLYMOUTH_DIR}"
cat > "${PLYMOUTH_DIR}/secubox.plymouth" <<'PLYTHEME'
[Plymouth Theme]
Name=SecuBox Cyber
Description=SecuBox VT100/DEC PDP-11 style boot splash
ModuleName=script
[script]
ImageDir=/usr/share/plymouth/themes/secubox
ScriptFile=/usr/share/plymouth/themes/secubox/secubox.script
PLYTHEME
cat > "${PLYMOUTH_DIR}/secubox.script" <<'PLYSCRIPT'
# SecuBox Plymouth Theme - Raspberry Pi Edition
Window.SetBackgroundTopColor(0.0, 0.0, 0.0);
Window.SetBackgroundBottomColor(0.0, 0.05, 0.0);
screen_width = Window.GetWidth();
screen_height = Window.GetHeight();
center_x = screen_width / 2;
center_y = screen_height / 2;
banner_text = "SECUBOX CYBER DEFENSE SYSTEM";
banner_sprite = Sprite();
banner_image = Image.Text(banner_text, 0.0, 1.0, 0.0, "Fixed");
banner_sprite.SetImage(banner_image);
banner_sprite.SetPosition(center_x - banner_image.GetWidth() / 2, center_y - 100, 1);
version_text = "RASPBERRY PI 400 - SECURE BOOT SEQUENCE";
version_sprite = Sprite();
version_image = Image.Text(version_text, 0.0, 0.8, 0.0, "Fixed");
version_sprite.SetImage(version_image);
version_sprite.SetPosition(center_x - version_image.GetWidth() / 2, center_y - 60, 1);
progress_sprite = Sprite();
fun boot_progress_callback(duration, progress) {
fill_count = Math.Int(progress * 30);
fill_text = "";
for (i = 0; i < fill_count; i++) { fill_text = fill_text + "#"; }
for (i = fill_count; i < 30; i++) { fill_text = fill_text + " "; }
progress_text = "[" + fill_text + "]";
progress_image = Image.Text(progress_text, 0.0, 1.0, 0.0, "Fixed");
progress_sprite.SetImage(progress_image);
progress_sprite.SetPosition(center_x - progress_image.GetWidth() / 2, center_y + 20, 1);
}
Plymouth.SetBootProgressFunction(boot_progress_callback);
message_sprite = Sprite();
fun message_callback(text) {
message_image = Image.Text("> " + text, 0.0, 0.7, 0.0, "Fixed");
message_sprite.SetImage(message_image);
message_sprite.SetPosition(center_x - 200, center_y + 60, 1);
}
Plymouth.SetMessageFunction(message_callback);
PLYSCRIPT
mkdir -p "${ROOTFS}/etc/plymouth"
cat > "${ROOTFS}/etc/plymouth/plymouthd.conf" <<EOF
[Daemon]
Theme=secubox
ShowDelay=0
EOF
chroot "${ROOTFS}" plymouth-set-default-theme secubox 2>/dev/null || true
mkdir -p "${ROOTFS}/etc/initramfs-tools/conf.d"
echo "FRAMEBUFFER=y" > "${ROOTFS}/etc/initramfs-tools/conf.d/plymouth"
ok "Plymouth theme installed"
ok "System configured"
# ══════════════════════════════════════════════════════════════════
@@ -221,9 +397,9 @@ EOF
chroot "${ROOTFS}" apt-get update -q
# Install firmware
# Install firmware and Raspberry Pi boot files
chroot "${ROOTFS}" apt-get install -y -q --no-install-recommends \
firmware-brcm80211 firmware-misc-nonfree \
raspi-firmware firmware-brcm80211 firmware-misc-nonfree \
2>/dev/null || warn "Some firmware unavailable"
# SecuBox packages from local cache
@@ -286,11 +462,15 @@ enable_uart=1
#arm_freq=2000
EOF
# cmdline.txt
# cmdline.txt (with splash for Plymouth)
cat > "${ROOTFS}/boot/firmware/cmdline.txt" <<EOF
console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet
console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash
EOF
# Regenerate initramfs with Plymouth
log "Regenerating initramfs with Plymouth..."
chroot "${ROOTFS}" update-initramfs -u -k all 2>/dev/null || warn "initramfs update issue"
ok "Pi bootloader configured"
# ══════════════════════════════════════════════════════════════════
@@ -340,9 +520,9 @@ UUID=${BOOT_UUID} /boot/firmware vfat defaults 0 2
UUID=${ROOT_UUID} / ext4 defaults,noatime 0 1
EOF
# Update cmdline with UUID
# Update cmdline with UUID (splash for Plymouth boot graphics)
cat > "${MNT}/boot/firmware/cmdline.txt" <<EOF
console=serial0,115200 console=tty1 root=UUID=${ROOT_UUID} rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet
console=serial0,115200 console=tty1 root=UUID=${ROOT_UUID} rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash
EOF
# Sync and unmount
+5 -1
View File
@@ -4,7 +4,7 @@
# Parses kernel parameters for SecuBox-specific options
# Run early at boot before network configuration
# ══════════════════════════════════════════════════════════════════
set -euo pipefail
set -u # Exit on undefined variables, but allow command failures
CMDLINE="${1:-/proc/cmdline}"
MARKER_DIR="/var/lib/secubox"
@@ -82,6 +82,10 @@ apply_settings() {
# Set graphical target for this boot
systemctl set-default graphical.target 2>/dev/null || true
# Explicitly start kiosk service (condition was already evaluated by systemd)
log "Starting kiosk service..."
systemctl start secubox-kiosk.service 2>/dev/null || log "Kiosk service start deferred"
else
log "Kiosk packages NOT present - use --kiosk flag when building live USB"
log "Will attempt installation when network is available"
+3 -2
View File
@@ -4,7 +4,7 @@
# Detects board type and configures WAN/LAN interfaces accordingly
# Supports: EspressoBin, MochaBin, x64 (VM/Bare-metal)
# ══════════════════════════════════════════════════════════════════
set -euo pipefail
set -u # Exit on undefined variables, but allow command failures
SECUBOX_CONF="/etc/secubox/secubox.conf"
NETPLAN_DIR="/etc/netplan"
@@ -339,7 +339,8 @@ main() {
# Generate and apply netplan configuration
generate_netplan "$board" "$wan_iface" "$lan_ifaces" "$sfp_ifaces" "$mode"
log "Applying netplan..."
netplan apply 2>/dev/null || warn "netplan apply failed"
# Use timeout to prevent hanging
timeout 5 netplan apply 2>/dev/null || log "netplan apply skipped or failed"
ok "Network configuration applied (mode: $mode)"
;;
test)
+1
View File
@@ -7,6 +7,7 @@ After=local-fs.target
[Service]
Type=oneshot
RemainAfterExit=yes
TimeoutStartSec=10s
ExecStart=/usr/sbin/secubox-cmdline-handler apply
[Install]
+21 -13
View File
@@ -1,34 +1,37 @@
[Unit]
Description=SecuBox Kiosk Mode (WebUI Display)
After=network-online.target systemd-user-sessions.service
After=systemd-user-sessions.service plymouth-quit-wait.service
Wants=network-online.target
Conflicts=getty@tty1.service
# Only start if kiosk is enabled
ConditionPathExists=/var/lib/secubox/.kiosk-enabled
[Service]
Type=simple
# Run on tty1
TTYPath=/dev/tty1
StandardInput=tty
StandardOutput=tty
StandardError=journal
# Check if kiosk is enabled (+ prefix runs as root before User= switch)
ExecStartPre=+/bin/sh -c '[ -f /var/lib/secubox/.kiosk-enabled ] || exit 1'
# Run on tty7 (like normal display managers)
TTYPath=/dev/tty7
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes
# Create runtime directory AS ROOT (before switching to User)
ExecStartPre=+/bin/mkdir -p /run/user/1000
ExecStartPre=+/bin/chown 1000:1000 /run/user/1000
ExecStartPre=+/bin/chmod 700 /run/user/1000
# Switch VT to tty7 before starting
ExecStartPre=+/bin/chvt 7
# Now switch to kiosk user
User=secubox-kiosk
Group=secubox-kiosk
# Wayland/DRM access
SupplementaryGroups=video audio input render
SupplementaryGroups=video audio input render tty
# Environment for Wayland
# Environment for Wayland (cage creates its own display, don't set WAYLAND_DISPLAY)
Environment=XDG_RUNTIME_DIR=/run/user/1000
Environment=XDG_SESSION_TYPE=wayland
Environment=KIOSK_URL=https://192.168.255.1:9443/
@@ -37,13 +40,18 @@ Environment=KIOSK_URL=https://192.168.255.1:9443/
Environment=WLR_LIBINPUT_NO_DEVICES=1
Environment=WLR_NO_HARDWARE_CURSORS=1
Environment=WLR_RENDERER_ALLOW_SOFTWARE=1
Environment=WLR_DRM_NO_ATOMIC=1
# Cage compositor running kiosk script (no -d flag, not supported in 0.1.4)
# Cage compositor running kiosk script
ExecStart=/usr/bin/cage -s -- /home/secubox-kiosk/start-kiosk.sh
Restart=on-failure
RestartSec=5
TimeoutStartSec=60
TimeoutStartSec=90
# Resource limits
MemoryMax=1G
TasksMax=200
[Install]
WantedBy=graphical.target