From e7de5142f3fb1865a5d5aa41aaa0944c1e99bbba Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sat, 8 Feb 2025 15:32:52 -0600 Subject: [PATCH] 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. --- newvm.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/newvm.sh b/newvm.sh index da41865..569881e 100755 --- a/newvm.sh +++ b/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}" @@ -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