All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] license_image: Don't try to hard link license files
@ 2019-05-02 21:30 paul
  2019-05-02 21:30 ` [PATCH 1/1] " paul
  0 siblings, 1 reply; 4+ messages in thread
From: paul @ 2019-05-02 21:30 UTC (permalink / raw)
  To: openembedded-core

From: Paul Barker <paul@betafive.co.uk>

Stumbled across a build failure when setting up my new build machine with
DEPLOY_DIR set to a location outside TMPDIR on a separate drive. This only
occurs if COPY_LIC_MANIFEST is also set but it's definitely worth fixing.

This applies cleanly to both master and warrior. The backport to thud should be
fairly obvious but let me know if it's worth me submitting a separate patch
against that branch.

Paul Barker (1):
  license_image: Don't try to hard link license files

 meta/classes/license_image.bbclass | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

-- 
2.17.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/1] license_image: Don't try to hard link license files
  2019-05-02 21:30 [PATCH 0/1] license_image: Don't try to hard link license files paul
@ 2019-05-02 21:30 ` paul
  2019-05-03  5:05   ` Richard Purdie
  0 siblings, 1 reply; 4+ messages in thread
From: paul @ 2019-05-02 21:30 UTC (permalink / raw)
  To: openembedded-core

From: Paul Barker <paul@betafive.co.uk>

This change allows us to support the placement of WORKDIR and DEPLOY_DIR
on different devices. As the license files are typically small, the
increase in disk usage and build time should be negligible.

Signed-off-by: Paul Barker <paul@betafive.co.uk>
---
 meta/classes/license_image.bbclass | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/meta/classes/license_image.bbclass b/meta/classes/license_image.bbclass
index 67500386bf..655b56347f 100644
--- a/meta/classes/license_image.bbclass
+++ b/meta/classes/license_image.bbclass
@@ -37,6 +37,7 @@ python license_create_manifest() {
 
 def write_license_files(d, license_manifest, pkg_dic, rootfs=True):
     import re
+    import shutil
     import stat
 
     bad_licenses = (d.getVar("INCOMPATIBLE_LICENSE") or "").split()
@@ -102,7 +103,7 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True):
         rootfs_license_manifest = os.path.join(rootfs_license_dir,
                 os.path.split(license_manifest)[1])
         if not os.path.exists(rootfs_license_manifest):
-            os.link(license_manifest, rootfs_license_manifest)
+            shutil.copy(license_manifest, rootfs_license_manifest)
 
         if copy_lic_dirs == "1":
             for pkg in sorted(pkg_dic):
@@ -136,7 +137,7 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True):
                             continue
 
                         if not os.path.exists(rootfs_license):
-                            os.link(pkg_license, rootfs_license)
+                            shutil.copy(pkg_license, rootfs_license)
 
                         if not os.path.exists(pkg_rootfs_license):
                             os.symlink(os.path.join('..', lic), pkg_rootfs_license)
@@ -146,7 +147,7 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True):
                                 os.path.exists(pkg_rootfs_license)):
                             continue
 
-                        os.link(pkg_license, pkg_rootfs_license)
+                        shutil.copy(pkg_license, pkg_rootfs_license)
             # Fixup file ownership and permissions
             for walkroot, dirs, files in os.walk(rootfs_license_dir):
                 for f in files:
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] license_image: Don't try to hard link license files
  2019-05-02 21:30 ` [PATCH 1/1] " paul
@ 2019-05-03  5:05   ` Richard Purdie
  2019-05-03  7:05     ` Paul Barker
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2019-05-03  5:05 UTC (permalink / raw)
  To: paul, openembedded-core

On Thu, 2019-05-02 at 21:30 +0000, paul@betafive.co.uk wrote:
> From: Paul Barker <paul@betafive.co.uk>
> 
> This change allows us to support the placement of WORKDIR and
> DEPLOY_DIR
> on different devices. As the license files are typically small, the
> increase in disk usage and build time should be negligible.
> 
> Signed-off-by: Paul Barker <paul@betafive.co.uk>
> ---
>  meta/classes/license_image.bbclass | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)

We create a lot of hardlinks and its not negligible overall ;-).

I'd prefer we continue to do so where we can. We should probably create
a function similar to lib.oe.path.copyhardlinktree() and use that here
rather than abandon the hardlinks.

Cheers,

Richard





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] license_image: Don't try to hard link license files
  2019-05-03  5:05   ` Richard Purdie
@ 2019-05-03  7:05     ` Paul Barker
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Barker @ 2019-05-03  7:05 UTC (permalink / raw)
  To: Richard Purdie, openembedded-core

On 03/05/2019 06:05, Richard Purdie wrote:
> On Thu, 2019-05-02 at 21:30 +0000, paul@betafive.co.uk wrote:
>> From: Paul Barker <paul@betafive.co.uk>
>>
>> This change allows us to support the placement of WORKDIR and
>> DEPLOY_DIR
>> on different devices. As the license files are typically small, the
>> increase in disk usage and build time should be negligible.
>>
>> Signed-off-by: Paul Barker <paul@betafive.co.uk>
>> ---
>>   meta/classes/license_image.bbclass | 7 ++++---
>>   1 file changed, 4 insertions(+), 3 deletions(-)
> 
> We create a lot of hardlinks and its not negligible overall ;-).
> 
> I'd prefer we continue to do so where we can. We should probably create
> a function similar to lib.oe.path.copyhardlinktree() and use that here
> rather than abandon the hardlinks.
> 

Ok, I'll throw together a copyhardlink() helper and send a v2 of this patch.

Thanks,

-- 
Paul Barker
Managing Director & Principal Engineer
Beta Five Ltd


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-05-03  7:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-02 21:30 [PATCH 0/1] license_image: Don't try to hard link license files paul
2019-05-02 21:30 ` [PATCH 1/1] " paul
2019-05-03  5:05   ` Richard Purdie
2019-05-03  7:05     ` Paul Barker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.