Commit 19d3be25 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

moving back to /

parent 18394acc
......@@ -59,7 +59,7 @@ function init(){
ct2 = $("<div style='padding-top:20px;'>");
tmpstr = "Absolute path: <input id='abspath' style='text' value='/tmp/mnt/sda1' class='ap' />";
tmpstr = "Absolute path: <input id='abspath' style='text' value='/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=/tmp/mnt",
url:"camogm.php?cmd=list&path=/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=="/tmp/mnt/sda1") {
if (tmp=="/mnt/sda1") {
$("#abspath").val(tmp);
res = true;
}
......
......@@ -71,9 +71,9 @@ if ($cmd=="create_symlink"){
if (isset($_GET['path'])) {
$path = $_GET['path'];
if (is_dir($path)){
//exec("ln -sf $path /www/pages/video;sync");
if (file_exists("/tmp/video")) unlink("/tmp/video");
exec("ln -sf $path /tmp/video");
exec("ln -sf $path /www/pages/video;sync");
//if (file_exists("/tmp/video")) unlink("/tmp/video");
//exec("ln -sf $path /tmp/video");
}
}
}
......@@ -90,7 +90,7 @@ if ($cmd=="start"){
fprintf($fcmd,"exit;\n");
exec('sync');
}else if ($cmd=="default"){
fprintf($fcmd,"format=mov;exif=0;prefix=/tmp/mnt/sda1/;\n");
fprintf($fcmd,"format=mov;exif=0;prefix=/mnt/sda1/;\n");
}else{
fprintf($fcmd,"$cmd\n");
//exec('sync');
......
......@@ -20,3 +20,7 @@ IMAGE_ROOTFS_SIZE = "8192"
BAD_RECOMMENDATIONS += "busybox-syslog"
do_compile_append(){
echo "VIRTUAL-RUNTIME_base-utils= ${VIRTUAL-RUNTIME_base-utils}"
echo "ROOTFS_BOOTSTRAP_INSTALL= ${ROOTFS_BOOTSTRAP_INSTALL}"
}
\ No newline at end of file
......@@ -5,7 +5,7 @@ DAEMON=/usr/sbin/init_elphel393
NAME=init_elphel393
DESC="extra init scripts"
MNTPOINT=/tmp/mnt/mmc
MNTPOINT=/mnt/mmc
MMCDEV=/dev/mmcblk0p1
SOME_SCRIPT=init_elphel393.sh
......
......@@ -13,19 +13,19 @@ SATA_EN=1
ifconfig eth0 192.168.0.9
PYDIR=/tmp/local/bin
PYDIR=/usr/local/bin
mkdir /tmp/local
cp -r /usr/local/bin $PYDIR
#mkdir /tmp/local
#cp -r /usr/local/bin $PYDIR
cd /usr/local/verilog/
if [ $SENSOR_TYPE -eq 5 ]; then
ln -sf x393_parallel.bit x393.bit
$PYDIR/test_mcntrl.py @startup5 >> /dev/null 2>&1 &
ln -sf /usr/local/verilog/x393_parallel.bit /tmp/x393.bit
else
ln -sf x393_hispi.bit x393.bit
$PYDIR/test_mcntrl.py @startup14 >> /dev/null 2>&1 &
ln -sf /usr/local/verilog/x393_hispi.bit /tmp/x393.bit
fi
sleep 10
......
......@@ -166,40 +166,41 @@ read_args
mount_and_boot() {
mkdir $ROOT_MOUNT
#mknod /dev/loop0 b 7 0 2>/dev/null
#if [ "$ROOT_FSTYPE" = "ubifs" ]; then
#unlock flash ? - driver should have taken care of this
# ubiattach won't be found and there's no need because kernel already knows
#ubiattach /dev/ubi_ctrl -m $ROOT_UBIVOL
#fi
if ! mount -t $ROOT_FSTYPE -o rw,noatime $ROOT_DEVICE $ROOT_MOUNT ; then
fatal "Could not mount rootfs device (not $ROOT_FSTYPE?)"
fi
# always 'overlay'
TMP=/var/volatile/tmp
mkdir -p /var/volatile
mount -t tmpfs tmpfs /var/volatile
mkdir -p $TMP/rootfs.ro $TMP/rootfs.rw
if [ "$ROOT_FSTYPE" = "ubifs" ]; then
#mknod /dev/loop0 b 7 0 2>/dev/null
if ! mount -n --move $ROOT_MOUNT $TMP/rootfs.ro; then
rm -rf $TMP/rootfs.ro $TMP/rootfs.rw
fatal "Could not move rootfs mount point"
else
mount -t tmpfs -o rw,noatime,mode=755 tmpfs $TMP/rootfs.rw
mkdir -p $TMP/rootfs.rw/upperdir $TMP/rootfs.rw/work
mount -t overlay overlay -o "lowerdir=$TMP/rootfs.ro,upperdir=$TMP/rootfs.rw/upperdir,workdir=$TMP/rootfs.rw/work" $ROOT_MOUNT
#if [ "$ROOT_FSTYPE" = "ubifs" ]; then
#unlock flash ? - driver should have taken care of this
# ubiattach won't be found and there's no need because kernel already knows
#ubiattach /dev/ubi_ctrl -m $ROOT_UBIVOL
#fi
# Assuming $ROOT_MOUNT/var/volatile exists
mount --move /var/volatile $ROOT_MOUNT/var/volatile
# Everything is already moved with /var/volatile
#mkdir -p $ROOT_MOUNT/rootfs.ro $ROOT_MOUNT/rootfs.rw
#mount --move /rootfs.ro $ROOT_MOUNT/rootfs.ro
#mount --move /rootfs.rw $ROOT_MOUNT/rootfs.rw
fi
# always 'overlay'
TMP=/var/volatile/tmp
mkdir -p /var/volatile
mount -t tmpfs tmpfs /var/volatile
mkdir -p $TMP/rootfs.ro $TMP/rootfs.rw
if ! mount -n --move $ROOT_MOUNT $TMP/rootfs.ro; then
rm -rf $TMP/rootfs.ro $TMP/rootfs.rw
fatal "Could not move rootfs mount point"
else
mount -t tmpfs -o rw,noatime,mode=755 tmpfs $TMP/rootfs.rw
mkdir -p $TMP/rootfs.rw/upperdir $TMP/rootfs.rw/work
mount -t overlay overlay -o "lowerdir=$TMP/rootfs.ro,upperdir=$TMP/rootfs.rw/upperdir,workdir=$TMP/rootfs.rw/work" $ROOT_MOUNT
# Assuming $ROOT_MOUNT/var/volatile exists
mount --move /var/volatile $ROOT_MOUNT/var/volatile
# Everything is already moved with /var/volatile
#mkdir -p $ROOT_MOUNT/rootfs.ro $ROOT_MOUNT/rootfs.rw
#mount --move /rootfs.ro $ROOT_MOUNT/rootfs.ro
#mount --move /rootfs.rw $ROOT_MOUNT/rootfs.rw
fi
fi
boot_live_root
#commenting out old lines
......
#!/bin/sh
rsync -av \
--exclude '*.pyc' \
--exclude '.python-history*' \
--exclude 'etc/udev-cache.tar.gz' \
--exclude 'etc/udev' \
--exclude 'etc/volatile.cache' \
--exclude '' \
--exclude '' \
--exclude 'media' \
--exclude 'mnt' \
--exclude 'run' \
--exclude 'var' \
/tmp/rootfs.rw/upperdir/ /tmp/rootfs.ro/
echo $@ > /tmp/overlay_sync
exit 0
......@@ -12,7 +12,9 @@ case "$1" in
stop)
echo -n "Stopping $DESC: "
echo "$NAME."
/sbin/overlay_sync
if [ -f /tmp/overlay ]; then
rsync -av /tmp/rootfs.rw/upperdir/ /tmp/rootfs.ro/
fi
;;
restart)
echo -n "Restarting $DESC: "
......@@ -27,7 +29,9 @@ case "$1" in
fi
;;
sync)
/sbin/overlay_sync
if [ -f /tmp/overlay ]; then
rsync -av /tmp/rootfs.rw/upperdir/ /tmp/rootfs.ro/
fi
;;
*)
N=/etc/init.d/$NAME
......
......@@ -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 /tmp/media/%E{dir_name}", RUN+="/bin/mount /dev/%k /tmp/media/%E{dir_name}"
ACTION=="add", ENV{ID_ATA_SATA}!="1", RUN+="/bin/mkdir -p /media/%E{dir_name}", RUN+="/bin/mount /dev/%k /media/%E{dir_name}"
# Mound device to /mnt if it is SSD
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}"
ACTION=="add", ENV{ID_ATA_SATA}=="1", RUN+="/bin/mkdir -p /mnt/%E{dir_name}", RUN+="/bin/mount /dev/%k /mnt/%E{dir_name}"
# Delete directory after removal
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}"
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}"
# 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