You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
542 B
26 lines
542 B
gather_cpu_info() {
|
|
[ -z "${NCPUS}" ] || return
|
|
|
|
has_class "GNU" && {
|
|
export NCPUS=$(${NPROC})
|
|
}
|
|
|
|
has_class "Linux" && {
|
|
eval $(${LSCPU} | ${AWK} -F: '
|
|
{ sub(/^ */,"",$2) }
|
|
/Byte Order/ {
|
|
sub(/ /,"_",$2);
|
|
print "export BYTE_ORDER=\"" $2 "\";"
|
|
}
|
|
/CPU op-mode/ {
|
|
sub(/,/,"",$2);
|
|
print "export OP_MODES=\"" $2 "\";"
|
|
}
|
|
/CPU(s):/ { print "export NCPUS=" $2 ";" }
|
|
/Virtualization/ { print "export CPU_VIRT=\"" $2 "\";" }')
|
|
}
|
|
|
|
set_class ${NCPUS}cpus ${CPU_VIRT} ${BYTE_ORDER} ${OP_MODES}
|
|
}
|
|
|
|
# vim: set ts=4 sw=4:
|