From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RuJng-00043I-S0 for garchives@archives.gentoo.org; Mon, 06 Feb 2012 08:19:49 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E27EDE064A; Mon, 6 Feb 2012 08:19:36 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id B2F67E064A for ; Mon, 6 Feb 2012 08:19:36 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 374C21B404A for ; Mon, 6 Feb 2012 08:19:36 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 2931A80057 for ; Mon, 6 Feb 2012 08:19:35 +0000 (UTC) From: "Robin H. Johnson" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Robin H. Johnson" Message-ID: <5f4d31dfd0eb71c4001afcc6d32a610060901c04.robbat2@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: / X-VCS-Repository: proj/genkernel X-VCS-Files: ChangeLog gen_initramfs.sh X-VCS-Directories: / X-VCS-Committer: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: 5f4d31dfd0eb71c4001afcc6d32a610060901c04 Date: Mon, 6 Feb 2012 08:19: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 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 64724dca-7199-4506-ab41-67b164be9bc2 X-Archives-Hash: c7d0228188323581b6f4877c2d45d7be commit: 5f4d31dfd0eb71c4001afcc6d32a610060901c04 Author: Robin H. Johnson gentoo org> AuthorDate: Mon Feb 6 08:05:54 2012 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Mon Feb 6 08:19:17 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/genkernel.git= ;a=3Dcommit;h=3D5f4d31df copy_binaries, multipath: refactor for ease of use and readability. Signed-off-by: Robin H. Johnson gentoo.org> --- ChangeLog | 3 +++ gen_initramfs.sh | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0dec7c5..6c2a7d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ # Distributed under the GPL v2 # $Id$ =20 + 06 Feb 2012; Robin H. Johnson gen_initramfs.sh: + Refactor copy_binaries and multipath slightly for ease of usage and re= adability. + 06 Feb 2012: Richard Yao gen_initramfs.sh: Refactor multipath initramfs generation using copy_binaries. =20 diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 02e6554..43fd77f 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -4,11 +4,14 @@ CPIO_ARGS=3D"--quiet -o -H newc" =20 copy_binaries() { - - local destdir=3D$1 files=3D$2 - - # Copy files - lddtree $files | tr ')(' '\n' |awk '/=3D>/{ if($3 ~ /^\//){print $3}}'= | sort | uniq | cpio -p --make-directories --dereference --quiet $destdi= r + local destdir=3D$1 + shift + lddtree "$@" \ + | tr ')(' '\n' \ + | awk '/=3D>/{ if($3 ~ /^\//){print $3}}' \ + | sort \ + | uniq \ + | cpio -p --make-directories --dereference --quiet $destdir =20 } =20 @@ -159,13 +162,10 @@ append_multipath(){ rm -r "${TEMP}/initramfs-multipath-temp" fi print_info 1 ' Multipath support being added' - mkdir -p "${TEMP}/initramfs-multipath-temp/bin/" - mkdir -p "${TEMP}/initramfs-multipath-temp/etc/"=20 - mkdir -p "${TEMP}/initramfs-multipath-temp/sbin/" - mkdir -p "${TEMP}/initramfs-multipath-temp/lib/" + mkdir -p "${TEMP}"/initramfs-multipath-temp/{bin,etc,sbin,lib}/ =20 # Copy files - copy_binaries "${TEMP}/initramfs-multipath-temp" "$(echo /sbin/{multipa= th,kpartx,mpath_prio_*,devmap_name,dmsetup} /lib64/udev/scsi_id /bin/moun= tpoint)" + copy_binaries "${TEMP}/initramfs-multipath-temp" /sbin/{multipath,kpart= x,mpath_prio_*,devmap_name,dmsetup} /lib64/udev/scsi_id /bin/mountpoint =20 if [ -x /sbin/multipath ] then