Skip to content

Commit

Permalink
OS-6687 want sysinfo key for bhyve support
Browse files Browse the repository at this point in the history
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Reviewed by: Dave Eddy <dave.eddy@joyent.com>
Approved by: Dave Eddy <dave.eddy@joyent.com>
  • Loading branch information
joshwilsdon authored and pfmooney committed Mar 14, 2018
1 parent 48cb3c4 commit d9a408b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/sysinfo
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright (c) 2015 Joyent Inc., All rights reserved.
# Copyright (c) 2018 Joyent Inc., All rights reserved.
#
# Output some info representing the system. Default: JSON
#
Expand Down Expand Up @@ -197,6 +197,16 @@ function get_smartos_cpu_info()
#echo "${CPU_Cores}"
}

function get_bhyve_capability()
{
Bhyve_Capable="false"
if [[ -x /usr/lib/brand/bhyve/bhhwcompat ]]; then
if /usr/lib/brand/bhyve/bhhwcompat; then
Bhyve_Capable="true"
fi
fi
}

function get_live_image_buildstamp()
{
# Add joyent buildstamp to SYSTEM_INFO
Expand Down Expand Up @@ -655,6 +665,7 @@ VM_Capable='${VM_Capable}'
CPU_Type='${CPU_Version}'
CPU_Virtualization='${CPU_Virtualization}'
CPU_Physical_Cores=${CPU_Count}
Bhyve_Capable='${Bhyve_Capable}'
Nic_Tags=${NicTagList}
Setup='${Setup_complete}'
END
Expand Down Expand Up @@ -787,6 +798,7 @@ END
"HW Family": "${HW_Family}",
"Setup": "${Setup_complete}",
"VM Capable": ${VM_Capable},
"Bhyve Capable": ${Bhyve_Capable},
"CPU Type": "${CPU_Version}",
"CPU Virtualization": "${CPU_Virtualization}",
"CPU Physical Cores": ${CPU_Count},
Expand Down Expand Up @@ -975,6 +987,7 @@ else
fi
get_memory_mib
get_smartos_cpu_info
get_bhyve_capability
get_live_image_buildstamp
get_system_type
get_hostname
Expand Down

0 comments on commit d9a408b

Please sign in to comment.