openssl-nativesdk: Fix "can't open config file" warning

When SDK is not installed in the default location, openssl will not be
able to find the the openssl.cnf config file:

"WARNING: can't open config file: XXXX/usr/lib/ssl/openssl.cnf"

To fix this, we need to provide the environment variable $OPENSSL_CONF
pointing to the correct config file location.

(From OE-Core rev: b3f148333515efdb746b78c57d62cfbf3321b21e)

(From OE-Core rev: fcea508efedeb36ca31fe8ad0cbc6d194fcfd1f7)

Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ovidiu Panait
2017-12-20 13:15:37 +00:00
committed by Richard Purdie
parent 8a42465904
commit da46b29ffd
4 changed files with 24 additions and 0 deletions

View File

@@ -0,0 +1 @@
export OPENSSL_CONF="$OECORE_NATIVE_SYSROOT/usr/lib/ssl/openssl.cnf"

View File

@@ -285,5 +285,12 @@ do_install_append_class-native() {
OPENSSL_ENGINES=${libdir}/ssl/engines
}
do_install_append_class-nativesdk() {
mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
install -m 644 ${WORKDIR}/environment.d-openssl.sh ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
}
FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/openssl.sh"
BBCLASSEXTEND = "native nativesdk"

View File

@@ -47,6 +47,11 @@ SRC_URI_append_class-target = "\
file://reproducible-cflags.patch \
file://reproducible-mkbuildinf.patch \
"
SRC_URI_append_class-nativesdk = " \
file://environment.d-openssl.sh \
"
SRC_URI[md5sum] = "44279b8557c3247cbe324e2322ecd114"
SRC_URI[sha256sum] = "ec3f5c9714ba0fd45cb4e087301eb1336c317e0d20b575a125050470e8089e4d"

View File

@@ -19,6 +19,10 @@ SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \
file://0001-Take-linking-flags-from-LDFLAGS-env-var.patch \
"
SRC_URI_append_class-nativesdk = " \
file://environment.d-openssl.sh \
"
S = "${WORKDIR}/openssl-${PV}"
inherit lib_package multilib_header ptest
@@ -142,6 +146,13 @@ do_install_append_class-native () {
sed -i -e 's,/etc/openssl,${sysconfdir}/ssl,g' ${D}${bindir}/c_rehash
}
do_install_append_class-nativesdk() {
mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
install -m 644 ${WORKDIR}/environment.d-openssl.sh ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh
}
FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/openssl.sh"
do_install_ptest() {
cp -r * ${D}${PTEST_PATH}