mirror of
https://github.com/blazblue547-afk/nova-os.git
synced 2026-12-02 14:54:17 -05:00
v4.2: first-boot auto-expand, SSH key regeneration, forced password change
- Added nova-firstboot systemd service (runs once on first boot) - Auto-expands root partition to fill SD card (fdisk + resize2fs) - Removes pre-generated SSH host keys (sshd regenerates fresh) - Forces root password change on first login (shadow last_change=0) - Compiled e2fsprogs 1.47.2 from source for resize2fs - Updated os-release, motd, and build script
This commit is contained in:
1 parent
b1f913ff14
commit
79f80c645d
6 files changed
+88
-1
No files matched your search
@@ -0,0 +1,11 @@
|
||||
|
||||
╔══════════════════════════════════════════╗
|
||||
║ N O V A O S ║
|
||||
║ "Burn bright, run light." ║
|
||||
║ 100% from source — zero prebuilt ║
|
||||
║ systemd 260 · glibc 2.41 · BusyBox ║
|
||||
║ OpenSSH 10.3 · firstboot auto-expand ║
|
||||
╚══════════════════════════════════════════╝
|
||||
|
||||
GitHub: https://github.com/blazblue547-afk/nova-os
|
||||
|
||||
Executable
+52
@@ -0,0 +1,52 @@
|
||||
#!/bin/sh
|
||||
# Nova OS — First Boot Setup
|
||||
# Expands root partition, regenerates SSH keys, expires root password
|
||||
|
||||
set -e
|
||||
|
||||
FLAG=/etc/nova-firstboot-done
|
||||
if [ -f "$FLAG" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo " ╔══════════════════════════════════════════╗"
|
||||
echo " ║ Nova OS — First Boot Setup ║"
|
||||
echo " ╚══════════════════════════════════════════╝"
|
||||
echo ""
|
||||
|
||||
# ── 1. Expand root partition to fill SD card ──────────────────
|
||||
PART=/dev/mmcblk0p2
|
||||
DISK=/dev/mmcblk0
|
||||
|
||||
echo "==> Expanding root partition to fill SD card..."
|
||||
printf "d\n2\nn\np\n2\n\n\nw\n" | fdisk "$DISK" > /dev/null 2>&1
|
||||
blockdev --rereadpt "$DISK" 2>/dev/null || true
|
||||
sleep 1
|
||||
|
||||
# ── 2. Grow ext4 filesystem ───────────────────────────────────
|
||||
echo "==> Resizing root filesystem..."
|
||||
resize2fs "$PART"
|
||||
|
||||
# ── 3. Regenerate SSH host keys ───────────────────────────────
|
||||
echo "==> Generating fresh SSH host keys..."
|
||||
rm -f /etc/ssh/ssh_host_*_key /etc/ssh/ssh_host_*_key.pub
|
||||
|
||||
# ── 4. Force root password change on first login ──────────────
|
||||
echo "==> Securing root account..."
|
||||
passwd -e root 2>/dev/null || true
|
||||
|
||||
# ── 5. Mark first-boot complete ───────────────────────────────
|
||||
touch "$FLAG"
|
||||
sync
|
||||
|
||||
echo ""
|
||||
echo " ╔══════════════════════════════════════════╗"
|
||||
echo " ║ First-boot setup complete. ║"
|
||||
echo " ║ Root password must be changed. ║"
|
||||
echo " ║ Rebooting in 5 seconds... ║"
|
||||
echo " ╚══════════════════════════════════════════╝"
|
||||
echo ""
|
||||
|
||||
sleep 5
|
||||
reboot
|
||||
@@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=Nova OS First-Boot Setup
|
||||
Documentation=https://github.com/blazblue547-afk/nova-os
|
||||
After=local-fs.target
|
||||
Before=sshd.service network.target multi-user.target
|
||||
ConditionPathExists=!/etc/nova-firstboot-done
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/sbin/nova-firstboot
|
||||
StandardOutput=journal+console
|
||||
StandardError=journal+console
|
||||
RemainAfterExit=yes
|
||||
TimeoutSec=300
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,6 @@
|
||||
NAME="Nova OS"
|
||||
VERSION="4.2-firstboot"
|
||||
ID=nova-os
|
||||
PRETTY_NAME="Nova OS 4.2"
|
||||
VERSION_ID="4.2"
|
||||
HOME_URL="https://github.com/blazblue547-afk/nova-os"
|
||||
@@ -0,0 +1 @@
|
||||
root:$6$4FERwZD4bnOFP1wz$0onBXYHLu822Hk1SQxB0Nbh/OvrI5ja29Fzmv8Gfe7E3eMfnplVA88SK/lV24Zx/nuhUZy1HeW3Q.WbvaLHgx0:0:0:99999:7:::
|
||||
Reference in new issue
Block a user