newvm: Allow setting cfgpol branch
The script that runs on first boot of a new machine that triggers host provisioning can read the name of the configuration policy branch to checkout from the QEMU firmware configuration option. This commit adds a `--cfg-branch` argument to `newvm.sh` that sets that value. This will be useful for testing new policy on a new VM.unifi-restore
parent
4d30798f54
commit
e7de5142f3
11
newvm.sh
11
newvm.sh
|
@ -75,6 +75,13 @@ while [ $# -gt 0 ]; do
|
|||
--domain=*)
|
||||
dnsdomain=${1#=*}
|
||||
;;
|
||||
--cfg-branch)
|
||||
shift
|
||||
cfg_branch=$1
|
||||
;;
|
||||
--cfg-branch=*)
|
||||
cfg_branch=${1#*=}
|
||||
;;
|
||||
--group)
|
||||
shift
|
||||
groups_xml="${groups_xml}<group name=\"${1}\"/>"
|
||||
|
@ -163,6 +170,10 @@ set -- \
|
|||
--boot uefi \
|
||||
"$@"
|
||||
|
||||
if [ -n "${cfg_branch}" ]; then
|
||||
set -- "$@" --qemu-commandline="-fw_cfg opt/dch/cfg-branch,string=${cfg_branch}"
|
||||
fi
|
||||
|
||||
if $console; then
|
||||
set -- "$@" --autoconsole text
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue