wic: bootimg: Add support to install directories
PATCH v2 1/1 wic: bootimg: Add support to install directories
IMAGE_BOOTFILES can contains directories to install in boot partition for e.g. below declaration allows to install files into boot dir as per example given in yocto documentation [1].
$ IMAGE_BOOT_FILES = "bcm2835-bootfiles/*;boot/
So to install directories in target boot parition of wic image, use -t option of install command so that if there are any directories present in IMAGE_BOOT_FILES macro they get created in target area and respective files get installed in created directory in target area.
This also fixes below error, which was faced while trying to install logos directory inside the boot partition :
$ "install -m 0644 -D <src_path>/deploy/images/am62xx-evm/ti.gz <dst_path>/1.0-r0/tmp-wic/hdd/boot/logos/ returned '1' instead of 0 | output: install: target '<dst_path>/1.0-r0/tmp-wic/hdd/boot/logos/' is not a directory: No such file or directory"
Link:
[1] https://docs.yoctoproject.org/ref-manual/variables.html?highlight=image_boot_files
---
V2: s/Logs/Link (in commit message)
--- scripts/lib/wic/plugins/source/bootimg-efi.py | 4 ++-- scripts/lib/wic/plugins/source/bootimg-partition.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
scripts/lib/wic/plugins/source/bootimg-efi.py +2 -2
@@ -341,13 +341,13 @@ class BootimgEFIPlugin(SourcePlugin): objcopy_cmd += " %s %s/EFI/Linux/linux.efi" % (efi_stub, hdddir) exec_native_cmd(objcopy_cmd, native_sysroot) else: - install_cmd = "install -m 0644 %s/%s %s/%s" % \ + install_cmd = "install -m 0644 -D %s/%s -t %s/%s" % \ (staging_kernel_dir, kernel, hdddir, kernel) exec_cmd(install_cmd) if get_bitbake_var("IMAGE_EFI_BOOT_FILES"): for src_path, dst_path in cls.install_task: - install_cmd = "install -m 0644 -D %s %s" \ + install_cmd = "install -m 0644 -D %s -t %s" \ % (os.path.join(kernel_dir, src_path), os.path.join(hdddir, dst_path)) exec_cmd(install_cmd)
scripts/lib/wic/plugins/source/bootimg-partition.py +1 -1
@@ -184,7 +184,7 @@ class BootimgPartitionPlugin(SourcePlugin): for task in cls.install_task: src_path, dst_path = task logger.debug('Install %s as %s', src_path, dst_path) - install_cmd = "install -m 0644 -D %s %s" \ + install_cmd = "install -m 0644 -D %s -t %s" \ % (os.path.join(kernel_dir, src_path), os.path.join(hdddir, dst_path)) exec_cmd(install_cmd)
Signature · 1 line
2.34.1
Hello,
This breaks x86:
https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/5277/steps/14/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#/builders/79/builds/5328/steps/14/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/5320/steps/14/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/5355/steps/14/logs/stdio
Quoted 76 lines · Devarsh Thakkar via lists.openembedded.org
IMAGE_BOOTFILEScan contains directories to install in boot partition for e.g. below declaration allows to install files into boot dir as per example given in yocto documentation [1].$ IMAGE_BOOT_FILES = "bcm2835-bootfiles/*;boot/So to install directories in target boot parition of wic image, use
-toption of install command so that if there are any directories present inIMAGE_BOOT_FILESmacro they get created in target area and respective files get installed in created directory in target area.This also fixes below error, which was faced while trying to install logos directory inside the boot partition :
$ "install -m 0644 -D <src_path>/deploy/images/am62xx-evm/ti.gz <dst_path>/1.0-r0/tmp-wic/hdd/boot/logos/ returned '1' instead of 0 | output: install: target '<dst_path>/1.0-r0/tmp-wic/hdd/boot/logos/' is not a directory: No such file or directory"Link:
[1] https://docs.yoctoproject.org/ref-manual/variables.html?highlight=image_boot_filesSigned-off-by Devarsh Thakkar <[email protected]>---
V2: s/Logs/Link (in commit message)--- scripts/lib/wic/plugins/source/bootimg-efi.py | 4 ++-- scripts/lib/wic/plugins/source/bootimg-partition.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)scripts/lib/wic/plugins/source/bootimg-efi.py +2
-2@@ -341,13 +341,13 @@ class BootimgEFIPlugin(SourcePlugin): objcopy_cmd += " %s %s/EFI/Linux/linux.efi" % (efi_stub, hdddir) exec_native_cmd(objcopy_cmd, native_sysroot) else: - install_cmd = "install -m 0644 %s/%s %s/%s" % \ + install_cmd = "install -m 0644 -D %s/%s -t %s/%s" % \ (staging_kernel_dir, kernel, hdddir, kernel) exec_cmd(install_cmd) if get_bitbake_var("IMAGE_EFI_BOOT_FILES"): for src_path, dst_path in cls.install_task: - install_cmd = "install -m 0644 -D %s %s" \ + install_cmd = "install -m 0644 -D %s -t %s" \ % (os.path.join(kernel_dir, src_path), os.path.join(hdddir, dst_path)) exec_cmd(install_cmd)scripts/lib/wic/plugins/source/bootimg-partition.py +1
-1@@ -184,7 +184,7 @@ class BootimgPartitionPlugin(SourcePlugin): for task in cls.install_task: src_path, dst_path = task logger.debug('Install %s as %s', src_path, dst_path) - install_cmd = "install -m 0644 -D %s %s" \ + install_cmd = "install -m 0644 -D %s -t %s" \ % (os.path.join(kernel_dir, src_path), os.path.join(hdddir, dst_path)) exec_cmd(install_cmd)Signature · 11 lines
2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#182701): https://lists.openembedded.org/g/openembedded-core/message/182701 Mute This Topic: https://lists.openembedded.org/mt/99501427/3617179 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com