1
0
mirror of https://git.yoctoproject.org/poky synced 2026-07-26 19:17:07 +00:00

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.

(From OE-Core rev: 6ba3eb5ff7c47aee6b3419fb3a348a634fe74ac9)

(From OE-Core rev: e7ecb139a215484422652ef35de8282acbf18ed2)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Tom Zanussi
2014-11-26 08:22:08 -08:00
committed by Richard Purdie
parent 90a03e9c9d
commit db012b429f
7 changed files with 27 additions and 57 deletions
@@ -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:
@@ -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'])
@@ -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