Gentoo Archives: gentoo-commits

From: "Robin H. Johnson" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/genkernel:master commit in: defaults/
Date: Wed, 02 May 2012 02:52:04
Message-Id: 1335925780.b5b535f5aa6fa776dadc2e324b94211224cdb7f9.robbat2@gentoo
1 commit: b5b535f5aa6fa776dadc2e324b94211224cdb7f9
2 Author: Richard Yao <ryao <AT> cs <DOT> stonybrook <DOT> edu>
3 AuthorDate: Wed May 2 02:28:10 2012 +0000
4 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
5 CommitDate: Wed May 2 02:29:40 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=b5b535f5
7
8 Do not import a pool that the kernel automatically imported
9
10 This works around the following upstream issue:
11 https://github.com/zfsonlinux/zfs/issues/714
12
13 Signed-off-by: Richard Yao <ryao <AT> cs.stonybrook.edu>
14
15 ---
16 defaults/initrd.scripts | 20 +++++++++++++-------
17 1 files changed, 13 insertions(+), 7 deletions(-)
18
19 diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
20 index a7d88e4..c468ad4 100755
21 --- a/defaults/initrd.scripts
22 +++ b/defaults/initrd.scripts
23 @@ -654,7 +654,7 @@ startVolumes() {
24
25 if [ "${USE_ZFS}" = '1' ]
26 then
27 - if [ -z "${ZFS_POOL}" ];
28 + if [ -z "${ZFS_POOL}" ]
29 then
30 good_msg "Importing ZFS pools"
31
32 @@ -667,15 +667,21 @@ startVolumes() {
33 bad_msg "Imported ZFS pools failed"
34 fi
35 else
36 - good_msg "Importing ZFS pool ${ZFS_POOL}"
37
38 - /sbin/zpool import -N "${ZPOOL_FORCE}" "${ZFS_POOL}"
39 -
40 - if [ "$?" = '0' ]
41 + if [ "$(zpool list -H -o name ${ZFS_POOL} 2>&1)" = "$ZFS_POOL" ]
42 then
43 - good_msg "Importing ${ZFS_POOL} succeeded"
44 + good_msg "ZFS pool ${ZFS_POOL} already imported"
45 else
46 - bad_msg "Importing ${ZFS_POOL} failed"
47 + good_msg "Importing ZFS pool ${ZFS_POOL}"
48 +
49 + /sbin/zpool import -N "${ZPOOL_FORCE}" "${ZFS_POOL}"
50 +
51 + if [ "$?" = '0' ]
52 + then
53 + good_msg "Importing ${ZFS_POOL} succeeded"
54 + else
55 + bad_msg "Importing ${ZFS_POOL} failed"
56 + fi
57 fi
58 fi
59 fi