FDS/OS 1.0

This commit is contained in:
2026-09-21 22:29:23 +08:00
commit 99bc3d15c5
430 changed files with 34876 additions and 0 deletions
View File
@@ -0,0 +1,4 @@
# Retain upstream package integrity while excluding unused runit service scripts.
noextract=/etc/sv/*
noextract=/etc/runit/*
syslog=false
+2
View File
@@ -0,0 +1,2 @@
# Native init prepares volatile mounts; the kernel or stage 0 supplies the root.
# No SYSTEM or DATA device is guessed here.
+31
View File
@@ -0,0 +1,31 @@
root:x:0:
bin:x:1:
sys:x:2:
kmem:x:3:
wheel:x:4:
tty:x:5:
tape:x:6:
daemon:x:7:
floppy:x:8:
disk:x:9:
lp:x:10:
dialout:x:11:
audio:x:12:
video:x:13:
utmp:x:14:
adm:x:15:
cdrom:x:16:
optical:x:17:
mail:x:18:
storage:x:19:
scanner:x:20:
network:x:21:
kvm:x:24:
input:x:25:
plugdev:x:26:
usbmon:x:27:
sgx:x:28:
nogroup:x:99:
users:x:100:
xbuilder:x:101:
fds:x:1000:
+31
View File
@@ -0,0 +1,31 @@
root:!::
fds:!::
bin:!::
sys:!::
kmem:!::
wheel:!::
tty:!::
tape:!::
daemon:!::
floppy:!::
disk:!::
lp:!::
dialout:!::
audio:!::
video:!::
utmp:!::
adm:!::
cdrom:!::
optical:!::
mail:!::
storage:!::
scanner:!::
network:!::
kvm:!::
input:!::
plugdev:!::
usbmon:!::
sgx:!::
nogroup:!::
users:!::
xbuilder:!::
+1
View File
@@ -0,0 +1 @@
fds
+3
View File
@@ -0,0 +1,3 @@
127.0.0.1 localhost
::1 localhost
127.0.1.1 fds
+1
View File
@@ -0,0 +1 @@
FDS/OS 0.1
+13
View File
@@ -0,0 +1,13 @@
{
"directories": {
"usr/bin": "0755", "usr/lib": "0755", "etc": "0755", "var": "0755",
"dev": "0755", "proc": "0755", "sys": "0755", "run": "0755",
"tmp": "1777", "root": "0700", "home": "0755", "home/fds": "0755", "mnt": "0755",
"media": "0755", "data": "0755", "var/tmp": "1777", "var/log": "0755", "var/empty": "0755"
},
"symlinks": {
"bin": "usr/bin", "sbin": "usr/bin", "usr/sbin": "bin",
"lib": "usr/lib", "lib64": "usr/lib", "usr/lib64": "lib",
"var/run": "../run", "var/lock": "../run/lock"
}
}
@@ -0,0 +1 @@
LANG=en_US.UTF-8
@@ -0,0 +1,9 @@
passwd: files
group: files
shadow: files
hosts: files dns
networks: files
protocols: files
services: files
ethers: files
rpc: files
+6
View File
@@ -0,0 +1,6 @@
NAME="FDS/OS"
PRETTY_NAME="FDS/OS 0.1 (M2 development rootfs)"
ID=fds
ID_LIKE=void
VERSION_ID=0.1
VERSION="0.1 (M2)"
+3
View File
@@ -0,0 +1,3 @@
root:x:0:0:root:/root:/bin/bash
nobody:x:99:99:Unprivileged User:/var/empty:/usr/bin/nologin
fds:x:1000:1000:FDS User:/home/fds:/bin/bash
+28
View File
@@ -0,0 +1,28 @@
# English UTF-8 by default. Interactive shells are userspace, never PID 1.
export PATH=/usr/bin:/bin
export LANG=en_US.UTF-8
export TZ=UTC
umask 022
for f in /etc/profile.d/*.sh; do
[ ! -r "$f" ] || . "$f"
done
unset f
case $- in
*i*)
PS1='FDS# '
if [ "${UID:-}" = 0 ] && [ "$(cat /usr/share/fds/image-profile)" = recovery ]; then
PS1='RECOVERY# '
/usr/bin/fds-boottrace mark console-ready || true
fi
if [ "${UID:-}" = 1000 ]; then
PS1='FDS> '
_fds_first_prompt() {
/usr/bin/fds-boottrace mark console-ready || true
printf '\nREADY.\n'
unset PROMPT_COMMAND
unset -f _fds_first_prompt
}
PROMPT_COMMAND=_fds_first_prompt
fi
;;
esac
+3
View File
@@ -0,0 +1,3 @@
root:!:20000:0:99999:7:::
nobody:!:20000:0:99999:7:::
fds:!:20000:0:99999:7:::
+30
View File
@@ -0,0 +1,30 @@
pkgname=fds-base-files
version=0.1.0
revision=1
archs="aarch64"
depends="xbps-triggers"
conflicts="base-files>=0 base-system>=0 runit>=0 runit-void>=0 systemd>=0 busybox>=0 musl>=0"
short_desc="FDS/OS filesystem layout, identity and base configuration"
maintainer="FDS/OS maintainers"
license="Public Domain"
homepage="https://github.com/void-linux/void-packages"
conf_files="/etc/hostname /etc/hosts /etc/passwd /etc/group /etc/shadow
/etc/gshadow /etc/profile /etc/nsswitch.conf /etc/fstab /etc/issue
/etc/locale.conf /etc/xbps.d/10-fds.conf"
# Upstream reserves root-level usr-merge links for its own base-files package.
# Ship an explicit layout manifest and apply it in the FDS image assembler.
do_install() {
vinstall "${FILESDIR}/layout.json" 644 usr/share/fds
for f in hostname hosts passwd group profile nsswitch.conf fstab issue locale.conf; do
vinstall "${FILESDIR}/${f}" 644 etc
done
for f in shadow gshadow; do
vinstall "${FILESDIR}/${f}" 600 etc
done
vinstall "${FILESDIR}/os-release" 644 usr/lib
ln -s ../usr/lib/os-release "${DESTDIR}/etc/os-release"
ln -s /run/fds/resolv.conf "${DESTDIR}/etc/resolv.conf"
ln -s /proc/self/mounts "${DESTDIR}/etc/mtab"
ln -s ../usr/share/zoneinfo/Etc/UTC "${DESTDIR}/etc/localtime"
vinstall "${FILESDIR}/10-fds.conf" 644 etc/xbps.d
}
View File
+16
View File
@@ -0,0 +1,16 @@
# Explicit FDS userspace; never depend on Void's base-system metapackage.
pkgname=fds-base
version=0.1.0
revision=1
archs="aarch64"
metapackage=yes
depends="fds-base-files fds-init glibc glibc-locales coreutils binutils findutils diffutils
grep sed gawk bash tar gzip xz util-linux procps-ng shadow kbd e2fsprogs
dosfstools erofs-utils eudev kmod iproute2 iputils pciutils usbutils
ca-certificates tzdata xbps skalibs execline s6 s6-linux-init s6-rc fds-dasungd
fds-cli fds-kernel fds-cartridged fds-eink fds-dhcpcd"
short_desc="FDS/OS GNU and glibc base userspace with native s6 init"
maintainer="FDS/OS maintainers"
license="Public Domain"
# Upstream package infrastructure; FDS has no published project URL yet.
homepage="https://github.com/void-linux/void-packages"
View File
+3
View File
@@ -0,0 +1,3 @@
# Intentionally uncalibrated: no physical Pi wiring has been measured.
# Use fds topology, then follow docs/cartridges.md to assign controller/ports.
# USB 2 and USB 3 companion roots need explicit aliases for the same bays.
@@ -0,0 +1,3 @@
# Recognition only: catalog entries cannot contain commands or actions.
# Unknown USB devices are reported by VID/PID and class without auto-execution.
device = []
+13
View File
@@ -0,0 +1,13 @@
#!/bin/bash
set -euo pipefail
mapfile -t interfaces < /run/fds/network/interfaces
(( ${#interfaces[@]} > 0 ))
for interface in "${interfaces[@]}"; do
[[ $interface =~ ^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,14}$ ]]
# This profile is IPv4 DHCP. Do not leave autonomous kernel IPv6 routing
# active outside the managed client's lifetime.
if [[ -e /proc/sys/net/ipv6/conf/$interface/disable_ipv6 ]]; then
printf '1\n' >"/proc/sys/net/ipv6/conf/$interface/disable_ipv6"
fi
done
exec /usr/bin/dhcpcd --nobackground --noipv6 --noipv4ll "${interfaces[@]}"
@@ -0,0 +1,6 @@
#!/bin/bash
set -euo pipefail
install -d -m 0750 -o root -g fds /run/log/network
install -d -m 0755 /run/dhcpcd /run/dhcpcd/db
chown _dhcpcd:_dhcpcd /run/dhcpcd/db
: > /run/fds/resolv.conf
@@ -0,0 +1,11 @@
#!/bin/bash
set -euo pipefail
[[ -r /run/fds/network/interfaces ]] || exit 0
mapfile -t interfaces < /run/fds/network/interfaces
for interface in "${interfaces[@]}"; do
[[ $interface =~ ^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,14}$ ]]
if [[ -e /sys/class/net/$interface ]]; then
ip link set dev "$interface" down || [[ ! -e /sys/class/net/$interface ]]
fi
done
: > /run/fds/resolv.conf
+26
View File
@@ -0,0 +1,26 @@
pkgname=fds-cartridged
version=0.1.0
revision=1
archs="aarch64"
nostrip=yes
noverifyrdeps=yes
depends="s6 s6-rc execline coreutils fds-cli"
short_desc="FDS static cartridge daemon and stable bay discovery"
maintainer="FDS/OS maintainers"
license="MIT"
homepage="https://github.com/void-linux/void-packages"
conf_files="/etc/fds/bays.toml /etc/fds/hardware-catalog.toml"
do_install() {
local input="${XBPS_SRCDISTDIR}/${pkgname}-${version}"
(cd "$input" && sha256sum -c SHA256SUMS) || return 1
vbin "${input}/fds-cartridged"
vbin "${input}/fds-profile"
vinstall "${FILESDIR}/network-run" 755 usr/libexec/fds
vinstall "${FILESDIR}/network-stop" 755 usr/libexec/fds
vinstall "${FILESDIR}/network-runtime" 755 usr/libexec/fds
vlicense "${input}/LICENSE"
vmkdir etc/s6-rc/source
cp -a "${input}/s6-source/." "${DESTDIR}/etc/s6-rc/source/"
vinstall "${FILESDIR}/bays.toml" 644 etc/fds
vinstall "${FILESDIR}/hardware-catalog.toml" 644 etc/fds
}
View File
+25
View File
@@ -0,0 +1,25 @@
# Static payloads are built and checked on the host before packaging.
pkgname=fds-cli
version=0.1.0
revision=1
archs="aarch64"
nostrip=yes
noverifyrdeps=yes
depends="coreutils e2fsprogs erofs-utils"
short_desc="FDS static system and cartridge command interface"
maintainer="FDS/OS maintainers"
license="MIT"
homepage="https://github.com/void-linux/void-packages"
do_install() {
local input="${XBPS_SRCDISTDIR}/${pkgname}-${version}"
(cd "$input" && sha256sum -c SHA256SUMS) || return 1
vbin "${input}/fds"
vbin "${input}/fds-boottrace"
vbin "${input}/fds-burn"
vbin "${input}/fds-inspect"
vbin "${input}/fds-eject"
vbin "${input}/fds-power"
vbin "${input}/fds-release"
vlicense "${input}/LICENSE"
vlicense "${input}/RUST-NOTICES.txt"
}
@@ -0,0 +1,4 @@
# Supplement the Pi kernel's CONFIG_SPI_CH341=n requirement with scoped autoload
# suppression. An already loaded/built-in driver can bind before userspace.
# Plain RUN assignment is compatible with eudev and replaces earlier queued runs.
ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_interface", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="5512", PROGRAM="/usr/bin/dasungd udev-match-spi %p", RESULT=="yes", RUN="/usr/bin/true"
+22
View File
@@ -0,0 +1,22 @@
# The user's grayscale Paperlike 13K. Do not match arbitrary CH340 adapters.
monitor_serial = "L56051794302"
socket = "/run/dasungd/control.sock"
# Session state survives daemon restart. Persistent machine storage is not built yet.
state_file = "/run/dasungd/settings.json"
transport = "usb"
require_companion = true
require_display = true
keepalive_ms = 2000
reconnect_ms = 2000
watchdog_ms = 30000
[display]
# Pi uses DRM/KMS firmware EDID or its display client, not AMD debugfs hotplug.
enabled = false
edid = "/usr/lib/firmware/edid/dasung-paperlike13k-37hz.bin"
hotplug = "none"
[startup]
# Values read back on this unit in the source task; color-model names do not apply.
mode = 1
contrast = 4
+29
View File
@@ -0,0 +1,29 @@
# FDS-owned overlay. The build helper supplies the verified static ARM payload.
pkgname=fds-dasungd
version=0.1.0
revision=1
archs="aarch64"
nostrip=yes
noverifyrdeps=yes
depends="coreutils execline s6 s6-rc eudev"
short_desc="FDS base-system controller for the Dasung Paperlike 13K"
maintainer="FDS/OS maintainers"
license="MIT, LGPL-2.1-or-later"
# Hardware vendor reference; this local FDS controller is not an official driver.
homepage="https://www.dasung.com/"
conf_files="/etc/dasungd.toml"
do_install() {
local input="${XBPS_SRCDISTDIR}/${pkgname}-${version}"
[ -f "${input}/SHA256SUMS" ] || msg_error "Run make dasung to prepare the verified payload\n"
(cd "$input" && sha256sum -c SHA256SUMS) || return 1
vbin "${input}/dasungd"
vinstall "${FILESDIR}/dasungd.toml" 644 etc
vinstall "${FILESDIR}/99-dasung-spi.rules" 644 usr/lib/udev/rules.d
vinstall "${input}/paperlike13k-37hz.edid" 644 usr/lib/firmware/edid dasung-paperlike13k-37hz.bin
vmkdir etc/s6-rc/source
cp -a "${input}/s6-source/." "${DESTDIR}/etc/s6-rc/source/"
vlicense "${input}/LICENSE"
vlicense "${input}/libusb-COPYING" libusb-COPYING
vdoc "${input}/dasung.md" README.md
}
+8
View File
@@ -0,0 +1,8 @@
# DHCP starts only after an explicit request or a mapped Ethernet cartridge.
hostname fds
clientid
option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
require dhcp_server_identifier
nohook wpa_supplicant
+27
View File
@@ -0,0 +1,27 @@
# Derived from dhcpcd at VOID_PACKAGES_COMMIT; native s6 services live in FDS.
pkgname=fds-dhcpcd
version=10.3.2
revision=1
wrksrc="dhcpcd-${version}"
build_style=configure
make_check_target=test
configure_args="--prefix=/usr --sbindir=/usr/bin --sysconfdir=/etc
--rundir=/run/dhcpcd --dbdir=/run/dhcpcd/db --enable-privsep --privsepuser=_dhcpcd"
hostmakedepends="pkg-config"
makedepends="eudev-libudev-devel"
short_desc="FDS on-demand DHCP client with volatile leases and privilege separation"
maintainer="FDS/OS maintainers"
license="BSD-2-Clause"
homepage="https://github.com/NetworkConfiguration/dhcpcd"
distfiles="https://github.com/NetworkConfiguration/dhcpcd/archive/refs/tags/v${version}.tar.gz"
checksum=fa9aa4867e2cd5d1551bf93e34fb8ed6891702448df8a71afffab067ceb66a4f
lib32disabled=yes
conf_files=/etc/dhcpcd.conf
conflicts="dhcpcd>=0"
provides="dhcpcd-${version}_${revision}"
system_accounts="_dhcpcd"
_dhcpcd_homedir="/var/empty"
post_install() {
vlicense LICENSE
vinstall "${FILESDIR}/dhcpcd.conf" 644 etc
}
View File
+10
View File
@@ -0,0 +1,10 @@
Section "ServerFlags"
Option "DontVTSwitch" "false"
Option "BlankTime" "0"
Option "StandbyTime" "0"
Option "SuspendTime" "0"
Option "OffTime" "0"
EndSection
Section "Extensions"
Option "Composite" "Disable"
EndSection
+6
View File
@@ -0,0 +1,6 @@
("FDS/OS",
("Terminal", EXEC, "/usr/libexec/fds/terminal"),
("Enable Ethernet", EXEC, "fds network on"),
("Disable Ethernet", EXEC, "fds network off"),
("Return to console", EXEC, "fds profile deactivate")
)
@@ -0,0 +1,4 @@
{
"*" = { NoAppIcon = YES; };
"FDS" = { NoAppIcon = YES; };
}
+44
View File
@@ -0,0 +1,44 @@
{
DisableDock = YES;
DisableClip = YES;
DisableDrawers = YES;
EnableWorkspacePager = NO;
DisableAnimations = YES;
DisableBlinking = YES;
Superfluous = NO;
DoNotMakeAppIconsBounce = YES;
BounceAppIconsWhenUrgent = NO;
OpaqueMove = NO;
OpaqueResize = NO;
OpaqueMoveResizeKeyboard = NO;
IconificationStyle = None;
SaveSessionOnExit = NO;
SmoothWorkspaceBack = NO;
WorkspaceBack = (solid, "white");
WidgetColor = (solid, "#cccccc");
IconBack = (solid, "white");
FTitleBack = (solid, "black");
PTitleBack = (solid, "#cccccc");
UTitleBack = (solid, "white");
ResizebarBack = (solid, "#cccccc");
MenuTitleBack = (solid, "black");
MenuTextBack = (solid, "white");
FTitleColor = "white";
PTitleColor = "black";
UTitleColor = "black";
MenuTitleColor = "white";
MenuTextColor = "black";
MenuDisabledColor = "#666666";
HighlightColor = "black";
HighlightTextColor = "white";
WindowTitleFont = "Terminus:pixelsize=20";
MenuTitleFont = "Terminus:pixelsize=20";
MenuTextFont = "Terminus:pixelsize=20";
IconTitleFont = "Terminus:pixelsize=16";
ClipTitleFont = "Terminus:pixelsize=16";
LargeDisplayFont = "Terminus:pixelsize=32";
FrameBorderWidth = 2;
FrameBorderColor = "black";
FocusedFrameBorderColor = "black";
SelectedFrameBorderColor = "black";
}
+7
View File
@@ -0,0 +1,7 @@
#!/bin/bash
set -euo pipefail
install -d -m 0750 -o root -g fds /run/log/desktop /run/log/xserver /run/fds/x11
# Active XKB keymaps are session state; all global font caches are built in the image.
if [[ -d /var/lib/xkb ]] && ! mountpoint -q /var/lib/xkb; then
mount -t tmpfs -o mode=0755,nosuid,nodev,noexec tmpfs /var/lib/xkb
fi
+5
View File
@@ -0,0 +1,5 @@
#!/bin/bash
export PS1='FDS> '
exec /usr/bin/xterm -class FDS -name fds-terminal -title 'FDS Terminal' \
-bg white -fg black -cr black -fn '-xos4-terminus-medium-r-normal--20-200-72-72-c-100-iso10646-1' \
-ut -bc -uc -sb -geometry 100x35+40+40 -e /bin/bash --noprofile --norc -i
@@ -0,0 +1,13 @@
#!/bin/bash
set -euo pipefail
# Runs as fds; never install files into a user-controlled home as root.
mkdir -p "$HOME/GNUstep/Defaults"
for name in WindowMaker WMRootMenu WMWindowAttributes; do
if [[ ! -e $HOME/GNUstep/Defaults/$name ]]; then
cp --no-clobber "/usr/share/fds/eink/$name" "$HOME/GNUstep/Defaults/$name"
fi
done
xset s off
xset -dpms
xsetroot -solid white
exec wmaker --no-dock --no-clip --no-autolaunch
+1
View File
@@ -0,0 +1 @@
xorg
+22
View File
@@ -0,0 +1,22 @@
pkgname=fds-eink
version=0.1.0
revision=1
archs="aarch64"
depends="xorg-server xf86-input-libinput WindowMaker terminus-font xterm xset xsetroot fontconfig"
short_desc="FDS grayscale WindowMaker session and E-Ink defaults"
maintainer="FDS/OS maintainers"
license="MIT"
homepage="https://github.com/void-linux/void-packages"
conf_files="/etc/fds/xserver"
do_install() {
vmkdir etc/fonts/conf.d
ln -s ../conf.avail/75-yes-terminus.conf "${DESTDIR}/etc/fonts/conf.d/75-yes-terminus.conf"
for f in WindowMaker WMRootMenu WMWindowAttributes; do
vinstall "${FILESDIR}/${f}" 644 usr/share/fds/eink
done
for f in windowmaker-session terminal desktop-runtime; do
vinstall "${FILESDIR}/${f}" 755 usr/libexec/fds
done
vinstall "${FILESDIR}/xserver" 644 etc/fds
vinstall "${FILESDIR}/20-fds.conf" 644 usr/share/X11/xorg.conf.d
}
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
set -euo pipefail
# Login accounting is volatile on a read-only SYSTEM root.
install -m 0664 -o root -g utmp /dev/null /run/utmp
install -m 0664 -o root -g utmp /dev/null /var/log/wtmp
install -m 0600 -o root -g utmp /dev/null /var/log/btmp
+17
View File
@@ -0,0 +1,17 @@
#!/bin/bash
# Local single-user console. Drop root before reading any user shell startup files.
set -euo pipefail
if [[ $(cat /usr/share/fds/image-profile) == recovery ]]; then
# Explicit recovery image only; never read shell startup files from DATA.
install -d -m 0700 /run/fds/recovery-home
cd /run/fds/recovery-home
printf '\nFDS RECOVERY — LOCAL MAINTENANCE CONSOLE\nDATA stays read-only until explicitly selected.\nUse fds recovery help for inspection and repair commands.\n'
exec /usr/bin/env -i HOME=/run/fds/recovery-home USER=root LOGNAME=root \
SHELL=/bin/bash PATH=/usr/bin:/bin LANG=en_US.UTF-8 TERM="${TERM:-linux}" \
/bin/bash --login
fi
cd /home/fds
exec /usr/bin/s6-setuidgid fds /usr/bin/env -i \
HOME=/home/fds USER=fds LOGNAME=fds SHELL=/bin/bash \
PATH=/usr/bin:/bin LANG=en_US.UTF-8 TERM="${TERM:-linux}" \
/bin/bash --login
+4
View File
@@ -0,0 +1,4 @@
#!/bin/bash
set -euo pipefail
read -r name < /etc/hostname
exec /usr/bin/hostname "$name"
+19
View File
@@ -0,0 +1,19 @@
#!/bin/bash
set -euo pipefail
# /dev is supplied by the kernel/early userspace; s6 stage 1 mounts /run.
# Never remount SYSTEM writable.
mountpoint -q /proc || mount -t proc -o nosuid,nodev,noexec proc /proc
mountpoint -q /sys || mount -t sysfs -o nosuid,nodev,noexec sysfs /sys
mountpoint -q /tmp || mount -t tmpfs -o mode=1777,nosuid,nodev tmpfs /tmp
mountpoint -q /var/tmp || mount -t tmpfs -o mode=1777,nosuid,nodev tmpfs /var/tmp
mountpoint -q /var/log || mount -t tmpfs -o mode=0755,nosuid,nodev tmpfs /var/log
mountpoint -q /home/fds || mount -t tmpfs -o mode=0700,uid=1000,gid=1000,nosuid,nodev tmpfs /home/fds
mkdir -p /dev/pts /dev/shm /run/lock /run/log
mountpoint -q /dev/pts || mount -t devpts -o mode=0620,gid=5,nosuid,noexec devpts /dev/pts
mountpoint -q /dev/shm || mount -t tmpfs -o mode=1777,nosuid,nodev tmpfs /dev/shm
ln -snf /proc/self/fd /dev/fd
ln -snf /proc/self/fd/0 /dev/stdin
ln -snf /proc/self/fd/1 /dev/stdout
ln -snf /proc/self/fd/2 /dev/stderr
# Local TCP/UDP is base IPC. External interfaces remain down until requested.
ip link set dev lo up
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
# Stage 2 is a child of native s6-svscan, never PID 1.
set -euo pipefail
/usr/bin/fds-boottrace adopt || printf 'Boot trace could not be initialized\n' >&2
s6-rc-init -c /etc/s6-rc/compiled -l /run/s6-rc /run/service
exec /etc/s6-linux-init/current/scripts/runlevel "${1:-default}"
+17
View File
@@ -0,0 +1,17 @@
#!/bin/bash
set -euo pipefail
# A native shutdown is irrevocable once started. Keep this hook alive on failure
# instead of letting a nonzero script exit trigger final process killing.
if ! /usr/bin/fds-power --shutdown-hook; then
printf 'FDS shutdown helper failed; remaining powered on for recovery.\n' >&2
exec /usr/bin/fds-power --hold-shutdown
fi
failed=()
if [[ -d /run/s6-rc ]]; then
if ! s6-rc -b -l /run/s6-rc -t 15000 -d -a change; then
printf 'FDS service stop failed after verified DATA unmount; native cleanup will terminate remaining processes.\n' >&2
failed=(failed)
fi
fi
/usr/bin/fds-power --record-final "${failed[@]}"
# s6-linux-init-shutdownd handles the final process cleanup, sync and unmount.
+2
View File
@@ -0,0 +1,2 @@
#!/usr/bin/execlineb -P
/usr/bin/true
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
set -euo pipefail
case ${1:-default} in
default|boot|2|3|4|5) exec s6-rc -l /run/s6-rc -t 15000 -u change boot ;;
*) printf 'Unsupported FDS runlevel: %s\n' "$1" >&2; exit 100 ;;
esac
+21
View File
@@ -0,0 +1,21 @@
# Image-time s6 configuration. The native upstream binaries own PID 1.
pkgname=fds-init
version=0.1.0
revision=1
archs="aarch64"
depends="iproute2 s6-linux-init s6-rc s6 execline coreutils util-linux bash eudev fds-dasungd fds-cli fds-cartridged"
short_desc="FDS native s6 boot graph and shutdown configuration"
maintainer="FDS/OS maintainers"
license="Public Domain"
homepage="https://skarnet.org/software/s6-linux-init/"
do_install() {
local input="${XBPS_SRCDISTDIR}/${pkgname}-${version}"
(cd "$input" && sha256sum -c SHA256SUMS) || return 1
vmkdir etc/s6-rc/source
cp -a "${input}/s6-source/." "${DESTDIR}/etc/s6-rc/source/"
vmkdir usr/share/fds/init-skel
cp -a "${FILESDIR}/skel/." "${DESTDIR}/usr/share/fds/init-skel/"
for f in runtime-fs console hostname console-session; do
vinstall "${FILESDIR}/${f}" 755 usr/libexec/fds
done
}
View File
+68
View File
@@ -0,0 +1,68 @@
# Native early userspace, immutable SYSTEM and DATA support.
CONFIG_LOCALVERSION="-fds1"
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_BLK_DEV_INITRD=y
CONFIG_RD_GZIP=y
CONFIG_RD_LZ4=y
CONFIG_RD_ZSTD=y
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
CONFIG_EFI_PARTITION=y
CONFIG_EROFS_FS=y
CONFIG_EROFS_FS_ZIP=y
CONFIG_EXT4_FS=y
CONFIG_FAT_FS=y
CONFIG_VFAT_FS=y
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
CONFIG_USB=y
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_PCI=y
CONFIG_USB_XHCI_PLATFORM=y
CONFIG_USB_STORAGE=y
CONFIG_USB_UAS=y
CONFIG_PCI=y
CONFIG_PCIE_BRCMSTB=y
CONFIG_PCI_MSI=y
CONFIG_MFD_RP1=y
CONFIG_PINCTRL_RP1=y
CONFIG_COMMON_CLK_RP1=y
CONFIG_BCM2712_IOMMU=y
CONFIG_BLK_DEV_NVME=y
CONFIG_HID=y
CONFIG_HID_GENERIC=y
CONFIG_USB_HID=y
CONFIG_INPUT_EVDEV=y
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
CONFIG_DRM=y
# VC4 requires these audio core interfaces even when sound devices are optional.
CONFIG_SND=y
CONFIG_SND_SOC=y
CONFIG_DRM_VC4=y
CONFIG_DRM_VC4_HDMI_CEC=y
CONFIG_DRM_FBDEV_EMULATION=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FW_LOADER=y
CONFIG_DRM_LOAD_EDID_FIRMWARE=y
# The companion CH341 SPI interface must remain available to dasungd.
# CONFIG_SPI_CH341 is not set
# Generic ARM VM drivers let us test this build without pretending to emulate Pi firmware.
CONFIG_SERIAL_AMBA_PL011=y
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
CONFIG_PCI_HOST_GENERIC=y
CONFIG_ATA=y
CONFIG_SATA_AHCI=y
CONFIG_VIRTIO=y
CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_BLK=y
# Avoid random module signing inputs and large development-only debug artifacts.
# Release authentication covers the complete immutable kernel/module image.
# CONFIG_MODULE_SIG is not set
CONFIG_DEBUG_INFO_NONE=y
# CONFIG_DEBUG_INFO_BTF is not set
+63
View File
@@ -0,0 +1,63 @@
# Based on rpi5-kernel at the pinned Void commit; upstream stays unchanged.
pkgname=fds-kernel
version=6.12.87
revision=1
_githash=ae4d75fb36deba0fe1a986d9bfae65755e082dd0
archs="aarch64"
wrksrc="linux-${_githash}"
hostmakedepends="perl kmod openssl-devel bc bison flex xz python3 cpio"
short_desc="FDS Raspberry Pi 5 kernel with built-in boot drivers"
maintainer="FDS/OS maintainers"
license="GPL-2.0-only"
homepage="https://github.com/raspberrypi/linux"
distfiles="https://github.com/raspberrypi/linux/archive/${_githash}.tar.gz"
checksum=432afe0cbb9370fc9329f67d44bdc892b8e2417a60dd33de8f0cd22e9c697c62
python_version=3
nodebug=yes
nostrip=yes
noverifyrdeps=yes
noshlibprovides=yes
export KBUILD_BUILD_TIMESTAMP="Thu Jan 1 00:00:00 UTC 1970"
export KBUILD_BUILD_USER=fds
export KBUILD_BUILD_HOST=fds-builder
_cross="CROSS_COMPILE=aarch64-linux-gnu-"
do_configure() {
make ARCH=arm64 ${_cross} bcm2712_defconfig
scripts/kconfig/merge_config.sh -m .config "${FILESDIR}/fds.config"
make ARCH=arm64 ${_cross} olddefconfig
# Kconfig can silently drop impossible requests. Verify every delta entry.
while IFS= read -r setting; do
case "$setting" in
CONFIG_*=*) grep -Fqx "$setting" .config || return 1 ;;
'# CONFIG_'*' is not set')
local symbol="${setting#\# }"
symbol="${symbol% is not set}"
! grep -Eq "^${symbol}=[ym]$" .config || return 1 ;;
esac
done <"${FILESDIR}/fds.config"
}
do_build() {
export LDFLAGS=
make ARCH=arm64 ${_cross} ${makejobs} Image modules dtbs
}
do_install() {
local release
release=$(make -s ARCH=arm64 ${_cross} kernelrelease)
vinstall arch/arm64/boot/Image 644 boot kernel_2712.img
vinstall .config 644 boot config-fds
vinstall System.map 644 boot System.map-fds
vmkdir boot/overlays
vcopy "arch/arm64/boot/dts/broadcom/bcm2712-*.dtb" boot
vcopy "arch/arm64/boot/dts/overlays/*.dtbo" boot/overlays
vinstall arch/arm64/boot/dts/overlays/README 644 boot/overlays
make ARCH=arm64 ${_cross} ${makejobs} INSTALL_MOD_PATH="${DESTDIR}/usr" \
INSTALL_MOD_STRIP=1 DEPMOD=true modules_install
rm -f "${DESTDIR}/usr/lib/modules/${release}/build" "${DESTDIR}/usr/lib/modules/${release}/source"
depmod -b "${DESTDIR}/usr" "$release"
vmkdir usr/share/fds
printf '%s\n' "$release" >"${DESTDIR}/usr/share/fds/kernel-release"
}