added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

Submodule meta-st/meta-st-openstlinux deleted from 6526808593

View File

@@ -0,0 +1,73 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team via this [link](https://www.st.com/content/st_com/en/contact-us.html).
All complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 1.4,
available [here](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html).
For answers to common questions about this code of conduct, refer to the FAQ section [here](https://www.contributor-covenant.org/faq).

View File

@@ -0,0 +1,30 @@
# Contributing guide
This document serves as a checklist before contributing to this repository. It includes links to read up on if topics are unclear to you.
This guide mainly focuses on the proper use of Git.
## 1. Issues
STM32MPU projects do not activate "Github issues" feature for the time being. If you need to report an issue or question about this project deliverables, you can report them using [ ST Support Center ](https://my.st.com/ols#/ols/newrequest) or [ ST Community MPU Forum ](https://community.st.com/s/topic/0TO0X0000003u2AWAQ/stm32-mpus).
## 2. Pull Requests
STMicrolectronics is happy to receive contributions from the community, based on an initial Contributor License Agreement (CLA) procedure.
* If you are an individual writing original source code and you are sure **you own the intellectual property**, then you need to sign an Individual CLA (https://cla.st.com).
* If you work for a company that wants also to allow you to contribute with your work, your company needs to provide a Corporate CLA (https://cla.st.com) mentioning your GitHub account name.
* If you are not sure that a CLA (Individual or Corporate) has been signed for your GitHub account you can check here (https://cla.st.com).
Please note that:
* The Corporate CLA will always take precedence over the Individual CLA.
* One CLA submission is sufficient, for any project proposed by STMicroelectronics.
__How to proceed__
* We recommend to fork the project in your GitHub account to further develop your contribution. Please use the latest commit version.
* Please, submit one Pull Request for one new feature or proposal. This will ease the analysis and final merge if accepted.
__Note__
Merge will not be done directly in GitHub but it will need first to follow internal integration process before public deliver in a standard release. The Pull request will stay open until it is merged and delivered.

View File

@@ -0,0 +1,17 @@
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -0,0 +1 @@
http://wiki.st.com/stm32mpu/index.php/OpenSTLinux_licenses

View File

@@ -0,0 +1 @@
README.md

View File

@@ -0,0 +1,30 @@
# Meta-st-openstlinux
## Introduction
meta-st-openstlinux is a layer containing the framework metadata for current versions of OpenSTLinux.
OpenSTLinux is a Linux® distribution based on the OpenEmbedded build framework.
## DISTRO
OpenSTLinux layer provides severals distro:
* **openstlinux-weston**:
Distribution with Wayland/Weston graphic backend usage.
* **openstlinux-eglfs**:
Distribution dedicated to Qt usage. With this distribution, Qt uses the eglfs graphic backend.
* **openstlinux-x11**:
Distribution dedicated to X11 framework usage.
## Images
OpenSTLinux provides two reference image to be used mainly with **openstlinux-weston** distro:
* **st-image-core**:
Basic core image with: ssh server, several tools for kernel, audio, network.
* **st-image-weston**:
Image with Wayland/weston UI (if **openstlinux-weston** distro are used). This image contains weston UI, GTK+3 demo and all tools present on st-image-core.
OpenSTLinux provides also some image **as example** to show how to enable some specific framework:
* **st-example-image-qt** (with **openstlinux-eglfs** distro):
Image which demonstrates an example of Qt usage
* **st-example-image-x11** (with **openstlinux-x11** distro):
Image which demonstrates an example of Basic X11 usage.
* **st-example-image-xfce.bb** (with **openstlinux-x11** distro):
Image which demonstrates an example of X11 usage with XFCE as UI.

View File

@@ -0,0 +1,8 @@
# Report potential product security vulnerabilities
ST places a high priority on security, and our Product Security Incident Response Team (PSIRT) is committed to rapidly addressing potential security vulnerabilities affecting our products. PSIRT's long history and vast experience in security allows ST to perform clear analyses and provide appropriate guidance on mitigations and solutions when applicable.
If you wish to report potential security vulnerabilities regarding our products, **please do not report them through public GitHub issues.** Instead, we encourage you to report them to our ST PSIRT following the process described at: **https://www.st.com/content/st_com/en/security/report-vulnerabilities.html**
### IMPORTANT - READ CAREFULLY:
STMicroelectronics International N.V., on behalf of itself, its affiliates and subsidiaries, (collectively “ST”) takes all potential security vulnerability reports or other related communications (“Report(s)”) seriously. In order to review Your Report (the terms “You” and “Yours” include your employer, and all affiliates, subsidiaries and related persons or entities) and take actions as deemed appropriate, ST requires that we have the rights and Your permission to do so.
As such, by submitting Your Report to ST, You agree that You have the right to do so, and You grant to ST the rights to use the Report for purposes related to security vulnerability analysis, testing, correction, patching, reporting and any other related purpose or function.
By submitting Your Report, You agree that STs [Privacy Policy](https://www.st.com/content/st_com/en/common/privacy-portal.html) applies to all related communications.

View File

@@ -0,0 +1,24 @@
# The goal of this class are to check if the layers are compatible with OpenSTLinux version.
# The verification are based on ST_OSTL_COMPATIBILTY_VERSION variable defined on layer.conf
def check_sanity_ostl(data):
ref_layer = "st-openstlinux"
ref_version = data.getVar("ST_OSTL_COMPATIBILITY_VERSION_%s" % ref_layer, None)
#bb.warn("OSTL: reference version: %s" % ref_version)
layerlist = set((data.getVar("BBFILE_COLLECTIONS") or "").split())
for layername in layerlist:
versions = data.getVar("ST_OSTL_COMPATIBILITY_VERSION_%s" % layername)
if versions is None:
versions = data.getVar("ST_OSTL_COMPATIBILTY_VERSION_%s" % layername)
if versions is not None:
if not ref_version in versions:
raise_sanity_error("OSTL: layer %s (ver = %s) are not compatible with OpenSTlinux (Version = %s)" % (layername, versions, ref_version), data)
os._exit(1)
addhandler check_sanity_ostl_version_eventhandler
check_sanity_ostl_version_eventhandler[eventmask] = "bb.event.SanityCheck"
python check_sanity_ostl_version_eventhandler() {
check_sanity_ostl(e.data)
}

View File

@@ -0,0 +1,630 @@
# To have tab on html file generated
CVE_IMAGE_CONTENT_WITH_TAB ?= "1"
# Configure on BSP side this var if you expect the summary to be generated
ENABLE_IMAGE_CVE_SUMMARY ??= "0"
ST_CVE_SUMMARY_DIR ?= "${WORKDIR}/cve-summary/"
ST_CVE_SUMMARY_DEPLOYDIR ?= "${DEPLOY_DIR}/images/${MACHINE}"
ST_CVE_SUMMARY_NAME ?= "${IMAGE_NAME}-cve_content.html"
ST_CVE_SUMMARY_LINK_NAME ?= "${IMAGE_LINK_NAME}-cve_content.html"
ST_MAIN_COMPONENTS ?= ""
def cve_create_summary(d):
import re
import json
tab = d.expand("${CVE_IMAGE_CONTENT_WITH_TAB}")
ref_image_name = d.expand("${IMAGE_LINK_NAME}")
deploy_image_dir = d.expand("${DEPLOY_DIR_IMAGE}")
temp_deploy_image_dir = d.expand("${IMGDEPLOYDIR}")
cve_deploy_dir = d.expand("${DEPLOY_DIR}/cve")
cve_summary_deploydir = d.getVar('ST_CVE_SUMMARY_DIR')
cve_summary_name = d.getVar('ST_CVE_SUMMARY_NAME')
cve_summary_link = d.getVar('ST_CVE_SUMMARY_LINK_NAME')
components_list = d.getVar('ST_MAIN_COMPONENTS')
datetime = d.getVar('DATETIME')
if tab.startswith("1"):
with_tab = 1
else:
with_tab = None
def private_open(filename):
result = None
if os.path.exists(filename):
try:
with open(filename, "r") as lic:
result = lic.readlines()
except IOError:
bb.warn("IMG LIC SUM: Cannot open file %s" % (filename))
result = ""
except:
bb.warn("IMG LIC SUM: Error with file %s" % (filename))
result = ""
else:
bb.warn("IMG LIC SUM: File does not exist with open file %s" % (filename))
result = ""
return result
class HTMLSummaryfile():
''' format definition '''
bold = "font-weight: bold; background-color: #cccccc;"
red = "background-color: #ff0000;"
center_format = "align: center;"
border_format = "border: 1;"
wrap_format = ""
wrap_red_format = "background-color: #ff0000;"
blue = "background-color: #0000ff;"
green = "background-color: #00ff00;"
opened_file = None
def openfile(self, file_name):
self.opened_file = open(file_name, 'w')
def closefile(self):
self.opened_file.close()
def startTable(self, style=None, classes=None):
if style:
if classes:
self.opened_file.write("<TABLE STYLE='%s' class='%s'>\n" % (style, classes))
else:
self.opened_file.write("<TABLE STYLE='%s'>\n" % style)
else:
if classes:
self.opened_file.write("<TABLE BORDER=1 class='%s'>\n" % classes)
else:
self.opened_file.write("<TABLE border=1>\n")
def stopTable(self):
self.opened_file.write("</TABLE>\n")
def startRow(self, style=None):
self.opened_file.write("<TR>\n")
def stopRow(self, style=None):
self.opened_file.write("</TR>\n")
def startColumn(self, style=None):
if style:
self.opened_file.write("<TD STYLE='%s'>\n")
else:
self.opened_file.write("<TD>\n")
def stopColumn(self, style=None):
self.opened_file.write("</TD>\n")
def addColumnHeaderContent(self, content, style=None):
if style:
self.opened_file.write("<TH STYLE='%s'>%s</TH>\n" % (style, content))
else:
self.opened_file.write("<TH><B>%s</B></TH>\n" % content)
def addColumnContent(self, content, style=None):
if style:
self.opened_file.write("<TD STYLE='%s'>%s</TD>\n" % (style, content))
else:
self.opened_file.write("<TD>%s</TD>\n" % content)
def addColumnURLOUTContent(self, content, url, style=None):
if style:
self.opened_file.write("<TD STYLE='%s'><A HREF='%s' TARGET='_blank'>%s</A></TD>\n" % (style, url, content))
else:
self.opened_file.write("<TD><A HREF='%s' TARGET='_blank'>%s</A></TD>\n" % (url, content))
def addColumnEmptyContent(self, style=None):
if style:
self.opened_file.write("<TD STYLE='%s'><BR/></TD>\n" % style)
else:
self.opened_file.write("<TD><BR/></TD>\n")
def addNewLine(self):
self.opened_file.write("<BR/>\n")
def addContent(self, content):
self.opened_file.write(content)
def addURLContent(self, content, url):
self.opened_file.write("<A HREF='%s'>%s</A>\n" %(url, content))
def startBlock(self):
self.opened_file.write("<UL>\n")
def stopBlock(self):
self.opened_file.write("</UL>\n")
def addTitle(self, title):
self.opened_file.write("<H1>{}</H1>\n".format(title))
def addAnchor(self, anchor):
self.opened_file.write("<A name='%s'/>\n" % anchor)
def startDiv(self, anchor, title, style=None):
self.opened_file.write("<div id='%s' class='tabcontent'>\n" % anchor)
self.opened_file.write("<H1>%s</H1>\n" % title)
def stopDiv(self):
self.opened_file.write("</div>\n")
def beginHtml(self):
self.opened_file.write("<HTML>\n")
self.opened_file.write('<HEAD>\n')
self.opened_file.write(" <STYLE TYPE='text/css'>\n")
self.opened_file.write("/* Style the tab buttons */\n")
self.opened_file.write(".tablink {\n")
self.opened_file.write(" background-color: #555;\n")
self.opened_file.write(" color: white;\n")
self.opened_file.write(" float: left;\n")
self.opened_file.write(" border: none;\n")
self.opened_file.write(" outline: none;\n")
self.opened_file.write(" cursor: pointer;\n")
self.opened_file.write(" padding: 14px 16px;\n")
self.opened_file.write(" font-size: 17px;\n")
self.opened_file.write(" width: 25%;\n")
self.opened_file.write("}\n")
self.opened_file.write("\n")
self.opened_file.write("/* Change background color of buttons on hover */\n")
self.opened_file.write(".tablink:hover {\n")
self.opened_file.write(" background-color: #777;\n")
self.opened_file.write("}\n")
self.opened_file.write("\n")
self.opened_file.write("/* Set default styles for tab content */\n")
self.opened_file.write(".tabcontent {\n")
self.opened_file.write(" color: black;\n")
self.opened_file.write(" display: none;\n")
self.opened_file.write(" padding: 50px;\n")
self.opened_file.write(" text-align: left;\n")
self.opened_file.write("}\n")
self.opened_file.write("\n")
self.opened_file.write("/* Style each tab content individually */\n")
self.opened_file.write("#statistic {background-color: white;}\n")
self.opened_file.write("#component {background-color: white;}\n")
self.opened_file.write("#images {background-color: white;}\n")
self.opened_file.write(" </STYLE>\n")
self.opened_file.write("</HEAD>\n")
def endHtml(self):
self.opened_file.write("</HTML>\n")
def beginBody(self, tab=None):
self.opened_file.write("<BODY>\n")
self.opened_file.write("<a name='top'/>\n")
def addApplicationTab(self):
if tab:
self.opened_file.write(' <button class="tablink" onclick="openTab(\'statistic\', this)" id="defaultOpen">Main Statistics</button>\n')
self.opened_file.write(' <button class="tablink" onclick="openTab(\'component\', this)">Main Components CVE / CVS</button>\n')
self.opened_file.write(' <button class="tablink" onclick="openTab(\'images\', this)">Image CVE / CVS</button>\n')
self.opened_file.write("\n")
def endBody(self, tab=None):
if tab:
self.opened_file.write('<SCRIPT TYPE="text/javascript">\n')
self.opened_file.write('function openTab(Name, elmnt) {\n')
self.opened_file.write(' // Hide all elements with class="tabcontent" by default */\n')
self.opened_file.write(' var i, tabcontent, tablinks;\n')
self.opened_file.write(' tabcontent = document.getElementsByClassName("tabcontent");\n')
self.opened_file.write(' for (i = 0; i < tabcontent.length; i++) {\n')
self.opened_file.write(' tabcontent[i].style.display = "none";\n')
self.opened_file.write(' }\n')
self.opened_file.write('\n')
self.opened_file.write(' // Remove the background color of all tablinks/buttons\n')
self.opened_file.write(' tablinks = document.getElementsByClassName("tablink");\n')
self.opened_file.write(' for (i = 0; i < tablinks.length; i++) {\n')
self.opened_file.write(' tablinks[i].style.backgroundColor = "";\n')
self.opened_file.write(' }\n')
self.opened_file.write('\n')
self.opened_file.write(' // Show the specific tab content\n')
self.opened_file.write(' document.getElementById(Name).style.display = "block";\n')
self.opened_file.write('\n')
self.opened_file.write(' // Add the specific color to the button used to open the tab content\n')
self.opened_file.write(' elmnt.style.backgroundColor = \'white\';\n')
self.opened_file.write(' elmnt.style.color = "black";\n')
self.opened_file.write('}\n')
self.opened_file.write('\n')
self.opened_file.write('function toggleunpatched(element) {\n')
self.opened_file.write(' patched = document.getElementsByClassName("patched");\n')
self.opened_file.write(' for (i = 0; i < patched.length; i++) {\n')
self.opened_file.write(' if (element.checked) {\n')
self.opened_file.write(' patched[i].style.display = "none";\n')
self.opened_file.write(' } else {\n')
self.opened_file.write(' patched[i].style.display = "block";\n')
self.opened_file.write(' }\n')
self.opened_file.write(' }\n')
self.opened_file.write('}\n')
self.opened_file.write('function toggleunscorev3(element) {\n')
self.opened_file.write(' score = document.getElementsByClassName("scorev3");\n')
self.opened_file.write(' for (i = 0; i < score.length; i++) {\n')
self.opened_file.write(' if (element.checked) {\n')
self.opened_file.write(' score[i].style.display = "none";\n')
self.opened_file.write(' } else {\n')
self.opened_file.write(' score[i].style.display = "block";\n')
self.opened_file.write(' }\n')
self.opened_file.write(' }\n')
self.opened_file.write(' if element.checked == false) {\n')
self.opened_file.write(' check = document.getElementsByName("check_unpatched")\n')
self.opened_file.write(' toggleunpatched(check[0])\n')
self.opened_file.write(' }\n')
self.opened_file.write('}\n')
self.opened_file.write('function toggleunscorev2(element) {\n')
self.opened_file.write(' score2 = document.getElementsByClassName("scorev2");\n')
self.opened_file.write(' for (i = 0; i < score2.length; i++) {\n')
self.opened_file.write(' if (element.checked) {\n')
self.opened_file.write(' score2[i].style.display = "none";\n')
self.opened_file.write(' } else {\n')
self.opened_file.write(' score2[i].style.display = "block";\n')
self.opened_file.write(' }\n')
self.opened_file.write(' }\n')
self.opened_file.write(' if element.checked == false) {\n')
self.opened_file.write(' check = document.getElementsByName("check_unpatched")\n')
self.opened_file.write(' toggleunpatched(check[0])\n')
self.opened_file.write(' }\n')
self.opened_file.write('}\n')
self.opened_file.write('// Get the element with id="defaultOpen" and click on it\n')
self.opened_file.write('document.getElementById("defaultOpen").click();\n')
self.opened_file.write('</SCRIPT>\n')
else:
self.opened_file.write('<SCRIPT TYPE="text/javascript">\n')
self.opened_file.write(' // display all elements with class="tabcontent" by default */\n')
self.opened_file.write(' var i, tabcontent, tablinks;\n')
self.opened_file.write(' tabcontent = document.getElementsByClassName("tabcontent");\n')
self.opened_file.write(' for (i = 0; i < tabcontent.length; i++) {\n')
self.opened_file.write(' tabcontent[i].style.display = "block";\n')
self.opened_file.write(' }\n')
self.opened_file.write('\n')
self.opened_file.write('</SCRIPT>\n')
self.opened_file.write("</BODY>\n")
def score_v2_table(score):
''' source : https://nvd.nist.gov/vuln-metrics/cvss '''
if float(score) < 4.0:
return "<SPAN STYLE='color: black; background-color: yellow;'> {} Low </SPAN>".format(score)
elif float(score) < 7.0:
return "<SPAN STYLE='color: black; background-color: #FFBF00;'> {} Medium </SPAN>".format(score)
else:
return "<SPAN STYLE='color: black; background-color: red;'> {} Hight </SPAN>".format(score)
def score_v3_table(score):
''' source : https://www.cert-ist.com/public/fr/SO_detail?code=cvss%20v3&format=html '''
if float(score) == 0.0:
return "<SPAN STYLE='color: black; background-color: darkgrey;'> {} None </SPAN>".format(score)
elif float(score) < 4.0:
return "<SPAN STYLE='color: black; background-color: yellow;'> {} Low </SPAN>".format(score)
elif float(score) < 7.0:
return "<SPAN STYLE='color: black; background-color: #FFBF00;'> {} Medium </SPAN>".format(score)
elif float(score) < 9.0:
return "<SPAN STYLE='color: black; background-color: red;'> {} High </SPAN>".format(score)
else:
return "<SPAN STYLE='color: white; background-color: black;'> {} Critical </SPAN>".format(score)
def generate_image_cve_sheet(html):
html.startDiv("images", "Image CVE / CVS")
html.addAnchor("images")
# link
html.addTitle("List of components on image:")
html.startTable(style="width: 80%; border: 1px solid black;")
html.startRow()
html.addContent("<TD width='20%'>")
count=0
col=0
with open(os.path.join(deploy_image_dir, "{}.json".format(ref_image_name))) as image_file:
json_component = json.load(image_file)
for i in json_component['package']:
issue=i['issue']
if len(issue) > 0:
html.addContent("<LI><a href='#image_{}'>{}</a></LI>\n".format(i['name'], i['name']))
count+=1
if count > 15:
count = 0
if col > 5:
col = 0
html.addContent("</td></tr><tr><td witdh='20%'>")
else:
html.addContent("</td><td witdh='10%'>")
col+=1
html.addContent("</TD>")
html.stopRow()
html.stopTable()
html.addNewLine()
html.addNewLine()
html.startTable(style="border: 1px solid black;")
with open(os.path.join(deploy_image_dir, ref_image_name + ".json")) as image_file:
json_component = json.load(image_file)
for i in json_component['package']:
issue=i['issue']
if len(issue) > 0:
html.startRow()
html.addColumnHeaderContent("Component Name <a href='#top'>[top]</a><a name='image_{}'/>".format(i['name']), style="font-weight: bold; background-color: #cccccc;")
html.addColumnHeaderContent("Version", style="font-weight: bold; background-color: #cccccc;")
html.addColumnHeaderContent("CVE Ref Name", style="font-weight: bold; background-color: #cccccc;")
html.stopRow()
html.startRow()
html.addColumnContent(i['name'])
html.addColumnContent(i['version'])
html.addColumnContent(i['products'][0]['product'])
html.stopRow()
html.startRow()
html.addColumnHeaderContent("Issues", style="font-weight: bold; background-color: #cccccc;")
html.addContent("<TD colspan='2'>")
for iss in issue:
classe = ''
if iss['status'].find("Unpatched") < 0:
classe += 'patched '
if float(iss['scorev3']) < 7.0 :
classe += 'scorev3 '
if float(iss['scorev2']) < 7.0 :
classe += 'scorev2 '
if len(classe) > 0:
html.startTable(style='border: 1px solid black; width=100%;', classes=classe)
else:
html.startTable(style='border: 1px solid black; width=100%;')
html.startRow()
html.addColumnContent(iss['id'], style="width: 10%;")
if iss['status'].find("Unpatched") > -1:
html.addColumnContent(iss['status'], style="background-color: red;")
else:
html.addColumnContent(iss['status'])
html.stopRow()
html.startRow()
html.addColumnContent("")
html.addColumnContent(iss['summary'])
html.stopRow()
html.startRow()
html.addColumnContent("")
html.addColumnContent("ScoreV2 = {} ScoreV3 = {}".format(score_v2_table(iss['scorev2']), score_v3_table(iss['scorev3'])))
html.stopRow()
html.startRow()
html.addColumnContent("")
html.addColumnContent("Link: <A HREF='{}'>NVD</A> or <A HREF='https://www.cve.org/CVERecord?id={}'>CVE.org</A>".format(iss['link'], iss['id']))
html.stopRow()
html.stopTable()
html.addContent("</TD>")
html.stopRow()
html.startRow()
html.stopRow()
html.startRow(style="bgcolor: gray;")
html.stopRow()
html.startRow()
html.stopRow()
html.stopTable()
html.stopDiv()
def generate_statistics_sheet(html, components):
general_MACHINE = d.getVar("MACHINE")
# Make sure to remove any DISTRO append to IMAGE_BASENAME for short display
general_IMAGE = re.sub(r'-%s$' % d.getVar('DISTRO'), '', d.getVar("IMAGE_BASENAME"))
general_DISTRO = d.getVar("DISTRO")
general_DISTRO_VERSION = d.getVar("DISTRO_VERSION")
general_DISTRO_CODENAME = d.getVar("DISTRO_CODENAME")
html.startDiv("statistic", "Main Statistics")
html.addAnchor("statistic")
html.addTitle("Number of CVE/CVS:")
html.startTable()
html.startRow()
html.addColumnHeaderContent("Component Name", style="font-weight: bold; background-color: #cccccc;")
html.addColumnHeaderContent("Issues", style="font-weight: bold; background-color: #cccccc;")
html.addColumnHeaderContent("Issues Patched", style="font-weight: bold; background-color: #cccccc;")
html.addColumnHeaderContent("Issues Unpatched", style="font-weight: bold; background-color: #cccccc;")
html.stopRow()
data = []
for c in components.split(','):
cvs = 0
patched = 0
unpatched = 0
file_name = os.path.join(cve_deploy_dir, "%s_cve.json" % c.lstrip().rstrip())
try:
with open(os.path.join(cve_deploy_dir, file_name)) as component_file:
json_component = json.load(component_file)
for i in json_component['package']:
issue=i['issue']
cvs = len(issue)
for err in issue:
if err['status'].find("Patched") > -1:
patched+= 1
elif err['status'].find("Unpatched") > -1:
unpatched+= 1
data.append([i['name'], cvs, patched, unpatched])
except FileNotFoundError:
bb.note("file (%s) are not present" % os.path.join(cve_deploy_dir, "%s_cve.json" % c.lstrip().rstrip()))
for i in data:
html.startRow()
html.addColumnContent(i[0], style="width: 10%;")
html.addColumnContent(i[1], style="width: 10%; text-align: center;")
html.addColumnContent(i[2], style="text-align: center;")
html.addColumnContent(i[3], style="text-align: center;")
html.stopRow()
html.stopTable()
html.addNewLine()
html.addNewLine()
# image count
with open( os.path.join(deploy_image_dir, "{}.json".format(ref_image_name))) as image_file:
json_component = json.load(image_file)
cvs = 0
package=0
patched = 0
unpatched = 0
for i in json_component['package']:
package += 1
issue=i['issue']
cvs += len(issue)
for err in issue:
if err['status'].find("Patched") > -1:
patched += 1
elif err['status'].find("Unpatched") > -1:
unpatched += 1
# package, cvs, patched, unpatched
html.addTitle("Number of CVE/CVS for image:")
html.startTable()
html.startRow()
html.addColumnHeaderContent("Image Name", style="font-weight: bold; background-color: #cccccc;")
html.addColumnHeaderContent("Packages", style="font-weight: bold; background-color: #cccccc;")
html.addColumnHeaderContent("Issues", style="font-weight: bold; background-color: #cccccc;")
html.addColumnHeaderContent("Issues Patched", style="font-weight: bold; background-color: #cccccc;")
html.addColumnHeaderContent("Issues Unpatched", style="font-weight: bold; background-color: #cccccc;")
html.stopRow()
html.startRow()
html.addColumnContent(ref_image_name, style="width: 25%; ")
html.addColumnContent(package, style="width: 10%; text-align: center;")
html.addColumnContent(cvs, style="text-align: center;")
html.addColumnContent(patched, style="text-align: center;")
html.addColumnContent(unpatched, style="text-align: center;")
html.stopRow()
html.stopTable()
html.stopDiv()
def generate_components_content_sheet(html, components):
html.startDiv("component", "Main Components CVE / CVS")
html.addAnchor("component")
html.addTitle("List of components:")
# link
for c in components.split(","):
html.addContent("<LI><a href='#component_{}'>{}</a></LI>\n".format(c, c))
html.addNewLine()
html.addNewLine()
for name in components.split(","):
html.addContent("<H1>Component: {} <a href='#top'>[top]</a></H1>\n".format(name))
html.addContent("<a name='component_{}'/>\n".format(name))
html.startTable(style="border: 1px solid black;")
html.startRow()
html.addColumnHeaderContent("Component Name", style="font-weight: bold; background-color: #cccccc;")
html.addColumnContent(name)
html.stopRow()
try:
with open(os.path.join(cve_deploy_dir, "%s_cve.json" % name.lstrip().rstrip())) as component_file:
json_component = json.load(component_file)
for i in json_component['package']:
issue=i['issue']
html.startRow()
html.addColumnHeaderContent("Version", style="font-weight: bold; background-color: #cccccc;")
html.addColumnContent(i['version'])
html.stopRow()
html.startRow()
html.addColumnHeaderContent("CVE Ref Name", style="font-weight: bold; background-color: #cccccc;")
html.addColumnContent(i['products'][0]['product'])
html.stopRow()
html.startRow()
html.addColumnHeaderContent("Issues", style="font-weight: bold; background-color: #cccccc;")
html.startColumn()
for iss in issue:
classe = ''
if iss['status'].find("Unpatched") < 0:
classe += 'patched '
if float(iss['scorev3']) < 7.0 :
classe += 'scorev3 '
if float(iss['scorev2']) < 7.0 :
classe += 'scorev2 '
if len(classe) > 0:
html.startTable(style='border: 1px solid black; width=100%;', classes=classe)
else:
html.startTable(style='border: 1px solid black; width=100%;')
html.startRow()
html.addColumnContent(iss['id'], style="width: 10%;")
if iss['status'].find("Unpatched") > -1:
html.addColumnContent(iss['status'], style="background-color: red;")
else:
html.addColumnContent(iss['status'])
html.stopRow()
html.startRow()
html.addColumnContent("")
html.addColumnContent(iss['summary'])
html.stopRow()
html.startRow()
html.addColumnContent("")
html.addColumnContent("ScoreV2 = {}; ScoreV3 = {}".format(score_v2_table(iss['scorev2']), score_v3_table(iss['scorev3'])))
html.stopRow()
html.startRow()
html.addColumnContent("")
html.addColumnContent("Link: <A HREF='{}'>NVD</A> or <A HREF='https://www.cve.org/CVERecord?id={}'>CVE.org</A>".format(iss['link'], iss['id']))
html.stopRow()
# empty line for separation
html.startRow(style="bgcolor: gray;")
html.stopRow()
html.stopTable()
html.stopColumn()
i = None
except FileNotFoundError:
bb.note("file (%s) are not present" % os.path.join(cve_deploy_dir, "%s_cve.json" % name.lstrip().rstrip()))
html.stopTable()
html.stopDiv()
# Create license summary file
cve_summary_name_path = os.path.join(cve_summary_deploydir, cve_summary_name)
print("generate ", cve_summary_name_path)
html = HTMLSummaryfile()
html.openfile(cve_summary_name_path)
html.beginHtml()
html.beginBody(with_tab)
html.addTitle("Image Name: {}<BR/>Generation Date: {}".format(ref_image_name, datetime))
html.addContent("<div class='one'>See Only 'Unpatched' CVE <input type='checkbox' valud='submit' class='btn' name='unpatched' onclick='toggleunpatched(this)'></div>")
html.addNewLine()
html.addContent("<div class='one'>See Only 'ScoreV3 > 7' (only)<input type='checkbox' valud='submit' class='btn' onclick='toggleunscorev3(this)'></div>")
html.addNewLine()
html.addContent("<div class='one'>See Only 'ScoreV2 > 7' (only)<input type='checkbox' valud='submit' class='btn' onclick='toggleunscorev2(this)'></div>")
html.addNewLine()
html.addApplicationTab()
''' generate first page: statistics cve / cvs information'''
generate_statistics_sheet(html, components_list)
''' generate image content '''
generate_components_content_sheet(html, components_list)
''' generate license spdx reference '''
generate_image_cve_sheet(html)
html.endBody(with_tab)
html.endHtml()
html.closefile()
# Create link
cve_summary_link_path = os.path.join(cve_summary_deploydir, cve_summary_link)
if os.path.exists(cve_summary_name_path):
bb.note("Creating symlink: %s -> %s" % (cve_summary_link_path, cve_summary_name))
if os.path.islink(cve_summary_link_path):
os.remove(cve_summary_link_path)
os.symlink(cve_summary_name, cve_summary_link_path)
else:
bb.note("Skipping symlink, source does not exist: %s -> %s" % (cve_summary_link_path, cve_summary_name))
python do_st_write_cve_create_summary() {
bb.note("---> ENABLE_IMAGE_CVE_SUMMARY %s" % (d.getVar('ENABLE_IMAGE_CVE_SUMMARY')))
if d.getVar('ENABLE_IMAGE_CVE_SUMMARY') == "1":
if not d.getVar('CVE_CHECK_MANIFEST') is None:
cve_create_summary(d)
else:
return
}
addtask st_write_cve_create_summary before do_build after do_image_complete
do_st_write_cve_create_summary[dirs] = "${ST_CVE_SUMMARY_DIR} ${IMGDEPLOYDIR}"
SSTATETASKS += "do_st_write_cve_create_summary"
do_st_write_cve_create_summary[cleandirs] = "${ST_CVE_SUMMARY_DIR}"
do_st_write_cve_create_summary[sstate-inputdirs] = "${ST_CVE_SUMMARY_DIR}"
do_st_write_cve_create_summary[sstate-outputdirs] = "${ST_CVE_SUMMARY_DEPLOYDIR}/"
python do_st_write_cve_create_summary_setscene () {
sstate_setscene(d)
}
addtask do_st_write_cve_create_summary_setscene
#excluded from basehash signature calculation
cve_create_summary[vardepsexclude] += "DATETIME"

View File

@@ -0,0 +1,736 @@
inherit license_image
# To have tab on html file generated
LICENSE_IMAGE_CONTENT_WITH_TAB ?= "1"
# Configure on BSP side this var if you expect the summary to be generated
ENABLE_IMAGE_LICENSE_SUMMARY ??= "0"
# We can define one or more additional images built as additional partitions
# to the default rootfs one (${IMAGE_BASENAME}:/) thought IMAGE_SUMMARY_LIST var
# with format
# IMAGE_SUMMARY_LIST = "<image_name_1>:<image_mountpoint_1>;${IMAGE_BASENAME}:/;<image_name_2>:<image_mountpoint_2"
IMAGE_SUMMARY_LIST ?= "${IMAGE_BASENAME}:/"
LICENSE_SUMMARY_DEPLOYDIR ?= "${DEPLOY_DIR}/images/${MACHINE}"
LICENSE_SUMMARY_DIR ?= "${WORKDIR}/license-summary/"
LICENSE_SUMMARY_NAME ?= "${IMAGE_NAME}-license_content.html"
LICENSE_SUMMARY_LINK_NAME ?= "${IMAGE_LINK_NAME}-license_content.html"
def license_create_summary(d):
import re
tab = d.expand("${LICENSE_IMAGE_CONTENT_WITH_TAB}")
ref_image_name = d.expand("${IMAGE_LINK_NAME}")
deploy_image_dir = d.expand("${DEPLOY_DIR_IMAGE}")
temp_deploy_image_dir = d.expand("${IMGDEPLOYDIR}")
license_deploy_dir = d.expand("${DEPLOY_DIR}/licenses")
pkgdata_dir = d.expand("${TMPDIR}/pkgdata/${MACHINE}")
license_summary_deploydir = d.getVar('LICENSE_SUMMARY_DIR')
license_summary_name = d.getVar('LICENSE_SUMMARY_NAME')
license_summary_link = d.getVar('LICENSE_SUMMARY_LINK_NAME')
image_list_arrray = []
# Process IMAGE_SUMMARY_LIST to feed image_list_arrray
image_summary_list = (d.getVar('IMAGE_SUMMARY_LIST') or "").split(';')
mount_list = []
for img in image_summary_list:
if img.strip() == "":
continue
img_name = img.split(':')[0].strip()
img_mount = img.split(':')[1].strip()
# Remove DISTRO from image name to avoid long name
img_name = re.sub(r'-%s$' % d.getVar('DISTRO'), '', img_name)
# Configure target folder to search for image file
if img_mount == '/':
filter = True
target_deploydir = temp_deploy_image_dir
else:
filter = False
target_deploydir = deploy_image_dir
mount_list.append(img_mount)
for fi in os.listdir(target_deploydir):
if fi.startswith(img_name) and fi.endswith(".ext4"):
r = re.compile(r"(.*)-(\d\d\d\d+)")
mi = r.match(os.path.basename(fi))
if mi:
image_list_arrray.append([mi.group(1), mi.group(2), img_name, img_mount, filter])
# Append any INITRD image to image_list_arrray
initrd_img = d.getVar('INITRD_IMAGE_ALL') or d.getVar('INITRD_IMAGE') or ""
for img_name in initrd_img.split():
img_ext = d.getVar('INITRAMFS_FSTYPES') or ""
img_mount = '/'
filter = False
for fi in os.listdir(deploy_image_dir):
if fi.startswith(img_name) and fi.endswith(img_ext):
r = re.compile(r"(.*)-(\d\d\d\d+)")
mi = r.match(os.path.basename(fi))
if mi:
image_list_arrray.append([mi.group(1), mi.group(2), img_name, img_mount, filter])
if tab.startswith("1"):
with_tab = 1
else:
with_tab = None
def private_open(filename):
result = None
if os.path.exists(filename):
try:
with open(filename, "r") as lic:
result = lic.readlines()
except IOError:
bb.warn("IMG LIC SUM: Cannot open file %s" % (filename))
result = ""
except:
bb.warn("IMG LIC SUM: Error with file %s" % (filename))
result = ""
else:
bb.warn("IMG LIC SUM: File does not exist with open file %s" % (filename))
result = ""
return result
class HTMLSummaryfile():
''' format definition '''
bold = "font-weight: bold; background-color: #cccccc;"
red = "background-color: #ff0000;"
center_format = "align: center;"
border_format = "border: 1;"
wrap_format = ""
wrap_red_format = "background-color: #ff0000;"
blue = "background-color: #0000ff;"
green = "background-color: #00ff00;"
opened_file = None
def openfile(self, file_name):
self.opened_file = open(file_name, 'w')
def closefile(self):
self.opened_file.close()
def startTable(self, style=None):
if style:
self.opened_file.write("<TABLE STYLE='%s'>\n" % style)
else:
self.opened_file.write("<TABLE border=1>\n")
def stopTable(self):
self.opened_file.write("</TABLE>\n")
def startRow(self, style=None):
self.opened_file.write("<TR>\n")
def stopRow(self, style=None):
self.opened_file.write("</TR>\n")
def startColumn(self, style=None):
if style:
self.opened_file.write("<TD STYLE='%s'>\n")
else:
self.opened_file.write("<TD>\n")
def stopColumn(self, style=None):
self.opened_file.write("</TR>\n")
def addColumnHeaderContent(self, content, style=None):
if style:
self.opened_file.write("<TH STYLE='%s'>%s</TH>\n" % (style, content))
else:
self.opened_file.write("<TH><B>%s</B></TH>\n" % content)
def addColumnContent(self, content, style=None):
if style:
self.opened_file.write("<TD STYLE='%s'>%s</TD>\n" % (style, content))
else:
self.opened_file.write("<TD>%s</TD>\n" % content)
def addColumnURLOUTContent(self, content, url, style=None):
if style:
self.opened_file.write("<TD STYLE='%s'><A HREF='%s' TARGET='_blank'>%s</A></TD>\n" % (style, url, content))
else:
self.opened_file.write("<TD><A HREF='%s' TARGET='_blank'>%s</A></TD>\n" % (url, content))
def addColumnEmptyContent(self, style=None):
if style:
self.opened_file.write("<TD STYLE='%s'><BR/></TD>\n" % style)
else:
self.opened_file.write("<TD><BR/></TD>\n")
def addNewLine(self):
self.opened_file.write("<BR/>\n")
def addContent(self, content):
self.opened_file.write(content)
def addURLContent(self, content, url):
self.opened_file.write("<A HREF='%s'>%s</A>\n" %(url, content))
def startBlock(self):
self.opened_file.write("<UL>\n")
def stopBlock(self):
self.opened_file.write("</UL>\n")
def addAnchor(self, anchor):
self.opened_file.write("<A name='%s'/>\n" % anchor)
def startDiv(self, anchor, title, style=None):
self.opened_file.write("<div id='%s' class='tabcontent'>\n" % anchor)
self.opened_file.write("<H1>%s</H1>\n" % title)
def stopDiv(self):
self.opened_file.write("</div>\n")
def beginHtml(self):
self.opened_file.write("<HTML>\n")
self.opened_file.write('<HEAD>\n')
self.opened_file.write(" <STYLE TYPE='text/css'>\n")
self.opened_file.write("/* Style the tab buttons */\n")
self.opened_file.write(".tablink {\n")
self.opened_file.write(" background-color: #555;\n")
self.opened_file.write(" color: white;\n")
self.opened_file.write(" float: left;\n")
self.opened_file.write(" border: none;\n")
self.opened_file.write(" outline: none;\n")
self.opened_file.write(" cursor: pointer;\n")
self.opened_file.write(" padding: 14px 16px;\n")
self.opened_file.write(" font-size: 17px;\n")
self.opened_file.write(" width: 25%;\n")
self.opened_file.write("}\n")
self.opened_file.write("\n")
self.opened_file.write("/* Change background color of buttons on hover */\n")
self.opened_file.write(".tablink:hover {\n")
self.opened_file.write(" background-color: #777;\n")
self.opened_file.write("}\n")
self.opened_file.write("\n")
self.opened_file.write("/* Set default styles for tab content */\n")
self.opened_file.write(".tabcontent {\n")
self.opened_file.write(" color: black;\n")
self.opened_file.write(" display: none;\n")
self.opened_file.write(" padding: 50px;\n")
self.opened_file.write(" text-align: left;\n")
self.opened_file.write("}\n")
self.opened_file.write("\n")
self.opened_file.write("/* Style each tab content individually */\n")
self.opened_file.write("#introduction {background-color: white;}\n")
self.opened_file.write("#image_content {background-color: white;}\n")
self.opened_file.write("#OE_SPDX_LICENSE {background-color: white;}\n")
self.opened_file.write(" </STYLE>\n")
self.opened_file.write("</HEAD>\n")
def endHtml(self):
self.opened_file.write("</HTML>\n")
def beginBody(self, tab=None):
self.opened_file.write("<BODY>\n")
if tab:
self.opened_file.write(' <button class="tablink" onclick="openTab(\'introduction\', this)" id="defaultOpen">Main</button>\n')
self.opened_file.write(' <button class="tablink" onclick="openTab(\'image_content\', this)">Contents of Images</button>\n')
self.opened_file.write(' <button class="tablink" onclick="openTab(\'OE_SPDX_LICENSE\', this)">SPDX License</button>\n')
self.opened_file.write("\n")
def endBody(self, tab=None):
if tab:
self.opened_file.write('<SCRIPT TYPE="text/javascript">\n')
self.opened_file.write('function openTab(Name, elmnt) {\n')
self.opened_file.write(' // Hide all elements with class="tabcontent" by default */\n')
self.opened_file.write(' var i, tabcontent, tablinks;\n')
self.opened_file.write(' tabcontent = document.getElementsByClassName("tabcontent");\n')
self.opened_file.write(' for (i = 0; i < tabcontent.length; i++) {\n')
self.opened_file.write(' tabcontent[i].style.display = "none";\n')
self.opened_file.write(' }\n')
self.opened_file.write('\n')
self.opened_file.write(' // Remove the background color of all tablinks/buttons\n')
self.opened_file.write(' tablinks = document.getElementsByClassName("tablink");\n')
self.opened_file.write(' for (i = 0; i < tablinks.length; i++) {\n')
self.opened_file.write(' tablinks[i].style.backgroundColor = "";\n')
self.opened_file.write(' }\n')
self.opened_file.write('\n')
self.opened_file.write(' // Show the specific tab content\n')
self.opened_file.write(' document.getElementById(Name).style.display = "block";\n')
self.opened_file.write('\n')
self.opened_file.write(' // Add the specific color to the button used to open the tab content\n')
self.opened_file.write(' elmnt.style.backgroundColor = \'white\';\n')
self.opened_file.write(' elmnt.style.color = "black";\n')
self.opened_file.write('}\n')
self.opened_file.write('\n')
self.opened_file.write('// Get the element with id="defaultOpen" and click on it\n')
self.opened_file.write('document.getElementById("defaultOpen").click();\n')
self.opened_file.write('</SCRIPT>\n')
else:
self.opened_file.write('<SCRIPT TYPE="text/javascript">\n')
self.opened_file.write(' // display all elements with class="tabcontent" by default */\n')
self.opened_file.write(' var i, tabcontent, tablinks;\n')
self.opened_file.write(' tabcontent = document.getElementsByClassName("tabcontent");\n')
self.opened_file.write(' for (i = 0; i < tabcontent.length; i++) {\n')
self.opened_file.write(' tabcontent[i].style.display = "block";\n')
self.opened_file.write(' }\n')
self.opened_file.write('\n')
self.opened_file.write('</SCRIPT>\n')
self.opened_file.write("</BODY>\n")
def findWholeWord(w):
return re.compile(r'\b({0})\b'.format(w), flags=re.IGNORECASE).search
def generate_spdx_license_sheet(html):
SRC_DISTRIBUTE_LICENSES = ""
SRC_DISTRIBUTE_LICENSES += "0BSD "
SRC_DISTRIBUTE_LICENSES += "AAL Abstyles Adobe Adobe-2006 Adobe-Glyph ADSL "
SRC_DISTRIBUTE_LICENSES += "AFL-1.1 AFL-1.2 AFL-2.0 AFL-2.1 AFL-3.0 "
SRC_DISTRIBUTE_LICENSES += "Afmparse AGPL-1.0-only AGPL-1.0-or-later AGPL-3.0-only "
SRC_DISTRIBUTE_LICENSES += "AGPL-3.0-or-later Aladdin AMDPLPA AML AMPAS ANTLR-PD "
SRC_DISTRIBUTE_LICENSES += "ANTLR-PD-fallback Apache-1.0 Apache-1.1 Apache-2.0 "
SRC_DISTRIBUTE_LICENSES += "Apache-2.0-with-LLVM-exception APAFML APL-1.0 APSL-1.0 "
SRC_DISTRIBUTE_LICENSES += "APSL-1.1 APSL-1.2 APSL-2.0 "
SRC_DISTRIBUTE_LICENSES += "Artistic-1.0 Artistic-1.0-cl8 Artistic-1.0-Perl Artistic-2.0 "
SRC_DISTRIBUTE_LICENSES += "Bahyph Barr Beerware BitstreamVera BitTorrent-1.0 BitTorrent-1.1 "
SRC_DISTRIBUTE_LICENSES += "blessing BlueOak-1.0.0 Borceux BSD-1-Clause BSD-2-Clause "
SRC_DISTRIBUTE_LICENSES += "BSD-2-Clause-Patent BSD-2-Clause-Views BSD-3-Clause "
SRC_DISTRIBUTE_LICENSES += "BSD-3-Clause-Attribution BSD-3-Clause-Clear BSD-3-Clause-LBNL "
SRC_DISTRIBUTE_LICENSES += "BSD-3-Clause-Modification BSD-3-Clause-No-Military-License "
SRC_DISTRIBUTE_LICENSES += "BSD-3-Clause-No-Nuclear-License BSD-3-Clause-No-Nuclear-License-2014 "
SRC_DISTRIBUTE_LICENSES += "BSD-3-Clause-No-Nuclear-Warranty BSD-3-Clause-Open-MPI "
SRC_DISTRIBUTE_LICENSES += "BSD-4-Clause BSD-4-Clause-Shortened BSD-4-Clause-UC "
SRC_DISTRIBUTE_LICENSES += "BSD-Protection BSD-Source-Code "
SRC_DISTRIBUTE_LICENSES += "BSL-1.0 BUSL-1.1 bzip2-1.0.4 bzip2-1.0.5 bzip2-1.0.6 "
SRC_DISTRIBUTE_LICENSES += "CAL-1.0 CAL-1.0-Combined-Work-Exception Caldera CATOSL-1.1 "
SRC_DISTRIBUTE_LICENSES += "CC0-1.0 CC-BY-1.0 CC-BY-2.0 CC-BY-2.5 CC-BY-2.5-AU CC-BY-3.0 "
SRC_DISTRIBUTE_LICENSES += "CC-BY-3.0-AT CC-BY-3.0-DE CC-BY-3.0-NL CC-BY-3.0-US CC-BY-4.0 "
SRC_DISTRIBUTE_LICENSES += "CC-BY-NC-1.0 CC-BY-NC-2.0 CC-BY-NC-2.5 CC-BY-NC-3.0 "
SRC_DISTRIBUTE_LICENSES += "CC-BY-NC-3.0-DE CC-BY-NC-4.0 CC-BY-NC-ND-1.0 CC-BY-NC-ND-2.0 "
SRC_DISTRIBUTE_LICENSES += "CC-BY-NC-ND-2.5 CC-BY-NC-ND-3.0 CC-BY-NC-ND-3.0-DE "
SRC_DISTRIBUTE_LICENSES += "CC-BY-NC-ND-3.0-IGO CC-BY-NC-ND-4.0 CC-BY-NC-SA-1.0 "
SRC_DISTRIBUTE_LICENSES += "CC-BY-NC-SA-2.0 CC-BY-NC-SA-2.0-FR CC-BY-NC-SA-2.0-UK "
SRC_DISTRIBUTE_LICENSES += "CC-BY-NC-SA-2.5 CC-BY-NC-SA-3.0 CC-BY-NC-SA-3.0-DE "
SRC_DISTRIBUTE_LICENSES += "CC-BY-NC-SA-3.0-IGO CC-BY-NC-SA-4.0 CC-BY-ND-1.0 "
SRC_DISTRIBUTE_LICENSES += "CC-BY-ND-2.0 CC-BY-ND-2.5 CC-BY-ND-3.0 CC-BY-ND-3.0-DE "
SRC_DISTRIBUTE_LICENSES += "CC-BY-ND-4.0 CC-BY-SA-1.0 CC-BY-SA-2.0 CC-BY-SA-2.0-UK "
SRC_DISTRIBUTE_LICENSES += "CC-BY-SA-2.1-JP CC-BY-SA-2.5 CC-BY-SA-3.0 CC-BY-SA-3.0-AT "
SRC_DISTRIBUTE_LICENSES += "CC-BY-SA-3.0-DE CC-BY-SA-4.0 CC-PDDC CDDL-1.0 CDDL-1.1 "
SRC_DISTRIBUTE_LICENSES += "CDL-1.0 CDLA-Permissive-1.0 CDLA-Permissive-2.0 CDLA-Sharing-1.0 "
SRC_DISTRIBUTE_LICENSES += "CECILL-1.0 CECILL-1.1 CECILL-2.0 CECILL-2.1 CECILL-B CECILL-C "
SRC_DISTRIBUTE_LICENSES += "CERN-OHL-1.1 CERN-OHL-1.2 CERN-OHL-P-2.0 CERN-OHL-S-2.0 CERN-OHL-W-2.0 "
SRC_DISTRIBUTE_LICENSES += "ClArtistic CNRI-Jython CNRI-Python CNRI-Python-GPL-Compatible "
SRC_DISTRIBUTE_LICENSES += "Condor-1.1 copyleft-next-0.3.0 copyleft-next-0.3.1 CPAL-1.0 "
SRC_DISTRIBUTE_LICENSES += "CPL-1.0 CPOL-1.02 Crossword CrystalStacker CUA-OPL-1.0 Cube "
SRC_DISTRIBUTE_LICENSES += "C-UDA-1.0 curl D-FSL-1.0 diffmark DOC Dotseqn DRL-1.0 DSDP "
SRC_DISTRIBUTE_LICENSES += "DSSSL dvipdfm ECL-1.0 ECL-2.0 eCos-2.0 EDL-1.0 EFL-1.0 "
SRC_DISTRIBUTE_LICENSES += "EFL-2.0 eGenix Entessa EPICS EPL-1.0 EPL-2.0 ErlPL-1.1 etalab-2.0 "
SRC_DISTRIBUTE_LICENSES += "EUDatagrid EUPL-1.0 EUPL-1.1 EUPL-1.2 urosym Fair Frameworx-1.0 "
SRC_DISTRIBUTE_LICENSES += "FreeBSD-DOC FreeImage FSFAP FSFUL FSFULLR FSF-Unlimited "
SRC_DISTRIBUTE_LICENSES += "FTL GD GFDL-1.1 GFDL-1.1-invariants-only GFDL-1.1-invariants-or-later "
SRC_DISTRIBUTE_LICENSES += "GFDL-1.1-no-invariants-only GFDL-1.1-no-invariants-or-later "
SRC_DISTRIBUTE_LICENSES += "GFDL-1.1-only GFDL-1.1-or-later GFDL-1.2 GFDL-1.2-invariants-only "
SRC_DISTRIBUTE_LICENSES += "GFDL-1.2-invariants-or-later GFDL-1.2-no-invariants-only "
SRC_DISTRIBUTE_LICENSES += "GFDL-1.2-no-invariants-or-later GFDL-1.2-only GFDL-1.2-or-later "
SRC_DISTRIBUTE_LICENSES += "GFDL-1.3 GFDL-1.3-invariants-only GFDL-1.3-invariants-or-later "
SRC_DISTRIBUTE_LICENSES += "GFDL-1.3-no-invariants-only GFDL-1.3-no-invariants-or-later "
SRC_DISTRIBUTE_LICENSES += "GFDL-1.3-only GFDL-1.3-or-later Giftware GL2PS Glide Glulxe "
SRC_DISTRIBUTE_LICENSES += "GLWTPL gnuplot GPL-1.0-only GPL-1.0-or-later GPL-2.0-only "
SRC_DISTRIBUTE_LICENSES += "GPL-2.0-or-later GPL-2.0-with-autoconf-exception "
SRC_DISTRIBUTE_LICENSES += "GPL-2.0-with-classpath-exception GPL-2.0-with-font-exception "
SRC_DISTRIBUTE_LICENSES += "GPL-2.0-with-GCC-exception GPL-2.0-with-OpenSSL-exception "
SRC_DISTRIBUTE_LICENSES += "GPL-2-with-bison-exception GPL-3.0-only GPL-3.0-or-later "
SRC_DISTRIBUTE_LICENSES += "GPL-3.0-with-autoconf-exception GPL-3.0-with-GCC-exception "
SRC_DISTRIBUTE_LICENSES += "GPL-3-with-bison-exception gSOAP-1 gSOAP-1.3b HaskellReport "
SRC_DISTRIBUTE_LICENSES += "Hippocratic-2.1 HPND HPND-sell-variant HTMLTIDY IBM-pibs "
SRC_DISTRIBUTE_LICENSES += "ICU IJG ImageMagick iMatix Imlib2 Info-ZIP Intel Intel-ACPI "
SRC_DISTRIBUTE_LICENSES += "Interbase-1.0 IPA IPL-1.0 ISC JasPer-2.0 JPNIC JSON "
SRC_DISTRIBUTE_LICENSES += "LAL-1.2 LAL-1.3 Latex2e Leptonica LGPL-2.0-only "
SRC_DISTRIBUTE_LICENSES += "LGPL-2.0-or-later LGPL-2.1-only LGPL-2.1-or-later LGPL-3.0-only "
SRC_DISTRIBUTE_LICENSES += "LGPL-3.0-or-later LGPLLR Libpng libpng-2.0 libselinux-1.0 libtiff "
SRC_DISTRIBUTE_LICENSES += "LiLiQ-P-1.1 LiLiQ-R-1.1 LiLiQ-Rplus-1.1 Linux-OpenIB "
SRC_DISTRIBUTE_LICENSES += "LPL-1.0 LPL-1.02 LPPL-1.0 LPPL-1.1 LPPL-1.2 LPPL-1.3a LPPL-1.3c "
SRC_DISTRIBUTE_LICENSES += "MakeIndex MirOS MIT MIT-0 MIT-advertising MIT-CMU MIT-enna "
SRC_DISTRIBUTE_LICENSES += "MIT-feh MIT-Modern-Variant MITNFA MIT-open-group Motosoto "
SRC_DISTRIBUTE_LICENSES += "mpich2 MPL-1.0 MPL-1.1 MPL-2.0 MPL-2.0-no-copyleft-exception "
SRC_DISTRIBUTE_LICENSES += "MS-PL MS-RL MTLL MulanPSL-1.0 MulanPSL-2.0 Multics Mup "
SRC_DISTRIBUTE_LICENSES += "NAIST-2003 NASA-1.3 Naumen NBPL-1.0 NCGL-UK-2.0 NCSA NetCDF "
SRC_DISTRIBUTE_LICENSES += "Net-SNMP Newsletr NGPL NIST-PD NIST-PD-fallback NLOD-1.0 "
SRC_DISTRIBUTE_LICENSES += "NLOD-2.0 NLPL Nokia NOSL Noweb NPL-1.0 NPL-1.1 NPOSL-3.0 "
SRC_DISTRIBUTE_LICENSES += "NRL NTP NTP-0 OASIS OCCT-PL OCLC-2.0 ODbL-1.0 ODC-By-1.0 "
SRC_DISTRIBUTE_LICENSES += "OFL-1.0 OFL-1.0-no-RFN OFL-1.0-RFN OFL-1.1 OFL-1.1-no-RFN "
SRC_DISTRIBUTE_LICENSES += "OFL-1.1-RFN OGC-1.0 OGDL-Taiwan-1.0 OGL-Canada-2.0 OGL-UK-1.0 "
SRC_DISTRIBUTE_LICENSES += "OGL-UK-2.0 OGL-UK-3.0 OGTSL OLDAP-1.1 OLDAP-1.2 OLDAP-1.3 "
SRC_DISTRIBUTE_LICENSES += "OLDAP-1.4 OLDAP-2.0 OLDAP-2.0.1 OLDAP-2.1 OLDAP-2.2 OLDAP-2.2.1 "
SRC_DISTRIBUTE_LICENSES += "OLDAP-2.2.2 OLDAP-2.3 OLDAP-2.4 OLDAP-2.5 OLDAP-2.6 OLDAP-2.7 "
SRC_DISTRIBUTE_LICENSES += "OLDAP-2.8 OML OpenSSL OPL-1.0 OPUBL-1.0 OSET-PL-2.1 OSL-1.0 "
SRC_DISTRIBUTE_LICENSES += "OSL-1.1 OSL-2.0 OSL-2.1 OSL-3.0 O-UDA-1.0 ParaTypeFFL-1.3 "
SRC_DISTRIBUTE_LICENSES += "Parity-6.0.0 Parity-7.0.0 PD PDDL-1.0 PHP-3.0 PHP-3.01 pkgconf "
SRC_DISTRIBUTE_LICENSES += "Plexus PolyForm-Noncommercial-1.0.0 PolyForm-Small-Business-1.0.0 "
SRC_DISTRIBUTE_LICENSES += "PostgreSQL Proprietary PSF-2.0 psfrag psutils Python-2.0 "
SRC_DISTRIBUTE_LICENSES += "Qhull QPL-1.0 Rdisc RHeCos-1 RHeCos-1.1 RPL-1.1 RPL-1.5 "
SRC_DISTRIBUTE_LICENSES += "RPSL-1.0 RSA-MD RSCPL Ruby Saxpath SAX-PD SCEA Sendmail "
SRC_DISTRIBUTE_LICENSES += "Sendmail-8.23 SGI-1 SGI-B-1.0 SGI-B-1.1 SGI-B-2.0 SHL-0.5 "
SRC_DISTRIBUTE_LICENSES += "SHL-0.51 SimPL-2.0 Simple-2.0 SISSL SISSL-1.2 Sleepycat "
SRC_DISTRIBUTE_LICENSES += "SMAIL_GPL SMLNJ SMPPL SNIA Spencer-86 Spencer-94 Spencer-99 "
SRC_DISTRIBUTE_LICENSES += "SPL-1.0 SSH-OpenSSH SSH-short SSPL-1.0 SugarCRM-1 SugarCRM-1.1.3 "
SRC_DISTRIBUTE_LICENSES += "SWL TAPR-OHL-1.0 TCL TCP-wrappers TMate TORQUE-1.1 TOSL "
SRC_DISTRIBUTE_LICENSES += "TU-Berlin-1.0 TU-Berlin-2.0 UCB UCL-1.0 unfs3 Unicode-DFS-2015 "
SRC_DISTRIBUTE_LICENSES += "Unicode-DFS-2016 Unicode-TOU Unlicense UPL-1.0 Vim VOSTROM "
SRC_DISTRIBUTE_LICENSES += "VSL-1.0 W3C W3C-19980720 W3C-20150513 Watcom-1.0 Wsuipa "
SRC_DISTRIBUTE_LICENSES += "WTFPL WXwindows X11 Xerox XFree86-1.0 Free86-1.1 xinetd "
SRC_DISTRIBUTE_LICENSES += "Xnet xpp XSkat XSL YPL-1.0 YPL-1.1 Zed Zend-2.0 Zimbra-1.3 "
SRC_DISTRIBUTE_LICENSES += "Zimbra-1.4 Zlib zlib-acknowledgement ZPL-1.1 ZPL-2.0 ZPL-2.1 "
html.startDiv("OE_SPDX_LICENSE", "OE SPDX LICENSE")
html.addAnchor("OE_SPDX_LICENSE")
html.addContent("Openembedded validate the License with the SPDX license list. ")
html.addNewLine()
html.addContent("How Openembedded validate an License indicated on a package:")
html.addNewLine()
html.startBlock()
html.addContent(" - remove all information after the last + on license( ex.: LGPLv2.1+ become GPLv2.1)")
html.addNewLine()
html.addContent(" - translate license with SPDX table: (LGPLV2.1 become LGPL-2.1)")
html.addNewLine()
html.addContent(" - verification with official list of license")
html.addNewLine()
html.stopBlock()
html.startTable()
html.startRow()
html.addColumnHeaderContent("Official licenses used by Openembedded", html.bold)
html.addColumnHeaderContent("Link to text of license", html.bold)
html.stopRow()
for lic in SRC_DISTRIBUTE_LICENSES.split(' '):
html.startRow()
html.addColumnContent(lic)
html.addColumnURLOUTContent('['+lic+']', "http://git.openembedded.org/openembedded-core/tree/meta/files/common-licenses/" + lic )
html.stopRow()
html.stopTable()
html.addNewLine()
html.addNewLine()
html.addNewLine()
html.addContent("Information extracted from:")
html.addNewLine()
html.addURLContent("http://git.openembedded.org/openembedded-core/tree/meta/conf/licenses.conf", "http://git.openembedded.org/openembedded-core/tree/meta/conf/licenses.conf")
html.addNewLine()
html.addContent("All Text of License are available:")
html.addNewLine()
html.addURLContent("http://git.openembedded.org/openembedded-core/tree/meta/files/common-licenses", "http://git.openembedded.org/openembedded-core/tree/meta/files/common-licenses")
html.addNewLine()
html.stopDiv()
def generate_introduction_sheet(html):
general_MACHINE = d.getVar("MACHINE")
# Make sure to remove any DISTRO append to IMAGE_BASENAME for short display
general_IMAGE = re.sub(r'-%s$' % d.getVar('DISTRO'), '', d.getVar("IMAGE_BASENAME"))
general_DISTRO = d.getVar("DISTRO")
general_DISTRO_VERSION = d.getVar("DISTRO_VERSION")
general_DISTRO_CODENAME = d.getVar("DISTRO_CODENAME")
html.startDiv("introduction", "")
html.addAnchor("introduction")
html.startTable()
# Machine
html.startRow()
html.addColumnContent("MACHINE", html.bold)
html.addColumnContent(general_MACHINE)
html.stopRow()
# Image
html.startRow()
html.addColumnContent("IMAGE", html.bold)
html.addColumnContent(general_IMAGE)
html.stopRow()
# DISTRO
html.startRow()
html.addColumnContent("DISTRO", html.bold)
html.addColumnContent(general_DISTRO)
html.stopRow()
# DISTRO VERSION
html.startRow()
html.addColumnContent("VERSION", html.bold)
html.addColumnContent(general_DISTRO_VERSION)
html.stopRow()
# DISTRO CODENAME
html.startRow()
html.addColumnContent("OE branch", html.bold)
html.addColumnContent(general_DISTRO_CODENAME)
html.stopRow()
html.stopTable()
html.addNewLine()
html.addNewLine()
license_file_to_read = os.path.join(deploy_image_dir, "%s.license" % ref_image_name)
contents = private_open(license_file_to_read)
html.startTable()
html.startRow()
html.addColumnHeaderContent("License", html.bold)
html.stopRow()
html.startRow()
html.startColumn()
for l in contents:
if len(l.rstrip('\n')) > 0:
html.addContent(l.rstrip('\n'))
html.addNewLine()
else:
html.addNewLine()
html.stopColumn()
html.stopRow()
html.stopTable()
html.stopDiv()
def generate_image_content_sheet(html):
html.startDiv("image_content", "Image content")
html.addAnchor("image_content")
# partition schema
html.addContent("Schema of partitions:")
html.startTable()
html.startRow()
html.startColumn("width: 10%; text-align: center;")
html.addURLContent("Boot binaries", "#boot_binaries")
for img in image_list_arrray:
_image_prefix = img[0]
_image_date = img[1]
_image_name = img[2]
_image_mount_point = img[3]
if _image_mount_point == '/':
html.startColumn("width: 30%; text-align: center;")
else:
html.startColumn("width: 20%; text-align: center;")
html.addURLContent(_image_name, "#%s" % _image_name)
html.stopColumn()
html.stopRow()
html.stopTable()
html.addNewLine()
html.addNewLine()
boot_file_to_read = None
# boot binaries
for img in image_list_arrray:
_image_prefix = img[0]
_image_date = img[1]
if _image_prefix == ref_image_name:
_image_package = "image_license.manifest"
boot_file_to_read = license_deploy_dir + "/" + _image_prefix + "-" + _image_date + "/" + _image_package
if boot_file_to_read:
contents = private_open(boot_file_to_read)
else:
contents = ""
html.addContent("List of packages used during the different boot phases:")
html.addAnchor("boot_binaries")
html.startTable()
html.startRow()
html.addColumnHeaderContent("Recipe Name", html.bold)
html.addColumnHeaderContent("Version", html.bold)
html.addColumnHeaderContent("License", html.bold)
html.stopRow()
r = re.compile(r"(^.+?):\s+(.*)")
new_boot = 0
boot_recipe = None
boot_license = None
boot_version = None
for l in contents:
m = r.match(l)
if m:
if m.group(1) == "RECIPE NAME":
boot_recipe = m.group(2)
elif m.group(1) == "LICENSE":
boot_license = m.group(2)
elif m.group(1) == "VERSION":
boot_version = m.group(2)
elif m.group(1) == "FILES":
new_boot = 1
if new_boot == 1:
if findWholeWord("GPLv3")(boot_license):
html.startRow(red)
# Recipe Name
html.addColumnContent(boot_recipe, red)
# Version
html.addColumnContent(boot_version, red)
# License
html.addColumnContent(boot_license, red)
html.stopRow()
else:
html.startRow()
# Recipe Name
html.addColumnContent(boot_recipe)
# Version
html.addColumnContent(boot_version)
# License
html.addColumnContent(boot_license)
html.stopRow()
boot_recipe = ""
boot_license = ""
boot_version = ""
new_boot = 0
html.stopTable()
# image content list
package_processed_list = []
for img in image_list_arrray:
_image_prefix = img[0]
_image_date = img[1]
_image_name = img[2]
_image_mount_point = img[3]
_image_filter = img[4]
html.addNewLine()
html.addNewLine()
html.addContent("List of packages present on image")
html.addAnchor(_image_name)
html.startTable()
html.startRow()
html.addColumnHeaderContent("Image", html.bold)
html.addColumnHeaderContent(_image_prefix)
html.stopRow()
html.stopTable()
_image_package="package.manifest"
file_to_read = license_deploy_dir + "/" + _image_prefix + "-" + _image_date + "/" + _image_package
contents = private_open(file_to_read)
#print("Process for %s" % _image_prefix)
html.startTable()
html.startRow()
html.addColumnHeaderContent("Recipe Name", html.bold)
html.addColumnHeaderContent("Package Name", html.bold)
html.addColumnHeaderContent("Version", html.bold)
html.addColumnHeaderContent("License", html.bold)
html.addColumnHeaderContent("Description", html.bold)
html.stopRow()
for p in contents:
package_license = None
package_recipe = None
package_name = p.split('\n')[0]
package_version = None
package_description = None
package_summary = None
package_file = pkgdata_dir + "/runtime-reverse/" + package_name
package_file_content = private_open(package_file)
file_info = None
r = re.compile(r"(^.+?):\s+(.*)")
for line in package_file_content:
m = r.match(line)
if m:
if m.group(1) == "PN":
package_recipe = m.group(2)
elif m.group(1).startswith("LICENSE"):
package_license = m.group(2)
elif m.group(1) == "PV":
package_version = m.group(2)
elif m.group(1).startswith("DESCRIPTION"):
package_description = m.group(2)
elif m.group(1).startswith("SUMMARY"):
package_summary = m.group(2)
elif m.group(1).startswith("FILES_INFO"):
file_info = m.group(2)
if findWholeWord("GPLv3")(package_license):
style = html.red
style_wrapped = html.wrap_red_format
else:
style = None
style_wrapped = None
# Filter partition in case of a package is already in another partition
if _image_filter:
to_filter = False
for other_mount in mount_list:
if file_info.find(other_mount+'/') >= 0:
to_filter = True
break
if to_filter:
bb.note("Package %s is found in both %s and %s. Don't add it in %s" %
(package_name, other_mount,_image_mount_point, _image_name))
continue
# remove package which are dependency of installed package but
# not present on this mount point
if file_info.find(_image_mount_point) < 0:
continue;
html.startRow(style)
if package_recipe:
html.addColumnContent(package_recipe, style)
else:
html.addColumnContent("", style)
if package_name:
html.addColumnContent(package_name, style)
else:
html.addColumnContent("", style)
if package_version:
html.addColumnContent(package_version, style)
else:
html.addColumnContent("", style)
if package_license:
html.addColumnContent(package_license, style)
else:
html.addColumnContent("", style)
if package_summary:
html.addColumnContent(package_summary, style_wrapped)
else:
if package_description:
html.addColumnContent(package_description, style_wrapped)
else:
html.addColumnContent("", style)
# display file installed
#if file_info:
# b = re.compile("{(.*)}")
# b_info = b.match(file_info)
# data_file = ""
# for t in b_info.group(1).split(','):
# if t.find(_image_mount_point) > -1:
# data_file += t.split(':')[0].replace('\"', '') + " <br/>"
# html.addColumnContent(data_file, style)
#else:
# html.addColumnContent("", style)
html.stopRow()
package_license = None
package_parent = None
package_name = None
package_version = None
package_description = None
package_summary = None
html.stopTable()
html.stopDiv()
# Create license summary file
license_summary_name_path = os.path.join(license_summary_deploydir, license_summary_name)
html = HTMLSummaryfile()
html.openfile(license_summary_name_path)
html.beginHtml()
html.beginBody(with_tab)
''' generate first page: general information + license text '''
generate_introduction_sheet(html)
''' generate image content '''
generate_image_content_sheet(html)
''' generate license spdx reference '''
generate_spdx_license_sheet(html)
html.endBody(with_tab)
html.endHtml()
html.closefile()
# Create link
license_summary_link_path = os.path.join(license_summary_deploydir, license_summary_link)
if os.path.exists(license_summary_name_path):
bb.note("Creating symlink: %s -> %s" % (license_summary_link_path, license_summary_name))
if os.path.islink(license_summary_link_path):
os.remove(license_summary_link_path)
os.symlink(license_summary_name, license_summary_link_path)
else:
bb.note("Skipping symlink, source does not exist: %s -> %s" % (license_summary_link_path, license_summary_name))
python do_st_write_license_create_summary() {
if d.getVar('ENABLE_IMAGE_LICENSE_SUMMARY') == "1":
license_create_summary(d)
else:
return
}
addtask st_write_license_create_summary before do_build after do_image_complete
do_st_write_license_create_summary[recrdeptask] += "do_populate_lic_deploy"
do_st_write_license_create_summary[dirs] = "${LICENSE_SUMMARY_DIR} ${IMGDEPLOYDIR}"
SSTATETASKS += "do_st_write_license_create_summary"
do_st_write_license_create_summary[cleandirs] = "${LICENSE_SUMMARY_DIR}"
do_st_write_license_create_summary[sstate-inputdirs] = "${LICENSE_SUMMARY_DIR}"
do_st_write_license_create_summary[sstate-outputdirs] = "${LICENSE_SUMMARY_DEPLOYDIR}/"
python do_st_write_license_create_summary_setscene () {
sstate_setscene(d)
}
addtask do_st_write_license_create_summary_setscene

View File

@@ -0,0 +1,537 @@
# Configure on BSP side this var if you expect the summary to be generated
ENABLE_IMAGE_LICENSE_SUMMARY ?= "0"
python do_write_sdk_license_create_summary() {
if d.getVar('ENABLE_IMAGE_LICENSE_SUMMARY') == "1":
license_sdk_create_summary(d)
else:
bb.warn("IMG LIC SUM: Please set ENABLE_IMAGE_LICENSE_SUMMARY to '1' to enable licence summary")
}
def license_sdk_create_summary(d):
import re
tab = d.expand("${LICENSE_IMAGE_CONTENT_WITH_TAB}")
ref_sdk_name_full = d.expand("${TOOLCHAIN_OUTPUTNAME}")
temp_deploy_sdk_dir = d.expand("${SDKDEPLOYDIR}")
pkgdata_dir = d.expand("${TMPDIR}/pkgdata/${MACHINE}")
pkgdata_host_dir = d.expand("${TMPDIR}/pkgdata/${SDK_SYS}")
image_list_arrray = []
# host manifest
image_list_arrray.append([ "List of packages / tools used on host part",
"host", ref_sdk_name_full + ".host.manifest" ])
# target manifest
image_list_arrray.append([ "List of packages associated to package present on image",
"target", ref_sdk_name_full + ".target.manifest" ])
if tab.startswith("1"):
with_tab = 1
else:
with_tab = None
def private_open(filename):
result = None
if os.path.exists(filename):
try:
with open(filename, "r") as lic:
result = lic.readlines()
except IOError:
bb.warn("SDK LIC SUM: Cannot open file %s" % (filename))
result = ""
except:
bb.warn("SDK LIC SUM: Error with file %s" % (filename))
result = ""
else:
bb.warn("SDK LIC SUM: File does not exist with open file %s" % (filename))
result = ""
return result
class HTMLSummaryfile():
''' format definition '''
bold = "font-weight: bold; background-color: #cccccc;"
red = "background-color: #ff0000;"
center_format = "align: center;"
border_format = "border: 1;"
wrap_format = ""
wrap_red_format = "background-color: #ff0000;"
opened_file = None
def openfile(self, file_name):
self.opened_file = open(file_name, 'w')
def closefile(self):
self.opened_file.close()
def startTable(self, style=None):
if style:
self.opened_file.write("<TABLE STYLE='%s'>\n" % style)
else:
self.opened_file.write("<TABLE border=1>\n")
def stopTable(self):
self.opened_file.write("</TABLE>\n")
def startRow(self, style=None):
self.opened_file.write("<TR>\n")
def stopRow(self, style=None):
self.opened_file.write("</TR>\n")
def startColumn(self, style=None):
if style:
self.opened_file.write("<TD STYLE='%s'>\n")
else:
self.opened_file.write("<TD>\n")
def stopColumn(self, style=None):
self.opened_file.write("</TR>\n")
def addColumnHeaderContent(self, content, style=None):
if style:
self.opened_file.write("<TH STYLE='%s'>%s</TH>\n" % (style, content))
else:
self.opened_file.write("<TH><B>%s</B></TH>\n" % content)
def addColumnContent(self, content, style=None):
if style:
self.opened_file.write("<TD STYLE='%s'>%s</TD>\n" % (style, content))
else:
self.opened_file.write("<TD>%s</TD>\n" % content)
def addColumnURLOUTContent(self, content, url, style=None):
if style:
self.opened_file.write("<TD STYLE='%s'><A HREF='%s' TARGET='_blank'>%s</A></TD>\n" % (style, url, content))
else:
self.opened_file.write("<TD><A HREF='%s' TARGET='_blank'>%s</A></TD>\n" % (url, content))
def addColumnEmptyContent(self, style=None):
if style:
self.opened_file.write("<TD STYLE='%s'><BR/></TD>\n" % style)
else:
self.opened_file.write("<TD><BR/></TD>\n")
def addNewLine(self):
self.opened_file.write("<BR/>\n")
def addContent(self, content):
self.opened_file.write(content)
def addURLContent(self, content, url):
self.opened_file.write("<A HREF='%s'>%s</A>\n" %(url, content))
def startBlock(self):
self.opened_file.write("<UL>\n")
def stopBlock(self):
self.opened_file.write("</UL>\n")
def addAnchor(self, anchor):
self.opened_file.write("<A name='%s'/>\n" % anchor)
def startDiv(self, anchor, title, style=None):
self.opened_file.write("<div id='%s' class='tabcontent'>\n" % anchor)
self.opened_file.write("<H1>%s</H1>\n" % title)
def stopDiv(self):
self.opened_file.write("</div>\n")
def beginHtml(self):
self.opened_file.write("<HTML>\n")
self.opened_file.write('<HEAD>\n')
self.opened_file.write(" <STYLE TYPE='text/css'>\n")
self.opened_file.write("/* Style the tab buttons */\n")
self.opened_file.write(".tablink {\n")
self.opened_file.write(" background-color: #555;\n")
self.opened_file.write(" color: white;\n")
self.opened_file.write(" float: left;\n")
self.opened_file.write(" border: none;\n")
self.opened_file.write(" outline: none;\n")
self.opened_file.write(" cursor: pointer;\n")
self.opened_file.write(" padding: 14px 16px;\n")
self.opened_file.write(" font-size: 17px;\n")
self.opened_file.write(" width: 25%;\n")
self.opened_file.write("}\n")
self.opened_file.write("\n")
self.opened_file.write("/* Change background color of buttons on hover */\n")
self.opened_file.write(".tablink:hover {\n")
self.opened_file.write(" background-color: #777;\n")
self.opened_file.write("}\n")
self.opened_file.write("\n")
self.opened_file.write("/* Set default styles for tab content */\n")
self.opened_file.write(".tabcontent {\n")
self.opened_file.write(" color: black;\n")
self.opened_file.write(" display: none;\n")
self.opened_file.write(" padding: 50px;\n")
self.opened_file.write(" text-align: left;\n")
self.opened_file.write("}\n")
self.opened_file.write("\n")
self.opened_file.write("/* Style each tab content individually */\n")
self.opened_file.write("#introduction {background-color: white;}\n")
self.opened_file.write("#image_content {background-color: white;}\n")
self.opened_file.write("#OE_SPDX_LICENSE {background-color: white;}\n")
self.opened_file.write(" </STYLE>\n")
self.opened_file.write("</HEAD>\n")
def endHtml(self):
self.opened_file.write("</HTML>\n")
def beginBody(self, tab=None):
self.opened_file.write("<BODY>\n")
if tab:
self.opened_file.write(' <button class="tablink" onclick="openTab(\'introduction\', this)" id="defaultOpen">Main</button>\n')
self.opened_file.write(' <button class="tablink" onclick="openTab(\'sdk_content\', this)">Contents of Images</button>\n')
self.opened_file.write(' <button class="tablink" onclick="openTab(\'OE_SPDX_LICENSE\', this)">SPDX License</button>\n')
self.opened_file.write("\n")
def endBody(self, tab=None):
if tab:
self.opened_file.write('<SCRIPT TYPE="text/javascript">\n')
self.opened_file.write('function openTab(Name, elmnt) {\n')
self.opened_file.write(' // Hide all elements with class="tabcontent" by default */\n')
self.opened_file.write(' var i, tabcontent, tablinks;\n')
self.opened_file.write(' tabcontent = document.getElementsByClassName("tabcontent");\n')
self.opened_file.write(' for (i = 0; i < tabcontent.length; i++) {\n')
self.opened_file.write(' tabcontent[i].style.display = "none";\n')
self.opened_file.write(' }\n')
self.opened_file.write('\n')
self.opened_file.write(' // Remove the background color of all tablinks/buttons\n')
self.opened_file.write(' tablinks = document.getElementsByClassName("tablink");\n')
self.opened_file.write(' for (i = 0; i < tablinks.length; i++) {\n')
self.opened_file.write(' tablinks[i].style.backgroundColor = "";\n')
self.opened_file.write(' }\n')
self.opened_file.write('\n')
self.opened_file.write(' // Show the specific tab content\n')
self.opened_file.write(' document.getElementById(Name).style.display = "block";\n')
self.opened_file.write('\n')
self.opened_file.write(' // Add the specific color to the button used to open the tab content\n')
self.opened_file.write(' elmnt.style.backgroundColor = \'white\';\n')
self.opened_file.write(' elmnt.style.color = "black";\n')
self.opened_file.write('}\n')
self.opened_file.write('\n')
self.opened_file.write('// Get the element with id="defaultOpen" and click on it\n')
self.opened_file.write('document.getElementById("defaultOpen").click();\n')
self.opened_file.write('</SCRIPT>\n')
else:
self.opened_file.write('<SCRIPT TYPE="text/javascript">\n')
self.opened_file.write(' // display all elements with class="tabcontent" by default */\n')
self.opened_file.write(' var i, tabcontent, tablinks;\n')
self.opened_file.write(' tabcontent = document.getElementsByClassName("tabcontent");\n')
self.opened_file.write(' for (i = 0; i < tabcontent.length; i++) {\n')
self.opened_file.write(' tabcontent[i].style.display = "block";\n')
self.opened_file.write(' }\n')
self.opened_file.write('\n')
self.opened_file.write('</SCRIPT>\n')
self.opened_file.write("</BODY>\n")
def findWholeWord(w):
return re.compile(r'\b({0})\b'.format(w), flags=re.IGNORECASE).search
def generate_spdx_license_sheet(html):
SRC_DISTRIBUTE_LICENSES = ""
SRC_DISTRIBUTE_LICENSES += "0BSD"
SRC_DISTRIBUTE_LICENSES += "AAL Abstyles Adobe Adobe-2006 Adobe-Glyph ADSL"
SRC_DISTRIBUTE_LICENSES += "AFL-1.1 AFL-1.2 AFL-2.0 AFL-2.1 AFL-3.0"
SRC_DISTRIBUTE_LICENSES += "Afmparse AGPL-1.0-only AGPL-1.0-or-later AGPL-3.0-only "
SRC_DISTRIBUTE_LICENSES += "AGPL-3.0-or-later Aladdin AMDPLPA AML AMPAS ANTLR-PD"
SRC_DISTRIBUTE_LICENSES += "ANTLR-PD-fallback Apache-1.0 Apache-1.1 Apache-2.0"
SRC_DISTRIBUTE_LICENSES += "Apache-2.0-with-LLVM-exception APAFML APL-1.0 APSL-1.0"
SRC_DISTRIBUTE_LICENSES += "APSL-1.1 APSL-1.2 APSL-2.0"
SRC_DISTRIBUTE_LICENSES += "Artistic-1.0 Artistic-1.0-cl8 Artistic-1.0-Perl Artistic-2.0"
SRC_DISTRIBUTE_LICENSES += "Bahyph Barr Beerware BitstreamVera BitTorrent-1.0 BitTorrent-1.1"
SRC_DISTRIBUTE_LICENSES += "blessing BlueOak-1.0.0 Borceux BSD-1-Clause BSD-2-Clause "
SRC_DISTRIBUTE_LICENSES += "BSD-2-Clause-Patent BSD-2-Clause-Views BSD-3-Clause "
SRC_DISTRIBUTE_LICENSES += "BSD-3-Clause-Attribution BSD-3-Clause-Clear BSD-3-Clause-LBNL"
SRC_DISTRIBUTE_LICENSES += "BSD-3-Clause-Modification BSD-3-Clause-No-Military-License "
SRC_DISTRIBUTE_LICENSES += "BSD-3-Clause-No-Nuclear-License BSD-3-Clause-No-Nuclear-License-2014"
SRC_DISTRIBUTE_LICENSES += "BSD-3-Clause-No-Nuclear-Warranty BSD-3-Clause-Open-MPI"
SRC_DISTRIBUTE_LICENSES += "BSD-4-Clause BSD-4-Clause-Shortened BSD-4-Clause-UC"
SRC_DISTRIBUTE_LICENSES += "BSD-Protection BSD-Source-Code"
SRC_DISTRIBUTE_LICENSES += "BSL-1.0 BUSL-1.1 bzip2-1.0.4 bzip2-1.0.5 bzip2-1.0.6"
SRC_DISTRIBUTE_LICENSES += "CAL-1.0 CAL-1.0-Combined-Work-Exception Caldera CATOSL-1.1"
SRC_DISTRIBUTE_LICENSES += "CC0-1.0 CC-BY-1.0 CC-BY-2.0 CC-BY-2.5 CC-BY-2.5-AU CC-BY-3.0"
SRC_DISTRIBUTE_LICENSES += "CC-BY-3.0-AT CC-BY-3.0-DE CC-BY-3.0-NL CC-BY-3.0-US CC-BY-4.0"
SRC_DISTRIBUTE_LICENSES += "CC-BY-NC-1.0 CC-BY-NC-2.0 CC-BY-NC-2.5 CC-BY-NC-3.0 "
SRC_DISTRIBUTE_LICENSES += "CC-BY-NC-3.0-DE CC-BY-NC-4.0 CC-BY-NC-ND-1.0 CC-BY-NC-ND-2.0"
SRC_DISTRIBUTE_LICENSES += "CC-BY-NC-ND-2.5 CC-BY-NC-ND-3.0 CC-BY-NC-ND-3.0-DE "
SRC_DISTRIBUTE_LICENSES += "CC-BY-NC-ND-3.0-IGO CC-BY-NC-ND-4.0 CC-BY-NC-SA-1.0"
SRC_DISTRIBUTE_LICENSES += "CC-BY-NC-SA-2.0 CC-BY-NC-SA-2.0-FR CC-BY-NC-SA-2.0-UK"
SRC_DISTRIBUTE_LICENSES += "CC-BY-NC-SA-2.5 CC-BY-NC-SA-3.0 CC-BY-NC-SA-3.0-DE "
SRC_DISTRIBUTE_LICENSES += "CC-BY-NC-SA-3.0-IGO CC-BY-NC-SA-4.0 CC-BY-ND-1.0"
SRC_DISTRIBUTE_LICENSES += "CC-BY-ND-2.0 CC-BY-ND-2.5 CC-BY-ND-3.0 CC-BY-ND-3.0-DE "
SRC_DISTRIBUTE_LICENSES += "CC-BY-ND-4.0 CC-BY-SA-1.0 CC-BY-SA-2.0 CC-BY-SA-2.0-UK"
SRC_DISTRIBUTE_LICENSES += "CC-BY-SA-2.1-JP CC-BY-SA-2.5 CC-BY-SA-3.0 CC-BY-SA-3.0-AT"
SRC_DISTRIBUTE_LICENSES += "CC-BY-SA-3.0-DE CC-BY-SA-4.0 CC-PDDC CDDL-1.0 CDDL-1.1"
SRC_DISTRIBUTE_LICENSES += "CDL-1.0 CDLA-Permissive-1.0 CDLA-Permissive-2.0 CDLA-Sharing-1.0"
SRC_DISTRIBUTE_LICENSES += "CECILL-1.0 CECILL-1.1 CECILL-2.0 CECILL-2.1 CECILL-B CECILL-C"
SRC_DISTRIBUTE_LICENSES += "CERN-OHL-1.1 CERN-OHL-1.2 CERN-OHL-P-2.0 CERN-OHL-S-2.0 CERN-OHL-W-2.0"
SRC_DISTRIBUTE_LICENSES += "ClArtistic CNRI-Jython CNRI-Python CNRI-Python-GPL-Compatible"
SRC_DISTRIBUTE_LICENSES += "Condor-1.1 copyleft-next-0.3.0 copyleft-next-0.3.1 CPAL-1.0"
SRC_DISTRIBUTE_LICENSES += "CPL-1.0 CPOL-1.02 Crossword CrystalStacker CUA-OPL-1.0 Cube"
SRC_DISTRIBUTE_LICENSES += "C-UDA-1.0 curl D-FSL-1.0 diffmark DOC Dotseqn DRL-1.0 DSDP"
SRC_DISTRIBUTE_LICENSES += "DSSSL dvipdfm ECL-1.0 ECL-2.0 eCos-2.0 EDL-1.0 EFL-1.0"
SRC_DISTRIBUTE_LICENSES += "EFL-2.0 eGenix Entessa EPICS EPL-1.0 EPL-2.0 ErlPL-1.1 etalab-2.0"
SRC_DISTRIBUTE_LICENSES += "EUDatagrid EUPL-1.0 EUPL-1.1 EUPL-1.2 urosym Fair Frameworx-1.0"
SRC_DISTRIBUTE_LICENSES += "FreeBSD-DOC FreeImage FSFAP FSFUL FSFULLR FSF-Unlimited"
SRC_DISTRIBUTE_LICENSES += "FTL GD GFDL-1.1 GFDL-1.1-invariants-only GFDL-1.1-invariants-or-later"
SRC_DISTRIBUTE_LICENSES += "GFDL-1.1-no-invariants-only GFDL-1.1-no-invariants-or-later"
SRC_DISTRIBUTE_LICENSES += "GFDL-1.1-only GFDL-1.1-or-later GFDL-1.2 GFDL-1.2-invariants-only"
SRC_DISTRIBUTE_LICENSES += "GFDL-1.2-invariants-or-later GFDL-1.2-no-invariants-only"
SRC_DISTRIBUTE_LICENSES += "GFDL-1.2-no-invariants-or-later GFDL-1.2-only GFDL-1.2-or-later"
SRC_DISTRIBUTE_LICENSES += "GFDL-1.3 GFDL-1.3-invariants-only GFDL-1.3-invariants-or-later"
SRC_DISTRIBUTE_LICENSES += "GFDL-1.3-no-invariants-only GFDL-1.3-no-invariants-or-later"
SRC_DISTRIBUTE_LICENSES += "GFDL-1.3-only GFDL-1.3-or-later Giftware GL2PS Glide Glulxe"
SRC_DISTRIBUTE_LICENSES += "GLWTPL gnuplot GPL-1.0-only GPL-1.0-or-later GPL-2.0-only"
SRC_DISTRIBUTE_LICENSES += "GPL-2.0-or-later GPL-2.0-with-autoconf-exception "
SRC_DISTRIBUTE_LICENSES += "GPL-2.0-with-classpath-exception GPL-2.0-with-font-exception"
SRC_DISTRIBUTE_LICENSES += " GPL-2.0-with-GCC-exception GPL-2.0-with-OpenSSL-exception"
SRC_DISTRIBUTE_LICENSES += "GPL-2-with-bison-exception GPL-3.0-only GPL-3.0-or-later"
SRC_DISTRIBUTE_LICENSES += "GPL-3.0-with-autoconf-exception GPL-3.0-with-GCC-exception"
SRC_DISTRIBUTE_LICENSES += "GPL-3-with-bison-exception gSOAP-1 gSOAP-1.3b HaskellReport"
SRC_DISTRIBUTE_LICENSES += "Hippocratic-2.1 HPND HPND-sell-variant HTMLTIDY IBM-pibs"
SRC_DISTRIBUTE_LICENSES += "ICU IJG ImageMagick iMatix Imlib2 Info-ZIP Intel Intel-ACPI"
SRC_DISTRIBUTE_LICENSES += "Interbase-1.0 IPA IPL-1.0 ISC JasPer-2.0 JPNIC JSON"
SRC_DISTRIBUTE_LICENSES += "LAL-1.2 LAL-1.3 Latex2e Leptonica LGPL-2.0-only"
SRC_DISTRIBUTE_LICENSES += "LGPL-2.0-or-later LGPL-2.1-only LGPL-2.1-or-later LGPL-3.0-only"
SRC_DISTRIBUTE_LICENSES += "LGPL-3.0-or-later LGPLLR Libpng libpng-2.0 libselinux-1.0 libtiff"
SRC_DISTRIBUTE_LICENSES += "LiLiQ-P-1.1 LiLiQ-R-1.1 LiLiQ-Rplus-1.1 Linux-OpenIB"
SRC_DISTRIBUTE_LICENSES += "LPL-1.0 LPL-1.02 LPPL-1.0 LPPL-1.1 LPPL-1.2 LPPL-1.3a LPPL-1.3c"
SRC_DISTRIBUTE_LICENSES += "MakeIndex MirOS MIT MIT-0 MIT-advertising MIT-CMU MIT-enna"
SRC_DISTRIBUTE_LICENSES += "MIT-feh MIT-Modern-Variant MITNFA MIT-open-group Motosoto"
SRC_DISTRIBUTE_LICENSES += "mpich2 MPL-1.0 MPL-1.1 MPL-2.0 MPL-2.0-no-copyleft-exception"
SRC_DISTRIBUTE_LICENSES += "MS-PL MS-RL MTLL MulanPSL-1.0 MulanPSL-2.0 Multics Mup"
SRC_DISTRIBUTE_LICENSES += "NAIST-2003 NASA-1.3 Naumen NBPL-1.0 NCGL-UK-2.0 NCSA NetCDF"
SRC_DISTRIBUTE_LICENSES += "Net-SNMP Newsletr NGPL NIST-PD NIST-PD-fallback NLOD-1.0"
SRC_DISTRIBUTE_LICENSES += "NLOD-2.0 NLPL Nokia NOSL Noweb NPL-1.0 NPL-1.1 NPOSL-3.0"
SRC_DISTRIBUTE_LICENSES += "NRL NTP NTP-0 OASIS OCCT-PL OCLC-2.0 ODbL-1.0 ODC-By-1.0"
SRC_DISTRIBUTE_LICENSES += "OFL-1.0 OFL-1.0-no-RFN OFL-1.0-RFN OFL-1.1 OFL-1.1-no-RFN"
SRC_DISTRIBUTE_LICENSES += "OFL-1.1-RFN OGC-1.0 OGDL-Taiwan-1.0 OGL-Canada-2.0 OGL-UK-1.0"
SRC_DISTRIBUTE_LICENSES += "OGL-UK-2.0 OGL-UK-3.0 OGTSL OLDAP-1.1 OLDAP-1.2 OLDAP-1.3"
SRC_DISTRIBUTE_LICENSES += "OLDAP-1.4 OLDAP-2.0 OLDAP-2.0.1 OLDAP-2.1 OLDAP-2.2 OLDAP-2.2.1"
SRC_DISTRIBUTE_LICENSES += "OLDAP-2.2.2 OLDAP-2.3 OLDAP-2.4 OLDAP-2.5 OLDAP-2.6 OLDAP-2.7"
SRC_DISTRIBUTE_LICENSES += "OLDAP-2.8 OML OpenSSL OPL-1.0 OPUBL-1.0 OSET-PL-2.1 OSL-1.0"
SRC_DISTRIBUTE_LICENSES += "OSL-1.1 OSL-2.0 OSL-2.1 OSL-3.0 O-UDA-1.0 ParaTypeFFL-1.3"
SRC_DISTRIBUTE_LICENSES += "Parity-6.0.0 Parity-7.0.0 PD PDDL-1.0 PHP-3.0 PHP-3.01 pkgconf"
SRC_DISTRIBUTE_LICENSES += "Plexus PolyForm-Noncommercial-1.0.0 PolyForm-Small-Business-1.0.0"
SRC_DISTRIBUTE_LICENSES += "PostgreSQL Proprietary PSF-2.0 psfrag psutils Python-2.0"
SRC_DISTRIBUTE_LICENSES += "Qhull QPL-1.0 Rdisc RHeCos-1 RHeCos-1.1 RPL-1.1 RPL-1.5"
SRC_DISTRIBUTE_LICENSES += "RPSL-1.0 RSA-MD RSCPL Ruby Saxpath SAX-PD SCEA Sendmail"
SRC_DISTRIBUTE_LICENSES += "Sendmail-8.23 SGI-1 SGI-B-1.0 SGI-B-1.1 SGI-B-2.0 SHL-0.5"
SRC_DISTRIBUTE_LICENSES += "SHL-0.51 SimPL-2.0 Simple-2.0 SISSL SISSL-1.2 Sleepycat"
SRC_DISTRIBUTE_LICENSES += "SMAIL_GPL SMLNJ SMPPL SNIA Spencer-86 Spencer-94 Spencer-99"
SRC_DISTRIBUTE_LICENSES += "SPL-1.0 SSH-OpenSSH SSH-short SSPL-1.0 SugarCRM-1 SugarCRM-1.1.3"
SRC_DISTRIBUTE_LICENSES += "SWL TAPR-OHL-1.0 TCL TCP-wrappers TMate TORQUE-1.1 TOSL"
SRC_DISTRIBUTE_LICENSES += "TU-Berlin-1.0 TU-Berlin-2.0 UCB UCL-1.0 unfs3 Unicode-DFS-2015"
SRC_DISTRIBUTE_LICENSES += "Unicode-DFS-2016 Unicode-TOU Unlicense UPL-1.0 Vim VOSTROM"
SRC_DISTRIBUTE_LICENSES += "VSL-1.0 W3C W3C-19980720 W3C-20150513 Watcom-1.0 Wsuipa"
SRC_DISTRIBUTE_LICENSES += "WTFPL WXwindows X11 Xerox XFree86-1.0 Free86-1.1 xinetd"
SRC_DISTRIBUTE_LICENSES += "Xnet xpp XSkat XSL YPL-1.0 YPL-1.1 Zed Zend-2.0 Zimbra-1.3"
SRC_DISTRIBUTE_LICENSES += "Zimbra-1.4 Zlib zlib-acknowledgement ZPL-1.1 ZPL-2.0 ZPL-2.1"
html.startDiv("OE_SPDX_LICENSE", "OE SPDX LICENSE")
html.addAnchor("OE_SPDX_LICENSE")
html.addContent("Openembedded validate the License with the SPDX license list. ")
html.addNewLine()
html.addContent("How Openembedded validate an License indicated on a package:")
html.addNewLine()
html.startBlock()
html.addContent(" - remove all information after the last + on license( ex.: LGPLv2.1+ become GPLv2.1)")
html.addNewLine()
html.addContent(" - translate license with SPDX table: (LGPLV2.1 become LGPL-2.1)")
html.addNewLine()
html.addContent(" - verification with official list of license")
html.addNewLine()
html.stopBlock()
html.startTable()
html.startRow()
html.addColumnHeaderContent("Official licenses used by Openembedded", html.bold)
html.addColumnHeaderContent("Link to text of license", html.bold)
html.stopRow()
for lic in SRC_DISTRIBUTE_LICENSES.split(' '):
html.startRow()
html.addColumnContent(lic)
html.addColumnURLOUTContent('['+lic+']', "http://git.openembedded.org/openembedded-core/tree/meta/files/common-licenses/" + lic )
html.stopRow()
html.stopTable()
html.addNewLine()
html.addNewLine()
html.addNewLine()
html.addContent("Information extracted from:")
html.addNewLine()
html.addURLContent("http://git.openembedded.org/openembedded-core/tree/meta/conf/licenses.conf", "http://git.openembedded.org/openembedded-core/tree/meta/conf/licenses.conf")
html.addNewLine()
html.addContent("All Text of License are available:")
html.addNewLine()
html.addURLContent("http://git.openembedded.org/openembedded-core/tree/meta/files/common-licenses", "http://git.openembedded.org/openembedded-core/tree/meta/files/common-licenses")
html.addNewLine()
html.stopDiv()
def generate_introduction_sheet(html):
general_MACHINE = d.getVar("MACHINE")
general_DISTRO = d.getVar("DISTRO")
general_DISTRO_VERSION = d.getVar("DISTRO_VERSION")
general_DISTRO_CODENAME = d.getVar("DISTRO_CODENAME")
html.startDiv("introduction", "")
html.addAnchor("introduction")
html.startTable()
# Machine
html.startRow()
html.addColumnContent("MACHINE", html.bold)
html.addColumnContent(general_MACHINE)
html.stopRow()
# Image
html.startRow()
html.addColumnContent("SDK", html.bold)
html.addColumnContent(ref_sdk_name_full)
html.stopRow()
# DISTRO
html.startRow()
html.addColumnContent("DISTRO", html.bold)
html.addColumnContent(general_DISTRO)
html.stopRow()
# DISTRO VERSION
html.startRow()
html.addColumnContent("VERSION", html.bold)
html.addColumnContent(general_DISTRO_VERSION)
html.stopRow()
# DISTRO CODENAME
html.startRow()
html.addColumnContent("OE branch", html.bold)
html.addColumnContent(general_DISTRO_CODENAME)
html.stopRow()
html.stopTable()
html.addNewLine()
html.addNewLine()
license_file_to_read = os.path.join(temp_deploy_sdk_dir, "%s.license" % ref_sdk_name_full)
contents = private_open(license_file_to_read)
html.startTable()
html.startRow()
html.addColumnHeaderContent("License", html.bold)
html.stopRow()
html.startRow()
html.startColumn()
for l in contents:
if len(l.rstrip('\n')) > 0:
html.addContent(l.rstrip('\n'))
html.addNewLine()
else:
html.addNewLine()
html.stopColumn()
html.stopRow()
html.stopTable()
html.stopDiv()
def generate_image_content_sheet(html):
html.startDiv("sdk_content", "SDK content")
html.addAnchor("sdk_content")
# boot binaries
for img in image_list_arrray:
_info_text = img[0]
_info_type = img[1]
_info_file = img[2]
html.startTable()
html.startRow()
html.addColumnHeaderContent("SDK name (%s part):" % _info_type, html.bold)
html.addColumnHeaderContent(ref_sdk_name_full)
html.stopRow()
html.stopTable()
html.addNewLine()
html.addContent(_info_text)
html.addNewLine()
file_to_read = temp_deploy_sdk_dir + "/" + _info_file
contents = private_open(file_to_read)
html.addAnchor("%s_binaries"% _info_type)
html.startTable()
html.startRow()
html.addColumnHeaderContent("Recipe Name", html.bold)
html.addColumnHeaderContent("Package Name", html.bold)
html.addColumnHeaderContent("Version", html.bold)
html.addColumnHeaderContent("License", html.bold)
html.addColumnHeaderContent("Description", html.bold)
html.stopRow()
for p in contents:
package_license = ""
package_recipe = None
package_name = p.split('\n')[0].split(' ')[0]
package_version = None
package_description = None
package_summary = None
if _info_type.startswith("host"):
package_file = pkgdata_host_dir + "/runtime-reverse/" + package_name
else:
package_file = pkgdata_dir + "/runtime-reverse/" + package_name
package_file_content = private_open(package_file)
if len(package_file_content) == 0:
package_file = pkgdata_dir + "/runtime-reverse/" + package_name
package_file_content = private_open(package_file)
r = re.compile(r"(^.+?):\s+(.*)")
for line in package_file_content:
m = r.match(line)
if m:
if m.group(1) == "PN":
package_recipe = m.group(2)
elif m.group(1).startswith("LICENSE"):
package_license = m.group(2)
elif m.group(1) == "PV":
package_version = m.group(2)
elif m.group(1).startswith("DESCRIPTION"):
package_description = m.group(2)
elif m.group(1).startswith("SUMMARY"):
package_summary = m.group(2)
if findWholeWord("GPLv3")(package_license):
style = html.red
style_wrapped = html.wrap_red_format
else:
style = None
style_wrapped = None
html.startRow(style)
if package_recipe:
html.addColumnContent(package_recipe, style)
else:
html.addColumnContent("", style)
if package_name:
html.addColumnContent(package_name, style)
else:
html.addColumnContent("", style)
if package_version:
html.addColumnContent(package_version, style)
else:
html.addColumnContent("", style)
if package_license:
html.addColumnContent(package_license, style)
else:
html.addColumnContent("", style)
if package_summary:
html.addColumnContent(package_summary, style_wrapped)
else:
if package_description:
html.addColumnContent(package_description, style_wrapped)
else:
html.addColumnContent("", style)
html.stopRow()
package_license = None
package_parent = None
package_name = None
package_version = None
package_description = None
package_summary = None
html.stopTable()
html.addNewLine()
html.addNewLine()
html.stopDiv()
summary_file = os.path.join(temp_deploy_sdk_dir, "%s-license_content.html" % ref_sdk_name_full)
# bb.warn("file generated %s" % (summary_file))
html = HTMLSummaryfile()
html.openfile(summary_file)
html.beginHtml()
html.beginBody(with_tab)
''' generate first page: general information + license text '''
generate_introduction_sheet(html)
''' generate image content '''
generate_image_content_sheet(html)
''' generate license spdx reference '''
generate_spdx_license_sheet(html)
html.endBody(with_tab)
html.endHtml()
html.closefile()
SDK_POSTPROCESS_COMMAND:append = "do_write_sdk_license_create_summary;"

View File

@@ -0,0 +1,27 @@
#@DESCRIPTION: ST GPLv3 exception
#--------------------------
# License settings
#
# We dont want (L)GPL-3.0+
INCOMPATIBLE_LICENSE = "GPLv3.0 GPLv3 GPL-3.0 GPLv3+ LGPLv3.0 LGPLv3 LGPL-3.0 LGPLv3+"
OPENSTLINUX_ALLOW_GPLv3 = "gettext"
# for alsa-utils:
OPENSTLINUX_ALLOW_GPLv3 =+ " gettext bash "
# for systemd
OPENSTLINUX_ALLOW_GPLv3 =+ " bash readline "
# for udev:
OPENSTLINUX_ALLOW_GPLv3 =+ " gawk coreutils gdbm m4 "
# for bluez
OPENSTLINUX_ALLOW_GPLv3 =+ " python3-pycairo "
# for framework-tools-ui
OPENSTLINUX_ALLOW_GPLv3 =+ " grep dosfstools elfutils cpio gzip which "
OPENSTLINUX_ALLOW_GPLv3 += "${@bb.utils.contains('DISTRO_FEATURES', 'tpm', 'nano msmtp', '', d)}"
INCOMPATIBLE_LICENSE_EXCEPTIONS:LGPL-3.0-or-later = "${OPENSTLINUX_ALLOW_GPLv3}"
INCOMPATIBLE_LICENSE_EXCEPTIONS:LGPL-3.0-only = "${OPENSTLINUX_ALLOW_GPLv3}"
INCOMPATIBLE_LICENSE_EXCEPTIONS:GPL-3.0-only = "${OPENSTLINUX_ALLOW_GPLv3}"
INCOMPATIBLE_LICENSE_EXCEPTIONS:GPL-3.0-or-later = "${OPENSTLINUX_ALLOW_GPLv3}"

View File

@@ -0,0 +1,32 @@
#@DESCRIPTION: openstlinux default distro naming
# Init OPENSTLINUX_RELEASE flag to snapshot
OPENSTLINUX_RELEASE ??= "snapshot"
DISTRO = "openstlinux"
DISTRO_NAME = "ST OpenSTLinux (A Yocto Project Based Distro)"
DISTRO_VERSION = "4.2.2-${@bb.utils.contains('OPENSTLINUX_RELEASE', 'snapshot', 'snapshot-${DATE}', '${OPENSTLINUX_RELEASE}', d)}"
# Don't include the DATE variable in the sstate package signatures
DISTRO_VERSION[vardepsexclude] = "DATE"
DISTRO_CODENAME = "mickledore"
# Warning: SDK_VENDOR does not contains a valid OS/ARCH name like : linux, arm
SDK_VENDOR = "-ostl_sdk"
SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}"
# Don't include the DATE variable in the sstate package signatures
SDK_VERSION[vardepsexclude] = "DATE"
MAINTAINER = "Christophe Priouzeau <christophe.priouzeau@st.com>"
# Warning: TARGET_VENDOR does not contains a valid OS/ARCH name like : linux, arm
STM32MP_TARGETVENDOR ?= "-ostl"
TARGET_VENDOR = "${STM32MP_TARGETVENDOR}"
# Append distro name to each image name
IMAGE_BASENAME:append = "-${DISTRO}"
# Add image name for generated SDK and set default SDK install folder
SDK_NAME = "${IMAGE_LINK_NAME}-${SDK_ARCH}"
SDKPATHINSTALL = "/opt/st/${MACHINE}/${SDK_VERSION}"
# Don't include the DATE variable in the sstate package signatures
SDKPATHINSTALL[vardepsexclude] = "DATE"

View File

@@ -0,0 +1,110 @@
# Distribution definition for openstlinux
# from dev manual:
# Your configuration file needs to set the following variables:
#
# DISTRO_NAME [required]
# DISTRO_VERSION [required]
# DISTRO_FEATURES [required if creating from scratch]
# DISTRO_EXTRA_RDEPENDS [optional]
# DISTRO_EXTRA_RRECOMMENDS [optional]
# TCLIBC [required if creating from scratch]
LOCALCONF_VERSION = "2"
LAYER_CONF_VERSION ?= "7"
# =========================================================================
# Set default distro naming
# =========================================================================
require openstlinux-default-naming.inc
# =========================================================================
# Enable uninative support
# =========================================================================
require conf/distro/include/no-static-libs.inc
require conf/distro/include/yocto-uninative.inc
INHERIT += "uninative"
# =========================================================================
# DISTRO features
# =========================================================================
DISTRO_FEATURES = "alsa"
DISTRO_FEATURES += "argp"
DISTRO_FEATURES += "ext2"
DISTRO_FEATURES += "ext4"
DISTRO_FEATURES += "largefile"
DISTRO_FEATURES += "ipv4"
DISTRO_FEATURES += "ipv6"
DISTRO_FEATURES += "multiarch"
DISTRO_FEATURES += "pci"
DISTRO_FEATURES += "wifi"
DISTRO_FEATURES += "nfs"
DISTRO_FEATURES += "usbgadget"
DISTRO_FEATURES += "usbhost"
DISTRO_FEATURES += "xattr"
DISTRO_FEATURES += "zeroconf"
DISTRO_FEATURES += "bluetooth"
DISTRO_FEATURES += "bluez5"
# add support of gstreamer
DISTRO_FEATURES:append = " gstreamer "
# add support of optee
DISTRO_FEATURES:append = " optee "
# add support of splashscreen
DISTRO_FEATURES:append = " splashscreen "
# add support of wayland
DISTRO_FEATURES:append = " wayland pam "
# add support of X11
DISTRO_FEATURES:append = " x11 "
# add support of KDE (since OE thud version)
DISTRO_FEATURES:append = " kde "
# add support of systemd
DISTRO_FEATURES:append = " systemd "
# add support of efi
DISTRO_FEATURES:append = " efi "
# add support of InitRD installation package
DISTRO_FEATURES:append = " initrd "
# add support of autoresize through InitRD
DISTRO_FEATURES:append = " autoresize "
# add support of tpm2
#DISTRO_FEATURES:append = " tpm2 "
# Disabling pulseaudio
#DISTRO_FEATURES_BACKFILL_CONSIDERED += "pulseaudio"
DISTRO_FEATURES:append = "pulseaudio"
# Disabling sysvinit
DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"
VIRTUAL-RUNTIME_init_manager = "systemd"
VIRTUAL-RUNTIME_initscripts = "systemd-compat-units"
# =========================================================================
# Preferred version
# =========================================================================
# v4l-utils
#PREFERRED_VERSION_v4l-utils ?= "1.6.2"
# =========================================================================
# IMAGE addons
# =========================================================================
IMAGE_LINGUAS = "en-us en-gb"
LICENSE_FLAGS_ACCEPTED += " non-commercial commercial"
# X11 addons
DISTRO_EXTRA_RDEPENDS:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xf86-video-modesetting', '', d)} "
# INITRD addons to image
DISTRO_EXTRA_RRECOMMENDS:append = " ${@bb.utils.contains('COMBINED_FEATURES', 'initrd', '${INITRD_PACKAGE}', '', d)} "

View File

@@ -0,0 +1,16 @@
#@DESCRIPTION: ST default distro providers
PREFERRED_PROVIDER_libevent = "libevent-fb"
PREFERRED_PROVIDER_jpeg = "libjpeg-turbo"
PREFERRED_PROVIDER_jpeg-native = "libjpeg-turbo-native"
#--------------------------
# Preferred provider
# for openvt tools
PREFERRED_PROVIDER_console-tools = "kbd"
#--------------------------
# Preferred provider
# splash
SPLASH = "${@bb.utils.contains('COMBINED_FEATURES', 'splashscreen', 'psplash-drm', '', d)}"
PREFERRED_PROVIDER_virtual/psplash = "${@bb.utils.contains('COMBINED_FEATURES', 'splashscreen', 'psplash-drm', '', d)}"

View File

@@ -0,0 +1,61 @@
#@DESCRIPTION: ST default distro rules
# Set common distrooverrides for all ST distro
DISTROOVERRIDES =. "openstlinuxcommon:"
#--------------------------
# Mirror settings
#
YOCTOPROJECT_MIRROR_URL = "http://downloads.yoctoproject.org/mirror/sources/"
MIRRORS =+ "\
ftp://.*/.* ${YOCTOPROJECT_MIRROR_URL} \n \
http://.*/.* ${YOCTOPROJECT_MIRROR_URL} \n \
https://.*/.* ${YOCTOPROJECT_MIRROR_URL} \n"
INHERIT += "own-mirrors"
SOURCE_MIRROR_URL ??= "${YOCTOPROJECT_MIRROR_URL}"
#--------------------------
# The CONNECTIVITY_CHECK_URI's are used to test whether we can succesfully
# fetch from the network (and warn you if not).
# URI's to check can be set in the CONNECTIVITY_CHECK_URIS variable
# using the same syntax as for SRC_URI. If the variable is not set
# the check is skipped
#
CONNECTIVITY_CHECK_URIS ?= "https://www.example.com/"
#--------------------------
# OELAYOUT_ABI allows us to notify users when the format of TMPDIR changes in
# an incompatible way. Such changes should usually be detailed in the commit
# that breaks the format and have been previously discussed on the mailing list
# with general agreement from the core team.
#
OELAYOUT_ABI = "12"
#--------------------------
# Add the manifest and the licenses file on image generated
COPY_LIC_MANIFEST = "1"
#--------------------------
# Configure InitRD image installation package
INITRD_PACKAGE = "st-initrd"
# Init default InitRD image to ST resize image
INITRD_IMAGE ?= "${@bb.utils.contains('COMBINED_FEATURES', 'autoresize', 'st-image-resize-initrd', '', d)}"
#--------------------------
# Tune build config display
#
BUILDCFG_VARS += "DISTRO_CODENAME"
BUILDCFG_VARS += "${@'ACCEPT_EULA_' + d.getVar('MACHINE')}"
BUILDCFG_VARS += "GCCVERSION"
BUILDCFG_VARS += "PREFERRED_PROVIDER_virtual/kernel"
#--------------------------
# Configure build info file for rootfs availability
#
DISTRO_EXTRA_RDEPENDS:append = " build-info-openstlinux "
# Set IMAGE_BUILDINFO_FILE to configure the expected file name
IMAGE_BUILDINFO_FILE ?= "${sysconfdir}/build"
# Avoid conflict with image-buildinfo class that may feed same file on rootfs
INHERIT:remove = "${@bb.utils.contains('DISTRO_EXTRA_RDEPENDS', 'build-info-openstlinux', 'image-buildinfo', '', d)}"

View File

@@ -0,0 +1,23 @@
#@NAME: openstlinux-eglfs
#@DESCRIPTION: OpenSTLinux featuring eglfs - no X11, no Wayland (with GPLv3 software)
require include/st-default-distro-rules.inc
require include/st-default-distro-providers.inc
require include/openstlinux.inc
# =========================================================================
# Distribution definition for: st-openstlinux-eglfs
# =========================================================================
DISTRO = "openstlinux-eglfs"
DISTRO_NAME = "ST OpenSTLinux - EGLfs - (A Yocto Project Based Distro)"
# =========================================================================
# DISTRO features
# =========================================================================
DISTRO_FEATURES:append = " opengl "
DISTRO_FEATURES:remove = " wayland x11 "
DISTRO_FEATURES:append = " gplv3 "
# FOR QT5 FORCE GIT PROTOCOL FOR HTTPS
#QT_GIT_PROTOCOL = "https"

View File

@@ -0,0 +1,22 @@
#@NAME: openstlinux-weston
#@DESCRIPTION: OpenSTLinux featuring Weston/Wayland (with GPLv3 software)
require include/st-default-distro-rules.inc
require include/st-default-distro-providers.inc
require include/openstlinux.inc
# =========================================================================
# Distribution definition for: st-openstlinux-weston-
# =========================================================================
DISTRO = "openstlinux-weston"
DISTRO_NAME = "ST OpenSTLinux - Weston - (A Yocto Project Based Distro)"
# =========================================================================
# DISTRO features
# =========================================================================
DISTRO_FEATURES:append = " opengl"
DISTRO_FEATURES:remove = " x11 "
# with X11
#PREFERRED_PROVIDER_virtual/xserver = "${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', 'xserver-xorg', d)}"
DISTRO_FEATURES:append = " gplv3 "

View File

@@ -0,0 +1,44 @@
# Distro Layer configuration
# include and overwrite default poky distro
#@NAME: vrmpdv
#@DESCRIPTION: OpenSTLinux featuring vrpm Device - no X11, no Wayland
# require conf/distro/poky.conf
require include/st-default-distro-rules.inc
require include/st-default-distro-providers.inc
require include/openstlinux.inc
DISTRO = "vrmpdv"
DISTRO_NAME = "VRPMDV-Linux"
DISTRO_VERSION = "1.0"
# DISTRO_CODENAME = "VRMProot"
# SDK_VENDOR = "-golemossdk"
# SDK_VERSION="${DISTRO_VERSION}"
MAINTAINER = "markus@malehr.de"
TARGET_VENDOR = "-markuslehr"
DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"
VIRTUAL-RUNTIME_init_manager = "systemd"
VIRTUAL-RUNTIME_initscripts = "systemd-compat-units"
# Override these in poky based distros
# VRPMDV_WEB_DEFAULT_DISTRO_FEATURES = "systemd wifi"
VRPMDV_WEB_DEFAULT_EXTRA_RDEPENDS = "packagegroup-core-boot"
VRPMDV_WEB_DEFAULT_EXTRA_RRECOMMENDS = "kernel-module-af-packet"
DISTRO_EXTRA_RDEPENDS += " ${VRPMDV_WEB_DEFAULT_EXTRA_RDEPENDS}"
DISTRO_EXTRA_RRECOMMENDS += " ${VRPMDV_WEB_DEFAULT_EXTRA_RRECOMMENDS}"
# DISTRO_FEATURES ?= "${DISTRO_FEATURES ?= "${GOLEMOS_DEFAULT_DISTRO_FEATURES} ${DISTRO_FEATURES_LIBC} "_DEFAULT_DISTRO_FEATURES} ${DISTRO_FEATURES_LIBC} "
DISTRO_FEATURES ?= " ${DISTRO_FEATURES_LIBC} "
PACKAGE_CLASSES = "package_rpm"

View File

@@ -0,0 +1,23 @@
#@NAME: openstlinux-eglfs
#@DESCRIPTION: OpenSTLinux featuring eglfs - no X11, no Wayland (with GPLv3 software)
require include/st-default-distro-rules.inc
require include/st-default-distro-providers.inc
require include/openstlinux.inc
# =========================================================================
# Distribution definition for: st-openstlinux-eglfs
# =========================================================================
DISTRO = "vrpmdv1"
DISTRO_NAME = "ST OpenSTLinux - VR Predictive Maintenance Device - (A Yocto Project Based Distro)"
# =========================================================================
# DISTRO features
# =========================================================================
DISTRO_FEATURES:remove = " wayland x11 "
DISTRO_FEATURES:remove = " x11 "
DISTRO_FEATURES:append = " gplv3 "
# FOR QT5 FORCE GIT PROTOCOL FOR HTTPS
#QT_GIT_PROTOCOL = "https"

View File

@@ -0,0 +1,35 @@
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"
# We have a recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend \
"
# This folder should only contains specific patches to fix issue on oe recipes
# Note that these patches may be pushed on Community
BBFILES += "${LAYERDIR}/oe-core/recipes-*/*/*.bbappend"
# This folder should only contains direct backport from oe recipes
# These recipes may be suppress at next update on oe version
BBFILES += "${LAYERDIR}/oe-backport/recipes-*/*/*.bb \
${LAYERDIR}/oe-backport/recipes-*/*/*.bbappend \
"
BBFILE_COLLECTIONS += "st-openstlinux"
BBFILE_PATTERN_st-openstlinux := "^${LAYERDIR}/"
BBFILE_PRIORITY_st-openstlinux = "5"
LAYERDEPENDS_st-openstlinux = "qt5-layer"
# Set a variable to get the openstlinux location
OPENSTLINUX_BASE = "${LAYERDIR}"
# This should only be incremented on significant changes that will
# cause compatibility issues with other layers
LAYERVERSION_st-openstlinux = "1"
LAYERSERIES_COMPAT_st-openstlinux = "mickledore"
INHERIT += "check-st-openstlinux-compatibility"
# OpenSTLinux compatibility version
ST_OSTL_COMPATIBILITY_VERSION_st-openstlinux = "5.0"

View File

@@ -0,0 +1,69 @@
# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
LCONF_VERSION = "7"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
OEROOT := "${@os.path.abspath(os.path.dirname(d.getVar('FILE')) + '/../..')}"
#--------------------------
# Layers var definition for buildsystem
#
OPENEMBEDDED = "${OPENEMBEDDED_NON_REMOVABLE}"
OPENEMBEDDED_NON_REMOVABLE = "${OEROOT}/layers/openembedded-core/meta"
POKY = "${POKY_NON_REMOVABLE}"
POKY += "${OEROOT}/layers/poky/meta-yocto-bsp"
POKY_NON_REMOVABLE = "${OEROOT}/layers/poky/meta"
#--------------------------
#
BASELAYERS ?= " \
${OEROOT}/layers/meta-openembedded/meta-gnome \
${OEROOT}/layers/meta-openembedded/meta-initramfs \
${OEROOT}/layers/meta-openembedded/meta-multimedia \
${OEROOT}/layers/meta-openembedded/meta-networking \
${OEROOT}/layers/meta-openembedded/meta-webserver \
${OEROOT}/layers/meta-openembedded/meta-filesystems \
${OEROOT}/layers/meta-openembedded/meta-perl \
${OEROOT}/layers/meta-st-openstlinux/recipes-vrpmdv \
"
BBLAYERS_NON_REMOVABLE ?= " \
${@'${OPENEMBEDDED_NON_REMOVABLE}' if os.path.isfile('${OEROOT}/layers/openembedded-core/meta/conf/layer.conf') else '${POKY_NON_REMOVABLE}'} \
"
BSPLAYER ?= " \
${@'${OEROOT}/layers/meta-st/meta-st-cannes2' if os.path.isfile('${OEROOT}/layers/meta-st/meta-st-cannes2/conf/layer.conf') else ''} \
${@'${OEROOT}/layers/meta-st/meta-st-stm32mp' if os.path.isfile('${OEROOT}/layers/meta-st/meta-st-stm32mp/conf/layer.conf') else ''} \
"
ADDONSLAYERS = ""
# linaro
ADDONSLAYERS += "${@'${OEROOT}/layers/meta-linaro/meta-linaro' if os.path.isfile('${OEROOT}/layers/meta-linaro/meta-linaro/conf/layer.conf') else ''}"
ADDONSLAYERS += "${@'${OEROOT}/layers/meta-linaro/meta-linaro-toolchain' if os.path.isfile('${OEROOT}/layers/meta-linaro/meta-linaro-toolchain/conf/layer.conf') else ''}"
ADDONSLAYERS += "${@'${OEROOT}/layers/meta-openembedded/meta-networking' if os.path.isfile('${OEROOT}/layers/meta-linaro/meta-linaro/conf/layer.conf') else ''}"
# Qt5
ADDONSLAYERS += "${@'${OEROOT}/layers/meta-qt5' if os.path.isfile('${OEROOT}/layers/meta-qt5/conf/layer.conf') else ''}"
# Security layer
ADDONSLAYERS += " \
${@'${OEROOT}/layers/meta-security \
${OEROOT}/layers/meta-security/meta-tpm' \
if os.path.isfile('${OEROOT}/layers/meta-security/conf/layer.conf') else ''} \
"
# specific to framework
FRAMEWORKLAYERS += "${@'${OEROOT}/layers/meta-st/meta-st-openstlinux' if os.path.isfile('${OEROOT}/layers/meta-st/meta-st-openstlinux/conf/layer.conf') else ''}"
# add BSP layer
BBLAYERS += " \
${BASELAYERS} \
${BSPLAYER} \
${ADDONSLAYERS} \
${FRAMEWORKLAYERS} \
${@'${OPENEMBEDDED}' if os.path.isfile('${OEROOT}/layers/openembedded-core/meta/conf/layer.conf') else '${POKY}'} \
"

View File

@@ -0,0 +1,9 @@
Available images for OpenSTLinux layers are:
- Official OpenSTLinux images:
st-image-weston - OpenSTLinux weston image with basic Wayland support (if enable in distro)
- Other OpenSTLinux images:
- Supported images:
st-image-core - OpenSTLinux core image

View File

@@ -0,0 +1,318 @@
#
# This file is your local configuration file and is where all local user settings
# are placed. The comments in this file give some guide to the options a new user
# to the system might want to change but pretty much any configuration option can
# be set in this file. More adventurous users can look at
# local.conf.sample.extended which contains other examples of configuration which
# can be placed in this file but new users likely won't need any of them
# initially. There's also site.conf.sample which contains examples of site specific
# information such as proxy server addresses.
#
# Lines starting with the '#' character are commented out and in some cases the
# default values are provided as comments to show people example syntax. Enabling
# the option is a question of removing the # character and making any change to the
# variable as required.
#
# Machine Selection
#
# You need to select a specific machine to target the build with. There are a selection
# of emulated machines available which can boot and run in the QEMU emulator:
#
#MACHINE ?= "qemuarm"
#MACHINE ?= "qemuarm64"
#MACHINE ?= "qemumips"
#MACHINE ?= "qemumips64"
#MACHINE ?= "qemuppc"
#MACHINE ?= "qemux86"
#MACHINE ?= "qemux86-64"
#
# This sets the default machine to be qemux86-64 if no other machine is selected:
MACHINE ??= "qemux86-64"
# These are some of the more commonly used values. Looking at the files in the
# meta/conf/machine directory, or the conf/machine directory of any additional layers
# you add in will show all the available machines.
#
# Default policy config
#
# The distribution setting controls which policy settings are used as defaults.
# The default value is fine for general Yocto project use, at least initially.
# Ultimately when creating custom policy, people will likely end up subclassing
# these defaults.
#
# This sets the default distribution to be nodistro if no other distribution is selected:
DISTRO ??= "nodistro"
#
# Where to place downloads
#
# During a first build the system will download many different source code tarballs
# from various upstream projects. This can take a while, particularly if your network
# connection is slow. These are all stored in DL_DIR. When wiping and rebuilding you
# can preserve this directory to speed up this part of subsequent builds. This directory
# is safe to share between multiple builds on the same machine too.
#
# The default is a downloads directory under TOPDIR which is the build directory.
#
#DL_DIR ?= "${TOPDIR}/downloads"
#
# Where to place shared-state files
#
# BitBake has the capability to accelerate builds based on previously built output.
# This is done using "shared state" files which can be thought of as cache objects
# and this option determines where those files are placed.
#
# You can wipe out TMPDIR leaving this directory intact and the build would regenerate
# from these files if no changes were made to the configuration. If changes were made
# to the configuration, only shared state files where the state was still valid would
# be used (done using checksums).
#
# The default is a sstate-cache directory under TOPDIR.
#
#SSTATE_DIR ?= "${TOPDIR}/sstate-cache"
#
# Where to place the build output
#
# This option specifies where the bulk of the building work should be done and
# where BitBake should place its temporary files and output. Keep in mind that
# this includes the extraction and compilation of many applications and the toolchain
# which can use Gigabytes of hard disk space.
#
# The default is a tmp directory under TOPDIR.
#
#TMPDIR = "${TOPDIR}/tmp"
#
# Package Management configuration
#
# This variable lists which packaging formats to enable. Multiple package backends
# can be enabled at once and the first item listed in the variable will be used
# to generate the root filesystems.
# Options are:
# - 'package_deb' for debian style deb files
# - 'package_ipk' for ipk files are used by opkg (a debian style embedded package manager)
# - 'package_rpm' for rpm style packages
# E.g.: PACKAGE_CLASSES ?= "package_rpm package_deb package_ipk"
# We default to ipk:
PACKAGE_CLASSES ?= "package_ipk"
#
# SDK target architecture
#
# This variable specifies the architecture to build SDK items for and means
# you can build the SDK packages for architectures other than the machine you are
# running the build on (i.e. building i686 packages on an x86_64 host).
# Supported values are i686, x86_64, aarch64
#SDKMACHINE ?= "i686"
#
# Extra image configuration defaults
#
# The EXTRA_IMAGE_FEATURES variable allows extra packages to be added to the generated
# images. Some of these options are added to certain image types automatically. The
# variable can contain the following options:
# "dbg-pkgs" - add -dbg packages for all installed packages
# (adds symbol information for debugging/profiling)
# "src-pkgs" - add -src packages for all installed packages
# (adds source code for debugging)
# "dev-pkgs" - add -dev packages for all installed packages
# (useful if you want to develop against libs in the image)
# "ptest-pkgs" - add -ptest packages for all ptest-enabled packages
# (useful if you want to run the package test suites)
# "tools-sdk" - add development tools (gcc, make, pkgconfig etc.)
# "tools-debug" - add debugging tools (gdb, strace)
# "eclipse-debug" - add Eclipse remote debugging support
# "tools-profile" - add profiling tools (oprofile, lttng, valgrind)
# "tools-testapps" - add useful testing tools (ts_print, aplay, arecord etc.)
# "debug-tweaks" - make an image suitable for development
# e.g. ssh root access has a blank password
# There are other application targets that can be used here too, see
# meta/classes-recipe/image.bbclass and
# meta/classes-recipe/core-image.bbclass for more details.
# We default to enabling the debugging tweaks.
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
#
# Additional image features
#
# The following is a list of additional classes to use when building images which
# enable extra features. Some available options which can be included in this variable
# are:
# - 'buildstats' collect build statistics
USER_CLASSES ?= "buildstats"
#
# Runtime testing of images
#
# The build system can test booting virtual machine images under qemu (an emulator)
# after any root filesystems are created and run tests against those images. It can also
# run tests against any SDK that are built. To enable this uncomment these lines.
# See meta/classes-recipe/test{image,sdk}.bbclass for further details.
#IMAGE_CLASSES += "testimage testsdk"
#TESTIMAGE_AUTO:qemuall = "1"
#
# Interactive shell configuration
#
# Under certain circumstances the system may need input from you and to do this it
# can launch an interactive shell. It needs to do this since the build is
# multithreaded and needs to be able to handle the case where more than one parallel
# process may require the user's attention. The default is iterate over the available
# terminal types to find one that works.
#
# Examples of the occasions this may happen are when resolving patches which cannot
# be applied, to use the devshell or the kernel menuconfig
#
# Supported values are auto, gnome, xfce, rxvt, screen, konsole (KDE 3.x only), none
# Note: currently, Konsole support only works for KDE 3.x due to the way
# newer Konsole versions behave
#OE_TERMINAL = "auto"
# By default disable interactive patch resolution (tasks will just fail instead):
PATCHRESOLVE = "noop"
#
# Disk Space Monitoring during the build
#
# Monitor the disk space during the build. If there is less that 1GB of space or less
# than 100K inodes in any key build location (TMPDIR, DL_DIR, SSTATE_DIR), gracefully
# shutdown the build. If there is less than 100MB or 1K inodes, perform a hard halt
# of the build. The reason for this is that running completely out of space can corrupt
# files and damages the build in ways which may not be easily recoverable.
# It's necessary to monitor /tmp, if there is no space left the build will fail
# with very exotic errors.
BB_DISKMON_DIRS ??= "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
STOPTASKS,/tmp,100M,100K \
HALT,${TMPDIR},100M,1K \
HALT,${DL_DIR},100M,1K \
HALT,${SSTATE_DIR},100M,1K \
HALT,/tmp,10M,1K"
#
# Shared-state files from other locations
#
# As mentioned above, shared state files are prebuilt cache data objects which can be
# used to accelerate build time. This variable can be used to configure the system
# to search other mirror locations for these objects before it builds the data itself.
#
# This can be a filesystem directory, or a remote url such as https or ftp. These
# would contain the sstate-cache results from previous builds (possibly from other
# machines). This variable works like fetcher MIRRORS/PREMIRRORS and points to the
# cache locations to check for the shared objects.
# NOTE: if the mirror uses the same structure as SSTATE_DIR, you need to add PATH
# at the end as shown in the examples below. This will be substituted with the
# correct path within the directory structure.
#SSTATE_MIRRORS ?= "\
#file://.* https://someserver.tld/share/sstate/PATH;downloadfilename=PATH \
#file://.* file:///some/local/dir/sstate/PATH"
#
# Qemu configuration
#
# By default native qemu will build with a builtin VNC server where graphical output can be
# seen. The line below enables the SDL UI frontend too.
PACKAGECONFIG:append:pn-qemu-system-native = " sdl"
# By default libsdl2-native will be built, if you want to use your host's libSDL instead of
# the minimal libsdl built by libsdl2-native then uncomment the ASSUME_PROVIDED line below.
#ASSUME_PROVIDED += "libsdl2-native"
# You can also enable the Gtk UI frontend, which takes somewhat longer to build, but adds
# a handy set of menus for controlling the emulator.
#PACKAGECONFIG:append:pn-qemu-system-native = " gtk+"
#
# Hash Equivalence
#
# Enable support for automatically running a local hash equivalence server and
# instruct bitbake to use a hash equivalence aware signature generator. Hash
# equivalence improves reuse of sstate by detecting when a given sstate
# artifact can be reused as equivalent, even if the current task hash doesn't
# match the one that generated the artifact.
#
# A shared hash equivalent server can be set with "<HOSTNAME>:<PORT>" format
#
#BB_HASHSERVE = "auto"
#BB_SIGNATURE_HANDLER = "OEEquivHash"
#
# Memory Resident Bitbake
#
# Bitbake's server component can stay in memory after the UI for the current command
# has completed. This means subsequent commands can run faster since there is no need
# for bitbake to reload cache files and so on. Number is in seconds, after which the
# server will shut down.
#
#BB_SERVER_TIMEOUT = "60"
# CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to
# track the version of this file when it was generated. This can safely be ignored if
# this doesn't mean anything to you.
CONF_VERSION = "2"
# =========================================================================
# ST SPecific
# =========================================================================
#
# Set GLIBC_GENERATE_LOCALES to the locales you wish to generate should you not
# wish to perform the time-consuming step of generating all LIBC locales.
# NOTE: If removing en_US.UTF-8 you will also need to uncomment, and set
# appropriate value for IMAGE_LINGUAS.
# WARNING: this may break localisation!
GLIBC_GENERATE_LOCALES = "en_GB.UTF-8 en_US.UTF-8"
IMAGE_LINGUAS ?= "en-gb"
# Additional image generation features
#
# The following is a list of classes to import to use in the generation of images
# currently an example class is image_types_uboot
# IMAGE_CLASSES = " image_types_uboot"
# Support of devshell
INHERIT += "devshell"
# Remove the old image before the new one generated to save disk space
RM_OLD_IMAGE = "1"
# Nice debug data
INHERIT += "buildhistory"
BUILDHISTORY_COMMIT = "1"
# Clean up working directory after build
INHERIT += "rm_work"
# To generate debug image with all symbol
#IMAGE_GEN_DEBUGFS = "1"
# force the usage of debian package
PACKAGE_CLASSES = "package_deb"
# To enable archiver for recipes that are configured
#ST_ARCHIVER_ENABLE = "1"
# Setup environment for builds binary reproducibility
REPRODUCIBLE_TIMESTAMP_ROOTFS = ""
# Setup eSDK
SDK_EXT_TYPE="minimal"
SDK_INCLUDE_TOOLCHAIN="1"
# Enable PR server to avoid version-going-backward issue
PRSERV_HOST = "localhost:0"
# =========================================================================
# Configure STM32MP default version to github
# =========================================================================
#STM32MP_SOURCE_SELECTION:pn-linux-stm32mp = "github"
#STM32MP_SOURCE_SELECTION:pn-optee-os-stm32mp = "github"
#STM32MP_SOURCE_SELECTION:pn-tf-a-stm32mp = "github"
#STM32MP_SOURCE_SELECTION:pn-u-boot-stm32mp = "github"

View File

@@ -0,0 +1 @@
en.DM00217720.pdf

View File

@@ -0,0 +1,9 @@
# There is a conflict with 'wireless-regdb-static' package and 'dev-pkgs'
# IMAGE_FEATURES:
# This configuration creates an install dependency for 'wireless-regdb' package,
# while the 'wireless-regdb_%.bb' recipe set: RCONFLICTS:${PN} = "${PN}-static"
# This gives 'unmet dependencies' error.
# To avoid this issue, modify dependencies for ${PN}-dev to not require the
# ${PN} package by default.
RDEPENDS:${PN}-dev = ""
RRECOMMENDS:${PN}-dev:append = "${PN}"

View File

@@ -0,0 +1,42 @@
From 42ae45c1764fa5ca0f5c6428103b8bf8ca4da728 Mon Sep 17 00:00:00 2001
From: Lei YU <yulei.sh@bytedance.com>
Date: Thu, 19 Aug 2021 18:58:21 +0800
Subject: [PATCH] timesyncd: Use recvmsg() instead of recvmsg_safe()
The timesyncd gets below error on IPv6 NTP server:
systemd-timesyncd[534]: Error receiving message, disconnecting: Exchange full
This is returned by recvmsg_safe() when the MSG_CTRUNC is set.
In my case it occurs everytime when the system tries to sync time from
NTP with IPv6.
Before 3691bcf3c5e the code works fine. So revert the piece of code to
use recvmsg() and the issue is gone.
Signed-off-by: Lei YU <yulei.sh@bytedance.com>
---
src/timesync/timesyncd-manager.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c
index cb5d42b1d3..2df1b3eadb 100644
--- a/src/timesync/timesyncd-manager.c
+++ b/src/timesync/timesyncd-manager.c
@@ -440,10 +440,11 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re
return manager_connect(m);
}
- len = recvmsg_safe(fd, &msghdr, MSG_DONTWAIT);
- if (len == -EAGAIN)
- return 0;
+ len = recvmsg(fd, &msghdr, MSG_DONTWAIT);
+
if (len < 0) {
+ if (len == -EAGAIN)
+ return 0;
log_warning_errno(len, "Error receiving message, disconnecting: %m");
return manager_connect(m);
}
--
2.25.1

View File

@@ -0,0 +1,2 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://0050-timesyncd-Use-recvmsg-instead-of-recvmsg_safe.patch "

View File

@@ -0,0 +1,99 @@
From afae74e88e7cef05a22d5c50b662172d201b7b48 Mon Sep 17 00:00:00 2001
From: Richard Purdie <richard.purdie@linuxfoundation.org>
Date: Wed, 19 Feb 2020 09:51:16 -0800
Subject: [PATCH] binutils-nativesdk: Search for alternative ld.so.conf in SDK
installation
We need binutils to look at our ld.so.conf file within the SDK to ensure
we search the SDK's libdirs as well as those from the host system.
We therefore pass in the directory to the code using a define, then add
it to a section we relocate in a similar way to the way we relocate the
gcc internal paths. This ensures that ld works correctly in our buildtools
tarball.
Standard sysroot relocation doesn't work since we're not in a sysroot,
we want to use both the host system and SDK libs.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020/1/17
Upstream-Status: Inappropriate [OE specific tweak]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
ld/Makefile.am | 3 ++-
ld/Makefile.in | 3 ++-
ld/ldelf.c | 2 +-
ld/ldmain.c | 1 +
ld/ldmain.h | 1 +
5 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/ld/Makefile.am b/ld/Makefile.am
index 4df3f718f80..1b875904b8d 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -42,7 +42,8 @@ ZLIBINC = @zlibinc@
ELF_CLFAGS=-DELF_LIST_OPTIONS=@elf_list_options@ \
-DELF_SHLIB_LIST_OPTIONS=@elf_shlib_list_options@ \
- -DELF_PLT_UNWIND_LIST_OPTIONS=@elf_plt_unwind_list_options@
+ -DELF_PLT_UNWIND_LIST_OPTIONS=@elf_plt_unwind_list_options@ \
+ -DSYSCONFDIR="\"$(sysconfdir)\""
WARN_CFLAGS = @WARN_CFLAGS@
NO_WERROR = @NO_WERROR@
AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) $(JANSSON_CFLAGS) $(ZSTD_CFLAGS)
diff --git a/ld/Makefile.in b/ld/Makefile.in
index 13997650f58..17c58dd2fd0 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -569,7 +569,8 @@ ZLIB = @zlibdir@ -lz
ZLIBINC = @zlibinc@
ELF_CLFAGS = -DELF_LIST_OPTIONS=@elf_list_options@ \
-DELF_SHLIB_LIST_OPTIONS=@elf_shlib_list_options@ \
- -DELF_PLT_UNWIND_LIST_OPTIONS=@elf_plt_unwind_list_options@
+ -DELF_PLT_UNWIND_LIST_OPTIONS=@elf_plt_unwind_list_options@ \
+ -DSYSCONFDIR="\"$(sysconfdir)\""
AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) $(JANSSON_CFLAGS) $(ZSTD_CFLAGS)
diff --git a/ld/ldelf.c b/ld/ldelf.c
index 747b47123c2..925da4cff34 100644
--- a/ld/ldelf.c
+++ b/ld/ldelf.c
@@ -936,7 +936,7 @@ ldelf_check_ld_so_conf (const struct bfd_link_needed_list *l, int force,
info.path = NULL;
info.len = info.alloc = 0;
- tmppath = concat (ld_sysroot, prefix, "/etc/ld.so.conf",
+ tmppath = concat (ld_sysconfdir, "/ld.so.conf",
(const char *) NULL);
if (!ldelf_parse_ld_so_conf (&info, tmppath))
{
diff --git a/ld/ldmain.c b/ld/ldmain.c
index ca1b1a8f0fb..62e7b4e5341 100644
--- a/ld/ldmain.c
+++ b/ld/ldmain.c
@@ -70,6 +70,7 @@ char *program_name;
/* The prefix for system library directories. */
const char *ld_sysroot;
+char ld_sysconfdir[4096] __attribute__ ((section (".gccrelocprefix"))) = SYSCONFDIR;
/* The canonical representation of ld_sysroot. */
char *ld_canon_sysroot;
diff --git a/ld/ldmain.h b/ld/ldmain.h
index dda124b96e8..ba06a7d7be2 100644
--- a/ld/ldmain.h
+++ b/ld/ldmain.h
@@ -23,6 +23,7 @@
extern char *program_name;
extern const char *ld_sysroot;
+extern char ld_sysconfdir[4096];
extern char *ld_canon_sysroot;
extern int ld_canon_sysroot_len;
extern FILE *saved_script_handle;
--
2.25.1

View File

@@ -0,0 +1,3 @@
# look for files in the layer first
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"

View File

@@ -0,0 +1,3 @@
FILESEXTRAPATHS:prepend := "${THISDIR}:"
SRC_URI:append = "file://gdb/0010-fix-gdb-cross-arm-compilation-with-YOCTO-build-syste.patch"

View File

@@ -0,0 +1,38 @@
From 02370e466c7cda9347c9a6d65a160fdd41e91cbe Mon Sep 17 00:00:00 2001
From: Vincent ABRIOU <vincent.abriou@st.com>
Date: Thu, 13 Apr 2023 18:28:55 +0200
Subject: [PATCH 10/10] fix gdb-cross-arm compilation with YOCTO build system
Issue meet while compiling:
linux-tdep.c:(.text+0x13ac): undefined reference to
`gcore_elf_build_thread_register_notes(gdbarch*, thread_info*, gdb_signal,
bfd*, std::unique_ptr<char, gdb::xfree_deleter<char> >*, int*)'
linux-tdep.c:(.text+0x49d7): undefined reference to
`gcore_elf_make_tdesc_note(bfd*, std::unique_ptr<char,
gdb::xfree_deleter<char> >*, int*)'
Patch inspired fro this discussion.
https://lists.openembedded.org/g/openembedded-core/message/177970
Signed-off-by: Vincent ABRIOU <vincent.abriou@st.com>
---
gdb/configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/configure b/gdb/configure
index bdc84be9c01..2179743d3ab 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -28561,7 +28561,7 @@ WIN32LIBS="$WIN32LIBS $WIN32APILIBS"
# points somewhere with bfd, with -I/foo/lib and -L/foo/lib. We
# always want our bfd.
CFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS"
- LDFLAGS="-L../bfd -L../libiberty"
+ LDFLAGS="-L../bfd -L../libiberty $LDFLAGS"
intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
LIBS="-lbfd -liberty $intl $LIBS"
CC="./libtool --quiet --mode=link $CC"
--
2.25.1

View File

@@ -0,0 +1,35 @@
From 31c4a53fb0f7538850e0814bdecfc927a36433d4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20VINCENT?= <cedric.vincent@st.com>
Date: Wed, 20 Nov 2019 16:33:28 +0100
Subject: [PATCH] Add support for ARM Thumb branches with instruction-set
exchange.
This is issue has been detected on OpenSTLinux 2019-10-09, where
ltrace failed to single-step on a "bx lr" instruction when tracing
weston-simple-egl.
---
sysdeps/linux-gnu/arm/trace.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/sysdeps/linux-gnu/arm/trace.c b/sysdeps/linux-gnu/arm/trace.c
index 54632f3..7475f81 100644
--- a/sysdeps/linux-gnu/arm/trace.c
+++ b/sysdeps/linux-gnu/arm/trace.c
@@ -430,6 +430,14 @@ thumb_get_next_pcs(struct process *proc,
}
} else if ((inst1 & 0xf800) == 0xe000) { /* unconditional branch */
next_pcs[nr++] = pc + (SBITS(inst1, 0, 10) << 1);
+ } else if ((inst1 & 0xff07) == 0x4700) { /* branch with exchange */
+ const enum arm_register reg = BITS(inst1, 3, 6);
+ uint32_t next;
+
+ if (arm_get_register(proc, reg, &next) < 0)
+ return -1;
+
+ next_pcs[nr++] = (arch_addr_t) (next & 0xfffffffe);
} else if (thumb_insn_size(inst1) == 4) { /* 32-bit instruction */
unsigned short inst2;
if (proc_read_16(proc, pc + 2, &inst2) < 0)
--
2.20.1

View File

@@ -0,0 +1,3 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI:append = " file://0001-Add-support-for-ARM-Thumb-branches-with-instruction-.patch "

View File

@@ -0,0 +1,7 @@
DEPENDS:append = " cairo "
do_install:append() {
# Hack: the directory are not present and at image creation, sysprof post installation failed
install -d ${D}${datadir}/glib-2.0/schemas
touch ${D}${datadir}/glib-2.0/schemas/sysprof.txt
}

View File

@@ -0,0 +1,34 @@
PACKAGECONFIG = "${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11-gles2', '', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'wayland opengl', 'wayland-gles2', '', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'dispmanx', 'dispmanx', '', d)} \
drm-gles2 \
gbm-gles2 \
"
PACKAGECONFIG[gbm-gl] = ",,virtual/libgl virtual/libgbm"
PACKAGECONFIG[gbm-gles2] = ",,virtual/libgles2 virtual/libgbm"
python __anonymous() {
packageconfig = (d.getVar("PACKAGECONFIG") or "").split()
flavors = []
if "x11-gles2" in packageconfig:
flavors.append("x11-glesv2")
if "x11-gl" in packageconfig:
flavors.append("x11-gl")
if "wayland-gles2" in packageconfig:
flavors.append("wayland-glesv2")
if "wayland-gl" in packageconfig:
flavors.append("wayland-gl")
if "drm-gles2" in packageconfig:
flavors.append("drm-glesv2")
if "drm-gl" in packageconfig:
flavors.append("drm-gl")
if "gbm-gles2" in packageconfig:
flavors.append("gbm-glesv2")
if "gbm-gl" in packageconfig:
flavors.append("gbm-gl")
if "dispmanx" in packageconfig:
flavors = ["dispmanx-glesv2"]
if flavors:
d.appendVar("EXTRA_OEMESON", " -Dflavors=%s" % ",".join(flavors))
}

View File

@@ -0,0 +1,44 @@
# Copyright (C) 2016, STMicroelectronics - All Rights Reserved
# Released under the MIT license (see COPYING.MIT for the terms)
# Tools extracted from 96boards-tools https://github.com/96boards/96boards-tools
SUMMARY = "Tools for resizing the file system"
SECTION = "devel"
LICENSE = "GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-or-later;md5=fed54355545ffd980b814dab4a3b312c"
# e2fsprogs for resize2fs
RDEPENDS:${PN} += " e2fsprogs-resize2fs "
SRC_URI = " file://resize-helper.service file://resize-helper file://resize-helper.sh.in"
S = "${WORKDIR}/git"
START_RESIZE_HELPER_SERVICE ?= "1"
inherit systemd update-rc.d
SYSTEMD_PACKAGES += " resize-helper "
SYSTEMD_SERVICE:${PN} = "resize-helper.service"
SYSTEMD_AUTO_ENABLE:${PN} = "${@bb.utils.contains('START_RESIZE_HELPER_SERVICE','1','enable','disable',d)}"
do_install() {
install -d ${D}${systemd_unitdir}/system ${D}${base_sbindir}
install -m 0644 ${WORKDIR}/resize-helper.service ${D}${systemd_unitdir}/system
install -m 0755 ${WORKDIR}/resize-helper ${D}${base_sbindir}
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/resize-helper.sh.in ${D}${sysconfdir}/init.d/resize-helper.sh
sed -i -e "s:@sbindir@:${base_sbindir}:; s:@sysconfdir@:${sysconfdir}:" \
${D}${sysconfdir}/init.d/resize-helper.sh
if [ "${START_RESIZE_HELPER_SERVICE}" -eq 0 ]; then
rm ${D}${sysconfdir}/init.d/resize-helper.sh
echo "#!/bin/sh" > ${D}${sysconfdir}/init.d/resize-helper.sh
chmod +x ${D}${sysconfdir}/init.d/resize-helper.sh
fi
}
INITSCRIPT_NAME = "resize-helper.sh"
INITSCRIPT_PARAMS = "start 22 5 3 ."

View File

@@ -0,0 +1,80 @@
#!/bin/sh
# Copyright (c) Fathi Boudra <fathi.boudra@linaro.org>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
# we must be root
[ $(whoami) = "root" ] || { echo "E: You must be root" && exit 1; }
# we must have few tools
RESIZE2FS=$(which resize2fs) || { echo "E: You must have resize2fs" && exit 1; }
# find root device
# ROOT_DEVICE=$(findmnt --noheadings --output=SOURCE / | cut -d'[' -f1)
DEVICES=$(ls /sys/fs/ext4/)
echo "RESIZE-HELPER START" > /dev/kmsg
# disable service to be sure it will be executed only one time
if [ -f /bin/systemctl ]; then
/bin/systemctl --no-reload disable resize-helper.service
else
rm /etc/rc[35].d/S22resize-helper.sh &> /dev/null
fi
sync
if `grep -q nfsroot /proc/cmdline` ; then
exit 0;
fi
if [ -f /lib/systemd/systemd-growfs ]; then
echo "RESIZE-HELPER: Using systemd-growfs" > /dev/kmsg
# force to mount partitions
if [ -z $(findmnt --noheadings --output=SOURCE /boot|cut -d'[' -f1) ];
then
[ -f /sbin/mount-partitions.sh ] && /sbin/mount-partitions.sh stop
fi
/lib/systemd/systemd-growfs /
/lib/systemd/systemd-growfs /boot
/lib/systemd/systemd-growfs /vendor
/lib/systemd/systemd-growfs /usr/local/
else
echo "RESIZE-HELPER: Using directly resize2fs" > /dev/kmsg
# umount partition before to resize it
[ -f /sbin/mount-partitions.sh ] && /sbin/mount-partitions.sh stop
for device in ${DEVICES}; do
PART_TABLE_TYPE=$(udevadm info --query=property --name=/dev/${device} | grep '^ID_PART_TABLE_TYPE=' | cut -d'=' -f2)
if [ -e /dev/${device} ]; then
if [ "$PART_TABLE_TYPE" = "gpt" ]; then
echo "Resize /dev/${device}"
${RESIZE2FS} "/dev/${device}"
fi
fi
done
fi
df -h > /dev/kmsg
#echo "RESIZE-HELPER: For integrity of file-system after a resize2fs, the system need to be rebooted" > /dev/kmsg
#echo "RESIZE-HELPER REBOOTING of system" > /dev/kmsg
echo "RESIZE-HELPER FINISH" > /dev/kmsg

View File

@@ -0,0 +1,14 @@
[Unit]
Description=Resize root filesystem to fit available disk space
DefaultDependencies=false
After=mount-partitions.service
Before=local-fs.target serial-getty@ttySTM0.service netdata.service
[Service]
Type=oneshot
ExecStartPre=-/bin/udevadm settle
ExecStart=-/sbin/resize-helper
WatchdogSec=45
[Install]
WantedBy=local-fs.target

View File

@@ -0,0 +1,24 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: Resize root filesystem to fit available disk space
# Description: Start resize helper, then remove own init from runlevels,
# as it is required only for first boot. run settle to provide partition
# table details.
### END INIT INFO
DESC="resize helper"
case $1 in
start)
echo "Starting $DESC"
@sbindir@/resize-helper
;;
*)
echo "Usage: @sysconfdir@/init.d/resize-helper.sh {start}" >&2
exit 1
;;
esac
exit 0
# vim:noet

View File

@@ -0,0 +1,32 @@
# Copyright (C) 2018, STMicroelectronics - All Rights Reserved
# Released under the MIT license (see COPYING.MIT for the terms)
SUMMARY = "The goal is to enable USB gadget configuration"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
PV = "1.0"
SRC_URI = " file://stm32_usbotg_eth_config.sh \
file://53-usb-otg.network \
file://97-ustotg.rules \
"
S = "${WORKDIR}/git"
do_install() {
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
install -d ${D}${systemd_unitdir}/network
install -m 0644 ${WORKDIR}/53-usb-otg.network ${D}${systemd_unitdir}/network
fi
install -d ${D}${base_sbindir}
install -m 0755 ${WORKDIR}/stm32_usbotg_eth_config.sh ${D}${base_sbindir}
# install udev rule
install -D -p -m0644 ${WORKDIR}/97-ustotg.rules ${D}${sysconfdir}/udev/rules.d/97-ustotg.rules
}
FILES:${PN} += "${systemd_unitdir}/network ${sysconfdir}/udev"

View File

@@ -0,0 +1,14 @@
[Match]
Name=usb0
Type=gadget
[Network]
Address=192.168.7.1/24
DHCPServer=yes
KeepConfiguration=yes
[DHCPServer]
ServerAddress=192.168.7.1/24
EmitTimezone=no
EmitRouter=no

View File

@@ -0,0 +1,2 @@
ACTION=="add", SUBSYSTEM=="udc", RUN+="/sbin/stm32_usbotg_eth_config.sh restart"

View File

@@ -0,0 +1,153 @@
#!/bin/sh
#add stm32_eth_config script to enable USB Ethernet & MSC gadget This script configures USB Gadget
#configfs to use USB OTG as a USB Ethernet Gadget with Remote NDIS (RNDIS), well supported by Microsoft
#Windows and Linux.
configfs="/sys/kernel/config/usb_gadget"
g=g1
c=c.1
d="${configfs}/${g}"
func_eth=ncm.0
func_ms=mass_storage.0
VENDOR_ID="0x1d6b"
PRODUCT_ID="0x0104"
IP="192.168.7.2"
NETMASK="255.255.255.0"
#MAC address for ethernet-over-USB can be defined here
MAC_HOST_CUST=""
MAC_DEV_CUST=""
get_mac_address_from_serial_number(){
sha1sum /proc/device-tree/serial-number \
| fold -1 \
| sed -n '1{h;d};2{y/1235679abdef/000444888ccc/;H;d};13{g;s/\n//g;p;q};s/^/:/;N;H;d'
}
do_start() {
if [ ! -d ${configfs} ]; then
modprobe libcomposite
if [ ! -d ${configfs} ]; then
exit 1
fi
fi
if [ -d ${d} ]; then
exit 0
fi
udc=$(ls -1 /sys/class/udc/)
if [ -z $udc ]; then
echo "No UDC driver registered"
exit 1
fi
mkdir "${d}"
echo ${VENDOR_ID} > "${d}/idVendor"
echo ${PRODUCT_ID} > "${d}/idProduct"
echo 0x0200 > "${d}/bcdUSB"
# Windows extension to use IAD (Interface Association Descriptor)
# https://learn.microsoft.com/en-us/windows-hardware/drivers/usbcon/usb-interface-association-descriptor
echo "0xEF" > "${d}/bDeviceClass"
echo "0x02" > "${d}/bDeviceSubClass"
echo "0x01" > "${d}/bDeviceProtocol"
echo "0x0100" > "${d}/bcdDevice"
mkdir -p "${d}/strings/0x409"
tr -d '\0' < /proc/device-tree/serial-number > "${d}/strings/0x409/serialnumber"
echo "STMicroelectronics" > "${d}/strings/0x409/manufacturer"
echo "STM32MP1" > "${d}/strings/0x409/product"
# Config
mkdir -p "${d}/configs/${c}"
mkdir -p "${d}/configs/${c}/strings/0x409"
echo "Config 1: NCM" > "${d}/configs/${c}/strings/0x409/configuration"
echo 0 > "${d}/configs/${c}/MaxPower"
echo 0xC0 > "${d}/configs/${c}/bmAttributes" # self powered device
# Enable use of OS descriptor (for windows to bind drivers like NCM, RNDIS...
# without additional .inf file)
mkdir -p "${d}/os_desc"
echo "1" > "${d}/os_desc/use"
echo "0xbc" > "${d}/os_desc/b_vendor_code"
echo "MSFT100" > "${d}/os_desc/qw_sign"
# Select windows UsbNcm Host driver
mkdir -p "${d}/functions/${func_eth}"
mkdir -p "${d}/functions/${func_eth}/os_desc/interface.ncm"
echo "WINNCM" > "${d}/functions/${func_eth}/os_desc/interface.ncm/compatible_id"
if [ "$MAC_HOST_CUST" != "" ]; then
echo $MAC_HOST_CUST > "${d}/functions/${func_eth}/host_addr"
else
mac_host=$(get_mac_address_from_serial_number)
echo $mac_host > "${d}/functions/${func_eth}/host_addr"
fi
if [ "$MAC_DEV_CUST" != "" ]; then
echo $MAC_DEV_CUST > "${d}/functions/${func_eth}/dev_addr"
fi
# Set up the rndis device only first
ln -s "${d}/functions/${func_eth}" "${d}/configs/${c}"
ln -s "${d}/configs/${c}" "${d}/os_desc"
echo "${udc}" > "${d}/UDC"
sleep 0.2
interfacename=$(cat ${d}/functions/${func_eth}/ifname 2> /dev/null)
if [ -z "${interfacename}" ];
then
interfacename=usb0
fi
# ifconfig ${interfacename} $IP netmask $NETMASK
ifconfig ${interfacename} up
}
do_stop() {
interfacename=$(cat ${d}/functions/${func_eth}/ifname 2> /dev/null)
if [ -z "${interfacename}" ];
then
echo "Nothing to do"
return
fi
ifconfig ${interfacename} down
sleep 0.2
echo "" > "${d}/UDC"
rm -f "${d}/os_desc/${c}"
[ -d "${d}/configs/${c}/${func_eth}" ] &&rm -f "${d}/configs/${c}/${func_eth}"
[ -d "${d}/strings/0x409/" ] && rmdir "${d}/strings/0x409/"
[ -d "${d}/configs/${c}/strings/0x409" ] && rmdir "${d}/configs/${c}/strings/0x409"
[ -d "${d}/configs/${c}" ] && rmdir "${d}/configs/${c}"
[ -d "${d}/functions/${func_eth}" ] && rmdir "${d}/functions/${func_eth}"
[ -d "${d}" ] && rmdir "${d}"
}
case $1 in
start)
echo "Start usb gadget"
do_start
;;
stop)
echo "Stop usb gadget"
do_stop
;;
restart)
echo "Stop usb gadget"
do_stop
sleep 1
echo "Start usb gadget"
do_start
;;
*)
echo "Usage: $0 (stop | start | restart)"
;;
esac

View File

@@ -0,0 +1,41 @@
From fd4ce2545ebf30263de41684e7b7c68e6fd1e3be Mon Sep 17 00:00:00 2001
From: Christophe Priouzeau <christophe.priouzeau@st.com>
Date: Fri, 14 Feb 2020 15:25:05 +0100
Subject: [PATCH] authorize pulse audio request via dbus
Signed-off-by: Christophe Priouzeau <christophe.priouzeau@st.com>
---
src/bluetooth.conf | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/src/bluetooth.conf b/src/bluetooth.conf
index 8a1e258..380388d 100644
--- a/src/bluetooth.conf
+++ b/src/bluetooth.conf
@@ -22,6 +22,23 @@
<allow send_interface="org.mpris.MediaPlayer2.Player"/>
</policy>
+ <policy user="pulse">
+ <allow own="org.bluez"/>
+ <allow send_destination="org.bluez"/>
+ <allow send_interface="org.bluez.Agent1"/>
+ <allow send_interface="org.bluez.MediaEndpoint1"/>
+ <allow send_interface="org.bluez.MediaPlayer1"/>
+ <allow send_interface="org.bluez.ThermometerWatcher1"/>
+ <allow send_interface="org.bluez.AlertAgent1"/>
+ <allow send_interface="org.bluez.Profile1"/>
+ <allow send_interface="org.bluez.HeartRateWatcher1"/>
+ <allow send_interface="org.bluez.CyclingSpeedWatcher1"/>
+ <allow send_interface="org.bluez.GattCharacteristic1"/>
+ <allow send_interface="org.bluez.GattDescriptor1"/>
+ <allow send_interface="org.freedesktop.DBus.ObjectManager"/>
+ <allow send_interface="org.freedesktop.DBus.Properties"/>
+ </policy>
+
<policy context="default">
<allow send_destination="org.bluez"/>
</policy>
--
2.17.1

View File

@@ -0,0 +1,4 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://0001-authorize-pulse-audio-request-via-dbus.patch"

View File

@@ -0,0 +1,13 @@
# Disable connman service at startup
SYSTEMD_AUTO_ENABLE:${PN} = "disable"
# Set low alternative priority for resolv-conf to keep systemd by default
ALTERNATIVE_PRIORITY[resolv-conf] = "10"
# As we disable CONNMAN service, we also need to remove the specific
# /etc/tmpfiles.d/connman_resolvconf.conf to let systemd managing /etc/resolv.conf
do_install:append() {
if [ -f ${D}/${sysconfdir}/tmpfiles.d/connman_resolvconf.conf ]; then
rm ${D}/${sysconfdir}/tmpfiles.d/connman_resolvconf.conf
fi
}

View File

@@ -0,0 +1 @@
PACKAGECONFIG += " cryptodev-linux"

View File

@@ -0,0 +1,9 @@
DESCRIPTION = "Python-based Blue Py"
HOMEPAGE = "https://pypi.org/project/bluepy/"
LICENSE = "GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://README;md5=0e50fa260baaf98bc02337980811786a"
inherit pypi

View File

@@ -0,0 +1,9 @@
require python3-bluepy.inc
inherit setuptools3
SRC_URI[sha256sum] = "2a71edafe103565fb990256ff3624c1653036a837dfc90e1e32b839f83971cec"
DEPENDS += "glib-2.0"
inherit pkgconfig
INSANE_SKIP:${PN} += "ldflags"

View File

@@ -0,0 +1,4 @@
do_configure:append() {
# add CONFIG_P2P
sed -i "s/^#CONFIG_P2P=y/CONFIG_P2P=y/" wpa_supplicant/.config
}

View File

@@ -0,0 +1,12 @@
# Enable FLASH utilities
CONFIG_FLASHCP=y
CONFIG_FLASH_LOCK=y
CONFIG_FLASH_UNLOCK=y
CONFIG_FLASH_ERASEALL=y
# Enable tools to fill ARP table (991 cameras)
CONFIG_ARP=y
CONFIG_ARPING=y
# enable ether_wake tools
CONFIG_ETHER_WAKE=y

View File

@@ -0,0 +1,3 @@
FILESEXTRAPATHS:append := ":${THISDIR}/${PN}"
SRC_URI:append = " file://busybox-openstlinux.cfg "

View File

@@ -0,0 +1,2 @@
echo "Linux version <KERNEL_VERSION> - NO TRACE"
echo

View File

@@ -0,0 +1,26 @@
# Copyright (C) 2023, STMicroelectronics - All Rights Reserved
# Released under the MIT license (see COPYING.MIT for the terms)
SUMMARY = "Add script in case no trace was asked"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "file://${NOTRACE_SCRIPT}"
NOTRACE_SCRIPT = "notrace.sh"
inherit linux-kernel-base
KERNEL_VERSION = "${@get_kernelversion_file("${STAGING_KERNEL_BUILDDIR}") or '0.0'}"
do_configure[depends] += "virtual/kernel:do_shared_workdir"
do_configure() {
cp "${WORKDIR}/${NOTRACE_SCRIPT}" "${S}/${NOTRACE_SCRIPT}"
sed -i 's/<KERNEL_VERSION>/'"${KERNEL_VERSION}"'/' "${S}/${NOTRACE_SCRIPT}"
}
do_install() {
install -d ${D}${sysconfdir}/profile.d
if ${@bb.utils.contains('ST_DEBUG_TRACE','0','true','false',d)}; then
install -m 0755 ${S}/${NOTRACE_SCRIPT} ${D}${sysconfdir}/profile.d/
fi
}

View File

@@ -0,0 +1,6 @@
#
# Due to GPLv3 limitation, gdbserver are removed of package group
#
RDEPENDS:${PN}:remove = "\
${@bb.utils.contains('DISTRO_FEATURES', 'gplv3', '', 'gdbserver', d)} \
"

View File

@@ -0,0 +1,5 @@
RDEPENDS:${PN}:remove = "${LTTNGMODULES}"
RRECOMMENDS:${PN}:remove = "${@bb.utils.contains('DISTRO_FEATURES', 'gplv3', '', '${PERF}', d)}"
#RDEPENDS:append += "oprofile"

View File

@@ -0,0 +1,47 @@
# Copyright (C) 2014, STMicroelectronics - All Rights Reserved
# Released under the MIT license (see COPYING.MIT for the terms)
SUMMARY = "Basic splash screen which display a picture on DRM/KMS"
LICENSE = "MIT"
DEPENDS = "libdrm pkgconfig-native libpng pixman"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = " \
file://image_header.h \
file://basic_splash_drm.c \
file://Makefile \
file://psplash-drm-quit \
"
SRC_URI += " file://psplash-drm-start.service "
PROVIDES = "virtual/psplash"
RPROVIDES:${PN} = "virtual-psplash virtual-psplash-support"
inherit systemd
SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}"
SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','psplash-drm-start.service ','',d)}"
S = "${WORKDIR}"
do_configure[noexec] = "1"
do_compile() {
bbnote "EXTRA_OEMAKE=${EXTRA_OEMAKE}"
oe_runmake clean
oe_runmake psplash
}
do_install() {
install -d ${D}${bindir}
install -m 755 ${WORKDIR}/psplash-drm ${D}${bindir}
install -m 755 ${WORKDIR}/psplash-drm-quit ${D}${bindir}
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
install -d ${D}${systemd_unitdir}/system
install -m 644 ${WORKDIR}/*.service ${D}/${systemd_unitdir}/system
fi
}
FILES:${PN} += "${systemd_unitdir}/system "

View File

@@ -0,0 +1,16 @@
SPLASH_IMG ?= OpenSTLinux_background_480x272.png
SPLASH_IMG_ROT ?= OpenSTLinux_background_480x272_rotation.png
all: modeset
generate_header: $(SPLASH_IMG) $(SPLASH_IMG_ROT)
@gdk-pixbuf-csource --macros $(SPLASH_IMG) > image_header.tmp
@(sed -e "s/MY_PIXBUF/SPLASH_IMG/g" -e "s/guint8/uint8_t/g" image_header.tmp > image_header.h && rm image_header.tmp)
@gdk-pixbuf-csource --macros $(SPLASH_IMG_ROT) > image_header.tmp
@(sed -e "s/MY_PIXBUF/SPLASH_IMG_ROT/g" -e "s/guint8/uint8_t/g" image_header.tmp >> image_header.h && rm image_header.tmp)
psplash:
$(CC) $(CFLAGS) $(LDFLAGS) -o psplash-drm basic_splash_drm.c -I. `pkg-config --cflags --libs libdrm pixman-1 libpng` -Wall -Os
clean:
rm -rf psplash-drm

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,9 @@
#!/bin/sh
PSPLASH_PID=`pidof psplash-drm`
if [[ ! -z $PSPLASH_PID ]]; then
echo -n "Stop psplash: "
echo QUIT > /tmp/splash_fifo
#kill -9 $PSPLASH_PID
echo "done."
fi

View File

@@ -0,0 +1,16 @@
[Unit]
Description=Starts Psplash Boot screen
#Wants=systemd-remount-fs.service
#After=systemd-vconsole-setup.service systemd-udev-trigger.service systemd-udevd.service
After=systemd-remount-fs.service
DefaultDependencies=no
[Service]
Type=simple
RemainAfterExit=yes
KillMode=mixed
SendSIGKILL=no
ExecStart=/usr/bin/psplash-drm -w
[Install]
WantedBy=local-fs.target

View File

@@ -0,0 +1,3 @@
[Coredump]
Storage=external

View File

@@ -0,0 +1,21 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI:append = " \
file://coredump-custom.conf \
"
do_install:prepend() {
install -d ${D}${sysconfdir}/systemd/coredump.conf.d/
install -m 644 ${WORKDIR}/coredump-custom.conf ${D}${sysconfdir}/systemd/coredump.conf.d/
# ignore poweroff key on logind
install -d ${D}${systemd_unitdir}/logind.conf.d/
echo "[Login]" > ${D}${systemd_unitdir}/logind.conf.d/01-openstlinux.conf
echo "HandlePowerKey=ignore" >> ${D}${systemd_unitdir}/logind.conf.d/01-openstlinux.conf
# Journal, do not store journald on filesystem (syslog make it already)
install -d ${D}${systemd_unitdir}/journald.conf.d/
echo "[Journal]" > ${D}${systemd_unitdir}/journald.conf.d/01-openstlinux.conf
echo "Storage=volatile" >> ${D}${systemd_unitdir}/journald.conf.d/01-openstlinux.conf
}
FILES:${PN} += " ${sysconfdir}/systemd/coredump.conf.d/ "

View File

@@ -0,0 +1,80 @@
# Copyright (C) 2018, STMicroelectronics - All Rights Reserved
# Released under the MIT license (see COPYING.MIT for the terms)
SUMMARY = "Mount partitions"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
RDEPENDS:${PN} += " util-linux "
MOUNT_BASENAME = "mount-partitions"
SRC_URI = " \
file://${MOUNT_BASENAME}.service \
file://${MOUNT_BASENAME}.sh \
"
inherit systemd update-rc.d
INITSCRIPT_NAME = "${MOUNT_BASENAME}.sh"
INITSCRIPT_PARAMS = "start 22 5 3 ."
SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}"
SYSTEMD_SERVICE:${PN} = "${MOUNT_BASENAME}.service"
SYSTEMD_AUTO_ENABLE:${PN} = "enable"
# This list should be set with partition label and associated mountpoint
# <partition_label1>,<partition_mountpoint1> <partition_label2>,<partition_mountpoint2>
MOUNT_PARTITIONS_LIST ?= ""
PARTITIONS_IMAGES ?= ""
# Update MOUNT_PARTITIONS_LIST var with input from PARTITIONS_IMAGES enabled
python set_partitions_list() {
partitionsconfig = (d.getVar('PARTITIONS_IMAGES') or "").split()
if len(partitionsconfig) > 0:
partitionsconfigflags = d.getVarFlags('PARTITIONS_IMAGES')
# The "doc" varflag is special, we don't want to see it here
partitionsconfigflags.pop('doc', None)
for config in partitionsconfig:
for f, v in partitionsconfigflags.items():
if config == f:
items = v.split(',')
# Make sure a mount point is available
if len(items) > 2 and items[1] and items[2]:
bb.debug(1, "Appending '%s,%s' to MOUNT_PARTITIONS_LIST." % (items[1], items[2]))
d.appendVar('MOUNT_PARTITIONS_LIST', ' ' + items[1] + ',' + items[2])
break
}
do_install[prefuncs] += "set_partitions_list"
do_install() {
if [ -n "${MOUNT_PARTITIONS_LIST} " ] ; then
for part in ${MOUNT_PARTITIONS_LIST}
do
part_label=$(echo ${part} | cut -d',' -f1)
mountpoint=$(echo ${part} | cut -d',' -f2)
# Check that list is properly feed
[ -z "${part_label}" ] && bbfatal "MOUNT_PARTITIONS_LIST parsing error: ${part} does not contain partition label"
[ -z "${mountpoint}" ] && bbfatal "MOUNT_PARTITIONS_LIST parsing error: ${part} does not contain partition mountpoint"
done
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
install -d ${D}${systemd_unitdir}/system ${D}/${base_sbindir}
install -m 644 ${WORKDIR}/${MOUNT_BASENAME}.service ${D}/${systemd_unitdir}/system
install -m 755 ${WORKDIR}/${MOUNT_BASENAME}.sh ${D}/${base_sbindir}/
# Update script
sed 's:^MOUNT_PARTITIONS_LIST=.*$:MOUNT_PARTITIONS_LIST=\"'"${MOUNT_PARTITIONS_LIST}"'\":' -i ${D}/${base_sbindir}/${MOUNT_BASENAME}.sh
fi
install -d ${D}/${INIT_D_DIR}
install -m 755 ${WORKDIR}/${MOUNT_BASENAME}.sh ${D}/${INIT_D_DIR}/
# Update script
sed 's:^MOUNT_PARTITIONS_LIST=.*$:MOUNT_PARTITIONS_LIST=\"'"${MOUNT_PARTITIONS_LIST}"'\":' -i ${D}/${INIT_D_DIR}/${MOUNT_BASENAME}.sh
else
bbfatal "Please set MOUNT_PARTITIONS_LIST with expected partition labels and mount point."
fi
}
FILES:${PN} += " ${systemd_unitdir} ${base_sbindir} ${INIT_D_DIR}"

View File

@@ -0,0 +1,15 @@
[Unit]
Description=Mount partitions
DefaultDependencies=false
Before=local-fs.target
[Service]
Type=oneshot
RemainAfterExit=Yes
StandardOutput=syslog
TimeoutSec=0
ExecStart=-/sbin/mount-partitions.sh start
ExecStop=/sbin/mount-partitions.sh stop
[Install]
WantedBy=local-fs.target

View File

@@ -0,0 +1,148 @@
#!/bin/sh -
#===============================================================================
#
# FILE: mount-partitions.sh
#
# USAGE: ./mount-partitions.sh [start|stop]
#
# DESCRIPTION: mount partitions
# ORGANIZATION: STMicroelectronics
# COPYRIGHT: Copyright (C) 2018, STMicroelectronics - All Rights Reserved
# CREATED: 01/09/2018 13:36
# REVISION: ---
#===============================================================================
MOUNT_PARTITIONS_LIST=""
get_type() {
local __resultvar=$1
ROOT_TYPE="unknown"
if [ -f /usr/bin/findmnt ];
then
ROOT_DEVICE=$(findmnt --noheadings --output=SOURCE / | cut -d'[' -f1)
case $ROOT_DEVICE in
ubi*)
ROOT_TYPE="nand"
;;
/dev/mmcblk0*)
ROOT_TYPE="sdmmc"
;;
/dev/mmcblk1*)
ROOT_TYPE="mmc"
;;
/dev/disk/by-*)
LINK=$(/usr/bin/readlink $ROOT_DEVICE | tr '/' ' ' | tr '.' ' ' | sed "s/ //g")
case $LINK in
ubi*)
ROOT_TYPE="nand"
;;
mmcblk0*)
ROOT_TYPE="sdmmc"
;;
mmcblk1*)
ROOT_TYPE="mmc"
;;
esac
;;
esac
else
if [ `cat /proc/cmdline | sed "s/.*mmcblk0.*/mmcblk0/" ` == "mmcblk0" ]; then
ROOT_TYPE="sdmmc"
elif [ `cat /proc/cmdline | sed "s/.*mmcblk1.*/mmcblk1/" ` == "mmcblk1" ]; then
ROOT_TYPE="mmc"
elif [ `cat /proc/cmdline | sed "s/.*ubi0.*/ubi0/" ` == "ubi0" ]; then
ROOT_TYPE="nand"
fi
fi
eval $__resultvar="'$ROOT_TYPE'"
}
found_devices() {
local __resultvar=$1
local __resultopt=$2
local _type=$3
local _search=$4
local _device="unknown"
local _option=" "
case $_type in
nand)
# for the nand, fs can be not present in partition name
_search="($_search|$(echo $_search | sed 's,fs$,,'))"
local ubi_volumes=$(ls -1 -d /sys/class/ubi/ubi0_*)
for f in $ubi_volumes;
do
if [ -r $f/name ];
then
cat $f/name | grep -sq -E "^${_search}$"
if [ "$?" -eq 0 ];
then
_device="/dev/$(basename $f)"
_option="-t ubifs"
break;
fi
fi
done
;;
sdmmc)
local sdmmc_parts=$(ls -1 -d /sys/block/mmcblk0/mmcblk0p*)
for f in $sdmmc_parts;
do
if [ -r $f/uevent ];
then
cat $f/uevent | grep PARTNAME | sed "s/PARTNAME=//" | grep -sq "^${_search}"
if [ "$?" -eq 0 ];
then
_device="/dev/$(basename $f)"
break;
fi
fi
done
;;
mmc)
local mmc_parts=$(ls -1 -d /sys/block/mmcblk1/mmcblk1p*)
for f in $mmc_parts;
do
if [ -r $f/uevent ];
then
cat $f/uevent | grep PARTNAME | sed "s/PARTNAME=//" | grep -sq "^${_search}"
if [ "$?" -eq 0 ];
then
_device="/dev/$(basename $f)"
break;
fi
fi
done
;;
esac
eval $__resultvar="'$_device'"
eval $__resultopt="'$_option'"
}
case "$1" in
start)
# mount partitions
get_type TYPE
echo "TYPE of support detected: $TYPE"
for part in $MOUNT_PARTITIONS_LIST
do
part_label=$(echo $part | cut -d',' -f1)
mountpoint=$(echo $part | cut -d',' -f2)
found_devices DEVICE DEVICE_OPTION $TYPE $part_label
echo "$part_label device: $DEVICE"
[ -d $mountpoint ] || mkdir -p $mountpoint
[ -e $DEVICE ] && mount $DEVICE_OPTION $DEVICE $mountpoint
done
;;
stop)
# umount partitions
for part in $MOUNT_PARTITIONS_LIST
do
mountpoint=$(echo $part | cut -d',' -f2)
umount $mountpoint
done
;;
*)
echo "Usage: $0 [start|stop]"
;;
esac

View File

@@ -0,0 +1,33 @@
# Copyright (C) 2017, STMicroelectronics - All Rights Reserved
# Released under the MIT license (see COPYING.MIT for the terms)
SUMMARY = "Basic networkd configuration"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
DEPENDS = "systemd"
SRC_URI = " \
file://50-wired-nfs.network \
file://52-static.network.static \
file://51-wireless.network.sample \
\
file://98-net-alias-stm32mp.rules \
file://stm32mp-net-alias-udev.sh \
file://stm32mp-net-alias-wlan-udev.sh \
"
do_install() {
install -d ${D}${systemd_unitdir}/network
install -m 644 ${WORKDIR}/50-wired-nfs.network ${D}${systemd_unitdir}/network
install -m 644 ${WORKDIR}/52-static.network.static ${D}${systemd_unitdir}/network
install -m 644 ${WORKDIR}/51-wireless.network.sample ${D}${systemd_unitdir}/network
# install link creation
install -d ${D}${sysconfdir}/udev/rules.d/
install -m 0644 ${WORKDIR}/98-net-alias-stm32mp.rules ${D}${sysconfdir}/udev/rules.d/
install -d ${D}${sbindir}/
install -m 0755 ${WORKDIR}/stm32mp-net-alias-udev.sh ${D}${sbindir}/
install -m 0755 ${WORKDIR}/stm32mp-net-alias-wlan-udev.sh ${D}${sbindir}/
}
FILES:${PN} += "${systemd_unitdir}/network"

View File

@@ -0,0 +1,11 @@
[Match]
Name=eth* en*
KernelCommandLine=nfsroot
[Network]
DHCP=yes
[DHCP]
RouteMetric=10
ClientIdentifier=mac
CriticalConnection=true

View File

@@ -0,0 +1,30 @@
[Match]
Name=wlan*
[Network]
DHCP=ipv4
# Documentation to activate manually wireless interface
# 1. generate the specific wpa_supplicant file
# mkdir -p /etc/wpa_supplicant/
# echo "ctrl_interface=/var/run/wpa_supplicant" > /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
# echo "eapol_version=1" >> /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
# echo "ap_scan=1" >> /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
# echo "fast_reauth=1" >> /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
# echo "" >> /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
# wpa_passphrase SSID_OF_NETWORK PASSWORD_OF_NETWORK >> /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
# or
# wpa_passphrase ssid_of_network >> /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
# 2. put in place network configuration
# rename file 51-wireless.network.sample to 51-wireless.network on /usr/lib/systemd/network/
# 3. restart/start service
# systemctl enable systemd-networkd.service
# systemctl enable wpa_supplicant@wlan0.service
# systemctl restart systemd-networkd.service
# systemctl restart wpa_supplicant@wlan0.service
# info:
# How to list SSID available
# ifconfig wlan0 up
# iw dev wlan0 scan | grep SSID
# or
# iwlist wlan0 scanning | grep ESSID

View File

@@ -0,0 +1,12 @@
[Match]
Name=end0
[Network]
DNS=192.168.72.254
Address=192.168.72.2/24
Gateway=192.168.72.254
# to enable static IP on eth0/end0:
# $> cp 80-wired.network 80-wired.network.notused
# $> cp 52-static.network.static 52-static.network
# $> systemctl restart systemd-networkd.service

View File

@@ -0,0 +1,8 @@
[Match]
Name=!eth0 !end0
[Network]
DHCP=ipv4
[DHCP]
CriticalConnection=true

View File

@@ -0,0 +1,7 @@
#store kernel alias
ACTION=="add", SUBSYSTEM=="platform", ENV{OF_ALIAS_0}=="ethernet*", RUN+="/usr/sbin/stm32mp-net-alias-udev.sh alias $env{OF_ALIAS_0} %p"
#store link between path and interface name
ACTION=="add", SUBSYSTEM=="net", RUN+="/usr/sbin/stm32mp-net-alias-udev.sh interface $env{ID_NET_NAME} %p"
# for wlan
ACTION=="add", SUBSYSTEM=="net", RUN+="/usr/sbin/stm32mp-net-alias-wlan-udev.sh $env{DEVTYPE} $env{ID_NET_NAME}"

View File

@@ -0,0 +1,60 @@
#!/bin/sh -
# COPYRIGHT: Copyright (C) 2021, STMicroelectronics - All Rights Reserved
DEBUG=0
debug() {
if [ $DEBUG -eq 1 ]; then
echo $@ >> /tmp/stm32mp-net-alias-udev.log
fi
}
if [ $# -eq 2 ]; then
action=$1
devpath=$(echo $2 | sed "s/;//")
param1=""
else
action=$1
param1=$2
devpath=$(echo $3 | sed "s/;//")
fi
debug "Parameter: $1"
debug "Parameter: $2"
debug "Parameter: $3"
case $1 in
alias)
debug "--------ALIAS--------"
debug "devpath=$devpath"
debug "param1=$param1"
if [ -n "$devpath" ]; then
mkdir -p /tmp/net_alias/
if [ -n "$param1" ]; then
echo "$devpath" > /tmp/net_alias/$param1
fi
fi
;;
interface)
if [ -n "$devpath" ]; then
for talias in $(ls -1 /tmp/net_alias/*);
do
tmp_alias_path=$(cat $talias)
if $(echo $devpath | grep -q $tmp_alias_path) ; then
alias=$(basename $talias)
interface=$(basename $devpath)
soc_interface=$(basename $tmp_alias_path | sed 's/\(.*\)\.\(.*\)/\2/' )
debug "===> FOUND for $alias"
debug "' ' alias=$alias"
debug "' ' interface=$interface"
debug "' ' soc_interface=$soc_interface"
debug "ip link property add dev $interface altname $alias"
ip link property add dev $interface altname $alias
debug "ip link property add dev $interface altname $alias.$soc_interface"
ip link property add dev $interface altname $alias.$soc_interface
fi
done
fi
;;
esac

View File

@@ -0,0 +1,11 @@
#!/bin/sh -
# COPYRIGHT: Copyright (C) 2022, STMicroelectronics - All Rights Reserved
TYPE=$1
INTERFACE=$2
if [ "$TYPE" = "wlan" ]; then
ip links show wlan0 > /dev/null 2> /dev/null
if [ $? -eq 1 ]; then
ip link property add dev $INTERFACE altname wlan0
fi
fi

View File

@@ -0,0 +1 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"

View File

@@ -0,0 +1,44 @@
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Serial Getty on %I
Documentation=man:agetty(8) man:systemd-getty-generator(8)
Documentation=http://0pointer.de/blog/projects/serial-console.html
PartOf=dev-%i.device
ConditionPathExists=/dev/%i
After=systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target
After=rc-local.service
# If additional gettys are spawned during boot then we should make
# sure that this is synchronized before getty.target, even though
# getty.target didn't actually pull it in.
Before=getty.target
IgnoreOnIsolate=yes
# IgnoreOnIsolate causes issues with sulogin, if someone isolates
# rescue.target or starts rescue.service from multi-user.target or
# graphical.target.
Conflicts=rescue.service
Before=rescue.service
[Service]
Environment="TERM=xterm"
ExecStart=-/sbin/agetty -8 --autologin root -L --keep-baud %I @BAUDRATE@ $TERM
Type=idle
Restart=always
RestartSec=0
UtmpIdentifier=%I
TTYPath=/dev/%I
TTYReset=yes
TTYVHangup=yes
KillMode=process
IgnoreSIGPIPE=no
SendSIGHUP=yes
[Install]
WantedBy=getty.target

View File

@@ -0,0 +1,18 @@
PACKAGECONFIG:append = " \
firstboot \
coredump \
iptc \
"
PACKAGECONFIG:append = "${@bb.utils.contains('DISTRO_FEATURES', 'polkit', '', 'polkit_hostnamed_fallback', d)} "
WATCHDOG_TIMEOUT = "32"
NTP_SERVERS ??= ""
EXTRA_OEMESON += " ${@ '-Dntp-servers="${NTP_SERVERS}"' if '${NTP_SERVERS}' else ''}"
do_install:append() {
#Remove this service useless for our needs
rm -f ${D}/${rootlibexecdir}/systemd/system-generators/systemd-gpt-auto-generator
}

View File

@@ -0,0 +1,31 @@
# Copyright (C) 2019, STMicroelectronics - All Rights Reserved
SUMMARY = "Add apt configuration files for OpenSTLinux"
DESCRIPTION = "Add apt configuration files for OpenSTLinux"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
RDEPENDS:${PN} += " gnupg "
SRC_URI = "file://packages.openstlinux.st.com.list \
file://packages.openstlinux.st.com.gpg \
file://01-st-disclaimer \
file://disclaimer \
"
S = "${WORKDIR}"
inherit deploy
do_compile[noexec] = "1"
do_install() {
install -d ${D}/${sysconfdir}/apt/sources.list.d
install -d ${D}/${sysconfdir}/apt/trusted.gpg.d
install -d ${D}/${sysconfdir}/apt/apt.conf.d
install ${S}/packages.openstlinux.st.com.list ${D}/${sysconfdir}/apt/sources.list.d
install ${S}/packages.openstlinux.st.com.gpg ${D}/${sysconfdir}/apt/trusted.gpg.d
install ${S}/disclaimer ${D}/${sysconfdir}/apt/
install ${S}/01-st-disclaimer ${D}/${sysconfdir}/apt/apt.conf.d
}

View File

@@ -0,0 +1,2 @@
DPkg::Pre-Invoke {"echo ; fold -sw $(stty size | sed 's,.* ,,;s,^0$,40,' ) /etc/apt/disclaimer ; echo ; ";};
APT::Update::Pre-Invoke {"echo ; fold -sw $(stty size | sed 's,.* ,,;s,^0$,40,' ) /etc/apt/disclaimer ; echo ;";};

View File

@@ -0,0 +1,2 @@
The software package is provided AS IS, and by downloading it, you agree to be bound to the terms of the software license agreement (SLA).
The detailed content licenses can be found at https://wiki.st.com/stm32mpu/wiki/OpenSTLinux_licenses.

View File

@@ -0,0 +1 @@
deb http://packages.openstlinux.st.com/5.0 mickledore main updates untested

View File

@@ -0,0 +1,2 @@
RDEPENDS:${PN} += " gnupg "

View File

@@ -0,0 +1 @@
ALTERNATIVE_PRIORITY = "40"

View File

@@ -0,0 +1,20 @@
SUMMARY = "Writes build information to target filesystem on /etc/build"
LICENSE = "MIT"
PACKAGE_ARCH = "${MACHINE_ARCH}"
inherit image-buildinfo
IMAGE_BUILDINFO_FILE = "${sysconfdir}/build"
do_install(){
install -d ${D}/$(dirname "${IMAGE_BUILDINFO_FILE}")
}
BUILDINFODEST = "${D}"
# Configure buildinfo() from image-buildinfo class to generate expected info
IMAGE_BUILDINFO_VARS = "${BUILDCFG_VARS}"
# Set path to output build info file on image dir
IMAGE_ROOTFS = "${D}"
# Generate build info file
do_install[postfuncs] += "buildinfo"
# Always rebuild that recipe to avoid cache issue
do_install[nostamp] = "1"

View File

@@ -0,0 +1,22 @@
SUMMARY = "Information for support"
LICENSE = "GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-or-later;md5=fed54355545ffd980b814dab4a3b312c"
PACKAGE_ARCH = "${MACHINE_ARCH}"
PV = "1.1"
do_install() {
if [ "${TARGET_ARCH}" = "arm" ]; then
mkdir -p ${D}${sysconfdir}/st-info.d
touch ${D}${sysconfdir}/st-info.d/graphics-${PV}
printf "LIBGLES1=${PREFERRED_PROVIDER_virtual/libgles1}\n" > ${D}${sysconfdir}/st-info.d/graphics-${PV}
fi
}
# Make sure to update package as soon as EULA is accepted or not
do_install[vardeps] += "${@d.getVar('ACCEPT_EULA_'+d.getVar('MACHINE'))}"
FILES:${PN} = "${sysconfdir}/st-info.d"
ALLOW_EMPTY:${PN} = "1"

View File

@@ -0,0 +1,4 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
PACKAGECONFIG:remove:stm32mpcommon = "mozjs"
PACKAGECONFIG:append:stm32mpcommon = "duktape"

View File

@@ -0,0 +1,60 @@
#!/usr/bin/python3
import getopt
import re
import sys
with open('/proc/device-tree/compatible', 'r') as compatible:
if 'stm32mp15' in compatible.read():
word_length = 4 # Bytes
else:
word_length = 2 # Bytes
burst_length = 8 # Words
def usage():
print("Usage:")
print(" python stm32_ddr_pmu.py [-d <ddr_freq>] -f <perf_file>")
print(" -d ddr_freq: DDR frequency in MHz (533 MHz by default)")
print(" -f perf_file: text file containing the output of")
print(" perf stat -e stm32_ddr_pmu/read_cnt/,stm32_ddr_pmu/time_cnt/,stm32_ddr_pmu/write_cnt/ -a -o <perf_file> <command>")
print("The script considers bursts of %s words with %s bytes per word." % (burst_length, word_length))
sys.exit(2)
ddr_freq = 533
perf_file = None
dic = {}
try:
opts, args = getopt.getopt(sys.argv[1:], "d:f:")
except getopt.GetoptError:
print("Error: invalid option !")
usage()
for opt,arg in opts:
if opt == '-d':
ddr_freq = int(arg)
elif opt == '-f':
perf_file = arg
else:
usage()
if perf_file == None:
print("Error: no perf file !")
usage()
with open(perf_file) as file:
lines = file.readlines()
for line in lines:
a = re.match(".* ([0-9]+).*stm32_ddr_pmu\/(.*)\/.*", line)
try:
dic[a.groups()[1]] = a.groups()[0]
except:
continue
constant = word_length * burst_length * ddr_freq * 1000000 / int(dic['time_cnt']) / (1024 * 1024)
read_bw = int(dic['read_cnt']) * constant
write_bw = int(dic['write_cnt']) * constant
print("R = %s MB/s, W = %s MB/s, R&W = %s MB/s (DDR @ %s MHz)" % (read_bw.__round__(),
write_bw.__round__(), (read_bw + write_bw).__round__(), ddr_freq))

View File

@@ -0,0 +1,16 @@
SUMMARY = "STM32 tool to convert the 'perf' tool counters into understandable MB/s"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
RDEPENDS:${PN} += " python3-core "
SRC_URI += " \
file://stm32_ddr_pmu.py \
"
do_install() {
install -d ${D}/${bindir}
install -m 0755 ${WORKDIR}/stm32_ddr_pmu.py ${D}/${bindir}
}
FILES:${PN} = "${bindir}/stm32_ddr_pmu.py"

View File

@@ -0,0 +1,8 @@
PACKAGECONFIG = " ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 xcb', '', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'egl glesv2', '', d)} \
"
do_install:append() {
install -d ${D}${bindir}/
install -m 0755 ${B}/util/cairo-trace/cairo-trace ${D}${bindir}/
}

View File

@@ -0,0 +1,4 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
PACKAGECONFIG = "gstreamer"
DEPENDS += "gstreamer1.0 gstreamer1.0-plugins-base"

View File

@@ -0,0 +1,16 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
PACKAGECONFIG_GL = ""
PACKAGECONFIG ??= " \
${PACKAGECONFIG_GL} \
${@bb.utils.filter('DISTRO_FEATURES', 'alsa pulseaudio', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland gles2', '', d)} \
${@bb.utils.contains("TUNE_FEATURES", "neon","arm-neon","",d)} \
kmsdrm \
"
EXTRA_OECMAKE += " \
-DSDL_VIVANTE=OFF \
-DSDL_VULKAN=OFF \
-DSDL_OPENGL=OFF \
"

View File

@@ -0,0 +1,5 @@
PACKAGECONFIG = "drm osmesa freetype2 gbm egl gles1 gles2 \
x11 glew glu glx \
${@bb.utils.filter('DISTRO_FEATURES', 'wayland', d)} \
"

View File

@@ -0,0 +1,46 @@
From f1482e88c2295b9c7288f5b273335a8e18039de8 Mon Sep 17 00:00:00 2001
From: Fabio Berton <fabio.berton@ossystems.com.br>
Date: Wed, 12 Jun 2019 14:18:31 -0300
Subject: [PATCH] Allow enable DRI without DRI drivers
Organization: O.S. Systems Software LTDA.
Upstream-Status: Pending
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
meson.build | 2 +-
meson_options.txt | 6 ++++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 0e50bb26c0a..de065c290d6 100644
--- a/meson.build
+++ b/meson.build
@@ -137,7 +137,7 @@ with_dri_r200 = dri_drivers.contains('r200')
with_dri_nouveau = dri_drivers.contains('nouveau')
with_dri_swrast = dri_drivers.contains('swrast')
-with_dri = dri_drivers.length() != 0 and dri_drivers != ['']
+with_dri = get_option('dri') or (dri_drivers.length() != 0 and dri_drivers != [''])
gallium_drivers = get_option('gallium-drivers')
if gallium_drivers.contains('auto')
diff --git a/meson_options.txt b/meson_options.txt
index fcd49efea27..0529200b3bb 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -34,6 +34,12 @@ option(
choices : ['auto', 'true', 'false'],
description : 'enable support for dri3'
)
+option(
+ 'dri',
+ type : 'boolean',
+ value : false,
+ description : 'enable support for dri'
+)
option(
'dri-drivers',
type : 'array',

Some files were not shown because too many files have changed in this diff Show More