diff options
author | Tom Zanussi <tom.zanussi@linux.intel.com> | 2014-10-29 17:04:23 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-10-30 13:03:30 +0000 |
commit | 6ba3eb5ff7c47aee6b3419fb3a348a634fe74ac9 (patch) | |
tree | e40c0217810161b6d1af545c8ffc1ef79fdea9da /scripts/lib/wic | |
parent | db90f10bf31dec8d7d7bb2d3680d50e133662850 (diff) | |
download | openembedded-core-6ba3eb5ff7c47aee6b3419fb3a348a634fe74ac9.tar.gz openembedded-core-6ba3eb5ff7c47aee6b3419fb3a348a634fe74ac9.tar.bz2 openembedded-core-6ba3eb5ff7c47aee6b3419fb3a348a634fe74ac9.zip |
wic: Remove special-case bootimg_dir
The first iterations of wic very shortsightedly catered to two
specific use-cases and added special-purpose params for those cases so
that they could be directly given their corresponding boot artifacts.
(hdddir and staging_data_dir).
As more use-cases are added, it becomes rather obvious that such a
scheme doens't scale, and additionally causes confusion for plugin
writers.
This removes those special cases and states explicitly in the help
text that plugins are responsible for locating their own boot
artifacts.
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic')
-rw-r--r-- | scripts/lib/wic/imager/direct.py | 5 | ||||
-rw-r--r-- | scripts/lib/wic/plugins/imager/direct_plugin.py | 20 | ||||
-rw-r--r-- | scripts/lib/wic/plugins/source/bootimg-efi.py | 5 | ||||
-rw-r--r-- | scripts/lib/wic/plugins/source/bootimg-pcbios.py | 3 |
4 files changed, 12 insertions, 21 deletions
diff --git a/scripts/lib/wic/imager/direct.py b/scripts/lib/wic/imager/direct.py index 5b12856289..6b2ab3368e 100644 --- a/scripts/lib/wic/imager/direct.py +++ b/scripts/lib/wic/imager/direct.py @@ -52,8 +52,7 @@ class DirectImageCreator(BaseImageCreator): """ def __init__(self, oe_builddir, image_output_dir, rootfs_dir, bootimg_dir, - kernel_dir, native_sysroot, hdddir, staging_data_dir, - creatoropts=None): + kernel_dir, native_sysroot, creatoropts=None): """ Initialize a DirectImageCreator instance. @@ -74,8 +73,6 @@ class DirectImageCreator(BaseImageCreator): self.bootimg_dir = bootimg_dir self.kernel_dir = kernel_dir self.native_sysroot = native_sysroot - self.hdddir = hdddir - self.staging_data_dir = staging_data_dir def __write_fstab(self, image_rootfs): """overriden to generate fstab (temporarily) in rootfs. This is called diff --git a/scripts/lib/wic/plugins/imager/direct_plugin.py b/scripts/lib/wic/plugins/imager/direct_plugin.py index dabd6fc3e0..5601c3f1c9 100644 --- a/scripts/lib/wic/plugins/imager/direct_plugin.py +++ b/scripts/lib/wic/plugins/imager/direct_plugin.py @@ -58,21 +58,19 @@ class DirectPlugin(ImagerPlugin): """ Create direct image, called from creator as 'direct' cmd """ - if len(args) != 9: + if len(args) != 7: raise errors.Usage("Extra arguments given") - staging_data_dir = args[0] - hdddir = args[1] - native_sysroot = args[2] - kernel_dir = args[3] - bootimg_dir = args[4] - rootfs_dir = args[5] + native_sysroot = args[0] + kernel_dir = args[1] + bootimg_dir = args[2] + rootfs_dir = args[3] creatoropts = configmgr.create - ksconf = args[6] + ksconf = args[4] - image_output_dir = args[7] - oe_builddir = args[8] + image_output_dir = args[5] + oe_builddir = args[6] krootfs_dir = self.__rootfs_dir_to_dict(rootfs_dir) @@ -84,8 +82,6 @@ class DirectPlugin(ImagerPlugin): bootimg_dir, kernel_dir, native_sysroot, - hdddir, - staging_data_dir, creatoropts) try: diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py index 855bbc2ce2..e4067b6dbf 100644 --- a/scripts/lib/wic/plugins/source/bootimg-efi.py +++ b/scripts/lib/wic/plugins/source/bootimg-efi.py @@ -173,7 +173,6 @@ class BootimgEFIPlugin(SourcePlugin): cr.set_bootimg_dir(bootimg_dir) staging_kernel_dir = kernel_dir - staging_data_dir = bootimg_dir hdddir = "%s/hdd/boot" % cr_workdir @@ -185,12 +184,12 @@ class BootimgEFIPlugin(SourcePlugin): if source_params['loader'] == 'grub-efi': shutil.copyfile("%s/hdd/boot/EFI/BOOT/grub.cfg" % cr_workdir, "%s/grub.cfg" % cr_workdir) - cp_cmd = "cp %s/EFI/BOOT/* %s/EFI/BOOT" % (staging_data_dir, hdddir) + cp_cmd = "cp %s/EFI/BOOT/* %s/EFI/BOOT" % (bootimg_dir, hdddir) exec_cmd(cp_cmd, True) shutil.move("%s/grub.cfg" % cr_workdir, "%s/hdd/boot/EFI/BOOT/grub.cfg" % cr_workdir) elif source_params['loader'] == 'gummiboot': - cp_cmd = "cp %s/EFI/BOOT/* %s/EFI/BOOT" % (staging_data_dir, hdddir) + cp_cmd = "cp %s/EFI/BOOT/* %s/EFI/BOOT" % (bootimg_dir, hdddir) exec_cmd(cp_cmd, True) else: msger.error("unrecognized bootimg-efi loader: %s" % source_params['loader']) diff --git a/scripts/lib/wic/plugins/source/bootimg-pcbios.py b/scripts/lib/wic/plugins/source/bootimg-pcbios.py index 6057bab42d..8a1aca1ad1 100644 --- a/scripts/lib/wic/plugins/source/bootimg-pcbios.py +++ b/scripts/lib/wic/plugins/source/bootimg-pcbios.py @@ -144,7 +144,6 @@ class BootimgPcbiosPlugin(SourcePlugin): cr.set_bootimg_dir(bootimg_dir) staging_kernel_dir = kernel_dir - staging_data_dir = bootimg_dir hdddir = "%s/hdd/boot" % cr_workdir @@ -153,7 +152,7 @@ class BootimgPcbiosPlugin(SourcePlugin): exec_cmd(install_cmd) install_cmd = "install -m 444 %s/syslinux/ldlinux.sys %s/ldlinux.sys" \ - % (staging_data_dir, hdddir) + % (bootimg_dir, hdddir) exec_cmd(install_cmd) du_cmd = "du -bks %s" % hdddir |