From e780aa829dc6ccbe697bbb4c34c35378a382c622 Mon Sep 17 00:00:00 2001 From: tokiclover Date: Sat, 2 Jun 2018 13:00:07 +0200 Subject: [PATCH] mkinitramfs-ll.bash: copy libgcc_s.so and handle ld.so.cache (#47) --- mkinitramfs-ll.bash | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/mkinitramfs-ll.bash b/mkinitramfs-ll.bash index 581b610..209a27f 100755 --- a/mkinitramfs-ll.bash +++ b/mkinitramfs-ll.bash @@ -529,12 +529,16 @@ for (( i=0; i < ${#env[@]}; i++ )); do done unset env -# Handle GCC libraries symlinks -[[ -d usr/lib/gcc ]] && -for lib in $(find usr/lib/gcc -iname 'lib*'); do - ln -fns /$lib lib/${lib##*/} - ln -fns /$lib usr/lib/${lib##*/} +# Handle GCC libraries +for dir in $(sed -nre '/^\/.*gcc.*/p' /etc/ld.so.conf /etc/ld.so.conf.d/*); do + if [[ -e ${dir}/libgcc_s.so ]]; then + mkdir -p .${dir} + cp ${dir}/libgcc_s.so* .${dir} + fi done +cp -ar /etc/ld.so.* etc +echo >etc/ld.so.cache +ldconfig -r "${opts[-tmpdir]}" -f etc/ld.so.conf -C etc/ld.so.cache docpio || die [[ "${opts[-K]}" || "${opts[-keep-tmpdir]}" ]] || rm -rf ${opts[-tmpdir]}