[oe-commits] [openembedded-core] 02/12: wic: bootimg-partition: Select a preferred type if multi kernel images are installed
git at git.openembedded.org
git at git.openembedded.org
Mon Aug 20 17:06:49 UTC 2018
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit dd674aa88c1303e30db574a3a62d51e3d332bdc6
Author: Kevin Hao <kexin.hao at windriver.com>
AuthorDate: Mon Aug 20 18:42:25 2018 +0800
wic: bootimg-partition: Select a preferred type if multi kernel images are installed
Automatically select one kernel type image based on a predefined
precedence list if there are multi kernel images installed.
Signed-off-by: Kevin Hao <kexin.hao at windriver.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
.../lib/wic/plugins/source/bootimg-partition.py | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/scripts/lib/wic/plugins/source/bootimg-partition.py b/scripts/lib/wic/plugins/source/bootimg-partition.py
index 2e9b9f5..ddc880b 100644
--- a/scripts/lib/wic/plugins/source/bootimg-partition.py
+++ b/scripts/lib/wic/plugins/source/bootimg-partition.py
@@ -130,24 +130,28 @@ class BootimgPartitionPlugin(SourcePlugin):
if not custom_cfg:
# The kernel types supported by the sysboot of u-boot
- kernel_types = ["uImage", "zImage", "Image", "vmlinux", "fitImage"]
+ kernel_types = ["zImage", "Image", "fitImage", "uImage", "vmlinux"]
has_dtb = False
fdt_dir = '/'
kernel_name = None
- for task in cls.install_task:
- src, dst = task
- # Find the kernel image name
- for image in kernel_types:
+
+ # Find the kernel image name, from the highest precedence to lowest
+ for image in kernel_types:
+ for task in cls.install_task:
+ src, dst = task
if re.match(image, src):
- if not kernel_name:
- kernel_name = os.path.join('/', dst)
- else:
- raise WicError('Multi kernel file founded')
+ kernel_name = os.path.join('/', dst)
+ break
+ if kernel_name:
+ break
+ for task in cls.install_task:
+ src, dst = task
# We suppose that all the dtb are in the same directory
if re.search(r'\.dtb', src) and fdt_dir == '/':
has_dtb = True
fdt_dir = os.path.join(fdt_dir, os.path.dirname(dst))
+ break
if not kernel_name:
raise WicError('No kernel file founded')
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list