Commit d9faffe9 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

1.mmc automount 2.launching a script from mmc

parent b763b0c2
...@@ -5,22 +5,44 @@ DAEMON=/usr/sbin/init_elphel393 ...@@ -5,22 +5,44 @@ DAEMON=/usr/sbin/init_elphel393
NAME=init_elphel393 NAME=init_elphel393
DESC="extra init scripts" DESC="extra init scripts"
MNTPOINT=/mnt/mmc
MMCDEV=/dev/mmcblk0p1
SOME_SCRIPT=test_elphel393.sh
case "$1" in case "$1" in
start) start)
echo -n "Starting $DESC: " 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) stop)
echo -n "Stopping $DESC: " echo -n "Stopping $DESC: "
echo "$NAME." echo "$NAME."
;; ;;
restart|force-reload) restart)
echo -n "Restarting $DESC: " echo -n "Restarting $DESC: "
echo "$NAME." 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 N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2 echo "Usage: $N {start|stop|restart|status}" >&2
exit 1 exit 1
;; ;;
esac esac
......
...@@ -20,7 +20,7 @@ SRC_URI = "file://init_elphel393 \ ...@@ -20,7 +20,7 @@ SRC_URI = "file://init_elphel393 \
S = "${WORKDIR}/" S = "${WORKDIR}/"
INITSCRIPT_NAME = "init_elphel393" INITSCRIPT_NAME = "init_elphel393"
INITSCRIPT_PARAMS = "defaults 75" INITSCRIPT_PARAMS = "defaults 95"
#This needs to get the script into rc?.d/ #This needs to get the script into rc?.d/
inherit update-rc.d inherit update-rc.d
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment