commit:     ea84d161aa142d642443623deb4cac27b028a63a
Author:     Matthew Thode <mthode <AT> mthode <DOT> org>
AuthorDate: Mon Jan  2 00:45:39 2017 +0000
Commit:     Matt Thode <prometheanfire <AT> gentoo <DOT> org>
CommitDate: Mon Jan  2 00:45:39 2017 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=ea84d161

update initramfs generation to not always copy ld.so

fixes gen_initramfs.sh on musl systems

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

diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index 1f62f5c..268bc2d 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -533,13 +533,24 @@ append_linker() {
                rm -r "${TEMP}/initramfs-linker-temp"
        fi
 
-       mkdir -p "${TEMP}/initramfs-linker-temp/etc/ld.so.conf.d"
+       mkdir -p "${TEMP}/initramfs-linker-temp/etc"
 
-       cp "/etc/ld.so."{cache,conf} "${TEMP}/initramfs-linker-temp/etc/" 2> 
/dev/null \
-               || gen_die "Could not copy ld.so.{cache,conf}"
-
-       cp -r "/etc/ld.so.conf.d" "${TEMP}/initramfs-linker-temp/etc/" 2> 
/dev/null \
-               || gen_die "Could not copy ld.so.conf.d"
+       if [ -e "/etc/ld.so.conf" ]
+       then
+               cp "/etc/ld.so.conf" "${TEMP}/initramfs-linker-temp/etc/" 2> 
/dev/null \
+                       || gen_die "Could not copy ld.so.conf"
+       fi
+       if [ -e "/etc/ld.so.cache" ]
+       then
+               cp "/etc/ld.so.cache" "${TEMP}/initramfs-linker-temp/etc/" 2> 
/dev/null \
+                       || gen_die "Could not copy ld.so.cache"
+       fi
+       if [ -d "/etc/ld.so.conf.d" ]
+       then
+               mkdir -p "${TEMP}/initramfs-linker-temp/etc/ld.so.conf.d"
+               cp -r "/etc/ld.so.conf.d" "${TEMP}/initramfs-linker-temp/etc/" 
2> /dev/null \
+                       || gen_die "Could not copy ld.so.conf.d"
+       fi
 
        cd "${TEMP}/initramfs-linker-temp/"
        log_future_cpio_content

Reply via email to