Refactor Red Bear profiles to use shared config fragments

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-04-14 11:43:37 +01:00
parent a5f8693fd8
commit 3a0349f0d9
4 changed files with 4 additions and 371 deletions
+1 -50
View File
@@ -4,7 +4,7 @@
# Build: make all CONFIG_NAME=redbear-desktop # Build: make all CONFIG_NAME=redbear-desktop
# Live: make live CONFIG_NAME=redbear-desktop # Live: make live CONFIG_NAME=redbear-desktop
include = ["desktop.toml"] include = ["desktop.toml", "redbear-netctl.toml"]
[general] [general]
filesystem_size = 10240 filesystem_size = 10240
@@ -24,52 +24,3 @@ mc = {}
# Package builder (cub -S/-B/-G CLI) # Package builder (cub -S/-B/-G CLI)
cub = {} cub = {}
[[files]]
path = "/etc/netctl"
data = ""
directory = true
mode = 0o755
[[files]]
path = "/etc/netctl/examples"
data = ""
directory = true
mode = 0o755
[[files]]
path = "/etc/netctl/examples/wired-dhcp"
data = """
Description='Red Bear wired DHCP profile'
Interface=eth0
Connection=ethernet
IP=dhcp
"""
[[files]]
path = "/etc/netctl/examples/wired-static"
data = """
Description='Red Bear wired static profile'
Interface=eth0
Connection=ethernet
IP=static
Address=('192.168.1.10/24')
Gateway='192.168.1.1'
DNS=('1.1.1.1')
"""
[[files]]
path = "/usr/lib/init.d/12_netctl.service"
data = """
[unit]
description = "Network profile application"
requires_weak = [
"10_smolnetd.service",
"10_dhcpd.service",
]
[service]
cmd = "netctl"
args = ["--boot"]
type = "oneshot"
"""
+1 -142
View File
@@ -9,7 +9,7 @@
# libinput/libevdev: WIP meson builds, not yet validated. Re-enable when tested. # libinput/libevdev: WIP meson builds, not yet validated. Re-enable when tested.
# seatd: now builds; DRM lease/runtime validation is still open before enabling broadly. # seatd: now builds; DRM lease/runtime validation is still open before enabling broadly.
include = ["desktop.toml"] include = ["desktop.toml", "redbear-legacy-base.toml", "redbear-legacy-desktop.toml", "redbear-device-services.toml", "redbear-netctl.toml"]
[general] [general]
filesystem_size = 2048 filesystem_size = 2048
@@ -66,46 +66,6 @@ data = ""
directory = true directory = true
mode = 0o755 mode = 0o755
# ── Neutralize broken legacy scripts from upstream configs ─────────
#
# base.toml and desktop-minimal.toml ship legacy init scripts that use
# "notify <service>" — but "notify" is NOT a keyword in the legacy script
# parser (only "requires_weak" and "nowait" exist). This causes init to
# try executing a binary called "notify" which doesn't exist.
#
# The base source package already ships proper .service/.target files in
# its init.d/ directory. These get installed to /usr/lib/init.d/ during
# the build. We just need to neutralize the conflicting legacy scripts
# so only the proper .service/.target files remain active.
#
# Override each broken legacy script with an empty file. Init will still
# find the .target and .service files from the base package.
# base.toml: "notify ipcd", "notify ptyd", "nowait sudo --daemon"
# → Replaced by 00_base.target → 00_ipcd.service + 00_ptyd.service + 00_sudo.service
[[files]]
path = "/usr/lib/init.d/00_base"
data = ""
# base.toml: "pcid-spawner" (blocking, no keyword)
# → Replaced by 00_pcid-spawner.service (oneshot)
[[files]]
path = "/usr/lib/init.d/00_drivers"
data = ""
# base.toml: "notify smolnetd", "nowait dhcpd"
# → Replaced by 10_net.target → 10_smolnetd.service + 10_dhcpd.service
[[files]]
path = "/usr/lib/init.d/10_net"
data = ""
# desktop-minimal.toml: "notify audiod", "nowait orbital orblogin launcher"
# → audiod: 20_audiod.service (from base package, type=scheme)
# → orbital: needs its own .service file since base doesn't ship one
[[files]]
path = "/usr/lib/init.d/20_orbital"
data = ""
# ── Desktop services (not provided by base package) ──────────────── # ── Desktop services (not provided by base package) ────────────────
# Orbital display server + login + launcher # Orbital display server + login + launcher
@@ -126,109 +86,8 @@ envs = { VT = "3" }
type = "oneshot_async" type = "oneshot_async"
""" """
# ── Red Bear OS custom service .service files ──────────────────────
# firmware-loader: scheme daemon serving /scheme/firmware
# Uses SchemeDaemon which requires init to read the pipe (ServiceType::Scheme).
[[files]]
path = "/usr/lib/init.d/05_firmware-loader.service"
data = """
[unit]
description = "Firmware loading scheme"
requires_weak = [
"00_pcid-spawner.service",
]
[service]
cmd = "firmware-loader"
type = { scheme = "firmware" }
"""
# udev-shim: scheme daemon serving /scheme/udev
[[files]]
path = "/usr/lib/init.d/11_udev.service"
data = """
[unit]
description = "udev compatibility shim"
requires_weak = [
"00_pcid-spawner.service",
]
[service]
cmd = "udev-shim"
type = { scheme = "udev" }
"""
# evdevd: self-registers scheme, no INIT_NOTIFY handshake needed
[[files]]
path = "/usr/lib/init.d/10_evdevd.service"
data = """
[unit]
description = "Evdev input daemon"
requires_weak = [
"00_pcid-spawner.service",
]
[service]
cmd = "evdevd"
type = "oneshot_async"
"""
[[files]]
path = "/etc/netctl"
data = ""
directory = true
mode = 0o755
[[files]]
path = "/etc/netctl/examples"
data = ""
directory = true
mode = 0o755
[[files]]
path = "/etc/netctl/examples/wired-dhcp"
data = """
Description='Red Bear wired DHCP profile'
Interface=eth0
Connection=ethernet
IP=dhcp
"""
[[files]]
path = "/etc/netctl/examples/wired-static"
data = """
Description='Red Bear wired static profile'
Interface=eth0
Connection=ethernet
IP=static
Address=('192.168.1.10/24')
Gateway='192.168.1.1'
DNS=('1.1.1.1')
"""
[[files]]
path = "/usr/lib/init.d/12_netctl.service"
data = """
[unit]
description = "Network profile application"
requires_weak = [
"10_smolnetd.service",
"10_dhcpd.service",
]
[service]
cmd = "netctl"
args = ["--boot"]
type = "oneshot"
"""
# desktop-minimal.toml: "inputd -A 2", "nowait getty 2", "nowait getty /scheme/debug/no-preserve -J" # desktop-minimal.toml: "inputd -A 2", "nowait getty 2", "nowait getty /scheme/debug/no-preserve -J"
# Neutralize and replace with proper service files # Neutralize and replace with proper service files
[[files]]
path = "/usr/lib/init.d/30_console"
data = ""
[[files]] [[files]]
path = "/usr/lib/init.d/30_console.service" path = "/usr/lib/init.d/30_console.service"
data = """ data = """
+1 -68
View File
@@ -5,7 +5,7 @@
# KDE Plasma 6 session with Wayland compositor # KDE Plasma 6 session with Wayland compositor
# Requires: D-Bus, libinput, Mesa, Qt6, KF6, KWin, plasma-workspace # Requires: D-Bus, libinput, Mesa, Qt6, KF6, KWin, plasma-workspace
include = ["desktop.toml"] include = ["desktop.toml", "redbear-legacy-base.toml", "redbear-legacy-desktop.toml", "redbear-device-services.toml", "redbear-netctl.toml"]
[general] [general]
filesystem_size = 4096 filesystem_size = 4096
@@ -107,74 +107,7 @@ data = ""
directory = true directory = true
mode = 0o755 mode = 0o755
# ── Neutralize broken legacy scripts from upstream configs ─────────
# base.toml uses "notify <service>" which is not a keyword in the legacy
# script parser. Base source package ships proper .service/.target files.
[[files]]
path = "/usr/lib/init.d/00_base"
data = ""
[[files]]
path = "/usr/lib/init.d/00_drivers"
data = ""
[[files]]
path = "/usr/lib/init.d/10_net"
data = ""
[[files]]
path = "/usr/lib/init.d/20_orbital"
data = ""
[[files]]
path = "/usr/lib/init.d/30_console"
data = ""
# ── Red Bear OS custom services ───────────────────────────────────── # ── Red Bear OS custom services ─────────────────────────────────────
[[files]]
path = "/usr/lib/init.d/05_firmware-loader.service"
data = """
[unit]
description = "Firmware loading scheme"
requires_weak = [
"00_pcid-spawner.service",
]
[service]
cmd = "firmware-loader"
type = { scheme = "firmware" }
"""
[[files]]
path = "/usr/lib/init.d/10_evdevd.service"
data = """
[unit]
description = "Evdev input daemon"
requires_weak = [
"00_pcid-spawner.service",
]
[service]
cmd = "evdevd"
type = "oneshot_async"
"""
[[files]]
path = "/usr/lib/init.d/11_udev.service"
data = """
[unit]
description = "udev compatibility shim"
requires_weak = [
"00_pcid-spawner.service",
]
[service]
cmd = "udev-shim"
type = { scheme = "udev" }
"""
[[files]] [[files]]
path = "/usr/lib/init.d/12_dbus.service" path = "/usr/lib/init.d/12_dbus.service"
data = """ data = """
+1 -111
View File
@@ -3,7 +3,7 @@
# #
# Build: make all CONFIG_NAME=redbear-minimal # Build: make all CONFIG_NAME=redbear-minimal
include = ["minimal.toml"] include = ["minimal.toml", "redbear-legacy-base.toml", "redbear-device-services.toml", "redbear-netctl.toml"]
[general] [general]
filesystem_size = 512 filesystem_size = 512
@@ -24,23 +24,6 @@ mc = {}
# Diagnostic tool # Diagnostic tool
redbear-info = {} redbear-info = {}
# ── Neutralize broken legacy scripts from base.toml ─────────────────
# base.toml uses "notify <service>" which is not a keyword in the legacy
# script parser. Base source package already ships proper .service/.target
# files — we just need to suppress the conflicting legacy scripts.
[[files]]
path = "/usr/lib/init.d/00_base"
data = ""
[[files]]
path = "/usr/lib/init.d/00_drivers"
data = ""
[[files]]
path = "/usr/lib/init.d/10_net"
data = ""
# minimal.toml: "inputd -A 2", "nowait getty 2", "nowait getty /scheme/debug/no-preserve -J" # minimal.toml: "inputd -A 2", "nowait getty 2", "nowait getty /scheme/debug/no-preserve -J"
[[files]] [[files]]
path = "/usr/lib/init.d/30_console" path = "/usr/lib/init.d/30_console"
@@ -75,96 +58,3 @@ cmd = "getty"
args = ["/scheme/debug/no-preserve", "-J"] args = ["/scheme/debug/no-preserve", "-J"]
type = "oneshot_async" type = "oneshot_async"
""" """
# ── Red Bear OS custom services ─────────────────────────────────────
[[files]]
path = "/usr/lib/init.d/05_firmware-loader.service"
data = """
[unit]
description = "Firmware loading scheme"
requires_weak = [
"00_pcid-spawner.service",
]
[service]
cmd = "firmware-loader"
type = { scheme = "firmware" }
"""
[[files]]
path = "/usr/lib/init.d/11_udev.service"
data = """
[unit]
description = "udev compatibility shim"
requires_weak = [
"00_pcid-spawner.service",
]
[service]
cmd = "udev-shim"
type = { scheme = "udev" }
"""
[[files]]
path = "/usr/lib/init.d/10_evdevd.service"
data = """
[unit]
description = "Evdev input daemon"
requires_weak = [
"00_pcid-spawner.service",
]
[service]
cmd = "evdevd"
type = "oneshot_async"
"""
[[files]]
path = "/etc/netctl"
data = ""
directory = true
mode = 0o755
[[files]]
path = "/etc/netctl/examples"
data = ""
directory = true
mode = 0o755
[[files]]
path = "/etc/netctl/examples/wired-dhcp"
data = """
Description='Red Bear wired DHCP profile'
Interface=eth0
Connection=ethernet
IP=dhcp
"""
[[files]]
path = "/etc/netctl/examples/wired-static"
data = """
Description='Red Bear wired static profile'
Interface=eth0
Connection=ethernet
IP=static
Address=('192.168.1.10/24')
Gateway='192.168.1.1'
DNS=('1.1.1.1')
"""
[[files]]
path = "/usr/lib/init.d/12_netctl.service"
data = """
[unit]
description = "Network profile application"
requires_weak = [
"10_smolnetd.service",
"10_dhcpd.service",
]
[service]
cmd = "netctl"
args = ["--boot"]
type = "oneshot"
"""