If not standard finit.conf, then we want to show just the base name.
E.g., loading first /etc/finit.conf then /etc/finit.d/services.conf
Loading configuration ............. vs
Loading services configuration ....
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Try to do better by the user, by default, if no tty is specified in the
finit.conf. This way the user will at least have a way to interact with
the system and repair it.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
- Simplify: reduce indentation depth
- Always check for error condition first, cleaner code
- Make sure buffer is always freed, use same exit everyhere
- Use readable, but still short, local variable names
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
The cppcheck tool raised an alert to the missing close() for
stdin when a console is opened for a getty. This patch fixes
that warning and also makes the code slighlty more readable.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
- Add support for symlinks to copyfile()
- Fix memory leak in copy_filep()
- New function, fsendfile(), copy data between FILE streams
Also, minor whitespace and coding style cleanup.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Revert crazy BANNER macro idea from 5ba7bc1. It is simply too difficult to
set -DBANNER='"Some distributions specific text"' in a parent Makefile
without entering Shell/Make escape hell ... instead, downstream will
have to patch the banner() function.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
On some platforms GCC does not zero the heap. This can lead to
serious problems, e.g., tty->pid may be non-zero while never
having been started.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Standard init implementations save current and previous runlevels
in utmp, now finit does too. Also, the initial runlevel at boot
has changed from 10 to the more obvious 0.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Add support for runlevels to tty command and support for reading baud
rate and TERM variable from finit.conf.
The tty-watcher thread has been converted to a standard I/O plugin.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Most systems need an early bootstrap phase for one-shot tasks and
necessary one-time probing. This phase usually runs well before any
networking is setup. This commit adds support for that 'S' runlevel,
and also extends the number of possible total runlevels to nine.
For the one-shot tasks that run in bootstrap two new finit.conf cmds
have been added:
- task: For one-shot tasks that can be started in parallell
- run: For one-shot tasks that must run in sequence
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is a refactor of how arguments to finit.conf file settings
are parsed. Not all settings are run directly, but only need the arg
for future use. The code should be a lot easier to understand now.
Also, added support for specifying the desired runlevel in finit.conf
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>