summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2011-12-05 21:16:43 +0100
committerDave Reisner <dreisner@archlinux.org>2011-12-05 21:16:43 +0100
commiteeb558968d02b8b46b73d0b01613271fa77a76bf (patch)
treeb1c09e0a17a295110569c5ef8d2c1565dd6b4fac
parent7effc762a2de2029ccedb659f25426c80b04cf4d (diff)
downloadmkinitcpio-eeb558968d02b8b46b73d0b01613271fa77a76bf.tar.gz
mkinitcpio-eeb558968d02b8b46b73d0b01613271fa77a76bf.tar.xz
mkinitcpio: add VERSION stamp to image
This is mostly a debugging aid. lsinitcpio will be taught to read this. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rwxr-xr-xmkinitcpio7
1 files changed, 6 insertions, 1 deletions
diff --git a/mkinitcpio b/mkinitcpio
index ec54408..4411ff3 100755
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -10,6 +10,8 @@
# in case of embedded spaces, quote all path names and string comparisons
#
+declare -r version=%VERSION%
+
shopt -s extglob
# Settings
@@ -35,7 +37,7 @@ unset GREP_OPTIONS CDPATH
usage() {
cat <<EOF
-mkinitcpio %VERSION%
+mkinitcpio $version
usage: ${0##*/} [options]
Options:
@@ -363,6 +365,9 @@ if [[ "${GENIMG}" ]]; then
msg "Creating $COMPRESSION initcpio image: %s" "$GENIMG"
[[ "$COMPRESSION" = xz ]] && COMPRESSION_OPTIONS+=" --check=crc32"
+ # write version stamp
+ printf '%s' "$version" > "$BUILDROOT/VERSION"
+
pushd "$BUILDROOT" >/dev/null
find . -print0 |
bsdcpio $( (( QUIET )) && echo '--quiet' ) -0oH newc |