diff options
author | Simon Rettberg | 2020-12-07 12:11:06 +0100 |
---|---|---|
committer | Simon Rettberg | 2020-12-07 12:11:06 +0100 |
commit | ab9905aabdf465d94c63d97c4ce9fc25dde71e87 (patch) | |
tree | 62073705a5a6d6a1dc92a24bc303acb54f0cb200 /core/rootfs | |
parent | [rootfs-stage31] Remove unused stage4 code (diff) | |
download | mltk-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_sysconfig | 2 | ||||
-rw-r--r-- | core/rootfs/rootfs-stage31/data/inc/functions | 11 |
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 +} |