-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings-tui-bhyve.subr
727 lines (618 loc) · 17.4 KB
/
settings-tui-bhyve.subr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
# BHYVE-related TUI function
if [ ! "$_CBSD_SETTINGS_TUI_BHYVE_SUBR" ]; then
_CBSD_SETTINGS_TUI_BHYVE_SUBR=1
###
# bhyve form for $bhyve_flags
get_construct_bhyve_flags()
{
title=" additioal bhyve_flags "
prompt="enter additional bhyve(8) args"
defaultitem="${bhyve_flags}"
cbsd_inputbox_simple && bhyve_flags="${mtag}"
}
# bhyve form for $bhyve_vnc_vgaconf
get_construct_bhyve_vnc_vgaconf_menu()
{
local _input _res
# for default values
readconf vnc.conf
local title="VGACONF setting"
local defaultitem="${bhyve_vnc_vgaconf}"
local menu_list="
'io' 'io' 'I/O port queries'
'on' 'on' 'for legacy VGA I/O and memory regions'
'off' 'off' 'VGA adapter is present if they detect the I/O ports'
" # END-QUOTE
cbsd_menubox
retval=$?
case $retval in
${DIALOG_OK})
[ -n "${mtag}" ] && bhyve_vnc_vgaconf="${mtag}"
;;
*)
;;
esac
return ${retval}
}
# bhyve form for $vm_hostbridge
get_construct_vm_hostbridge()
{
local _input _res
local title="${GET_HOSTBRIDGE_MSG}"
local defaultitem="${vm_hostbridge}"
local menu_list="
'hostbridge' 'hostbridge' 'Provide a simple host bridge.'
'amd_hostbridge' 'amd_hostbridge' 'The amd_hostbridge emulation is identical but uses a PCI vendor ID of AMD'
" # END-QUOTE
cbsd_menubox
retval=$?
case $retval in
${DIALOG_OK})
[ -n "${mtag}" ] && vm_hostbridge="${mtag}"
;;
*)
;;
esac
return ${retval}
}
# bhyve form for $vnc_resolution
get_construct_bhyve_vnc_resolution_menu()
{
local _input _res
# for default values
readconf vnc.conf
local title="VNC Resolution"
local defaultitem="${bhyve_vnc_resolution}"
local menu_list="
'640x480' '640 x 480' '640 x 480'
'800x600' '800 x 600' '800 x 600'
'1024x768' '1024 x 768' '1024 x 768'
'1280x720' '1280 x 720' '1280 x 720'
'1280x1024' '1280 x 1024' '1280 x 1024'
'1600x900' '1600 x 900' '1600 x 900'
'1600x1200' '1600 x 1200' '1600 x 1200'
'1920x1080' '1920 x 1080' '1920 x 1080'
'1920x1200' '1920 x 1200' '1920 x 1200'
" # END-QUOTE
cbsd_menubox
retval=$?
case $retval in
${DIALOG_OK})
[ -n "${mtag}" ] && bhyve_vnc_resolution="${mtag}"
;;
*)
;;
esac
return ${retval}
}
# bhyve form for bhyve options
get_construct_bhyve_options_menu()
{
local _input _res item_let=A
local title="Additional bhyve arguments"
local defaultitem=
local menu_choice=
local _checkbox="bhyve_generate_acpi bhyve_wire_memory bhyve_rts_keeps_utc bhyve_force_msi_irq bhyve_x2apic_mode bhyve_mptable_gen bhyve_ignore_msr_acc double_acpi virtio_rnd"
f_dialog_default_fetch defaultitem
# checkbox mark
for i in ${_checkbox}; do
eval _mytest=\$$i
if [ "${_mytest}" = "1" ]; then
export ${i}_mark="X"
else
export ${i}_mark=" "
fi
done
local menu_list=
menu_list="${menu_list} '${item_let} bhyve_generate_acpi' '[${bhyve_generate_acpi_mark}]' 'Generate ACPI tables. Required for FreeBSD/amd64 guests'"
inc_menu_index item_let
menu_list="${menu_list} '${item_let} bhyve_wire_memory' '[${bhyve_wire_memory_mark}]' 'Wire guest memory'"
inc_menu_index item_let
menu_list="${menu_list} '${item_let} bhyve_rts_keeps_utc' '[${bhyve_rts_keeps_utc_mark}]' 'RTC keeps UTC time'"
inc_menu_index item_let
menu_list="${menu_list} '${item_let} bhyve_force_msi_irq' '[${bhyve_force_msi_irq_mark}]' 'Force virtio PCI device to use MSI interrupts instead of MSI-X'"
inc_menu_index item_let
menu_list="${menu_list} '${item_let} bhyve_x2apic_mode' '[${bhyve_x2apic_mode_mark}]' 'The guests local APIC is configured in x2APIC mode'"
inc_menu_index item_let
menu_list="${menu_list} '${item_let} bhyve_mptable_gen' '[${bhyve_mptable_gen_mark}]' 'Disable MPtable generation'"
inc_menu_index item_let
menu_list="${menu_list} '${item_let} bhyve_ignore_msr_acc' '[${bhyve_ignore_msr_acc_mark}]' 'Ignore accesses to unimplemented MSRs'"
inc_menu_index item_let
menu_list="${menu_list} '${item_let} double_acpi' '[${double_acpi_mark}]' 'Compatible for double ACPI on poweroff'"
inc_menu_index item_let
menu_list="${menu_list} '${item_let} virtio_rnd' '[${virtio_rnd_mark}]' 'Enable Virtio RNG interface'"
inc_menu_index item_let
menu_list="${menu_list} '${item_let} uuid' '[$(curval uuid)]' 'set vm UUID manually'"
inc_menu_index item_let
menu_list="${menu_list} '${item_let} mnt_start' '$(curval mnt_start)' 'External script for mount env data'"
inc_menu_index item_let
menu_list="${menu_list} '${item_let} mnt_stop' '$(curval mnt_stop)' 'External script for unmount env data'"
# build main menu: params first
# bhyverun_wrapper, bhyvestop_wrapper, bhyve_cmd
for i in bhyverun_wrapper; do
eval VAL=\$$i
_mydesc=
eval _mydesc=\$${i}_msg
[ -z "${_mydesc}" ] && _mydesc="no description"
if [ -z "${VAL}" ]; then
menu_list="${menu_list} '${item_let} ${i}' ' ' '${_mydesc}'"
else
menu_list="${menu_list} '${item_let} ${i}' '${VAL}' '${_mydesc}'"
fi
inc_menu_index item_let
done
menu_list="${menu_list} 'Save' 'Save changes and quit' 'Save!'"
cbsd_menubox
retval=$?
f_dialog_data_sanitize menu_choice
f_dialog_menutag_store "$menu_choice"
f_dialog_default_store "$menu_choice"
return $retval
}
# bhyve form for bhyve vnc options
get_construct_bhyve_vnc_options_menu()
{
local _input _res item_let=A
local title="VNC Options"
local defaultitem=
local menu_choice=
local _checkbox="cd_vnc_wait"
local vnc_password_mark=
local _bhyve_vnc_resolution
f_dialog_default_fetch defaultitem
readconf vnc.conf
[ -z "${bhyve_vnc_resolution}" ] && bhyve_vnc_resolution="${default_vnc_width}x${default_vnc_height}"
[ -z "${bhyve_vnc_tcp_bind}" ] && bhyve_vnc_tcp_bind="${default_vnc_tcp_bind}"
[ -z "${bhyve_vnc_vgaconf}" ] && bhyve_vnc_vgaconf="${default_bhyve_vnc_vgaconf}"
[ -z "${bhyve_vnc_port}" ] && bhyve_vnc_port="${default_vnc_port}"
[ -z "${vm_vnc_port}" ] && vm_vnc_port="${default_vnc_password}"
[ -z "${vm_vnc_port}" ] && vm_vnc_port="0"
case "${vnc_password}" in
0)
vnc_password_mark=
;;
*)
vnc_password_mark="***"
;;
esac
# checkbox mark
for i in ${_checkbox}; do
eval _mytest=\$$i
if [ "${_mytest}" = "1" ]; then
export ${i}_mark="X"
else
export ${i}_mark=" "
fi
done
local menu_list=""
# remove IPv6 brackets []
_bhyve_vnc_tcp_bind=$( echo ${bhyve_vnc_tcp_bind} | ${TR_CMD} -d '[]' )
menu_list="${menu_list} '${item_let} cd_vnc_wait' '[${cd_vnc_wait_mark}]' 'When booting from CD - wait for connections on VNC before VM run'"
inc_menu_index item_let
menu_list="${menu_list} '${item_let} bhyve_vnc_resolution' '[${bhyve_vnc_resolution}]' 'Default: width - ${default_vnc_width}, height - ${default_vnc_height}'"
inc_menu_index item_let
menu_list="${menu_list} '${item_let} bhyve_vnc_tcp_bind' '[${_bhyve_vnc_tcp_bind}]' 'Default: ${default_vnc_tcp_bind}'"
inc_menu_index item_let
menu_list="${menu_list} '${item_let} vm_vnc_port' '[${vm_vnc_port}]' 'Default: ${default_vnc_port}'"
# vgaconf support introduced in FreeBSD 11.1+
if [ ${freebsdhostversion} -gt 1101000 ]; then
inc_menu_index item_let
menu_list="${menu_list} '${item_let} bhyve_vnc_vgaconf' '[${bhyve_vnc_vgaconf}]' 'Default: ${bhyve_default_vnc_vgaconf}'"
fi
# VNC password support introduced in FreeBSD 11.1
if [ ${freebsdhostversion} -gt 1101000 ]; then
inc_menu_index item_let
menu_list="${menu_list} '${item_let} vnc_password' '[${vnc_password_mark}]' 'Default: see vnc.conf file'"
fi
menu_list="${menu_list} 'Save' 'Save changes and quit' 'Save!'"
cbsd_menubox
retval=$?
f_dialog_data_sanitize menu_choice
f_dialog_menutag_store "$menu_choice"
f_dialog_default_store "$menu_choice"
return $retval
}
# bhyve form for bhyve options
get_construct_bhyve_options()
{
local mychoice index
local old_defaultitem="${mtag}"
while [ 1 ]; do
get_construct_bhyve_options_menu || break
index=${mtag%% *}
mychoice=${mtag##* }
case "${mychoice}" in
"-")
continue
;;
mnt_start|mnt_stop|uuid|bhyverun_wrapper)
get_construct_${mychoice}
continue
;;
"Save")
break
;;
*)
invert_checkbox ${mychoice}
continue
;;
esac
done
f_dialog_default_store "${old_defaultitem}"
}
# bhyve form for bhyve vnc options
get_construct_bhyve_vnc_options()
{
local mychoice index _ret
local old_defaultitem="${mtag}"
while [ 1 ]; do
get_construct_bhyve_vnc_options_menu || break
index=${mtag%% *}
mychoice=${mtag##* }
case "${mychoice}" in
"-")
continue
;;
"Save")
break
;;
bhyve_vnc_tcp_bind)
title=" vnc bind "
prompt="System default via vnc.conf: ${default_vnc_tcp_bind}\n\nTo bind on all IPv4 addresses please use:\n 0.0.0.0\nTo bind on all IPv6 addresses please use: \n [::]\nOr by single IP, for example:\n 10.0.0.2 or fde4:8dba:82e1::2\nEnter valid IP"
case "${node_ip6_active}" in
1)
if [ "${node_ip4_active}" = "0" ]; then
defaultitem="[::1]"
else
defaultitem="${bhyve_vnc_tcp_bind}"
fi
;;
*)
defaultitem="${bhyve_vnc_tcp_bind}"
;;
esac
if cbsd_inputbox_simple; then
iptype ${mtag}
_ret=$?
case ${_ret} in
1)
# valid IPv4
;;
2)
# valid IPv6, check for brackets
_ret=$( substr --pos=0 --len=1 --str=${mtag} )
if [ "${_ret}" != "[" ]; then
# add IPv6 brackets
mtag="[${mtag}]"
fi
;;
3)
# invalid IP
;;
esac
bhyve_vnc_tcp_bind="${mtag}"
fi
;;
bhyve_vnc_resolution)
get_construct_bhyve_vnc_resolution_menu
;;
bhyve_vnc_vgaconf)
get_construct_bhyve_vnc_vgaconf_menu
;;
vnc_password|vm_vnc_port)
get_construct_${mychoice}
;;
*)
invert_checkbox ${mychoice}
continue
;;
esac
done
f_dialog_default_store "${old_defaultitem}"
}
# bhyve form for $vm_efi
get_construct_vm_efi()
{
local _input _res
local title="${GET_EFI_MSG}"
local defaultitem="${vm_efi}"
local menu_list="
'none' 'No UEFI boot' 'Legacy boot mode'
'uefi' 'UEFI' 'Boot using UEFI firmware'
'uefi_csm' 'UEFI CSM' 'Boot using UEFI CSM firmware'
" # END-QUOTE
cbsd_menubox
retval=$?
case $retval in
${DIALOG_OK})
[ -n "${mtag}" ] && vm_efi="${mtag}"
;;
*)
;;
esac
return ${retval}
}
# bhyve form for $vm_console
get_construct_vm_console()
{
local _input _res
local title="${GET_CONSOLE_MSG}"
local defaultitem="${vm_console}"
local menu_list="
'tmux' 'tmux console' 'No serial, just tmux session'
'nmdm' 'serial console via nmdm' 'Serial console via nullmodem driver'
" # END-QUOTE
cbsd_menubox
retval=$?
case $retval in
${DIALOG_OK})
[ -n "${mtag}" ] && vm_console="${mtag}"
;;
*)
;;
esac
return ${retval}
}
# bhyve form for $cd_boot_firmware
get_construct_cd_boot_firmware()
{
local _input _res
local title="${GET_CD_BOOT_FIRMWARE_MSG}"
local defaultitem="${cd_boot_firmware}"
local menu_list="
'bhyve' 'standard bhyve firmware' 'No serial, just tmux session'
'refind' 'reFIND firmware' 'reFIND firmware'
" # END-QUOTE
cbsd_menubox
retval=$?
case ${retval} in
${DIALOG_OK})
[ -n "${mtag}" ] && cd_boot_firmware="${mtag}"
;;
*)
;;
esac
return ${retval}
}
# bhyve form for $hdd_boot_firmware
get_construct_hdd_boot_firmware()
{
local _input _res
local title="${GET_HDD_BOOT_FIRMWARE_MSG}"
if [ "${hdd_boot_firmware}" = "0" ]; then
# inherit cd_boot_firmware
hdd_boot_firmware="${cd_boot_firmware}"
fi
local defaultitem="${hdd_boot_firmware}"
local menu_list="
'bhyve' 'standard bhyve firmware' 'No serial, just tmux session'
'refind' 'reFIND firmware' 'reFIND firmware'
" # END-QUOTE
cbsd_menubox
retval=$?
case ${retval} in
${DIALOG_OK})
[ -n "${mtag}" ] && hdd_boot_firmware="${mtag}"
;;
*)
;;
esac
return ${retval}
}
# bhyve form for submenu for audio options
# -u - update in SQL db on save
get_construct_bhyve_audio_options()
{
local mychoice index
local old_defaultitem="${mtag}"
local _update=0
while getopts "u" opt; do
case "${opt}" in
u) _update="1" ;;
esac
shift $(($OPTIND - 1))
done
while [ 1 ]; do
# only hda choice for bhyve
get_construct_audio_options_menu || break
index=${mtag%% *}
mychoice=${mtag##* }
case "${mychoice}" in
"-")
continue
;;
"Save")
#if [ "${_update}" = "0" -o -z "${jname}" ]; then
# break
#fi
#echo "bset jname=${jname} soundhw=\"${soundhw}\" soundhw_play=\"${soundhw_play}\" soundhw_rec=\"${soundhw_rec}\""
bset jname=${jname} soundhw="${soundhw}" soundhw_play="${soundhw_play}" soundhw_rec="${soundhw_rec}" > /dev/null 2>&1
break
;;
soundhw)
[ -z "${soundhw}" ] && soundhw="${default_soundhw}"
[ -z "${soundhw}" ] && soundhw="none"
# only hda choice for bhyve
get_construct_soundhw -c "hda"
;;
soundhw_play)
[ -z "${soundhw_play}" ] && soundhw_play="${default_soundhw_play}"
[ -z "${soundhw_play}" ] && soundhw_play="/dev/dsp"
title=" set play device "
prompt=" specify play device "
defaultitem="${soundhw_play}"
cbsd_inputbox_simple && soundhw_play="${mtag}"
;;
soundhw_rec)
[ -z "${soundhw_rec}" ] && soundhw_rec="${default_soundhw_rec}"
[ -z "${soundhw_rec}" ] && soundhw_play="/dev/dsp"
title=" set rec device "
prompt=" specify rec device "
eval defaultitem="${soundhw_rec}"
cbsd_inputbox_simple && soundhw_rec="${mtag}"
;;
esac
done
f_dialog_default_store "${old_defaultitem}"
}
# bhyve form for $bhyverun_wrapper
get_construct_bhyverun_wrapper()
{
title=" alternative/custom bhyverun wrapper "
prompt="e.g:\n /usr/local/cbsd/share/examples/bhyve/bhyverun.sh\ndefault:\n /usr/local/cbsd/share/bhyverun.sh"
defaultitem="${bhyverun_wrapper}"
cbsd_inputbox_simple && bhyverun_wrapper="${mtag}"
}
# bhyve jconf part
make_bhyve_part()
{
local i _val
if [ -n "${alt_iso}" ]; then
iso_site=
iso_img=
iso_img_type=
register_iso_name=
register_iso_as="${alt_iso}"; # vm_os_path
fi
${CAT_CMD} >> ${TMPFILE} << EOF
# Bhyve minimal configuration:
#jname="${jname}";
# first disk size
imgsize="${imgsize}";
# number of vcpu
vm_cpus="${vm_cpus}";
# ram amount
vm_ram="${vm_ram}";
# profile os type
vm_os_type="${vm_os_type}";
# vm defaults/setting profile
vm_os_profile="${vm_os_profile}";
# end of Bhyve minimal configuration
emulator="bhyve";
# disk type - md or zvol
imgtype="${imgtype}";
# efi boot?
vm_efi="${vm_efi}";
# source site's for iso
iso_site="${iso_site}";
# iso image filename
iso_img="${iso_img}";
# iso image type?
iso_img_type="${iso_img_type}";
# register ISO as name
register_iso_name="${register_iso_name}"
# register ISO as
register_iso_as="${register_iso_as}"
# vm hostbridge
vm_hostbridge="${vm_hostbridge}";
# additional bhyve flags
bhyve_flags="${bhyve_flags}";
# first disk type
virtio_type="${virtio_type}";
# swap size for vm-from-jail
swapsize="${swapsize}";
# path to iso image
vm_iso_path="${register_iso_as}";
# guest fs for vm-from-jail
vm_guestfs="${vm_guestfs}";
# VNC port
vm_vnc_port="${vm_vnc_port}";
# bhyve flags
bhyve_generate_acpi="${bhyve_generate_acpi}";
# bhyve flags
bhyve_wire_memory="${bhyve_wire_memory}";
# bhyve flags
bhyve_rts_keeps_utc="${bhyve_rts_keeps_utc}";
# bhyve flags
bhyve_force_msi_irq="${bhyve_force_msi_irq}";
# bhyve flags
bhyve_x2apic_mode="${bhyve_x2apic_mode}";
# bhyve flags
bhyve_mptable_gen="${bhyve_mptable_gen}";
# bhyve flags
bhyve_ignore_msr_acc="${bhyve_ignore_msr_acc}";
# wait for VNC connect when boot from CD
cd_vnc_wait="${cd_vnc_wait}";
# VNC resolution
bhyve_vnc_resolution="${bhyve_vnc_resolution}";
# VNC bind addr
bhyve_vnc_tcp_bind="${bhyve_vnc_tcp_bind}";
# vgaconf settings
bhyve_vnc_vgaconf="${bhyve_vnc_vgaconf}";
# first NIC driver
nic_driver="${nic_driver}";
# password for VNC
vnc_password='${vnc_password}';
# automatically eject CD when boot from CD and hard-disk is not empty
media_auto_eject="${media_auto_eject}";
# cpu topology name
vm_cpu_topology="${vm_cpu_topology}";
# run via debugger
debug_engine="${debug_engine}";
# emulate xhci
xhci="${xhci}";
# use alternative CD boot firmware
cd_boot_firmware="${cd_boot_firmware}";
# use alternative HHD boot firmware
hdd_boot_firmware="${hdd_boot_firmware}";
# jailed bhyve ?
jailed="${jailed}";
# chrooted bhyve ?
chrooted="${chrooted}";
# custom behavior settings by exit codes
on_poweroff="${on_poweroff}";
# custom behavior settings by exit codes
on_reboot="${on_reboot}";
# custom behavior settings by exit codes
on_crash="${on_crash}";
# is cloud image?
is_cloud='${is_cloud}';
# default disk sectorsize
sectorsize='${sectorsize}'
# sound hardware
soundhw="${soundhw}";
soundhw_play="${soundhw_play}";
soundhw_rec="${soundhw_rec}";
mnt_start="${mnt_start}";
mnt_stop="${mnt_stop}";
# compatible for double ACPI poweroff?
double_acpi="${double_acpi}";
virtio_rnd="${virtio_rnd}";
uuid="${uuid}";
# alternative bhyve stop wrapper
bhyverun_wrapper="${bhyverun_wrapper}"
# alternative bhyve start wrapper
bhyvestop_wrapper="${bhyvestop_wrapper}"
# alternative bhyve cmd
bhyve_cmd="${bhyve_cmd}";
EOF
[ ${is_cloud} -eq 0 ] && return 0
# todo: make is generic make_cloud_init_part()
${CAT_CMD} >> ${TMPFILE} << EOF
# cloud-init settings
ci_jname='${ci_jname}';
ci_fqdn='${ci_fqdn}';
ci_template='${ci_template}';
ci_interface='${ci_interface}';
ci_interface_mtu='${ci_interface_mtu}';
ci_ip4_addr='${ci_ip4_addr}';
ci_gw4='${ci_gw4}';
ci_nameserver_address='${ci_nameserver_address}';
ci_nameserver_search='${ci_nameserver_search}';
ci_adjust_inteface_helper='${ci_adjust_inteface_helper}';
ci_user_add='${ci_user_add}';
ci_user_pw_user='${ci_user_pw_user}';
ci_user_pw_root='${ci_user_pw_root}';
EOF
for i in ${ci_user_add}; do
for _par in gecos home shell member_groups pubkey; do
_val=
eval _val="\$ci_user_${_par}_${i}"
${CAT_CMD} >> ${TMPFILE} << EOF
ci_user_${_par}_${i}='${_val}';
EOF
done
done
}
###
fi