newvm: Avoid adding graphics adapter by default
VMs don't really need graphical consoles; serial terminals are good enough, or even better given that they are logged. For the few cases where a graphical console is actually necessary, the `newvm.sh` script can add one with the `--graphics` argument.unifi-restore
parent
0824e6bea0
commit
04718fa6d0
9
newvm.sh
9
newvm.sh
|
@ -12,6 +12,7 @@ network=network=kube
|
||||||
dnsdomain=host.pyrocufflink.black
|
dnsdomain=host.pyrocufflink.black
|
||||||
console=true
|
console=true
|
||||||
default_groups=true
|
default_groups=true
|
||||||
|
graphics=false
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
printf 'usage: %s [options] name\n' "${0##*/}"
|
printf 'usage: %s [options] name\n' "${0##*/}"
|
||||||
|
@ -76,6 +77,9 @@ while [ $# -gt 0 ]; do
|
||||||
--domain=*)
|
--domain=*)
|
||||||
dnsdomain=${1#=*}
|
dnsdomain=${1#=*}
|
||||||
;;
|
;;
|
||||||
|
--with-graphics)
|
||||||
|
graphics=true
|
||||||
|
;;
|
||||||
--cfg-branch)
|
--cfg-branch)
|
||||||
shift
|
shift
|
||||||
cfg_branch=$1
|
cfg_branch=$1
|
||||||
|
@ -105,6 +109,7 @@ while [ $# -gt 0 ]; do
|
||||||
name="$1"
|
name="$1"
|
||||||
else
|
else
|
||||||
usage >&2
|
usage >&2
|
||||||
|
printf 'unknown option: %s\n' "${1}" >&2
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
esac
|
esac
|
||||||
|
@ -183,6 +188,10 @@ if [ -n "${cfg_branch}" ]; then
|
||||||
set -- "$@" --qemu-commandline="-fw_cfg opt/dch/cfg-branch,string=${cfg_branch}"
|
set -- "$@" --qemu-commandline="-fw_cfg opt/dch/cfg-branch,string=${cfg_branch}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! $graphics; then
|
||||||
|
set -- "$@" --graphics=none
|
||||||
|
fi
|
||||||
|
|
||||||
if $console; then
|
if $console; then
|
||||||
set -- "$@" --autoconsole text
|
set -- "$@" --autoconsole text
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue