Commit 7e1bb078 authored by Mikhail Karpenko's avatar Mikhail Karpenko

Merge branch 'master' of https://github.com/Elphel/meta-elphel393

parents c5b18ceb 19d3be25
...@@ -59,7 +59,7 @@ function init(){ ...@@ -59,7 +59,7 @@ function init(){
ct2 = $("<div style='padding-top:20px;'>"); 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); ct2.html(tmpstr);
$("#controls").append(ct2); $("#controls").append(ct2);
...@@ -212,14 +212,14 @@ function get_files(){ ...@@ -212,14 +212,14 @@ function get_files(){
function init_path(){ function init_path(){
$.ajax({ $.ajax({
url:"camogm.php?cmd=list&path=/tmp/mnt", url:"camogm.php?cmd=list&path=/mnt",
complete: function(data){ complete: function(data){
var xml = data.responseXML; var xml = data.responseXML;
var dirs = $(xml).find("d"); var dirs = $(xml).find("d");
var res = false; var res = false;
for(var i=0;i<dirs.length;i++){ for(var i=0;i<dirs.length;i++){
var tmp = $(dirs[i]).text(); var tmp = $(dirs[i]).text();
if (tmp=="/tmp/mnt/sda1") { if (tmp=="/mnt/sda1") {
$("#abspath").val(tmp); $("#abspath").val(tmp);
res = true; res = true;
} }
......
...@@ -71,9 +71,9 @@ if ($cmd=="create_symlink"){ ...@@ -71,9 +71,9 @@ if ($cmd=="create_symlink"){
if (isset($_GET['path'])) { if (isset($_GET['path'])) {
$path = $_GET['path']; $path = $_GET['path'];
if (is_dir($path)){ if (is_dir($path)){
//exec("ln -sf $path /www/pages/video;sync"); exec("ln -sf $path /www/pages/video;sync");
if (file_exists("/tmp/video")) unlink("/tmp/video"); //if (file_exists("/tmp/video")) unlink("/tmp/video");
exec("ln -sf $path /tmp/video"); //exec("ln -sf $path /tmp/video");
} }
} }
} }
...@@ -90,7 +90,7 @@ if ($cmd=="start"){ ...@@ -90,7 +90,7 @@ if ($cmd=="start"){
fprintf($fcmd,"exit;\n"); fprintf($fcmd,"exit;\n");
exec('sync'); exec('sync');
}else if ($cmd=="default"){ }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{ }else{
fprintf($fcmd,"$cmd\n"); fprintf($fcmd,"$cmd\n");
//exec('sync'); //exec('sync');
......
...@@ -20,3 +20,7 @@ IMAGE_ROOTFS_SIZE = "8192" ...@@ -20,3 +20,7 @@ IMAGE_ROOTFS_SIZE = "8192"
BAD_RECOMMENDATIONS += "busybox-syslog" 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 ...@@ -5,7 +5,7 @@ DAEMON=/usr/sbin/init_elphel393
NAME=init_elphel393 NAME=init_elphel393
DESC="extra init scripts" DESC="extra init scripts"
MNTPOINT=/tmp/mnt/mmc MNTPOINT=/mnt/mmc
MMCDEV=/dev/mmcblk0p1 MMCDEV=/dev/mmcblk0p1
SOME_SCRIPT=init_elphel393.sh SOME_SCRIPT=init_elphel393.sh
......
...@@ -15,19 +15,19 @@ SATA_EN=1 ...@@ -15,19 +15,19 @@ SATA_EN=1
ifconfig eth0 192.168.0.9 ifconfig eth0 192.168.0.9
PYDIR=/tmp/local/bin PYDIR=/usr/local/bin
mkdir /tmp/local #mkdir /tmp/local
cp -r /usr/local/bin $PYDIR #cp -r /usr/local/bin $PYDIR
cd /usr/local/verilog/ cd /usr/local/verilog/
if [ $SENSOR_TYPE -eq 5 ]; then if [ $SENSOR_TYPE -eq 5 ]; then
ln -sf x393_parallel.bit x393.bit
$PYDIR/test_mcntrl.py @startup5 >> /dev/null 2>&1 & $PYDIR/test_mcntrl.py @startup5 >> /dev/null 2>&1 &
ln -sf /usr/local/verilog/x393_parallel.bit /tmp/x393.bit
else else
ln -sf x393_hispi.bit x393.bit
$PYDIR/test_mcntrl.py @startup14 >> /dev/null 2>&1 & $PYDIR/test_mcntrl.py @startup14 >> /dev/null 2>&1 &
ln -sf /usr/local/verilog/x393_hispi.bit /tmp/x393.bit
fi fi
sleep 10 sleep 10
......
...@@ -166,40 +166,41 @@ read_args ...@@ -166,40 +166,41 @@ read_args
mount_and_boot() { mount_and_boot() {
mkdir $ROOT_MOUNT 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 if ! mount -t $ROOT_FSTYPE -o rw,noatime $ROOT_DEVICE $ROOT_MOUNT ; then
fatal "Could not mount rootfs device (not $ROOT_FSTYPE?)" fatal "Could not mount rootfs device (not $ROOT_FSTYPE?)"
fi fi
# always 'overlay' if [ "$ROOT_FSTYPE" = "ubifs" ]; then
TMP=/var/volatile/tmp #mknod /dev/loop0 b 7 0 2>/dev/null
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 #if [ "$ROOT_FSTYPE" = "ubifs" ]; then
rm -rf $TMP/rootfs.ro $TMP/rootfs.rw #unlock flash ? - driver should have taken care of this
fatal "Could not move rootfs mount point" # ubiattach won't be found and there's no need because kernel already knows
else #ubiattach /dev/ubi_ctrl -m $ROOT_UBIVOL
mount -t tmpfs -o rw,noatime,mode=755 tmpfs $TMP/rootfs.rw #fi
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 # always 'overlay'
mount --move /var/volatile $ROOT_MOUNT/var/volatile TMP=/var/volatile/tmp
# Everything is already moved with /var/volatile mkdir -p /var/volatile
#mkdir -p $ROOT_MOUNT/rootfs.ro $ROOT_MOUNT/rootfs.rw mount -t tmpfs tmpfs /var/volatile
#mount --move /rootfs.ro $ROOT_MOUNT/rootfs.ro mkdir -p $TMP/rootfs.ro $TMP/rootfs.rw
#mount --move /rootfs.rw $ROOT_MOUNT/rootfs.rw
fi 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 boot_live_root
#commenting out old lines #commenting out old lines
......
#!/bin/sh #!/bin/sh
rsync -av \ echo $@ > /tmp/overlay_sync
--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/
exit 0 exit 0
...@@ -12,7 +12,9 @@ case "$1" in ...@@ -12,7 +12,9 @@ case "$1" in
stop) stop)
echo -n "Stopping $DESC: " echo -n "Stopping $DESC: "
echo "$NAME." echo "$NAME."
/sbin/overlay_sync if [ -f /tmp/overlay ]; then
rsync -av /tmp/rootfs.rw/upperdir/ /tmp/rootfs.ro/
fi
;; ;;
restart) restart)
echo -n "Restarting $DESC: " echo -n "Restarting $DESC: "
...@@ -27,7 +29,9 @@ case "$1" in ...@@ -27,7 +29,9 @@ case "$1" in
fi fi
;; ;;
sync) sync)
/sbin/overlay_sync if [ -f /tmp/overlay ]; then
rsync -av /tmp/rootfs.rw/upperdir/ /tmp/rootfs.ro/
fi
;; ;;
*) *)
N=/etc/init.d/$NAME N=/etc/init.d/$NAME
......
...@@ -13,14 +13,14 @@ ENV{ID_FS_LABEL}=="", ENV{ID_FS_USAGE}=="", GOTO="quit_automount" ...@@ -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" ENV{ID_FS_LABEL}=="", ENV{ID_FS_USAGE}=="filesystem", ENV{dir_name}="%k"
# Mount device to /media if it is not SSD # 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 # 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 # 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 /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 /mnt/%E{dir_name}"
# Exit point # Exit point
LABEL="quit_automount" 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