From 23cb10477537a2bbf40ac06a61046f75f2b160c5 Mon Sep 17 00:00:00 2001 From: Henrik Riomar Date: Fri, 29 Dec 2017 21:10:44 +0100 Subject: add new flag --no-commit-hooks This flag skips running hook scripts This flag *must* be used during initramfs tmpfs initial install. The reason that this new flag is needed is that the hooks will currently always fail as musl and /bin/sh is missing at this stage on diskless. --- src/commit.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/commit.c') diff --git a/src/commit.c b/src/commit.c index 0c0bb34e4c..af49f5c9fc 100644 --- a/src/commit.c +++ b/src/commit.c @@ -236,6 +236,10 @@ static int run_commit_hook(void *ctx, int dirfd, const char *file) return 0; snprintf(fn, sizeof(fn), "etc/apk/commit_hooks.d" "/%s", file); + if ((apk_flags & APK_NO_COMMIT_HOOKS) != 0) { + apk_message("Skipping: %s %s", fn, commit_hook_str[hook->type]); + return 0; + } if (apk_verbosity >= 2) apk_message("Executing: %s %s", fn, commit_hook_str[hook->type]); if (apk_db_run_script(db, fn, argv) < 0 && hook->type == PRE_COMMIT_HOOK) -- cgit v1.2.3