21 Commits
Author SHA1 Message Date
bazub 662293e194 Use explicit plugin names to prevent subtle macro processing bugs 2026-03-06 20:36:23 +00:00
Joachim Wiberg ff91d5c836 Follow-up to d37d241, add missing log.h to all plugins
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-07-06 14:40:07 +02:00
Joachim Wiberg eb13ccc227 plugins: minor, rename local functions
Prevent name clash with upcoming refactor and any confusion with
src/plugin.c functions with the same name.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-07-06 03:13:58 +02:00
Joachim Wiberg 75fa868a4b Fix various typos found by codepsell
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-03-17 16:46:28 +01:00
Joachim Wiberg 939ae02a6a Increase MAX command, and arg., length: 64 -> 256
With non-standard paths, e.g., when running `make distcheck`, the
absolute path to some commands become ridiculously long.  However,
this has been a recurring issue for some users in the past, so it
is time to increase the capabilibieies of Finit to cover this.

Yes, a better way is probably to allocate all these strings when they
are used, but that would require a redesign of the initctl API and
likely cause a lot of regressions before everything has stabilized.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-14 09:15:55 +02:00
Joachim Wiberg 82dfa002ff Follow-up to c9fe9afa, proper fix for HOOK_BASFFS_UP mess
Instead of the revert in c9fe9afa, we restore HOOK_BASFFS_UP to its
proper place at the end of fs_mount_all().  For this to not cause any
regressions we add a new hook, HOOK_SVC_PLUGIN, and update all plugins
that call service_register() to run at the new hook.

This will cause regressions for external 3rd party plugins that rely on
HOOK_BASEFS_UP to be called at its previous postion.  Nevertheless, this
is the proper fix to the problem.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-05 01:15:49 +01:00
Joachim Wiberg 48cfbfe5ed Follow-up to 685e0a80, drop extra snprintf() args
Issue #332

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-20 13:35:19 +01:00
Joachim Wiberg 685e0a80a4 Fix #332: silence confusing [ OK ] status progress from modules-load
This change drops the confusing status progress output, which was always
OK since the actual modprobe operation runs in the background.  No need
to show status of the "added a task to finit, found modprobe" command.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-11 10:05:53 +01:00
Joachim Wiberg 19847d2997 plugins/modules-load: change default, load modules in runlevel S
Instead of waiting until runlevel 2, 3, 4, or 5 to load modules with
this plugin, we should load modules as soon as possible, i.e., in
runlevel S.  This also means that Finit will clean up all the tasks
so we don't have to see them in `initctl status`.

To allow users to revert to the old behavior, we add a new setting

    set runlevel 2345

that per modules-load.d/file changes the runlevel for all modprobe
commands.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-10 13:29:53 +01:00
Joachim Wiberg 3df154b798 Fix #325: allow custom modprobe command in modules-load.d plugin
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-06 14:01:20 +01:00
Joachim Wiberg d22dea74e3 Finalize refactor to new log macros, following-up to 37e3be9
This possible also mitigates the issue tracked in #307.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-10-09 12:52:40 +02:00
Joachim Wiberg eca3098c0e plugins: refactor modules-load to read files in lexicographic order
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-05-07 16:29:18 +02:00
Joachim Wiberg 7f19474d8d plugins: skip backup files in modules-load plugin
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-05-06 07:57:07 +02:00
Joachim Wiberg a5941165a0 plugins: add support for 'set noindex' to modules-load plugin
This adds support for a `set` directive in the modules-load plugin.
Currently only `set noindex` and `set index = NUM` are supported and
either disable indexing (:ID) of modules, or reset the index to NUM,
for the given file.  For each new file read the index is reset to
the value it would have had.  E.g.

01-foo.conf:          => name:id
   esp4.ko            => modprobe.esp4.ko:1
   set noindex
   deflate.ko         => modprobe.deflate.ko
02-bar.conf:
   nls_iso8859-15.ko  => modprobe.nls_iso8859-15.ko:3
   nls_utf8.ko        => modprobe.nls_utf8.ko:4

Fixes issue #257

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-05-06 07:57:07 +02:00
Joachim Wiberg 10392e9639 plugins: modules-load: skip lines starting with '#'
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-04-27 07:46:03 +02:00
Joachim Wiberg 280d91b9bf Add support for new libite (-lite) header namespace
Due to an unfortunate name clash with the DirectFB project LiTE, the
libite (-lite) project had to change its header namespace from

   lite/*.h -> libite/*.h

This patch adds support for the new namepace in Finit, triggered by the
define _LIBITE_LITE, from the .pc file read by pkg-config.  This should
only be needed on systems that install libite without the compatibility
symlink lite -> libite/ in the staging include directory.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-12-06 21:38:20 +01:00
Joachim Wiberg d994420d4d plugins: minor coding style cleanup
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-11-10 10:18:02 +01:00
Joachim Wiberg b04dc4d457 Ensure services in plugins and from finit.c belong to a cgroup
The udevd, dbus, bundled watchdog, and others were started without a
valid cgroup.  This is a workaround to ensure they are assigned one.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-05-15 10:27:59 +02:00
Ming Liu 1fa6a98e79 modules-load.c: allow MODULES_LOAD_PATH to be overridden
Define MODULES_LOAD_PATH only when it's unset, this allows it to be
overridden, for instance, by passing CFLAGS.

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
2020-06-09 10:54:09 +02:00
Robert Andersson 423c8d41a7 modules-load: add task name config
Signed-off-by: Robert Andersson <robert.m.andersson@se.atlascopco.com>
2018-10-22 12:51:58 +02:00
Robert Andersson 33fd6f0049 Add modules-load.d plugin
This plugin scans /etc/modules-load.d for modules to modprobe.

Signed-off-by: Robert Andersson <robert.m.andersson@se.atlascopco.com>
2018-10-22 12:51:58 +02:00