pax_global_header 0000666 0000000 0000000 00000000064 13652421575 0014524 g ustar 00root root 0000000 0000000 52 comment=e964f75303ae63bd39871eba9f1bb8da53aa47e6
elphel393-rocko-e964f75303ae63bd39871eba9f1bb8da53aa47e6/ 0000775 0000000 0000000 00000000000 13652421575 0021522 5 ustar 00root root 0000000 0000000 elphel393-rocko-e964f75303ae63bd39871eba9f1bb8da53aa47e6/.gitignore 0000664 0000000 0000000 00000000313 13652421575 0023507 0 ustar 00root root 0000000 0000000 attic/*
.directory
linux-elphel
meta
poky
rootfs-elphel
tools
bootable-images
projects.json
/scripts/.project
/scripts/.pydevproject
/scripts/.settings
/fpga-elphel
!/fpga-elphel/eclipse_workspace_setup
elphel393-rocko-e964f75303ae63bd39871eba9f1bb8da53aa47e6/README.md 0000664 0000000 0000000 00000004254 13652421575 0023006 0 ustar 00root root 0000000 0000000 Note for developers: **To have SSH access to all Elphel's repositories clone this project using SSH**
Note for users: **Some already built firmware images are available [here](http://community.elphel.com/files/393/). Also check [User Manual](https://wiki.elphel.com/wiki/Tmp_manual).**
# elphel393
The project contains scripts for fetching and setting up build environment that will generate firmware images for Elphel393 camera systems.
It clones and configures several individual repositories, such as
* https://git.elphel.com/Elphel/linux-elphel
* https://git.elphel.com/Elphel/x393
* http://git.yoctoproject.org
* http://git.openembedded.org
* https://github.com/Xilinx/meta-xilinx
* https://git.elphel.com/Elphel/meta-elphel393
The same script (*setup.py*) pulls updates from these repositories
### Get environment
#### Dependencies
* poky might require installing some packages, please check with the [Yocto Poky Manual](http://www.yoctoproject.org/docs/2.0/mega-manual/mega-manual.html)
* extra requirement
```sh
$ sudo apt install python-numpy
```
#### Get sources
```sh
$ ./setup.py
```
### Build targets
```sh
$ cd poky
$ . ./oe-init-build-env
$ bitbake u-boot device-tree linux-xlnx core-image-elphel393
```
* the results are in *poky/build/tmp/deploy/images/elphel393/*
* for more details, read [**this guide**][1] at [https://wiki.elphel.com][1]
[1]: http://wiki.elphel.com/index.php?title=Poky_2.0_manual
### Update and refresh environment
```sh
$ ./setup.py
```
### Rebuild targets
```sh
$ cd poky
$ . ./oe-init-build-env
$ (if changes in the kernel) bitbake linux-xlnx -c link -f; bitbake linux-xlnx
$ (if changes in the rootfs and the kernel) bitbake core-image-elphel393
```
### More info
[**Development for 10393**](https://wiki.elphel.com/wiki/Development_for_10393)
### Support
support-list@support.elphel.com
### Note 1: Switching between GIT protocols (SSH or HTTPS)
To have access to related Elphel's projects over **SSH** clone this project using **SSH**.
For **HTTPS** clone with **HTTPS**.
To change git protocol for all Elphel's projects - change the *remote* of this project accordingly, then run *setup.py*:
```sh
$ git remote -v
$ git remote set-url ...
$ ./setup.py
``` elphel393-rocko-e964f75303ae63bd39871eba9f1bb8da53aa47e6/check_versions.py 0000775 0000000 0000000 00000014105 13652421575 0025105 0 ustar 00root root 0000000 0000000 #!/usr/bin/env python
# Check software versions on the target
__author__ = "Elphel"
__copyright__ = "Copyright 2016, Elphel, Inc."
__license__ = "GPL"
__version__ = "3.0+"
__maintainer__ = "Oleg K Dzhimiev"
__email__ = "oleg@elphel.com"
__status__ = "Development"
import json
import os
import subprocess
import sys
#http://stackoverflow.com/questions/287871/print-in-terminal-with-colors-using-python
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[38;5;214m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
BOLDWHITE = '\033[1;37m'
UNDERLINE = '\033[4m'
def shout(cmd):
subprocess.call(cmd,shell=True)
def command_over_ssh(addr,command):
cmd = "ssh "+addr+" "+command
print("cmd: "+cmd)
try:
ret = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
except subprocess.CalledProcessError:
raise Exception("ssh to target requires access by public key. Run: \033[1;37mssh-copy-id "+addr+"\033[0m")
return ret.strip()
def read_local_conf(conf_file,pattern):
ret = "0"
if os.path.isfile(conf_file):
with open(conf_file,"r") as f:
lines = f.readlines()
for line in lines:
test = line.find(pattern)
if test!=-1:
ret = line.split("=")[1].strip().strip("\"")
return ret
def get_versions_from_target(addr,tdir):
# print remote package list
tmp_str = command_over_ssh(addr,"'ls "+tdir+"'")
remote_list = []
tmp_list = tmp_str.split()
for elem in tmp_list:
remote_list.append([elem,command_over_ssh(addr,"'cat "+tdir+"/"+elem+"'")])
return remote_list
def get_versions_from_target_quick(addr,tdir):
# print remote package list
ldir = os.path.basename(tdir)
if os.path.isdir(ldir):
shout("rm -rf "+ldir)
shout("scp -r "+addr+":"+tdir+" .")
remote_list = []
for f in os.listdir(ldir):
with open(ldir+"/"+f, 'r') as content_file:
content = content_file.read()
remote_list.append([f,content.strip()])
shout("rm -rf "+ldir)
return remote_list
def get_version_from_git(path,vfile):
#print(path)
cwd = os.getcwd()
os.chdir(cwd+"/"+path)
p0=""
p1=""
if os.path.isfile(vfile):
#PE.PV
f=open(vfile)
for line in f:
line = line.strip()
if (line[0]!="#"):
break
p0 = line
#PR
cmd = "git rev-list --count $(git log -1 --pretty=format:\"%H\" "+vfile+")..HEAD"
p1 = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
p1 = p1.strip()
else:
print(vfile+" file is missing in the project")
os.chdir(cwd)
return p0+"."+p1
def deep_analysis(local,remote):
print("\nVersion analysis")
print("\n"+bcolors.BOLDWHITE+"{:<24}".format("Project")+"{:<16}".format("Local GIT")+"{:<16}".format("Target Version")+bcolors.ENDC)
update_list = ""
for pl,vl in local:
recstr = "{:<24}".format(pl)+"{:<16}".format(vl)
prfound = False
for pr,vr in remote:
if pl==pr:
prfound = True
recstr = recstr+"{:<16}".format(vr)
if vl==vr:
recstr = bcolors.OKGREEN+recstr+bcolors.ENDC
else:
recstr = bcolors.FAIL+recstr+bcolors.ENDC
pl = getname(pl,"","recipe_to_package")
update_list = update_list+" bitbake "+pl+" -c target_scp -f\n"
if not prfound:
recstr = bcolors.WARNING+recstr+bcolors.ENDC
pl = getname(pl,"","recipe_to_package")
update_list = update_list+" bitbake "+pl+" -c target_scp -f\n"
print(recstr)
if not update_list=="":
print("\nTo sync the software on the target run:\n"+update_list)
# all exceptions in one place
def getname(name,project,mode):
global project_prefix
global package_prefix
if mode=="project_to_recipe":
if name.find(project_prefix)==0:
name = name[len(project_prefix):]
if project.find(package_prefix)==0:
name = package_prefix+name
#only exception
if name=="fpga-x393_sata":
name="fpga-x393sata"
return name
elif mode=="recipe_to_package":
if name=="linux-elphel":
name = "linux-xlnx"
elif name=="apps-php-extension":
name = "php"
return name
else:
return name
usage = """Usage example:
{0}{1} root@192.168.0.9{2}, where
192.168.0.9 - target ip address
root - target user
""".format(bcolors.BOLDWHITE,sys.argv[0],bcolors.ENDC)
# hardcoded
user = ""
ip = ""
local_conf = "poky/build/conf/local.conf"
target_dir = "/etc/elphel393/packages"
local_project_list = "projects.json"
local_dirs = ["rootfs-elphel","fpga-elphel","linux-elphel"]
git_vfile = "VERSION"
project_prefix = "elphel-"
package_prefix = "fpga-"
if len(sys.argv)>1:
rootip = sys.argv[1].split("@")
if len(rootip)>1:
user,ip = rootip
else:
ip = rootip[0]
else:
if (os.path.isfile(local_conf)):
user = read_local_conf(local_conf,"REMOTE_USER")
ip = read_local_conf(local_conf,"REMOTE_IP")
print(bcolors.WARNING+"NOTE: The default user and ip are taken from "+local_conf+bcolors.ENDC)
print(bcolors.WARNING+"NOTE: To check against the latest code run ./setup.py first"+bcolors.ENDC)
print(usage)
if user=="" or ip=="":
raise Exception(usage)
print("Software/firmware versions check for target "+bcolors.BOLDWHITE+user+"@"+ip+bcolors.ENDC)
print(bcolors.BOLDWHITE+"=== Read versions from the target ==="+bcolors.ENDC)
target_list = get_versions_from_target_quick(user+"@"+ip,target_dir)
#print(target_list)
print(bcolors.BOLDWHITE+"=== Read local versions ==="+bcolors.ENDC)
with open(local_project_list) as data_file:
Projects = json.load(data_file)
local_list = []
for p,v in Projects.items():
if p in local_dirs:
if isinstance(v,dict):
for k,l in v.items():
tmp = get_version_from_git(p+"/"+k,git_vfile)
name = getname(k,p,"project_to_recipe")
local_list.append([name.encode('ascii','ignore'),tmp])
elif isinstance(v,list):
tmp = get_version_from_git(p,git_vfile)
local_list.append([p.encode('ascii','ignore'),tmp])
else:
raise Exception("Unknown error")
#print(local_list)
deep_analysis(local_list,target_list)
elphel393-rocko-e964f75303ae63bd39871eba9f1bb8da53aa47e6/fpga-elphel/ 0000775 0000000 0000000 00000000000 13652421575 0023706 5 ustar 00root root 0000000 0000000 elphel393-rocko-e964f75303ae63bd39871eba9f1bb8da53aa47e6/fpga-elphel/eclipse_workspace_setup/ 0000775 0000000 0000000 00000000000 13652421575 0030630 5 ustar 00root root 0000000 0000000 .metadata/ 0000775 0000000 0000000 00000000000 13652421575 0032407 5 ustar 00root root 0000000 0000000 elphel393-rocko-e964f75303ae63bd39871eba9f1bb8da53aa47e6/fpga-elphel/eclipse_workspace_setup .plugins/ 0000775 0000000 0000000 00000000000 13652421575 0034146 5 ustar 00root root 0000000 0000000 elphel393-rocko-e964f75303ae63bd39871eba9f1bb8da53aa47e6/fpga-elphel/eclipse_workspace_setup/.metadata org.eclipse.core.runtime/ 0000775 0000000 0000000 00000000000 13652421575 0040771 5 ustar 00root root 0000000 0000000 elphel393-rocko-e964f75303ae63bd39871eba9f1bb8da53aa47e6/fpga-elphel/eclipse_workspace_setup/.metadata/.plugins .settings/ 0000775 0000000 0000000 00000000000 13652421575 0042707 5 ustar 00root root 0000000 0000000 elphel393-rocko-e964f75303ae63bd39871eba9f1bb8da53aa47e6/fpga-elphel/eclipse_workspace_setup/.metadata/.plugins/org.eclipse.core.runtime com.elphel.vdt.veditor.prefs 0000664 0000000 0000000 00000000547 13652421575 0050253 0 ustar 00root root 0000000 0000000 elphel393-rocko-e964f75303ae63bd39871eba9f1bb8da53aa47e6/fpga-elphel/eclipse_workspace_setup/.metadata/.plugins/org.eclipse.core.runtime/.settings ClearProblemsOnToolStart.Enable=true
Color.Default=00,00,00
Color.DisabledCode=230,230,230
Debug.Closure=false
Debug.Disabled=false
Debug.Launching=false
Debug.Other=false
Debug.Parsing=false
Debug.Preprocessor=false
Debug.ToolsSequence=false
DisabledCode.Enable=true
Parser.MinReparse=945
Parser.OnType=false
Style.indentSize=4
eclipse.preferences.version=1
elphel393-rocko-e964f75303ae63bd39871eba9f1bb8da53aa47e6/projects-default.json 0000664 0000000 0000000 00000010155 13652421575 0025672 0 ustar 00root root 0000000 0000000 {
"meta" : {
"meta-openembedded":[
"git://git.openembedded.org/meta-openembedded",
"master","34aa4c3202b427f59f843dc43a4e1afda4f81d13"
],
"meta-xilinx":[
"https://github.com/Xilinx/meta-xilinx.git",
"master","a18947c20dba2c0c38db8bde1ad4684995df4bbd"
],
"meta-swupdate":[
"https://github.com/sbabic/meta-swupdate.git",
"master","0fb115e97187c069f0da90163f1f374a6b7a4af7"
],
"meta-ezynq":[
"https://git.elphel.com/Elphel/meta-ezynq.git",
"rocko","",
"#master","00496002f513fc253f5356ee675fdcbb8b4a9962"
],
"meta-elphel393":[
"https://git.elphel.com/Elphel/meta-elphel393.git",
"rocko","",
"#master","a93edc1f91e82e5e613fa38bd800e307c348b9ee"
],
"meta-ros":[
"https://github.com/bmwcarit/meta-ros.git",
"master","72068b17e4192b51e09c8dc633805a35edac8701"
]
},
"poky":[
"git://git.yoctoproject.org/poky.git",
"master","72867393fe2004ab9f0ee23eb09a975c82938b9e"
],
"linux-elphel" :[
"https://git.elphel.com/Elphel/linux-elphel.git",
"rocko","",
"#master","cc50d7fa07140e680b09a8add617e62b4ba35aa0"
],
"fpga-elphel" : {
"x393" :[
"https://git.elphel.com/Elphel/x393.git",
"lwir","",
"#master","edcdce9550c20726618210149bc1cb4549fd00be"
],
"x393_sata":[
"https://git.elphel.com/Elphel/x393_sata.git",
"master",""
],
"x359" :[
"https://git.elphel.com/Elphel/x359.git",
"master",""
]
},
"rootfs-elphel": {
"elphel-apps-imgsrv":[
"https://git.elphel.com/Elphel/elphel-apps-imgsrv.git",
"rocko",""
],
"elphel-apps-php-extension":[
"https://git.elphel.com/Elphel/elphel-apps-php-extension.git",
"rocko",""
],
"elphel-apps-camogm":[
"https://git.elphel.com/Elphel/elphel-apps-camogm.git",
"tiff",""
],
"elphel-udev-rules":[
"https://git.elphel.com/Elphel/elphel-udev-rules.git",
"rocko",""
],
"elphel-web-393":[
"https://git.elphel.com/Elphel/elphel-web-393.git",
"rocko",""
],
"elphel-apps-autocampars":[
"https://git.elphel.com/Elphel/elphel-apps-autocampars.git",
"rocko",""
],
"elphel-apps-autoexposure":[
"https://git.elphel.com/Elphel/elphel-apps-autoexposure.git",
"rocko",""
],
"elphel-apps-histograms":[
"https://git.elphel.com/Elphel/elphel-apps-histograms.git",
"rocko",""
],
"elphel-web-camvc":[
"https://git.elphel.com/Elphel/elphel-web-camvc.git",
"rocko",""
],
"elphel-apps-editconf":[
"https://git.elphel.com/Elphel/elphel-apps-editconf.git",
"rocko",""
],
"elphel-init":[
"https://git.elphel.com/Elphel/elphel-init.git",
"rocko",""
],
"elphel-web-hwmon":[
"https://git.elphel.com/Elphel/elphel-web-hwmon.git",
"rocko",""
],
"elphel-apps-tempmon":[
"https://git.elphel.com/Elphel/elphel-apps-tempmon.git",
"rocko",""
],
"elphel-apps-gps":[
"https://git.elphel.com/Elphel/elphel-apps-gps.git",
"rocko",""
],
"elphel-apps-astreamer":[
"https://git.elphel.com/Elphel/elphel-apps-astreamer.git",
"rocko",""
],
"ros2-scripts":[
"https://git.elphel.com/Elphel/ros2-scripts.git",
"rocko",""
],
"ros2-interfaces":[
"https://git.elphel.com/Elphel/ros2-interfaces.git",
"rocko",""
]
},
"tools" : {
"elphel-tools-update":[
"https://git.elphel.com/Elphel/elphel-tools-update.git",
"master",""
]
}
}
elphel393-rocko-e964f75303ae63bd39871eba9f1bb8da53aa47e6/scripts/ 0000775 0000000 0000000 00000000000 13652421575 0023211 5 ustar 00root root 0000000 0000000 elphel393-rocko-e964f75303ae63bd39871eba9f1bb8da53aa47e6/scripts/run_bitbake.sh 0000775 0000000 0000000 00000000764 13652421575 0026044 0 ustar 00root root 0000000 0000000 #!/bin/bash
#ls -all
args="$@"
arg0=$0
#echo "arg0=" $arg0
#echo "args=" $args
while (( "$#" )); do
shift
done
DIR=$(realpath $(dirname $(dirname $arg0))/sysroots)
# works for Poky Jethro - Rocko
# move up until Poky's init script is found
while ([ ! -f $DIR/oe-init-build-env ]);do
DIR=$(dirname $DIR)
if [ "e$DIR" = 'e/' ]; then
break
fi
done
echo "DIR= $DIR"
echo "Launching bitbake $args"
#cd $DIR0/../../poky
cd $DIR
. ./oe-init-build-env
bitbake $args | sed -u 's@| @@'
exit 0
elphel393-rocko-e964f75303ae63bd39871eba9f1bb8da53aa47e6/scripts/used_files.py 0000775 0000000 0000000 00000036704 13652421575 0025722 0 ustar 00root root 0000000 0000000 #!/usr/bin/env python
# encoding: utf-8
from __future__ import print_function
from __future__ import division
'''
# @file used_files.py
# @brief Extract file access data after build, modify CDT project configuration
# (.cproject) accordingly
# @copyright Copyright (C) 2016, Elphel.inc.
# @param License
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
@author: Andrey Filippov
@copyright: 2015 Elphel, Inc.
@license: GPLv3.0+
@contact: andrey@elphel.coml
@deffield updated: Updated
'''
__author__ = "Andrey Filippov"
__copyright__ = "Copyright 2015, Elphel, Inc."
__license__ = "GPL"
__version__ = "3.0+"
__maintainer__ = "Andrey Filippov"
__email__ = "andrey@elphel.com"
__status__ = "Development"
import os
import sys
import time
import subprocess
import datetime
import xml.etree.ElementTree
MAIN_SRC = 'src' # main source subdirectory path relative to project directory. SHould not be './' !
# print (" cwd=",os.getcwd())
def get_bitbake_target(project_root):
cproject_path = os.path.join(project_root,".cproject")
try:
return xml.etree.ElementTree.parse(cproject_path).getroot().find(
'storageModule/cconfiguration/storageModule/configuration/folderInfo/toolChain/builder').get('arguments').split()[0]
except:
return None
def file_tree(flist): # Each file in list is a file, no directories
ftree={}
for p in flist:
node = ftree
seg_list=p.split(os.sep)
last_i=len(seg_list)-1
for i,segm in enumerate(seg_list):
if not segm in node:
if i == last_i:
node[segm] = None
else:
node[segm] = {}
node=node[segm]
return ftree
def exclude_list(ftree, flist):
mark = "*" # no file/dir name can be "*"
def list_tree_recursive(root):
rslt = []
if not mark in root:
return [[""]] # convert to trailing "/" for directories
for n in root:
if not n == mark:
if root[n] is None:
rslt.append([n])
else:
for l in list_tree_recursive(root[n]):
rslt.append([n]+l)
return rslt
ftree[mark]=None # mark top level dir
for p in flist:
node = ftree
for segm in p.split(os.sep)[:-1]:
node=node[segm]
node[mark]=None # [mark] means used in flist
del node[p.split(os.sep)[-1]]
#print (ftree)
# for k in ftree:
# print(k)
#Now prune unused directories
#prune_recursive(ftree) # (assuming root is used)
# now create list
files_list_list = list_tree_recursive(ftree)
# print (files_list_list)
#converrt to file paths
pl = []
for l in files_list_list:
pl.append(os.path.join(*(l[1:])))
pl = sorted (pl)
return pl
def get_sourceEntries(xml_root, root_dir):
# main_src = 'src' # main source folder
for sm in xml_root.iter('storageModule'):
attr = sm.attrib
try:
if sm.attrib['moduleId'] != 'cdtBuildSystem':
continue
except:
continue
for se in sm.iter('sourceEntries'):
for en in se:
if en.tag == 'entry':
attr = en.attrib
try:
if (attr['kind'] == 'sourcePath') and (attr['name'] == root_dir):
se.remove (en)
print ("Removed existing entry, name= ",attr['name'])
return se
except:
print ("error matching attributes for ",en.tag)
pass
#look for MAIN_SRC entry
for se in sm.iter('sourceEntries'):
for en in se:
if en.tag == 'entry':
attr = en.attrib
try:
if (attr['kind'] == 'sourcePath') and (attr['name'] == MAIN_SRC):
print ("Found existing entry for main source folder, name= ",attr['name'])
return se
except:
print ("error matching attributes for ",en.tag)
pass
#create new sourceEntries
print ("Creating new sourceEntries element")
try:
se = xml.etree.ElementTree.SubElement(sm.find('configuration'), 'sourceEntries')
#first entry - src folder
xml.etree.ElementTree.SubElement(se, 'entry', {"flags":"VALUE_WORKSPACE_PATH", "kind":"sourcePath", "name":MAIN_SRC})
return se
except:
return None
return None
def proc_tree(root_path, start_time, output_project_file, DEBUG): # string, float
print("root_path=",root_path)
print("start_time=",start_time)
print("output_project_file=",output_project_file)
print("DEBUG=",DEBUG)
extensions = [".h",".c",".cpp"]
exclude_start = ["linux"+os.sep+"scripts"+os.sep,"linux"+os.sep+"source"+os.sep+"scripts"+os.sep]
delta_t = 3 # seconds
# try:
# start_time = float(sys.argv[2])
# except:
# start_time = 0.0
touch_files= start_time < 0.0
print ("root_path = %s"%(root_path))
# root_path = "/home/eyesis/git/poky/linux-elphel/linux/"
lstFiles = []
# Append files to a list
for path, _, files in os.walk(root_path, followlinks = True):
for f in files:
for ext in extensions:
if f.endswith(ext):
lstFiles.append(os.path.join(path, f))
break
all_tree= file_tree(sorted(lstFiles))
include_lst=[]
lst_a = []
latest_at=0
for p in lstFiles:
if touch_files:
if os.path.islink(p):
try:
os.utime(os.path.realpath(p), None)
except:
print("missing linked file: %s"%(os.path.realpath(p)))
else:
os.utime(p, None)
else:
# at = time.ctime(os.stat(p).st_atime)
try:
at = os.stat(p).st_atime
l = None
except:
at = 0
if os.path.islink(p):
try:
l = os.path.realpath(p)
at = os.stat(l).st_atime
except:
at = 0 # missing file
latest_at = max((latest_at,at))
if at > (start_time + delta_t):
#Scripts/lexers result in problems
exclude=False
for exStr in exclude_start:
if p.startswith(exStr):
break
else:
lst_a.append([p,at,l])
include_lst.append(p)
if touch_files:
print (len(lstFiles), "last time = ", time.time())
return time.time()
excluding = exclude_list(all_tree, include_lst)
# print (all_tree)
# print (sorted(include_lst))
# print ("|".join(excluding))
#os.sep.join(s1.split(os.sep)[1:])
including=[]
#get rid of top directory in include paths
for p in include_lst:
including.append(os.sep.join(p.split(os.sep)[1:]))
if DEBUG:
with open("all_sources.lst","w" ) as f:
for p in sorted(lstFiles):
try:
at = os.stat(p).st_atime
except:
at = 0
lnk=""
if os.path.islink(p):
try:
at = os.stat(os.path.realpath(p)).st_atime
except:
at = 0
lnk = os.path.realpath(p)
print (p,at,lnk, file=f)
with open("excluding.lst","w" ) as f:
for p in excluding:
print (p, file=f)
with open("including.lst","w" ) as f:
for p in including:
print (p, file=f)
# include_tree= file_tree(sorted(include_lst))
# print(include_tree)
try:
root_dir=include_lst[0].split(os.sep)[0] #may fail if list is empty
print ("root_dir=",root_dir)
except:
print ("No files used from ",root_path)
root_dir=root_path
root= xml.etree.ElementTree.parse(".cproject").getroot()
if len(include_lst):
se = get_sourceEntries(root, root_dir)
if se is None:
print ("No sourceEntries exist and could not create one")
return -1
#add other header files in header directory, excluding...
# if len(excluding) < len(including):
xml.etree.ElementTree.SubElement(se,
'entry',
{"flags":"VALUE_WORKSPACE_PATH", "kind":"sourcePath", "name":root_dir, "excluding":"|".join(excluding)})
# else:
# xml.etree.ElementTree.SubElement(se,
# 'entry',
# {"flags":"VALUE_WORKSPACE_PATH", "kind":"sourcePath", "name":root_dir, "including":"|".join(including)})
for child in root.iter('sourceEntries'):
for gchild in child:
print("tag=",gchild.tag," name=",gchild.attrib['name']," kind=",gchild.attrib['kind'])
oneliner= xml.etree.ElementTree.tostring(root)
#overwrites original .cproject, may change to somethong different
with open(output_project_file, "wr") as f:
f.write("""
""")
f.write(oneliner)
print (len(lstFiles), len(lst_a), "last access time = ",latest_at)
return latest_at
def main():
DEBUG = False
output_project_file=".cproject" #".cproject_new" Overwrite or save to a new file
argv = sys.argv
top_h_dir='sysroots'
if len(argv) < 2:
print ("""
This program creates a list of the source files (such as C headers) used to build the project
for Eclipse CDT plugin. It only needs to be run for the new projects, the existing ones already
have .cproject file distributed in each subproject repository (in 'eclipse_project_setup' sub-
directory of the root sub-project directory). This sub-directory content is copyied to the sub-
project root by setup.py when it is first run. You may delete .project file (while Eclipse is closed)
and re-run setup.py (in elphel393 directory) restore default project settings if they get corrupted.
The program does not rely on exact duplicating of the environment used by bitbake, instead it
"spies" on the bitbake by noticing which files it accesses during build (using file modification and
access timestamps) and creates list of exclusions. As the access time is recorded only after the first
access after modification, the program first unpacks/touches the sources.
The extra_source directory is the specified in the command line directory (in addition to hard-coded
'src') with sub-tree of the source files (headers) to be filtered.
Here is the full sequence (target is the project name extracted from .cproject):
1. bitbake target-c cleansstate
2. bitbake target-c unpack -f
3. bitbake target-c configure -f
4. Scan all files under extra_source directory, find last modification stamp
5. bitbake target-c compile -f
6. bitbake target-c install -f # in the case of Linux kernel in triggers compilation of the kernel
modules
7. Scan source files, create list of the used files and then list of excluded files (Eclipse CDT allows
to specify directory and exclusion filter)
8. Add (or replace) the record in .cproject file that specifies source directory and the filter
You need to run indexing (right-click on the project in the Navigator panel -> Index -> rebuild
when the workspace is opened with the modified .cproject file.
Do not run this program when Eclipse IDE is opened that includes the current project!
The program should be launched from the project root directory, e.g. for applications:
./scripts/used_files.py sysroots
Program can either overwrite the current .cproject configuration file or create a new modified version
if specified in teh command line argument. In that case program runs in debug mode and generates lists
of files in the project root directory:
all_sources.lst - all scanned source file with last access timestamps
including.lst - list of the files (relative to specified extra_source directory) used by bitbake
excluding.lst - list of the unused files (they will appear crossed in the Project Navigator)
USAGE:
%s extra_source [path-to-modified-cproject]
First (mandatory) argument of this program (extra_source) is the relative path additional source/header
files. For Linux kernel development it is 'linux', for php extension - 'php, for applications - 'sysroots'
(symlink to header files)
Second (optional) argument (path-to-modified-cproject) is the relative to project root file to write
modified .cproject content. If specified it forces program to run in debug mode and generate 3 file lists.
"""%(argv[0],))
return 0
# Check that there is MAIN_SRC ('src') subdirectory in the project directory
if not os.path.isdir(MAIN_SRC):
print("\n*** Project source files should be in subdirectory '%s' for this program to run. ***\n"%(MAIN_SRC,))
return 1
top_h_dir = argv[1]
if len(argv) > 2:
output_project_file = argv[2] # Save result .cproject to a new file
DEBUG = True
print (" cwd=",os.getcwd())
bitbake_target = get_bitbake_target(os.getcwd())
print ("bitbake target=",bitbake_target)
if not bitbake_target:
print ("Failed to find bitbake target from .cproject file (it has to be set up in project->properties->C/C++ Build command")
print ("For example: ${workspace_loc:/linux-elphel/scripts/run_bitbake.sh} linux-xlnx")
return 1
bitbake = './scripts/run_bitbake.sh'
cmnd = bitbake+ ' '+bitbake_target+' -c cleansstate'
# subprocess.call("ls -all", shell = True)
return_code = subprocess.call(cmnd, shell = True)
print ('Command: %s returned %d'%(cmnd,return_code))
cmnd = bitbake+ ' '+bitbake_target+' -c unpack -f'
return_code = subprocess.call(cmnd, shell = True)
print ('Command: %s returned %d'%(cmnd,return_code))
cmnd = bitbake+ ' '+bitbake_target+' -c configure -f'
return_code = subprocess.call(cmnd, shell = True)
print ('Command: %s returned %d'%(cmnd,return_code))
last_mod = proc_tree(top_h_dir, -1.0, output_project_file, DEBUG);
print ('last_mod=',last_mod)
print("waiting 5 seconds")
time.sleep(5)
print("waiting over")
cmnd = bitbake+ ' '+bitbake_target+' -c compile -f'
return_code = subprocess.call(cmnd, shell = True)
print ('Command: %s returned %d'%(cmnd,return_code))
cmnd = bitbake+ ' '+bitbake_target+' -c install -f'
return_code = subprocess.call(cmnd, shell = True)
print ('Command: %s returned %d'%(cmnd,return_code))
latest_at = proc_tree(top_h_dir, last_mod+3, output_project_file, DEBUG);
print ('latest_at=',latest_at)
return 0
if __name__ == "__main__":
sys.exit(main()) elphel393-rocko-e964f75303ae63bd39871eba9f1bb8da53aa47e6/setup.py 0000775 0000000 0000000 00000025713 13652421575 0023247 0 ustar 00root root 0000000 0000000 #!/usr/bin/env python
# Clones and sets up and updates everything, also creates local.conf
__author__ = "Elphel"
__copyright__ = "Copyright 2016, Elphel, Inc."
__license__ = "GPL"
__version__ = "3.0+"
__maintainer__ = "Oleg K Dzhimiev"
__email__ = "oleg@elphel.com"
__status__ = "Development"
import subprocess
import os
import sys
import shutil
import re
import json
from collections import OrderedDict
projects_file = "projects.json"
projects_default_file = "projects-default.json"
if not os.path.isfile(projects_file):
if os.path.isfile(projects_default_file):
shutil.copy(projects_default_file,projects_file)
with open('projects.json') as data_file:
Projects = json.load(data_file, object_pairs_hook=OrderedDict)
#http://stackoverflow.com/questions/287871/print-in-terminal-with-colors-using-python
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[38;5;214m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
BOLDWHITE = '\033[1;37m'
UNDERLINE = '\033[4m'
def shout(cmd):
subprocess.call(cmd,shell=True)
def cloneandcheckout(name,item):
print("Clone and checkout: "+name)
if not os.path.isdir(name):
print(bcolors.WARNING+" Cloning into "+name+", branch="+item[1]+", hash="+item[2]+bcolors.ENDC)
shout("git clone -b "+item[1]+" "+item[0]+" "+name)
cwd = os.getcwd()
os.chdir(cwd+"/"+name)
shout("git checkout "+item[2])
os.chdir(cwd)
else:
#check for https or git
cwd = os.getcwd()
os.chdir(cwd+"/"+name)
read_remote = subprocess.check_output("git remote -v",shell=True)
if read_remote.find(item[0])==-1:
print(bcolors.WARNING+"Changing git remote to "+item[0]+bcolors.ENDC)
shout("git remote set-url origin "+item[0])
os.chdir(cwd)
if item[2]!="":
print(" Already cloned - checked out at "+item[1]+" "+item[2])
else:
print(" Already cloned - check out branch then git pull")
cwd = os.getcwd()
os.chdir(cwd+"/"+name)
cmd = "git checkout "+item[1]+" | grep --color -E '^|^M\s(.*)$'"
shout(cmd)
shout("git pull")
os.chdir(cwd)
def copy_eclipse_settings(name,return_path):
EPS = "eclipse_project_setup"
if (not os.path.isfile(name+"/.project")) and (os.path.isdir(name+"/"+EPS)):
print(" Copying up files for Eclipse project")
print(bcolors.WARNING+" Copying "+name+"/"+EPS+" to "+name+"/"+bcolors.ENDC)
shout("rsync -av "+name+"/"+EPS+"/ "+name+"/")
# it does not have to be an Eclipse project
if (not os.path.islink(name+"/scripts")):
# sub all character line into '..', keep '/'
#regex = re.compile(r"[^/]+")
#return_path = regex.sub("..",name)
shout("ln -sf "+return_path+"/scripts "+name+"/scripts")
print("Linked scripts/ to project")
if not os.path.isdir(name+"/"+EPS):
print("Not copying up files for Eclipse project: not an Eclipse project")
elif os.path.isfile(name+"/.project"):
print("Not copying up files for Eclipse project: .project is already there")
def read_local_conf(conf_file,pattern):
ret = []
if os.path.isfile(conf_file):
with open(conf_file,"r") as f:
lines = f.readlines()
for line in lines:
line = line.strip()
if len(line)!=0:
if line.strip()[0]!="#":
test = line.find(pattern)
if test!=-1:
pars = line.split("=")[1].strip().strip("\"").split(":")
ret.append(pars)
return ret
def read_local_conf_dev(conf_file,pattern):
ret = "0"
if os.path.isfile(conf_file):
with open(conf_file,"r") as f:
lines = f.readlines()
for line in lines:
line = line.strip()
if len(line)!=0:
if line[0]!="#":
test = line.find(pattern)
if test!=-1:
ret = line.split("=")[1].strip().strip("\"")
return ret
# reads protocol from the current repository and converts all other projects to this protocol
# https - user/password access
# git - key-based access
def read_git_proto(conf_file,pattern):
ret = "0"
if os.path.isfile(conf_file):
with open(conf_file,"r") as f:
lines = f.readlines()
for line in lines:
if len(line)!=0:
if line.strip()[0]!="#":
pars = line.strip().split("=")
if (len(pars)>1):
# simple test
if pars[0].strip()=='url':
test = pars[1].find(pattern)
if test!=-1:
ret = "1"
return ret
def update_branch(names_from_conf,name_from_list,pars,git_proto):
# GIT host is defined in projects.json,
# https or git is defined in local.conf
# get host
s0 = re.search("^(https:\/\/|git@)(.+)(\/|:)Elphel.*",pars[0])
if s0:
host = s0.group(2)
print("git host: "+host)
if (git_proto=="1"):
tmp = "https://"+host+"/Elphel"
if pars[0].find(tmp)!=-1:
pars[0] = "git@"+host+":Elphel"+pars[0][len(tmp):]
else:
tmp = "git@"+host+":Elphel"
if pars[0].find(tmp)!=-1:
pars[0] = "https://"+host+"/Elphel"+pars[0][len(tmp):]
for p in names_from_conf:
if name_from_list in p:
pars[1] = p[1]
return pars
#main
#self pull?
print(bcolors.BOLDWHITE+"Step 0: Running self git pull"+bcolors.ENDC)
selfpullresult = subprocess.check_output("git pull",shell=True)
if selfpullresult.strip()!="Already up-to-date." and \
selfpullresult.strip()!="Already up to date.":
print(bcolors.WARNING+"Wasn't up-to-date. Please, rerun ./setup.py"+bcolors.ENDC)
sys.exit()
else:
print("ok")
project_branches = read_local_conf("poky/build/conf/local.conf","ELPHEL393_branches")
#git_proto = read_local_conf_dev("poky/build/conf/local.conf","ELPHEL393_DEV")
git_proto = read_git_proto(".git/config","git@")
i=0
for p,v in Projects.items():
i = i + 1
print bcolors.BOLDWHITE+"Step "+str(i)+": "+p+bcolors.ENDC
if isinstance(v,dict):
#create dir
if not os.path.isdir(p):
print(" Creating "+p)
os.mkdir(p)
else:
print(" "+p+" exists")
cwd = os.getcwd()
os.chdir(cwd+"/"+p)
for k,l in v.items():
print("\n"+bcolors.BOLDWHITE+"*"+bcolors.ENDC+" "+k)
cloneandcheckout(k,update_branch(project_branches,k,l,git_proto))
copy_eclipse_settings(k,"../..")
#special case for x393 fpga project
if k=="x393":
if os.path.isfile(k+"/py393/generate_c.sh"):
subcwd = os.getcwd()
os.chdir(subcwd+"/"+k+"/py393")
shout("./generate_c.sh")
os.chdir(subcwd)
if os.path.isdir(k+"/py393/generated"):
if os.path.isdir(cwd+"/linux-elphel/src/drivers/elphel"):
shout("rsync -a "+k+"/py393/generated/ "+cwd+"/linux-elphel/src/drivers/elphel")
os.chdir(cwd)
elif isinstance(v,list):
cloneandcheckout(p,update_branch(project_branches,p,v,git_proto))
copy_eclipse_settings(p,"..")
else:
print("Error?")
# force create link to images
shout("ln -sf poky/build/tmp/deploy/images/elphel393/ bootable-images")
# do the local.conf
path = os.getcwd()
os.chdir(path+"/poky")
conf_notes = "meta-poky/conf/conf-notes.txt"
if os.path.isfile(conf_notes):
os.remove(conf_notes)
with open(conf_notes,'w') as f:
f.write("""\
Common targets for \"elphel393\" camera series are:
u-boot
device-tree
linux-xlnx
core-image-elphel393
""")
bblayers_conf = "build/conf/bblayers.conf"
local_conf = "build/conf/local.conf"
missing_local_conf = 0
missing_bblayers_conf = 0
if not os.path.isfile(local_conf):
missing_local_conf = 1
else:
print("\n"+local_conf+" exists, updating the default version: "+local_conf+"_default")
shout("cp "+local_conf+" "+local_conf+"_bkp")
os.remove(local_conf)
if not os.path.isfile(bblayers_conf):
missing_bblayers_conf = 1
else:
print(bblayers_conf+" exists, updating the default version: "+bblayers_conf+"_default")
shout("cp "+bblayers_conf+" "+bblayers_conf+"_bkp")
os.remove(bblayers_conf)
print("Running: . ./oe-init-build-env build. If config files existed they will be backed up and restored")
shout(". ./oe-init-build-env build")
with open(bblayers_conf,"a") as f:
f.write("""\
BBLAYERS = " \\
{0}/poky/meta \\
{0}/poky/meta-poky \\
{0}/poky/meta-yocto-bsp \\
{0}/meta/meta-ezynq \\
{0}/meta/meta-elphel393 \\
{0}/meta/meta-ros \\
{0}/meta/meta-xilinx/meta-xilinx-bsp \\
{0}/meta/meta-openembedded/meta-oe \\
{0}/meta/meta-openembedded/meta-python \\
{0}/meta/meta-openembedded/meta-networking \\
{0}/meta/meta-openembedded/meta-webserver \\
"
""".format(path))
with open(local_conf,"a") as f:
f.write("""\
MACHINE ?= "elphel393"
MIRRORS =+ "http://.*/.* http://mirror.elphel.com/elphel393_mirror/ \\n "
# Elphel's default git server.
# Affected recipes:
# * u-boot-ezynq.inc,
# * elphel-python-extensions_*.bb
# * linux-xlnx_4.0.bbappend
ELPHELGITHOST = "git.elphel.com"
# To change a project's branch from the setup.py list to something other than 'master'
# add the following line (a separate line for each project):
# ELPHEL393_branches += "projectname:branchname"
# Example:
# ELPHEL393_branches += "elphel-apps-camogm:framepars"
# ELPHEL393_branches += "linux-elphel:framepars"
# To change git host edit: projects.json (a copy of projects-default.json)
# New git host must match "^(https:\/\/|git@)(.+)(\/|:)Elphel.*", e.g.:
# "https://something.com/Elphel/someproject" or
# "git@something.com:Elphel/someproject"
REMOTE_USER ?= "root"
IDENTITY_FILE ?= "~/.ssh/id_rsa"
COPY_TO_NAND = "0"
REMOTE_IP ?= "192.168.0.9"
REMOTE_NETMASK ?= "255.255.255.0"
REMOTE_GATEWAY ?= "192.168.0.15"
INITSTRING ?= "init_elphel393.py \\"{\\
\\\\"usb_hub\\\\" :1,\\
\\\\"ip\\\\" :0,\\
\\\\"imgsrv\\\\" :1,\\
\\\\"autoexp_daemon\\\\" :1,\\
\\\\"autocampars\\\\" :1,\\
\\\\"sata\\\\" :1,\\
\\\\"gps\\\\" :1,\\
\\\\"eyesis\\\\" :0 \\
}\\""
MACHINE_DEVICETREE = "elphel393_4_mt9p006.dts"
""")
if missing_bblayers_conf==0:
print("restoring "+bblayers_conf)
shout("cp "+bblayers_conf+" "+bblayers_conf+"_default")
shout("cp "+bblayers_conf+"_bkp "+bblayers_conf)
print("NOTE: If anything breaks after running setup.py, compare your bblayers.conf and bblayers.conf_default")
if missing_local_conf==0:
print("restoring "+local_conf)
shout("cp "+local_conf+" "+local_conf+"_default")
shout("cp "+local_conf+"_bkp "+local_conf)
print("NOTE: If anything breaks after running setup.py, compare your local.conf and local.conf_default")
elphel393-rocko-e964f75303ae63bd39871eba9f1bb8da53aa47e6/setup_eclipse.py 0000775 0000000 0000000 00000020210 13652421575 0024736 0 ustar 00root root 0000000 0000000 #!/usr/bin/env python
# encoding: utf-8
from __future__ import print_function
from __future__ import division
'''
# Copyright (C) 2017, Elphel.inc.
# Setup eclipse workspace for multiple projects of elphel393
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
@author: Andrey Filippov
@copyright: 2015 Elphel, Inc.
@license: GPLv3.0+
@contact: andrey@elphel.coml
@deffield updated: Updated
'''
__author__ = "Andrey Filippov"
__copyright__ = "Copyright 2015, Elphel, Inc."
__license__ = "GPL"
__version__ = "3.0+"
__maintainer__ = "Andrey Filippov"
__email__ = "andrey@elphel.com"
__status__ = "Development"
import os
import sys
import subprocess
import datetime
import xml.etree.ElementTree
#import shutil
from distutils.dir_util import copy_tree
#import distutils
def main():
workspace = '../workspace-elphel393'
workspace_fpga = '../workspace-elphel393_fpga'
project_paths = "./setup_eclipse_paths.xml"
project_paths_fpga = "./setup_eclipse_fpga_paths.xml"
fpga_to_workspace = "fpga-elphel/eclipse_workspace_setup"
continue_setup = False # True # disable later
argv = sys.argv
print (argv)
if (len(argv) < 2):
print ("""
This program creates new Eclipse workspace for all elphel393 subprojects. Eclipse installation
should have CDT and EGit plugins installed.
USAGE:
%s eclipse-home [[path-to-workspace] project-paths]
First (mandatory) argument of this program (eclipse-home) is the full path to Eclipse installation
(directory that has eclipse executable and eclipse.ini files).
Second (optional) argument (path-to-workspace) is the path to workspace. If not specified,
then ../workspace_elphel393 will be used.
Third (optional) argument (project-paths) is the path to list of project paths. If not specified,
then "./setup_eclipse_paths.
The program will not overwrite or modify any existing workspace.
"""%(argv[0],))
return 0
eclipse_home = argv[1]
if (len(argv) > 3):
project_paths = argv[3]
project_paths = os.path.abspath(project_paths)
proj_paths_root = xml.etree.ElementTree.parse(project_paths).getroot()#.find('name').text
subprojects = []
for child in proj_paths_root:
subprojects.append(child.text)
print('subprojects=',subprojects)
if (len(argv) > 2):
workspace = argv[2]
fpga= "fpga" in workspace
if fpga:
print ("Processing FPGA projects")
project_paths = project_paths_fpga
workspace = os.path.abspath(workspace)
need_import = True
if os.path.exists(workspace):
if continue_setup:
print ("Workspace %s already exists, will continue to set up git"%(workspace,))
need_import = False
else:
print ("Workspace %s already exists, this program can not modify/overwrite existing workspaces"%(workspace,))
return 1
apath=os.path.dirname(os.path.abspath(argv[0]))
print ("scriptdir=",apath," cwd=",os.getcwd())
#create eclipse import command
eclipse_import = os.path.join(eclipse_home,"eclipse" +
" -nosplash" +
" -data "+ workspace +
" -application org.eclipse.cdt.managedbuilder.core.headlessbuild")
# print ("subprojects=",subprojects)
for project in subprojects:
eclipse_import += " -import " + os.path.join(apath,project)
eclipse_import += " -no-indexer" # disableto create indexes (slow)
print ("eclipse_import = ",eclipse_import)
return_code = -1
if need_import:
return_code = subprocess.call(eclipse_import, shell = True)
print ("Eclipse import returned ",return_code)
if return_code > 0:
print ("Can not continuie on error")
return 1
if fpga:
# project_paths = project_paths_fpga
print ("Copying VDT settings (",fpga_to_workspace,") to workspace (",workspace,")")
# shutil.copytree(fpga_to_workspace+"/.metadata", workspace+"/.metadata")
# distutils.dir_util.copy_tree(fpga_to_workspace,workspace)
copy_tree(fpga_to_workspace,workspace)
'''
cp -r elphel393/fpga-elphel/eclipse_workspace_setup/.metadata ./workspace-elphel393-fpga-03
'''
#creating workspace/.metadata/.plugins/org.eclipse.core_runtime/.settings/org.eclipse.egit.core.prefs
egit_prefs_path = os.path.join(workspace,".metadata",".plugins","org.eclipse.core.runtime",".settings","org.eclipse.egit.core.prefs")
egit_prefs="GitRepositoriesView.GitDirectories="
for project in subprojects:
egit_prefs += os.path.join(apath,project,".git") + "\\:"
egit_prefs += "\n"
egit_prefs += "GitRepositoriesView.GitDirectories.relative="
for project in subprojects:
egit_prefs += os.path.join(apath,project,".git") + "\\:"
egit_prefs += "\n"
egit_prefs += "RepositorySearchDialogSearchPath=" + apath + "\n"
egit_prefs += "eclipse.preferences.version=1\n"
print ("Creating file ",egit_prefs_path)
print (egit_prefs)
with open(egit_prefs_path, 'w') as f:
print (egit_prefs,file = f)
#Create per-project files (and last directory):
GitProjectData= "#GitProjectData\n#"+datetime.datetime.now().strftime("%a %b %d %H:%M:%S %Z %Y")+"\n.gitdir=.git\n"
print ("GitProjectData=",GitProjectData)
#strings to be encoded in properties.index files (now, with fresh workspace never opened - all the same)
bin_strings = ['org.eclipse.team.core',
'repository',
'org.eclipse.egit.core.GitProvider']
for project in subprojects:
#read project names
dot_proj_path=os.path.join(apath,project,".project")
proj_name = xml.etree.ElementTree.parse(dot_proj_path).getroot().find('name').text
print(proj_name, dot_proj_path)
workspace_proj_path = os.path.join(workspace,
'.metadata',
'.plugins',
'org.eclipse.core.resources',
'.projects',
proj_name)# , org.eclipse.egit.core/
egit_core_dir= os.path.join(workspace_proj_path, 'org.eclipse.egit.core')
if not os.path.exists(egit_core_dir):
os.makedirs(egit_core_dir)
print ('created new directory ',egit_core_dir)
else:
print ('directory ',egit_core_dir,' already existed')
GitProjectDataPath=os.path.join(egit_core_dir, 'GitProjectData.properties')
# Write GitProjectData.properties contents
with open(GitProjectDataPath, 'w') as f:
print (GitProjectData,file = f)
# Create .indexes subdirectory in project subdirectory
indexes_dir= os.path.join(workspace_proj_path, '.indexes')
if not os.path.exists(indexes_dir):
os.makedirs(indexes_dir)
print ('created new directory ',indexes_dir)
else:
print ('directory ',indexes_dir,' already existed')
properties_index= os.path.join(indexes_dir, 'properties.index')
data = [1,0,0,0,
1,0,0,0,
1, # single pair entry
2, # 3 strings to follow
]
#now create binary file
for bin_str in bin_strings:
# print (len(bin_str), bin_str)
data.append(0) #these strings are never longer than 255
data.append(len(bin_str))
for l in bin_str:
data.append(ord(l))
ba=bytearray(data)
with open(properties_index, 'w') as f:
f.write(ba)
if __name__ == "__main__":
sys.exit(main())
"""
eyesis@eyesis-SH87R:~/nc393/elphel393$ ./setup_eclipse.py /home/eyesis/eclipse/jee-oxygen/eclipse/ ../workspace-elphel393-fpga setup_eclipse_fpga_paths.xml
""" elphel393-rocko-e964f75303ae63bd39871eba9f1bb8da53aa47e6/setup_eclipse_fpga_paths.xml 0000664 0000000 0000000 00000000263 13652421575 0027305 0 ustar 00root root 0000000 0000000
fpga-elphel/x393
fpga-elphel/x393_sata
fpga-elphel/x359
elphel393-rocko-e964f75303ae63bd39871eba9f1bb8da53aa47e6/setup_eclipse_paths.xml 0000664 0000000 0000000 00000001535 13652421575 0026313 0 ustar 00root root 0000000 0000000
linux-elphel
rootfs-elphel/elphel-apps-astreamer
rootfs-elphel/elphel-apps-autocampars
rootfs-elphel/elphel-apps-autoexposure
rootfs-elphel/elphel-apps-camogm
rootfs-elphel/elphel-apps-editconf
rootfs-elphel/elphel-apps-gps
rootfs-elphel/elphel-apps-histograms
rootfs-elphel/elphel-apps-imgsrv
rootfs-elphel/elphel-apps-php-extension
rootfs-elphel/elphel-apps-tempmon
rootfs-elphel/elphel-init
rootfs-elphel/elphel-udev-rules
rootfs-elphel/elphel-web-393
rootfs-elphel/elphel-web-camvc
rootfs-elphel/elphel-web-hwmon