Skip to contentSkip to conversation

openssl: Use the c_rehash shell re-implementation for target

PATCH Superseded Otavio Salvador 3 participants 5 messages Feb 26, 2019

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 openssl: Use the c_rehash shell re-implementation for target

We had a c_rehash shell re-implementation being used for the native package and there is no reason to not use it as well for the target. This allows it to be available without the need of perl being installed.

This partially reverts OE-Core:d2b1a889ef (openssl: move c_rehash pkg to avoid perl dep) but still allows the removal of perl dependency.

---

 .../openssl/openssl_1.1.1a.bb                    | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
meta/recipes-connectivity/openssl/openssl_1.1.1a.bb +8 -8
index 9f6e26bcf5..3e9e45e4a4 100644
@@ -122,7 +122,13 @@ do_install () {
 
 	oe_multilib_header openssl/opensslconf.h
 
-	# Create SSL structure for packages such as ca-certificates which
+	# Install a custom version of c_rehash that can handle sysroots properly.
+	# This version is used for example when installing ca-certificates during
+	# image creation.
+	install -Dm 0755 ${WORKDIR}/openssl-c_rehash.sh ${D}${bindir}/c_rehash
+	sed -i -e 's,/etc/openssl,${sysconfdir}/ssl,g' ${D}${bindir}/c_rehash
+
+        # Create SSL structure for packages such as ca-certificates which
 	# contain hard-coded paths to /etc/ssl. Debian does the same.
 	install -d ${D}${sysconfdir}/ssl
 	mv ${D}${libdir}/ssl-1.1/certs \
@@ -143,12 +149,6 @@ do_install_append_class-native () {
 	    SSL_CERT_DIR=${libdir}/ssl-1.1/certs \
 	    SSL_CERT_FILE=${libdir}/ssl-1.1/cert.pem \
 	    OPENSSL_ENGINES=${libdir}/ssl-1.1/engines
-
-	# Install a custom version of c_rehash that can handle sysroots properly.
-	# This version is used for example when installing ca-certificates during
-	# image creation.
-	install -Dm 0755 ${WORKDIR}/openssl-c_rehash.sh ${D}${bindir}/c_rehash
-	sed -i -e 's,/etc/openssl,${sysconfdir}/ssl,g' ${D}${bindir}/c_rehash
 }
 
 do_install_append_class-nativesdk () {
@@ -190,7 +190,7 @@ FILES_libcrypto = "${libdir}/libcrypto${SOLIBS}"
 FILES_libssl = "${libdir}/libssl${SOLIBS}"
 FILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf"
 FILES_${PN}-engines = "${libdir}/engines-1.1"
-FILES_${PN}-misc = "${libdir}/ssl-1.1/misc ${bindir}/c_rehash"
+FILES_${PN}-misc = "${libdir}/ssl-1.1/misc"
 FILES_${PN} =+ "${libdir}/ssl-1.1/*"
 FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/openssl.sh"
 
Signature · 1 line
2.20.1
#1 lore raw
Quoted 4 lines · Otavio Salvador

We had a c_rehash shell re-implementation being used for the native package and there is no reason to not use it as well for the target. This allows it to be available without the need of perl being installed.

I'd rather not deviate from the upstream, and use what the upstream provides. Especially considering that perl version does have command line options that the shell version does not, and the difference might increase in the future:
c_rehash [-old] [-h] [-help] [-v] [dirs...]

If you really really can't afford perl runtime on the target, and want the shell version, how about making it a PACKAGECONFIG?

Alex

Quoted 52 lines
 .../openssl/openssl_1.1.1a.bb                    | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
meta/recipes-connectivity/openssl/openssl_1.1.1a.bb +8 -9
index 9f6e26bcf5..3e9e45e4a4 100644
@@ -122,7 +122,13 @@ do_install () {
 
        oe_multilib_header openssl/opensslconf.h
 
-       # Create SSL structure for packages such as ca-certificates which
+       # Install a custom version of c_rehash that can handle sysroots properly.
+       # This version is used for example when installing ca-certificates during
+       # image creation.
+       install -Dm 0755 ${WORKDIR}/openssl-c_rehash.sh ${D}${bindir}/c_rehash
+       sed -i -e 's,/etc/openssl,${sysconfdir}/ssl,g' ${D}${bindir}/c_rehash
+
+        # Create SSL structure for packages such as ca-certificates which
        # contain hard-coded paths to /etc/ssl. Debian does the same.
        install -d ${D}${sysconfdir}/ssl
        mv ${D}${libdir}/ssl-1.1/certs \
@@ -143,12 +149,6 @@ do_install_append_class-native () {
            SSL_CERT_DIR=${libdir}/ssl-1.1/certs \
            SSL_CERT_FILE=${libdir}/ssl-1.1/cert.pem \
            OPENSSL_ENGINES=${libdir}/ssl-1.1/engines
-
-       # Install a custom version of c_rehash that can handle sysroots properly.
-       # This version is used for example when installing ca-certificates during
-       # image creation.
-       install -Dm 0755 ${WORKDIR}/openssl-c_rehash.sh ${D}${bindir}/c_rehash
-       sed -i -e 's,/etc/openssl,${sysconfdir}/ssl,g' ${D}${bindir}/c_rehash
 }
 
 do_install_append_class-nativesdk () {
@@ -190,7 +190,7 @@ FILES_libcrypto = "${libdir}/libcrypto${SOLIBS}"
 FILES_libssl = "${libdir}/libssl${SOLIBS}"
 FILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf"
 FILES_${PN}-engines = "${libdir}/engines-1.1"
-FILES_${PN}-misc = "${libdir}/ssl-1.1/misc ${bindir}/c_rehash"
+FILES_${PN}-misc = "${libdir}/ssl-1.1/misc"
 FILES_${PN} =+ "${libdir}/ssl-1.1/*"
 FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/openssl.sh"
 
--

2.20.1

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#2 lore raw

Hello Alexander,

Quoted 6 lines · Alexander Kanavin
Quoted 4 lines · Otavio Salvador

We had a c_rehash shell re-implementation being used for the native package and there is no reason to not use it as well for the target. This allows it to be available without the need of perl being installed.

Quoted 8 lines

I'd rather not deviate from the upstream, and use what the upstream provides. Especially considering that perl version does have command line options that the shell version does not, and the difference might increase in the future:
c_rehash [-old] [-h] [-help] [-v] [dirs...]

If you really really can't afford perl runtime on the target, and want the shell version, how about making it a PACKAGECONFIG?

Well, the c_rehash has a specific use case and this version is /already/ in use on 1.0 (for both target and native) and on 1.1 for native. If c_rehash is not good enough for use, we should remove it from native as well.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9 9981-7854          Mobile: +1 (347) 903-9750
#3 lore raw
Quoted 6 lines · Otavio Salvador
Quoted 6 lines

I'd rather not deviate from the upstream, and use what the upstream provides. Especially considering that perl version does have command line options that the shell version does not, and the difference might increase in the future:
c_rehash [-old] [-h] [-help] [-v] [dirs...]

Quoted 7 lines
Quoted 2 lines

If you really really can't afford perl runtime on the target, and want the shell version, how about making it a PACKAGECONFIG?

Well, the c_rehash has a specific use case and this version is /already/ in use on 1.0 (for both target and native) and on 1.1 for native. If c_rehash is not good enough for use, we should remove it from native as well.

1.0 version is no longer used in either native or target, 1.1 version is used in both cases, as they have the same file name and would then clash.
The native use case is specific and controlled - running update-ca-certificates. There is no guarantee that on target the utility will not be used from somewhere else, making assumptions that are true for perl version, but not true for our shell rewrite.

Alex

#4 lore raw

Hello Alexander,

Quoted 17 lines · Alexander Kanavin
Quoted 6 lines · Otavio Salvador
Quoted 6 lines

I'd rather not deviate from the upstream, and use what the upstream provides. Especially considering that perl version does have command line options that the shell version does not, and the difference might increase in the future:
c_rehash [-old] [-h] [-help] [-v] [dirs...]

Quoted 7 lines
Quoted 2 lines

If you really really can't afford perl runtime on the target, and want the shell version, how about making it a PACKAGECONFIG?

Well, the c_rehash has a specific use case and this version is /already/ in use on 1.0 (for both target and native) and on 1.1 for native. If c_rehash is not good enough for use, we should remove it from native as well.

Quoted 7 lines

1.0 version is no longer used in either native or target, 1.1 version is used in both cases, as they have the same file name and would then clash.
The native use case is specific and controlled - running update-ca-certificates. There is no guarantee that on target the utility will not be used from somewhere else, making assumptions that are true for perl version, but not true for our shell rewrite.

Really? What forbids me to use the c_rehash native side as part of my build scripts and tooling? So or it is good enough or it is.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9 9981-7854          Mobile: +1 (347) 903-9750