From patchwork Wed Aug 7 11:10:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wieczorkiewicz, Pawel" X-Patchwork-Id: 11081907 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8B0E713B1 for ; Wed, 7 Aug 2019 11:12:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D325289B4 for ; Wed, 7 Aug 2019 11:12:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5DF6B289B6; Wed, 7 Aug 2019 11:12:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 003DC289B4 for ; Wed, 7 Aug 2019 11:12:36 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hvJqF-0000Uo-7c; Wed, 07 Aug 2019 11:10:51 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hvJqC-0000Uj-VV for xen-devel@lists.xen.org; Wed, 07 Aug 2019 11:10:49 +0000 X-Inumbo-ID: 014d0062-b904-11e9-8980-bc764e045a96 Received: from smtp-fw-4101.amazon.com (unknown [72.21.198.25]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 014d0062-b904-11e9-8980-bc764e045a96; Wed, 07 Aug 2019 11:10:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1565176246; x=1596712246; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=70wvJNsYEt1AtY5SiHe3PVq6eN0xf28P0BOuTXB6954=; b=aVHRLTamNTBqDnRWSxX5lG/TF+qU9P8autdVO+JrNe/TLPbq0i0mKmcR /7BS/qhGwYfs/KlOiGPWYScrM6YzG1WFlw4UHmY9WbzRCHA+3LhbUGGgb QW8bpm6J4xACyJgmyI6EvYmvORQAtGwk7BDwRbQfEz4ILVdQwy3RXkYrn M=; X-IronPort-AV: E=Sophos;i="5.64,357,1559520000"; d="scan'208";a="778143886" Received: from iad6-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-1a-821c648d.us-east-1.amazon.com) ([10.124.125.6]) by smtp-border-fw-out-4101.iad4.amazon.com with ESMTP; 07 Aug 2019 11:10:44 +0000 Received: from EX13MTAUEA001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1a-821c648d.us-east-1.amazon.com (Postfix) with ESMTPS id 29959A22B4; Wed, 7 Aug 2019 11:10:44 +0000 (UTC) Received: from EX13D03EUC004.ant.amazon.com (10.43.164.33) by EX13MTAUEA001.ant.amazon.com (10.43.61.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 7 Aug 2019 11:10:43 +0000 Received: from EX13MTAUWB001.ant.amazon.com (10.43.161.207) by EX13D03EUC004.ant.amazon.com (10.43.164.33) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 7 Aug 2019 11:10:42 +0000 Received: from dev-dsk-wipawel-1a-0c4e6d58.eu-west-1.amazon.com (10.4.134.33) by mail-relay.amazon.com (10.43.161.249) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Wed, 7 Aug 2019 11:10:40 +0000 From: Pawel Wieczorkiewicz To: Date: Wed, 7 Aug 2019 11:10:29 +0000 Message-ID: <20190807111029.67766-1-wipawel@amazon.de> X-Mailer: git-send-email 2.16.5 In-Reply-To: <20190408083224.104802-4-wipawel@amazon.de> References: <20190408083224.104802-4-wipawel@amazon.de> MIME-Version: 1.0 Precedence: Bulk Subject: [Xen-devel] [livepatch-build-tools v2 4/4] livepatch-build: Handle newly created object files X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: mpohlack@amazon.de, ross.lagerwall@citrix.com, Pawel Wieczorkiewicz , konrad.wilk@oracle.com Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Up to now the livepatch-build ignores newly created object files. When patch applies new .c file and augments its Makefile to build it the resulting object file is not taken into account for final linking step. Such newly created object files can be detected by comparing patched/ and original/ directories and copied over to the output directory for the final linking step. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Bjoern Doebel Reviewed-by: Norbert Manthey Reviewed-by: Ross Lagerwall --- v2: * Fixed paths to process only hypervisor changes * Changing directory in subshells to simplified the command --- livepatch-build | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/livepatch-build b/livepatch-build index 796838c..3c4bf13 100755 --- a/livepatch-build +++ b/livepatch-build @@ -146,6 +146,12 @@ function create_patch() fi done + NEW_FILES=$(comm -23 <(cd patched/xen && find . -type f -name '*.o' | sort) <(cd original/xen && find . -type f -name '*.o' | sort)) + for i in $NEW_FILES; do + cp "patched/$i" "output/$i" + CHANGED=1 + done + if [[ $ERROR -ne 0 ]]; then die "$ERROR error(s) encountered" fi