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 9AFF5138F88 for ; Thu, 27 Feb 2014 04:47:11 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 47BF3E0A81; Thu, 27 Feb 2014 04:47:09 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id BFEA7E0A8C for ; Thu, 27 Feb 2014 04:47:08 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E617333FDF3 for ; Thu, 27 Feb 2014 04:47:07 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id C8A96188EB for ; Thu, 27 Feb 2014 04:47:05 +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: <1393475377.175087e2365e78480c61abd20e2cf465160d81d5.ryao@gentoo> Subject: [gentoo-commits] proj/genkernel:master 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: 175087e2365e78480c61abd20e2cf465160d81d5 X-VCS-Branch: master Date: Thu, 27 Feb 2014 04:47:05 +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: 26a7e603-955d-410c-9e5a-04b28f08e5f2 X-Archives-Hash: d2e6e65dcccdd1dce4a9f62888d700fa commit: 175087e2365e78480c61abd20e2cf465160d81d5 Author: Richard Yao gentoo org> AuthorDate: Mon Aug 26 21:32:09 2013 +0000 Commit: Richard Yao gentoo org> CommitDate: Thu Feb 27 04:29:37 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=175087e2 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"