Merge "dmidecode does not exist for ppc64/ppc64el"
This commit is contained in:
commit
908ca1d079
@ -1,6 +1,12 @@
|
|||||||
tgt:
|
tgt:
|
||||||
curl:
|
curl:
|
||||||
|
# dmidecode does not exist for ppc* arches so add includes for non ppc
|
||||||
dmidecode:
|
dmidecode:
|
||||||
|
arch: x86_64
|
||||||
|
dmidecode:
|
||||||
|
arch: i386
|
||||||
|
dmidecode:
|
||||||
|
arch: amd64
|
||||||
ipmitool:
|
ipmitool:
|
||||||
qemu-utils:
|
qemu-utils:
|
||||||
gcc:
|
gcc:
|
||||||
|
@ -44,11 +44,22 @@ CPU_ARCH=$(lscpu | grep Architecture | awk '{ print $2 }')
|
|||||||
update ".cpu_arch = \"$CPU_ARCH\""
|
update ".cpu_arch = \"$CPU_ARCH\""
|
||||||
|
|
||||||
RAM=0
|
RAM=0
|
||||||
for i in $(dmidecode --type memory | grep Size | awk '{ print $2; }' | grep -E '[0-9]+');
|
if hash dmidecode 2>/dev/null; then
|
||||||
do
|
for i in $(dmidecode --type memory | grep Size | awk '{ print $2; }' | grep -E '[0-9]+');
|
||||||
RAM=$(( RAM + $i ));
|
do
|
||||||
done
|
RAM=$(( RAM + $i ));
|
||||||
update ".memory_mb = $RAM"
|
done
|
||||||
|
elif hash lshw 2>/dev/null; then
|
||||||
|
# dmidecode does not exist for ppc, but lshw should (for both)
|
||||||
|
MEMORY=$(lshw -c memory -short -quiet | grep -i 'system memory' | awk '{ print $3; }')
|
||||||
|
if [[ "${MEMORY}" =~ GiB$ ]]; then
|
||||||
|
RAMGB=${MEMORY::-3}
|
||||||
|
RAM=$(( RAMGB * 1024 ));
|
||||||
|
elif [[ "${MEMORY}" =~ MiB$ ]]; then
|
||||||
|
RAM=${MEMORY::-3}
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
[ ${RAM} -gt 0 ] && update ".memory_mb = $RAM"
|
||||||
|
|
||||||
CPUS=$(cat /proc/cpuinfo | grep processor | wc -l)
|
CPUS=$(cat /proc/cpuinfo | grep processor | wc -l)
|
||||||
update ".cpus = $CPUS"
|
update ".cpus = $CPUS"
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
curl:
|
curl:
|
||||||
|
# dmidecode does not exist for ppc* arches so add includes for non ppc
|
||||||
dmidecode:
|
dmidecode:
|
||||||
|
arch: x86_64
|
||||||
|
dmidecode:
|
||||||
|
arch: i386
|
||||||
|
dmidecode:
|
||||||
|
arch: amd64
|
||||||
ipmitool:
|
ipmitool:
|
||||||
jq:
|
jq:
|
||||||
|
lshw:
|
||||||
util-linux:
|
util-linux:
|
||||||
|
Loading…
Reference in New Issue
Block a user