linuxrc: move zfs initialization code to zfs_init() in initrd.scripts

master
Fabio Erculiani 12 years ago
parent 071fff18b1
commit ecdb16659b

@ -836,6 +836,34 @@ wait_for_zfs() {
while [ ! -c /dev/zfs ]; do modprobe zfs 2> /dev/null; done;
}
zfs_init() {
# Set variables based on the value of REAL_ROOT
case "${REAL_ROOT}" in
ZFS=*)
ZFS_POOL=${REAL_ROOT#*=}
ZFS_POOL=${ZFS_POOL%%/*}
USE_ZFS=1
;;
ZFS)
USE_ZFS=1
;;
esac
# Verify that it is safe to use ZFS
if [ "USE_ZFS" = "1" ]
then
for i in /sbin/zfs /sbin/zpool
do
if [ ! -x ${i} ]
then
USE_ZFS=0
bad_msg 'Aborting use of zfs because ${i} not found!'
break
fi
done
fi
}
start_volumes() {
#good_msg 'Checking if volumes need to be started...'

@ -275,31 +275,8 @@ then
fi
fi
# Set variables based on the value of REAL_ROOT
case "${REAL_ROOT}" in
ZFS=*)
ZFS_POOL=${REAL_ROOT#*=}
ZFS_POOL=${ZFS_POOL%%/*}
USE_ZFS=1
;;
ZFS)
USE_ZFS=1
;;
esac
# Verify that it is safe to use ZFS
if [ "USE_ZFS" = "1" ]
then
for i in /sbin/zfs /sbin/zpool
do
if [ ! -x ${i} ]
then
USE_ZFS=0
bad_msg 'Aborting use of zfs because ${i} not found!'
break
fi
done
fi
# initialize ZFS filesystems
zfs_init
cmdline_hwopts

Loading…
Cancel
Save