Commit c3f1e194 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

moved mountpoints to /tmp

parent 1160b049
......@@ -59,7 +59,7 @@ function init(){
ct2 = $("<div style='padding-top:20px;'>");
tmpstr = "Absolute path: <input id='abspath' style='text' value='/mnt/sda1' class='ap' />";
tmpstr = "Absolute path: <input id='abspath' style='text' value='/tmp/mnt/sda1' class='ap' />";
ct2.html(tmpstr);
$("#controls").append(ct2);
......@@ -212,14 +212,14 @@ function get_files(){
function init_path(){
$.ajax({
url:"camogm.php?cmd=list&path=/mnt",
url:"camogm.php?cmd=list&path=/tmp/mnt",
complete: function(data){
var xml = data.responseXML;
var dirs = $(xml).find("d");
var res = false;
for(var i=0;i<dirs.length;i++){
var tmp = $(dirs[i]).text();
if (tmp=="/mnt/sda1") {
if (tmp=="/tmp/mnt/sda1") {
$("#abspath").val(tmp);
res = true;
}
......
......@@ -136,7 +136,7 @@ if ($cmd=="find_sdram_phase"){
}
function get_sensor_type(){
$lastline = exec("cat /mnt/mmc/init_elphel393.sh | grep \"SENSOR_TYPE=\"");
$lastline = exec("cat /etc/init_elphel393.sh | grep \"SENSOR_TYPE=\"");
$res = explode("=",$lastline);
$res[1] = intval($res[1]);
if (($res[1]!=5)&&($res[1]!=14)) $res[1]=0;
......
......@@ -5,7 +5,7 @@ DAEMON=/usr/sbin/init_elphel393
NAME=init_elphel393
DESC="extra init scripts"
MNTPOINT=/mnt/mmc
MNTPOINT=/tmp/mnt/mmc
MMCDEV=/dev/mmcblk0p1
SOME_SCRIPT=init_elphel393.sh
......@@ -19,12 +19,13 @@ case "$1" in
#mount here
echo " Mounting Memory Card to $MNTPOINT"
if [ ! -d $MNTPOINT ]; then
mkdir $MNTPOINT
mkdir -p $MNTPOINT
fi
mount $MMCDEV $MNTPOINT
if [ -f $MNTPOINT/$SOME_SCRIPT ]; then
echo " Launching $SOME_SCRIPT"
$MNTPOINT/$SOME_SCRIPT
if [ -f /etc/$SOME_SCRIPT ]; then
echo " Launching /etc/$SOME_SCRIPT"
/etc/$SOME_SCRIPT
else
echo " $SOME_SCRIPT not found. Nothing to launch."
fi
......
......@@ -49,6 +49,9 @@ do_install_append() {
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/init_elphel393 ${D}${sysconfdir}/init.d
#install init script to /etc
install -m 0755 ${WORKDIR}/init_elphel393.sh ${D}${sysconfdir}/
for RLOC in ${PRODUCTION_ROOT_LOCATION}; do
if [ ! -d ${DEPLOY_DIR_IMAGE}/${RLOC} ]; then
mkdir -p ${DEPLOY_DIR_IMAGE}/${RLOC}
......
......@@ -13,14 +13,14 @@ ENV{ID_FS_LABEL}=="", ENV{ID_FS_USAGE}=="", GOTO="quit_automount"
ENV{ID_FS_LABEL}=="", ENV{ID_FS_USAGE}=="filesystem", ENV{dir_name}="%k"
# Mount device to /media if it is not SSD
ACTION=="add", ENV{ID_ATA_SATA}!="1", RUN+="/bin/mkdir -p /media/%E{dir_name}", RUN+="/bin/mount /dev/%k /media/%E{dir_name}"
ACTION=="add", ENV{ID_ATA_SATA}!="1", RUN+="/bin/mkdir -p /tmp/media/%E{dir_name}", RUN+="/bin/mount /dev/%k /tmp/media/%E{dir_name}"
# Mound device to /mnt if it is SSD
ACTION=="add", ENV{ID_ATA_SATA}=="1", RUN+="/bin/mkdir -p /mnt/%E{dir_name}", RUN+="/bin/mount /dev/%k /mnt/%E{dir_name}"
ACTION=="add", ENV{ID_ATA_SATA}=="1", RUN+="/bin/mkdir -p /tmp/mnt/%E{dir_name}", RUN+="/bin/mount /dev/%k /tmp/mnt/%E{dir_name}"
# Delete directory after removal
ACTION=="remove", ENV{ID_ATA_SATA}!="1", ENV{dir_name}!="", RUN+="/bin/rmdir /media/%E{dir_name}"
ACTION=="remove", ENV{ID_ATA_SATA}=="1", ENV{dir_name}!="", RUN+="/bin/rmdir /mnt/%E{dir_name}"
ACTION=="remove", ENV{ID_ATA_SATA}!="1", ENV{dir_name}!="", RUN+="/bin/rmdir /tmp/media/%E{dir_name}"
ACTION=="remove", ENV{ID_ATA_SATA}=="1", ENV{dir_name}!="", RUN+="/bin/rmdir /tmp/mnt/%E{dir_name}"
# Exit point
LABEL="quit_automount"
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