summaryrefslogtreecommitdiff
path: root/imagebuild
diff options
context:
space:
mode:
authorMike Turek <mjturek@linux.vnet.ibm.com>2017-11-30 16:30:42 +0000
committerMike Turek <mjturek@linux.vnet.ibm.com>2018-01-30 15:54:10 +0000
commit2877fc53d409e950a685a4bd31ac37b4865981a9 (patch)
treec76ddb2a31a16d9c369850ba737d62da04aae7bb /imagebuild
parent5ee16ee2e8bd41984ceeb3647509b5e5f34e1575 (diff)
downloadironic-python-agent-2877fc53d409e950a685a4bd31ac37b4865981a9.tar.gz
Use lshw in place of dmidecode for the default hardware manager
Currently the generic hardware manager uses dmidecode to get the total physical memory and system details. This patch switches the generic hardware manager to use lshw, as it is capable of reading more than DMI [0]. This enables systems that do not support DMI to use the generic hardware manager, such as IBM Power systems. [0] https://github.com/lyonel/lshw/blob/master/README.md Closes-Bug: #1715790 Change-Id: Ie370331df6bb5ef131c5cb60f458877e2a7ad71a Depends-On: Idaf05b8efce28cd0cbf339cf693db4f55a693d9b
Diffstat (limited to 'imagebuild')
-rwxr-xr-ximagebuild/tinyipa/build-tinyipa.sh8
-rwxr-xr-ximagebuild/tinyipa/finalise-tinyipa.sh3
2 files changed, 11 insertions, 0 deletions
diff --git a/imagebuild/tinyipa/build-tinyipa.sh b/imagebuild/tinyipa/build-tinyipa.sh
index 40e26bb7..1112e1ed 100755
--- a/imagebuild/tinyipa/build-tinyipa.sh
+++ b/imagebuild/tinyipa/build-tinyipa.sh
@@ -62,6 +62,7 @@ sudo sh -c "echo $TINYCORE_MIRROR_URL > $BUILDDIR/opt/tcemirror"
# Download TGT, Qemu-utils, Biosdevname and IPMItool source
clone_and_checkout "https://github.com/fujita/tgt.git" "${BUILDDIR}/tmp/tgt" "v1.0.62"
clone_and_checkout "https://github.com/qemu/qemu.git" "${BUILDDIR}/tmp/qemu" "v2.5.0"
+clone_and_checkout "https://github.com/lyonel/lshw.git" "${BUILDDIR}/tmp/lshw" "B.02.18"
if $TINYIPA_REQUIRE_BIOSDEVNAME; then
wget -N -O - https://linux.dell.com/biosdevname/biosdevname-0.7.2/biosdevname-0.7.2.tar.gz | tar -xz -C "${BUILDDIR}/tmp" -f -
fi
@@ -137,6 +138,13 @@ cd $WORKDIR/build_files && mksquashfs $BUILDDIR/tmp/qemu-utils qemu-utils.tcz &&
# Create qemu-utils.tcz.dep
echo "glib2.tcz" > qemu-utils.tcz.dep
+# Build lshw
+rm -rf $WORKDIR/build_files/lshw.tcz
+# NOTE(mjturek): We touch src/lshw.1 and clear src/po/Makefile to avoid building the man pages, as they aren't used and require large dependencies to build.
+$CHROOT_CMD /bin/sh -c "cd /tmp/lshw && touch src/lshw.1 && echo install: > src/po/Makefile && make && make install DESTDIR=/tmp/lshw-installed"
+find $BUILDDIR/tmp/lshw-installed/ -type f -executable | xargs file | awk -F ':' '/ELF/ {print $1}' | sudo xargs strip
+cd $WORKDIR/build_files && mksquashfs $BUILDDIR/tmp/lshw-installed lshw.tcz && md5sum lshw.tcz > lshw.tcz.md5.txt
+
# Build biosdevname
if $TINYIPA_REQUIRE_BIOSDEVNAME; then
rm -rf $WORKDIR/build_files/biosdevname.tcz
diff --git a/imagebuild/tinyipa/finalise-tinyipa.sh b/imagebuild/tinyipa/finalise-tinyipa.sh
index 2ff2d6f5..972681e1 100755
--- a/imagebuild/tinyipa/finalise-tinyipa.sh
+++ b/imagebuild/tinyipa/finalise-tinyipa.sh
@@ -76,6 +76,8 @@ cp -Rp "$BUILDDIR/tmp/wheels" "$FINALDIR/tmp/wheelhouse"
cp $WORKDIR/build_files/tgt.* $FINALDIR/tmp/builtin/optional
cp $WORKDIR/build_files/qemu-utils.* $FINALDIR/tmp/builtin/optional
+cp $WORKDIR/build_files/lshw.* $FINALDIR/tmp/builtin/optional
+
if $TINYIPA_REQUIRE_BIOSDEVNAME; then
cp $WORKDIR/build_files/biosdevname.* $FINALDIR/tmp/builtin/optional
fi
@@ -118,6 +120,7 @@ fi
$TC_CHROOT_CMD tce-load -ic /tmp/builtin/optional/tgt.tcz
$TC_CHROOT_CMD tce-load -ic /tmp/builtin/optional/qemu-utils.tcz
+$TC_CHROOT_CMD tce-load -ic /tmp/builtin/optional/lshw.tcz
if $TINYIPA_REQUIRE_BIOSDEVNAME; then
$TC_CHROOT_CMD tce-load -ic /tmp/builtin/optional/biosdevname.tcz
fi