From patchwork Tue May 13 09:14:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Svend Aage Vedstesen X-Patchwork-Id: 348297 X-Patchwork-Delegate: esben@haabendal.dk Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hugin.dotsrc.org (hugin.dotsrc.org [IPv6:2001:878:346::102]) by ozlabs.org (Postfix) with ESMTP id C1D2E1400D4 for ; Tue, 13 May 2014 19:14:35 +1000 (EST) Received: from hugin.dotsrc.org (localhost [127.0.0.1]) by hugin.dotsrc.org (Postfix) with ESMTP id 5300A3FB59 for ; Tue, 13 May 2014 11:14:34 +0200 (CEST) X-Original-To: dev@oe-lite.org Delivered-To: dev@oe-lite.org Received: from mail02.prevas.se (mail02.prevas.se [62.95.78.10]) by hugin.dotsrc.org (Postfix) with ESMTPS id 8EC353FB59 for ; Tue, 13 May 2014 11:14:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=prevas.dk; i=@prevas.dk; l=2005; q=dns/txt; s=ironport2; t=1399972472; x=1431508472; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=FSaxnHKkh1M7S1kP9NEqGyz1zujulFO7fHYuVZ2G9zA=; b=WYF5H/WvQq10boiwynnm1wy1Zcw8E97RZyscJ7qkFoemuJC1A5fySnXb xuhET3q1sEMTYCtls/KPkENaahE0sSjoe77i14kqegFWZZbeLqJYrB1f0 t+Y+U4AFxHcS5yUOcGeOgn3ME47ykhGQ3Fhfg4JTrp85pXV5E5T/RLMY9 Y=; X-IronPort-AV: E=Sophos;i="4.97,1042,1389740400"; d="scan'208";a="591136" Received: from vmprevas3.prevas.se (HELO smtp.prevas.se) ([172.16.8.103]) by ironport2.prevas.se with ESMTP/TLS/AES128-SHA; 13 May 2014 11:14:32 +0200 Received: from svav-VirtualBox.prevas.se (172.16.11.41) by smtp.prevas.se (172.16.8.105) with Microsoft SMTP Server (TLS) id 14.2.347.0; Tue, 13 May 2014 11:14:31 +0200 From: Svend Aage Vedstesen To: Subject: [PATCH 1/1] dupdate-image.oeclass: Extend to support packing into zip Date: Tue, 13 May 2014 11:14:03 +0200 Message-ID: <1513b54ef87e133b6863a8ed01b539339d67c5b7.1399971768.git.Svend.Vedstesen@prevas.dk> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [172.16.11.41] X-BeenThere: dev@oe-lite.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: OE-lite development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dev-bounces@oe-lite.org Errors-To: dev-bounces@oe-lite.org --- classes/dupdate-image.oeclass | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/classes/dupdate-image.oeclass b/classes/dupdate-image.oeclass index f8af6a2..962b1c9 100644 --- a/classes/dupdate-image.oeclass +++ b/classes/dupdate-image.oeclass @@ -1,4 +1,4 @@ -## Used for creating dupdate tarballs containing multiple files. +## Used for creating dupdate tarballs/zip containing multiple files. ## ## A dupdate file is a tarball containing: A VERSION, a runscript, a number of ## images, and a checksum of all the files. @@ -6,6 +6,7 @@ ## @useflag dupdate_script Set it to the name of dupdate script. ## @useflag dupdate_version Set it to the dupdate version (will be placed in ## the VERSION file. +## @useflag dupdate_archiveformat Set it to the dupdate archive format to use, tar or zip ## @var IMAGE_BASENAME Set to a different basename. ## @var IMAGE_FULLNAME Set to a different fullname. @@ -18,16 +19,31 @@ DUPDATE_IMAGE_EXT = '.dupdate' IMAGE_CREATE_FUNCS += "dupdate_image" -dupdate_image() { - ( - sha256sum * > sha256sum.txt - tar chf ${B}/${IMAGE_BASENAME}${DUPDATE_IMAGE_EXT} . - ) +dupdate_image_tar(){ + tar chf ${B}/${IMAGE_BASENAME}${DUPDATE_IMAGE_EXT} . } -CLASS_FLAGS += "dupdate_script dupdate_version" +dupdate_image_zip(){ + zip ${B}/${IMAGE_BASENAME}${DUPDATE_IMAGE_EXT} * +} + +dupdate_image(){ + sha256sum * > sha256sum.txt + + case "${USE_dupdate_archiveformat}" in + "tar") dupdate_image_tar + ;; + "zip") dupdate_image_zip + ;; + *) echo "ERROR: Unsupported archive format (${USE_dupdate_archiveformat})" + exit 1 + esac +} + +CLASS_FLAGS += "dupdate_script dupdate_version dupdate_archiveformat" DEFAULT_USE_dupdate_script = "" DEFAULT_USE_dupdate_version = "" +DEFAULT_USE_dupdate_archiveformat = "tar" CLASS_FLAGS += "dupdate_exefile" require conf/dupdate.conf