forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Activate LVM volume groups before looking for zpools.
fixes zfsonlinux/pkg-zfs#102
- Loading branch information
1 parent
43518d9
commit 5f052dd
Showing
2 changed files
with
65 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/bin/sh | ||
PREREQ="mdadm mdrun multipath" | ||
|
||
prereqs() | ||
{ | ||
echo "$PREREQ" | ||
} | ||
|
||
case $1 in | ||
# get pre-requisites | ||
prereqs) | ||
prereqs | ||
exit 0 | ||
;; | ||
esac | ||
|
||
# source for log_*_msg() functions, see LP: #272301 | ||
. /scripts/functions | ||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
# | ||
# Helper functions | ||
# | ||
message() | ||
{ | ||
if [ -x /bin/plymouth ] && plymouth --ping; then | ||
plymouth message --text="$@" | ||
else | ||
echo "$@" >&2 | ||
fi | ||
return 0 | ||
} | ||
|
||
udev_settle() | ||
{ | ||
# Wait for udev to be ready, see https://launchpad.net/bugs/85640 | ||
if [ -x /sbin/udevadm ]; then | ||
/sbin/udevadm settle --timeout=30 | ||
elif [ -x /sbin/udevsettle ]; then | ||
/sbin/udevsettle --timeout=30 | ||
fi | ||
return 0 | ||
} | ||
|
||
|
||
activate_vg() | ||
{ | ||
# Sanity checks | ||
if [ ! -x /sbin/lvm ]; then | ||
message "jgoerzenactivatevg: lvm is not available" | ||
This comment has been minimized.
Sorry, something went wrong. |
||
return 1 | ||
fi | ||
|
||
# Detect and activate available volume groups | ||
/sbin/lvm vgscan | ||
/sbin/lvm vgchange -a y --sysinit | ||
return $? | ||
} | ||
|
||
udev_settle | ||
activate_vg | ||
|
||
exit 0 |
This isn't portable, looks to be unused and should be removed.