From 7f62a69f7494a3b9f6af93d1aaf0a1a0205677c4 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Thu, 18 Jan 2018 12:34:14 +0100 Subject: [PATCH] New hook/mount/post, runs after `mount -a` but before hook/mount/all This gives the operator a way to add a post-mount script, e.g. to peform a 2nd stage mount or mount preparations, before the bootmisc.so plugin and others run in hook/mount/all Signed-off-by: Joachim Nilsson --- src/finit.c | 3 +++ src/plugin.h | 1 + 2 files changed, 4 insertions(+) diff --git a/src/finit.c b/src/finit.c index 90162a26..c507a9f7 100644 --- a/src/finit.c +++ b/src/finit.c @@ -448,6 +448,9 @@ int main(int argc, char* argv[]) if (run_interactive("mount -na", "Mounting filesystems")) plugin_run_hooks(HOOK_MOUNT_ERROR); + _d("Calling extra mount hook, after mount -a ..."); + plugin_run_hooks(HOOK_MOUNT_POST); + run("swapon -ea"); umask(0022); } diff --git a/src/plugin.h b/src/plugin.h index ea85826d..4d404023 100644 --- a/src/plugin.h +++ b/src/plugin.h @@ -68,6 +68,7 @@ CHOOSE(HOOK_BANNER = 0, "hook/sys/banner"), \ CHOOSE(HOOK_ROOTFS_UP, "hook/mount/root"), \ CHOOSE(HOOK_MOUNT_ERROR, "hook/mount/error"), \ + CHOOSE(HOOK_MOUNT_POST, "hook/mount/post"), \ CHOOSE(HOOK_BASEFS_UP, "hook/mount/all"), \ CHOOSE(HOOK_NETWORK_UP, "hook/net/up"), \ CHOOSE(HOOK_SVC_UP, "hook/svc/up"), \