Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
205844a5
Commit
205844a5
authored
Jun 20, 2013
by
Mike Hibler
Browse files
Add zfs_enable=YES to /etc/rc.conf, otherwise zfs mounts are not done.
parent
5eb2e205
Changes
1
Show whitespace changes
Inline
Side-by-side
clientside/tmcc/freebsd/liblocstorage.pm
View file @
205844a5
...
...
@@ -631,21 +631,39 @@ sub os_init_storage($)
$so
{'
USEZFS
'}
=
$usezfs
;
#
# Allow for the zpool to exist.
# zfs: see if pool already exists, set zfs_enable in /etc/rc.conf.
#
if
(
$usezfs
)
{
#
# XXX we create the empty SPACEMAP so we don't try to initialize
# it later. ZFS never uses the SPACEMAP once the pool is created.
#
if
(
$usezfs
&&
is_lvm_initialized
(
1
))
{
if
(
is_lvm_initialized
(
1
))
{
$so
{'
ZFS_POOLCREATED
'}
=
1
;
$so
{'
SPACEMAP
'}
=
();
}
if
(
mysystem
("
grep -q 'zfs_enable=
\"
YES
\"
' /etc/rc.conf
"))
{
if
(
!
open
(
FD
,
"
>>/etc/rc.conf
"))
{
warn
("
*** storage: could not enable zfs in /etc/rc.conf
\n
");
return
undef
;
}
print
FD
"
# added by
$BINDIR
/rc/rc.storage
\n
";
print
FD
"
zfs_enable=
\"
YES
\"\n
";
close
(
FD
);
# and do a one-time start
if
(
-
x
"
/etc/rc.d/zfs
")
{
mysystem
("
/etc/rc.d/zfs start
");
}
}
}
#
# gvinum: put module load in /boot/loader.conf so that /etc/fstab
# mounts will work.
#
if
(
!
$usezfs
&&
mysystem
("
grep -q 'geom_vinum_load=
\"
YES
\"
' /boot/loader.conf
"))
{
elsif
(
mysystem
("
grep -q 'geom_vinum_load=
\"
YES
\"
' /boot/loader.conf
"))
{
if
(
!
open
(
FD
,
"
>>/boot/loader.conf
"))
{
warn
("
*** storage: could not enable gvinum in /boot/loader.conf
\n
");
return
undef
;
...
...
@@ -1734,6 +1752,15 @@ sub os_remove_storage_slice($$$)
}
}
}
#
# If we are the one that enabled ZFS, disable it
#
if
(
!
mysystem
("
grep -q '^# added by.*rc.storage' /etc/rc.conf
"))
{
if
(
mysystem
("
sed -i -e '/^# added by.*rc.storage/,+1d' /etc/rc.conf
"))
{
warn
("
***
$lv
: could not remove zfs_enable from /etc/rc.conf
\n
");
}
}
}
#
# Other, gvinum volume:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment