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: 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:

View File

@ -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"

View File

@ -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: