v3.0: From-source build — systemd 260 + BusyBox 1.36.1

- Compile systemd 260.2 from upstream source (meson/ninja)
- Compile BusyBox 1.36.1 static from source
- Zero Debian binaries in rootfs (kernel + systemd + busybox all from source)
- 56 MB rootfs with networkd, resolved, and getty
- Custom Nova splash service at boot
- Runtime libs (glibc, libcrypto, etc.) from host toolchain
- Updated mkimage.sh, Makefile, README for from-source workflow
- Output: nova-os-3.0-from-source.img (1.5 GB)
This commit is contained in:
blazblue547-afk committed 2026-06-14 10:14:42 -04:00
1 parent 8a622dfb9e
commit 2dfd0999db
4 files changed
+103 -167

No files matched your search

+3 -101
View File
@@ -2,105 +2,7 @@ build/
*.img *.img
*.tar.xz *.tar.xz
*.tar.bz2 *.tar.bz2
*.tar.gz
rootfs-busybox/ rootfs-busybox/
rootfs/
# Debian rootfs — only track our custom configs, not binaries rootfs-custom/
# usrmerge symlinks (files, not dirs — no trailing slash)
rootfs/bin
rootfs/sbin
rootfs/lib
rootfs/lib64
# Directory ignores
rootfs/usr/
rootfs/var/
rootfs/dev/
rootfs/proc/
rootfs/sys/
rootfs/tmp/
rootfs/run/
rootfs/root/
rootfs/etc/alternatives/
rootfs/etc/apparmor.d/
rootfs/etc/apt/
rootfs/etc/cron.d/
rootfs/etc/cron.daily/
rootfs/etc/default/
rootfs/etc/dhcp/
rootfs/etc/dpkg/
rootfs/etc/init.d/
rootfs/etc/iproute2/
rootfs/etc/ld.so.conf.d/
rootfs/etc/logrotate.d/
rootfs/etc/modules-load.d/
rootfs/etc/network/
rootfs/etc/pam.d/
rootfs/etc/profile.d/
rootfs/etc/rc*.d/
rootfs/etc/rcS.d/
rootfs/etc/security/
rootfs/etc/selinux/
rootfs/etc/skel/
rootfs/etc/ssl/
rootfs/etc/sudoers.d/
rootfs/etc/sysctl.d/
rootfs/etc/systemd/system/getty.target.wants/
rootfs/etc/systemd/system/multi-user.target.wants/
rootfs/etc/terminfo/
rootfs/etc/udev/
rootfs/etc/update-motd.d/
rootfs/etc/xdg/
rootfs/etc/*.conf
rootfs/etc/*.bak
rootfs/etc/adduser.conf
rootfs/etc/bindresvport.blacklist
rootfs/etc/ca-certificates.conf
rootfs/etc/debconf.conf
rootfs/etc/debian_version
rootfs/etc/deluser.conf
rootfs/etc/environment
rootfs/etc/ethertypes
rootfs/etc/gai.conf
rootfs/etc/group
rootfs/etc/group-
rootfs/etc/gshadow
rootfs/etc/gshadow-
rootfs/etc/host.conf
rootfs/etc/hosts
rootfs/etc/issue.net
rootfs/etc/ld.so.cache
rootfs/etc/ld.so.conf
rootfs/etc/libaudit.conf
rootfs/etc/login.defs
rootfs/etc/machine-id
rootfs/etc/mke2fs.conf
rootfs/etc/modules
rootfs/etc/mtab
rootfs/etc/netconfig
rootfs/etc/networks
rootfs/etc/nsswitch.conf
rootfs/etc/pam.conf
rootfs/etc/passwd
rootfs/etc/passwd-
rootfs/etc/profile
rootfs/etc/protocols
rootfs/etc/rmt
rootfs/etc/rpc
rootfs/etc/services
rootfs/etc/shadow
rootfs/etc/shadow-
rootfs/etc/shells
rootfs/etc/subgid
rootfs/etc/subuid
rootfs/etc/sudo.conf
rootfs/etc/sudo_logsrvd.conf
rootfs/etc/sudoers
rootfs/etc/sysctl.conf
rootfs/etc/timezone
rootfs/etc/wgetrc
rootfs/etc/xattr.conf
rootfs/etc/.pwd.lock
rootfs/etc/bash.bashrc
rootfs/etc/bash_completion
rootfs/etc/e2scrub.conf
rootfs/etc/issue
+46 -14
View File
@@ -1,32 +1,62 @@
# Nova OS Build System # Nova OS Build System — from source
# Produces a bootable image for Raspberry Pi 5 # Produces a bootable image for Raspberry Pi 5
NOVA_ROOT := $(dir $(lastword $(MAKEFILE_LIST))) NOVA_ROOT := $(dir $(lastword $(MAKEFILE_LIST)))
BUILD_DIR := $(NOVA_ROOT)build BUILD_DIR := $(NOVA_ROOT)build
ROOTFS := $(NOVA_ROOT)rootfs ROOTFS := $(NOVA_ROOT)rootfs-custom
BOOT := $(NOVA_ROOT)boot BOOT := $(NOVA_ROOT)boot
IMAGE := $(NOVA_ROOT)nova-os-2.0-systemd.img IMAGE := $(NOVA_ROOT)nova-os-3.0-from-source.img
KERNEL_DIR := $(BUILD_DIR)/linux-7.0.12 KERNEL_DIR := $(BUILD_DIR)/linux-7.0.12
ARCH := arm64 SYSTEMD_DIR := $(BUILD_DIR)/systemd-260.2
CROSS := aarch64-linux-gnu- BUSYBOX_DIR := $(BUILD_DIR)/busybox-1.36.1
ARCH := arm64
CROSS := aarch64-linux-gnu-
.PHONY: all kernel rootfs image clean .PHONY: all kernel systemd busybox rootfs image clean
all: kernel image all: kernel systemd busybox image
@echo "✦ Nova OS build complete: $(IMAGE)" @echo "✦ Nova OS build complete: $(IMAGE)"
@echo "Flash: sudo dd if=$(IMAGE) of=/dev/mmcblk0 bs=4M status=progress" @echo "Flash: sudo dd if=$(IMAGE) of=/dev/mmcblk0 bs=4M status=progress"
kernel: kernel:
cd $(KERNEL_DIR) && \ cd $(KERNEL_DIR) && \
ARCH=$(ARCH) CROSS_COMPILE=$(CROSS) make defconfig && \
ARCH=$(ARCH) CROSS_COMPILE=$(CROSS) scripts/kconfig/merge_config.sh .config novaos_fragment.config && \
ARCH=$(ARCH) CROSS_COMPILE=$(CROSS) make olddefconfig && \
ARCH=$(ARCH) CROSS_COMPILE=$(CROSS) make -j4 Image modules dtbs ARCH=$(ARCH) CROSS_COMPILE=$(CROSS) make -j4 Image modules dtbs
rootfs: systemd:
@echo "Rootfs is built via debootstrap. See README.md for instructions." cd $(SYSTEMD_DIR) && \
@echo "Pre-built rootfs at $(ROOTFS)/" meson setup build \
--prefix=/usr \
--buildtype=release \
-Dmode=release \
-Dpam=false \
-Dselinux=false \
-Dapparmor=false \
-Dpolkit=false \
-Dtests=false \
-Dman=false \
-Dhtml=false \
-Dnetworkd=true \
-Dresolve=true \
-Dlogind=true \
-Dcoredump=false \
-Dhostnamed=false \
-Dtimedated=false \
-Dlocaled=false \
-Dvconsole=false \
-Dquotacheck=false \
-Dbacklight=false \
-Drfkill=false \
-Dxdg-autostart=false \
-Dldconfig=false \
-Dhibernate=false && \
ninja -C build -j4 && \
DESTDIR=$(ROOTFS) ninja -C build install
busybox:
cd $(BUSYBOX_DIR) && \
make -j4 && \
make CONFIG_PREFIX=$(ROOTFS) install
image: image:
bash $(NOVA_ROOT)mkimage.sh bash $(NOVA_ROOT)mkimage.sh
@@ -34,3 +64,5 @@ image:
clean: clean:
rm -f $(IMAGE) rm -f $(IMAGE)
cd $(KERNEL_DIR) && make clean cd $(KERNEL_DIR) && make clean
cd $(SYSTEMD_DIR) && rm -rf build
cd $(BUSYBOX_DIR) && make clean
+50 -48
View File
@@ -2,84 +2,86 @@
**Burn bright, run light.** **Burn bright, run light.**
A lightweight Linux distribution built from the latest mainline kernel and a minimal Debian userspace. Designed for the Raspberry Pi 5, Nova OS pairs a custom-compiled kernel with systemd for modern init and service management — keeping things small but capable. A from-source Linux distribution — every significant binary compiled on this machine. No Debian packages, no prebuilt binaries (except the C runtime toolchain). Designed for the Raspberry Pi 5.
``` ```
╔══════════════════════════════════════════╗ ╔══════════════════════════════════════════╗
║ N O V A O S ║ ║ N O V A O S ║
║ kernel 7.0.12-nova-os ║ ║ kernel 7.0.12-nova-os ║
║ "Burn bright, run light." ║ ║ "Burn bright, run light." ║
║ systemd 260 · BusyBox 1.36.1 ║
╚══════════════════════════════════════════╝ ╚══════════════════════════════════════════╝
``` ```
## Specifications ## Specifications
| Component | Version | | Component | Version | Built From |
|-------------|----------------------| |-------------|----------------------|----------------|
| Kernel | Linux 7.0.12-nova-os | | Kernel | Linux 7.0.12 | kernel.org source |
| Userspace | Debian Bookworm (minbase) | | Init system | systemd 260.2 | github.com/systemd/systemd |
| Init | systemd 252 | | Core utils | BusyBox 1.36.1 | busybox.net source |
| Shell | bash | | Shell | ash (BusyBox) | busybox.net source |
| Architecture | aarch64 (ARM64) | | Architecture | aarch64 (ARM64) | — |
| Target | Raspberry Pi 5 (BCM2712) | | Target | Raspberry Pi 5 (BCM2712) | — |
| Image size | ~1.5 GB | | Image size | ~1.5 GB | — |
| Rootfs size | ~56 MB | — |
## v2.0 — What Changed ## What Makes This Different
- **systemd replaces BusyBox init** — proper service management, cgroups, socket activation - **Zero Debian binaries** — systemd, BusyBox, and the kernel are all compiled from upstream source
- **Debian minbase userspace** — apt-ready, 344MB rootfs - **systemd 260** — latest stable, configured with meson/ninja, minimal feature set
- **systemd-networkd** — DHCP networking out of the box - **BusyBox 1.36.1** — static binary providing all Unix utilities (ash shell, coreutils, networking, etc.)
- **systemd-resolved** — DNS resolution - **56 MB rootfs** — just the essentials: init, shell, networkd, resolved
- **Nova splash service** — boot banner on tty1 - **Runtime libraries** — glibc, libcrypto, zlib, zstd from host toolchain (full LFS bootstrap coming in v4.0)
- **Root password:** `nova` (change on first login)
## Build from Source ## Build from Source
```bash ```bash
make kernel # Build the kernel (45 min on Pi 5) # Prerequisites
make image # Package into bootable .img (requires sudo) sudo apt-get install meson ninja-build gcc gperf gettext python3-jinja2
make all # Kernel + image
# 1. Build the kernel (45 min on Pi 5)
make kernel
# 2. Build systemd
make systemd
# 3. Build BusyBox
make busybox
# 4. Assemble rootfs + image
make image
``` ```
The rootfs is pre-built via debootstrap. To rebuild it: Or just `make all` for the full pipeline.
```bash
sudo apt-get install debootstrap
sudo debootstrap --arch=arm64 --variant=minbase \
--include=systemd,systemd-sysv,udev,dbus,apt,kmod,netbase \
bookworm rootfs http://deb.debian.org/debian
# Then customize: hostname, os-release, splash service, networking
```
## Flash to SD Card ## Flash to SD Card
```bash ```bash
sudo dd if=nova-os-2.0-systemd.img of=/dev/mmcblk0 bs=4M status=progress sudo dd if=nova-os-3.0-from-source.img of=/dev/mmcblk0 bs=4M status=progress
``` ```
## Directory Layout ## Directory Layout
``` ```
nova-os/ nova-os/
├── Makefile # Build system ├── Makefile # Build system
├── boot/ # Boot partition files ├── mkimage.sh # Image packager
│ ├── config.txt # Pi bootloader config ├── boot/ # Pi boot partition files
│ └── cmdline.txt # Kernel command line │ ├── config.txt # Bootloader config
├── rootfs/ # Debian minbase + systemd rootfs │ └── cmdline.txt # Kernel command line
│ ├── bin/ # Essential binaries ├── rootfs-custom/ # Built root filesystem (~56 MB)
│ ├── sbin/ # System binaries │ ├── sbin/init → /usr/lib/systemd/systemd
│ │ └── init → /lib/systemd/systemd │ ├── bin/busybox # Static BusyBox binary
│ ├── etc/ │ ├── lib/ # Runtime libraries
│ │ ├── systemd/ # systemd config + services │ ├── usr/lib/systemd/ # systemd binaries
│ │ ├── hostname # "nova-os" │ └── etc/ # System configuration
│ │ ├── os-release # OS identity └── build/ # Build artifacts
│ │ ├── motd # Login banner ├── linux-7.0.12/ # Kernel source + build
│ │ └── fstab # Mount table ├── systemd-260.2/ # systemd source + build
│ └── lib/systemd/ # systemd itself └── busybox-1.36.1/ # BusyBox source + build
└── build/ # Build artifacts
└── linux-7.0.12/ # Kernel source + build
``` ```
## License ## License
Nova OS inherits the GPLv2 license from the Linux kernel. Nova OS inherits the GPLv2 license from the Linux kernel. systemd is LGPLv2.1+. BusyBox is GPLv2.
+4 -4
View File
@@ -5,11 +5,11 @@
set -e set -e
NOVA_ROOT="/home/joe/nova-os" NOVA_ROOT="/home/joe/nova-os"
IMAGE="$NOVA_ROOT/nova-os-2.0-systemd.img" IMAGE="$NOVA_ROOT/nova-os-3.0-from-source.img"
SIZE_MB=1536 # 1.5 GB SIZE_MB=1536 # 1.5 GB
TMP_MNT="/tmp/nova-os-mnt" TMP_MNT="/tmp/nova-os-mnt"
echo "==> Nova OS Image Builder" echo "==> Nova OS Image Builder (from-source)"
echo "" echo ""
# Check kernel exists # Check kernel exists
@@ -74,8 +74,8 @@ echo "✓ Boot partition ready"
# Copy rootfs # Copy rootfs
echo "==> Copying root filesystem..." echo "==> Copying root filesystem..."
sudo cp -a "$NOVA_ROOT/rootfs/"* "$TMP_MNT/root/" sudo cp -a "$NOVA_ROOT/rootfs-custom/"* "$TMP_MNT/root/"
echo "✓ Root filesystem ready (systemd $(sudo chroot "$TMP_MNT/root" systemd --version 2>/dev/null | head -1 | awk '{print $2}'))" echo "✓ Root filesystem ready (systemd 260 · BusyBox 1.36.1 · built from source)"
# Unmount # Unmount
echo "==> Unmounting..." echo "==> Unmounting..."