mirror of
https://github.com/churchers/vm-bhyve.git
synced 2026-01-04 12:03:44 +01:00
Add Makefile command to setup VM directory and copy templates
This commit is contained in:
15
Makefile
15
Makefile
@@ -2,8 +2,6 @@
|
||||
# vm-bhyve Makefile
|
||||
#
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
PREFIX?=/usr/local
|
||||
MAN=
|
||||
BINOWN=root
|
||||
@@ -29,7 +27,16 @@ install:
|
||||
$(INSTALL) $(MAN).gz $(MANDIR)/
|
||||
rm -f $(MAN).gz
|
||||
|
||||
vmdir:
|
||||
@if [ -z "${PATH}" ]; then \
|
||||
echo "Usage: make vmdir PATH=/path"; \
|
||||
else \
|
||||
${MKDIR} -p "${PATH}"; \
|
||||
${MKDIR} "${PATH}/.templates"; \
|
||||
${MKDIR} "${PATH}/.iso"; \
|
||||
${MKDIR} "${PATH}/.config"; \
|
||||
cp sample-templates/* "${PATH}/.templates/"; \
|
||||
fi;
|
||||
|
||||
.MAIN: clean
|
||||
clean: ;
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
@@ -25,7 +25,7 @@ Install the vm script using the Makefile
|
||||
|
||||
Create a directory for the virtual machines
|
||||
|
||||
# mkdir /path/to/my/vms
|
||||
# make vmdir PATH=/path/to/my/vms
|
||||
|
||||
Update `/etc/rc.conf`
|
||||
|
||||
@@ -40,8 +40,6 @@ This command needs to be run once after each host reboot (this is normally handl
|
||||
|
||||
# vm init
|
||||
|
||||
Copy the sample templates to the folder `/path/to/my/vms/.templates/`
|
||||
|
||||
This completes the basic setup
|
||||
|
||||
##Virtual Switch Management
|
||||
|
||||
@@ -37,6 +37,9 @@ __parse_cmd(){
|
||||
switch)
|
||||
__parse_switch_cmd "$@"
|
||||
;;
|
||||
image)
|
||||
__parse_image_cmd "$@"
|
||||
;;
|
||||
list)
|
||||
__vm_list
|
||||
;;
|
||||
|
||||
1
vm
1
vm
@@ -43,6 +43,7 @@ fi
|
||||
[ ! -d "${vm_dir}/.config" ] && mkdir "${vm_dir}/.config"
|
||||
[ ! -d "${vm_dir}/.templates" ] && mkdir "${vm_dir}/.templates"
|
||||
[ ! -d "${vm_dir}/.iso" ] && mkdir "${vm_dir}/.iso"
|
||||
[ ! -d "${vm_dir}/.img" ] && mkdir "${vm_dir}/.img"
|
||||
|
||||
# get libs
|
||||
if [ -e "/usr/local/lib/vm-bhyve" ]; then
|
||||
|
||||
Reference in New Issue
Block a user