2 # Build a udev permissions file for all devices that a user may encounter
3 UDEV_FILE=${ROMFSDIR}/etc/udev/rules.d/50-perms.rules
5 # Set some default values for group and perm
12 if [ ! -d `dirname $UDEV_FILE` ]
14 mkdir -p `dirname $UDEV_FILE`
19 echo "# Device node permissions" >> $UDEV_FILE
24 -group=*) GROUP=`echo $i | cut -f2 -d=`;;
25 -mode=*) PERM=`echo $i | cut -f2 -d=`;;
26 -reset) GROUP=$DEFAULT_GROUP; PERM=$DEFAULT_PERM;;
27 *,*) DEV=`echo $i | sed -e 's/,.*//' -e 's,.*/,,'`; DIR=`echo $i | sed -e 's/,.*//' -e 's,[^/]*$,,'`; echo "KERNEL==\"$DEV\", NAME=\"$DIR$DEV\", GROUP=\"$GROUP\", MODE=\"$PERM\"" >> $UDEV_FILE;;