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