#!/bin/sh
mount -t spufs spufs /spu
modprobe binfmt_misc

if test -f /proc/sys/fs/binfmt_misc/spe
then
  echo "elfspe already registered"
else
  if test ! -f /proc/sys/fs/binfmt_misc/register
  then
    mount -v -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc
  fi
  echo ':spe:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x17::/usr/bin/elfspe:' \
  >/proc/sys/fs/binfmt_misc/register
fi
