Files
RedBear-OS/config/redbear-device-services.toml
vasilito 29ff1ea8fc feat: ACPI Wave 1 boot-critical hardening (P19) + robust patch generation
- P19-init-startup-hardening: Replace panic-grade expect/unwrap in init
  startup paths (getns, register_scheme_to_ns, setrens, filename parsing)
  with graceful error handling and logging
- P19-acpid-startup-hardening: Replace panic-grade calls in acpid with
  graceful degradation (rxsdt read failure → warn + exit 0, SDT parse →
  error + exit 1, I/O privilege → fatal, scheme registration → fatal,
  setrens → warn + continue, event loop errors → log + continue)
- P18-9-msi-allocation-resilience: Regenerate with git diff -U0 -w format
  for maximum context resilience
- fetch.rs: Change --fuzz=0 to --fuzz=3 for resilient patch application
- AGENTS.md: Document robust patch generation technique as mandatory
- Add P4/P5/P6/P7 patches (estale, dmi, i2c, ps2d hardening)
- Add P21 kernel x2apic SMP fix patch
- Multiple local recipe source improvements (redox-drm, driver-manager,
  driver-acpi, thermald)
- Config updates for redbear-mini and redbear-device-services
- Subsystem assessment document
2026-05-18 14:07:42 +03:00

497 lines
9.5 KiB
TOML

# Red Bear OS shared device-service wiring
#
# Shared by profiles that ship the firmware/input/Wi-Fi control compatibility stack.
#
# Driver matching: driver-manager reads /lib/drivers.d/*.toml and matches against
# devices from both PCI and ACPI buses. ACPI devices are classified with PCI-equivalent
# class/subclass/vendor codes by redox-driver-acpi's AcpiBus, allowing reuse of existing
# driver match rules.
[packages]
redbear-quirks = {}
pciids = {}
fatd = {}
driver-manager = {}
# Firmware fallback chain configs
[[files]]
path = "/etc/firmware-fallbacks.d/00-amdgpu.toml"
data = """
"amdgpu/dmcub_dcn31.bin" = ["amdgpu/dmcub_dcn30.bin", "amdgpu/dmcub_dcn20.bin"]
"amdgpu/dmcub_dcn30.bin" = ["amdgpu/dmcub_dcn20.bin"]
"""
[[files]]
path = "/etc/firmware-fallbacks.d/10-iwlwifi.toml"
data = """
"iwlwifi-bz-b0-gf-a0-92.ucode" = ["iwlwifi-bz-b0-gf-a0-83.ucode", "iwlwifi-bz-b0-gf-a0-77.ucode"]
"""
[[files]]
path = "/etc/firmware-fallbacks.d/20-intel-dmc.toml"
data = """
"i915/adlp_dmc_ver2_16.bin" = ["i915/adlp_dmc_ver2_14.bin", "i915/adlp_dmc_ver2_12.bin"]
"""
[[files]]
path = "/etc/init.d/12_boot-late.target"
data = """
[unit]
description = "Late boot services target (compat alias for 04_drivers.target)"
requires_weak = [
"04_drivers.target",
]
"""
[[files]]
path = "/lib/drivers.d"
data = ""
directory = true
mode = 0o755
[[files]]
path = "/lib/drivers.d/00-storage.toml"
data = """
[[driver]]
name = "nvmed"
description = "NVMe storage driver"
priority = 100
command = ["/usr/lib/drivers/nvmed"]
[[driver.match]]
bus = "pci"
class = 1
subclass = 8
[[driver]]
name = "ahcid"
description = "AHCI SATA driver"
priority = 100
command = ["/usr/lib/drivers/ahcid"]
[[driver.match]]
bus = "pci"
class = 1
subclass = 6
[[driver]]
name = "ided"
description = "PATA IDE driver"
priority = 100
command = ["/usr/lib/drivers/ided"]
[[driver.match]]
bus = "pci"
class = 1
subclass = 1
[[driver]]
name = "virtio-blkd"
description = "VirtIO block device driver"
priority = 100
command = ["/usr/lib/drivers/virtio-blkd"]
[[driver.match]]
bus = "pci"
vendor = 0x1AF4
device = 0x1001
class = 1
subclass = 0
"""
[[files]]
path = "/lib/drivers.d/10-network.toml"
data = """
[[driver]]
name = "e1000d"
description = "Intel Gigabit Ethernet"
priority = 50
command = ["/usr/lib/drivers/e1000d"]
[[driver.match]]
bus = "pci"
vendor = 0x8086
class = 2
[[driver]]
name = "rtl8168d"
description = "Realtek 8168/8125 Ethernet"
priority = 50
command = ["/usr/lib/drivers/rtl8168d"]
[[driver.match]]
bus = "pci"
vendor = 0x10EC
class = 2
[[driver]]
name = "rtl8139d"
description = "Realtek 8139 Ethernet"
priority = 50
command = ["/usr/lib/drivers/rtl8139d"]
[[driver.match]]
bus = "pci"
vendor = 0x10EC
device = 0x8139
[[driver]]
name = "ixgbed"
description = "Intel 10 Gigabit Ethernet"
priority = 50
command = ["/usr/lib/drivers/ixgbed"]
[[driver.match]]
bus = "pci"
vendor = 0x8086
class = 2
subclass = 0
[[driver]]
name = "virtio-netd"
description = "VirtIO network driver"
priority = 50
command = ["/usr/lib/drivers/virtio-netd"]
[[driver.match]]
bus = "pci"
vendor = 0x1AF4
class = 2
"""
[[files]]
path = "/lib/drivers.d/20-usb.toml"
data = """
[[driver]]
name = "xhcid"
description = "xHCI USB host controller"
priority = 80
command = ["/usr/lib/drivers/xhcid"]
[[driver.match]]
bus = "pci"
class = 0x0C
subclass = 0x03
prog_if = 0x30
[[driver]]
name = "ehcid"
description = "EHCI USB 2.0 host controller"
priority = 80
command = ["/usr/lib/drivers/ehcid"]
# EHCI now owns a simple /scheme/usb controller surface for per-port status and
# control-transfer pass-through while the wider USB stack continues converging.
[[driver.match]]
bus = "pci"
class = 0x0C
subclass = 0x03
prog_if = 0x20
[[driver]]
name = "ohcid"
description = "OHCI USB 1.1 host controller"
priority = 80
command = ["/usr/lib/drivers/ohcid"]
[[driver.match]]
bus = "pci"
class = 0x0C
subclass = 0x03
prog_if = 0x10
[[driver]]
name = "uhcid"
description = "UHCI USB 1.1 host controller (Intel)"
priority = 80
command = ["/usr/lib/drivers/uhcid"]
[[driver.match]]
bus = "pci"
class = 0x0C
subclass = 0x03
prog_if = 0x00
"""
[[files]]
path = "/lib/drivers.d/30-graphics.toml"
data = """
[[driver]]
name = "redox-drm"
description = "DRM/KMS display driver (AMD + Intel)"
priority = 60
command = ["/usr/bin/redox-drm"]
[[driver.match]]
bus = "pci"
class = 0x03
"""
[[files]]
path = "/lib/drivers.d/40-input.toml"
data = """
[[driver]]
name = "ps2d"
description = "PS/2 keyboard and mouse driver"
priority = 90
command = ["/usr/lib/drivers/ps2d"]
[[driver.match]]
vendor = 0xFFFF
device = 0xFFFF
"""
[[files]]
path = "/lib/drivers.d/50-audio.toml"
data = """
[[driver]]
name = "ihdad"
description = "Intel HD Audio driver"
priority = 40
command = ["/usr/lib/drivers/ihdad"]
[[driver.match]]
bus = "pci"
vendor = 0x8086
class = 0x04
[[driver]]
name = "ac97d"
description = "AC'97 audio codec driver"
priority = 40
command = ["/usr/lib/drivers/ac97d"]
[[driver.match]]
bus = "pci"
class = 0x04
subclass = 0x01
"""
[[files]]
path = "/etc/init.d/00_acpid.service"
data = """
[unit]
description = "ACPI daemon (provides scheme:acpi)"
default_dependencies = false
[service]
cmd = "acpid"
inherit_envs = ["RSDP_ADDR", "RSDP_SIZE"]
type = { scheme = "acpi" }
"""
# ACPI GPIO/I2C controller drivers
# These match against ACPI-enumerated devices (class/subclass/vendor from _HID).
[[files]]
path = "/lib/drivers.d/60-gpio-i2c.toml"
data = """
# I2C bus registry — infrastructure, no hardware match
[[driver]]
name = "i2cd"
description = "I2C host adapter registry"
priority = 85
command = ["/usr/lib/drivers/i2cd"]
# GPIO pin registry — infrastructure, no hardware match
[[driver]]
name = "gpiod"
description = "GPIO controller registry"
priority = 85
command = ["/usr/lib/drivers/gpiod"]
# Intel ACPI I2C controller (DesignWare)
# Matches: INT33C3, INT3433, INT3442, INT3446, INT3447, INT3455, INT34B9
[[driver]]
name = "dw-acpi-i2cd"
description = "DesignWare ACPI I2C controller"
priority = 80
command = ["/usr/lib/drivers/dw-acpi-i2cd"]
depends_on = ["acpi", "i2c"]
[[driver.match]]
bus = "acpi"
class = 0x0C
subclass = 0x05
vendor = 0x8086
# AMD MP2 I2C controller
# Matches: AMDI0010, AMDI0510, AMDI0019
[[driver]]
name = "amd-mp2-i2cd"
description = "AMD MP2 I2C controller"
priority = 80
command = ["/usr/lib/drivers/amd-mp2-i2cd"]
depends_on = ["acpi", "i2c"]
[[driver.match]]
bus = "acpi"
class = 0x0C
subclass = 0x05
vendor = 0x1022
# Intel ACPI GPIO controller
# Matches: INT33C7, INT3437, INT3450, INT345D, INT34BB
[[driver]]
name = "intel-gpiod"
description = "Intel ACPI GPIO registrar"
priority = 80
command = ["/usr/lib/drivers/intel-gpiod"]
depends_on = ["acpi", "gpio"]
[[driver.match]]
bus = "acpi"
class = 0x0C
subclass = 0x80
vendor = 0x8086
"""
[[files]]
path = "/lib/drivers.d/70-usb-class.toml"
data = """
[[driver]]
name = "redbear-acmd"
description = "USB CDC ACM serial driver"
priority = 70
command = ["/usr/bin/redbear-acmd"]
[[driver.match]]
vendor = 0xFFFF
device = 0xFFFF
[[driver]]
name = "redbear-ecmd"
description = "USB CDC ECM/NCM ethernet driver"
priority = 70
command = ["/usr/bin/redbear-ecmd"]
[[driver.match]]
vendor = 0xFFFF
device = 0xFFFF
[[driver]]
name = "redbear-usbaudiod"
description = "USB Audio Class driver"
priority = 70
command = ["/usr/bin/redbear-usbaudiod"]
[[driver.match]]
vendor = 0xFFFF
device = 0xFFFF
"""
# Profiles that include this fragment should start `driver-manager` instead of
# `pcid-spawner`; the manager performs the PCI bind/channel handoff itself.
[[files]]
path = "/etc/init.d/00_driver-manager.service"
data = """
[unit]
description = "Red Bear driver manager"
requires_weak = [
"02_early_hw.target",
]
[service]
cmd = "/usr/bin/driver-manager"
args = ["--hotplug"]
type = "oneshot_async"
"""
# Override the base package's 30_thermald.service with a no-op since
# 15_thermald.service (above) replaces it with earlier start ordering.
[[files]]
path = "/etc/init.d/30_thermald.service"
data = """
[unit]
description = "Thermal management daemon (suppressed; use 15_thermald.service)"
[service]
cmd = "echo"
args = ["thermald: started earlier as 15_thermald.service"]
type = "oneshot"
"""
[[files]]
path = "/etc/init.d/15_cpufreqd.service"
data = """
[unit]
description = "CPU frequency scaling daemon"
requires_weak = ["04_drivers.target"]
[service]
cmd = "/usr/bin/cpufreqd"
type = "oneshot_async"
"""
[[files]]
path = "/etc/init.d/15_thermald.service"
data = """
[unit]
description = "Thermal management daemon"
requires_weak = ["04_drivers.target"]
[service]
cmd = "/usr/bin/thermald"
type = "oneshot_async"
"""
[[files]]
path = "/etc/init.d/15_hwrngd.service"
data = """
[unit]
description = "Hardware RNG entropy daemon"
requires_weak = ["00_base.target"]
[service]
cmd = "/usr/bin/hwrngd"
type = "oneshot_async"
"""
[[files]]
path = "/etc/init.d/13_driver-params.service"
data = """
[unit]
description = "Driver parameter scheme"
requires_weak = ["00_driver-manager.service"]
[service]
cmd = "/usr/bin/driver-params"
type = { scheme = "driver-params" }
"""
[[files]]
path = "/etc/init.d/16_redbear-acmd.service"
data = """
[unit]
description = "USB CDC ACM serial daemon"
requires_weak = ["04_drivers.target"]
[service]
cmd = "/usr/bin/redbear-acmd"
type = "oneshot_async"
"""
[[files]]
path = "/etc/init.d/16_redbear-ecmd.service"
data = """
[unit]
description = "USB CDC ECM/NCM ethernet daemon"
requires_weak = ["04_drivers.target"]
[service]
cmd = "/usr/bin/redbear-ecmd"
type = "oneshot_async"
"""
[[files]]
path = "/etc/init.d/16_redbear-usbaudiod.service"
data = """
[unit]
description = "USB Audio Class daemon"
requires_weak = ["04_drivers.target"]
[service]
cmd = "/usr/bin/redbear-usbaudiod"
type = "oneshot_async"
"""