commit:     9de72e7d230f7ad8822825ad204136233af95f47
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 11 19:15:07 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sun Aug 11 19:48:28 2019 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=9de72e7d

gen_initramfs.sh: create_initramfs(): Change /etc/ld.so.cache creation

- Always generate or update /etc/ld.so.cache when possible.

- ldconfig will chroot due to "-r" parameter. Therefore, "-f" parameter
  expects 'relative' path from chrooted root.

Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 gen_initramfs.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index 36b4678..c5e4a67 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -1603,12 +1603,12 @@ create_initramfs() {
                "${CPIO_COMMAND}" --quiet -i -F "${CPIO_ARCHIVE}" 2>/dev/null \
                        || gen_die "Failed to extract cpio '${CPIO_ARCHIVE}' 
for dedupe"
 
-               if [ -e etc/ld.so.cache ] && ! isTrue "$(tc-is-cross-compiler)"
+               if ! isTrue "$(tc-is-cross-compiler)"
                then
-                       # We can update /etc/ld.so.cache which was copied from 
host
+                       # We can generate or update /etc/ld.so.cache which was 
copied from host
                        # to actually match initramfs' content.
                        print_info 1 "$(get_indent 1)>> Pre-generating 
initramfs' /etc/ld.so.cache ..."
-                       ldconfig -f "${TDIR}/etc/ld.so.conf" -r . 2>/dev/null \
+                       ldconfig -f /etc/ld.so.conf -r "${TDIR}" 2>/dev/null \
                                || gen_die "Failed to pre-generate 
'${TDIR}/etc/ld.so.cache'!"
                fi
 

Reply via email to