1 |
commit: 0f399f48ff1e6c07d88a7ef18b27df84e8cbac6a |
2 |
Author: Richard Yao <ryao <AT> cs <DOT> stonybrook <DOT> edu> |
3 |
AuthorDate: Mon Apr 30 16:39:04 2012 +0000 |
4 |
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Apr 30 19:08:37 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=0f399f48 |
7 |
|
8 |
Verify that binaries exist before startVolumes calls them |
9 |
|
10 |
--- |
11 |
defaults/initrd.scripts | 14 ++++++++++++-- |
12 |
1 files changed, 12 insertions(+), 2 deletions(-) |
13 |
|
14 |
diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts |
15 |
index 4aad686..02843c5 100755 |
16 |
--- a/defaults/initrd.scripts |
17 |
+++ b/defaults/initrd.scripts |
18 |
@@ -599,7 +599,12 @@ startVolumes() { |
19 |
|
20 |
if [ "${USE_MDADM}" = '1' ] |
21 |
then |
22 |
- /sbin/mdadm --assemble --scan |
23 |
+ if [ -e '/sbin/mdadm' ] |
24 |
+ then |
25 |
+ /sbin/mdadm --assemble --scan |
26 |
+ else |
27 |
+ bad_msg "mdadm not found: skipping mdadm raid assembly!" |
28 |
+ fi |
29 |
fi |
30 |
|
31 |
if [ "${USE_DMRAID_NORMAL}" = '1' ] |
32 |
@@ -649,7 +654,12 @@ startVolumes() { |
33 |
|
34 |
if [ "${USE_ZFS}" = '1' ] |
35 |
then |
36 |
- /sbin/zpool import -N -a ${ZPOOL_FORCE} |
37 |
+ if [ -e '/sbin/zpool' ] |
38 |
+ then |
39 |
+ /sbin/zpool import -N -a ${ZPOOL_FORCE} |
40 |
+ else |
41 |
+ bad_msg "zpool not found: skipping ZFS pool import!" |
42 |
+ fi |
43 |
fi |
44 |
} |