You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
3.3 KiB

#!/bin/bash
# module-setup for url-lib
# called by dracut
check() {
require_binaries curl || return 1
return 255
}
# called by dracut
depends() {
echo network
return 0
}
# called by dracut
install() {
Handle curl using libnssckbi for TLS (RHBZ #1447777) curl in Fedora recently changed its default CA trust store. The Fedora package no longer specifies an OpenSSL-format bundle file during build, and curl itself has been patched to use an NSS plugin called libnssckbi.so when no bundle file or directory is specified. There are (at present) two possible providers of the libnssckbi.so module: the original NSS implementation, which uses a trust bundle built in at build time, and a compatible implementation from the p11-kit project, which reads a trust bundle at run time. So if we find a string in libcurl.so that suggests libnssckbi might be in use, we must both install it and make an effort to install any trust bundle files it may use. The p11-kit libnssckbi implementation does include a string that lists the top-level trust directories it will use, so we try to find that string, though the best effort I can come up with will also find many false positives too. To weed out the false positives, we check whether the matches actually exist as dirs, and if so, whether they contain some specific subdirectories we know p11-kit trust dirs must have (thanks, @kaie). For the NSS libnssckbi implementation, we will likely wind up not finding any dirs that match the requirements, so we will simply install the libnssckbi.so file itself, which is the correct action. This fixes TLS transactions in the initramfs environment when using a curl that's built this new way; it's significant for use of kickstarts and update images with the Fedora / RHEL installer, as these are retrieved in the initramfs environment, and are frequently retrieved via HTTPS.
8 years ago
local _dir _crt _found _lib _nssckbi _p11roots _p11root _p11item
inst_simple "$moddir/url-lib.sh" "/lib/url-lib.sh"
inst_multiple -o ctorrent
inst_multiple curl
if curl --version | grep -qi '\bNSS\b'; then
# also install libs for curl https
inst_libdir_file "libnsspem.so*"
inst_libdir_file "libnsssysinit.so*"
inst_libdir_file "libsoftokn3.so*"
inst_libdir_file "libsqlite3.so*"
fi
for _dir in $libdirs; do
Allow running on a cross-compiled rootfs For the shell scripts, new environment variables were introduced. dracutsysrootdir is the root directory, file existence checks use it. DRACUT_LDCONFIG can override ldconfig with a different one that works on the sysroot with foreign binaries. DRACUT_LDD can override ldd with a different one that works with foreign binaries. DRACUT_TESTBIN can override /bin/sh. A cross-compiled sysroot may use symlinks that are valid only when running on the target so a real file must be provided that exist in the sysroot. DRACUT_INSTALL now supports debugging dracut-install in itself when run by dracut but without debugging the dracut scripts. E.g. DRACUT_INSTALL="valgrind dracut-install or DRACUT_INSTALL="dracut-install --debug". DRACUT_COMPRESS_BZIP2, DRACUT_COMPRESS_LBZIP2, DRACUT_COMPRESS_LZMA, DRACUT_COMPRESS_XZ, DRACUT_COMPRESS_GZIP, DRACUT_COMPRESS_PIGZ, DRACUT_COMPRESS_LZOP, DRACUT_COMPRESS_ZSTD, DRACUT_COMPRESS_LZ4, DRACUT_COMPRESS_CAT: All of the compression utilities may be overridden, to support the native binaries in non-standard places. DRACUT_ARCH overrides "uname -m". SYSTEMD_VERSION overrides "systemd --version". The dracut-install utility was overhauled to support sysroot via a new option -r and fixes for clang-analyze. It supports cross-compiler-ldd from https://gist.github.com/jerome-pouiller/c403786c1394f53f44a3b61214489e6f DRACUT_INSTALL_PATH was introduced so dracut-install can work with a different PATH. In a cross-compiled environment (e.g. Yocto), PATH points to natively built binaries that are not in the host's /bin, /usr/bin, etc. dracut-install still needs plain /bin and /usr/bin that are relative to the cross-compiled sysroot. The hashmap pool allocate_tile/deallocate_tile code was removed because clang-analyze showed errors in it. hashmap_copy was removed because it wasn't used and clang-analyze showed errors in it. DRACUT_INSTALL_LOG_TARGET and DRACUT_INSTALL_LOG_LEVEL were introduced so dracut-install can use different settings from DRACUT_LOG_TARGET and DRACUT_LOG_LEVEL. Signed-off-by: Böszörményi Zoltán <zboszor@pr.hu>
5 years ago
[[ -d $dracutsysrootdir$_dir ]] || continue
for _lib in $dracutsysrootdir$_dir/libcurl.so.*; do
[[ -e $_lib ]] || continue
Handle curl using libnssckbi for TLS (RHBZ #1447777) curl in Fedora recently changed its default CA trust store. The Fedora package no longer specifies an OpenSSL-format bundle file during build, and curl itself has been patched to use an NSS plugin called libnssckbi.so when no bundle file or directory is specified. There are (at present) two possible providers of the libnssckbi.so module: the original NSS implementation, which uses a trust bundle built in at build time, and a compatible implementation from the p11-kit project, which reads a trust bundle at run time. So if we find a string in libcurl.so that suggests libnssckbi might be in use, we must both install it and make an effort to install any trust bundle files it may use. The p11-kit libnssckbi implementation does include a string that lists the top-level trust directories it will use, so we try to find that string, though the best effort I can come up with will also find many false positives too. To weed out the false positives, we check whether the matches actually exist as dirs, and if so, whether they contain some specific subdirectories we know p11-kit trust dirs must have (thanks, @kaie). For the NSS libnssckbi implementation, we will likely wind up not finding any dirs that match the requirements, so we will simply install the libnssckbi.so file itself, which is the correct action. This fixes TLS transactions in the initramfs environment when using a curl that's built this new way; it's significant for use of kickstarts and update images with the Fedora / RHEL installer, as these are retrieved in the initramfs environment, and are frequently retrieved via HTTPS.
8 years ago
[[ $_nssckbi ]] || _nssckbi=$(grep -F --binary-files=text -z libnssckbi $_lib)
_crt=$(grep -F --binary-files=text -z .crt $_lib)
[[ $_crt ]] || continue
[[ $_crt == /*/* ]] || continue
Allow running on a cross-compiled rootfs For the shell scripts, new environment variables were introduced. dracutsysrootdir is the root directory, file existence checks use it. DRACUT_LDCONFIG can override ldconfig with a different one that works on the sysroot with foreign binaries. DRACUT_LDD can override ldd with a different one that works with foreign binaries. DRACUT_TESTBIN can override /bin/sh. A cross-compiled sysroot may use symlinks that are valid only when running on the target so a real file must be provided that exist in the sysroot. DRACUT_INSTALL now supports debugging dracut-install in itself when run by dracut but without debugging the dracut scripts. E.g. DRACUT_INSTALL="valgrind dracut-install or DRACUT_INSTALL="dracut-install --debug". DRACUT_COMPRESS_BZIP2, DRACUT_COMPRESS_LBZIP2, DRACUT_COMPRESS_LZMA, DRACUT_COMPRESS_XZ, DRACUT_COMPRESS_GZIP, DRACUT_COMPRESS_PIGZ, DRACUT_COMPRESS_LZOP, DRACUT_COMPRESS_ZSTD, DRACUT_COMPRESS_LZ4, DRACUT_COMPRESS_CAT: All of the compression utilities may be overridden, to support the native binaries in non-standard places. DRACUT_ARCH overrides "uname -m". SYSTEMD_VERSION overrides "systemd --version". The dracut-install utility was overhauled to support sysroot via a new option -r and fixes for clang-analyze. It supports cross-compiler-ldd from https://gist.github.com/jerome-pouiller/c403786c1394f53f44a3b61214489e6f DRACUT_INSTALL_PATH was introduced so dracut-install can work with a different PATH. In a cross-compiled environment (e.g. Yocto), PATH points to natively built binaries that are not in the host's /bin, /usr/bin, etc. dracut-install still needs plain /bin and /usr/bin that are relative to the cross-compiled sysroot. The hashmap pool allocate_tile/deallocate_tile code was removed because clang-analyze showed errors in it. hashmap_copy was removed because it wasn't used and clang-analyze showed errors in it. DRACUT_INSTALL_LOG_TARGET and DRACUT_INSTALL_LOG_LEVEL were introduced so dracut-install can use different settings from DRACUT_LOG_TARGET and DRACUT_LOG_LEVEL. Signed-off-by: Böszörményi Zoltán <zboszor@pr.hu>
5 years ago
if ! inst "${_crt#$dracutsysrootdir}"; then
dwarn "Couldn't install '$_crt' SSL CA cert bundle; HTTPS might not work."
continue
fi
_found=1
done
done
Handle curl using libnssckbi for TLS (RHBZ #1447777) curl in Fedora recently changed its default CA trust store. The Fedora package no longer specifies an OpenSSL-format bundle file during build, and curl itself has been patched to use an NSS plugin called libnssckbi.so when no bundle file or directory is specified. There are (at present) two possible providers of the libnssckbi.so module: the original NSS implementation, which uses a trust bundle built in at build time, and a compatible implementation from the p11-kit project, which reads a trust bundle at run time. So if we find a string in libcurl.so that suggests libnssckbi might be in use, we must both install it and make an effort to install any trust bundle files it may use. The p11-kit libnssckbi implementation does include a string that lists the top-level trust directories it will use, so we try to find that string, though the best effort I can come up with will also find many false positives too. To weed out the false positives, we check whether the matches actually exist as dirs, and if so, whether they contain some specific subdirectories we know p11-kit trust dirs must have (thanks, @kaie). For the NSS libnssckbi implementation, we will likely wind up not finding any dirs that match the requirements, so we will simply install the libnssckbi.so file itself, which is the correct action. This fixes TLS transactions in the initramfs environment when using a curl that's built this new way; it's significant for use of kickstarts and update images with the Fedora / RHEL installer, as these are retrieved in the initramfs environment, and are frequently retrieved via HTTPS.
8 years ago
# If we found no cert bundle files referenced in libcurl but we
# *did* find a mention of libnssckbi (checked above), install it.
# If its truly NSS libnssckbi, it includes its own trust bundle,
# but if it's really p11-kit-trust.so, we need to find the dirs
# where it will look for a trust bundle and install them too.
if ! [[ $_found ]] && [[ $_nssckbi ]] ; then
_found=1
inst_libdir_file "libnssckbi.so*" || _found=
for _dir in $libdirs; do
Allow running on a cross-compiled rootfs For the shell scripts, new environment variables were introduced. dracutsysrootdir is the root directory, file existence checks use it. DRACUT_LDCONFIG can override ldconfig with a different one that works on the sysroot with foreign binaries. DRACUT_LDD can override ldd with a different one that works with foreign binaries. DRACUT_TESTBIN can override /bin/sh. A cross-compiled sysroot may use symlinks that are valid only when running on the target so a real file must be provided that exist in the sysroot. DRACUT_INSTALL now supports debugging dracut-install in itself when run by dracut but without debugging the dracut scripts. E.g. DRACUT_INSTALL="valgrind dracut-install or DRACUT_INSTALL="dracut-install --debug". DRACUT_COMPRESS_BZIP2, DRACUT_COMPRESS_LBZIP2, DRACUT_COMPRESS_LZMA, DRACUT_COMPRESS_XZ, DRACUT_COMPRESS_GZIP, DRACUT_COMPRESS_PIGZ, DRACUT_COMPRESS_LZOP, DRACUT_COMPRESS_ZSTD, DRACUT_COMPRESS_LZ4, DRACUT_COMPRESS_CAT: All of the compression utilities may be overridden, to support the native binaries in non-standard places. DRACUT_ARCH overrides "uname -m". SYSTEMD_VERSION overrides "systemd --version". The dracut-install utility was overhauled to support sysroot via a new option -r and fixes for clang-analyze. It supports cross-compiler-ldd from https://gist.github.com/jerome-pouiller/c403786c1394f53f44a3b61214489e6f DRACUT_INSTALL_PATH was introduced so dracut-install can work with a different PATH. In a cross-compiled environment (e.g. Yocto), PATH points to natively built binaries that are not in the host's /bin, /usr/bin, etc. dracut-install still needs plain /bin and /usr/bin that are relative to the cross-compiled sysroot. The hashmap pool allocate_tile/deallocate_tile code was removed because clang-analyze showed errors in it. hashmap_copy was removed because it wasn't used and clang-analyze showed errors in it. DRACUT_INSTALL_LOG_TARGET and DRACUT_INSTALL_LOG_LEVEL were introduced so dracut-install can use different settings from DRACUT_LOG_TARGET and DRACUT_LOG_LEVEL. Signed-off-by: Böszörményi Zoltán <zboszor@pr.hu>
5 years ago
[[ -e $dracutsysrootdir$_dir/libnssckbi.so ]] || continue
Handle curl using libnssckbi for TLS (RHBZ #1447777) curl in Fedora recently changed its default CA trust store. The Fedora package no longer specifies an OpenSSL-format bundle file during build, and curl itself has been patched to use an NSS plugin called libnssckbi.so when no bundle file or directory is specified. There are (at present) two possible providers of the libnssckbi.so module: the original NSS implementation, which uses a trust bundle built in at build time, and a compatible implementation from the p11-kit project, which reads a trust bundle at run time. So if we find a string in libcurl.so that suggests libnssckbi might be in use, we must both install it and make an effort to install any trust bundle files it may use. The p11-kit libnssckbi implementation does include a string that lists the top-level trust directories it will use, so we try to find that string, though the best effort I can come up with will also find many false positives too. To weed out the false positives, we check whether the matches actually exist as dirs, and if so, whether they contain some specific subdirectories we know p11-kit trust dirs must have (thanks, @kaie). For the NSS libnssckbi implementation, we will likely wind up not finding any dirs that match the requirements, so we will simply install the libnssckbi.so file itself, which is the correct action. This fixes TLS transactions in the initramfs environment when using a curl that's built this new way; it's significant for use of kickstarts and update images with the Fedora / RHEL installer, as these are retrieved in the initramfs environment, and are frequently retrieved via HTTPS.
8 years ago
# this looks for directory-ish strings in the file
Allow running on a cross-compiled rootfs For the shell scripts, new environment variables were introduced. dracutsysrootdir is the root directory, file existence checks use it. DRACUT_LDCONFIG can override ldconfig with a different one that works on the sysroot with foreign binaries. DRACUT_LDD can override ldd with a different one that works with foreign binaries. DRACUT_TESTBIN can override /bin/sh. A cross-compiled sysroot may use symlinks that are valid only when running on the target so a real file must be provided that exist in the sysroot. DRACUT_INSTALL now supports debugging dracut-install in itself when run by dracut but without debugging the dracut scripts. E.g. DRACUT_INSTALL="valgrind dracut-install or DRACUT_INSTALL="dracut-install --debug". DRACUT_COMPRESS_BZIP2, DRACUT_COMPRESS_LBZIP2, DRACUT_COMPRESS_LZMA, DRACUT_COMPRESS_XZ, DRACUT_COMPRESS_GZIP, DRACUT_COMPRESS_PIGZ, DRACUT_COMPRESS_LZOP, DRACUT_COMPRESS_ZSTD, DRACUT_COMPRESS_LZ4, DRACUT_COMPRESS_CAT: All of the compression utilities may be overridden, to support the native binaries in non-standard places. DRACUT_ARCH overrides "uname -m". SYSTEMD_VERSION overrides "systemd --version". The dracut-install utility was overhauled to support sysroot via a new option -r and fixes for clang-analyze. It supports cross-compiler-ldd from https://gist.github.com/jerome-pouiller/c403786c1394f53f44a3b61214489e6f DRACUT_INSTALL_PATH was introduced so dracut-install can work with a different PATH. In a cross-compiled environment (e.g. Yocto), PATH points to natively built binaries that are not in the host's /bin, /usr/bin, etc. dracut-install still needs plain /bin and /usr/bin that are relative to the cross-compiled sysroot. The hashmap pool allocate_tile/deallocate_tile code was removed because clang-analyze showed errors in it. hashmap_copy was removed because it wasn't used and clang-analyze showed errors in it. DRACUT_INSTALL_LOG_TARGET and DRACUT_INSTALL_LOG_LEVEL were introduced so dracut-install can use different settings from DRACUT_LOG_TARGET and DRACUT_LOG_LEVEL. Signed-off-by: Böszörményi Zoltán <zboszor@pr.hu>
5 years ago
for _p11roots in $(grep -o --binary-files=text "/[[:alpha:]][[:print:]]*" $dracutsysrootdir$_dir/libnssckbi.so) ; do
Handle curl using libnssckbi for TLS (RHBZ #1447777) curl in Fedora recently changed its default CA trust store. The Fedora package no longer specifies an OpenSSL-format bundle file during build, and curl itself has been patched to use an NSS plugin called libnssckbi.so when no bundle file or directory is specified. There are (at present) two possible providers of the libnssckbi.so module: the original NSS implementation, which uses a trust bundle built in at build time, and a compatible implementation from the p11-kit project, which reads a trust bundle at run time. So if we find a string in libcurl.so that suggests libnssckbi might be in use, we must both install it and make an effort to install any trust bundle files it may use. The p11-kit libnssckbi implementation does include a string that lists the top-level trust directories it will use, so we try to find that string, though the best effort I can come up with will also find many false positives too. To weed out the false positives, we check whether the matches actually exist as dirs, and if so, whether they contain some specific subdirectories we know p11-kit trust dirs must have (thanks, @kaie). For the NSS libnssckbi implementation, we will likely wind up not finding any dirs that match the requirements, so we will simply install the libnssckbi.so file itself, which is the correct action. This fixes TLS transactions in the initramfs environment when using a curl that's built this new way; it's significant for use of kickstarts and update images with the Fedora / RHEL installer, as these are retrieved in the initramfs environment, and are frequently retrieved via HTTPS.
8 years ago
# the string can be a :-separated list of dirs
for _p11root in $(echo "$_p11roots" | tr ':' '\n') ; do
# check if it's actually a directory (there are
# several false positives in the results)
Allow running on a cross-compiled rootfs For the shell scripts, new environment variables were introduced. dracutsysrootdir is the root directory, file existence checks use it. DRACUT_LDCONFIG can override ldconfig with a different one that works on the sysroot with foreign binaries. DRACUT_LDD can override ldd with a different one that works with foreign binaries. DRACUT_TESTBIN can override /bin/sh. A cross-compiled sysroot may use symlinks that are valid only when running on the target so a real file must be provided that exist in the sysroot. DRACUT_INSTALL now supports debugging dracut-install in itself when run by dracut but without debugging the dracut scripts. E.g. DRACUT_INSTALL="valgrind dracut-install or DRACUT_INSTALL="dracut-install --debug". DRACUT_COMPRESS_BZIP2, DRACUT_COMPRESS_LBZIP2, DRACUT_COMPRESS_LZMA, DRACUT_COMPRESS_XZ, DRACUT_COMPRESS_GZIP, DRACUT_COMPRESS_PIGZ, DRACUT_COMPRESS_LZOP, DRACUT_COMPRESS_ZSTD, DRACUT_COMPRESS_LZ4, DRACUT_COMPRESS_CAT: All of the compression utilities may be overridden, to support the native binaries in non-standard places. DRACUT_ARCH overrides "uname -m". SYSTEMD_VERSION overrides "systemd --version". The dracut-install utility was overhauled to support sysroot via a new option -r and fixes for clang-analyze. It supports cross-compiler-ldd from https://gist.github.com/jerome-pouiller/c403786c1394f53f44a3b61214489e6f DRACUT_INSTALL_PATH was introduced so dracut-install can work with a different PATH. In a cross-compiled environment (e.g. Yocto), PATH points to natively built binaries that are not in the host's /bin, /usr/bin, etc. dracut-install still needs plain /bin and /usr/bin that are relative to the cross-compiled sysroot. The hashmap pool allocate_tile/deallocate_tile code was removed because clang-analyze showed errors in it. hashmap_copy was removed because it wasn't used and clang-analyze showed errors in it. DRACUT_INSTALL_LOG_TARGET and DRACUT_INSTALL_LOG_LEVEL were introduced so dracut-install can use different settings from DRACUT_LOG_TARGET and DRACUT_LOG_LEVEL. Signed-off-by: Böszörményi Zoltán <zboszor@pr.hu>
5 years ago
[[ -d "$dracutsysrootdir$_p11root" ]] || continue
Handle curl using libnssckbi for TLS (RHBZ #1447777) curl in Fedora recently changed its default CA trust store. The Fedora package no longer specifies an OpenSSL-format bundle file during build, and curl itself has been patched to use an NSS plugin called libnssckbi.so when no bundle file or directory is specified. There are (at present) two possible providers of the libnssckbi.so module: the original NSS implementation, which uses a trust bundle built in at build time, and a compatible implementation from the p11-kit project, which reads a trust bundle at run time. So if we find a string in libcurl.so that suggests libnssckbi might be in use, we must both install it and make an effort to install any trust bundle files it may use. The p11-kit libnssckbi implementation does include a string that lists the top-level trust directories it will use, so we try to find that string, though the best effort I can come up with will also find many false positives too. To weed out the false positives, we check whether the matches actually exist as dirs, and if so, whether they contain some specific subdirectories we know p11-kit trust dirs must have (thanks, @kaie). For the NSS libnssckbi implementation, we will likely wind up not finding any dirs that match the requirements, so we will simply install the libnssckbi.so file itself, which is the correct action. This fixes TLS transactions in the initramfs environment when using a curl that's built this new way; it's significant for use of kickstarts and update images with the Fedora / RHEL installer, as these are retrieved in the initramfs environment, and are frequently retrieved via HTTPS.
8 years ago
# check if it has some specific subdirs that all
# p11-kit trust dirs have
Allow running on a cross-compiled rootfs For the shell scripts, new environment variables were introduced. dracutsysrootdir is the root directory, file existence checks use it. DRACUT_LDCONFIG can override ldconfig with a different one that works on the sysroot with foreign binaries. DRACUT_LDD can override ldd with a different one that works with foreign binaries. DRACUT_TESTBIN can override /bin/sh. A cross-compiled sysroot may use symlinks that are valid only when running on the target so a real file must be provided that exist in the sysroot. DRACUT_INSTALL now supports debugging dracut-install in itself when run by dracut but without debugging the dracut scripts. E.g. DRACUT_INSTALL="valgrind dracut-install or DRACUT_INSTALL="dracut-install --debug". DRACUT_COMPRESS_BZIP2, DRACUT_COMPRESS_LBZIP2, DRACUT_COMPRESS_LZMA, DRACUT_COMPRESS_XZ, DRACUT_COMPRESS_GZIP, DRACUT_COMPRESS_PIGZ, DRACUT_COMPRESS_LZOP, DRACUT_COMPRESS_ZSTD, DRACUT_COMPRESS_LZ4, DRACUT_COMPRESS_CAT: All of the compression utilities may be overridden, to support the native binaries in non-standard places. DRACUT_ARCH overrides "uname -m". SYSTEMD_VERSION overrides "systemd --version". The dracut-install utility was overhauled to support sysroot via a new option -r and fixes for clang-analyze. It supports cross-compiler-ldd from https://gist.github.com/jerome-pouiller/c403786c1394f53f44a3b61214489e6f DRACUT_INSTALL_PATH was introduced so dracut-install can work with a different PATH. In a cross-compiled environment (e.g. Yocto), PATH points to natively built binaries that are not in the host's /bin, /usr/bin, etc. dracut-install still needs plain /bin and /usr/bin that are relative to the cross-compiled sysroot. The hashmap pool allocate_tile/deallocate_tile code was removed because clang-analyze showed errors in it. hashmap_copy was removed because it wasn't used and clang-analyze showed errors in it. DRACUT_INSTALL_LOG_TARGET and DRACUT_INSTALL_LOG_LEVEL were introduced so dracut-install can use different settings from DRACUT_LOG_TARGET and DRACUT_LOG_LEVEL. Signed-off-by: Böszörményi Zoltán <zboszor@pr.hu>
5 years ago
[[ -d "$dracutsysrootdir${_p11root}/anchors" ]] || continue
[[ -d "$dracutsysrootdir${_p11root}/blacklist" ]] || continue
Handle curl using libnssckbi for TLS (RHBZ #1447777) curl in Fedora recently changed its default CA trust store. The Fedora package no longer specifies an OpenSSL-format bundle file during build, and curl itself has been patched to use an NSS plugin called libnssckbi.so when no bundle file or directory is specified. There are (at present) two possible providers of the libnssckbi.so module: the original NSS implementation, which uses a trust bundle built in at build time, and a compatible implementation from the p11-kit project, which reads a trust bundle at run time. So if we find a string in libcurl.so that suggests libnssckbi might be in use, we must both install it and make an effort to install any trust bundle files it may use. The p11-kit libnssckbi implementation does include a string that lists the top-level trust directories it will use, so we try to find that string, though the best effort I can come up with will also find many false positives too. To weed out the false positives, we check whether the matches actually exist as dirs, and if so, whether they contain some specific subdirectories we know p11-kit trust dirs must have (thanks, @kaie). For the NSS libnssckbi implementation, we will likely wind up not finding any dirs that match the requirements, so we will simply install the libnssckbi.so file itself, which is the correct action. This fixes TLS transactions in the initramfs environment when using a curl that's built this new way; it's significant for use of kickstarts and update images with the Fedora / RHEL installer, as these are retrieved in the initramfs environment, and are frequently retrieved via HTTPS.
8 years ago
# so now we know it's really a p11-kit trust dir;
# install everything in it
Allow running on a cross-compiled rootfs For the shell scripts, new environment variables were introduced. dracutsysrootdir is the root directory, file existence checks use it. DRACUT_LDCONFIG can override ldconfig with a different one that works on the sysroot with foreign binaries. DRACUT_LDD can override ldd with a different one that works with foreign binaries. DRACUT_TESTBIN can override /bin/sh. A cross-compiled sysroot may use symlinks that are valid only when running on the target so a real file must be provided that exist in the sysroot. DRACUT_INSTALL now supports debugging dracut-install in itself when run by dracut but without debugging the dracut scripts. E.g. DRACUT_INSTALL="valgrind dracut-install or DRACUT_INSTALL="dracut-install --debug". DRACUT_COMPRESS_BZIP2, DRACUT_COMPRESS_LBZIP2, DRACUT_COMPRESS_LZMA, DRACUT_COMPRESS_XZ, DRACUT_COMPRESS_GZIP, DRACUT_COMPRESS_PIGZ, DRACUT_COMPRESS_LZOP, DRACUT_COMPRESS_ZSTD, DRACUT_COMPRESS_LZ4, DRACUT_COMPRESS_CAT: All of the compression utilities may be overridden, to support the native binaries in non-standard places. DRACUT_ARCH overrides "uname -m". SYSTEMD_VERSION overrides "systemd --version". The dracut-install utility was overhauled to support sysroot via a new option -r and fixes for clang-analyze. It supports cross-compiler-ldd from https://gist.github.com/jerome-pouiller/c403786c1394f53f44a3b61214489e6f DRACUT_INSTALL_PATH was introduced so dracut-install can work with a different PATH. In a cross-compiled environment (e.g. Yocto), PATH points to natively built binaries that are not in the host's /bin, /usr/bin, etc. dracut-install still needs plain /bin and /usr/bin that are relative to the cross-compiled sysroot. The hashmap pool allocate_tile/deallocate_tile code was removed because clang-analyze showed errors in it. hashmap_copy was removed because it wasn't used and clang-analyze showed errors in it. DRACUT_INSTALL_LOG_TARGET and DRACUT_INSTALL_LOG_LEVEL were introduced so dracut-install can use different settings from DRACUT_LOG_TARGET and DRACUT_LOG_LEVEL. Signed-off-by: Böszörményi Zoltán <zboszor@pr.hu>
5 years ago
for _p11item in $(find "$dracutsysrootdir$_p11root") ; do
if ! inst "${_p11item#$dracutsysrootdir}" ; then
dwarn "Couldn't install '${_p11item#$dracutsysrootdir}' from p11-kit trust dir '${_p11root#$dracutsysrootdir}'; HTTPS might not work."
Handle curl using libnssckbi for TLS (RHBZ #1447777) curl in Fedora recently changed its default CA trust store. The Fedora package no longer specifies an OpenSSL-format bundle file during build, and curl itself has been patched to use an NSS plugin called libnssckbi.so when no bundle file or directory is specified. There are (at present) two possible providers of the libnssckbi.so module: the original NSS implementation, which uses a trust bundle built in at build time, and a compatible implementation from the p11-kit project, which reads a trust bundle at run time. So if we find a string in libcurl.so that suggests libnssckbi might be in use, we must both install it and make an effort to install any trust bundle files it may use. The p11-kit libnssckbi implementation does include a string that lists the top-level trust directories it will use, so we try to find that string, though the best effort I can come up with will also find many false positives too. To weed out the false positives, we check whether the matches actually exist as dirs, and if so, whether they contain some specific subdirectories we know p11-kit trust dirs must have (thanks, @kaie). For the NSS libnssckbi implementation, we will likely wind up not finding any dirs that match the requirements, so we will simply install the libnssckbi.so file itself, which is the correct action. This fixes TLS transactions in the initramfs environment when using a curl that's built this new way; it's significant for use of kickstarts and update images with the Fedora / RHEL installer, as these are retrieved in the initramfs environment, and are frequently retrieved via HTTPS.
8 years ago
continue
fi
done
done
done
done
fi
[[ $_found ]] || dwarn "Couldn't find SSL CA cert bundle or libnssckbi.so; HTTPS won't work."
}