summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/plugins
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2017-03-22 15:42:27 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-23 13:19:49 +0000
commit627952a234a844783a6d4ee9aa3f1608a0d537d0 (patch)
tree7ed2dc78e88d8df1ea591287f2ff239bb9354f6d /scripts/lib/wic/plugins
parentce627abf86e31486070c1b24de92c30ce47bf0b8 (diff)
downloadpoky-627952a234a844783a6d4ee9aa3f1608a0d537d0.tar.gz
wic: use kernel_dir instead of bootimg_dir
bootimg_dir is usually set to the value of STAGING_DATADIR and kernel_dir - to the value of DEPLOY_DIR_IMAGE, so usage of kernel_dir is more logical in bootimg-efi, bootimg-partition and rawcopy plugins. Replaced usage of bootimg_dir to kernel_dir in 3 above mentioned plugins that use DEPLOY_DIR_IMAGE as a default artifact location. (From OE-Core rev: 48a5d67d7cafdeac821e6f35bea380521ef017d5) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic/plugins')
-rw-r--r--scripts/lib/wic/plugins/source/bootimg-efi.py14
-rw-r--r--scripts/lib/wic/plugins/source/bootimg-partition.py12
-rw-r--r--scripts/lib/wic/plugins/source/rawcopy.py10
3 files changed, 18 insertions, 18 deletions
diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py
index 2d1c4d4089..ff76c2f16a 100644
--- a/scripts/lib/wic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/wic/plugins/source/bootimg-efi.py
@@ -185,9 +185,9 @@ class BootimgEFIPlugin(SourcePlugin):
185 'prepares' the partition to be incorporated into the image. 185 'prepares' the partition to be incorporated into the image.
186 In this case, prepare content for an EFI (grub) boot partition. 186 In this case, prepare content for an EFI (grub) boot partition.
187 """ 187 """
188 if not bootimg_dir: 188 if not kernel_dir:
189 bootimg_dir = get_bitbake_var("DEPLOY_DIR_IMAGE") 189 kernel_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
190 if not bootimg_dir: 190 if not kernel_dir:
191 raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting") 191 raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting")
192 192
193 staging_kernel_dir = kernel_dir 193 staging_kernel_dir = kernel_dir
@@ -203,14 +203,14 @@ class BootimgEFIPlugin(SourcePlugin):
203 if source_params['loader'] == 'grub-efi': 203 if source_params['loader'] == 'grub-efi':
204 shutil.copyfile("%s/hdd/boot/EFI/BOOT/grub.cfg" % cr_workdir, 204 shutil.copyfile("%s/hdd/boot/EFI/BOOT/grub.cfg" % cr_workdir,
205 "%s/grub.cfg" % cr_workdir) 205 "%s/grub.cfg" % cr_workdir)
206 for mod in [x for x in os.listdir(bootimg_dir) if x.startswith("grub-efi-")]: 206 for mod in [x for x in os.listdir(kernel_dir) if x.startswith("grub-efi-")]:
207 cp_cmd = "cp %s/%s %s/EFI/BOOT/%s" % (bootimg_dir, mod, hdddir, mod[9:]) 207 cp_cmd = "cp %s/%s %s/EFI/BOOT/%s" % (kernel_dir, mod, hdddir, mod[9:])
208 exec_cmd(cp_cmd, True) 208 exec_cmd(cp_cmd, True)
209 shutil.move("%s/grub.cfg" % cr_workdir, 209 shutil.move("%s/grub.cfg" % cr_workdir,
210 "%s/hdd/boot/EFI/BOOT/grub.cfg" % cr_workdir) 210 "%s/hdd/boot/EFI/BOOT/grub.cfg" % cr_workdir)
211 elif source_params['loader'] == 'systemd-boot': 211 elif source_params['loader'] == 'systemd-boot':
212 for mod in [x for x in os.listdir(bootimg_dir) if x.startswith("systemd-")]: 212 for mod in [x for x in os.listdir(bootimg_dir) if x.startswith("systemd-")]:
213 cp_cmd = "cp %s/%s %s/EFI/BOOT/%s" % (bootimg_dir, mod, hdddir, mod[8:]) 213 cp_cmd = "cp %s/%s %s/EFI/BOOT/%s" % (kernel_dir, mod, hdddir, mod[8:])
214 exec_cmd(cp_cmd, True) 214 exec_cmd(cp_cmd, True)
215 else: 215 else:
216 raise WicError("unrecognized bootimg-efi loader: %s" % 216 raise WicError("unrecognized bootimg-efi loader: %s" %
@@ -218,7 +218,7 @@ class BootimgEFIPlugin(SourcePlugin):
218 except KeyError: 218 except KeyError:
219 raise WicError("bootimg-efi requires a loader, none specified") 219 raise WicError("bootimg-efi requires a loader, none specified")
220 220
221 startup = os.path.join(bootimg_dir, "startup.nsh") 221 startup = os.path.join(kernel_dir, "startup.nsh")
222 if os.path.exists(startup): 222 if os.path.exists(startup):
223 cp_cmd = "cp %s %s/" % (startup, hdddir) 223 cp_cmd = "cp %s %s/" % (startup, hdddir)
224 exec_cmd(cp_cmd, True) 224 exec_cmd(cp_cmd, True)
diff --git a/scripts/lib/wic/plugins/source/bootimg-partition.py b/scripts/lib/wic/plugins/source/bootimg-partition.py
index 373e8d8f75..4afc8a2a07 100644
--- a/scripts/lib/wic/plugins/source/bootimg-partition.py
+++ b/scripts/lib/wic/plugins/source/bootimg-partition.py
@@ -78,12 +78,12 @@ class BootimgPartitionPlugin(SourcePlugin):
78 install_cmd = "install -d %s" % hdddir 78 install_cmd = "install -d %s" % hdddir
79 exec_cmd(install_cmd) 79 exec_cmd(install_cmd)
80 80
81 if not bootimg_dir: 81 if not kernel_dir:
82 bootimg_dir = get_bitbake_var("DEPLOY_DIR_IMAGE") 82 kernel_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
83 if not bootimg_dir: 83 if not kernel_dir:
84 raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting") 84 raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting")
85 85
86 logger.debug('Bootimg dir: %s', bootimg_dir) 86 logger.debug('Kernel dir: %s', bootimg_dir)
87 87
88 boot_files = get_bitbake_var("IMAGE_BOOT_FILES") 88 boot_files = get_bitbake_var("IMAGE_BOOT_FILES")
89 89
@@ -118,7 +118,7 @@ class BootimgPartitionPlugin(SourcePlugin):
118 os.path.join(dst, 118 os.path.join(dst,
119 os.path.basename(name)) 119 os.path.basename(name))
120 120
121 srcs = glob(os.path.join(bootimg_dir, src)) 121 srcs = glob(os.path.join(kernel_dir, src))
122 122
123 logger.debug('Globbed sources: %s', ', '.join(srcs)) 123 logger.debug('Globbed sources: %s', ', '.join(srcs))
124 for entry in srcs: 124 for entry in srcs:
@@ -127,7 +127,7 @@ class BootimgPartitionPlugin(SourcePlugin):
127 os.path.join(hdddir, 127 os.path.join(hdddir,
128 entry_dst_name))) 128 entry_dst_name)))
129 else: 129 else:
130 install_task = [(os.path.join(bootimg_dir, src), 130 install_task = [(os.path.join(kernel_dir, src),
131 os.path.join(hdddir, dst))] 131 os.path.join(hdddir, dst))]
132 132
133 for task in install_task: 133 for task in install_task:
diff --git a/scripts/lib/wic/plugins/source/rawcopy.py b/scripts/lib/wic/plugins/source/rawcopy.py
index bc71cf6f76..431afce7c4 100644
--- a/scripts/lib/wic/plugins/source/rawcopy.py
+++ b/scripts/lib/wic/plugins/source/rawcopy.py
@@ -59,17 +59,17 @@ class RawCopyPlugin(SourcePlugin):
59 Called to do the actual content population for a partition i.e. it 59 Called to do the actual content population for a partition i.e. it
60 'prepares' the partition to be incorporated into the image. 60 'prepares' the partition to be incorporated into the image.
61 """ 61 """
62 if not bootimg_dir: 62 if not kernel_dir:
63 bootimg_dir = get_bitbake_var("DEPLOY_DIR_IMAGE") 63 kernel_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
64 if not bootimg_dir: 64 if not kernel_dir:
65 raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting") 65 raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting")
66 66
67 logger.debug('Bootimg dir: %s', bootimg_dir) 67 logger.debug('Kernel dir: %s', kernel_dir)
68 68
69 if 'file' not in source_params: 69 if 'file' not in source_params:
70 raise WicError("No file specified") 70 raise WicError("No file specified")
71 71
72 src = os.path.join(bootimg_dir, source_params['file']) 72 src = os.path.join(kernel_dir, source_params['file'])
73 dst = os.path.join(cr_workdir, "%s.%s" % (source_params['file'], part.lineno)) 73 dst = os.path.join(cr_workdir, "%s.%s" % (source_params['file'], part.lineno))
74 74
75 if 'skip' in source_params: 75 if 'skip' in source_params: