#!/bin/sh

cp src/sys/dev/cardbus/if_ral*.[ch] /usr/src/sys/dev/cardbus/
cp src/sys/dev/pci/if_ral*.[ch] /usr/src/sys/dev/pci/
cp src/sys/dev/ic/ral*.[ch] /usr/src/sys/dev/ic/

grep '^attach.ral.' /usr/src/sys/dev/pci/files.pci > /dev/null 2>&1 ||
{
	cat >> /usr/src/sys/dev/pci/files.pci << EOF

# Ralink RT2500
attach	ral at pci with ral_pci
file	dev/pci/if_ral_pci.c		ral_pci
EOF
}

grep '^attach.ral.' /usr/src/sys/dev/cardbus/files.cardbus > /dev/null 2>&1 ||
{
	cat >> /usr/src/sys/dev/cardbus/files.cardbus << EOF

# Ralink RT2500
attach	ral at cardbus with ral_cardbus
file	dev/cardbus/if_ral_cardbus.c	ral_cardbus
EOF
}

grep '^device.ral:' /usr/src/sys/conf/files > /dev/null 2>&1 ||
{
	cat >> /usr/src/sys/conf/files << EOF
	
# Ralink RT2500
device	ral: ifnet, wlan
file	dev/ic/ral.c			ral
EOF
}

cat << EOF

--------
Thanks for installing ral 1.0 for NetBSD!

To finish the installation, you should add the following lines to your kernel
configuration file before recompiling it:

ral*    at pci? dev ? function ?        # Ralink Technology RT2500
ral*	at cardbus? dev ? function ?	# Ralink Technology RT2500

We greatly appreciate that you give feedback so we can improve the driver.

                                                -- Damien Bergamini
EOF

