Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
meta-elphel393
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
meta-elphel393
Commits
f3c5db5d
Commit
f3c5db5d
authored
Jul 22, 2016
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Elphel/meta-elphel393
parents
af102a1c
1aeb6d8c
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
97 additions
and
63 deletions
+97
-63
elphel-misc.bbclass
classes/elphel-misc.bbclass
+27
-0
camogm.js
recipes-core/apps-web/files/camogm.js
+3
-3
camogm.php
recipes-core/apps-web/files/camogm.php
+4
-4
core-image-elphel393-initramfs.bb
recipes-core/images/core-image-elphel393-initramfs.bb
+4
-0
init_elphel393
recipes-core/init-elphel393/files/init_elphel393
+1
-1
init_elphel393.sh
recipes-core/init-elphel393/files/init_elphel393.sh
+8
-6
init-elphel393_1.0.bb
recipes-core/init-elphel393/init-elphel393_1.0.bb
+10
-2
init-live.sh
recipes-core/initrdscripts/files/init-live.sh
+29
-28
overlay_sync
recipes-core/overlay-sync/files/overlay_sync
+1
-13
overlay_syncd
recipes-core/overlay-sync/files/overlay_syncd
+6
-2
90-elphel-automount.rules
recipes-core/udev-rules/files/90-elphel-automount.rules
+4
-4
No files found.
classes/elphel-misc.bbclass
0 → 100644
View file @
f3c5db5d
# Well
# returns string - based on file
def version_update(path,file,evr):
for line in open(path+'/'+file):
line = line.strip()
if (line[0]!="#"):
break
arr = line.split('.')
try:
arr[evr]
except IndexError:
if (evr==1): res = 0
if (evr==2): res = revision_update(path,file)
else:
res = arr[evr]
return res
def revision_update(path,file):
import subprocess
cmd = "cd "+path+"; git rev-list --count $(git log -1 --pretty=format:\"%H\" "+file+")..HEAD"
try:
res = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
except subprocess.CalledProcessError as e:
res = "error_"+e.returncode
res = res.strip(' \t\n\r')
return res
recipes-core/apps-web/files/camogm.js
View file @
f3c5db5d
...
...
@@ -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
;
}
...
...
recipes-core/apps-web/files/camogm.php
View file @
f3c5db5d
...
...
@@ -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');
...
...
recipes-core/images/core-image-elphel393-initramfs.bb
View file @
f3c5db5d
...
...
@@ -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
recipes-core/init-elphel393/files/init_elphel393
View file @
f3c5db5d
...
...
@@ -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
...
...
recipes-core/init-elphel393/files/init_elphel393.sh
View file @
f3c5db5d
...
...
@@ -6,6 +6,8 @@
SENSOR_TYPE
=
14
# imgsrv port number
IMGSRV_PORT
=
2323
# camogm port number
CAMOGM_PORT
=
3456
# camogm command pipe name
CAMOGM_PIPE
=
/var/volatile/camogm_cmd
# enable SATA, set this to 1 if camera is equipped with SSD drive
...
...
@@ -13,19 +15,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
...
...
@@ -122,7 +124,7 @@ if [ -f /usr/bin/imgsrv ]; then
imgsrv
-p
$IMGSRV_PORT
&
fi
if
[
-f
/usr/bin/camogm
]
;
then
camogm
$CAMOGM_PIPE
&
camogm
-n
$CAMOGM_PIPE
-p
$CAMOGM_PORT
&
fi
if
[
$SATA_EN
-eq
1
]
;
then
...
...
recipes-core/init-elphel393/init-elphel393_1.0.bb
View file @
f3c5db5d
...
...
@@ -13,8 +13,16 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-3.0;md5=c79ff39f19dfec6d293
SRCDATE = "20131202"
PV = "${SRCDATE}"
PR = "r0"
#PV = "${SRCDATE}"
#PR = "r0"
# PV,PR update
inherit elphel-misc
VPATH = "${TOPDIR}/../../fpga-elphel/x393"
VFILE = "VERSION"
PE = "${@version_update('${VPATH}','${VFILE}',0)}"
PV = "${@version_update('${VPATH}','${VFILE}',1)}"
PR = "${@version_update('${VPATH}','${VFILE}',2)}"
RDEPENDS_${PN} += "\
python-core \
...
...
recipes-core/initrdscripts/files/init-live.sh
View file @
f3c5db5d
...
...
@@ -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
...
...
recipes-core/overlay-sync/files/overlay_sync
View file @
f3c5db5d
#!/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
recipes-core/overlay-sync/files/overlay_syncd
View file @
f3c5db5d
...
...
@@ -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
...
...
recipes-core/udev-rules/files/90-elphel-automount.rules
View file @
f3c5db5d
...
...
@@ -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"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment