#!/bin/sh
PREREQ=""
prereqs()
{
	echo "$PREREQ"
}

case $1 in
prereqs)
	prereqs
	exit 0
	;;
esac

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

# Support z/VM's DIAG mode to access DASDs if needed.
manual_add_modules dasd_diag_mod

copy_exec /lib/udev/rules.d/85-sysconfig-hardware.rules

# hwup and hwdown are bash scripts so we need to copy bash into the
# initrd to run them. Furthermore they mostly shell out to support
# scripts for the various device types. Copy what we need.
copy_exec /bin/bash
copy_exec /sbin/hwup
copy_exec /sbin/hwdown
copy_exec /etc/sysconfig/scripts/common/functions
for script in /etc/sysconfig/scripts/hardware/*
do
	copy_exec "$script"
done

# Copy the actual user configuration with the list of devices to
# enable at boot into the initrd.
for cfg in /etc/sysconfig/hardware/*
do
	if [ "$(basename $cfg)" != "*" ]; then
		copy_exec "$cfg"
	fi
done
