Commit 0b1cb663 authored by ssrq's avatar ssrq

[explorer/machine_type] Use sysctl for acquiring DMI values on NetBSD

parent 22ecb7a8
Pipeline #3999 failed with stage
in 2 minutes and 17 seconds
......@@ -39,7 +39,7 @@ PATH="/sbin:/usr/sbin:$(getconf PATH)"
export PATH
arch=$(uname -m | sed -e 's/i.86/i386/' -e 's/arm.*/arm/')
uname_s=$(uname -s)
is_oneof() (
x=$1; shift
......@@ -66,6 +66,22 @@ set_has() (
glob_exists() { set -- $1; test -e "$1"; }
get_dmi_field() {
if is_oneof "${uname_s}" NetBSD
then
case $1
in
(system-manufacturer)
_sysctl_value=system-vendor
;;
esac
if test -n "${_sysctl_value}" \
&& get_sysctl "machdep.dmi.${_sysctl_value}" | grep -e .
then
return
fi
fi
if has dmidecode
then
dmidecode -s "$1"
......@@ -553,7 +569,7 @@ check_os_specific() {
fi
fi
case $(uname -s)
case ${uname_s}
in
(FreeBSD)
# FreeBSD does not have /proc/cpuinfo even when procfs is used.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment