Fix #235: support for overriding /etc/finit.conf and /etc/finit.d

This change adds support for a new command line option finit.config=PATH
which can be used to tell Finit to start with /etc/factory.conf instead
of /etc/finit.conf.

For the complete experience a new top-level configuration file directive
`rcsd PATH` has aslo been added.  It in turn can be used by factory.conf
as follows to override /etc/finit.d:

    rcsd /etc/factory.d

Manually verified in myLinux

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2022-11-10 17:21:33 +01:00
1 parent f6b5b0260b
commit 2f91ab5eac
11 files changed
+212 -48

No files matched your search

+6 -3
View File
@@ -69,11 +69,12 @@ int rescue = 0; /* rescue mode from kernel cmdline */
int single = 0; /* single user mode from kernel cmdline */
int bootstrap = 1; /* set while bootrapping (for TTYs) */
int kerndebug = 0; /* set if /proc/sys/kernel/printk > 7 */
char *fstab = FINIT_FSTAB;
char *finit_conf= NULL;
char *finit_rcsd= NULL;
char *fstab = NULL;
char *sdown = NULL;
char *network = NULL;
char *hostname = NULL;
char *rcsd = FINIT_RCSD;
char *runparts = NULL;
char *osheading = NULL;
@@ -808,9 +809,11 @@ int main(int argc, char *argv[])
cond_set_oneshot(plugin_hook_str(HOOK_ROOTFS_UP));
/*
* Initialize .conf system and load static /etc/finit.conf.
* Initialize .conf system and load static /etc/finit.conf then
* tell the world what we used.
*/
conf_init(&loop);
conf_saverc();
/*
* Start built-in watchdogd as soon as possible, if enabled