@@ -20,6 +20,7 @@ ARGUMENT_LIST=(
2020 " test-dir:"
2121 " test-name:"
2222 " box-name:"
23+ " vm"
2324)
2425
2526function usage() {
@@ -30,6 +31,8 @@ function usage() {
3031 echo " some test name, e.g. test-image-disk"
3132 echo " --box-name <name>"
3233 echo " name of the box to use for the build, default: universal"
34+ echo " --vm"
35+ echo " build in a virtual machine instead of a container"
3336}
3437
3538if ! opts=$( getopt \
@@ -61,6 +64,11 @@ while [[ $# -gt 0 ]]; do
6164 shift 2
6265 ;;
6366
67+ --vm)
68+ argVM=1
69+ shift
70+ ;;
71+
6472 * )
6573 break
6674 ;;
@@ -107,15 +115,18 @@ function create_build_commands() {
107115 build_command=" kiwi-ng --debug"
108116 has_profiles=false
109117 repo_options=$( create_repo_list " ${build_dir} " )
118+ box_options=" system boxbuild --box ${boxname} "
119+ if [ ! " ${argVM} " = 1 ]; then
120+ box_options=" ${box_options} --container"
121+ fi
110122 for profile in $(
111123 xmllint --xpath " //image/profiles/profile/@name" \
112124 " ${image} /appliance.kiwi" 2> /dev/null | cut -f2 -d\"
113125 ) ; do
114126 has_profiles=true
115127 target_dir=" build_results/${base_image} /${profile} "
116128 build_command=" ${build_command} --profile ${profile} "
117- build_command=" ${build_command} system boxbuild"
118- build_command=" ${build_command} --box ${boxname} --container --"
129+ build_command=" ${build_command} ${box_options} --"
119130 build_command=" ${build_command} --description $image "
120131 build_command=" ${build_command} ${repo_options} "
121132 build_command=" ${build_command} --target-dir ${target_dir} "
@@ -126,8 +137,7 @@ function create_build_commands() {
126137 done
127138 if [ " ${has_profiles} " = " false" ]; then
128139 target_dir=" build_results/${base_image} "
129- build_command=" ${build_command} system boxbuild"
130- build_command=" ${build_command} --box ${boxname} --container --"
140+ build_command=" ${build_command} ${box_options} --"
131141 build_command=" ${build_command} --description $image "
132142 build_command=" ${build_command} ${repo_options} "
133143 build_command=" ${build_command} --target-dir ${target_dir} "
0 commit comments