Skip to contentSkip to conversation

package.bbclass: Use hard link for packages split instead of copy

GIT PULL New Dongxiao Xu 1 participant 2 messages Dec 2, 2010

lore
Share & tools
lore
#0 lore raw

When doing package split, we use hard link instead of copy, which can save about 10% disk space when building poky-image-minimal.

Pull URL: git://git.pokylinux.org/poky-contrib.git
Branch: dxu4/perf
Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=dxu4/perf

Thanks,
Dongxiao Xu <[email protected]>
---

Dongxiao Xu (1):
package.bbclass: Use hard link for package split instead of copy

 meta/classes/package.bbclass |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
#1 lore raw

PATCH 1/1 package.bbclass: Use hard link for package split instead of copy

When doing package split, we use hard link instead of copy, which can save about 10% disk space when building poky-image-minimal.

---
 meta/classes/package.bbclass |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
meta/classes/package.bbclass +2 -2
index d39c694..2940eb9 100644
@@ -406,8 +406,8 @@ python populate_packages () {
 			fpath = os.path.join(root,file)
 			dpath = os.path.dirname(fpath)
 			bb.mkdirhier(dpath)
-			ret = bb.copyfile(file, fpath)
-			if ret is False or ret == 0:
+			ret = os.system("ln %s %s" % (file, fpath))
+			if ret is False:
 				raise bb.build.FuncFailed("File population failed")
 		del localdata
 	os.chdir(workdir)
Signature · 1 line
1.6.3.3