Commit d9faffe9 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev
Browse files

1.mmc automount 2.launching a script from mmc

parent b763b0c2
Loading
Loading
Loading
Loading
+25 −3
Original line number Diff line number Diff line
@@ -5,22 +5,44 @@ DAEMON=/usr/sbin/init_elphel393
NAME=init_elphel393
DESC="extra init scripts"

MNTPOINT=/mnt/mmc
MMCDEV=/dev/mmcblk0p1
SOME_SCRIPT=test_elphel393.sh

case "$1" in
  start)
	echo -n "Starting $DESC: "
	echo "$NAME."
	echo "$NAME:"
	#mount here
	echo "    Mounting Memory Card to $MNTPOINT"
	mkdir $MNTPOINT 
	mount $MMCDEV $MNTPOINT
	if [ -f $MNTPOINT/$SOME_SCRIPT ]; then
	    echo "    Launching $SOME_SCRIPT"
	    $MNTPOINT/$SOME_SCRIPT
	else
	    echo "    $SOME_SCRIPT not found. Nothing to launch."
	fi
	;;
  stop)
	echo -n "Stopping $DESC: "
	echo "$NAME."
	;;
  restart|force-reload)
  restart)
	echo -n "Restarting $DESC: "
	echo "$NAME."
	;;
  status)
	echo -n "$NAME status:"
	if [ -f /var/run/$NAME ]; then
	  echo -n "Running"
	else
	  echo -n "Not running"
	fi
	;;
  *)
	N=/etc/init.d/$NAME
	echo "Usage: $N {start|stop|restart|force-reload}" >&2
	echo "Usage: $N {start|stop|restart|status}" >&2
	exit 1
	;;
esac
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ SRC_URI = "file://init_elphel393 \
S = "${WORKDIR}/"

INITSCRIPT_NAME = "init_elphel393"
INITSCRIPT_PARAMS = "defaults 75"
INITSCRIPT_PARAMS = "defaults 95"

#This needs to get the script into rc?.d/
inherit update-rc.d