summaryrefslogtreecommitdiffstats
path: root/core/rootfs
diff options
context:
space:
mode:
authorSimon Rettberg2020-12-07 12:11:06 +0100
committerSimon Rettberg2020-12-07 12:11:06 +0100
commitab9905aabdf465d94c63d97c4ce9fc25dde71e87 (patch)
tree62073705a5a6d6a1dc92a24bc303acb54f0cb200 /core/rootfs
parent[rootfs-stage31] Remove unused stage4 code (diff)
downloadmltk-ab9905aabdf465d94c63d97c4ce9fc25dde71e87.tar.gz
mltk-ab9905aabdf465d94c63d97c4ce9fc25dde71e87.tar.xz
mltk-ab9905aabdf465d94c63d97c4ce9fc25dde71e87.zip
[rootfs-stage31] Add hook mechanism
TODO: Move bwlp-specific code to init-bwlp and use hooks.
Diffstat (limited to 'core/rootfs')
-rw-r--r--core/rootfs/rootfs-stage31/data/inc/activate_sysconfig2
-rw-r--r--core/rootfs/rootfs-stage31/data/inc/functions11
2 files changed, 12 insertions, 1 deletions
diff --git a/core/rootfs/rootfs-stage31/data/inc/activate_sysconfig b/core/rootfs/rootfs-stage31/data/inc/activate_sysconfig
index 61359374..56586928 100644
--- a/core/rootfs/rootfs-stage31/data/inc/activate_sysconfig
+++ b/core/rootfs/rootfs-stage31/data/inc/activate_sysconfig
@@ -151,6 +151,8 @@ if [ -n "$SLX_SYSTEMD_TARGET" ]; then
done
fi
+run_hooks post-config-tgz
+
# Activate jumbo frames if requested
(
. /run/network.conf
diff --git a/core/rootfs/rootfs-stage31/data/inc/functions b/core/rootfs/rootfs-stage31/data/inc/functions
index a4ad56db..c215350c 100644
--- a/core/rootfs/rootfs-stage31/data/inc/functions
+++ b/core/rootfs/rootfs-stage31/data/inc/functions
@@ -1,4 +1,4 @@
-#########################################################################
+#!/bin/ash ##############################################################
#
# COMMON HELPER FUNCTIONS
#
@@ -98,3 +98,12 @@ tarcopy() {
rm -f -- /tmp/tctmp
cd - &>/dev/null
}
+
+run_hooks () {
+ [ -d "/inc/${1}.d" ] || return 0
+ local i
+ for i in "/inc/${1}.d/"*; do
+ [ -f "$i" ] && . "$i"
+ done
+ return 0
+}