public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Cc: Henning Schild <henning.schild@siemens.com>
Subject: [PATCH 7/7] meta: Fold wks-file class into wic-img
Date: Mon, 26 Nov 2018 10:39:02 +0100	[thread overview]
Message-ID: <bfd7b98f9e22957cf34f0e2782e49fd56ce79199.1543225142.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1543225142.git.jan.kiszka@siemens.com>
In-Reply-To: <cover.1543225142.git.jan.kiszka@siemens.com>

From: Jan Kiszka <jan.kiszka@siemens.com>

There is no longer a valid use case for obtaining a wks file outside of
the wic-img class.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 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


  parent reply	other threads:[~2018-11-26  9:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-26  9:38 [PATCH 0/7] u-boot-script rework, the Final One (tm) Jan Kiszka
2018-11-26  9:38 ` [PATCH 1/7] wic: Move isar plugins out of example layer to core Jan Kiszka
2018-11-26  9:38 ` [PATCH 2/7] wic: Remove obsolete reference to msger logger Jan Kiszka
2018-11-26  9:45   ` Henning Schild
2018-11-26  9:50     ` Jan Kiszka
2018-11-26 10:07       ` Henning Schild
2018-11-26 11:02         ` Jan Kiszka
2018-11-26  9:38 ` [PATCH 3/7] meta-isar: Factor out bananapi machine config Jan Kiszka
2018-11-26  9:38 ` [PATCH 4/7] wic: Add rootfs-u-boot Jan Kiszka
2018-11-26  9:39 ` [PATCH 5/7] meta-isar: Switch bananapi and de0-nano-soc to rootfs-u-boot Jan Kiszka
2018-11-26  9:39 ` [PATCH 6/7] u-boot-script: Make truly generic Jan Kiszka
2018-11-26  9:39 ` Jan Kiszka [this message]
2018-11-29 12:15 ` [PATCH 0/7] u-boot-script rework, the Final One (tm) Maxim Yu. Osipov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bfd7b98f9e22957cf34f0e2782e49fd56ce79199.1543225142.git.jan.kiszka@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox