#!/bin/sh

if [ -e /sys/power/state ]; then
  chmod 0666 /sys/power/state
fi
if [ -e /dev/knvrm ]; then
  chmod 0660 /dev/knvrm
  chown root:root /dev/knvrm
fi
if [ -e /dev/knvmap ]; then
  chmod 0660 /dev/knvmap
  chown root:root /dev/knvmap
fi
if [ -e /dev/nvmap ]; then
  chmod 0660 /dev/nvmap
  chown root:root /dev/nvmap
fi
if [ -e /dev/nvram ]; then
  chmod 0660 /dev/nvram
  chown root:root /dev/nvram
fi
if test -n "`ls -1 /dev/nvhdcp* 2>/dev/null`"; then
  chmod 0660 /dev/nvhdcp*
  chown root:root /dev/nvhdcp*
fi
if test -n "`ls -1 /dev/nvhost* 2>/dev/null`"; then
  chmod 0660 /dev/nvhost*
  chown root:root /dev/nvhost*
fi
exists=`find /dev/ -name tegra* | wc -l`
if test -n "`ls -1 /dev/tegra* 2>/dev/null`"; then
  chmod 0660 /dev/tegra*
  chown root:root /dev/tegra*
fi

exit 0
