Skip to content
GitLab
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
83718697
Commit
83718697
authored
Feb 09, 2016
by
Mike Hibler
Browse files
Fixups for configuring FreeBSD VMs.
parent
b6b227e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
clientside/tmcc/linux/xen/libvnode_xen.pm
View file @
83718697
#!/usr/bin/perl -wT
#
# Copyright (c) 2008-201
5
University of Utah and the Flux Group.
# Copyright (c) 2008-201
6
University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
...
...
@@ -1742,16 +1742,25 @@ sub vnodePreConfig($$$$$){
my
$ldisk
=
"
da0s1
";
if
(
-
e
"
$vnoderoot
/etc/dumpdates
")
{
mysystem2
("
sed -i.bak -e 's;^/dev/
[ad][da][04
]s1;/dev/
$ldisk
;'
"
.
mysystem2
("
sed -i.bak -e 's;^/dev/
\\
(ada
\\
|ad
\\
|da
\\
)[0-9
]s1;/dev/
$ldisk
;'
"
.
"
$vnoderoot
/etc/dumpdates
");
goto
bad
if
(
$?
);
}
mysystem2
("
sed -i.bak -e 's;^/dev/
[ad][da][04
]s1;/dev/
$ldisk
;'
"
.
mysystem2
("
sed -i.bak -e 's;^/dev/
\\
(ada
\\
|ad
\\
|da
\\
)[0-9
]s1;/dev/
$ldisk
;'
"
.
"
$vnoderoot
/etc/fstab
");
goto
bad
if
(
$?
);
#
# Put out the /boot/loader.conf header we look for in prepare
#
if
(
open
(
LC
,
"
>>
$vnoderoot
/boot/loader.conf
"))
{
print
LC
"
# The remaining lines were added by Emulab slicefix.
\n
";
print
LC
"
# DO NOT ADD ANYTHING AFTER THIS POINT AS IT WILL GET REMOVED.
\n
";
close
(
LC
);
}
#
# In HVM the emulated RTC is UTC.
# Make sure FreeBSD knows that.
...
...
@@ -1768,6 +1777,10 @@ sub vnodePreConfig($$$$$){
mysystem
("
echo 'vfs.unmapped_buf_allowed=0'
"
.
"
>>
$vnoderoot
/boot/loader.conf
");
}
#
# Make sure console is comconsole
#
mysystem
("
echo 'console=comconsole' >>
$vnoderoot
/boot/loader.conf
");
}
#
...
...
@@ -1785,8 +1798,13 @@ sub vnodePreConfig($$$$$){
# By putting FS=/ in there, we can force libsetup's os_mkextrafs to
# use the root filesystem.
#
# XXX note the check for the existence of /var/emulab/boot. In older
# FreeBSD images, /var is a separate filesystem which we don't mount
# here. Just use the extra FS in that case.
#
if
(
!
exists
(
$vnconfig
->
{'
attributes
'}
->
{'
XEN_EXTRAFS
'})
&&
!
exists
(
$vnconfig
->
{'
attributes
'}
->
{'
XEN_EXTRADISKS
'}))
{
!
exists
(
$vnconfig
->
{'
attributes
'}
->
{'
XEN_EXTRADISKS
'})
&&
-
d
"
$vnoderoot
/var/emulab/boot
")
{
mysystem
("
echo 'FS=/' >
$vnoderoot
/var/emulab/boot/extrafs
");
}
else
{
unlink
("
$vnoderoot
/var/emulab/boot/extrafs
");
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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