summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scripts/lib/wic/plugins/source/bootimg-partition.py22
1 files 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 2e9b9f5ed6..ddc880be36 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):
130 130
131 if not custom_cfg: 131 if not custom_cfg:
132 # The kernel types supported by the sysboot of u-boot 132 # The kernel types supported by the sysboot of u-boot
133 kernel_types = ["uImage", "zImage", "Image", "vmlinux", "fitImage"] 133 kernel_types = ["zImage", "Image", "fitImage", "uImage", "vmlinux"]
134 has_dtb = False 134 has_dtb = False
135 fdt_dir = '/' 135 fdt_dir = '/'
136 kernel_name = None 136 kernel_name = None
137 for task in cls.install_task: 137
138 src, dst = task 138 # Find the kernel image name, from the highest precedence to lowest
139 # Find the kernel image name 139 for image in kernel_types:
140 for image in kernel_types: 140 for task in cls.install_task:
141 src, dst = task
141 if re.match(image, src): 142 if re.match(image, src):
142 if not kernel_name: 143 kernel_name = os.path.join('/', dst)
143 kernel_name = os.path.join('/', dst) 144 break
144 else: 145 if kernel_name:
145 raise WicError('Multi kernel file founded') 146 break
146 147
148 for task in cls.install_task:
149 src, dst = task
147 # We suppose that all the dtb are in the same directory 150 # We suppose that all the dtb are in the same directory
148 if re.search(r'\.dtb', src) and fdt_dir == '/': 151 if re.search(r'\.dtb', src) and fdt_dir == '/':
149 has_dtb = True 152 has_dtb = True
150 fdt_dir = os.path.join(fdt_dir, os.path.dirname(dst)) 153 fdt_dir = os.path.join(fdt_dir, os.path.dirname(dst))
154 break
151 155
152 if not kernel_name: 156 if not kernel_name:
153 raise WicError('No kernel file founded') 157 raise WicError('No kernel file founded')