From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 5DF481381F3 for ; Wed, 2 Oct 2013 12:43:39 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 89A8AE0AFB; Wed, 2 Oct 2013 12:43:38 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0F522E0AFB for ; Wed, 2 Oct 2013 12:43:37 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6281333EDB1 for ; Wed, 2 Oct 2013 12:43:36 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 18E0CE5464 for ; Wed, 2 Oct 2013 12:43:35 +0000 (UTC) From: "Richard Yao" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Richard Yao" Message-ID: <1377554099.7b9bce67a20ba2fde7e2c08247d359e03bf8e429.ryao@gentoo> Subject: [gentoo-commits] proj/genkernel:ryao commit in: / X-VCS-Repository: proj/genkernel X-VCS-Files: gen_initramfs.sh X-VCS-Directories: / X-VCS-Committer: ryao X-VCS-Committer-Name: Richard Yao X-VCS-Revision: 7b9bce67a20ba2fde7e2c08247d359e03bf8e429 X-VCS-Branch: ryao Date: Wed, 2 Oct 2013 12:43:35 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: e0125724-78d3-4bb7-b74b-3d272c37b416 X-Archives-Hash: 67b403bc68e5ce6834f07c0114c4ade3 commit: 7b9bce67a20ba2fde7e2c08247d359e03bf8e429 Author: Richard Yao gentoo org> AuthorDate: Mon Aug 26 21:32:09 2013 +0000 Commit: Richard Yao gentoo org> CommitDate: Mon Aug 26 21:54:59 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=7b9bce67 Copy ld.so.conf and friends when copy_binaries is used 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 gentoo.org> --- gen_initramfs.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) 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"