summaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-09-25 22:54:35 +0200
committerDave Reisner <dreisner@archlinux.org>2012-09-30 00:06:09 +0200
commite172683630d0fe8bde4db4c027039f0e7ecf3309 (patch)
treeb1b3f9b23400c16ad9d709801e08a07f14bf734f /functions
parent4136ec05327471a986b8d4dfada5733c6927d79e (diff)
downloadmkinitcpio-e172683630d0fe8bde4db4c027039f0e7ecf3309.tar.gz
mkinitcpio-e172683630d0fe8bde4db4c027039f0e7ecf3309.tar.xz
functions: include image config on image itself
For the purposes of accounting and debugging, it's nice to have this around. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Diffstat (limited to 'functions')
-rw-r--r--functions13
1 files changed, 6 insertions, 7 deletions
diff --git a/functions b/functions
index ed3a583..2e1ae3f 100644
--- a/functions
+++ b/functions
@@ -594,11 +594,11 @@ find_in_dirs() {
}
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"
+ # write the config as runtime config and as a pristine build config
+ # (for audting purposes) to the image.
+
+ tee "$BUILDROOT/buildconfig" < "$CONFIG" | {
+ . /dev/stdin
# sanitize of any extra whitespace
read -ra modules <<<"${MODULES//-/_}"
@@ -613,8 +613,7 @@ write_image_config() {
'HOOKS' "${RUNHOOKS['hooks']# }" \
'LATEHOOKS' "${RUNHOOKS['late']# }" \
'CLEANUPHOOKS' "${RUNHOOKS['cleanup']% }"
-
- ) >"$BUILDROOT/config"
+ } >"$BUILDROOT/config"
}
initialize_buildroot() {