Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-web-393
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
elphel-web-393
Commits
9af221e1
Commit
9af221e1
authored
Mar 18, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commands to download logs and kill camogm
parent
f1f12cde
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
16 deletions
+42
-16
eyesis4pi_interface.php
src/eyesis4pi/eyesis4pi_interface.php
+42
-16
No files found.
src/eyesis4pi/eyesis4pi_interface.php
View file @
9af221e1
...
...
@@ -44,6 +44,28 @@ $file_lba_current = $sysfs_lba_path."lba_current";
$file_lba_end
=
$sysfs_lba_path
.
"lba_end"
;
switch
(
$cmd
){
case
"camogm_debug"
:
exec
(
"echo 'debug=/tmp/camogm.log;debuglev=6' > /var/state/camogm_cmd"
);
echo
"
$cmd
ok"
;
break
;
case
"camogm_kill"
:
exec
(
"killall -9 camogm"
);
echo
"
$cmd
ok"
;
break
;
case
"logs_download"
:
header
(
"Content-Type: application/octet-stream"
);
header
(
"Content-Disposition: attachment; filename=
\"
{
$_SERVER
[
"SERVER_ADDR"
]
}
.logs
\"
"
);
echo_file
(
$sysfs_lba_path
.
"io_error"
);
echo_file
(
$file_lba_start
);
echo_file
(
$file_lba_current
);
echo_file
(
$file_lba_end
);
echo_file
(
$camogmdisk
);
echo_file
(
"/var/log/messages"
);
echo_file
(
"/var/tmp/camogm.log"
);
break
;
case
"external_drive"
:
switch_sata_connection
(
"external"
);
echo
"
$cmd
ok"
;
...
...
@@ -152,23 +174,27 @@ switch($cmd){
default
:
print
(
"nothing has been done"
);
}
function
echo_file
(
$f
){
if
(
is_file
(
$f
)){
echo
"
$f
:
\n
"
;
echo
file_get_contents
(
$f
)
.
"
\n
"
;
}
else
{
echo
"
$f
: missing
\n
"
;
}
return
0
;
}
function
switch_sata_connection
(
$mode
){
global
$mountpoint
;
exec
(
"umount
$mountpoint
"
);
exec
(
"rmmod ahci_elphel"
);
if
(
$mode
==
"external"
){
exec
(
"/usr/local/bin/x393sata_control.py set_zynq_esata"
);
}
else
if
(
$mode
==
"internal"
){
exec
(
"/usr/local/bin/x393sata_control.py set_zynq_ssd"
);
}
exec
(
"modprobe ahci_elphel >/dev/null 2>&1 &"
);
sleep
(
2
);
exec
(
"echo 1 > /sys/devices/soc0/amba@0/80000000.elphel-ahci/load_module"
);
global
$mountpoint
;
if
(
$mode
==
"external"
){
exec
(
"/usr/local/bin/x393sata_eyesis4pi_control.py set_zynq_esata"
);
}
else
if
(
$mode
==
"internal"
){
exec
(
"/usr/local/bin/x393sata_eyesis4pi_control.py set_zynq_ssd"
);
}
}
?>
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