#!/bin/sh
#

PKG_INSTALL_PATCH=$ROOTDIR


# Create allkmem pseudo device and symlink. 
# Get major number from name_to_major if mm driver is
# on the system.

if [ -f $ROOTDIR/kernel/drv/mm ]; then
	devnode=$ROOTDIR/devices/pseudo/mm@0:allkmem
	grep "^mm " $ROOTDIR/etc/name_to_major >/dev/null 2>&1
	if [ "$?" = "0" ]; then
		minor_mm=3
		major_mm=`grep "^mm " \
		$ROOTDIR/etc/name_to_major | nawk '{ print $2 }'`
	else
		exit -1
	fi
else 
	exit 0
fi

rm -f $devnode
mknod $devnode c $major_mm $minor_mm
chmod 0600 $devnode
chown root:sys $devnode

devnode=../devices/pseudo/mm@0:allkmem

devlink=allkmem
( cd $ROOTDIR/dev ; \
	rm -f $devlink ; ln -s $devnode $devlink )

exit 0

	
