-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
71 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Default SQL scheme for DB local::bhyve_settings | ||
MYCOL="created astart vm_cpus vm_ram vm_os_type vm_boot vm_os_profile bhyve_flags vm_vnc_port virtio_type bhyve_vnc_tcp_bind bhyve_vnc_resolution cd_vnc_wait protected hidden maintenance ip4_addr vnc_password state_time vm_hostbridge vm_iso_path vm_console vm_efi \ | ||
vm_rd_port bhyve_generate_acpi bhyve_wire_memory bhyve_rts_keeps_utc bhyve_force_msi_irq bhyve_x2apic_mode bhyve_mptable_gen bhyve_ignore_msr_acc bhyve_vnc_vgaconf media_auto_eject vm_cpu_topology debug_engine xhci cd_boot_firmware jailed vm_iso_path2 \ | ||
on_poweroff on_reboot on_crash vm_zfs_guid vnc_port soundhw bhyve_cmd double_acpi virtio_rnd hdd_boot_firmware chrooted uuid bhyverun_wrapper bhyvestop_wrapper tags fbuf tablet boot_delay cpuset efi_firmware bhyve_vnc_kbdlayout pid_wait" | ||
on_poweroff on_reboot on_crash vm_zfs_guid vnc_port soundhw bhyve_cmd double_acpi virtio_rnd hdd_boot_firmware chrooted uuid bhyverun_wrapper bhyvestop_wrapper tags fbuf tablet boot_delay cpuset efi_firmware bhyve_vnc_kbdlayout pid_wait tpm" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/sh | ||
#v13.0.23 | ||
# Update bhyve tables for tpm | ||
: ${distdir="/usr/local/cbsd"} | ||
[ ! -r "${distdir}/subr/cbsdbootstrap.subr" ] && exit 1 | ||
. ${distdir}/subr/cbsdbootstrap.subr || exit 1 | ||
test_sql_stuff | ||
|
||
[ ! -h "${dbdir}/local.sqlite" ] && exit | ||
|
||
_test=$( ${miscdir}/sqlcli ${mydb} "SELECT name FROM sqlite_master WHERE type='table' AND name='tpm'" ) | ||
if [ -z "${_test}" ]; then | ||
${ECHO} " * ${MAGENTA}Update bhyve tables: tpm" | ||
${miscdir}/sqlcli ${dbdir}/local.sqlite "ALTER TABLE bhyve ADD COLUMN tpm TEXT DEFAULT '0'" | ||
fi | ||
|
||
vms=$( ${miscdir}/sqlcli ${dbdir}/local.sqlite "SELECT jname FROM jails WHERE emulator = 'bhyve'" ) | ||
|
||
for i in ${vms}; do | ||
mydb="${jailsysdir}/${i}/local.sqlite" | ||
[ ! -r "${mydb}" ] && continue | ||
# alter tpm if not exist | ||
unset _test | ||
_test=$( ${miscdir}/sqlcli ${mydb} "SELECT COUNT(tpm) FROM settings LIMIT 1" 2>/dev/null ) | ||
[ -n "${_test}" ] && continue | ||
${ECHO} " * ${N1_COLOR}Update settings tables: tpm for ${N2_COLOR}${i}${N0_COLOR}" | ||
${miscdir}/sqlcli ${mydb} "ALTER TABLE settings ADD COLUMN tpm TEXT DEFAULT '0'" | ||
done |