diff options
| author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2017-03-22 15:42:27 +0200 | 
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-23 13:19:49 +0000 | 
| commit | 627952a234a844783a6d4ee9aa3f1608a0d537d0 (patch) | |
| tree | 7ed2dc78e88d8df1ea591287f2ff239bb9354f6d /scripts/lib/wic/plugins/source/bootimg-efi.py | |
| parent | ce627abf86e31486070c1b24de92c30ce47bf0b8 (diff) | |
| download | poky-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/source/bootimg-efi.py')
| -rw-r--r-- | scripts/lib/wic/plugins/source/bootimg-efi.py | 14 | 
1 files changed, 7 insertions, 7 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) | 
