dmidecode does not exist for ppc64/ppc64el

Adding three separate lines because the arch tag does not support a list.

Change-Id: Icf8a075224833fcfbbe2128e8802ff41c39f3c09
This commit is contained in:
Mark Hamzy 2016-06-24 09:31:43 -05:00
parent 7356941996
commit 76bf793a39
3 changed files with 29 additions and 5 deletions

View File

@ -1,6 +1,12 @@
tgt:
curl:
# dmidecode does not exist for ppc* arches so add includes for non ppc
dmidecode:
arch: x86_64
dmidecode:
arch: i386
dmidecode:
arch: amd64
ipmitool:
qemu-utils:
gcc:

View File

@ -44,11 +44,22 @@ CPU_ARCH=$(lscpu | grep Architecture | awk '{ print $2 }')
update ".cpu_arch = \"$CPU_ARCH\""
RAM=0
if hash dmidecode 2>/dev/null; then
for i in $(dmidecode --type memory | grep Size | awk '{ print $2; }' | grep -E '[0-9]+');
do
RAM=$(( RAM + $i ));
done
update ".memory_mb = $RAM"
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)
update ".cpus = $CPUS"

View File

@ -1,5 +1,12 @@
curl:
# dmidecode does not exist for ppc* arches so add includes for non ppc
dmidecode:
arch: x86_64
dmidecode:
arch: i386
dmidecode:
arch: amd64
ipmitool:
jq:
lshw:
util-linux: