mirror of
https://git.yoctoproject.org/poky
synced 2026-01-30 13:28:43 +01:00
Compare commits
25 Commits
uninative-
...
2.7_M3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
753e2a0ede | ||
|
|
c96d8de352 | ||
|
|
28fb15c56f | ||
|
|
588a4c58e8 | ||
|
|
9a1faba274 | ||
|
|
202b7d0521 | ||
|
|
8ded31e052 | ||
|
|
ddc9d240f4 | ||
|
|
95d6ad04fb | ||
|
|
f0d225fcd5 | ||
|
|
28f9cf565a | ||
|
|
e63d516db3 | ||
|
|
5c2dca7e75 | ||
|
|
8c7ec72e6d | ||
|
|
5fa73c1392 | ||
|
|
800c32096c | ||
|
|
34fa190d95 | ||
|
|
c9f2260820 | ||
|
|
15f2cefac4 | ||
|
|
5f6156b32c | ||
|
|
0a9161855c | ||
|
|
8c582d39ff | ||
|
|
3a1d31dee1 | ||
|
|
7f15c3fe2b | ||
|
|
2f7749c12f |
@@ -524,7 +524,7 @@ def fetcher_parse_save():
|
||||
def fetcher_parse_done():
|
||||
_checksum_cache.save_merge()
|
||||
|
||||
def fetcher_compare_revisions():
|
||||
def fetcher_compare_revisions(d):
|
||||
"""
|
||||
Compare the revisions in the persistant cache with current values and
|
||||
return true/false on whether they've changed.
|
||||
@@ -1403,7 +1403,7 @@ class FetchMethod(object):
|
||||
Fetch urls
|
||||
Assumes localpath was called first
|
||||
"""
|
||||
raise NoMethodError(url)
|
||||
raise NoMethodError(urldata.url)
|
||||
|
||||
def unpack(self, urldata, rootdir, data):
|
||||
iterate = False
|
||||
@@ -1547,7 +1547,7 @@ class FetchMethod(object):
|
||||
Check the status of a URL
|
||||
Assumes localpath was called first
|
||||
"""
|
||||
logger.info("URL %s could not be checked for status since no method exists.", url)
|
||||
logger.info("URL %s could not be checked for status since no method exists.", urldata.url)
|
||||
return True
|
||||
|
||||
def latest_revision(self, ud, d, name):
|
||||
@@ -1555,7 +1555,7 @@ class FetchMethod(object):
|
||||
Look in the cache for the latest revision, if not present ask the SCM.
|
||||
"""
|
||||
if not hasattr(self, "_latest_revision"):
|
||||
raise ParameterError("The fetcher for this URL does not support _latest_revision", url)
|
||||
raise ParameterError("The fetcher for this URL does not support _latest_revision", ud.url)
|
||||
|
||||
revs = bb.persist_data.persist('BB_URI_HEADREVS', d)
|
||||
key = self.generate_revision_key(ud, d, name)
|
||||
@@ -1786,7 +1786,7 @@ class Fetch(object):
|
||||
|
||||
for url in urls:
|
||||
if url not in self.ud:
|
||||
self.ud[url] = FetchData(url, d)
|
||||
self.ud[url] = FetchData(url, self.d)
|
||||
ud = self.ud[url]
|
||||
ud.setup_localpath(self.d)
|
||||
|
||||
|
||||
@@ -33,11 +33,14 @@ import logging
|
||||
import errno
|
||||
import bb
|
||||
import bb.progress
|
||||
import socket
|
||||
import http.client
|
||||
import urllib.request, urllib.parse, urllib.error
|
||||
from bb.fetch2 import FetchMethod
|
||||
from bb.fetch2 import FetchError
|
||||
from bb.fetch2 import logger
|
||||
from bb.fetch2 import runfetchcmd
|
||||
from bb.fetch2 import FetchConnectionCache
|
||||
from bb.utils import export_proxies
|
||||
from bs4 import BeautifulSoup
|
||||
from bs4 import SoupStrainer
|
||||
@@ -132,10 +135,6 @@ class Wget(FetchMethod):
|
||||
return True
|
||||
|
||||
def checkstatus(self, fetch, ud, d, try_again=True):
|
||||
import urllib.request, urllib.error, urllib.parse, socket, http.client
|
||||
from urllib.response import addinfourl
|
||||
from bb.fetch2 import FetchConnectionCache
|
||||
|
||||
class HTTPConnectionCache(http.client.HTTPConnection):
|
||||
if fetch.connection_cache:
|
||||
def connect(self):
|
||||
@@ -185,7 +184,7 @@ class Wget(FetchMethod):
|
||||
# request.
|
||||
|
||||
# Don't close connection when connection_cache is enabled,
|
||||
if fetch.connection_cache is None:
|
||||
if fetch.connection_cache is None:
|
||||
headers["Connection"] = "close"
|
||||
else:
|
||||
headers["Connection"] = "Keep-Alive" # Works for HTTP/1.0
|
||||
@@ -252,7 +251,7 @@ class Wget(FetchMethod):
|
||||
pass
|
||||
closed = False
|
||||
|
||||
resp = addinfourl(fp_dummy(), r.msg, req.get_full_url())
|
||||
resp = urllib.response.addinfourl(fp_dummy(), r.msg, req.get_full_url())
|
||||
resp.code = r.status
|
||||
resp.msg = r.reason
|
||||
|
||||
@@ -271,17 +270,16 @@ class Wget(FetchMethod):
|
||||
fp.read()
|
||||
fp.close()
|
||||
|
||||
newheaders = dict((k,v) for k,v in list(req.headers.items())
|
||||
newheaders = dict((k, v) for k, v in list(req.headers.items())
|
||||
if k.lower() not in ("content-length", "content-type"))
|
||||
return self.parent.open(urllib.request.Request(req.get_full_url(),
|
||||
headers=newheaders,
|
||||
origin_req_host=req.origin_req_host,
|
||||
unverifiable=True))
|
||||
|
||||
"""
|
||||
Some servers (e.g. GitHub archives, hosted on Amazon S3) return 403
|
||||
Forbidden when they actually mean 405 Method Not Allowed.
|
||||
"""
|
||||
|
||||
# Some servers (e.g. GitHub archives, hosted on Amazon S3) return 403
|
||||
# Forbidden when they actually mean 405 Method Not Allowed.
|
||||
http_error_403 = http_error_405
|
||||
|
||||
|
||||
@@ -292,15 +290,15 @@ class Wget(FetchMethod):
|
||||
"""
|
||||
def redirect_request(self, req, fp, code, msg, headers, newurl):
|
||||
newreq = urllib.request.HTTPRedirectHandler.redirect_request(self, req, fp, code, msg, headers, newurl)
|
||||
newreq.get_method = lambda: req.get_method()
|
||||
newreq.get_method = req.get_method
|
||||
return newreq
|
||||
exported_proxies = export_proxies(d)
|
||||
|
||||
handlers = [FixedHTTPRedirectHandler, HTTPMethodFallback]
|
||||
if export_proxies:
|
||||
if exported_proxies:
|
||||
handlers.append(urllib.request.ProxyHandler())
|
||||
handlers.append(CacheHTTPHandler())
|
||||
# XXX: Since Python 2.7.9 ssl cert validation is enabled by default
|
||||
# Since Python 2.7.9 ssl cert validation is enabled by default
|
||||
# see PEP-0476, this causes verification errors on some https servers
|
||||
# so disable by default.
|
||||
import ssl
|
||||
@@ -319,19 +317,19 @@ class Wget(FetchMethod):
|
||||
'''Adds Basic auth to http request, pass in login:password as string'''
|
||||
import base64
|
||||
encodeuser = base64.b64encode(login_str.encode('utf-8')).decode("utf-8")
|
||||
authheader = "Basic %s" % encodeuser
|
||||
authheader = "Basic %s" % encodeuser
|
||||
r.add_header("Authorization", authheader)
|
||||
|
||||
if ud.user:
|
||||
add_basic_auth(ud.user, r)
|
||||
if ud.user and ud.pswd:
|
||||
add_basic_auth(ud.user + ':' + ud.pswd, r)
|
||||
|
||||
try:
|
||||
import netrc, urllib.parse
|
||||
import netrc
|
||||
n = netrc.netrc()
|
||||
login, unused, password = n.authenticators(urllib.parse.urlparse(uri).hostname)
|
||||
add_basic_auth("%s:%s" % (login, password), r)
|
||||
except (TypeError, ImportError, IOError, netrc.NetrcParseError):
|
||||
pass
|
||||
pass
|
||||
|
||||
with opener.open(r) as response:
|
||||
pass
|
||||
@@ -396,18 +394,14 @@ class Wget(FetchMethod):
|
||||
(oldpn, oldpv, oldsuffix) = old
|
||||
(newpn, newpv, newsuffix) = new
|
||||
|
||||
"""
|
||||
Check for a new suffix type that we have never heard of before
|
||||
"""
|
||||
if (newsuffix):
|
||||
# Check for a new suffix type that we have never heard of before
|
||||
if newsuffix:
|
||||
m = self.suffix_regex_comp.search(newsuffix)
|
||||
if not m:
|
||||
bb.warn("%s has a possible unknown suffix: %s" % (newpn, newsuffix))
|
||||
return False
|
||||
|
||||
"""
|
||||
Not our package so ignore it
|
||||
"""
|
||||
# Not our package so ignore it
|
||||
if oldpn != newpn:
|
||||
return False
|
||||
|
||||
@@ -473,10 +467,9 @@ class Wget(FetchMethod):
|
||||
|
||||
return ""
|
||||
|
||||
def _check_latest_version_by_dir(self, dirver, package, package_regex,
|
||||
current_version, ud, d):
|
||||
def _check_latest_version_by_dir(self, dirver, package, package_regex, current_version, ud, d):
|
||||
"""
|
||||
Scan every directory in order to get upstream version.
|
||||
Scan every directory in order to get upstream version.
|
||||
"""
|
||||
version_dir = ['', '', '']
|
||||
version = ['', '', '']
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
section in the Yocto Project Reference Manual.
|
||||
</note>
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo apt-get install &UBUNTU_HOST_PACKAGES_ESSENTIAL; libsdl1.2-dev xterm
|
||||
$ sudo apt-get install &UBUNTU_HOST_PACKAGES_ESSENTIAL;
|
||||
</literallayout>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@@ -6323,10 +6323,181 @@
|
||||
</literallayout>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="replicating-a-build-offline">
|
||||
<title>Replicating a Build Offline</title>
|
||||
|
||||
<para>
|
||||
It can be useful to take a "snapshot" of upstream sources
|
||||
used in a build and then use that "snapshot" later to
|
||||
replicate the build offline.
|
||||
To do so, you need to first prepare and populate your downloads
|
||||
directory your "snapshot" of files.
|
||||
Once your downloads directory is ready, you can use it at
|
||||
any time and from any machine to replicate your build.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Follow these steps to populate your Downloads directory:
|
||||
<orderedlist>
|
||||
<listitem><para>
|
||||
<emphasis>Create a Clean Downloads Directory:</emphasis>
|
||||
Start with an empty downloads directory
|
||||
(<ulink url='&YOCTO_DOCS_REF_URL;#var-DL_DIR'><filename>DL_DIR</filename></ulink>).
|
||||
You start with an empty downloads directory by either
|
||||
removing the files in the existing directory or by
|
||||
setting
|
||||
<filename>DL_DIR</filename> to point to either an
|
||||
empty location or one that does not yet exist.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<emphasis>Generate Tarballs of the Source Git Repositories:</emphasis>
|
||||
Edit your <filename>local.conf</filename> configuration
|
||||
file as follows:
|
||||
<literallayout class='monospaced'>
|
||||
DL_DIR = "/home/<replaceable>your-download-dir</replaceable>/"
|
||||
BB_GENERATE_MIRROR_TARBALLS = "1"
|
||||
</literallayout>
|
||||
During the fetch process in the next step, BitBake
|
||||
gathers the source files and creates tarballs in
|
||||
the directory pointed to by <filename>DL_DIR</filename>.
|
||||
See the
|
||||
<ulink url='&YOCTO_DOCS_REF_URL;#var-BB_GENERATE_MIRROR_TARBALLS'><filename>BB_GENERATE_MIRROR_TARBALLS</filename></ulink>
|
||||
variable for more information.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<emphasis>Populate Your Downloads Directory Without Building:</emphasis>
|
||||
Use BitBake to fetch your sources but inhibit the
|
||||
build:
|
||||
<literallayout class='monospaced'>
|
||||
$ bitbake <replaceable>target</replaceable> --runonly=fetch
|
||||
</literallayout>
|
||||
The downloads directory (i.e.
|
||||
<filename>${DL_DIR}</filename>) now has a "snapshot" of
|
||||
the source files in the form of tarballs, which can
|
||||
be used for the build.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<emphasis>Optionally Remove Any Git or other SCM Subdirectories From the Downloads Directory:</emphasis>
|
||||
If you want, you can clean up your downloads directory
|
||||
by removing any Git or other Source Control Management
|
||||
(SCM) subdirectories such as
|
||||
<filename>${DL_DIR}/git2/*</filename>.
|
||||
The tarballs already contain these subdirectories.
|
||||
</para></listitem>
|
||||
</orderedlist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Once your downloads directory has everything it needs regarding
|
||||
source files, you can create your "own-mirror" and build
|
||||
your target.
|
||||
Understand that you can use the files to build the target
|
||||
offline from any machine and at any time.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Follow these steps to build your target using the files in the
|
||||
downloads directory:
|
||||
<orderedlist>
|
||||
<listitem><para>
|
||||
<emphasis>Using Local Files Only:</emphasis>
|
||||
Inside your <filename>local.conf</filename> file, add
|
||||
the
|
||||
<ulink url='&YOCTO_DOCS_REF_URL;#var-SOURCE_MIRROR_URL'><filename>SOURCE_MIRROR_URL</filename></ulink>
|
||||
variable,
|
||||
inherit the <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-own-mirrors'><filename>own-mirrors</filename></ulink>
|
||||
class, and use the
|
||||
<ulink url='&YOCTO_DOCS_BB_URL;#var-bb-BB_NO_NETWORK'><filename>BB_NO_NETWORK</filename></ulink>
|
||||
variable to your <filename>local.conf</filename>.
|
||||
<literallayout class='monospaced'>
|
||||
SOURCE_MIRROR_URL ?= "file:///home/<replaceable>your-download-dir</replaceable>/"
|
||||
INHERIT += "own-mirrors"
|
||||
BB_NO_NETWORK = "1"
|
||||
</literallayout>
|
||||
The <filename>SOURCE_MIRROR_URL</filename> and
|
||||
<filename>own-mirror</filename> class set up the system
|
||||
to use the downloads directory as your "own mirror".
|
||||
Using the <filename>BB_NO_NETWORK</filename>
|
||||
variable makes sure that BitBake's fetching process
|
||||
in step 3 stays local, which means files from
|
||||
your "own-mirror" are used.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<emphasis>Start With a Clean Build:</emphasis>
|
||||
You can start with a clean build by removing the
|
||||
<filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink><filename>}</filename>
|
||||
directory or using a new
|
||||
<ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<emphasis>Build Your Target:</emphasis>
|
||||
Use BitBake to build your target:
|
||||
<literallayout class='monospaced'>
|
||||
$ bitbake <replaceable>target</replaceable>
|
||||
</literallayout>
|
||||
The build completes using the known local "snapshot" of
|
||||
source files from your mirror.
|
||||
The resulting tarballs for your "snapshot" of source
|
||||
files are in the downloads directory.
|
||||
<note>
|
||||
<para>The offline build does not work if recipes
|
||||
attempt to find the latest version of software
|
||||
by setting
|
||||
<ulink url='&YOCTO_DOCS_REF_URL;#var-SRCREV'><filename>SRCREV</filename></ulink>
|
||||
to
|
||||
<filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-AUTOREV'><filename>AUTOREV</filename></ulink><filename>}</filename>:
|
||||
<literallayout class='monospaced'>
|
||||
SRCREV = "${AUTOREV}"
|
||||
</literallayout>
|
||||
When a recipe sets
|
||||
<filename>SRCREV</filename> to
|
||||
<filename>${AUTOREV}</filename>, the build system
|
||||
accesses the network in an attempt to determine the
|
||||
latest version of software from the SCM.
|
||||
Typically, recipes that use
|
||||
<filename>AUTOREV</filename> are custom or
|
||||
modified recipes.
|
||||
Recipes that reside in public repositories
|
||||
usually do not use <filename>AUTOREV</filename>.
|
||||
</para>
|
||||
|
||||
<para>If you do have recipes that use
|
||||
<filename>AUTOREV</filename>, you can take steps to
|
||||
still use the recipes in an offline build.
|
||||
Do the following:
|
||||
<orderedlist>
|
||||
<listitem><para>
|
||||
Use a configuration generated by
|
||||
enabling
|
||||
<link linkend='maintaining-build-output-quality'>build history</link>.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Use the
|
||||
<filename>buildhistory-collect-srcrevs</filename>
|
||||
command to collect the stored
|
||||
<filename>SRCREV</filename> values from
|
||||
the build's history.
|
||||
For more information on collecting these
|
||||
values, see the
|
||||
"<link linkend='build-history-package-information'>Build History Package Information</link>"
|
||||
section.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Once you have the correct source
|
||||
revisions, you can modify those recipes
|
||||
to to set <filename>SRCREV</filename>
|
||||
to specific versions of the software.
|
||||
</para></listitem>
|
||||
</orderedlist>
|
||||
</para>
|
||||
</note>
|
||||
</para></listitem>
|
||||
</orderedlist>
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<section id='speeding-up-a-build'>
|
||||
<title>Speeding Up a Build</title>
|
||||
|
||||
|
||||
@@ -69,17 +69,21 @@
|
||||
<!ENTITY OE_INIT_FILE "oe-init-build-env">
|
||||
<!ENTITY UBUNTU_HOST_PACKAGES_ESSENTIAL "gawk wget git-core diffstat unzip texinfo gcc-multilib \
|
||||
build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
|
||||
xz-utils debianutils iputils-ping">
|
||||
xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev \
|
||||
xterm">
|
||||
<!ENTITY FEDORA_HOST_PACKAGES_ESSENTIAL "gawk make wget tar bzip2 gzip python3 unzip perl patch \
|
||||
diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath \
|
||||
ccache perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue perl-bignum socat \
|
||||
python3-pexpect findutils which file cpio python python3-pip xz">
|
||||
python3-pexpect findutils which file cpio python python3-pip xz python3-GitPython \
|
||||
python3-jinja2 SDL-devel xterm">
|
||||
<!ENTITY OPENSUSE_HOST_PACKAGES_ESSENTIAL "python gcc gcc-c++ git chrpath make wget python-xml \
|
||||
diffstat makeinfo python-curses patch socat python3 python3-curses tar python3-pip \
|
||||
python3-pexpect xz which">
|
||||
python3-pexpect xz which python3-Jinja2 Mesa-libEGL1
|
||||
$ sudo pip3 install GitPython libSDL-devel xterm">
|
||||
<!ENTITY CENTOS_HOST_PACKAGES_ESSENTIAL "-y epel-release
|
||||
$ sudo yum makecache
|
||||
$ sudo yum install gawk make wget tar bzip2 gzip python unzip perl patch \
|
||||
diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath socat \
|
||||
perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue python34-pip xz \
|
||||
which">
|
||||
which SDL-devel xterm
|
||||
$ sudo pip3 install GitPython jinja2">
|
||||
|
||||
@@ -192,26 +192,12 @@
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo apt-get install &UBUNTU_HOST_PACKAGES_ESSENTIAL;
|
||||
</literallayout></para></listitem>
|
||||
<listitem><para><emphasis>Graphical and Eclipse Plug-In Extras:</emphasis>
|
||||
Packages recommended if the host system has graphics
|
||||
support or if you are going to use the Eclipse
|
||||
IDE:
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo apt-get install libsdl1.2-dev xterm
|
||||
</literallayout></para></listitem>
|
||||
<listitem><para><emphasis>Documentation:</emphasis>
|
||||
Packages needed if you are going to build out the
|
||||
Yocto Project documentation manuals:
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo apt-get install make xsltproc docbook-utils fop dblatex xmlto
|
||||
</literallayout></para></listitem>
|
||||
<listitem><para><emphasis>OpenEmbedded Self-Test (<filename>oe-selftest</filename>):</emphasis>
|
||||
Packages needed if you are going to run
|
||||
<filename>oe-selftest</filename>:
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo apt-get install python-git
|
||||
</literallayout>
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</section>
|
||||
@@ -229,27 +215,13 @@
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo dnf install &FEDORA_HOST_PACKAGES_ESSENTIAL;
|
||||
</literallayout></para></listitem>
|
||||
<listitem><para><emphasis>Graphical and Eclipse Plug-In Extras:</emphasis>
|
||||
Packages recommended if the host system has graphics
|
||||
support or if you are going to use the Eclipse
|
||||
IDE:
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo dnf install SDL-devel xterm
|
||||
</literallayout></para></listitem>
|
||||
<listitem><para><emphasis>Documentation:</emphasis>
|
||||
Packages needed if you are going to build out the
|
||||
Yocto Project documentation manuals:
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo dnf install make docbook-style-dsssl docbook-style-xsl \
|
||||
$ sudo dnf install docbook-style-dsssl docbook-style-xsl \
|
||||
docbook-dtds docbook-utils fop libxslt dblatex xmlto
|
||||
</literallayout></para></listitem>
|
||||
<listitem><para><emphasis>OpenEmbedded Self-Test (<filename>oe-selftest</filename>):</emphasis>
|
||||
Packages needed if you are going to run
|
||||
<filename>oe-selftest</filename>:
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo dnf install python3-GitPython
|
||||
</literallayout>
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</section>
|
||||
@@ -267,33 +239,13 @@
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo zypper install &OPENSUSE_HOST_PACKAGES_ESSENTIAL;
|
||||
</literallayout></para></listitem>
|
||||
<listitem><para><emphasis>Graphical and Eclipse Plug-In Extras:</emphasis>
|
||||
Packages recommended if the host system has graphics
|
||||
support or if you are going to use the Eclipse
|
||||
IDE:
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo zypper install libSDL-devel xterm
|
||||
</literallayout></para></listitem>
|
||||
<listitem><para><emphasis>Documentation:</emphasis>
|
||||
Packages needed if you are going to build out the
|
||||
Yocto Project documentation manuals:
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo zypper install make dblatex xmlto
|
||||
</literallayout></para></listitem>
|
||||
<listitem><para><emphasis>OpenEmbedded Self-Test (<filename>oe-selftest</filename>):</emphasis>
|
||||
Packages needed if you are going to run
|
||||
<filename>oe-selftest</filename>:
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo zypper install python-GitPython
|
||||
$ sudo zypper install dblatex xmlto
|
||||
</literallayout></para></listitem>
|
||||
</itemizedlist>
|
||||
<note>
|
||||
Sanity testing, through the
|
||||
<link linkend='ref-classes-testimage*'>testimage</link>
|
||||
classes, does not work on systems using the
|
||||
<ulink url='https://en.opensuse.org/Portal:Wicked'>Wicked</ulink>
|
||||
network manager.
|
||||
</note>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@@ -308,7 +260,7 @@
|
||||
Packages needed to build an image for a headless
|
||||
system:
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo yum install &CENTOS_HOST_PACKAGES_ESSENTIAL; SDL-devel xterm
|
||||
$ sudo yum install &CENTOS_HOST_PACKAGES_ESSENTIAL;
|
||||
</literallayout>
|
||||
<note><title>Notes</title>
|
||||
<itemizedlist>
|
||||
@@ -330,27 +282,13 @@
|
||||
</itemizedlist>
|
||||
</note>
|
||||
</para></listitem>
|
||||
<listitem><para><emphasis>Graphical and Eclipse Plug-In Extras:</emphasis>
|
||||
Packages recommended if the host system has graphics
|
||||
support or if you are going to use the Eclipse
|
||||
IDE:
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo yum install SDL-devel xterm
|
||||
</literallayout></para></listitem>
|
||||
<listitem><para><emphasis>Documentation:</emphasis>
|
||||
Packages needed if you are going to build out the
|
||||
Yocto Project documentation manuals:
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo yum install make docbook-style-dsssl docbook-style-xsl \
|
||||
$ sudo yum install docbook-style-dsssl docbook-style-xsl \
|
||||
docbook-dtds docbook-utils fop libxslt dblatex xmlto
|
||||
</literallayout></para></listitem>
|
||||
<listitem><para><emphasis>OpenEmbedded Self-Test (<filename>oe-selftest</filename>):</emphasis>
|
||||
Packages needed if you are going to run
|
||||
<filename>oe-selftest</filename>:
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo yum install GitPython
|
||||
</literallayout>
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@@ -3877,7 +3877,7 @@
|
||||
<filename>DISTRO_FEATURES_DEFAULT</filename> from a
|
||||
custom distro configuration file:
|
||||
<literallayout class='monospaced'>
|
||||
DISTRO_FEATURES ?= "${DISTRO_FEATURES_DEFAULT} ${DISTRO_FEATURES_LIBC} myfeature"
|
||||
DISTRO_FEATURES ?= "${DISTRO_FEATURES_DEFAULT} myfeature"
|
||||
</literallayout>
|
||||
</para>
|
||||
</glossdef>
|
||||
@@ -3924,13 +3924,14 @@
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<!--
|
||||
<glossentry id='var-DISTRO_FEATURES_LIBC'><glossterm>DISTRO_FEATURES_LIBC</glossterm>
|
||||
<info>
|
||||
DISTRO_FEATURES_LIBC[doc] = "Specifies the list of distro features that are specific to the C library (libc)."
|
||||
</info>
|
||||
<glossdef>
|
||||
<para role="glossdeffirst">
|
||||
<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
|
||||
<para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" />
|
||||
A convenience variable that specifies the list of distro
|
||||
features that are specific to the C library
|
||||
(<filename>libc</filename>).
|
||||
@@ -3940,6 +3941,7 @@
|
||||
</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
-->
|
||||
|
||||
<glossentry id='var-DISTRO_FEATURES_NATIVE'><glossterm>DISTRO_FEATURES_NATIVE</glossterm>
|
||||
<info>
|
||||
@@ -6917,6 +6919,44 @@
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry id='var-INHIBIT_SYSROOT_STRIP'><glossterm>INHIBIT_SYSROOT_STRIP</glossterm>
|
||||
<info>
|
||||
INHIBIT_SYSROOT_STRIP[doc] = "If set to "1", causes the build to not strip binaries in the resulting sysroot."
|
||||
</info>
|
||||
<glossdef>
|
||||
<para role="glossdeffirst">
|
||||
<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
|
||||
If set to "1", causes the build to not strip binaries in
|
||||
the resulting sysroot.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
By default, the OpenEmbedded build system strips
|
||||
binaries in the resulting sysroot.
|
||||
When you specifically set the
|
||||
<filename>INHIBIT_SYSROOT_STRIP</filename> variable to
|
||||
"1" in your recipe, you inhibit this stripping.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If you want to use this variable, include the
|
||||
<link linkend='ref-classes-staging'><filename>staging</filename></link>
|
||||
class.
|
||||
This class uses a <filename>sys_strip()</filename>
|
||||
function to test for the variable and acts accordingly.
|
||||
<note>
|
||||
Use of the <filename>INHIBIT_SYSROOT_STRIP</filename>
|
||||
variable occurs in rare and special circumstances.
|
||||
For example, suppose you are building bare-metal
|
||||
firmware by using an external GCC toolchain.
|
||||
Furthermore, even if the toolchain's binaries are
|
||||
strippable, other files exist that are needed for the
|
||||
build that are not strippable.
|
||||
</note>
|
||||
</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry id='var-INITRAMFS_FSTYPES'><glossterm>INITRAMFS_FSTYPES</glossterm>
|
||||
<info>
|
||||
INITRAMFS_FSTYPES[doc] = "Defines the format for the output image of an initial RAM filesystem (initramfs), which is used during boot."
|
||||
@@ -13758,7 +13798,7 @@
|
||||
</para></listitem>
|
||||
<listitem><para><emphasis><filename>maxdate</filename> -</emphasis>
|
||||
Apply the patch only if <filename>SRCDATE</filename>
|
||||
is not later than <filename>mindate</filename>.
|
||||
is not later than <filename>maxdate</filename>.
|
||||
</para></listitem>
|
||||
<listitem><para><emphasis><filename>minrev</filename> -</emphasis>
|
||||
Apply the patch only if <filename>SRCREV</filename>
|
||||
|
||||
@@ -6,10 +6,9 @@
|
||||
# to the distro running on the build machine.
|
||||
#
|
||||
|
||||
UNINATIVE_MAXGLIBCVERSION = "2.28"
|
||||
|
||||
UNINATIVE_URL ?= "http://downloads.yoctoproject.org/releases/uninative/2.3/"
|
||||
UNINATIVE_CHECKSUM[aarch64] ?= "e495046969c796b7fbbaad1ec86d76eca84d83098f50525b8a4124cc8685eaed"
|
||||
UNINATIVE_CHECKSUM[i686] ?= "44253cddbf629082568cea4fff59419106871a0cf81b4845b5d34e7014887b20"
|
||||
UNINATIVE_CHECKSUM[x86_64] ?= "c6954563dad3c95608117c6fc328099036c832bbd924ebf5fdccb622fc0a8684"
|
||||
UNINATIVE_MAXGLIBCVERSION = "2.29"
|
||||
|
||||
UNINATIVE_URL ?= "http://downloads.yoctoproject.org/releases/uninative/2.4/"
|
||||
UNINATIVE_CHECKSUM[aarch64] ?= "af2e2faf6cf00ff45cc1bcd5e3fb00cee7f79b3ec7c3be15917ad4ff8c154cfe"
|
||||
UNINATIVE_CHECKSUM[i686] ?= "fafacfc537a6ce2bd122bd16c146881ab5ac69bd575abf6cb68a0dd33fa70ea2"
|
||||
UNINATIVE_CHECKSUM[x86_64] ?= "06f91685b782f2ccfedf3070b3ba0fe4a5ba2f0766dad5c9d1642dccf95accd0"
|
||||
|
||||
@@ -2,8 +2,6 @@ DEFAULTTUNE ?= "armv8a-crc"
|
||||
|
||||
TUNEVALID[armv8a] = "Enable instructions for ARMv8-a"
|
||||
TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'armv8a', ' -march=armv8-a', '', d)}"
|
||||
TUNEVALID[simd] = "Enable instructions for ARMv8-a Advanced SIMD and floating-point"
|
||||
TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'simd', '+simd', '', d)}"
|
||||
TUNEVALID[crc] = "Enable instructions for ARMv8-a Cyclic Redundancy Check (CRC)"
|
||||
TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'crc', '+crc', '', d)}"
|
||||
TUNEVALID[crypto] = "Enable instructions for ARMv8-a cryptographic"
|
||||
@@ -18,11 +16,11 @@ ARMPKGARCH_tune-armv8a ?= "armv8a"
|
||||
ARMPKGARCH_tune-armv8a-crc ?= "armv8a"
|
||||
ARMPKGARCH_tune-armv8a-crypto ?= "armv8a"
|
||||
ARMPKGARCH_tune-armv8a-crc-crypto ?= "armv8a"
|
||||
TUNE_FEATURES_tune-armv8a = "aarch64 armv8a simd"
|
||||
TUNE_FEATURES_tune-armv8a = "aarch64 armv8a"
|
||||
TUNE_FEATURES_tune-armv8a-crc = "${TUNE_FEATURES_tune-armv8a} crc"
|
||||
TUNE_FEATURES_tune-armv8a-crypto = "${TUNE_FEATURES_tune-armv8a} crypto"
|
||||
TUNE_FEATURES_tune-armv8a-crc-crypto = "${TUNE_FEATURES_tune-armv8a-crc} crypto"
|
||||
PACKAGE_EXTRA_ARCHS_tune-armv8a = "aarch64 armv8a simd"
|
||||
PACKAGE_EXTRA_ARCHS_tune-armv8a = "aarch64 armv8a"
|
||||
PACKAGE_EXTRA_ARCHS_tune-armv8a-crc = "${PACKAGE_EXTRA_ARCHS_tune-armv8a} crc"
|
||||
PACKAGE_EXTRA_ARCHS_tune-armv8a-crypto = "${PACKAGE_EXTRA_ARCHS_tune-armv8a} crypto"
|
||||
PACKAGE_EXTRA_ARCHS_tune-armv8a-crc-crypto = "${PACKAGE_EXTRA_ARCHS_tune-armv8a-crc} crypto"
|
||||
|
||||
@@ -10,8 +10,8 @@ require conf/machine/include/arm/arch-armv8a.inc
|
||||
AVAILTUNES += "cortexa32 cortexa32-crypto"
|
||||
ARMPKGARCH_tune-cortexa32 = "cortexa32"
|
||||
ARMPKGARCH_tune-cortexa32-crypto = "cortexa32"
|
||||
TUNE_FEATURES_tune-cortexa32 = "aarch64 cortexa32 simd crc"
|
||||
TUNE_FEATURES_tune-cortexa32-crypto = "aarch64 cortexa32 simd crc crypto"
|
||||
TUNE_FEATURES_tune-cortexa32 = "aarch64 cortexa32 crc"
|
||||
TUNE_FEATURES_tune-cortexa32-crypto = "aarch64 cortexa32 crc crypto"
|
||||
PACKAGE_EXTRA_ARCHS_tune-cortexa32 = "${PACKAGE_EXTRA_ARCHS_tune-armv8a-crc} cortexa32"
|
||||
PACKAGE_EXTRA_ARCHS_tune-cortexa32-crypto = "${PACKAGE_EXTRA_ARCHS_tune-armv8a-crc-crypto} cortexa32 cortexa32-crypto"
|
||||
BASE_LIB_tune-cortexa32 = "lib64"
|
||||
|
||||
@@ -9,8 +9,8 @@ require conf/machine/include/arm/arch-armv8a.inc
|
||||
AVAILTUNES += "cortexa35 cortexa35-crypto"
|
||||
ARMPKGARCH_tune-cortexa35 = "cortexa35"
|
||||
ARMPKGARCH_tune-cortexa35-crypto = "cortexa35"
|
||||
TUNE_FEATURES_tune-cortexa35 = "aarch64 cortexa35 simd crc"
|
||||
TUNE_FEATURES_tune-cortexa35-crypto = "aarch64 cortexa35 simd crc crypto"
|
||||
TUNE_FEATURES_tune-cortexa35 = "aarch64 cortexa35 crc"
|
||||
TUNE_FEATURES_tune-cortexa35-crypto = "aarch64 cortexa35 crc crypto"
|
||||
PACKAGE_EXTRA_ARCHS_tune-cortexa35 = "${PACKAGE_EXTRA_ARCHS_tune-armv8a-crc} cortexa35"
|
||||
PACKAGE_EXTRA_ARCHS_tune-cortexa35-crypto = "${PACKAGE_EXTRA_ARCHS_tune-armv8a-crc-crypto} cortexa35 cortexa35-crypto"
|
||||
BASE_LIB_tune-cortexa35 = "lib64"
|
||||
|
||||
@@ -9,8 +9,8 @@ require conf/machine/include/arm/arch-armv8a.inc
|
||||
AVAILTUNES += "cortexa53 cortexa53-crypto"
|
||||
ARMPKGARCH_tune-cortexa53 = "cortexa53"
|
||||
ARMPKGARCH_tune-cortexa53-crypto = "cortexa53"
|
||||
TUNE_FEATURES_tune-cortexa53 = "aarch64 cortexa53 simd crc"
|
||||
TUNE_FEATURES_tune-cortexa53-crypto = "aarch64 cortexa53 simd crc crypto"
|
||||
TUNE_FEATURES_tune-cortexa53 = "aarch64 cortexa53 crc"
|
||||
TUNE_FEATURES_tune-cortexa53-crypto = "aarch64 cortexa53 crc crypto"
|
||||
PACKAGE_EXTRA_ARCHS_tune-cortexa53 = "${PACKAGE_EXTRA_ARCHS_tune-armv8a-crc} cortexa53"
|
||||
PACKAGE_EXTRA_ARCHS_tune-cortexa53-crypto = "${PACKAGE_EXTRA_ARCHS_tune-armv8a-crc-crypto} cortexa53 cortexa53-crypto"
|
||||
BASE_LIB_tune-cortexa53 = "lib64"
|
||||
|
||||
@@ -8,6 +8,6 @@ require conf/machine/include/arm/arch-armv8a.inc
|
||||
# Little Endian base configs
|
||||
AVAILTUNES += "cortexa72"
|
||||
ARMPKGARCH_tune-cortexa72 = "cortexa72"
|
||||
TUNE_FEATURES_tune-cortexa72 = "aarch64 cortexa72 simd crc crypto"
|
||||
TUNE_FEATURES_tune-cortexa72 = "aarch64 cortexa72 crc crypto"
|
||||
PACKAGE_EXTRA_ARCHS_tune-cortexa72 = "${PACKAGE_EXTRA_ARCHS_tune-armv8a-crc-crypto} cortexa72"
|
||||
BASE_LIB_tune-cortexa72 = "lib64"
|
||||
|
||||
@@ -1,222 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Ben Secrest <blsecres@gmail.com>
|
||||
#
|
||||
# sh c_rehash script, scan all files in a directory
|
||||
# and add symbolic links to their hash values.
|
||||
#
|
||||
# based on the c_rehash perl script distributed with openssl
|
||||
#
|
||||
# LICENSE: See OpenSSL license
|
||||
# ^^acceptable?^^
|
||||
#
|
||||
|
||||
# default certificate location
|
||||
DIR=/etc/openssl
|
||||
|
||||
# for filetype bitfield
|
||||
IS_CERT=$(( 1 << 0 ))
|
||||
IS_CRL=$(( 1 << 1 ))
|
||||
|
||||
|
||||
# check to see if a file is a certificate file or a CRL file
|
||||
# arguments:
|
||||
# 1. the filename to be scanned
|
||||
# returns:
|
||||
# bitfield of file type; uses ${IS_CERT} and ${IS_CRL}
|
||||
#
|
||||
check_file()
|
||||
{
|
||||
local IS_TYPE=0
|
||||
|
||||
# make IFS a newline so we can process grep output line by line
|
||||
local OLDIFS=${IFS}
|
||||
IFS=$( printf "\n" )
|
||||
|
||||
# XXX: could be more efficient to have two 'grep -m' but is -m portable?
|
||||
for LINE in $( grep '^-----BEGIN .*-----' ${1} )
|
||||
do
|
||||
if echo ${LINE} \
|
||||
| grep -q -E '^-----BEGIN (X509 |TRUSTED )?CERTIFICATE-----'
|
||||
then
|
||||
IS_TYPE=$(( ${IS_TYPE} | ${IS_CERT} ))
|
||||
|
||||
if [ $(( ${IS_TYPE} & ${IS_CRL} )) -ne 0 ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
elif echo ${LINE} | grep -q '^-----BEGIN X509 CRL-----'
|
||||
then
|
||||
IS_TYPE=$(( ${IS_TYPE} | ${IS_CRL} ))
|
||||
|
||||
if [ $(( ${IS_TYPE} & ${IS_CERT} )) -ne 0 ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# restore IFS
|
||||
IFS=${OLDIFS}
|
||||
|
||||
return ${IS_TYPE}
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# use openssl to fingerprint a file
|
||||
# arguments:
|
||||
# 1. the filename to fingerprint
|
||||
# 2. the method to use (x509, crl)
|
||||
# returns:
|
||||
# none
|
||||
# assumptions:
|
||||
# user will capture output from last stage of pipeline
|
||||
#
|
||||
fingerprint()
|
||||
{
|
||||
${SSL_CMD} ${2} -fingerprint -noout -in ${1} | sed 's/^.*=//' | tr -d ':'
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# link_hash - create links to certificate files
|
||||
# arguments:
|
||||
# 1. the filename to create a link for
|
||||
# 2. the type of certificate being linked (x509, crl)
|
||||
# returns:
|
||||
# 0 on success, 1 otherwise
|
||||
#
|
||||
link_hash()
|
||||
{
|
||||
local FINGERPRINT=$( fingerprint ${1} ${2} )
|
||||
local HASH=$( ${SSL_CMD} ${2} -hash -noout -in ${1} )
|
||||
local SUFFIX=0
|
||||
local LINKFILE=''
|
||||
local TAG=''
|
||||
|
||||
if [ ${2} = "crl" ]
|
||||
then
|
||||
TAG='r'
|
||||
fi
|
||||
|
||||
LINKFILE=${HASH}.${TAG}${SUFFIX}
|
||||
|
||||
while [ -f ${LINKFILE} ]
|
||||
do
|
||||
if [ ${FINGERPRINT} = $( fingerprint ${LINKFILE} ${2} ) ]
|
||||
then
|
||||
echo "NOTE: Skipping duplicate file ${1}" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
SUFFIX=$(( ${SUFFIX} + 1 ))
|
||||
LINKFILE=${HASH}.${TAG}${SUFFIX}
|
||||
done
|
||||
|
||||
echo "${3} => ${LINKFILE}"
|
||||
|
||||
# assume any system with a POSIX shell will either support symlinks or
|
||||
# do something to handle this gracefully
|
||||
ln -s ${3} ${LINKFILE}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
# hash_dir create hash links in a given directory
|
||||
hash_dir()
|
||||
{
|
||||
echo "Doing ${1}"
|
||||
|
||||
cd ${1}
|
||||
|
||||
ls -1 * 2>/dev/null | while read FILE
|
||||
do
|
||||
if echo ${FILE} | grep -q -E '^[[:xdigit:]]{8}\.r?[[:digit:]]+$' \
|
||||
&& [ -h "${FILE}" ]
|
||||
then
|
||||
rm ${FILE}
|
||||
fi
|
||||
done
|
||||
|
||||
ls -1 *.pem *.cer *.crt *.crl 2>/dev/null | while read FILE
|
||||
do
|
||||
REAL_FILE=${FILE}
|
||||
# if we run on build host then get to the real files in rootfs
|
||||
if [ -n "${SYSROOT}" -a -h ${FILE} ]
|
||||
then
|
||||
FILE=$( readlink ${FILE} )
|
||||
# check the symlink is absolute (or dangling in other word)
|
||||
if [ "x/" = "x$( echo ${FILE} | cut -c1 -)" ]
|
||||
then
|
||||
REAL_FILE=${SYSROOT}/${FILE}
|
||||
fi
|
||||
fi
|
||||
|
||||
check_file ${REAL_FILE}
|
||||
local FILE_TYPE=${?}
|
||||
local TYPE_STR=''
|
||||
|
||||
if [ $(( ${FILE_TYPE} & ${IS_CERT} )) -ne 0 ]
|
||||
then
|
||||
TYPE_STR='x509'
|
||||
elif [ $(( ${FILE_TYPE} & ${IS_CRL} )) -ne 0 ]
|
||||
then
|
||||
TYPE_STR='crl'
|
||||
else
|
||||
echo "NOTE: ${FILE} does not contain a certificate or CRL: skipping" >&2
|
||||
continue
|
||||
fi
|
||||
|
||||
link_hash ${REAL_FILE} ${TYPE_STR} ${FILE}
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
# choose the name of an ssl application
|
||||
if [ -n "${OPENSSL}" ]
|
||||
then
|
||||
SSL_CMD=$(which ${OPENSSL} 2>/dev/null)
|
||||
else
|
||||
SSL_CMD=/usr/bin/openssl
|
||||
OPENSSL=${SSL_CMD}
|
||||
export OPENSSL
|
||||
fi
|
||||
|
||||
# fix paths
|
||||
PATH=${PATH}:${DIR}/bin
|
||||
export PATH
|
||||
|
||||
# confirm existance/executability of ssl command
|
||||
if ! [ -x ${SSL_CMD} ]
|
||||
then
|
||||
echo "${0}: rehashing skipped ('openssl' program not available)" >&2
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# determine which directories to process
|
||||
old_IFS=$IFS
|
||||
if [ ${#} -gt 0 ]
|
||||
then
|
||||
IFS=':'
|
||||
DIRLIST=${*}
|
||||
elif [ -n "${SSL_CERT_DIR}" ]
|
||||
then
|
||||
DIRLIST=$SSL_CERT_DIR
|
||||
else
|
||||
DIRLIST=${DIR}/certs
|
||||
fi
|
||||
|
||||
IFS=':'
|
||||
|
||||
# process directories
|
||||
for CERT_DIR in ${DIRLIST}
|
||||
do
|
||||
if [ -d ${CERT_DIR} -a -w ${CERT_DIR} ]
|
||||
then
|
||||
IFS=$old_IFS
|
||||
hash_dir ${CERT_DIR}
|
||||
IFS=':'
|
||||
fi
|
||||
done
|
||||
@@ -53,8 +53,8 @@ SRC_URI_append_class-nativesdk = " \
|
||||
file://environment.d-openssl.sh \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "7563e1ce046cb21948eeb6ba1a0eb71c"
|
||||
SRC_URI[sha256sum] = "5744cfcbcec2b1b48629f7354203bc1e5e9b5466998bbccc5b5fcde3b18eb684"
|
||||
SRC_URI[md5sum] = "0d2baaf04c56d542f6cc757b9c2a2aac"
|
||||
SRC_URI[sha256sum] = "ae51d08bba8a83958e894946f15303ff894d75c2b8bbd44a852b64e3fe11d0d6"
|
||||
|
||||
S = "${WORKDIR}/openssl-${PV}"
|
||||
|
||||
@@ -7,13 +7,12 @@ SECTION = "libs/network"
|
||||
# "openssl" here actually means both OpenSSL and SSLeay licenses apply
|
||||
# (see meta/files/common-licenses/OpenSSL to which "openssl" is SPDXLICENSEMAPped)
|
||||
LICENSE = "openssl"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=d57d511030c9d66ef5f5966bee5a7eff"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=d343e62fc9c833710bbbed25f27364c8"
|
||||
|
||||
DEPENDS = "hostperl-runtime-native"
|
||||
|
||||
SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \
|
||||
file://run-ptest \
|
||||
file://openssl-c_rehash.sh \
|
||||
file://0001-skip-test_symbol_presence.patch \
|
||||
file://0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch \
|
||||
file://afalg.patch \
|
||||
@@ -24,8 +23,8 @@ SRC_URI_append_class-nativesdk = " \
|
||||
file://environment.d-openssl.sh \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "963deb2272d6be7d4c2458afd2517b73"
|
||||
SRC_URI[sha256sum] = "fc20130f8b7cbd2fb918b2f14e2f429e109c31ddd0fb38fc5d71d9ffed3f9f41"
|
||||
SRC_URI[md5sum] = "4532712e7bcc9414f5bce995e4e13930"
|
||||
SRC_URI[sha256sum] = "5c557b023230413dfb0756f3137a13e6d726838ccd1430888ad15bfb2b43ea4b"
|
||||
|
||||
inherit lib_package multilib_header ptest
|
||||
|
||||
@@ -150,12 +149,6 @@ do_install_append_class-native () {
|
||||
SSL_CERT_DIR=${libdir}/ssl-1.1/certs \
|
||||
SSL_CERT_FILE=${libdir}/ssl-1.1/cert.pem \
|
||||
OPENSSL_ENGINES=${libdir}/ssl-1.1/engines
|
||||
|
||||
# Install a custom version of c_rehash that can handle sysroots properly.
|
||||
# This version is used for example when installing ca-certificates during
|
||||
# image creation.
|
||||
install -Dm 0755 ${WORKDIR}/openssl-c_rehash.sh ${D}${bindir}/c_rehash
|
||||
sed -i -e 's,/etc/openssl,${sysconfdir}/ssl,g' ${D}${bindir}/c_rehash
|
||||
}
|
||||
|
||||
do_install_append_class-nativesdk () {
|
||||
@@ -197,14 +190,13 @@ FILES_libcrypto = "${libdir}/libcrypto${SOLIBS}"
|
||||
FILES_libssl = "${libdir}/libssl${SOLIBS}"
|
||||
FILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf"
|
||||
FILES_${PN}-engines = "${libdir}/engines-1.1"
|
||||
FILES_${PN}-misc = "${libdir}/ssl-1.1/misc ${bindir}/c_rehash"
|
||||
FILES_${PN}-misc = "${libdir}/ssl-1.1/misc"
|
||||
FILES_${PN} =+ "${libdir}/ssl-1.1/*"
|
||||
FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/openssl.sh"
|
||||
|
||||
CONFFILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf"
|
||||
|
||||
RRECOMMENDS_libcrypto += "openssl-conf"
|
||||
RDEPENDS_${PN}-misc = "perl"
|
||||
RDEPENDS_${PN}-ptest += "openssl-bin perl perl-modules bash"
|
||||
|
||||
RPROVIDES_openssl-conf = "openssl10-conf"
|
||||
@@ -212,7 +204,3 @@ RREPLACES_openssl-conf = "openssl10-conf"
|
||||
RCONFLICTS_openssl-conf = "openssl10-conf"
|
||||
|
||||
BBCLASSEXTEND = "native nativesdk"
|
||||
|
||||
inherit multilib_script
|
||||
|
||||
MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash"
|
||||
@@ -22,7 +22,7 @@ IMAGE_FSTYPES = "wic.vmdk"
|
||||
|
||||
inherit core-image module-base setuptools3
|
||||
|
||||
SRCREV ?= "554379870fab3552fad774c065c02fa295f02b08"
|
||||
SRCREV ?= "c96d8de352f242f70ff9c166508c3d0e50199874"
|
||||
SRC_URI = "git://git.yoctoproject.org/poky \
|
||||
file://Yocto_Build_Appliance.vmx \
|
||||
file://Yocto_Build_Appliance.vmxf \
|
||||
|
||||
@@ -39,16 +39,13 @@ SYSTEMTAP_riscv64 = ""
|
||||
LTTNGUST = "lttng-ust"
|
||||
LTTNGUST_libc-musl = ""
|
||||
LTTNGUST_arc = ""
|
||||
LTTNGUST_riscv64 = ""
|
||||
|
||||
LTTNGTOOLS = "lttng-tools"
|
||||
LTTNGTOOLS_libc-musl = ""
|
||||
LTTNGTOOLS_arc = ""
|
||||
LTTNGTOOLS_riscv64 = ""
|
||||
|
||||
LTTNGMODULES = "lttng-modules"
|
||||
LTTNGMODULES_arc = ""
|
||||
LTTNGMODULES_riscv64 = ""
|
||||
|
||||
BABELTRACE = "babeltrace"
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ DEPENDS = "expat zlib ncurses virtual/libiconv ${LTTNGUST} bison-native"
|
||||
LTTNGUST = "lttng-ust"
|
||||
LTTNGUST_arc = ""
|
||||
LTTNGUST_aarch64 = ""
|
||||
LTTNGUST_riscv64 = ""
|
||||
LTTNGUST_mipsarch = ""
|
||||
LTTNGUST_sh4 = ""
|
||||
LTTNGUST_libc-musl = ""
|
||||
|
||||
@@ -23,6 +23,12 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
|
||||
file://0011-Revert-linux-user-fix-mmap-munmap-mprotect-mremap-sh.patch \
|
||||
file://0001-Add-a-missing-X11-include.patch \
|
||||
file://0001-egl-headless-add-egl_create_context.patch \
|
||||
file://0014-fix-CVE-2018-16872.patch \
|
||||
file://0015-fix-CVE-2018-20124.patch \
|
||||
file://0016-fix-CVE-2018-20125.patch \
|
||||
file://0017-fix-CVE-2018-20126.patch \
|
||||
file://0018-fix-CVE-2018-20191.patch \
|
||||
file://0019-fix-CVE-2018-20216.patch \
|
||||
"
|
||||
UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
|
||||
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
CVE: CVE-2018-16872
|
||||
Upstream-Status: Backport [https://git.qemu.org/?p=qemu.git;a=commit;h=bab9df35]
|
||||
|
||||
Signed-off-by: Kai Kang <kai.kang@windriver.com>
|
||||
|
||||
From bab9df35ce73d1c8e19a37e2737717ea1c984dc1 Mon Sep 17 00:00:00 2001
|
||||
From: Gerd Hoffmann <kraxel@redhat.com>
|
||||
Date: Thu, 13 Dec 2018 13:25:11 +0100
|
||||
Subject: [PATCH] usb-mtp: use O_NOFOLLOW and O_CLOEXEC.
|
||||
|
||||
Open files and directories with O_NOFOLLOW to avoid symlinks attacks.
|
||||
While being at it also add O_CLOEXEC.
|
||||
|
||||
usb-mtp only handles regular files and directories and ignores
|
||||
everything else, so users should not see a difference.
|
||||
|
||||
Because qemu ignores symlinks, carrying out a successful symlink attack
|
||||
requires swapping an existing file or directory below rootdir for a
|
||||
symlink and winning the race against the inotify notification to qemu.
|
||||
|
||||
Fixes: CVE-2018-16872
|
||||
Cc: Prasad J Pandit <ppandit@redhat.com>
|
||||
Cc: Bandan Das <bsd@redhat.com>
|
||||
Reported-by: Michael Hanselmann <public@hansmi.ch>
|
||||
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
||||
Reviewed-by: Michael Hanselmann <public@hansmi.ch>
|
||||
Message-id: 20181213122511.13853-1-kraxel@redhat.com
|
||||
---
|
||||
hw/usb/dev-mtp.c | 13 +++++++++----
|
||||
1 file changed, 9 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
|
||||
index 100b7171f4..36c43b8c20 100644
|
||||
--- a/hw/usb/dev-mtp.c
|
||||
+++ b/hw/usb/dev-mtp.c
|
||||
@@ -653,13 +653,18 @@ static void usb_mtp_object_readdir(MTPState *s, MTPObject *o)
|
||||
{
|
||||
struct dirent *entry;
|
||||
DIR *dir;
|
||||
+ int fd;
|
||||
|
||||
if (o->have_children) {
|
||||
return;
|
||||
}
|
||||
o->have_children = true;
|
||||
|
||||
- dir = opendir(o->path);
|
||||
+ fd = open(o->path, O_DIRECTORY | O_CLOEXEC | O_NOFOLLOW);
|
||||
+ if (fd < 0) {
|
||||
+ return;
|
||||
+ }
|
||||
+ dir = fdopendir(fd);
|
||||
if (!dir) {
|
||||
return;
|
||||
}
|
||||
@@ -1007,7 +1012,7 @@ static MTPData *usb_mtp_get_object(MTPState *s, MTPControl *c,
|
||||
|
||||
trace_usb_mtp_op_get_object(s->dev.addr, o->handle, o->path);
|
||||
|
||||
- d->fd = open(o->path, O_RDONLY);
|
||||
+ d->fd = open(o->path, O_RDONLY | O_CLOEXEC | O_NOFOLLOW);
|
||||
if (d->fd == -1) {
|
||||
usb_mtp_data_free(d);
|
||||
return NULL;
|
||||
@@ -1031,7 +1036,7 @@ static MTPData *usb_mtp_get_partial_object(MTPState *s, MTPControl *c,
|
||||
c->argv[1], c->argv[2]);
|
||||
|
||||
d = usb_mtp_data_alloc(c);
|
||||
- d->fd = open(o->path, O_RDONLY);
|
||||
+ d->fd = open(o->path, O_RDONLY | O_CLOEXEC | O_NOFOLLOW);
|
||||
if (d->fd == -1) {
|
||||
usb_mtp_data_free(d);
|
||||
return NULL;
|
||||
@@ -1658,7 +1663,7 @@ static void usb_mtp_write_data(MTPState *s)
|
||||
0, 0, 0, 0);
|
||||
goto done;
|
||||
}
|
||||
- d->fd = open(path, O_CREAT | O_WRONLY, mask);
|
||||
+ d->fd = open(path, O_CREAT | O_WRONLY | O_CLOEXEC | O_NOFOLLOW, mask);
|
||||
if (d->fd == -1) {
|
||||
usb_mtp_queue_result(s, RES_STORE_FULL, d->trans,
|
||||
0, 0, 0, 0);
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
CVE: CVE-2018-20124
|
||||
Upstream-Status: Backport [https://git.qemu.org/?p=qemu.git;a=commit;h=0e68373]
|
||||
|
||||
Backport patch to fix CVE-2018-20124. Update context and stay with current
|
||||
function comp_handler() which has been replaced with complete_work() in latest
|
||||
git repo.
|
||||
|
||||
Signed-off-by: Kai Kang <kai.kang@windriver.com>
|
||||
|
||||
From 0e68373cc2b3a063ce067bc0cc3edaf370752890 Mon Sep 17 00:00:00 2001
|
||||
From: Prasad J Pandit <pjp@fedoraproject.org>
|
||||
Date: Thu, 13 Dec 2018 01:00:34 +0530
|
||||
Subject: [PATCH] rdma: check num_sge does not exceed MAX_SGE
|
||||
|
||||
rdma back-end has scatter/gather array ibv_sge[MAX_SGE=4] set
|
||||
to have 4 elements. A guest could send a 'PvrdmaSqWqe' ring element
|
||||
with 'num_sge' set to > MAX_SGE, which may lead to OOB access issue.
|
||||
Add check to avoid it.
|
||||
|
||||
Reported-by: Saar Amar <saaramar5@gmail.com>
|
||||
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
|
||||
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
|
||||
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
|
||||
---
|
||||
hw/rdma/rdma_backend.c | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/hw/rdma/rdma_backend.c b/hw/rdma/rdma_backend.c
|
||||
index d7a4bbd9..7f8028f8 100644
|
||||
--- a/hw/rdma/rdma_backend.c
|
||||
+++ b/hw/rdma/rdma_backend.c
|
||||
@@ -311,9 +311,9 @@ void rdma_backend_post_send(RdmaBackendDev *backend_dev,
|
||||
}
|
||||
|
||||
pr_dbg("num_sge=%d\n", num_sge);
|
||||
- if (!num_sge) {
|
||||
- pr_dbg("num_sge=0\n");
|
||||
- comp_handler(IBV_WC_GENERAL_ERR, VENDOR_ERR_NO_SGE, ctx);
|
||||
+ if (!num_sge || num_sge > MAX_SGE) {
|
||||
+ pr_dbg("invalid num_sge=%d\n", num_sge);
|
||||
+ comp_handler(IBV_WC_GENERAL_ERR, VENDOR_ERR_INV_NUM_SGE, ctx);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -390,9 +390,9 @@ void rdma_backend_post_recv(RdmaBackendDev *backend_dev,
|
||||
}
|
||||
|
||||
pr_dbg("num_sge=%d\n", num_sge);
|
||||
- if (!num_sge) {
|
||||
- pr_dbg("num_sge=0\n");
|
||||
- comp_handler(IBV_WC_GENERAL_ERR, VENDOR_ERR_NO_SGE, ctx);
|
||||
+ if (!num_sge || num_sge > MAX_SGE) {
|
||||
+ pr_dbg("invalid num_sge=%d\n", num_sge);
|
||||
+ comp_handler(IBV_WC_GENERAL_ERR, VENDOR_ERR_INV_NUM_SGE, ctx);
|
||||
return;
|
||||
}
|
||||
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
CVE: CVE-2018-20125
|
||||
Upstream-Status: Backport [https://git.qemu.org/?p=qemu.git;a=commit;h=2c858ce]
|
||||
|
||||
Signed-off-by: Kai Kang <kai.kang@windriver.com>
|
||||
|
||||
From 2c858ce5da8ae6689c75182b73bc455a291cad41 Mon Sep 17 00:00:00 2001
|
||||
From: Prasad J Pandit <pjp@fedoraproject.org>
|
||||
Date: Thu, 13 Dec 2018 01:00:36 +0530
|
||||
Subject: [PATCH] pvrdma: check number of pages when creating rings
|
||||
|
||||
When creating CQ/QP rings, an object can have up to
|
||||
PVRDMA_MAX_FAST_REG_PAGES 8 pages. Check 'npages' parameter
|
||||
to avoid excessive memory allocation or a null dereference.
|
||||
|
||||
Reported-by: Li Qiang <liq3ea@163.com>
|
||||
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
|
||||
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
|
||||
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
|
||||
---
|
||||
hw/rdma/vmw/pvrdma_cmd.c | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/hw/rdma/vmw/pvrdma_cmd.c b/hw/rdma/vmw/pvrdma_cmd.c
|
||||
index 3b94545761..f236ac4795 100644
|
||||
--- a/hw/rdma/vmw/pvrdma_cmd.c
|
||||
+++ b/hw/rdma/vmw/pvrdma_cmd.c
|
||||
@@ -259,6 +259,11 @@ static int create_cq_ring(PCIDevice *pci_dev , PvrdmaRing **ring,
|
||||
int rc = -EINVAL;
|
||||
char ring_name[MAX_RING_NAME_SZ];
|
||||
|
||||
+ if (!nchunks || nchunks > PVRDMA_MAX_FAST_REG_PAGES) {
|
||||
+ pr_dbg("invalid nchunks: %d\n", nchunks);
|
||||
+ return rc;
|
||||
+ }
|
||||
+
|
||||
pr_dbg("pdir_dma=0x%llx\n", (long long unsigned int)pdir_dma);
|
||||
dir = rdma_pci_dma_map(pci_dev, pdir_dma, TARGET_PAGE_SIZE);
|
||||
if (!dir) {
|
||||
@@ -372,6 +377,12 @@ static int create_qp_rings(PCIDevice *pci_dev, uint64_t pdir_dma,
|
||||
char ring_name[MAX_RING_NAME_SZ];
|
||||
uint32_t wqe_sz;
|
||||
|
||||
+ if (!spages || spages > PVRDMA_MAX_FAST_REG_PAGES
|
||||
+ || !rpages || rpages > PVRDMA_MAX_FAST_REG_PAGES) {
|
||||
+ pr_dbg("invalid pages: %d, %d\n", spages, rpages);
|
||||
+ return rc;
|
||||
+ }
|
||||
+
|
||||
pr_dbg("pdir_dma=0x%llx\n", (long long unsigned int)pdir_dma);
|
||||
dir = rdma_pci_dma_map(pci_dev, pdir_dma, TARGET_PAGE_SIZE);
|
||||
if (!dir) {
|
||||
--
|
||||
2.20.1
|
||||
|
||||
113
meta/recipes-devtools/qemu/qemu/0017-fix-CVE-2018-20126.patch
Normal file
113
meta/recipes-devtools/qemu/qemu/0017-fix-CVE-2018-20126.patch
Normal file
@@ -0,0 +1,113 @@
|
||||
CVE: CVE-2018-20126
|
||||
Upstream-Status: Backport [https://git.qemu.org/?p=qemu.git;a=commit;h=509f57c]
|
||||
|
||||
Backport and rebase patch to fix CVE-2018-20126.
|
||||
|
||||
Signed-off-by: Kai Kang <kai.kang@windriver.com>
|
||||
|
||||
From 509f57c98e7536905bb4902363d0cba66ce7e089 Mon Sep 17 00:00:00 2001
|
||||
From: Prasad J Pandit <pjp@fedoraproject.org>
|
||||
Date: Thu, 13 Dec 2018 01:00:37 +0530
|
||||
Subject: [PATCH] pvrdma: release ring object in case of an error
|
||||
|
||||
create_cq and create_qp routines allocate ring object, but it's
|
||||
not released in case of an error, leading to memory leakage.
|
||||
|
||||
Reported-by: Li Qiang <liq3ea@163.com>
|
||||
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
|
||||
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
|
||||
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
|
||||
---
|
||||
hw/rdma/vmw/pvrdma_cmd.c | 41 ++++++++++++++++++++++++++++++-----------
|
||||
1 file changed, 30 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/hw/rdma/vmw/pvrdma_cmd.c b/hw/rdma/vmw/pvrdma_cmd.c
|
||||
index 4faeb21..9b6796f 100644
|
||||
--- a/hw/rdma/vmw/pvrdma_cmd.c
|
||||
+++ b/hw/rdma/vmw/pvrdma_cmd.c
|
||||
@@ -310,6 +310,14 @@ out:
|
||||
return rc;
|
||||
}
|
||||
|
||||
+static void destroy_cq_ring(PvrdmaRing *ring)
|
||||
+{
|
||||
+ pvrdma_ring_free(ring);
|
||||
+ /* ring_state was in slot 1, not 0 so need to jump back */
|
||||
+ rdma_pci_dma_unmap(ring->dev, --ring->ring_state, TARGET_PAGE_SIZE);
|
||||
+ g_free(ring);
|
||||
+}
|
||||
+
|
||||
static int create_cq(PVRDMADev *dev, union pvrdma_cmd_req *req,
|
||||
union pvrdma_cmd_resp *rsp)
|
||||
{
|
||||
@@ -333,6 +341,10 @@ static int create_cq(PVRDMADev *dev, union pvrdma_cmd_req *req,
|
||||
|
||||
resp->hdr.err = rdma_rm_alloc_cq(&dev->rdma_dev_res, &dev->backend_dev,
|
||||
cmd->cqe, &resp->cq_handle, ring);
|
||||
+ if (resp->hdr.err) {
|
||||
+ destroy_cq_ring(ring);
|
||||
+ }
|
||||
+
|
||||
resp->cqe = cmd->cqe;
|
||||
|
||||
out:
|
||||
@@ -356,10 +368,7 @@ static int destroy_cq(PVRDMADev *dev, union pvrdma_cmd_req *req,
|
||||
}
|
||||
|
||||
ring = (PvrdmaRing *)cq->opaque;
|
||||
- pvrdma_ring_free(ring);
|
||||
- /* ring_state was in slot 1, not 0 so need to jump back */
|
||||
- rdma_pci_dma_unmap(PCI_DEVICE(dev), --ring->ring_state, TARGET_PAGE_SIZE);
|
||||
- g_free(ring);
|
||||
+ destroy_cq_ring(ring);
|
||||
|
||||
rdma_rm_dealloc_cq(&dev->rdma_dev_res, cmd->cq_handle);
|
||||
|
||||
@@ -451,6 +460,17 @@ out:
|
||||
return rc;
|
||||
}
|
||||
|
||||
+static void destroy_qp_rings(PvrdmaRing *ring)
|
||||
+{
|
||||
+ pr_dbg("sring=%p\n", &ring[0]);
|
||||
+ pvrdma_ring_free(&ring[0]);
|
||||
+ pr_dbg("rring=%p\n", &ring[1]);
|
||||
+ pvrdma_ring_free(&ring[1]);
|
||||
+
|
||||
+ rdma_pci_dma_unmap(ring->dev, ring->ring_state, TARGET_PAGE_SIZE);
|
||||
+ g_free(ring);
|
||||
+}
|
||||
+
|
||||
static int create_qp(PVRDMADev *dev, union pvrdma_cmd_req *req,
|
||||
union pvrdma_cmd_resp *rsp)
|
||||
{
|
||||
@@ -482,6 +502,11 @@ static int create_qp(PVRDMADev *dev, union pvrdma_cmd_req *req,
|
||||
cmd->max_recv_wr, cmd->max_recv_sge,
|
||||
cmd->recv_cq_handle, rings, &resp->qpn);
|
||||
|
||||
+ if (resp->hdr.err) {
|
||||
+ destroy_qp_rings(rings);
|
||||
+ return resp->hdr.err;
|
||||
+ }
|
||||
+
|
||||
resp->max_send_wr = cmd->max_send_wr;
|
||||
resp->max_recv_wr = cmd->max_recv_wr;
|
||||
resp->max_send_sge = cmd->max_send_sge;
|
||||
@@ -555,13 +580,7 @@ static int destroy_qp(PVRDMADev *dev, union pvrdma_cmd_req *req,
|
||||
rdma_rm_dealloc_qp(&dev->rdma_dev_res, cmd->qp_handle);
|
||||
|
||||
ring = (PvrdmaRing *)qp->opaque;
|
||||
- pr_dbg("sring=%p\n", &ring[0]);
|
||||
- pvrdma_ring_free(&ring[0]);
|
||||
- pr_dbg("rring=%p\n", &ring[1]);
|
||||
- pvrdma_ring_free(&ring[1]);
|
||||
-
|
||||
- rdma_pci_dma_unmap(PCI_DEVICE(dev), ring->ring_state, TARGET_PAGE_SIZE);
|
||||
- g_free(ring);
|
||||
+ destroy_qp_rings(ring);
|
||||
|
||||
return 0;
|
||||
}
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
CVE: CVE-2018-20191
|
||||
Upstream-Status: Backport [https://git.qemu.org/?p=qemu.git;a=commit;h=2aa8645]
|
||||
|
||||
Signed-off-by: Kai Kang <kai.kang@windriver.com>
|
||||
|
||||
From 2aa86456fb938a11f2b7bd57c8643c213218681c Mon Sep 17 00:00:00 2001
|
||||
From: Prasad J Pandit <pjp@fedoraproject.org>
|
||||
Date: Thu, 13 Dec 2018 01:00:35 +0530
|
||||
Subject: [PATCH] pvrdma: add uar_read routine
|
||||
|
||||
Define skeleton 'uar_read' routine. Avoid NULL dereference.
|
||||
|
||||
Reported-by: Li Qiang <liq3ea@163.com>
|
||||
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
|
||||
Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
|
||||
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
|
||||
---
|
||||
hw/rdma/vmw/pvrdma_main.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/hw/rdma/vmw/pvrdma_main.c b/hw/rdma/vmw/pvrdma_main.c
|
||||
index 64de16fb52..838ad8a949 100644
|
||||
--- a/hw/rdma/vmw/pvrdma_main.c
|
||||
+++ b/hw/rdma/vmw/pvrdma_main.c
|
||||
@@ -448,6 +448,11 @@ static const MemoryRegionOps regs_ops = {
|
||||
},
|
||||
};
|
||||
|
||||
+static uint64_t uar_read(void *opaque, hwaddr addr, unsigned size)
|
||||
+{
|
||||
+ return 0xffffffff;
|
||||
+}
|
||||
+
|
||||
static void uar_write(void *opaque, hwaddr addr, uint64_t val, unsigned size)
|
||||
{
|
||||
PVRDMADev *dev = opaque;
|
||||
@@ -489,6 +494,7 @@ static void uar_write(void *opaque, hwaddr addr, uint64_t val, unsigned size)
|
||||
}
|
||||
|
||||
static const MemoryRegionOps uar_ops = {
|
||||
+ .read = uar_read,
|
||||
.write = uar_write,
|
||||
.endianness = DEVICE_LITTLE_ENDIAN,
|
||||
.impl = {
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
CVE: CVE-2018-20216
|
||||
Upstream-Status: Backport [https://git.qemu.org/?p=qemu.git;a=commit;h=f1e2e38]
|
||||
|
||||
Signed-off-by: Kai Kang <kai.kang@windriver.com>
|
||||
|
||||
From f1e2e38ee0136b7710a2caa347049818afd57a1b Mon Sep 17 00:00:00 2001
|
||||
From: Prasad J Pandit <pjp@fedoraproject.org>
|
||||
Date: Thu, 13 Dec 2018 01:00:39 +0530
|
||||
Subject: [PATCH] pvrdma: check return value from pvrdma_idx_ring_has_ routines
|
||||
|
||||
pvrdma_idx_ring_has_[data/space] routines also return invalid
|
||||
index PVRDMA_INVALID_IDX[=-1], if ring has no data/space. Check
|
||||
return value from these routines to avoid plausible infinite loops.
|
||||
|
||||
Reported-by: Li Qiang <liq3ea@163.com>
|
||||
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
|
||||
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
|
||||
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
|
||||
---
|
||||
hw/rdma/vmw/pvrdma_dev_ring.c | 29 +++++++++++------------------
|
||||
1 file changed, 11 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/hw/rdma/vmw/pvrdma_dev_ring.c b/hw/rdma/vmw/pvrdma_dev_ring.c
|
||||
index 01247fc041..e8e5b502f6 100644
|
||||
--- a/hw/rdma/vmw/pvrdma_dev_ring.c
|
||||
+++ b/hw/rdma/vmw/pvrdma_dev_ring.c
|
||||
@@ -73,23 +73,16 @@ out:
|
||||
|
||||
void *pvrdma_ring_next_elem_read(PvrdmaRing *ring)
|
||||
{
|
||||
+ int e;
|
||||
unsigned int idx = 0, offset;
|
||||
|
||||
- /*
|
||||
- pr_dbg("%s: t=%d, h=%d\n", ring->name, ring->ring_state->prod_tail,
|
||||
- ring->ring_state->cons_head);
|
||||
- */
|
||||
-
|
||||
- if (!pvrdma_idx_ring_has_data(ring->ring_state, ring->max_elems, &idx)) {
|
||||
+ e = pvrdma_idx_ring_has_data(ring->ring_state, ring->max_elems, &idx);
|
||||
+ if (e <= 0) {
|
||||
pr_dbg("No more data in ring\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
offset = idx * ring->elem_sz;
|
||||
- /*
|
||||
- pr_dbg("idx=%d\n", idx);
|
||||
- pr_dbg("offset=%d\n", offset);
|
||||
- */
|
||||
return ring->pages[offset / TARGET_PAGE_SIZE] + (offset % TARGET_PAGE_SIZE);
|
||||
}
|
||||
|
||||
@@ -105,20 +98,20 @@ void pvrdma_ring_read_inc(PvrdmaRing *ring)
|
||||
|
||||
void *pvrdma_ring_next_elem_write(PvrdmaRing *ring)
|
||||
{
|
||||
- unsigned int idx, offset, tail;
|
||||
+ int idx;
|
||||
+ unsigned int offset, tail;
|
||||
|
||||
- /*
|
||||
- pr_dbg("%s: t=%d, h=%d\n", ring->name, ring->ring_state->prod_tail,
|
||||
- ring->ring_state->cons_head);
|
||||
- */
|
||||
-
|
||||
- if (!pvrdma_idx_ring_has_space(ring->ring_state, ring->max_elems, &tail)) {
|
||||
+ idx = pvrdma_idx_ring_has_space(ring->ring_state, ring->max_elems, &tail);
|
||||
+ if (idx <= 0) {
|
||||
pr_dbg("CQ is full\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
idx = pvrdma_idx(&ring->ring_state->prod_tail, ring->max_elems);
|
||||
- /* TODO: tail == idx */
|
||||
+ if (idx < 0 || tail != idx) {
|
||||
+ pr_dbg("invalid idx\n");
|
||||
+ return NULL;
|
||||
+ }
|
||||
|
||||
offset = idx * ring->elem_sz;
|
||||
return ring->pages[offset / TARGET_PAGE_SIZE] + (offset % TARGET_PAGE_SIZE);
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@@ -9,7 +9,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=c4613d1f8a9587bd7b366191830364b3 \
|
||||
|
||||
inherit module
|
||||
|
||||
COMPATIBLE_HOST = '(x86_64|i.86|powerpc|aarch64|mips|nios2|arm).*-linux'
|
||||
COMPATIBLE_HOST = '(x86_64|i.86|powerpc|aarch64|mips|nios2|arm|riscv).*-linux'
|
||||
|
||||
#https://lttng.org/files/lttng-modules/lttng-modules-2.10.7.tar.bz2
|
||||
SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2 \
|
||||
|
||||
@@ -28,7 +28,6 @@ PACKAGECONFIG[kmod] = "--with-kmod, --without-kmod, kmod"
|
||||
PACKAGECONFIG[manpages] = "--enable-man-pages, --disable-man-pages, asciidoc-native xmlto-native libxslt-native"
|
||||
PACKAGECONFIG_remove_libc-musl = "lttng-ust"
|
||||
PACKAGECONFIG_remove_arc = "lttng-ust"
|
||||
PACKAGECONFIG_remove_riscv64 = "lttng-ust"
|
||||
|
||||
SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \
|
||||
file://x32.patch \
|
||||
|
||||
@@ -11,7 +11,7 @@ LIC_FILES_CHKSUM = "file://debian/copyright;md5=aeb420429b1659507e0a5a1b123e8308
|
||||
DEPENDS = ""
|
||||
DEPENDS_class-native = "openssl-native"
|
||||
DEPENDS_class-nativesdk = "openssl-native"
|
||||
# Need c_rehash from openssl and run-parts from debianutils
|
||||
# Need rehash from openssl and run-parts from debianutils
|
||||
PACKAGE_WRITE_DEPS += "openssl-native debianutils-native"
|
||||
|
||||
SRCREV = "c28799b138b044c963d24c4a69659b6e5486e3be"
|
||||
|
||||
Reference in New Issue
Block a user