Migrate all init scripts from legacy format to .service TOML units

Convert 14 config files from the legacy init script format (plain-text
commands) to the systemd-style TOML .service format. The init daemon
supports both formats; this eliminates the legacy path entirely so that
all services use the richer, more structured TOML unit format.

Key changes per config:
- base.toml: split 00_base into 00_base.service (tmpdir) + 00_sudo.service
  (sudo daemon); remove redundant 00_drivers and 10_net (handled by
  existing .service files from the base recipe)
- minimal.toml: split 30_console into 29_activate_console.service +
  30_console.service + 31_debug_console.service
- desktop-minimal.toml: convert 20_display and 30_console to .service,
  add 29_activate_console and 31_debug_console overrides
- x11.toml: convert 10_dbus, 10_xenv, 20_orbital, 30_console
- redoxer.toml: split 10_net into 10_smolnetd.service + 10_dhcpd.service,
  convert 30_redoxer
- redbear-legacy-*.toml: update override references to .service paths
- acid.toml, auto-test.toml, os-test.toml, sys-build.toml: direct conversions
This commit is contained in:
2026-04-25 12:20:09 +01:00
parent dc69317ddf
commit 61e1a1335c
14 changed files with 302 additions and 113 deletions
+9 -3
View File
@@ -14,10 +14,16 @@ coreutils = {}
ion = {}
[[files]]
path = "/usr/lib/init.d/10_acid"
path = "/usr/lib/init.d/10_acid.service"
data = """
requires_weak 00_drivers
ion /usr/lib/run_acid.ion
[unit]
description = "Acid test runner"
requires_weak = ["00_pcid-spawner.service"]
[service]
cmd = "ion"
args = ["/usr/lib/run_acid.ion"]
type = "oneshot_async"
"""
[[files]]
+9 -3
View File
@@ -13,10 +13,16 @@ filesystem_size = 1024
auto-test = {}
[[files]]
path = "/usr/lib/init.d/30_console"
path = "/usr/lib/init.d/30_console.service"
data = """
requires_weak 10_net
ion /usr/lib/run_tests.ion
[unit]
description = "Automated test runner"
requires_weak = ["00_base.target"]
[service]
cmd = "ion"
args = ["/usr/lib/run_tests.ion"]
type = "oneshot"
"""
[[files]]
+14 -18
View File
@@ -23,31 +23,27 @@ uutils = {}
## Configuration files
[[files]]
path = "/usr/lib/init.d/00_base"
path = "/usr/lib/init.d/00_base.service"
data = """
# clear and recreate tmpdir with 0o1777 permission
rm -rf /tmp
mkdir -m a=rwxt /tmp
[unit]
description = "Base environment setup (tmpdir)"
notify ipcd
notify ptyd
nowait sudo --daemon
[service]
cmd = "ion"
args = ["-c", "rm -rf /tmp; mkdir -m a=rwxt /tmp"]
type = "oneshot"
"""
[[files]]
path = "/usr/lib/init.d/00_drivers"
path = "/usr/lib/init.d/00_sudo.service"
data = """
requires_weak 00_base
pcid-spawner
"""
[unit]
description = "Sudo privilege daemon"
## Network init
[[files]]
path = "/usr/lib/init.d/10_net"
data = """
requires_weak 00_drivers
notify smolnetd
nowait dhcpd
[service]
cmd = "sudo"
args = ["--daemon"]
type = "oneshot_async"
"""
[[files]]
+40 -9
View File
@@ -15,18 +15,49 @@ orbterm = "ignore"
orbutils = "ignore"
[[files]]
path = "/usr/lib/init.d/20_display"
path = "/usr/lib/init.d/20_display.service"
data = """
requires_weak 10_net
notify audiod
nowait VT=3 ion -c true
[unit]
description = "Display setup"
requires_weak = ["00_base.target"]
[service]
cmd = "ion"
args = ["-c", "true"]
envs = { VT = "3" }
type = "oneshot_async"
"""
# Override console config to not switch to VT 2
# Override: do not activate VT 2 (desktop uses VT 3)
[[files]]
path = "/usr/lib/init.d/30_console"
path = "/usr/lib/init.d/29_activate_console.service"
data = ""
# Override console config to depend on display instead of VT activation
[[files]]
path = "/usr/lib/init.d/30_console.service"
data = """
requires_weak 20_display
nowait getty 2
nowait getty /scheme/debug/no-preserve -J
[unit]
description = "Console terminals"
requires_weak = ["20_display.service"]
[service]
cmd = "getty"
args = ["2"]
type = "oneshot_async"
respawn = true
"""
[[files]]
path = "/usr/lib/init.d/31_debug_console.service"
data = """
[unit]
description = "Debug console"
requires_weak = ["30_console.service"]
[service]
cmd = "getty"
args = ["/scheme/debug/no-preserve", "-J"]
type = "oneshot_async"
respawn = true
"""
+37 -5
View File
@@ -17,10 +17,42 @@ pkgutils = {}
kibi = {}
[[files]]
path = "/usr/lib/init.d/30_console"
path = "/usr/lib/init.d/29_activate_console.service"
data = """
requires_weak 10_net
inputd -A 2
nowait getty 2
nowait getty /scheme/debug/no-preserve -J
[unit]
description = "Activate console VT"
requires_weak = ["00_base.target"]
[service]
cmd = "inputd"
args = ["-A", "2"]
type = "oneshot_async"
"""
[[files]]
path = "/usr/lib/init.d/30_console.service"
data = """
[unit]
description = "Console terminals"
requires_weak = ["29_activate_console.service"]
[service]
cmd = "getty"
args = ["2"]
type = "oneshot_async"
respawn = true
"""
[[files]]
path = "/usr/lib/init.d/31_debug_console.service"
data = """
[unit]
description = "Debug console"
requires_weak = ["29_activate_console.service"]
[service]
cmd = "getty"
args = ["/scheme/debug/no-preserve", "-J"]
type = "oneshot_async"
respawn = true
"""
+10 -4
View File
@@ -14,9 +14,15 @@ prompt = false
os-test-bins = {} # Provides source and cross-compiled binaries
[[files]]
path = "/usr/lib/init.d/30_console"
path = "/usr/lib/init.d/30_console.service"
data = """
requires_weak 10_net
RUST_BACKTRACE=full os-test-runner
shutdown
[unit]
description = "OS test runner"
requires_weak = ["00_base.target"]
[service]
cmd = "ion"
args = ["-c", "os-test-runner; shutdown"]
envs = { RUST_BACKTRACE = "full" }
type = "oneshot"
"""
+15 -23
View File
@@ -1,15 +1,11 @@
# Red Bear OS overrides for legacy base init scripts.
# Red Bear OS overrides for base init services.
#
# 00_base: tmpdir setup + sudo --daemon. ipcd and ptyd are started by the
# systemd-style services in base recipe's init.d/ (00_ipcd.service,
# 00_ptyd.service). The old "notify" calls have been removed because
# the "notify" binary does not exist — they always failed silently.
# sudo --daemon is kept here because 00_sudo.service exists in the base
# recipe but is not wired into any target that gets scheduled.
# 00_drivers: removed — pcid-spawner is started by 00_pcid-spawner.service from
# the base recipe. The legacy script was redundant.
# 10_net: blanked — replaced by per-config network services (e.g. redbear-live-mini's
# 10_smolnetd.service + 10_dhcpd.service).
# 00_base.service: stripped base setup (tmpdir only, no sudo — sudo runs from
# base.toml's 00_sudo.service). ipcd and ptyd are started by
# 00_ipcd.service and 00_ptyd.service from the base recipe.
# 00_drivers / 10_net: no longer overridden — the legacy scripts were removed
# from base.toml. pcid-spawner is started by 00_pcid-spawner.service
# from the base recipe; smolnetd/dhcpd have their own .service files.
# 00_pcid-spawner.service: overridden to oneshot_async. The base recipe uses
# type="oneshot" which blocks init until pcid-spawner exits. On real
# hardware (and QEMU), pcid-spawner can hang waiting for a PCI device
@@ -18,21 +14,17 @@
# services while drivers spawn in the background.
[[files]]
path = "/usr/lib/init.d/00_base"
path = "/usr/lib/init.d/00_base.service"
data = """
# clear and recreate tmpdir with 0o1777 permission
rm -rf /tmp
mkdir -m a=rwxt /tmp
[unit]
description = "Base environment setup (tmpdir)"
[service]
cmd = "ion"
args = ["-c", "rm -rf /tmp; mkdir -m a=rwxt /tmp"]
type = "oneshot"
"""
[[files]]
path = "/usr/lib/init.d/00_drivers"
data = ""
[[files]]
path = "/usr/lib/init.d/10_net"
data = ""
[[files]]
path = "/etc/init.d/20_audiod.service"
data = """
+12 -3
View File
@@ -1,9 +1,18 @@
# Red Bear OS overrides for broken legacy desktop init scripts.
# Red Bear OS overrides for legacy desktop init services.
# Blank the display and console services inherited from desktop-minimal.toml.
[[files]]
path = "/usr/lib/init.d/20_display"
path = "/usr/lib/init.d/20_display.service"
data = ""
[[files]]
path = "/usr/lib/init.d/30_console"
path = "/usr/lib/init.d/29_activate_console.service"
data = ""
[[files]]
path = "/usr/lib/init.d/30_console.service"
data = ""
[[files]]
path = "/usr/lib/init.d/31_debug_console.service"
data = ""
+10 -5
View File
@@ -9,10 +9,15 @@ orbital = {}
# Override to run inside of orbital
[[files]]
path = "/usr/lib/init.d/30_redoxer"
path = "/usr/lib/init.d/30_redoxer.service"
data = """
requires_weak 10_net
echo
echo "## running redoxer in orbital ##"
nowait VT=3 orbital redoxerd
[unit]
description = "Redoxer GUI test (orbital)"
requires_weak = ["10_dhcpd.service"]
[service]
cmd = "orbital"
args = ["redoxerd"]
envs = { VT = "3" }
type = "oneshot_async"
"""
+30 -8
View File
@@ -15,20 +15,42 @@ pkgutils = {}
relibc = {}
sed = {}
# Override to not background dhcpd
# Override network services for redoxer (foreground dhcpd)
[[files]]
path = "/usr/lib/init.d/10_net"
path = "/usr/lib/init.d/10_smolnetd.service"
data = """
requires_weak 00_drivers
notify smolnetd
dhcpd
[unit]
description = "Network stack for redoxer"
requires_weak = ["00_pcid-spawner.service"]
[service]
cmd = "netstack"
type = "oneshot_async"
"""
[[files]]
path = "/usr/lib/init.d/30_redoxer"
path = "/usr/lib/init.d/10_dhcpd.service"
data = """
requires_weak 10_net
ion /usr/lib/run_redoxer.ion
[unit]
description = "DHCP client (foreground) for redoxer"
requires_weak = ["10_smolnetd.service"]
[service]
cmd = "dhcpd"
type = "oneshot_async"
"""
[[files]]
path = "/usr/lib/init.d/30_redoxer.service"
data = """
[unit]
description = "Redoxer test runner"
requires_weak = ["10_dhcpd.service"]
[service]
cmd = "ion"
args = ["/usr/lib/run_redoxer.ion"]
type = "oneshot_async"
"""
[[files]]
+9 -3
View File
@@ -14,10 +14,16 @@ bottom = "ignore"
kibi = "ignore"
[[files]]
path = "/usr/lib/init.d/30_console"
path = "/usr/lib/init.d/30_console.service"
data = """
requires_weak 10_net
ion /usr/lib/sys_build.ion
[unit]
description = "System build test"
requires_weak = ["00_base.target"]
[service]
cmd = "ion"
args = ["/usr/lib/sys_build.ion"]
type = "oneshot"
"""
[[files]]
+54 -14
View File
@@ -27,10 +27,16 @@ x11-full = {}
zenity = {}
[[files]]
path = "/usr/lib/init.d/10_dbus"
path = "/usr/lib/init.d/10_dbus.service"
data = """
requires_weak 10_net
bash /usr/bin/start-dbus.sh
[unit]
description = "D-Bus system bus (X11)"
requires_weak = ["00_base.target"]
[service]
cmd = "bash"
args = ["/usr/bin/start-dbus.sh"]
type = "oneshot_async"
"""
[[files]]
@@ -49,19 +55,31 @@ dbus-daemon --system
"""
[[files]]
path = "/usr/lib/init.d/10_xenv"
path = "/usr/lib/init.d/10_xenv.service"
data = """
requires_weak 10_net
glib-compile-schemas /usr/share/glib-2.0/schemas/
[unit]
description = "Compile glib schemas"
requires_weak = ["00_base.target"]
[service]
cmd = "glib-compile-schemas"
args = ["/usr/share/glib-2.0/schemas/"]
type = "oneshot"
"""
# Overridden to launch X instead of orblogin
[[files]]
path = "/usr/lib/init.d/20_orbital"
path = "/usr/lib/init.d/20_orbital.service"
data = """
requires_weak 10_dbus 10_xenv
notify audiod
nowait BROWSER=/bin/netsurf-fb VT=3 orbital orbital-x11
[unit]
description = "Orbital display (X11)"
requires_weak = ["10_dbus.service", "10_xenv.service"]
[service]
cmd = "orbital"
args = ["orbital-x11"]
envs = { BROWSER = "/bin/netsurf-fb", VT = "3" }
type = "oneshot_async"
"""
[[files]]
@@ -131,11 +149,33 @@ mate-session&
# Override console config to set DISPLAY=:0
[[files]]
path = "/usr/lib/init.d/30_console"
path = "/usr/lib/init.d/30_console.service"
data = """
requires_weak 20_orbital
nowait DISPLAY=:0 getty 2
nowait DISPLAY=:0 getty /scheme/debug/no-preserve -J
[unit]
description = "Console terminals (X11)"
requires_weak = ["20_orbital.service"]
[service]
cmd = "getty"
args = ["2"]
envs = { DISPLAY = ":0" }
type = "oneshot_async"
respawn = true
"""
[[files]]
path = "/usr/lib/init.d/31_debug_console.service"
data = """
[unit]
description = "Debug console (X11)"
requires_weak = ["30_console.service"]
[service]
cmd = "getty"
args = ["/scheme/debug/no-preserve", "-J"]
envs = { DISPLAY = ":0" }
type = "oneshot_async"
respawn = true
"""
+34 -8
View File
@@ -15,20 +15,46 @@ include = ["../desktop.toml"]
# Override orbital init to use contain_orblogin
[[files]]
path = "/usr/lib/init.d/20_orbital"
path = "/usr/lib/init.d/20_orbital.service"
data = """
requires_weak 10_net
notify audiod
nowait VT=3 orbital contain_orblogin launcher
[unit]
description = "Orbital display (contain sandbox)"
requires_weak = ["00_base.target"]
[service]
cmd = "orbital"
args = ["contain_orblogin", "launcher"]
envs = { VT = "3" }
type = "oneshot_async"
"""
# Override console init to use contain
[[files]]
path = "/usr/lib/init.d/30_console"
path = "/usr/lib/init.d/30_console.service"
data = """
requires_weak 20_orbital
nowait getty --contain 2
nowait getty --contain /scheme/debug/no-preserve -J
[unit]
description = "Console terminals (contained)"
requires_weak = ["20_orbital.service"]
[service]
cmd = "getty"
args = ["--contain", "2"]
type = "oneshot_async"
respawn = true
"""
[[files]]
path = "/usr/lib/init.d/31_debug_console.service"
data = """
[unit]
description = "Debug console (contained)"
requires_weak = ["30_console.service"]
[service]
cmd = "getty"
args = ["--contain", "/scheme/debug/no-preserve", "-J"]
type = "oneshot_async"
respawn = true
"""
[[files]]
+19 -7
View File
@@ -36,18 +36,30 @@ website = {}
[[files]]
path = "/usr/lib/init.d/98_keygen_sh"
path = "/usr/lib/init.d/98_keygen_sh.service"
data = """
requires_weak 10_net
bash /root/keygen.sh
[unit]
description = "SSH key generation"
requires_weak = ["00_base.target"]
[service]
cmd = "bash"
args = ["/root/keygen.sh"]
type = "oneshot"
"""
[[files]]
path = "/usr/lib/init.d/99_rustysd"
path = "/usr/lib/init.d/99_rustysd.service"
data = """
requires_weak 98_keygen_sh
# Undocumented usage of rsdctl, pointing to notifications dir
RSDCTL_ADDR=/var/run/rustysd/control.socket rustysd --conf /etc/rustysd
[unit]
description = "Rustysd service manager"
requires_weak = ["98_keygen_sh.service"]
[service]
cmd = "rustysd"
args = ["--conf", "/etc/rustysd"]
envs = { RSDCTL_ADDR = "/var/run/rustysd/control.socket" }
type = "oneshot_async"
"""
[[files]]