Skip to content

Commit 050a1be

Browse files
authored
Merge pull request #111 from metalefty/1.7-stable
Release v1.7.2
2 parents 0c93a8f + 3c7eef6 commit 050a1be

File tree

6 files changed

+44
-17
lines changed

6 files changed

+44
-17
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ MAN=$(PROG).8
2020
install:
2121
$(MKDIR) -p $(BINDIR)
2222
$(INSTALL) -m 544 $(PROG) $(BINDIR)/
23+
sed -i '' -e 's|/usr/local/lib/vm-bhyve|$(LIBDIR)|g' $(BINDIR)/$(PROG)
2324

2425
$(MKDIR) -p $(LIBDIR)
2526
$(INSTALL) lib/* $(LIBDIR)/

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ See the sections below for more in-depth details.
4343
6. cp /usr/local/share/examples/vm-bhyve/* /mountpoint/for/pool/vm/.templates/
4444
7. vm switch create public
4545
8. vm switch add public em0
46-
9. vm iso https://download.freebsd.org/ftp/releases/ISO-IMAGES/14.2/FreeBSD-14.2-RELEASE-amd64-bootonly.iso
46+
9. vm iso https://download.freebsd.org/ftp/releases/ISO-IMAGES/14.3/FreeBSD-14.3-RELEASE-amd64-bootonly.iso
4747
10. vm create myguest
48-
11. vm install [-f] myguest FreeBSD-14.2-RELEASE-amd64-bootonly.iso
48+
11. vm install [-f] myguest FreeBSD-14.3-RELEASE-amd64-bootonly.iso
4949
12. vm console myguest
5050

5151
- [ ] Line 1
@@ -187,17 +187,17 @@ example specifies the templatename.conf template, and tells vm-bhyve to create a
187187

188188
You will need an ISO to install the guest with, so download one using the iso command:
189189

190-
# vm iso https://download.freebsd.org/ftp/releases/ISO-IMAGES/14.2/FreeBSD-14.2-RELEASE-amd64-disc1.iso
190+
# vm iso https://download.freebsd.org/ftp/releases/ISO-IMAGES/14.3/FreeBSD-14.3-RELEASE-amd64-disc1.iso
191191

192192
To start a guest install, run the following command. vm-bhyve will run the machine in the background,
193193
so use the console command to connect to it and finish installation.
194194

195-
# vm install testvm FreeBSD-14.2-RELEASE-amd64-disc1.iso
195+
# vm install testvm FreeBSD-14.3-RELEASE-amd64-disc1.iso
196196
# vm console testvm
197197

198198
You can also specify the foreground option to run the guest directly on your terminal:
199199

200-
# vm install -f testvm FreeBSD-14.2-RELEASE-amd64-disc1.iso
200+
# vm install -f testvm FreeBSD-14.3-RELEASE-amd64-disc1.iso
201201

202202
Once installation has finished, you can reboot the guest from inside the console and it will boot up into
203203
the new OS (assuming installation was successful). Further reboots will work as expected and
@@ -259,8 +259,8 @@ To use this feature you'll need install qemu-tools package:
259259

260260
To launch FreeBSD using official cloud image:
261261

262-
# vm img https://download.freebsd.org/ftp/releases/VM-IMAGES/14.2-RELEASE/amd64/Latest/FreeBSD-14.2-RELEASE-amd64.raw.xz
263-
# vm create -t freebsd-zvol -i FreeBSD-14.2-RELEASE-amd64.raw freebsd-cloud
262+
# vm img https://download.freebsd.org/ftp/releases/VM-IMAGES/14.3-RELEASE/amd64/Latest/FreeBSD-14.3-RELEASE-amd64.raw.xz
263+
# vm create -t freebsd-zvol -i FreeBSD-14.3-RELEASE-amd64.raw freebsd-cloud
264264
# vm start freebsd-cloud
265265

266266
To list downloaded images:
@@ -270,7 +270,7 @@ To list downloaded images:
270270
default CentOS-7-x86_64-GenericCloud-20180930_02.raw
271271
default debian-9-openstack-amd64.qcow2
272272
default Fedora-AtomicHost-28-1.1.x86_64.raw
273-
default FreeBSD-14.2-RELEASE-amd64.raw
273+
default FreeBSD-14.3-RELEASE-amd64.raw
274274
default xenial-server-cloudimg-amd64-uefi1.img
275275

276276
## Using cloud-init

lib/vm-base

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: BSD-2-Clause
33
# SPDX-FileCopyrightText: 2018 Matt Churchyard <churchers@gmail.com>
44

5-
VERSION=1.7.1
5+
VERSION=1.7.2
66
VERSION_BSD=$(uname -K)
77
PATH=${PATH}:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin
88

lib/vm-core

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,10 +1280,13 @@ core::configure(){
12801280
# @param string _url if specified, the url will be fetch'ed into $vm_dir/.iso
12811281
#
12821282
core::iso(){
1283-
local _url _ds="default"
1283+
local _url _ds="default" _filename
1284+
local _fetch_opts
12841285

1285-
while getopts d:u _opt ; do
1286+
while getopts 46d:u _opt ; do
12861287
case $_opt in
1288+
4) _fetch_opts="${_fetch_opts} -4" ;;
1289+
6) _fetch_opts="${_fetch_opts} -6" ;;
12871290
d) _ds=${OPTARG} ;;
12881291
*) util::usage ;;
12891292
esac
@@ -1294,7 +1297,11 @@ core::iso(){
12941297

12951298
if [ -n "${_url}" ]; then
12961299
datastore::get_iso "${_ds}" || util::err "unable to locate path for datastore '${_ds}'"
1297-
fetch -o "${VM_DS_PATH}" "${_url}"
1300+
# Essentially, -4 and -6 are mutually exclusive, but fetch(1) does not enforce it.
1301+
# The last one wins, so leaving it to fetch(1).
1302+
fetch ${_fetch_opts} -o "${VM_DS_PATH}" "${_url}"
1303+
_filename=$(basename "${_url}")
1304+
core::decompress "${VM_DS_PATH}/${_filename}"
12981305
else
12991306
datastore::iso_list
13001307
fi
@@ -1329,12 +1336,15 @@ core::decompress(){
13291336
#
13301337
core::img(){
13311338
local _url _ds="default" _filename
1339+
local _fetch_opts
13321340
if ! which qemu-img > /dev/null; then
13331341
util::err "Error: qemu-img is required to work with cloud images! Run 'pkg install qemu-tools'."
13341342
fi
13351343

1336-
while getopts d:u _opt ; do
1344+
while getopts 46d:u _opt ; do
13371345
case $_opt in
1346+
4) _fetch_opts="${_fetch_opts} -4" ;;
1347+
6) _fetch_opts="${_fetch_opts} -6" ;;
13381348
d) _ds=${OPTARG} ;;
13391349
*) util::usage ;;
13401350
esac
@@ -1346,7 +1356,9 @@ core::img(){
13461356
if [ -n "${_url}" ]; then
13471357
datastore::get_img "${_ds}" || util::err "unable to locate path for datastore '${_ds}'"
13481358
_filename=$(basename "${_url}")
1349-
fetch -o "${VM_DS_PATH}" "${_url}"
1359+
# Essentially, -4 and -6 are mutually exclusive, but fetch(1) does not enforce it.
1360+
# The last one wins, so leaving it to fetch(1).
1361+
fetch ${_fetch_opts} -o "${VM_DS_PATH}" "${_url}"
13501362
core::decompress "${VM_DS_PATH}/${_filename}"
13511363
else
13521364
datastore::img_list

lib/vm-util

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ Usage: vm ...
198198
clone <name[@snapshot]> <new-name>
199199
snapshot [-f] <name[@snapshot]>
200200
rollback [-r] <name@snapshot>
201-
iso [url]
202-
img [url]
201+
iso [-46] [url]
202+
img [-46[ [url]
203203
image list
204204
image create [-d description] [-u] <name>
205205
image destroy <uuid>

vm.8

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,12 @@
183183
.Pp
184184
.Nm
185185
.Cm iso
186+
.Op Fl 46
186187
.Op Ar -d datastore
187188
.Op Ar url
188189
.Nm
189190
.Cm img
191+
.Op Fl 46
190192
.Op Ar -d datastore
191193
.Op Ar url
192194
.Pp
@@ -1144,6 +1146,7 @@ This snapshot must exist on both hosts.
11441146
.El
11451147
.It Xo
11461148
.Cm iso
1149+
.Op Fl 46
11471150
.Op Ar -d datastore
11481151
.Op Ar url
11491152
.Xc
@@ -1163,8 +1166,14 @@ The target datasource can be changed by specifying
11631166
.Sy -d datastore
11641167
with
11651168
.Sy url .
1169+
Use the
1170+
.Sy -4
1171+
or
1172+
.Sy -6
1173+
option to specify the IP address family for downloads.
11661174
.It Xo
11671175
.Cm img
1176+
.Op Fl 46
11681177
.Op Ar -d datastore
11691178
.Op Ar url
11701179
.Xc
@@ -1184,6 +1193,11 @@ The target datastore can be changed by specifying
11841193
.Sy -d datastore
11851194
with
11861195
.Sy url .
1196+
Use the
1197+
.Sy -4
1198+
or
1199+
.Sy -6
1200+
option to specify the IP address family for downloads.
11871201
.It Cm image list
11881202
List available images.
11891203
Any virtual machine can be packaged into an image, which can then be used to
@@ -1340,7 +1354,7 @@ which can be achieved using the
13401354
.Sy none
13411355
value.
13421356
.It fwcfg
1343-
This option allows you to specify the fwcfg interface.
1357+
This option allows you to specify the fw_cfg interface.
13441358
The valid options are
13451359
.Sy bhyve ,
13461360
or

0 commit comments

Comments
 (0)