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 817561381F3 for ; Sun, 9 Jun 2013 06:43:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8C15AE07E8; Sun, 9 Jun 2013 06:43:32 +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 AF897E076D for ; Sun, 9 Jun 2013 06:43:31 +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 C638B33E2F4 for ; Sun, 9 Jun 2013 06:43:30 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 6E68EE5462 for ; Sun, 9 Jun 2013 06:43:29 +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: <1370760106.ee71084ed92acfd1a91e9358f72313e06793899d.ryao@gentoo> Subject: [gentoo-commits] proj/genkernel:ryao commit in: /, defaults/ X-VCS-Repository: proj/genkernel X-VCS-Files: defaults/initrd.scripts gen_initramfs.sh X-VCS-Directories: / defaults/ X-VCS-Committer: ryao X-VCS-Committer-Name: Richard Yao X-VCS-Revision: ee71084ed92acfd1a91e9358f72313e06793899d X-VCS-Branch: ryao Date: Sun, 9 Jun 2013 06:43:29 +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: 24b91378-d3e6-4215-aea3-cc363b17cda2 X-Archives-Hash: 7495b1bb1ab5f23e246721c00aedec57 commit: ee71084ed92acfd1a91e9358f72313e06793899d Author: Richard Yao gentoo org> AuthorDate: Sun Jun 9 06:38:55 2013 +0000 Commit: Richard Yao gentoo org> CommitDate: Sun Jun 9 06:41:46 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=ee71084e Remove zpool.cache from initramfs Importing the root pool with zpool.cache present will fail in rare circumstances. This commit removes zpool.cache from initramfs and simplifies the zpool import code. The simplification should have the side effect of eliminating an incorrect error message that has been observed on some systems. Signed-off-by: Richard Yao gentoo.org> --- defaults/initrd.scripts | 25 ++++++------------------- gen_initramfs.sh | 16 ++++++++-------- 2 files changed, 14 insertions(+), 27 deletions(-) diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index ef58b5b..b8c355a 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -722,28 +722,15 @@ startVolumes() { bad_msg "Imported ZFS pools failed" fi else + good_msg "Importing ZFS pool ${ZFS_POOL}" - if [ "$(zpool list -H -o name ${ZFS_POOL} 2>&1)" = "$ZFS_POOL" ] - then - good_msg "ZFS pool ${ZFS_POOL} already imported." + /sbin/zpool import -N ${ZPOOL_FORCE} "${ZFS_POOL}" - if [ -n "${CRYPT_ROOT}" -o -n "${CRYPT_SWAP}" ] - then - good_msg "LUKS detected. Reimporting ${ZFS_POOL}" - /sbin/zpool export -f "${ZFS_POOL}" - /sbin/zpool import -N ${ZPOOL_FORCE} "${ZFS_POOL}" - fi + if [ "$?" = '0' ] + then + good_msg "Import of ${ZFS_POOL} succeeded" else - good_msg "Importing ZFS pool ${ZFS_POOL}" - - /sbin/zpool import -N ${ZPOOL_FORCE} "${ZFS_POOL}" - - if [ "$?" = '0' ] - then - good_msg "Importing ${ZFS_POOL} succeeded" - else - bad_msg "Importing ${ZFS_POOL} failed" - fi + bad_msg "Import of ${ZFS_POOL} failed" fi fi fi diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 6ad51c1..3be93c0 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -424,14 +424,14 @@ append_zfs(){ rm -r "${TEMP}/initramfs-zfs-temp" fi - mkdir -p "${TEMP}/initramfs-zfs-temp/etc/zfs/" - - # Copy files to /etc/zfs - for i in /etc/zfs/{zdev.conf,zpool.cache} - do - cp -a "${i}" "${TEMP}/initramfs-zfs-temp/etc/zfs" 2> /dev/null \ - || print_warning 1 "Could not copy file ${i} for ZFS" - done + # Copy system zdev.conf + if [ -f /etc/zfs/zdev.conf ] + then + print_info 1 " >> Copying system zdev.conf into initramfs..." + mkdir -p "${TEMP}/initramfs-zfs-temp/etc/zfs/" + cp -a "/etc/zfs/zdev.conf" "${TEMP}/initramfs-zfs-temp/etc/zfs" 2> /dev/null \ + || gen_die "Could not copy file ${i} for ZFS" + fi # Copy binaries copy_binaries "${TEMP}/initramfs-zfs-temp" /sbin/{mount.zfs,zfs,zpool}