]> code.ossystems Code Review - openembedded-core.git/commitdiff
gzip/pigz-native: Install into a prefix to avoid clashing with system binaries
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 21 Mar 2012 11:26:09 +0000 (11:26 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 21 Mar 2012 14:32:15 +0000 (14:32 +0000)
Due to the system providing a copy of gzip, we face some issues when we
'shadow' that copy with our own leading to a varient of race type bugs,
and issues for example if a dependency such as libz is missing but the
binary is still present. We usually rely on our dependency logic to protect
us from this but for gzip, we don't have this protection since its not listed
by all its users (and doing so would be impractical).

This patch installed pigz and gzip into their own directory which we only
add to PATH when we explictly want these binaries in much the same way we do
with perl-native. This means dependency logic is correct when we use the binary
and everything should work well.

The patch adds an explict dependency into image.bbclass since the accelerated
speed of compression is most appreciated at rootfs time.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/gzipnative.bbclass [new file with mode: 0644]
meta/classes/image.bbclass
meta/classes/native.bbclass
meta/recipes-core/expat/expat.inc
meta/recipes-extended/gzip/gzip_1.4.bb
meta/recipes-extended/pigz/pigz_2.2.4.bb

diff --git a/meta/classes/gzipnative.bbclass b/meta/classes/gzipnative.bbclass
new file mode 100644 (file)
index 0000000..4a41143
--- /dev/null
@@ -0,0 +1,3 @@
+PATH_prepend = "${STAGING_BINDIR_NATIVE}/pigz-native:${STAGING_BINDIR_NATIVE}/gzip-native:"
+DEPENDS += "gzip-native"
+
index ccfcaba40ef41dd6b292deb792fbae5d2b857116..907c59ba0f820fc5d10f0074b7e33ae1aced1a60 100644 (file)
@@ -3,6 +3,8 @@ inherit rootfs_${IMAGE_PKGTYPE}
 IMAGETEST ?= "dummy"
 inherit imagetest-${IMAGETEST}
 
+inherit gzipnative
+
 LICENSE = "MIT"
 PACKAGES = ""
 RDEPENDS += "${IMAGE_INSTALL} ${LINGUAS_INSTALL} ${NORMAL_FEATURE_INSTALL} ${ROOTFS_BOOTSTRAP_INSTALL}"
index 871dda042631263ce46223eb1dde741ef527c282..ffab971cbb436f62848eacebfd5911241e1bea47 100644 (file)
@@ -77,7 +77,7 @@ baselib = "lib"
 # Libtool's default paths are correct for the native machine
 lt_cv_sys_lib_dlsearch_path_spec[unexport] = "1"
 
-NATIVE_PACKAGE_PATH_SUFFIX = ""
+NATIVE_PACKAGE_PATH_SUFFIX ?= ""
 bindir .= "${NATIVE_PACKAGE_PATH_SUFFIX}"
 libdir .= "${NATIVE_PACKAGE_PATH_SUFFIX}"
 libexecdir .= "${NATIVE_PACKAGE_PATH_SUFFIX}"
index d902b7afdf4b1963d31b245484b8e1804c65e00d..459ccb3b5ba60721c722acb3e2a905d3f1d20573 100644 (file)
@@ -7,7 +7,7 @@ LICENSE = "MIT"
 SRC_URI = "${SOURCEFORGE_MIRROR}/expat/expat-${PV}.tar.gz \
            file://autotools.patch"
 
-inherit autotools lib_package
+inherit autotools lib_package gzipnative
 
 # This package uses an archive format known to have issue with some
 # versions of gzip
index ab8a744327b56e933e454ccc544b5aeb414893b4..8f4a237ec34b3cb60d2371edd8ca84292fc17a3b 100644 (file)
@@ -1,6 +1,8 @@
 require gzip.inc
 
-PR = "r0"
+PR = "r1"
+
+NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
 
 BBCLASSEXTEND = "native"
 
index 598bbe35ba829b2bbed049974e7f9551c91a9051..eaf00c67054bdf7713ef0166b1c8e444ad2f0717 100644 (file)
@@ -1,6 +1,8 @@
 require pigz.inc
 
-PR = "r0"
+PR = "r1"
+
+NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
 
 BBCLASSEXTEND = "native"