Skip to content
Snippets Groups Projects
Verified Commit efcb0358 authored by Andrei Gherzan's avatar Andrei Gherzan :penguin:
Browse files

ohos-image.bbclass: Define dtb_boot_files and extlinux_boot_files


* dtb_boot_files - converts dtb entries from KERNEL_DEVICETREE (assumed
  in DEPLOY/kernel) into IMAGE_BOOT_FILES ones (assuming destination is
  the root of the filesystem)
* extlinux_boot_files - converts extlinux files (assumed in
  DEPLOY/bootloader/extlinux) to IMAGE_BOOT_FILES entries (assuming
  destination is relative to the deploy directory of the extlinux files)

Signed-off-by: Andrei Gherzan's avatarAndrei Gherzan <andrei.gherzan@huawei.com>
parent 4bc9d04b
No related branches found
No related tags found
No related merge requests found
......@@ -16,3 +16,25 @@ systemd_mask_getty () {
}
IMAGE_PREPROCESS_COMMAND_append = " ${@ 'systemd_mask_getty;' if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d) and not bb.utils.contains('IMAGE_FEATURES', 'stateless-rootfs', True, False, d) else ''}"
# Convert all KERNEL_DEVICETREE enties to IMAGE_BOOT_FILES entries
def dtb_boot_files(d):
k_dt = d.getVar('KERNEL_DEVICETREE')
if not k_dt:
return ''
return ' '.join(['kernel/{dtb};{dtb}'.format(dtb=dt) for dt in k_dt.split()])
# Convert all extlinux files to IMAGE_BOOT_FILES entries
def extlinux_boot_files(d):
import os
deploy_dir_image = d.getVar('DEPLOY_DIR_IMAGE')
deploy_extlinux_files = os.path.join(deploy_dir_image, 'bootloader/extlinux')
boot_files = []
for root, _, files in os.walk(deploy_extlinux_files):
for file in files:
src = os.path.relpath(os.path.join(root, file), deploy_dir_image)
dst = os.path.relpath(os.path.join(root, file), deploy_extlinux_files)
boot_files.append('{0};{1}'.format(src, dst))
if not boot_files:
return ''
return ' '.join(boot_files)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment