Commit Graph
882 Commits
Author SHA1 Message Date
Joachim Nilsson 2c29893558 Prune old (and now irrelevant) TODO items
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-31 10:16:52 +02:00
Joachim Nilsson a1a7f69349 Update info on getty, no /bin/login included
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-30 16:06:35 +02:00
Joachim Nilsson 8d9fbea551 Micro adjustment
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-30 16:03:32 +02:00
Joachim Nilsson 1d89e1a706 Advertise for new logo ...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-30 16:02:51 +02:00
Joachim Nilsson 596b7cc413 README: Mention built-in getty
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-30 16:00:31 +02:00
Joachim Nilsson fbed5cd8cb TODO: Timed shutdown/reboot incl. cancellation
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-30 15:55:59 +02:00
Joachim Nilsson 0cb1ce2483 Disable clear screen in getty
Disabled until we decide on config to disable/enable.  It is quite
annoying to not be able to see the boot messages with it on ...

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-30 15:54:37 +02:00
Joachim Nilsson e23b62ffb7 Plugin loader fixes for dep handling and unload
- Plugins without declared name registered with full path + ext
  => Strip path and extension
- Plugins registered with __NAME__ => strip extension
- Do *not* call dlclose() from destructor, must be called by Finit

Also, some minor cleanup and code simplifcation.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-30 15:54:37 +02:00
Joachim Nilsson 94d41e38f8 Close inotify watcher when TTY plugin is unloaded
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-30 15:54:37 +02:00
Joachim Nilsson 42800a1cc8 ALSA plugin: only run if /usr/sbin/alsactl exists
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-30 15:54:37 +02:00
Joachim Nilsson 4cf60b7491 initctl: Add SysV compat support for setenv
- Fix compat INIT_CMD_ defines so Finit clients can talk to SysV init
- Add setenv support, only for INIT_HALT={POWERDOWN,HALT} to runlevel 6

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-30 15:54:37 +02:00
Joachim Nilsson 72a9832662 Remove developer debug of reboot/umount sequence
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-30 15:54:37 +02:00
Joachim Nilsson eeb59eb22b Adopt BusyBox init signal handling for halt/reboot/poweroff
This patch adopts the BusyBox init signals for handling halt, reboot,
and poweroff.  The SIGINT and SIGPWR signals still behave the same as
before, even though they likely will become configurable in a future
release.

Note: the disabling of Ctrl-Alt-Delete (SIGINT) is also removed!

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-29 16:47:38 +02:00
Joachim Nilsson 0df0f019e3 Alpine Linux finit.conf updates
First lessons from Debian, more to come ...

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-29 01:08:48 +02:00
Joachim Nilsson bc7f6f1bc1 Debian HowTo: Minor fixup
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-29 00:22:32 +02:00
Joachim Nilsson 73b807a007 Debian HowTo: Minor reformatting
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-29 00:20:46 +02:00
Joachim Nilsson 62113a0057 New mini HowTo: Finit on Debian Jessie
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-29 00:13:03 +02:00
Joachim Nilsson 968f1bf991 The science of unmounting file systems on Debian
That's maybe a bit unfair.  This patch implements a brief version of
what is really needed to safely unmount all file systems on a modern
Linux distribution.  Yes, it's this insane.  (Who am I kidding, it's
worse!  Just have a look at the ancient scrolls hidden in your /etc!)

Here is where we use the new plugin_exit() and api_exit() API's from an
earlier patch.  Making sure to exit and close any kernel descriptors.
Then follows a bizarre spell cast on leaking descriptors, rebooting in
a child, remounting / as read-only, and a whole slew of other R rated
stuff to prevent mount/umount from returning 32 ...

Stay safe people, use protection always!

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-28 23:48:39 +02:00
Joachim Nilsson 57514130fc Starting service as @user chdir() to their $HOME
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-28 23:48:39 +02:00
Joachim Nilsson 0710fdd2a3 Plugin and API init/exit for conformance
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-28 23:48:39 +02:00
Joachim Nilsson 08e46782e5 Print banner earlier
Thanks to udev we need to do a lot more stuff even earlier these days.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-28 23:48:39 +02:00
Joachim Nilsson b96d8d3055 Handle tabs in finit.conf better
Should probably be extended to handle any non-space blank character.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-28 23:48:38 +02:00
Joachim Nilsson 4ede2a93b2 Change initctl FIFO from /dev/ to /var/run/
FIFOs, PID files, and other non-devices belong in /var/run (or /run
these days), not /dev -- as per FHS.  Compat with Debian SysV init.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-28 23:48:38 +02:00
Joachim Nilsson dd2eb9ce04 Initial contrib/debian support for Jessie
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-28 23:48:38 +02:00
Joachim Nilsson d15633781b TTY: Major overhaul, move to built-in getty
The TTY handling in Finit has always been a bit of a patch work.  This
commit is an attempt at a first cleanup and simplification.

Included is a brand new built-in getty which should work fine on both
virtual and serial consoles.  It is however completely untested on the
latter serial consoles.

Still TODO: add support for /etc/securetty, add support for actually
setting TERM when calling /bin/login.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-28 23:48:38 +02:00
Joachim Nilsson 789354ab40 Improve udev support on non-embedded systems
Embedded Linux systems usually employ BusyBox mdev.  This patch assumes
that all non-embedded systems employ udev.  Adding support for cleaning
up the udev db after the initramfs, or mounting /dev if that not done.
It also runs the udev-finish script at the end.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-27 19:28:42 +02:00
Joachim Nilsson 8002704a5f bootmisc: Create /var/run/network/ for ifupdown
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-27 19:25:50 +02:00
Joachim Nilsson 82853bf0ea Add support for ifupdown 'allow-hotplug' keyword
Look for 'auto' *and* 'allow-hotplug' in /etc/network/interfaces when
bringing up Debian/BusyBox interfaces at boot.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-27 19:25:19 +02:00
Joachim Nilsson bfe9e011bd Remove fallback to /bin/sh if no TTY is defined
If the user specifies no 'tty /dev/ttyN' in finit.conf this code
took upon itself to add a backdoor to the system.  Let's remove
it and rely on the operator deciding what is best practise.

With this patch no getty, or fallback shell, will be started if
no tty line in finit.conf is available.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-27 19:14:36 +02:00
Joachim Nilsson 9416e14074 Minor cleanup and default signals also for getty
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-26 21:13:19 +02:00
Joachim Nilsson 46a58f058a Simplify, simplify, simplify ...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-26 01:29:31 +02:00
Joachim Nilsson 72a484b639 Break out building and bootstrap to separate files
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-23 00:25:14 +02:00
Joachim Nilsson 82e483d6c7 Start splitting up the README into separate files
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-22 23:31:57 +02:00
Joachim Nilsson dafa50ee42 Add links to dependencies in build section
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-22 23:07:25 +02:00
Joachim Nilsson 2187e05e06 Update build instructions
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-22 22:59:08 +02:00
Joachim Nilsson a4fd058607 Update example finit.conf
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-22 22:58:43 +02:00
Joachim Nilsson c49eb5e10d Replace classic Finit rally car with retro ASCII logo
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-22 22:57:55 +02:00
Joachim Nilsson 01d1dabaae Remove useless hostname debug
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-22 22:44:39 +02:00
Joachim Nilsson a3b0022d66 Minor cleanup and additions
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-22 20:00:13 +02:00
Joachim Nilsson e4d882e99e Fix ToC links and add finit.conf example
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-22 19:29:23 +02:00
Joachim Nilsson 5ef426d424 Link to files
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-22 19:28:14 +02:00
Joachim Nilsson 5ee1b7c322 Name waiting-for-enter to getty process
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-21 20:43:23 +02:00
Joachim Nilsson 0d665f3773 Correct adjustment of initctl show columns
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-21 16:48:29 +02:00
Joachim Nilsson 38619966ee Fix interface bring up message NULL ptr deref
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-21 16:35:57 +02:00
Joachim Nilsson 6380f17d1f Prototype support for /etc/netork/interfaces
This patch adds prototype support for the Debian/Ubuntu/Busybox network
configuration file /etc/netork/interfaces.  If this file exists Finit
will call `ifup` for each (non-commented-out) interface marked `auto`.

With this implementation we block boot until all ifup commands have
returned, which is less than ideal.  A better approach would be to ifup
only loopback and create deferred tasklets to be run in parallel with
the rest of the boot.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-21 16:11:50 +02:00
Joachim Nilsson 42181a3031 Add OpenRC-like support for sysctl.d/*.conf
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-21 15:49:00 +02:00
Joachim Nilsson 77b32ebff0 Update Alpine Linux example config
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-21 15:37:15 +02:00
Joachim Nilsson 97de3ad0bb Slight adjustment, plus 1, to allow 79 char width
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-21 15:15:26 +02:00
Joachim Nilsson 44f8a2666f tty: Always detach from initial TTY and open actual /dev/ttyN
This patch fixes a long standing problem with TTY's.  The original code
tried to workaround a limitation in the console of some embedded systems
that was detrimental on actual TTYs.

As an added benefit, the console specific "Press Enter" prompt for the
console port is now available on all TTYs -- meaning no getty needs to
be started and kept needlessly in the background until it is needed.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-21 14:57:58 +02:00
Joachim Nilsson 4cf5b055cf Adjust max width to 79 chars in text output
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-21 14:28:03 +02:00