mirror of
https://github.com/troglobit/finit.git
synced 2026-10-16 10:39:35 +00:00
Add basic support to specify login TTYs in configuration
This also adds support for monitor /dev for TTYs appering after boot, USB-to-serial converters for example. Some limitations: Baudrate (and other settings) is hardcoded for now, should be read from config file.
This commit is contained in:
1 parent
a18c5f3441
commit
5961748b2a
7 files changed
+200
-57
No files matched your search
@@ -31,7 +31,6 @@
|
||||
#define MATCH_CMD(l, c, x) \
|
||||
(!strncmp(l, c, strlen(c)) && (x = (l) + strlen(c)))
|
||||
|
||||
|
||||
static char *build_cmd(char *cmd, char *line, int len)
|
||||
{
|
||||
int l;
|
||||
@@ -135,6 +134,20 @@ void parse_finit_conf(char *file)
|
||||
svc_register(x, NULL);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (MATCH_CMD(line, "console ", x)) {
|
||||
if (console) free(console);
|
||||
console = build_cmd(NULL, x, CMD_SIZE);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (MATCH_CMD(line, "tty ", x)) {
|
||||
char *tty = build_cmd(NULL, x, CMD_SIZE);
|
||||
int baud = 115200; /* TODO: Read from config file. */
|
||||
|
||||
tty_add(tty, baud);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user