gzip/pigz-native: Install into a prefix to avoid clashing with system binaries

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.

(From OE-Core rev: 7a98c0ef28822ae1fcee45b14db3edcfd4c7ad8f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2012-03-21 11:26:09 +00:00
parent 01218e29f9
commit 40f95685e6
6 changed files with 13 additions and 4 deletions

View File

@ -0,0 +1,3 @@
PATH_prepend = "${STAGING_BINDIR_NATIVE}/pigz-native:${STAGING_BINDIR_NATIVE}/gzip-native:"
DEPENDS += "gzip-native"

View 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}"

View 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}"

View 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

View File

@ -1,6 +1,8 @@
require gzip.inc
PR = "r0"
PR = "r1"
NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
BBCLASSEXTEND = "native"

View File

@ -1,6 +1,8 @@
require pigz.inc
PR = "r0"
PR = "r1"
NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
BBCLASSEXTEND = "native"