Relocate global configuration variables from finit.c -> conf.c

These variables really belong in conf.c.  Relocate and move external
decls. from finit.h -> conf.h to simplify linking of other programs.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2025-07-06 03:14:03 +02:00
1 parent d37d241647
commit 3df3c51dae
12 files changed
+47 -39

No files matched your search

+19
View File
@@ -50,6 +50,25 @@
#define BOOTSTRAP (runlevel == INIT_LEVEL)
int runlevel = INIT_LEVEL; /* Bootstrap 'S' */
int cfglevel = RUNLEVEL; /* Fallback if no configured runlevel */
int cmdlevel = 0; /* runlevel override from cmdline */
int prevlevel = -1;
int debug = 0; /* debug mode from kernel cmdline */
int rescue = 0; /* rescue mode from kernel cmdline */
int single = 0; /* single user mode from kernel cmdline */
int bootstrap = 1; /* set while bootstrapping (for TTYs) */
int kerndebug = 0; /* set if /proc/sys/kernel/printk > 7 */
int syncsec = 0; /* reboot delay */
int readiness = SVC_NOTIFY_PID;
char *finit_conf= NULL;
char *finit_rcsd= NULL;
char *fstab = NULL;
char *sdown = NULL;
char *network = NULL;
char *hostname = NULL;
char *osheading = NULL;
int logfile_size_max = 200000; /* 200 kB */
int logfile_count_max = 5;
+18
View File
@@ -27,6 +27,24 @@
#include "cgroup.h"
#include "svc.h"
extern int runlevel;
extern int cfglevel;
extern int cmdlevel;
extern int prevlevel;
extern int debug;
extern int rescue;
extern int single;
extern int bootstrap;
extern int kerndebug;
extern int syncsec;
extern int readiness;
extern char *fstab;
extern char *sdown;
extern char *network;
extern char *hostname;
extern char *runparts;
extern char *osheading;
extern int logfile_size_max;
extern int logfile_count_max;
-19
View File
@@ -59,25 +59,6 @@
#include "util.h"
#include "utmp-api.h"
int runlevel = INIT_LEVEL; /* Bootstrap 'S' */
int cfglevel = RUNLEVEL; /* Fallback if no configured runlevel */
int cmdlevel = 0; /* runlevel override from cmdline */
int prevlevel = -1;
int debug = 0; /* debug mode from kernel cmdline */
int rescue = 0; /* rescue mode from kernel cmdline */
int single = 0; /* single user mode from kernel cmdline */
int bootstrap = 1; /* set while bootstrapping (for TTYs) */
int kerndebug = 0; /* set if /proc/sys/kernel/printk > 7 */
int syncsec = 0; /* reboot delay */
int readiness = SVC_NOTIFY_PID;
char *finit_conf= NULL;
char *finit_rcsd= NULL;
char *fstab = NULL;
char *sdown = NULL;
char *network = NULL;
char *hostname = NULL;
char *osheading = NULL;
uev_ctx_t *ctx = NULL; /* Main loop context */
svc_t *wdog = NULL; /* No watchdog by default */
-19
View File
@@ -116,25 +116,6 @@ struct init_request {
char data[368];
};
extern int runlevel;
extern int cfglevel;
extern int cmdlevel;
extern int prevlevel;
extern int debug;
extern int rescue;
extern int single;
extern int bootstrap;
extern int kerndebug;
extern int syncsec;
extern int readiness;
extern char *fstab;
extern char *sdown;
extern char *network;
extern char *hostname;
extern char *runparts;
extern char *osheading;
extern uev_ctx_t *ctx;
#endif /* FINIT_H_ */
/**
+1
View File
@@ -40,6 +40,7 @@
#include "finit.h"
#include "helpers.h"
#include "conf.h"
#include "log.h"
#include "private.h"
#include "sig.h"
+2
View File
@@ -41,6 +41,8 @@ extern int service_interval;
extern char *fsck_mode;
extern char *fsck_repair;
extern uev_ctx_t *ctx;
int api_init (uev_ctx_t *ctx);
int api_exit (void);
void conf_flush_events(void);
+1 -1
View File
@@ -22,7 +22,7 @@
*/
#include "config.h"
#include "finit.h"
#include "private.h"
#include "log.h"
#include "schedule.h"
+1
View File
@@ -37,6 +37,7 @@
#endif
#include "finit.h"
#include "conf.h"
#include "svc.h"
#include "helpers.h"
#include "pid.h"