diff options
author | Dave Reisner <dreisner@archlinux.org> | 2012-05-18 04:01:28 +0200 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2012-05-18 15:39:04 +0200 |
commit | 0ccb5f6e037bcbb0817cdb76274a37624c28cb5a (patch) | |
tree | 063e366e2c142ab73029cc6718e310052fa1b0b6 /functions | |
parent | a68d47b4851828688275921e94b9a9e6bef80ca3 (diff) | |
download | mkinitcpio-0ccb5f6e037bcbb0817cdb76274a37624c28cb5a.tar.gz mkinitcpio-0ccb5f6e037bcbb0817cdb76274a37624c28cb5a.tar.xz |
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 <dreisner@archlinux.org>
Diffstat (limited to 'functions')
-rw-r--r-- | functions | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -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: |