#!/bin/sh
#
# Simple script to handle uevents
#

if [ "$SUBSYSTEM/$ACTION" == "firmware/add" ]; then
    [ -e "/sys$DEVPATH/loading" ] || exit 1
    DIR=/lib/firmware
    [ -e "$DIR/$FIRMWARE" ] || exit 1
    echo 1 > /sys$DEVPATH/loading
    cat "$DIR/$FIRMWARE" > /sys$DEVPATH/data
    echo 0 > /sys$DEVPATH/loading
    exit 0
fi
