diff options
author | 2013-08-26 17:32:09 -0400 | |
---|---|---|
committer | 2013-08-26 17:54:59 -0400 | |
commit | 7b9bce67a20ba2fde7e2c08247d359e03bf8e429 (patch) | |
tree | a4cc3f2d7a07b2a4fa3f7e5de2f273ef303616c1 | |
parent | Detect grub2-mkconfig failure (diff) | |
download | genkernel-ryao.tar.gz genkernel-ryao.tar.bz2 genkernel-ryao.zip |
Copy ld.so.conf and friends when copy_binaries is usedryao
This fixes "error while loading shared libraries libgcc_s.so.1 cannot
open shared object file" when attempting to import a root pool on ARM.
Signed-off-by: Richard Yao <ryao@gentoo.org>
-rwxr-xr-x | gen_initramfs.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 3047470..40318a2 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -1,6 +1,7 @@ #!/bin/bash # $Id$ +COPY_BINARIES=false CPIO_ARGS="--quiet -o -H newc" # The copy_binaries function is explicitly released under the CC0 license to @@ -24,6 +25,8 @@ copy_binaries() { local destdir=$1 shift + COPY_BINARIES=true + for binary in "$@"; do [[ -e "${binary}" ]] \ || gen_die "Binary ${binary} could not be found" @@ -448,6 +451,28 @@ append_zfs(){ rm -rf "${TEMP}/initramfs-zfs-temp" > /dev/null } +append_linker() { + if [ -d "${TEMP}/initramfs-linker-temp" ] + then + rm -r "${TEMP}/initramfs-linker-temp" + fi + + mkdir -p "${TEMP}/initramfs-linker-temp/etc/ld.so.conf.d" + + 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" + + cd "${TEMP}/initramfs-linker-temp/" + log_future_cpio_content + find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ + || gen_die "compressing linker cpio" + cd "${TEMP}" + rm -rf "${TEMP}/initramfs-linker-temp" > /dev/null +} + append_splash(){ splash_geninitramfs=`which splash_geninitramfs 2>/dev/null` if [ -x "${splash_geninitramfs}" ] @@ -800,6 +825,11 @@ create_initramfs() { append_data 'overlay' fi + if ${COPY_BINARIES} + then + append_data 'linker' + fi + # Finalize cpio by removing duplicate files print_info 1 " >> Finalizing cpio..." local TDIR="${TEMP}/initramfs-final" |