From patchwork Mon Jul 15 16:20:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomoki Sekiyama X-Patchwork-Id: 259125 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 03A952C00C6 for ; Tue, 16 Jul 2013 02:45:48 +1000 (EST) Received: from localhost ([::1]:59887 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UylY0-0000Hd-M1 for incoming@patchwork.ozlabs.org; Mon, 15 Jul 2013 12:22:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33549) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UylWA-000682-3n for qemu-devel@nongnu.org; Mon, 15 Jul 2013 12:20:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UylW6-0003x4-Ch for qemu-devel@nongnu.org; Mon, 15 Jul 2013 12:20:53 -0400 Received: from usindpps06.hds.com ([207.126.252.19]:32996) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UylW6-0003wu-7N for qemu-devel@nongnu.org; Mon, 15 Jul 2013 12:20:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hds.com; h=subject : to : from : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=mail1; bh=oGk938cityuArBXKYDdXTaFROVh0SOqcXGyxFnxmOr4=; b=DJ4Ud7Tuo5MjCWBc88YSVRs0pjgeMU5gvuaNzqtgXB+JLbc0RcUu2mJF5ssLofejEx6U SF0V8T98I9KuQxdta/L80rVyd4OWMiWxB1DS1L6Ta1ZTYFzqJKPkKclSqEetCpE/JcY/ HYVjWf/Ba45VHkZ+3RSKZVCnONrl9KFIT1rB4XoffMJslitprS2/A0LxshpoIpQHAaJz po7rl/3lcN2F5tf97v9GTMzxxjOq+cC5JB69aLZUS/uonxfbB8oonqXt1HGlpqLADO42 MkKq45e0zYNf2rdeqvlYTNuArViWkgPvF1bDdAU+3yfRg79RDak3TmBAvP3WXOBI76Ju /w== Received: from usindmail02.hds.com (usindmail02 [207.126.252.21]) by usindpps06.hds.com (8.14.5/8.14.5) with ESMTP id r6FGKgGK028280; Mon, 15 Jul 2013 09:20:43 -0700 Received: from [10.18.17.86] (usindnetf5d-vlan47float.corp.hds.com [10.74.73.11]) by usindmail02.hds.com (8.14.1/8.14.1) with ESMTP id r6FGKfPx029315; Mon, 15 Jul 2013 12:20:41 -0400 (EDT) To: qemu-devel@nongnu.org From: Tomoki Sekiyama Date: Mon, 15 Jul 2013 12:20:41 -0400 Message-ID: <20130715162041.16676.20397.stgit@outback> In-Reply-To: <20130715162023.16676.87828.stgit@outback> References: <20130715162023.16676.87828.stgit@outback> User-Agent: StGit/0.16 MIME-Version: 1.0 X-Proofpoint-SPF-Result: pass X-Proofpoint-SPF-Record: v=spf1 mx ip4:207.126.244.0/26 ip4:207.126.252.0/25 include:mktomail.com include:cloud.hds.com ~all X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794, 1.0.431, 0.0.0000 definitions=2013-07-15_04:2013-07-15, 2013-07-15, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=outbound_policy score=0 kscore.is_bulkscore=0 kscore.compositescore=0 circleOfTrustscore=0 compositescore=0.207753575997753 urlsuspect_oldscore=0.997706394249456 suspectscore=1 recipient_domain_to_sender_totalscore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=0 recipient_to_sender_totalscore=0 recipient_domain_to_sender_domain_totalscore=349 rbsscore=0.207753575997753 spamscore=0 recipient_to_sender_domain_totalscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1305240000 definitions=main-1307150134 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 207.126.252.19 Cc: libaiqing@huawei.com, ghammer@redhat.com, stefanha@gmail.com, mdroth@linux.vnet.ibm.com, lcapitulino@redhat.com, vrozenfe@redhat.com, Paolo Bonzini , seiji.aguchi@hds.com, Laszlo Ersek , areis@redhat.com Subject: [Qemu-devel] [PATCH v7 04/10] Add a script to extract VSS SDK headers on POSIX system X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org VSS SDK(*) setup.exe is only runnable on Windows. This adds a script to extract VSS SDK headers on POSIX-systems using msitools. * http://www.microsoft.com/en-us/download/details.aspx?id=23490 From: Paolo Bonzini Signed-off-by: Paolo Bonzini Signed-off-by: Tomoki Sekiyama Reviewed-by: Laszlo Ersek Reviewed-by: Michael Roth --- scripts/extract-vsssdk-headers | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 scripts/extract-vsssdk-headers diff --git a/scripts/extract-vsssdk-headers b/scripts/extract-vsssdk-headers new file mode 100755 index 0000000..9e38510 --- /dev/null +++ b/scripts/extract-vsssdk-headers @@ -0,0 +1,35 @@ +#! /bin/bash + +# extract-vsssdk-headers +# Author: Paolo Bonzini + +set -e +if test $# != 1 || ! test -f "$1"; then + echo 'Usage: extract-vsssdk-headers /path/to/setup.exe' >&2 + exit 1 +fi + +if ! command -v msiextract > /dev/null; then + echo 'msiextract not found. Please install msitools.' >&2 + exit 1 +fi + +if test -e inc; then + echo '"inc" already exists.' >&2 + exit 1 +fi + +# Extract .MSI file in the .exe, looking for the OLE compound +# document signature. Extra data at the end does not matter. +export LC_ALL=C +MAGIC=$'\xd0\xcf\x11\xe0\xa1\xb1\x1a\xe1' +offset=$(grep -abom1 "$MAGIC" "$1" | sed -n 's/:/\n/; P') +tmpdir=$(mktemp -d) +trap 'rm -fr -- "$tmpdir" vsssdk.msi' EXIT HUP INT QUIT ALRM TERM +tail -c +$(($offset+1)) -- "$1" > vsssdk.msi + +# Now extract the files. +msiextract -C $tmpdir vsssdk.msi +mv "$tmpdir/Program Files/Microsoft/VSSSDK72/inc" inc +echo 'Extracted SDK headers into "inc" directory.' +exit 0