...
 
Commits (34)
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
Scripts for setting up development environment to build firmware for Elphel393 camera systems.
The same script (*setup.py*) pulls updates from these repositories
Prebuilt firmware: [community.elphel.com/files/393/](http://community.elphel.com/files/393/).
### Get environment
#### Dependencies
## Requirements
### for Kubuntu 20.04
* 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
* extra packages:
```sh
# in Kubuntu 20.04 this will install python2 which is used by poky[warrior]
$ sudo apt install python python-numpy python3-numpy
# below fixes missing error when compiling the kernel: missing "openssl/bio.h":
$ sudo apt install libssl-dev
```
### for Kubuntu 16.04/18.04
* same as for Kubuntu 20.04
* run setup.py then roll back [meta-elphel393](https://git.elphel.com/Elphel/meta-elphel393) to [6e0687d745e8962ec979e59ed600203c97d92cff](https://git.elphel.com/Elphel/meta-elphel393/commit/6e0687d745e8962ec979e59ed600203c97d92cff)
## Clone this repo ('warrior' branch recommended)
```sh
$ sudo apt install python-numpy
$ git clone -b warrior https://git.elphel.com/Elphel/elphel393.git
```
#### Get sources
## Setup
```sh
$ ./setup.py
```
### Build targets
## Build
```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/*
* the results are in *bootable-images/*
* 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
## Update and refresh environment
```sh
$ ./setup.py
```
### Rebuild targets
## Rebuild targets
```sh
$ cd poky
$ . ./oe-init-build-env
......@@ -53,23 +56,10 @@ $ (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
## More info
[**Development for 10393**](https://wiki.elphel.com/wiki/Development_for_10393)
### Support
## 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
```
\ No newline at end of file
#!/usr/bin/env python
#!/usr/bin/env python3
# Check software versions on the target
'''
Copyright 2020, Elphel Inc.
SPDX-License-Identifier: GPL-3.0-or-later
__author__ = "Elphel"
__copyright__ = "Copyright 2016, Elphel, Inc."
__license__ = "GPL"
__version__ = "3.0+"
__maintainer__ = "Oleg K Dzhimiev"
__email__ = "oleg@elphel.com"
__status__ = "Development"
Author: Oleg Dzhimiev <oleg@elphel.com>
Description: Compares software versions between local GIT and hardware target
'''
import json
import os
......@@ -71,8 +69,8 @@ def get_versions_from_target_quick(addr,tdir):
shout("scp -r "+addr+":"+tdir+" .")
remote_list = []
for f in os.listdir(ldir):
for f in sorted(os.listdir(ldir)):
with open(ldir+"/"+f, 'r') as content_file:
content = content_file.read()
remote_list.append([f,content.strip()])
......@@ -101,8 +99,7 @@ def get_version_from_git(path,vfile):
#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()
p1 = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True).strip().decode('utf-8')
else:
print(vfile+" file is missing in the project")
......@@ -117,6 +114,9 @@ def deep_analysis(local,remote):
update_list = ""
for pl,vl in local:
# pl is <class 'bytes'>
# vl is <class 'str'>
pl = pl.decode('utf-8')
recstr = "{:<24}".format(pl)+"{:<16}".format(vl)
prfound = False
for pr,vr in remote:
......@@ -224,6 +224,9 @@ for p,v in Projects.items():
else:
raise Exception("Unknown error")
# sort [[a,va],[b,vb]] by key 0
local_list = sorted(local_list, key=lambda x: x[0])
#print(local_list)
deep_analysis(local_list,target_list)
......
......@@ -2,40 +2,44 @@
"meta" : {
"meta-openembedded":[
"git://git.openembedded.org/meta-openembedded",
"master","73854a05565b30a5ca146ac53959c679b27815aa"
"warrior","0afee3eacfd18a9962013830028f9e54b4973657"
],
"meta-xilinx":[
"https://github.com/Xilinx/meta-xilinx.git",
"master","cc146d6c170f100eb2f445047969893faa7a6a55"
"master","391c7054e88ae77abf18fe8a705ac7ff34c7dc79"
],
"meta-swupdate":[
"https://github.com/sbabic/meta-swupdate.git",
"master","f6ab29cfac2b9c6da8881c754e2a316ea43b884d"
"master","0fb115e97187c069f0da90163f1f374a6b7a4af7"
],
"meta-ezynq":[
"https://git.elphel.com/Elphel/meta-ezynq.git",
"master","",
"warrior","",
"#master","00496002f513fc253f5356ee675fdcbb8b4a9962"
],
"meta-elphel393":[
"https://git.elphel.com/Elphel/meta-elphel393.git",
"master","",
"warrior","",
"#master","a93edc1f91e82e5e613fa38bd800e307c348b9ee"
],
"meta-ros":[
"https://github.com/bmwcarit/meta-ros.git",
"master","72068b17e4192b51e09c8dc633805a35edac8701"
]
},
"poky":[
"git://git.yoctoproject.org/poky.git",
"master","3d2c0f5902cacf9d8544bf263b51ef0dd1a7218c"
"warrior","e4ceb7fcdca3ec90d85796a7234e5554a518ca33"
],
"linux-elphel" :[
"https://git.elphel.com/Elphel/linux-elphel.git",
"master","",
"warrior","",
"#master","cc50d7fa07140e680b09a8add617e62b4ba35aa0"
],
"fpga-elphel" : {
"x393" :[
"https://git.elphel.com/Elphel/x393.git",
"master","",
"lwir","",
"#master","edcdce9550c20726618210149bc1cb4549fd00be"
],
"x393_sata":[
......@@ -50,64 +54,72 @@
"rootfs-elphel": {
"elphel-apps-imgsrv":[
"https://git.elphel.com/Elphel/elphel-apps-imgsrv.git",
"master",""
"rocko",""
],
"elphel-apps-php-extension":[
"https://git.elphel.com/Elphel/elphel-apps-php-extension.git",
"master",""
"warrior",""
],
"elphel-apps-camogm":[
"https://git.elphel.com/Elphel/elphel-apps-camogm.git",
"master",""
"tiff",""
],
"elphel-udev-rules":[
"https://git.elphel.com/Elphel/elphel-udev-rules.git",
"master",""
"rocko",""
],
"elphel-web-393":[
"https://git.elphel.com/Elphel/elphel-web-393.git",
"master",""
"warrior",""
],
"elphel-apps-autocampars":[
"https://git.elphel.com/Elphel/elphel-apps-autocampars.git",
"master",""
"rocko",""
],
"elphel-apps-autoexposure":[
"https://git.elphel.com/Elphel/elphel-apps-autoexposure.git",
"master",""
"rocko",""
],
"elphel-apps-histograms":[
"https://git.elphel.com/Elphel/elphel-apps-histograms.git",
"master",""
"rocko",""
],
"elphel-web-camvc":[
"https://git.elphel.com/Elphel/elphel-web-camvc.git",
"master",""
"warrior",""
],
"elphel-apps-editconf":[
"https://git.elphel.com/Elphel/elphel-apps-editconf.git",
"master",""
"rocko",""
],
"elphel-init":[
"https://git.elphel.com/Elphel/elphel-init.git",
"master",""
"rocko",""
],
"elphel-web-hwmon":[
"https://git.elphel.com/Elphel/elphel-web-hwmon.git",
"master",""
"rocko",""
],
"elphel-apps-tempmon":[
"https://git.elphel.com/Elphel/elphel-apps-tempmon.git",
"master",""
"rocko",""
],
"elphel-apps-gps":[
"https://git.elphel.com/Elphel/elphel-apps-gps.git",
"master",""
"rocko",""
],
"elphel-apps-astreamer":[
"https://git.elphel.com/Elphel/elphel-apps-astreamer.git",
"master",""
]
"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":[
......@@ -115,4 +127,4 @@
"master",""
]
}
}
\ No newline at end of file
}
#!/usr/bin/env python
#!/usr/bin/env python3
# Clones and sets up and updates everything, also creates local.conf
'''
Copyright 2020, Elphel Inc.
SPDX-License-Identifier: GPL-3.0-or-later
__author__ = "Elphel"
__copyright__ = "Copyright 2016, Elphel, Inc."
__license__ = "GPL"
__version__ = "3.0+"
__maintainer__ = "Oleg K Dzhimiev"
__email__ = "oleg@elphel.com"
__status__ = "Development"
Author: Oleg Dzhimiev <oleg@elphel.com>
Description: Clones and sets up and updates everything, also creates local.conf
'''
import subprocess
import os
......@@ -58,7 +56,7 @@ def cloneandcheckout(name,item):
cwd = os.getcwd()
os.chdir(cwd+"/"+name)
read_remote = subprocess.check_output("git remote -v",shell=True)
read_remote = subprocess.check_output("git remote -v",shell=True).decode('utf-8')
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])
......@@ -176,13 +174,14 @@ def update_branch(names_from_conf,name_from_list,pars,git_proto):
#self pull?
print(bcolors.BOLDWHITE+"Step 0: Running self git pull"+bcolors.ENDC)
selfpullresult = subprocess.check_output("git pull",shell=True)
selfpullresult = subprocess.check_output("git pull",shell=True).strip().decode('utf-8')
if selfpullresult.strip()!="Already up-to-date.":
print(bcolors.WARNING+"Wasn't up-to-date. Please, rerun ./setup.py"+bcolors.ENDC)
sys.exit()
if selfpullresult != "Already up-to-date." and \
selfpullresult != "Already up to date.":
print(bcolors.WARNING+"Wasn't up-to-date. Please, rerun ./setup.py"+bcolors.ENDC)
sys.exit()
else:
print("ok")
print("ok")
project_branches = read_local_conf("poky/build/conf/local.conf","ELPHEL393_branches")
......@@ -192,7 +191,7 @@ 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
print(bcolors.BOLDWHITE+"Step "+str(i)+": "+p+bcolors.ENDC)
if isinstance(v,dict):
#create dir
......@@ -237,7 +236,7 @@ shout("ln -sf poky/build/tmp/deploy/images/elphel393/ bootable-images")
path = os.getcwd()
os.chdir(path+"/poky")
conf_notes = "meta-yocto/conf/conf-notes.txt"
conf_notes = "meta-poky/conf/conf-notes.txt"
if os.path.isfile(conf_notes):
os.remove(conf_notes)
......@@ -278,11 +277,11 @@ with open(bblayers_conf,"a") as f:
f.write("""\
BBLAYERS = " \\
{0}/poky/meta \\
{0}/poky/meta-yocto \\
{0}/poky/meta-poky \\
{0}/poky/meta-yocto-bsp \\
{0}/meta/meta-ezynq \\
{0}/meta/meta-elphel393 \\
{0}/meta/meta-xilinx \\
{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 \\
......@@ -319,11 +318,13 @@ REMOTE_USER ?= "root"
IDENTITY_FILE ?= "~/.ssh/id_rsa"
COPY_TO_NAND = "0"
REMOTE_IP ?= "192.168.0.9"
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\\\\" :1,\\
\\\\"ip\\\\" :0,\\
\\\\"imgsrv\\\\" :1,\\
\\\\"autoexp_daemon\\\\" :1,\\
\\\\"autocampars\\\\" :1,\\
......
#!/usr/bin/env python
#!/usr/bin/env python3
# encoding: utf-8
from __future__ import print_function
from __future__ import division
# from __future__ import print_function
# from __future__ import division
'''
# Copyright (C) 2017, Elphel.inc.
......@@ -189,11 +189,11 @@ The program will not overwrite or modify any existing workspace.
for l in bin_str:
data.append(ord(l))
ba=bytearray(data)
with open(properties_index, 'w') as f:
with open(properties_index, 'wb') 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
"""
\ No newline at end of file
"""
<?xml version="1.0" encoding="UTF-8"?>
<project_paths>
<path>linux-elphel</path>
<path>rootfs-elphel/elphel-apps-astreamer</path>
<path>rootfs-elphel/elphel-apps-autocampars</path>
<path>rootfs-elphel/elphel-apps-autoexposure</path>
<path>rootfs-elphel/elphel-apps-camogm</path>
......