- real dinit service files (connmand, sddm, ntpd, chrony, sshd) - void backend properly swaps runit for dinit with service definitions - ISO generation finds kernel/initrd, builds proper GRUB config - ship all package manager binaries in ISO for offline use - LICENSES/ directory with proper GPL-2.0 plain text for xbps, pacman, apt, dnf, apk, dpkg - backends explicitly install their own package managers - README updated with binary inclusion and license info
96 lines
2.0 KiB
Python
96 lines
2.0 KiB
Python
"""Dinit service definitions — real service files, not symlinks."""
|
|
|
|
SERVICES = {
|
|
"connmand": {
|
|
"connmand": """\
|
|
description = "ConnMan Network Manager Daemon"
|
|
requires = network-setup.service
|
|
accept-notify = false
|
|
|
|
service openrc-style {
|
|
pid-file = /run/connman/connmand.pid
|
|
reader = syslog
|
|
|
|
command = /usr/sbin/connmand -n
|
|
|
|
env_file = /etc/conf.d/connmand
|
|
}
|
|
""",
|
|
},
|
|
"sddm": {
|
|
"sddm": """\
|
|
description = "SDDM Display Manager"
|
|
requires = background-setup.service
|
|
accept-notify = false
|
|
|
|
service openrc-style {
|
|
pid-file = /run/sddm/pid
|
|
reader = syslog
|
|
|
|
command = /usr/bin/sddm
|
|
}
|
|
""",
|
|
},
|
|
"ntpd": {
|
|
"ntpd": """\
|
|
description = "NTP Daemon"
|
|
accept-notify = false
|
|
|
|
service openrc-style {
|
|
pid-file = /run/ntpd.pid
|
|
reader = syslog
|
|
|
|
command = /usr/sbin/ntpd -g
|
|
}
|
|
""",
|
|
},
|
|
"chrony": {
|
|
"chrony": """\
|
|
description = "Chrony NTP Daemon"
|
|
accept-notify = false
|
|
|
|
service openrc-style {
|
|
pid-file = /run/chrony/chronyd.pid
|
|
reader = syslog
|
|
|
|
command = /usr/sbin/chronyd -d
|
|
env_file = /etc/conf.d/chronyd
|
|
}
|
|
""",
|
|
},
|
|
"sshd": {
|
|
"sshd": """\
|
|
description = "OpenSSH Server"
|
|
accept-notify = false
|
|
|
|
service openrc-style {
|
|
pid-file = /run/sshd.pid
|
|
reader = syslog
|
|
|
|
command = /usr/sbin/sshd -D
|
|
}
|
|
""",
|
|
},
|
|
}
|
|
|
|
|
|
def install_service(rootfs, name: str) -> None:
|
|
"""Install a dinit service file into the rootfs."""
|
|
if name not in SERVICES:
|
|
raise ValueError(f"Unknown dinit service: {name}")
|
|
|
|
services = SERVICES[name]
|
|
for svc_name, content in services.items():
|
|
svc_dir = rootfs / f"/etc/dinit.d/{svc_name}"
|
|
svc_dir.mkdir(parents=True, exist_ok=True)
|
|
(svc_dir / "run").write_text(content)
|
|
|
|
|
|
def install_all(rootfs, services: list[str]) -> None:
|
|
"""Install all requested dinit services."""
|
|
for svc in services:
|
|
try:
|
|
install_service(rootfs, svc)
|
|
except ValueError as e:
|
|
print(f" \033[33m⚠ {e}\033[0m")
|