From e172683630d0fe8bde4db4c027039f0e7ecf3309 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Tue, 25 Sep 2012 16:54:35 -0400 Subject: 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 --- functions | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'functions') 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() { -- cgit v1.2.3-24-g4f1b