Fix IPA execution issues due to lack of entropy

While running TinyIPA stable/stein images in KVM virtual machines with
Tenks, we noticed that IPA would start but not execute further, which
appeared to be caused by a lack of entropy.

This patch installs haveged, a simple entropy daemon [1], into the
tinyipa ramdisk and starts it on boot, which resolves the issue.

We first applied this change in ironic-python-agent-builder for master
and stable/train with I7d47b7828733cc03c1ed6c370c451465a6d492b6 [2]. We
still build stable/stein images from the ironic-python-agent repository,
so we can't directly backport the commit. Additionally, we install
haveged from source, because a Tiny Core extension is available only for
x86, not for x86_64 [3]. We use version 1.9.4 as newer versions require
a more recent GNU Automake.

[1] http://www.issihosts.com/haveged/
[2] https://review.opendev.org/#/c/695080/
[3] http://tinycorelinux.net/8.x/x86_64/tcz/

Change-Id: I7d47b7828733cc03c1ed6c370c451465a6d492b6
Story: 2006911
Task: 37554
This commit is contained in:
Pierre Riteau 2019-11-22 11:35:10 +01:00
parent cbac1c2ead
commit 61128de52b
3 changed files with 16 additions and 1 deletions

View File

@ -62,6 +62,7 @@ sudo sh -c "echo $TINYCORE_MIRROR_URL > $BUILDDIR/opt/tcemirror"
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"
clone_and_checkout "https://github.com/jirka-h/haveged.git" "${BUILDDIR}/tmp/haveged" "1.9.4"
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
@ -180,6 +181,12 @@ $CHROOT_CMD /bin/sh -c "cd /tmp/lshw && touch src/lshw.1 && echo install: > src/
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 haveged
rm -rf $WORKDIR/build_files/haveged.tcz
$CHROOT_CMD /bin/sh -c "cd /tmp/haveged && ./configure && make && make install DESTDIR=/tmp/haveged-installed"
find $BUILDDIR/tmp/haveged-installed/ -type f -executable | xargs file | awk -F ':' '/ELF/ {print $1}' | sudo xargs strip
cd $WORKDIR/build_files && mksquashfs $BUILDDIR/tmp/haveged-installed haveged.tcz && md5sum haveged.tcz > haveged.tcz.md5.txt
# Build biosdevname
if $TINYIPA_REQUIRE_BIOSDEVNAME; then
rm -rf $WORKDIR/build_files/biosdevname.tcz

View File

@ -10,11 +10,17 @@ date
export HOME=/root
# Start SSHd
if [ -f /usr/local/etc/init.d/openssh ]; then
if [ -x /usr/local/etc/init.d/openssh ]; then
echo "Starting OpenSSH server:"
/usr/local/etc/init.d/openssh start
fi
# Start haveged
if [ -x /usr/local/sbin/haveged ]; then
echo "Starting haveged entropy daemon:"
/usr/local/sbin/haveged
fi
# Maybe save some RAM?
#rm -rf /tmp/builtin

View File

@ -76,6 +76,7 @@ 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
cp $WORKDIR/build_files/haveged.* $FINALDIR/tmp/builtin/optional
if $TINYIPA_REQUIRE_BIOSDEVNAME; then
cp $WORKDIR/build_files/biosdevname.* $FINALDIR/tmp/builtin/optional
@ -125,6 +126,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
$TC_CHROOT_CMD tce-load -ic /tmp/builtin/optional/haveged.tcz
if $TINYIPA_REQUIRE_BIOSDEVNAME; then
$TC_CHROOT_CMD tce-load -ic /tmp/builtin/optional/biosdevname.tcz
fi