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
a526e777
Commit
a526e777
authored
Dec 21, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated. rocko - py 3.5.2, jethro - py 2.7.12
parent
5127c1fa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
24 deletions
+28
-24
elphel-scp.bbclass
classes/elphel-scp.bbclass
+23
-20
elphel-ssh.bbclass
classes/elphel-ssh.bbclass
+5
-4
No files found.
classes/elphel-scp.bbclass
View file @
a526e777
...
@@ -40,10 +40,13 @@ python do_target_scp () {
...
@@ -40,10 +40,13 @@ python do_target_scp () {
cmd = "ping "+REMOTE_IP+" -c 1"
cmd = "ping "+REMOTE_IP+" -c 1"
print("cmd: "+cmd)
print("cmd: "+cmd)
try:
try:
subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
subprocess.run(cmd,stderr=subprocess.STDOUT,shell=True)
except subprocess.CalledProcessError:
except subprocess.CalledProcessError as e:
print("MOST EPIC FAIL 1: "+str(e.output))
print("MOST EPIC FAIL 2: "+str(e.cmd))
raise Exception("No route to target "+REMOTE_IP)
raise Exception("No route to target "+REMOTE_IP)
nandboot = command_over_ssh(d,"'if [ -d /tmp/rootfs.ro ]; then echo 1; else echo 0;fi'")
nandboot = command_over_ssh(d,"'if [ -d /tmp/rootfs.ro ]; then echo 1; else echo 0;fi'")
...
@@ -56,7 +59,7 @@ python do_target_scp () {
...
@@ -56,7 +59,7 @@ python do_target_scp () {
#copy archive
#copy archive
cmd = "scp -i "+IDENTITY_FILE+" -p "+WORKDIR+"/image.tar.gz "+REMOTE_USER+"@"+REMOTE_IP+":/"
cmd = "scp -i "+IDENTITY_FILE+" -p "+WORKDIR+"/image.tar.gz "+REMOTE_USER+"@"+REMOTE_IP+":/"
print("cmd: "+cmd)
print("cmd: "+cmd)
subprocess.
check_output
(cmd,stderr=subprocess.STDOUT,shell=True)
subprocess.
run
(cmd,stderr=subprocess.STDOUT,shell=True)
#unpack archive to /
#unpack archive to /
command_over_ssh(d,"'tar -C / -xzpf /image.tar.gz; sync'")
command_over_ssh(d,"'tar -C / -xzpf /image.tar.gz; sync'")
#unpack archive to /tmp/rootfs.ro
#unpack archive to /tmp/rootfs.ro
...
@@ -86,7 +89,7 @@ python do_target_scp () {
...
@@ -86,7 +89,7 @@ python do_target_scp () {
#copy archive
#copy archive
print("Copy archive")
print("Copy archive")
cmd = "scp -i "+IDENTITY_FILE+" -p "+WORKDIR+"/image.tar.gz "+REMOTE_USER+"@"+REMOTE_IP+":/"
cmd = "scp -i "+IDENTITY_FILE+" -p "+WORKDIR+"/image.tar.gz "+REMOTE_USER+"@"+REMOTE_IP+":/"
subprocess.
check_output
(cmd,stderr=subprocess.STDOUT,shell=True)
subprocess.
run
(cmd,stderr=subprocess.STDOUT,shell=True)
#unpack archive to mountpoint
#unpack archive to mountpoint
print("Unpack archive then delete")
print("Unpack archive then delete")
...
@@ -101,7 +104,7 @@ python do_target_scp () {
...
@@ -101,7 +104,7 @@ python do_target_scp () {
#copy archive
#copy archive
cmd = "scp -i "+IDENTITY_FILE+" -p "+WORKDIR+"/image.tar.gz "+REMOTE_USER+"@"+REMOTE_IP+":/"
cmd = "scp -i "+IDENTITY_FILE+" -p "+WORKDIR+"/image.tar.gz "+REMOTE_USER+"@"+REMOTE_IP+":/"
subprocess.
check_output
(cmd,stderr=subprocess.STDOUT,shell=True)
subprocess.
run
(cmd,stderr=subprocess.STDOUT,shell=True)
#unpack archive to /
#unpack archive to /
command_over_ssh(d,"'tar -C / -xzpf /image.tar.gz; rm -f /image.tar.gz; sync'")
command_over_ssh(d,"'tar -C / -xzpf /image.tar.gz; rm -f /image.tar.gz; sync'")
...
...
classes/elphel-ssh.bbclass
View file @
a526e777
...
@@ -8,8 +8,9 @@ def command_over_ssh(d,command):
...
@@ -8,8 +8,9 @@ def command_over_ssh(d,command):
cmd = "ssh -i "+id+" "+user+"@"+ip+" "+command
cmd = "ssh -i "+id+" "+user+"@"+ip+" "+command
print("cmd: "+cmd)
print("cmd: "+cmd)
try:
try:
ret = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
ret = subprocess.run(cmd,stderr=subprocess.STDOUT,shell=True)
except subprocess.CalledProcessError:
except subprocess.CalledProcessError as e:
print("Error code: "+e.returncode)
raise Exception("Copying to target requires access by public key. Run: \033[1;37mssh-copy-id "+REMOTE_USER+"@"+REMOTE_IP+"\033[0m")
raise Exception("Copying to target requires access by public key. Run: \033[1;37mssh-copy-id "+REMOTE_USER+"@"+REMOTE_IP+"\033[0m")
return
ret.strip()
return
str(ret).strip()
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