Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Devarsh Thakkar <devarsht@ti.com>
To: <openembedded-core@lists.openembedded.org>,
	<richard.purdie@linuxfoundation.org>
Cc: <denys@konsulko.com>, <nm@ti.com>, <vigneshr@ti.com>,
	<a-bhatia1@ti.com>, <j-luthra@ti.com>, <khasim@ti.com>,
	<nsekhar@ti.com>, <afd@ti.com>, <rs@ti.com>, <devarsht@ti.com>,
	<n-jain1@ti.com>
Subject: [oe-core][PATCH v2] wic: bootimg: Add support to install directories
Date: Tue, 13 Jun 2023 14:40:11 +0530	[thread overview]
Message-ID: <20230613091011.3624628-1-devarsht@ti.com> (raw)

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

Signed-off-by: Devarsh Thakkar <devarsht@ti.com>
---
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(-)

diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py
index c28d3917c2..966606a39e 100644
--- a/scripts/lib/wic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/wic/plugins/source/bootimg-efi.py
@@ -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)
diff --git a/scripts/lib/wic/plugins/source/bootimg-partition.py b/scripts/lib/wic/plugins/source/bootimg-partition.py
index 5dbe2558d2..32cc5d38ab 100644
--- a/scripts/lib/wic/plugins/source/bootimg-partition.py
+++ b/scripts/lib/wic/plugins/source/bootimg-partition.py
@@ -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)
-- 
2.34.1



             reply	other threads:[~2023-06-13  9:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-13  9:10 Devarsh Thakkar [this message]
2023-06-14  8:05 ` [oe-core][PATCH v2] wic: bootimg: Add support to install directories Alexandre Belloni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230613091011.3624628-1-devarsht@ti.com \
    --to=devarsht@ti.com \
    --cc=a-bhatia1@ti.com \
    --cc=afd@ti.com \
    --cc=denys@konsulko.com \
    --cc=j-luthra@ti.com \
    --cc=khasim@ti.com \
    --cc=n-jain1@ti.com \
    --cc=nm@ti.com \
    --cc=nsekhar@ti.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    --cc=rs@ti.com \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox