# Copyright 2016 Cumulus Networks, Inc.
# All rights reserved.

# This script will be sourced by mkinitramfs when building the
# initramfs image.
#
# Add a few utilities to the initramfs needed for staging and
# launching a cumulus installer image.
#
# See initramfs.conf(5), initramfs-tools(8) and mkinitramfs(8) for
# details.

PREREQ=""

prereqs()
{
    echo "$PREREQ"
}

case $1 in
# get pre-requisites
prereqs)
	prereqs
	exit 0
	;;
esac

. /usr/share/initramfs-tools/hook-functions

if [ -x /sbin/mkfs.ext2 ] ; then
	copy_exec /sbin/mkfs.ext2 /sbin
fi
if [ -x /sbin/sgdisk ] ; then
	copy_exec /sbin/sgdisk /sbin
fi
if [ -x /sbin/partprobe ] ; then
	copy_exec /sbin/partprobe /sbin
fi

if [ -d /sys/firmware/efi ] ; then
	manual_add_modules efivars
fi
