|
|
0d20ef |
From 4107d367a686622974660c1dc45bc8e40d50624d Mon Sep 17 00:00:00 2001
|
|
|
0d20ef |
From: "Richard W.M. Jones" <rjones@redhat.com>
|
|
|
0d20ef |
Date: Thu, 20 Nov 2014 22:22:49 +0000
|
|
|
0d20ef |
Subject: [PATCH] p2v: Include version and md5sum in kickstart.
|
|
|
0d20ef |
|
|
|
0d20ef |
Include the version of virt-p2v and its MD5 checksum in the source
|
|
|
0d20ef |
kickstart. This is useful for working out which version of virt-p2v
|
|
|
0d20ef |
the kickstart corresponds to.
|
|
|
0d20ef |
|
|
|
0d20ef |
(cherry picked from commit c64467a4c1a31de1134084a15a4acb841557140f)
|
|
|
0d20ef |
---
|
|
|
0d20ef |
p2v/p2v.ks.in | 3 ++-
|
|
|
0d20ef |
p2v/virt-p2v-make-kickstart.in | 3 +++
|
|
|
0d20ef |
2 files changed, 5 insertions(+), 1 deletion(-)
|
|
|
0d20ef |
|
|
|
0d20ef |
diff --git a/p2v/p2v.ks.in b/p2v/p2v.ks.in
|
|
|
0d20ef |
index 9f55e18..26bb925 100644
|
|
|
0d20ef |
--- a/p2v/p2v.ks.in
|
|
|
0d20ef |
+++ b/p2v/p2v.ks.in
|
|
|
0d20ef |
@@ -15,7 +15,7 @@
|
|
|
0d20ef |
# along with this program; if not, write to the Free Software
|
|
|
0d20ef |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
0d20ef |
|
|
|
0d20ef |
-# Generated by virt-p2v-make-kickstart.
|
|
|
0d20ef |
+# Generated by virt-p2v-make-kickstart __PACKAGE_VERSION__.
|
|
|
0d20ef |
|
|
|
0d20ef |
lang en_US.UTF-8
|
|
|
0d20ef |
keyboard us
|
|
|
0d20ef |
@@ -102,6 +102,7 @@ EOF
|
|
|
0d20ef |
systemctl enable p2v.service
|
|
|
0d20ef |
|
|
|
0d20ef |
# Base64-decoding of virt-p2v binary
|
|
|
0d20ef |
+# md5(virt-p2v) = __MD5SUM_VIRT_P2V__
|
|
|
0d20ef |
|
|
|
0d20ef |
base64 -d <<EOF | gzip -cd > __LIBEXECDIR__/virt-p2v
|
|
|
0d20ef |
__BASE64_VIRT_P2V__
|
|
|
0d20ef |
diff --git a/p2v/virt-p2v-make-kickstart.in b/p2v/virt-p2v-make-kickstart.in
|
|
|
0d20ef |
index a2937b3..22a4eaa 100644
|
|
|
0d20ef |
--- a/p2v/virt-p2v-make-kickstart.in
|
|
|
0d20ef |
+++ b/p2v/virt-p2v-make-kickstart.in
|
|
|
0d20ef |
@@ -97,6 +97,7 @@ base64_p2v_service="$(base64 $datadir/p2v.service)"
|
|
|
0d20ef |
# virt-p2v binary is too large unless we strip it and compress it.
|
|
|
0d20ef |
tmpfile="$(mktemp -u)"
|
|
|
0d20ef |
cp $host_libexecdir/virt-p2v $tmpfile
|
|
|
0d20ef |
+md5sum_virt_p2v="$(md5sum $tmpfile | @AWK@ '{print $1}')"
|
|
|
0d20ef |
strip --strip-all $tmpfile
|
|
|
0d20ef |
gzip -9 $tmpfile
|
|
|
0d20ef |
base64_virt_p2v="$(base64 $tmpfile.gz)"
|
|
|
0d20ef |
@@ -139,6 +140,7 @@ done
|
|
|
0d20ef |
-v "base64_launch_virt_p2v=$base64_launch_virt_p2v" \
|
|
|
0d20ef |
-v "base64_p2v_service=$base64_p2v_service" \
|
|
|
0d20ef |
-v "base64_virt_p2v=$base64_virt_p2v" \
|
|
|
0d20ef |
+ -v "md5sum_virt_p2v=$md5sum_virt_p2v" \
|
|
|
0d20ef |
-v "repos=$repos" \
|
|
|
0d20ef |
-v "libexecdir=$libexecdir" \
|
|
|
0d20ef |
'{
|
|
|
0d20ef |
@@ -148,6 +150,7 @@ done
|
|
|
0d20ef |
gsub (/__BASE64_LAUNCH_VIRT_P2V__/, base64_launch_virt_p2v);
|
|
|
0d20ef |
gsub (/__BASE64_P2V_SERVICE__/, base64_p2v_service);
|
|
|
0d20ef |
gsub (/__BASE64_VIRT_P2V__/, base64_virt_p2v);
|
|
|
0d20ef |
+ gsub (/__MD5SUM_VIRT_P2V__/, md5sum_virt_p2v);
|
|
|
0d20ef |
gsub (/__REPOS__/, repos);
|
|
|
0d20ef |
gsub (/__LIBEXECDIR__/, libexecdir);
|
|
|
0d20ef |
print;
|
|
|
0d20ef |
--
|
|
|
0d20ef |
1.8.3.1
|
|
|
0d20ef |
|