[OE-core] [PATCH v5 09/12] runqemu: also accept -image suffix for rootfs parameter
Bystricky, Juro
juro.bystricky at intel.com
Fri Jan 27 16:54:32 UTC 2017
Just curious: is this test for "image" in file name really necessary?
With qemuboot.conf the relevant files are already spelled out.
I don't see a need to force "compulsory" names for images.
If I comment out this test, everything works just fine. Am I missing something?
Juro
________________________________________
From: openembedded-core-bounces at lists.openembedded.org [openembedded-core-bounces at lists.openembedded.org] on behalf of Patrick Ohly [patrick.ohly at intel.com]
Sent: Friday, January 27, 2017 7:30 AM
To: openembedded-core at lists.openembedded.org
Subject: [OE-core] [PATCH v5 09/12] runqemu: also accept -image suffix for rootfs parameter
The magic detection of the rootfs parameter only worked for image
recipes which embedd the "image" string in the middle, as in
"core-image-minimal".
Sometimes it is more natural to call an image "something-image". To
get such an image detected by runqemu, "-image" at the end of a
parameter must also cause that parameter to be treated as the rootfs
parameter.
Inside the image directory, "something-image" has an -<arch> suffix
and thus no change is needed for those usages of
re.search('-image-'). However, while at it also enhance those string
searches a bit (no need for re; any()+map() a bit closer to the
intended logic).
Signed-off-by: Patrick Ohly <patrick.ohly at intel.com>
---
scripts/runqemu | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/runqemu b/scripts/runqemu
index 17d79e9..4d7168c 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -218,7 +218,7 @@ class BaseConfig(object):
if not re.search('.qemuboot.conf$', '\n'.join(os.listdir(p)), re.M):
logger.info("Can't find required *.qemuboot.conf in %s" % p)
return False
- if not re.search('-image-', '\n'.join(os.listdir(p))):
+ if not any(map(lambda name: '-image-' in name, os.listdir(p))):
logger.info("Can't find *-image-* in %s" % p)
return False
return True
@@ -267,7 +267,7 @@ class BaseConfig(object):
re.search('zImage', p) or re.search('vmlinux', p) or \
re.search('fitImage', p) or re.search('uImage', p):
self.kernel = p
- elif os.path.exists(p) and (not os.path.isdir(p)) and re.search('-image-', os.path.basename(p)):
+ elif os.path.exists(p) and (not os.path.isdir(p)) and '-image-' in os.path.basename(p):
self.rootfs = p
# Check filename against self.fstypes can hanlde <file>.cpio.gz,
# otherwise, its type would be "gz", which is incorrect.
@@ -381,7 +381,7 @@ class BaseConfig(object):
self.kernel_cmdline_script += ' %s' % arg[len('bootparams='):]
elif os.path.exists(arg) or (re.search(':', arg) and re.search('/', arg)):
self.check_arg_path(os.path.abspath(arg))
- elif re.search('-image-', arg):
+ elif re.search(r'-image-|-image$', arg):
# Lazy rootfs
self.rootfs = arg
else:
--
git-series 0.9.1
--
_______________________________________________
Openembedded-core mailing list
Openembedded-core at lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
More information about the Openembedded-core
mailing list