From 0ccb5f6e037bcbb0817cdb76274a37624c28cb5a Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Thu, 17 May 2012 22:01:28 -0400 Subject: mkinitcpio: write image config after install hooks Break this out of install/base into a separate function. We need to be able to read from the RUNHOOKS array to accurately specify which hooks to execute at runtime. Signed-off-by: Dave Reisner --- functions | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'functions') diff --git a/functions b/functions index a6c7163..ed6d78d 100644 --- a/functions +++ b/functions @@ -547,4 +547,24 @@ find_in_dirs() { return 1 } +write_image_config() { + # write a config file. re-source the config as we can't guarantee the + # environment hasn't been modified, but subshell it so it doesn't disturb + # anyone else. + ( + . "$CONFIG" + + # sanitize of any extra whitespace + read -r -a modules <<< "$MODULES" + (( ${#modules[*]} )) && printf 'MODULES="%s"\n' "${modules[*]%\?}" + + printf '%s="%s"\n' \ + 'EARLYHOOKS' "${RUNHOOKS['early']# }" \ + 'HOOKS' "${RUNHOOKS['hooks']# }" \ + 'LATEHOOKS' "${RUNHOOKS['late']# }" \ + 'CLEANUPHOOKS' "${RUNHOOKS['cleanup']% }" + + ) >"$BUILDROOT/config" +} + # vim: set ft=sh ts=4 sw=4 et: -- cgit v1.2.3-24-g4f1b