[Pkg-libvirt-commits] [libguestfs] 28/146: p2v: Include version and md5sum in kickstart.

Hilko Bengen bengen at moszumanska.debian.org
Sun Mar 29 17:00:09 UTC 2015


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch master
in repository libguestfs.

commit 481ed5660dc7e8c003e74ffa9f5cc2a8989921c0
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Thu Nov 20 22:22:49 2014 +0000

    p2v: Include version and md5sum in kickstart.
    
    Include the version of virt-p2v and its MD5 checksum in the source
    kickstart.  This is useful for working out which version of virt-p2v
    the kickstart corresponds to.
    
    (cherry picked from commit c64467a4c1a31de1134084a15a4acb841557140f)
---
 p2v/p2v.ks.in                  | 3 ++-
 p2v/virt-p2v-make-kickstart.in | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/p2v/p2v.ks.in b/p2v/p2v.ks.in
index 9f55e18..26bb925 100644
--- a/p2v/p2v.ks.in
+++ b/p2v/p2v.ks.in
@@ -15,7 +15,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-# Generated by virt-p2v-make-kickstart.
+# Generated by virt-p2v-make-kickstart __PACKAGE_VERSION__.
 
 lang en_US.UTF-8
 keyboard us
@@ -102,6 +102,7 @@ EOF
 systemctl enable p2v.service
 
 # Base64-decoding of virt-p2v binary
+# md5(virt-p2v) = __MD5SUM_VIRT_P2V__
 
 base64 -d <<EOF | gzip -cd > __LIBEXECDIR__/virt-p2v
 __BASE64_VIRT_P2V__
diff --git a/p2v/virt-p2v-make-kickstart.in b/p2v/virt-p2v-make-kickstart.in
index a2937b3..22a4eaa 100644
--- a/p2v/virt-p2v-make-kickstart.in
+++ b/p2v/virt-p2v-make-kickstart.in
@@ -97,6 +97,7 @@ base64_p2v_service="$(base64 $datadir/p2v.service)"
 # virt-p2v binary is too large unless we strip it and compress it.
 tmpfile="$(mktemp -u)"
 cp $host_libexecdir/virt-p2v $tmpfile
+md5sum_virt_p2v="$(md5sum $tmpfile | @AWK@ '{print $1}')"
 strip --strip-all $tmpfile
 gzip -9 $tmpfile
 base64_virt_p2v="$(base64 $tmpfile.gz)"
@@ -139,6 +140,7 @@ done
   -v "base64_launch_virt_p2v=$base64_launch_virt_p2v" \
   -v "base64_p2v_service=$base64_p2v_service" \
   -v "base64_virt_p2v=$base64_virt_p2v" \
+  -v "md5sum_virt_p2v=$md5sum_virt_p2v" \
   -v "repos=$repos" \
   -v "libexecdir=$libexecdir" \
   '{
@@ -148,6 +150,7 @@ done
     gsub (/__BASE64_LAUNCH_VIRT_P2V__/, base64_launch_virt_p2v);
     gsub (/__BASE64_P2V_SERVICE__/, base64_p2v_service);
     gsub (/__BASE64_VIRT_P2V__/, base64_virt_p2v);
+    gsub (/__MD5SUM_VIRT_P2V__/, md5sum_virt_p2v);
     gsub (/__REPOS__/, repos);
     gsub (/__LIBEXECDIR__/, libexecdir);
     print;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list