From a72645f43110ce820c4b047bd8315ca180d1d336 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Thu, 15 Dec 2016 17:07:04 +1100 Subject: [PATCH] Recreate initramfs within loopback image dracut has a loop [1] where it probes top-level directories, tries to find what block device they are on, then determines the file-system of that block device. It then puts those file-system modules into the initramfs for boot. Since we install the kernel package during the chroot phase, / there is not a block device and thus this loop matches nothing and we end up with no file-system modules in the initramfs. This results in a very annoying silent boot hang. By moving re-generation of dracut into finalise.d phase, we run inside the final image where / is the loop-device; the root file-system gets detected correctly and the ext4 module is included correctly. [1] http://git.kernel.org/cgit/boot/dracut/dracut.git/tree/dracut.sh?h=RHEL-7#n1041 Change-Id: Iaf2a1e8470f642bfaaaad3f9b7f26cfc8cc445c9 Signed-off-by: Paul Belanger --- elements/yum-minimal/finalise.d/55-dracut-recreate | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 elements/yum-minimal/finalise.d/55-dracut-recreate diff --git a/elements/yum-minimal/finalise.d/55-dracut-recreate b/elements/yum-minimal/finalise.d/55-dracut-recreate new file mode 100755 index 00000000..477e93ec --- /dev/null +++ b/elements/yum-minimal/finalise.d/55-dracut-recreate @@ -0,0 +1,12 @@ +#!/bin/bash + +# Recreate the initramfs within the loop device so everything gets +# picked up correctly. + +if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then + set -x +fi +set -eu +set -o pipefail + +dracut --regenerate-all --force --verbose