From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6628101524376518656 X-Received: by 2002:a5d:6091:: with SMTP id w17mr2467631wrt.27.1543225144688; Mon, 26 Nov 2018 01:39:04 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:b403:: with SMTP id d3-v6ls4553385wmf.4.gmail; Mon, 26 Nov 2018 01:39:04 -0800 (PST) X-Google-Smtp-Source: AJdET5ciW1+fGP2NSb+m3IESCwpoRhj4SKgfH9gUnzA015+oCrbBGJwtoyvTJA5HzIyiK+70DRy0 X-Received: by 2002:a1c:8b8e:: with SMTP id n136-v6mr3231090wmd.18.1543225144207; Mon, 26 Nov 2018 01:39:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543225144; cv=none; d=google.com; s=arc-20160816; b=HcCCxv5c66KJGmYNkHaB3ry+e9XmCFEIhk0F7nXGvlF0ZbaQ9pbOPo+E8Q/MK9IlAW fwBIIFhe+XJ8c+ZwnMSsBbgacHcfodf6kuEcd/k21BacJMHuXda6o5VALeYRkJQdQdCl sLhEX4fRoc90d5IBFk8NhQkeixu0WS4N7QrRICjTJGXm40hGbgdrs70bOSDwm83C0wXG 6IoKhyOtfqc+m1Lhc6iViV6PWehuy3WbjVW8+qnnQyuVIn7iaUJSSV+ESNOG5vs/AaBA DEq5tgqvVTXV40fclzL/lsjP89mwttNEJo+rBaSXcm5P2tq2l5sDGP9eK2nDc5zQQp78 JECw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:references:in-reply-to:message-id:date :subject:cc:to:from; bh=eVGhLc6JDPtUoBOr21xJF0LQt3HGpyu+2QoFeJvI2sE=; b=AM/34Z7no4jgk9pshYoQ6mq//yJLaIZwNf1U+/JkLLxq8dezHqI5rAOE+ciHEAIJN/ WcdLkQ+H/rZX2qTatXP5DBrX1Fk/fsdX3shlx3IPf+6vqVQGgT6cTTCHCoaQuoAM5jjd n+9GDyEbFvUk5giXIH4+UeDa/UOa6sOZEZpctmUs1VnokZrWtCZ01gZgLUPnnK+mQmaA W++opccy6AGx0OKfEC5yKOoDF3N2g7sPFpV7ufLH7/2IGzgCREPZikXogqMgtGKDQ0yx 6dkNltrNgjbXBVoBZX9ZrZFmS/r9Ouhl2OW8BMYUMPnsZg4I4c007wIQKPmkqvwxky98 Lbvg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Return-Path: Received: from gecko.sbs.de (gecko.sbs.de. [194.138.37.40]) by gmr-mx.google.com with ESMTPS id k140si3975wmd.2.2018.11.26.01.39.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Nov 2018 01:39:04 -0800 (PST) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.40 as permitted sender) client-ip=194.138.37.40; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id wAQ9d3dX015424 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 26 Nov 2018 10:39:03 +0100 Received: from md1f2u6c.ad001.siemens.net ([139.23.79.230]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id wAQ9d2v1012310; Mon, 26 Nov 2018 10:39:03 +0100 From: Jan Kiszka To: isar-users Cc: Henning Schild Subject: [PATCH 7/7] meta: Fold wks-file class into wic-img Date: Mon, 26 Nov 2018 10:39:02 +0100 Message-Id: X-Mailer: git-send-email 2.16.4 In-Reply-To: References: In-Reply-To: References: X-TUID: RhBzMQ3rbeBp From: Jan Kiszka There is no longer a valid use case for obtaining a wks file outside of the wic-img class. Signed-off-by: Jan Kiszka --- meta/classes/wic-img.bbclass | 26 ++++++++++++++++++++++---- meta/classes/wks-file.bbclass | 30 ------------------------------ 2 files changed, 22 insertions(+), 34 deletions(-) delete mode 100644 meta/classes/wks-file.bbclass diff --git a/meta/classes/wic-img.bbclass b/meta/classes/wic-img.bbclass index e7527c8..225463e 100644 --- a/meta/classes/wic-img.bbclass +++ b/meta/classes/wic-img.bbclass @@ -5,14 +5,32 @@ # python () { - if not d.getVar('WKS_FILE', True): + wks_full_path = None + + wks_file = d.getVar('WKS_FILE', True) + if not wks_file: bb.fatal("WKS_FILE must be set") + if not wks_file.endswith('.wks'): + wks_file += '.wks' + + if os.path.isabs(wks_file): + if os.path.exists(wks_file): + wks_full_path = wks_file + else: + bbpaths = d.getVar('BBPATH', True).split(':') + corebase = d.getVar('COREBASE', True) + search_path = ':'.join('%s/wic' % p for p in bbpaths) + ':' + \ + ':'.join('%s/scripts/lib/wic/canned-wks' % l \ + for l in (bbpaths + [corebase])) + wks_full_path = bb.utils.which(search_path, wks_file) + + if not wks_full_path: + bb.fatal("WKS_FILE '%s' not found" % wks_file) + + d.setVar('WKS_FULL_PATH', wks_full_path) } inherit buildchroot -inherit wks-file - -WKS_FULL_PATH = "${@get_wks_full_path(d)}" # wic comes with reasonable defaults, and the proper interface is the wks file ROOTFS_EXTRA ?= "0" diff --git a/meta/classes/wks-file.bbclass b/meta/classes/wks-file.bbclass deleted file mode 100644 index 493fea7..0000000 --- a/meta/classes/wks-file.bbclass +++ /dev/null @@ -1,30 +0,0 @@ -# This software is a part of ISAR. -# Copyright (C) 2018 Siemens AG -# -# SPDX-License-Identifier: MIT - -def get_wks_full_path(d): - if (d.getVar('IMAGE_TYPE', True) or '') != 'wic-img': - return "" - - wks_full_path = None - - wks_file = d.getVar('WKS_FILE', True) - if not wks_file.endswith('.wks'): - wks_file += '.wks' - - if os.path.isabs(wks_file): - if os.path.exists(wks_file): - wks_full_path = wks_file - else: - bbpaths = d.getVar('BBPATH', True).split(':') - corebase = d.getVar('COREBASE', True) - search_path = ':'.join('%s/wic' % p for p in bbpaths) + ':' + \ - ':'.join('%s/scripts/lib/wic/canned-wks' % l \ - for l in (bbpaths + [corebase])) - wks_full_path = bb.utils.which(search_path, wks_file) - - if not wks_full_path: - bb.fatal("WKS_FILE '%s' not found" % wks_file) - - return wks_full_path -- 2.16.4