"""
bitbake_env_lines = get_bitbake_env_lines()
- rootfs_dir = kernel_dir = hdddir = staging_data_dir = native_sysroot = ""
+ rootfs_dir = kernel_dir = bootimg_dir = native_sysroot = ""
for line in bitbake_env_lines.split('\n'):
if (get_line_val(line, "IMAGE_ROOTFS")):
if (get_line_val(line, "STAGING_KERNEL_DIR")):
kernel_dir = get_line_val(line, "STAGING_KERNEL_DIR")
continue
- if (get_line_val(line, "HDDDIR")):
- hdddir = get_line_val(line, "HDDDIR")
- continue
- if (get_line_val(line, "STAGING_DATADIR")):
- staging_data_dir = get_line_val(line, "STAGING_DATADIR")
- continue
if (get_line_val(line, "STAGING_DIR_NATIVE")):
native_sysroot = get_line_val(line, "STAGING_DIR_NATIVE")
continue
- return (rootfs_dir, kernel_dir, hdddir, staging_data_dir, native_sysroot)
+ return (rootfs_dir, kernel_dir, bootimg_dir, native_sysroot)
CANNED_IMAGE_DIR = "lib/image/canned-wks" # relative to scripts
def wic_create(args, wks_file, rootfs_dir, bootimg_dir, kernel_dir,
- native_sysroot, hdddir, staging_data_dir, scripts_path,
- image_output_dir, debug, properties_file, properties=None):
- """
- Create image
+ native_sysroot, scripts_path, image_output_dir, debug,
+ properties_file, properties=None):
+ """Create image
wks_file - user-defined OE kickstart file
rootfs_dir - absolute path to the build's /rootfs dir
bootimg_dir - absolute path to the build's boot artifacts directory
kernel_dir - absolute path to the build's kernel directory
native_sysroot - absolute path to the build's native sysroots dir
- hdddir - absolute path to the build's HDDDIR dir
- staging_data_dir - absolute path to the build's STAGING_DATA_DIR dir
scripts_path - absolute path to /scripts dir
image_output_dir - dirname to create for image
properties_file - use values from this file if nonempty i.e no prompting
rootfs_dir: IMAGE_ROOTFS
kernel_dir: STAGING_KERNEL_DIR
native_sysroot: STAGING_DIR_NATIVE
- hdddir: HDDDIR
- staging_data_dir: STAGING_DATA_DIR
- In the above case, bootimg_dir remains unset and the image
- creation code determines which of the passed-in directories to
- use.
+ In the above case, bootimg_dir remains unset and the
+ plugin-specific image creation code is responsible for finding the
+ bootimg artifacts.
In the case where the values are passed in explicitly i.e 'wic -e'
is not used but rather the individual 'wic' options are used to
- explicitly specify these values, hdddir and staging_data_dir will
- be unset, but bootimg_dir must be explicit i.e. explicitly set to
- either hdddir or staging_data_dir, depending on the image being
- generated. The other values (rootfs_dir, kernel_dir, and
- native_sysroot) correspond to the same values found above via
- 'bitbake -e').
-
+ explicitly specify these values.
"""
try:
oe_builddir = os.environ["BUILDDIR"]
direct_args.insert(0, bootimg_dir)
direct_args.insert(0, kernel_dir)
direct_args.insert(0, native_sysroot)
- direct_args.insert(0, hdddir)
- direct_args.insert(0, staging_data_dir)
direct_args.insert(0, "direct")
if debug:
-r: IMAGE_ROOTFS
-k: STAGING_KERNEL_DIR
-n: STAGING_DIR_NATIVE
- -b: HDDDIR and STAGING_DATA_DIR (handlers decide which to use)
+ -b: empty (plugin-specific handlers must determine this)
If 'wic -e' is not used, the user needs to select the appropriate
value for -b (as well as -r, -k, and -n).
"""
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.
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
"""
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)
bootimg_dir,
kernel_dir,
native_sysroot,
- hdddir,
- staging_data_dir,
creatoropts)
try:
cr.set_bootimg_dir(bootimg_dir)
staging_kernel_dir = kernel_dir
- staging_data_dir = bootimg_dir
hdddir = "%s/hdd/boot" % cr_workdir
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'])
cr.set_bootimg_dir(bootimg_dir)
staging_kernel_dir = kernel_dir
- staging_data_dir = bootimg_dir
hdddir = "%s/hdd/boot" % cr_workdir
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
sys.exit(1)
set_bitbake_env_lines(bitbake_env_lines)
- bootimg_dir = staging_data_dir = hdddir = ""
+ bootimg_dir = ""
if options.image_name:
- (rootfs_dir, kernel_dir, hdddir, staging_data_dir, native_sysroot) = \
- find_artifacts(options.image_name)
+ (rootfs_dir, kernel_dir, bootimg_dir, native_sysroot) \
+ = find_artifacts(options.image_name)
wks_file = args[0]
not_found = not_found_dir = ""
if not os.path.isdir(rootfs_dir):
(not_found, not_found_dir) = ("rootfs-dir", rootfs_dir)
- elif not os.path.isdir(hdddir) and not os.path.isdir(staging_data_dir):
- (not_found, not_found_dir) = ("bootimg-dir", bootimg_dir)
elif not os.path.isdir(kernel_dir):
(not_found, not_found_dir) = ("kernel-dir", kernel_dir)
elif not os.path.isdir(native_sysroot):
rootfs_dir = rootfs_dir_to_args(krootfs_dir)
wic_create(args, wks_file, rootfs_dir, bootimg_dir, kernel_dir,
- native_sysroot, hdddir, staging_data_dir, scripts_path,
- image_output_dir, options.debug, options.properties_file)
+ native_sysroot, scripts_path, image_output_dir,
+ options.debug, options.properties_file)
def wic_list_subcommand(args, usage_str):