diskimage-builder/elements/fedora-minimal/install.d/99-ramdisk
Monty Taylor b5bcb3b60e Add a yum-minimal element that just uses yum
The centos-minimal approach of using rinse does not, it turns out, work
on centos. That's a bummer. It's also rather heavyweight. Instead, with
minor machinations, we can just use yum itself pointed at a chroot.

Also adding fedora-minimal element which creates a fedora image using
the new yum-minimal approach.

Co-Authored-By: Gregory Haynes <greg@greghaynes.net>

Change-Id: I026fd9d323e786dae5bb67824c6501067e1ceaa3
2015-04-14 13:39:18 -04:00

18 lines
386 B
Bash
Executable File

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
initrd=$(find /boot -name initrd)
kernel_version=$(rpm -qa | grep kernel | sort | head -n 1 | cut -d '-' -f 2,3)
if [ "$(echo $initrd | wc -l)" -eq 1 ]; then
cp $initrd /boot/initrd-$kernel_version.img
else
echo "Zero or multiple initrds found. This should not happen."
exit 1
fi