carbon-config

config submodule of carbon-core-system
git clone https://ccx.te2000.cz/git/carbon-config
Log | Files | Refs

commit a775d2ef08f295a10cac91efae73b5d3e2d7cd59
parent 8a8f374a8c355c8bc9dd36e62123f05a7e778d7c
Author: Jan Pobříslo <ccx@te2000.cz>
Date:   Tue,  1 Nov 2022 22:35:57 +0100

Function to declare bundles

Diffstat:
Mrc-common.aat | 11+++++++++++
Ms6-rc.aat | 13++++---------
2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/rc-common.aat b/rc-common.aat @@ -61,6 +61,17 @@ m755 | bundle_names[++bundle_count] = bundle_name | } |} +|function declare_bundle(bundle_name, svc_names, svc_array, svc_count, n) { +| if(length(svc_names)) { +| svc_count = split(svc_names, svc_array, "[ \t\n]+") +| for(n=1; n<=svc_count; n++) { +| add_to_bundle(bundle_name, svc_array[n]) +| } +| } else if(!(bundle_name in bundles)) { +| bundles[bundle_name] = "" +| bundle_names[++bundle_count] = bundle_name +| } +|} |function print_bundles( n, command) { | if(length(sort_tmpfile) && bundle_count) { | command = "sort >" sort_tmpfile diff --git a/s6-rc.aat b/s6-rc.aat @@ -4,20 +4,15 @@ |END{ / d m755 -|add_to_bundle("ok-all", "ok-all-but-tty") -|add_to_bundle("ok-all", "gettys") -|#add_to_bundle("ok-all-but-tty", "mount-tmp-X11") +|declare_bundle("ok-all", "ok-all-but-tty gettys") -|add_to_bundle("ok-all-but-tty", "net-all") +|declare_bundle("ok-sysinit", "mount-sysinit dev-coldplug") -|add_to_bundle("ok-sysinit", "mount-sysinit") -|add_to_bundle("ok-sysinit", "dev-coldplug") +|declare_bundle("ok-mount", "ok-sysinit ok-localmount") -|add_to_bundle("ok-all-but-tty", "ok-mount") +|declare_bundle("ok-all-but-tty", "net-all ok-mount") -|add_to_bundle("ok-mount", "ok-sysinit") -|add_to_bundle("ok-mount", "ok-localmount") |### Networking ### |start_oneshot("loopback")