From: Andre McCurdy <armccurdy@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH] rootfs.py: support absolute paths in IMAGE_DEVICE_TABLES
Date: Mon, 12 Sep 2016 16:00:54 -0700 [thread overview]
Message-ID: <1473721254-9610-1-git-send-email-armccurdy@gmail.com> (raw)
Paths relative to BBPATH are fine if device table files are always
static and contained somewhere within a meta layer. However if device
tables are created dynamically, they will be located somewhere within
${TMPDIR} and most conveniently referenced via an absolute path.
The legacy IMAGE_DEVICE_TABLE variable supported an absolute path,
therefore make IMAGE_DEVICE_TABLES support absolute paths too, to
avoid users who need dynamic device table files being dependent on
the legacy variable.
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
---
meta/lib/oe/rootfs.py | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index a348b97..32cce64 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -352,8 +352,8 @@ class Rootfs(object, metaclass=ABCMeta):
"""
Create devfs:
* IMAGE_DEVICE_TABLE is the old name to an absolute path to a device table file
- * IMAGE_DEVICE_TABLES is a new name for a file, or list of files, seached
- for in the BBPATH
+ * IMAGE_DEVICE_TABLES is the new name for a file, or list of files, which may be
+ either absolute paths or paths relative to BBPATH.
If neither are specified then the default name of files/device_table-minimal.txt
is searched for in the BBPATH (same as the old version.)
"""
@@ -367,7 +367,10 @@ class Rootfs(object, metaclass=ABCMeta):
if devtables is None:
devtables = 'files/device_table-minimal.txt'
for devtable in devtables.split():
- devtable_list.append("%s" % bb.utils.which(self.d.getVar('BBPATH', True), devtable))
+ if os.path.isabs(devtable):
+ devtable_list.append(devtable)
+ else:
+ devtable_list.append("%s" % bb.utils.which(self.d.getVar('BBPATH', True), devtable))
for devtable in devtable_list:
self._exec_shell_cmd(["makedevs", "-r",
--
1.9.1
next reply other threads:[~2016-09-12 23:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-12 23:00 Andre McCurdy [this message]
2016-09-13 0:17 ` [PATCH] rootfs.py: support absolute paths in IMAGE_DEVICE_TABLES Mark Hatle
2016-09-13 3:20 ` Andre McCurdy
2016-09-13 14:02 ` Mark Hatle
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=1473721254-9610-1-git-send-email-armccurdy@gmail.com \
--to=armccurdy@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
/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