#!/bin/sh
if [ -f mgmt.o ]; then
	if [ -f /etc/hotplug/firmware.agent ]; then
		cat /etc/hotplug/firmware.agent | grep FIRMWARE_DIR= > Makefile &&
		cat Makefile
	else
		echo "FIRMWARE_DIR=/lib/firmware" > Makefile &&
		echo "FIRMWARE_DIR=/lib/firmware"
	fi
	cat Makefile.in >> Makefile &&
exit 0
else
	echo "Error: No firmware found."
	echo "Please put a copy of the firmware in this folder and rename it mgmt.o"
	exit 1
fi
