mirror of
https://git.yoctoproject.org/poky
synced 2026-02-04 07:48:43 +01:00
Compare commits
137 Commits
master
...
yocto-2.4.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c2b641c8a0 | ||
|
|
ab4310e7b8 | ||
|
|
551d18e4b8 | ||
|
|
7030d5b4f9 | ||
|
|
f88c841a2d | ||
|
|
1c61ba0a3f | ||
|
|
babf923312 | ||
|
|
a1bff37c3f | ||
|
|
738fc234fa | ||
|
|
f79c0d45fa | ||
|
|
a5e95c2a85 | ||
|
|
4b2d0192b2 | ||
|
|
fd93e26f0d | ||
|
|
15542ff2b3 | ||
|
|
b472addc93 | ||
|
|
2f07e71a9e | ||
|
|
66a0b5b550 | ||
|
|
adaefc1880 | ||
|
|
1a2fb23f56 | ||
|
|
937beb5d94 | ||
|
|
45139bd079 | ||
|
|
8c56b0b2f4 | ||
|
|
f04d6842d3 | ||
|
|
c889bffda2 | ||
|
|
1655dfeffc | ||
|
|
ebf2523922 | ||
|
|
7de56ebc2a | ||
|
|
d0640da88e | ||
|
|
776fb31844 | ||
|
|
80ed9207a7 | ||
|
|
1e4d4762b1 | ||
|
|
968145b24e | ||
|
|
3c28d31fed | ||
|
|
65d09a7d1e | ||
|
|
311245d89f | ||
|
|
0845fa12b8 | ||
|
|
2d9aecf044 | ||
|
|
c32f44ebf5 | ||
|
|
c6d473f460 | ||
|
|
7104d48590 | ||
|
|
d164445477 | ||
|
|
7e0b00fd12 | ||
|
|
25c0d7d891 | ||
|
|
7df22af792 | ||
|
|
351192c314 | ||
|
|
fe51ddba06 | ||
|
|
c8730962a4 | ||
|
|
1e944f79b4 | ||
|
|
994e3674a8 | ||
|
|
69490b4280 | ||
|
|
e27fd333df | ||
|
|
216a839e1b | ||
|
|
bd884dd998 | ||
|
|
e36cf9e621 | ||
|
|
611e4b43d8 | ||
|
|
d4e3893e2d | ||
|
|
99c18e36e2 | ||
|
|
fbddd3917f | ||
|
|
5481891748 | ||
|
|
18b51a13af | ||
|
|
e46fa69897 | ||
|
|
7d934ff315 | ||
|
|
2f6cffd605 | ||
|
|
ed4708db31 | ||
|
|
8d53ceebaf | ||
|
|
f97450203f | ||
|
|
572b9c54a1 | ||
|
|
3f6fbed1e1 | ||
|
|
292c2ae888 | ||
|
|
539a852504 | ||
|
|
10d0ace274 | ||
|
|
852c71956b | ||
|
|
254013ce5f | ||
|
|
de78322f16 | ||
|
|
61f319db67 | ||
|
|
88d92fb301 | ||
|
|
ef6babd638 | ||
|
|
f8c7eff81d | ||
|
|
8d3edc9821 | ||
|
|
8d706de096 | ||
|
|
59cbf69299 | ||
|
|
02f64e5db8 | ||
|
|
c76a25b6ac | ||
|
|
1002359e5e | ||
|
|
3eca58ca70 | ||
|
|
aa6e825bf0 | ||
|
|
2ef0fd2364 | ||
|
|
ee7f665f0a | ||
|
|
ab31d76bc8 | ||
|
|
dd03b7399b | ||
|
|
55d21c7fb6 | ||
|
|
4e28c8d6b7 | ||
|
|
18941419c8 | ||
|
|
da8f32a3bb | ||
|
|
e6fe54ce38 | ||
|
|
23ee931b9d | ||
|
|
e4f256000f | ||
|
|
fbc12e0794 | ||
|
|
c45bdab6b9 | ||
|
|
a97fecb3bd | ||
|
|
87577b8a53 | ||
|
|
5599639b65 | ||
|
|
c388d72c60 | ||
|
|
d40531211c | ||
|
|
8eeed4220e | ||
|
|
0fbaee9077 | ||
|
|
33a48469bd | ||
|
|
e52027eef7 | ||
|
|
9d5296bba5 | ||
|
|
8754f4779c | ||
|
|
e0bfc22475 | ||
|
|
f165c52e57 | ||
|
|
e6c74f7ac9 | ||
|
|
ce3bbc6972 | ||
|
|
f483bdf9c4 | ||
|
|
24c9708492 | ||
|
|
221c4877f1 | ||
|
|
e303b3cadc | ||
|
|
500ce8d139 | ||
|
|
f7e10b532c | ||
|
|
0fc114ba76 | ||
|
|
b21f8e361b | ||
|
|
f515778225 | ||
|
|
40ed9adb53 | ||
|
|
96d525dc03 | ||
|
|
d61b65f35c | ||
|
|
3190ba0b38 | ||
|
|
a027091807 | ||
|
|
9779fc2bdd | ||
|
|
cb258fef83 | ||
|
|
0d84cdfaac | ||
|
|
f609c3f755 | ||
|
|
9217de77b9 | ||
|
|
87f8aafd53 | ||
|
|
6709452171 | ||
|
|
f7b90ab3ea | ||
|
|
7226a1c600 |
@@ -36,7 +36,7 @@ from bb import cookerdata
|
||||
from bb.main import bitbake_main, BitBakeConfigParameters, BBMainException
|
||||
|
||||
if sys.getfilesystemencoding() != "utf-8":
|
||||
sys.exit("Please use a locale setting which supports utf-8.\nPython can't change the filesystem locale after loading so we need a utf-8 when python starts or things won't work.")
|
||||
sys.exit("Please use a locale setting which supports UTF-8 (such as LANG=en_US.UTF-8).\nPython can't change the filesystem locale after loading so we need a UTF-8 when Python starts or things won't work.")
|
||||
|
||||
__version__ = "1.36.0"
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ from multiprocessing import Lock
|
||||
from threading import Thread
|
||||
|
||||
if sys.getfilesystemencoding() != "utf-8":
|
||||
sys.exit("Please use a locale setting which supports utf-8.\nPython can't change the filesystem locale after loading so we need a utf-8 when python starts or things won't work.")
|
||||
sys.exit("Please use a locale setting which supports UTF-8 (such as LANG=en_US.UTF-8).\nPython can't change the filesystem locale after loading so we need a UTF-8 when Python starts or things won't work.")
|
||||
|
||||
# Users shouldn't be running this code directly
|
||||
if len(sys.argv) != 2 or not sys.argv[1].startswith("decafbad"):
|
||||
@@ -499,4 +499,3 @@ worker_thread.join()
|
||||
|
||||
workerlog_write("exitting")
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
@@ -1686,15 +1686,23 @@ class CookerCollectFiles(object):
|
||||
|
||||
# We need to track where we look so that we can add inotify watches. There
|
||||
# is no nice way to do this, this is horrid. We intercept the os.listdir()
|
||||
# calls while we run glob().
|
||||
# (or os.scandir() for python 3.6+) calls while we run glob().
|
||||
origlistdir = os.listdir
|
||||
if hasattr(os, 'scandir'):
|
||||
origscandir = os.scandir
|
||||
searchdirs = []
|
||||
|
||||
def ourlistdir(d):
|
||||
searchdirs.append(d)
|
||||
return origlistdir(d)
|
||||
|
||||
def ourscandir(d):
|
||||
searchdirs.append(d)
|
||||
return origscandir(d)
|
||||
|
||||
os.listdir = ourlistdir
|
||||
if hasattr(os, 'scandir'):
|
||||
os.scandir = ourscandir
|
||||
try:
|
||||
# Can't use set here as order is important
|
||||
newfiles = []
|
||||
@@ -1714,6 +1722,8 @@ class CookerCollectFiles(object):
|
||||
newfiles.append(g)
|
||||
finally:
|
||||
os.listdir = origlistdir
|
||||
if hasattr(os, 'scandir'):
|
||||
os.scandir = origscandir
|
||||
|
||||
bbmask = config.getVar('BBMASK')
|
||||
|
||||
|
||||
@@ -173,6 +173,10 @@ def print_ui_queue():
|
||||
for event in ui_queue[:]:
|
||||
if isinstance(event, logging.LogRecord):
|
||||
logger.handle(event)
|
||||
if msgerrs:
|
||||
logger.removeHandler(stderr)
|
||||
else:
|
||||
logger.removeHandler(stdout)
|
||||
|
||||
def fire_ui_handlers(event, d):
|
||||
global _thread_lock
|
||||
|
||||
@@ -27,6 +27,7 @@ import os
|
||||
import bb
|
||||
from bb.fetch2 import FetchMethod
|
||||
from bb.fetch2 import runfetchcmd
|
||||
from bb.fetch2 import logger
|
||||
|
||||
class Repo(FetchMethod):
|
||||
"""Class to fetch a module or modules from repo (git) repositories"""
|
||||
|
||||
@@ -47,6 +47,9 @@ logger = logging.getLogger("BitBake")
|
||||
class BBMainException(Exception):
|
||||
pass
|
||||
|
||||
class BBMainFatal(bb.BBHandledException):
|
||||
pass
|
||||
|
||||
def present_options(optionlist):
|
||||
if len(optionlist) > 1:
|
||||
return ' or '.join([', '.join(optionlist[:-1]), optionlist[-1]])
|
||||
@@ -461,6 +464,8 @@ def setup_bitbake(configParams, configuration, extrafeatures=None):
|
||||
|
||||
if server_connection or configParams.server_only:
|
||||
break
|
||||
except BBMainFatal:
|
||||
raise
|
||||
except (Exception, bb.server.process.ProcessTimeout) as e:
|
||||
if not retries:
|
||||
raise
|
||||
@@ -491,6 +496,9 @@ def setup_bitbake(configParams, configuration, extrafeatures=None):
|
||||
|
||||
def lockBitbake():
|
||||
topdir = bb.cookerdata.findTopdir()
|
||||
if not topdir:
|
||||
bb.error("Unable to find conf/bblayers.conf or conf/bitbake.conf. BBAPTH is unset and/or not in a build directory?")
|
||||
raise BBMainFatal
|
||||
lockfile = topdir + "/bitbake.lock"
|
||||
return topdir, bb.utils.lockfile(lockfile, False, False)
|
||||
|
||||
|
||||
@@ -28,6 +28,11 @@ from bb.fetch2 import URI
|
||||
from bb.fetch2 import FetchMethod
|
||||
import bb
|
||||
|
||||
def skipIfNoNetwork():
|
||||
if os.environ.get("BB_SKIP_NETTESTS") == "yes":
|
||||
return unittest.skip("Network tests being skipped")
|
||||
return lambda f: f
|
||||
|
||||
class URITest(unittest.TestCase):
|
||||
test_uris = {
|
||||
"http://www.google.com/index.html" : {
|
||||
@@ -518,141 +523,153 @@ class FetcherLocalTest(FetcherTest):
|
||||
self.fetchUnpack(['file://a;subdir=/bin/sh'])
|
||||
|
||||
class FetcherNetworkTest(FetcherTest):
|
||||
@skipIfNoNetwork()
|
||||
def test_fetch(self):
|
||||
fetcher = bb.fetch.Fetch(["http://downloads.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz", "http://downloads.yoctoproject.org/releases/bitbake/bitbake-1.1.tar.gz"], self.d)
|
||||
fetcher.download()
|
||||
self.assertEqual(os.path.getsize(self.dldir + "/bitbake-1.0.tar.gz"), 57749)
|
||||
self.assertEqual(os.path.getsize(self.dldir + "/bitbake-1.1.tar.gz"), 57892)
|
||||
self.d.setVar("BB_NO_NETWORK", "1")
|
||||
fetcher = bb.fetch.Fetch(["http://downloads.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz", "http://downloads.yoctoproject.org/releases/bitbake/bitbake-1.1.tar.gz"], self.d)
|
||||
fetcher.download()
|
||||
fetcher.unpack(self.unpackdir)
|
||||
self.assertEqual(len(os.listdir(self.unpackdir + "/bitbake-1.0/")), 9)
|
||||
self.assertEqual(len(os.listdir(self.unpackdir + "/bitbake-1.1/")), 9)
|
||||
|
||||
if os.environ.get("BB_SKIP_NETTESTS") == "yes":
|
||||
print("Unset BB_SKIP_NETTESTS to run network tests")
|
||||
else:
|
||||
def test_fetch(self):
|
||||
fetcher = bb.fetch.Fetch(["http://downloads.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz", "http://downloads.yoctoproject.org/releases/bitbake/bitbake-1.1.tar.gz"], self.d)
|
||||
fetcher.download()
|
||||
self.assertEqual(os.path.getsize(self.dldir + "/bitbake-1.0.tar.gz"), 57749)
|
||||
self.assertEqual(os.path.getsize(self.dldir + "/bitbake-1.1.tar.gz"), 57892)
|
||||
self.d.setVar("BB_NO_NETWORK", "1")
|
||||
fetcher = bb.fetch.Fetch(["http://downloads.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz", "http://downloads.yoctoproject.org/releases/bitbake/bitbake-1.1.tar.gz"], self.d)
|
||||
fetcher.download()
|
||||
@skipIfNoNetwork()
|
||||
def test_fetch_mirror(self):
|
||||
self.d.setVar("MIRRORS", "http://.*/.* http://downloads.yoctoproject.org/releases/bitbake")
|
||||
fetcher = bb.fetch.Fetch(["http://invalid.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz"], self.d)
|
||||
fetcher.download()
|
||||
self.assertEqual(os.path.getsize(self.dldir + "/bitbake-1.0.tar.gz"), 57749)
|
||||
|
||||
@skipIfNoNetwork()
|
||||
def test_fetch_mirror_of_mirror(self):
|
||||
self.d.setVar("MIRRORS", "http://.*/.* http://invalid2.yoctoproject.org/ \n http://invalid2.yoctoproject.org/.* http://downloads.yoctoproject.org/releases/bitbake")
|
||||
fetcher = bb.fetch.Fetch(["http://invalid.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz"], self.d)
|
||||
fetcher.download()
|
||||
self.assertEqual(os.path.getsize(self.dldir + "/bitbake-1.0.tar.gz"), 57749)
|
||||
|
||||
@skipIfNoNetwork()
|
||||
def test_fetch_file_mirror_of_mirror(self):
|
||||
self.d.setVar("MIRRORS", "http://.*/.* file:///some1where/ \n file:///some1where/.* file://some2where/ \n file://some2where/.* http://downloads.yoctoproject.org/releases/bitbake")
|
||||
fetcher = bb.fetch.Fetch(["http://invalid.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz"], self.d)
|
||||
os.mkdir(self.dldir + "/some2where")
|
||||
fetcher.download()
|
||||
self.assertEqual(os.path.getsize(self.dldir + "/bitbake-1.0.tar.gz"), 57749)
|
||||
|
||||
@skipIfNoNetwork()
|
||||
def test_fetch_premirror(self):
|
||||
self.d.setVar("PREMIRRORS", "http://.*/.* http://downloads.yoctoproject.org/releases/bitbake")
|
||||
fetcher = bb.fetch.Fetch(["http://invalid.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz"], self.d)
|
||||
fetcher.download()
|
||||
self.assertEqual(os.path.getsize(self.dldir + "/bitbake-1.0.tar.gz"), 57749)
|
||||
|
||||
@skipIfNoNetwork()
|
||||
def gitfetcher(self, url1, url2):
|
||||
def checkrevision(self, fetcher):
|
||||
fetcher.unpack(self.unpackdir)
|
||||
self.assertEqual(len(os.listdir(self.unpackdir + "/bitbake-1.0/")), 9)
|
||||
self.assertEqual(len(os.listdir(self.unpackdir + "/bitbake-1.1/")), 9)
|
||||
revision = bb.process.run("git rev-parse HEAD", shell=True, cwd=self.unpackdir + "/git")[0].strip()
|
||||
self.assertEqual(revision, "270a05b0b4ba0959fe0624d2a4885d7b70426da5")
|
||||
|
||||
def test_fetch_mirror(self):
|
||||
self.d.setVar("MIRRORS", "http://.*/.* http://downloads.yoctoproject.org/releases/bitbake")
|
||||
fetcher = bb.fetch.Fetch(["http://invalid.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz"], self.d)
|
||||
fetcher.download()
|
||||
self.assertEqual(os.path.getsize(self.dldir + "/bitbake-1.0.tar.gz"), 57749)
|
||||
self.d.setVar("BB_GENERATE_MIRROR_TARBALLS", "1")
|
||||
self.d.setVar("SRCREV", "270a05b0b4ba0959fe0624d2a4885d7b70426da5")
|
||||
fetcher = bb.fetch.Fetch([url1], self.d)
|
||||
fetcher.download()
|
||||
checkrevision(self, fetcher)
|
||||
# Wipe out the dldir clone and the unpacked source, turn off the network and check mirror tarball works
|
||||
bb.utils.prunedir(self.dldir + "/git2/")
|
||||
bb.utils.prunedir(self.unpackdir)
|
||||
self.d.setVar("BB_NO_NETWORK", "1")
|
||||
fetcher = bb.fetch.Fetch([url2], self.d)
|
||||
fetcher.download()
|
||||
checkrevision(self, fetcher)
|
||||
|
||||
def test_fetch_mirror_of_mirror(self):
|
||||
self.d.setVar("MIRRORS", "http://.*/.* http://invalid2.yoctoproject.org/ \n http://invalid2.yoctoproject.org/.* http://downloads.yoctoproject.org/releases/bitbake")
|
||||
fetcher = bb.fetch.Fetch(["http://invalid.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz"], self.d)
|
||||
fetcher.download()
|
||||
self.assertEqual(os.path.getsize(self.dldir + "/bitbake-1.0.tar.gz"), 57749)
|
||||
@skipIfNoNetwork()
|
||||
def test_gitfetch(self):
|
||||
url1 = url2 = "git://git.openembedded.org/bitbake"
|
||||
self.gitfetcher(url1, url2)
|
||||
|
||||
def test_fetch_file_mirror_of_mirror(self):
|
||||
self.d.setVar("MIRRORS", "http://.*/.* file:///some1where/ \n file:///some1where/.* file://some2where/ \n file://some2where/.* http://downloads.yoctoproject.org/releases/bitbake")
|
||||
fetcher = bb.fetch.Fetch(["http://invalid.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz"], self.d)
|
||||
os.mkdir(self.dldir + "/some2where")
|
||||
fetcher.download()
|
||||
self.assertEqual(os.path.getsize(self.dldir + "/bitbake-1.0.tar.gz"), 57749)
|
||||
@skipIfNoNetwork()
|
||||
def test_gitfetch_goodsrcrev(self):
|
||||
# SRCREV is set but matches rev= parameter
|
||||
url1 = url2 = "git://git.openembedded.org/bitbake;rev=270a05b0b4ba0959fe0624d2a4885d7b70426da5"
|
||||
self.gitfetcher(url1, url2)
|
||||
|
||||
def test_fetch_premirror(self):
|
||||
self.d.setVar("PREMIRRORS", "http://.*/.* http://downloads.yoctoproject.org/releases/bitbake")
|
||||
fetcher = bb.fetch.Fetch(["http://invalid.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz"], self.d)
|
||||
fetcher.download()
|
||||
self.assertEqual(os.path.getsize(self.dldir + "/bitbake-1.0.tar.gz"), 57749)
|
||||
@skipIfNoNetwork()
|
||||
def test_gitfetch_badsrcrev(self):
|
||||
# SRCREV is set but does not match rev= parameter
|
||||
url1 = url2 = "git://git.openembedded.org/bitbake;rev=dead05b0b4ba0959fe0624d2a4885d7b70426da5"
|
||||
self.assertRaises(bb.fetch.FetchError, self.gitfetcher, url1, url2)
|
||||
|
||||
def gitfetcher(self, url1, url2):
|
||||
def checkrevision(self, fetcher):
|
||||
fetcher.unpack(self.unpackdir)
|
||||
revision = bb.process.run("git rev-parse HEAD", shell=True, cwd=self.unpackdir + "/git")[0].strip()
|
||||
self.assertEqual(revision, "270a05b0b4ba0959fe0624d2a4885d7b70426da5")
|
||||
@skipIfNoNetwork()
|
||||
def test_gitfetch_tagandrev(self):
|
||||
# SRCREV is set but does not match rev= parameter
|
||||
url1 = url2 = "git://git.openembedded.org/bitbake;rev=270a05b0b4ba0959fe0624d2a4885d7b70426da5;tag=270a05b0b4ba0959fe0624d2a4885d7b70426da5"
|
||||
self.assertRaises(bb.fetch.FetchError, self.gitfetcher, url1, url2)
|
||||
|
||||
self.d.setVar("BB_GENERATE_MIRROR_TARBALLS", "1")
|
||||
self.d.setVar("SRCREV", "270a05b0b4ba0959fe0624d2a4885d7b70426da5")
|
||||
fetcher = bb.fetch.Fetch([url1], self.d)
|
||||
fetcher.download()
|
||||
checkrevision(self, fetcher)
|
||||
# Wipe out the dldir clone and the unpacked source, turn off the network and check mirror tarball works
|
||||
bb.utils.prunedir(self.dldir + "/git2/")
|
||||
bb.utils.prunedir(self.unpackdir)
|
||||
self.d.setVar("BB_NO_NETWORK", "1")
|
||||
fetcher = bb.fetch.Fetch([url2], self.d)
|
||||
fetcher.download()
|
||||
checkrevision(self, fetcher)
|
||||
@skipIfNoNetwork()
|
||||
def test_gitfetch_localusehead(self):
|
||||
# Create dummy local Git repo
|
||||
src_dir = tempfile.mkdtemp(dir=self.tempdir,
|
||||
prefix='gitfetch_localusehead_')
|
||||
src_dir = os.path.abspath(src_dir)
|
||||
bb.process.run("git init", cwd=src_dir)
|
||||
bb.process.run("git commit --allow-empty -m'Dummy commit'",
|
||||
cwd=src_dir)
|
||||
# Use other branch than master
|
||||
bb.process.run("git checkout -b my-devel", cwd=src_dir)
|
||||
bb.process.run("git commit --allow-empty -m'Dummy commit 2'",
|
||||
cwd=src_dir)
|
||||
stdout = bb.process.run("git rev-parse HEAD", cwd=src_dir)
|
||||
orig_rev = stdout[0].strip()
|
||||
|
||||
def test_gitfetch(self):
|
||||
url1 = url2 = "git://git.openembedded.org/bitbake"
|
||||
self.gitfetcher(url1, url2)
|
||||
# Fetch and check revision
|
||||
self.d.setVar("SRCREV", "AUTOINC")
|
||||
url = "git://" + src_dir + ";protocol=file;usehead=1"
|
||||
fetcher = bb.fetch.Fetch([url], self.d)
|
||||
fetcher.download()
|
||||
fetcher.unpack(self.unpackdir)
|
||||
stdout = bb.process.run("git rev-parse HEAD",
|
||||
cwd=os.path.join(self.unpackdir, 'git'))
|
||||
unpack_rev = stdout[0].strip()
|
||||
self.assertEqual(orig_rev, unpack_rev)
|
||||
|
||||
def test_gitfetch_goodsrcrev(self):
|
||||
# SRCREV is set but matches rev= parameter
|
||||
url1 = url2 = "git://git.openembedded.org/bitbake;rev=270a05b0b4ba0959fe0624d2a4885d7b70426da5"
|
||||
self.gitfetcher(url1, url2)
|
||||
@skipIfNoNetwork()
|
||||
def test_gitfetch_remoteusehead(self):
|
||||
url = "git://git.openembedded.org/bitbake;usehead=1"
|
||||
self.assertRaises(bb.fetch.ParameterError, self.gitfetcher, url, url)
|
||||
|
||||
def test_gitfetch_badsrcrev(self):
|
||||
# SRCREV is set but does not match rev= parameter
|
||||
url1 = url2 = "git://git.openembedded.org/bitbake;rev=dead05b0b4ba0959fe0624d2a4885d7b70426da5"
|
||||
self.assertRaises(bb.fetch.FetchError, self.gitfetcher, url1, url2)
|
||||
@skipIfNoNetwork()
|
||||
def test_gitfetch_premirror(self):
|
||||
url1 = "git://git.openembedded.org/bitbake"
|
||||
url2 = "git://someserver.org/bitbake"
|
||||
self.d.setVar("PREMIRRORS", "git://someserver.org/bitbake git://git.openembedded.org/bitbake \n")
|
||||
self.gitfetcher(url1, url2)
|
||||
|
||||
def test_gitfetch_tagandrev(self):
|
||||
# SRCREV is set but does not match rev= parameter
|
||||
url1 = url2 = "git://git.openembedded.org/bitbake;rev=270a05b0b4ba0959fe0624d2a4885d7b70426da5;tag=270a05b0b4ba0959fe0624d2a4885d7b70426da5"
|
||||
self.assertRaises(bb.fetch.FetchError, self.gitfetcher, url1, url2)
|
||||
@skipIfNoNetwork()
|
||||
def test_gitfetch_premirror2(self):
|
||||
url1 = url2 = "git://someserver.org/bitbake"
|
||||
self.d.setVar("PREMIRRORS", "git://someserver.org/bitbake git://git.openembedded.org/bitbake \n")
|
||||
self.gitfetcher(url1, url2)
|
||||
|
||||
def test_gitfetch_localusehead(self):
|
||||
# Create dummy local Git repo
|
||||
src_dir = tempfile.mkdtemp(dir=self.tempdir,
|
||||
prefix='gitfetch_localusehead_')
|
||||
src_dir = os.path.abspath(src_dir)
|
||||
bb.process.run("git init", cwd=src_dir)
|
||||
bb.process.run("git commit --allow-empty -m'Dummy commit'",
|
||||
cwd=src_dir)
|
||||
# Use other branch than master
|
||||
bb.process.run("git checkout -b my-devel", cwd=src_dir)
|
||||
bb.process.run("git commit --allow-empty -m'Dummy commit 2'",
|
||||
cwd=src_dir)
|
||||
stdout = bb.process.run("git rev-parse HEAD", cwd=src_dir)
|
||||
orig_rev = stdout[0].strip()
|
||||
@skipIfNoNetwork()
|
||||
def test_gitfetch_premirror3(self):
|
||||
realurl = "git://git.openembedded.org/bitbake"
|
||||
dummyurl = "git://someserver.org/bitbake"
|
||||
self.sourcedir = self.unpackdir.replace("unpacked", "sourcemirror.git")
|
||||
os.chdir(self.tempdir)
|
||||
bb.process.run("git clone %s %s 2> /dev/null" % (realurl, self.sourcedir), shell=True)
|
||||
self.d.setVar("PREMIRRORS", "%s git://%s;protocol=file \n" % (dummyurl, self.sourcedir))
|
||||
self.gitfetcher(dummyurl, dummyurl)
|
||||
|
||||
# Fetch and check revision
|
||||
self.d.setVar("SRCREV", "AUTOINC")
|
||||
url = "git://" + src_dir + ";protocol=file;usehead=1"
|
||||
fetcher = bb.fetch.Fetch([url], self.d)
|
||||
fetcher.download()
|
||||
fetcher.unpack(self.unpackdir)
|
||||
stdout = bb.process.run("git rev-parse HEAD",
|
||||
cwd=os.path.join(self.unpackdir, 'git'))
|
||||
unpack_rev = stdout[0].strip()
|
||||
self.assertEqual(orig_rev, unpack_rev)
|
||||
|
||||
def test_gitfetch_remoteusehead(self):
|
||||
url = "git://git.openembedded.org/bitbake;usehead=1"
|
||||
self.assertRaises(bb.fetch.ParameterError, self.gitfetcher, url, url)
|
||||
|
||||
def test_gitfetch_premirror(self):
|
||||
url1 = "git://git.openembedded.org/bitbake"
|
||||
url2 = "git://someserver.org/bitbake"
|
||||
self.d.setVar("PREMIRRORS", "git://someserver.org/bitbake git://git.openembedded.org/bitbake \n")
|
||||
self.gitfetcher(url1, url2)
|
||||
|
||||
def test_gitfetch_premirror2(self):
|
||||
url1 = url2 = "git://someserver.org/bitbake"
|
||||
self.d.setVar("PREMIRRORS", "git://someserver.org/bitbake git://git.openembedded.org/bitbake \n")
|
||||
self.gitfetcher(url1, url2)
|
||||
|
||||
def test_gitfetch_premirror3(self):
|
||||
realurl = "git://git.openembedded.org/bitbake"
|
||||
dummyurl = "git://someserver.org/bitbake"
|
||||
self.sourcedir = self.unpackdir.replace("unpacked", "sourcemirror.git")
|
||||
os.chdir(self.tempdir)
|
||||
bb.process.run("git clone %s %s 2> /dev/null" % (realurl, self.sourcedir), shell=True)
|
||||
self.d.setVar("PREMIRRORS", "%s git://%s;protocol=file \n" % (dummyurl, self.sourcedir))
|
||||
self.gitfetcher(dummyurl, dummyurl)
|
||||
|
||||
def test_git_submodule(self):
|
||||
fetcher = bb.fetch.Fetch(["gitsm://git.yoctoproject.org/git-submodule-test;rev=f12e57f2edf0aa534cf1616fa983d165a92b0842"], self.d)
|
||||
fetcher.download()
|
||||
# Previous cwd has been deleted
|
||||
os.chdir(os.path.dirname(self.unpackdir))
|
||||
fetcher.unpack(self.unpackdir)
|
||||
@skipIfNoNetwork()
|
||||
def test_git_submodule(self):
|
||||
fetcher = bb.fetch.Fetch(["gitsm://git.yoctoproject.org/git-submodule-test;rev=f12e57f2edf0aa534cf1616fa983d165a92b0842"], self.d)
|
||||
fetcher.download()
|
||||
# Previous cwd has been deleted
|
||||
os.chdir(os.path.dirname(self.unpackdir))
|
||||
fetcher.unpack(self.unpackdir)
|
||||
|
||||
|
||||
class TrustedNetworksTest(FetcherTest):
|
||||
@@ -782,32 +799,32 @@ class FetchLatestVersionTest(FetcherTest):
|
||||
("db", "http://download.oracle.com/berkeley-db/db-5.3.21.tar.gz", "http://www.oracle.com/technetwork/products/berkeleydb/downloads/index-082944.html", "http://download.oracle.com/otn/berkeley-db/(?P<name>db-)(?P<pver>((\d+[\.\-_]*)+))\.tar\.gz")
|
||||
: "6.1.19",
|
||||
}
|
||||
if os.environ.get("BB_SKIP_NETTESTS") == "yes":
|
||||
print("Unset BB_SKIP_NETTESTS to run network tests")
|
||||
else:
|
||||
def test_git_latest_versionstring(self):
|
||||
for k, v in self.test_git_uris.items():
|
||||
self.d.setVar("PN", k[0])
|
||||
self.d.setVar("SRCREV", k[2])
|
||||
self.d.setVar("UPSTREAM_CHECK_GITTAGREGEX", k[3])
|
||||
ud = bb.fetch2.FetchData(k[1], self.d)
|
||||
pupver= ud.method.latest_versionstring(ud, self.d)
|
||||
verstring = pupver[0]
|
||||
self.assertTrue(verstring, msg="Could not find upstream version")
|
||||
r = bb.utils.vercmp_string(v, verstring)
|
||||
self.assertTrue(r == -1 or r == 0, msg="Package %s, version: %s <= %s" % (k[0], v, verstring))
|
||||
|
||||
def test_wget_latest_versionstring(self):
|
||||
for k, v in self.test_wget_uris.items():
|
||||
self.d.setVar("PN", k[0])
|
||||
self.d.setVar("UPSTREAM_CHECK_URI", k[2])
|
||||
self.d.setVar("UPSTREAM_CHECK_REGEX", k[3])
|
||||
ud = bb.fetch2.FetchData(k[1], self.d)
|
||||
pupver = ud.method.latest_versionstring(ud, self.d)
|
||||
verstring = pupver[0]
|
||||
self.assertTrue(verstring, msg="Could not find upstream version")
|
||||
r = bb.utils.vercmp_string(v, verstring)
|
||||
self.assertTrue(r == -1 or r == 0, msg="Package %s, version: %s <= %s" % (k[0], v, verstring))
|
||||
@skipIfNoNetwork()
|
||||
def test_git_latest_versionstring(self):
|
||||
for k, v in self.test_git_uris.items():
|
||||
self.d.setVar("PN", k[0])
|
||||
self.d.setVar("SRCREV", k[2])
|
||||
self.d.setVar("UPSTREAM_CHECK_GITTAGREGEX", k[3])
|
||||
ud = bb.fetch2.FetchData(k[1], self.d)
|
||||
pupver= ud.method.latest_versionstring(ud, self.d)
|
||||
verstring = pupver[0]
|
||||
self.assertTrue(verstring, msg="Could not find upstream version")
|
||||
r = bb.utils.vercmp_string(v, verstring)
|
||||
self.assertTrue(r == -1 or r == 0, msg="Package %s, version: %s <= %s" % (k[0], v, verstring))
|
||||
|
||||
@skipIfNoNetwork()
|
||||
def test_wget_latest_versionstring(self):
|
||||
for k, v in self.test_wget_uris.items():
|
||||
self.d.setVar("PN", k[0])
|
||||
self.d.setVar("UPSTREAM_CHECK_URI", k[2])
|
||||
self.d.setVar("UPSTREAM_CHECK_REGEX", k[3])
|
||||
ud = bb.fetch2.FetchData(k[1], self.d)
|
||||
pupver = ud.method.latest_versionstring(ud, self.d)
|
||||
verstring = pupver[0]
|
||||
self.assertTrue(verstring, msg="Could not find upstream version")
|
||||
r = bb.utils.vercmp_string(v, verstring)
|
||||
self.assertTrue(r == -1 or r == 0, msg="Package %s, version: %s <= %s" % (k[0], v, verstring))
|
||||
|
||||
|
||||
class FetchCheckStatusTest(FetcherTest):
|
||||
@@ -820,40 +837,40 @@ class FetchCheckStatusTest(FetcherTest):
|
||||
"https://yoctoproject.org/documentation",
|
||||
"http://downloads.yoctoproject.org/releases/opkg/opkg-0.1.7.tar.gz",
|
||||
"http://downloads.yoctoproject.org/releases/opkg/opkg-0.3.0.tar.gz",
|
||||
"ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz",
|
||||
"ftp://ftp.gnu.org/gnu/chess/gnuchess-5.08.tar.gz",
|
||||
"ftp://ftp.gnu.org/gnu/gmp/gmp-4.0.tar.gz",
|
||||
"ftp://sourceware.org/pub/libffi/libffi-1.20.tar.gz",
|
||||
"http://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz",
|
||||
"https://ftp.gnu.org/gnu/chess/gnuchess-5.08.tar.gz",
|
||||
"https://ftp.gnu.org/gnu/gmp/gmp-4.0.tar.gz",
|
||||
# GitHub releases are hosted on Amazon S3, which doesn't support HEAD
|
||||
"https://github.com/kergoth/tslib/releases/download/1.1/tslib-1.1.tar.xz"
|
||||
]
|
||||
|
||||
if os.environ.get("BB_SKIP_NETTESTS") == "yes":
|
||||
print("Unset BB_SKIP_NETTESTS to run network tests")
|
||||
else:
|
||||
|
||||
def test_wget_checkstatus(self):
|
||||
fetch = bb.fetch2.Fetch(self.test_wget_uris, self.d)
|
||||
for u in self.test_wget_uris:
|
||||
@skipIfNoNetwork()
|
||||
def test_wget_checkstatus(self):
|
||||
fetch = bb.fetch2.Fetch(self.test_wget_uris, self.d)
|
||||
for u in self.test_wget_uris:
|
||||
with self.subTest(url=u):
|
||||
ud = fetch.ud[u]
|
||||
m = ud.method
|
||||
ret = m.checkstatus(fetch, ud, self.d)
|
||||
self.assertTrue(ret, msg="URI %s, can't check status" % (u))
|
||||
|
||||
@skipIfNoNetwork()
|
||||
def test_wget_checkstatus_connection_cache(self):
|
||||
from bb.fetch2 import FetchConnectionCache
|
||||
|
||||
def test_wget_checkstatus_connection_cache(self):
|
||||
from bb.fetch2 import FetchConnectionCache
|
||||
connection_cache = FetchConnectionCache()
|
||||
fetch = bb.fetch2.Fetch(self.test_wget_uris, self.d,
|
||||
connection_cache = connection_cache)
|
||||
|
||||
connection_cache = FetchConnectionCache()
|
||||
fetch = bb.fetch2.Fetch(self.test_wget_uris, self.d,
|
||||
connection_cache = connection_cache)
|
||||
|
||||
for u in self.test_wget_uris:
|
||||
for u in self.test_wget_uris:
|
||||
with self.subTest(url=u):
|
||||
ud = fetch.ud[u]
|
||||
m = ud.method
|
||||
ret = m.checkstatus(fetch, ud, self.d)
|
||||
self.assertTrue(ret, msg="URI %s, can't check status" % (u))
|
||||
|
||||
connection_cache.close_connections()
|
||||
connection_cache.close_connections()
|
||||
|
||||
|
||||
class GitMakeShallowTest(FetcherTest):
|
||||
@@ -972,15 +989,13 @@ class GitMakeShallowTest(FetcherTest):
|
||||
self.make_shallow()
|
||||
self.assertRevCount(1)
|
||||
|
||||
if os.environ.get("BB_SKIP_NETTESTS") == "yes":
|
||||
print("Unset BB_SKIP_NETTESTS to run network tests")
|
||||
else:
|
||||
def test_make_shallow_bitbake(self):
|
||||
self.git('remote add origin https://github.com/openembedded/bitbake')
|
||||
self.git('fetch --tags origin')
|
||||
orig_revs = len(self.git('rev-list --all').splitlines())
|
||||
self.make_shallow(['refs/tags/1.10.0'])
|
||||
self.assertRevCount(orig_revs - 1746, ['--all'])
|
||||
@skipIfNoNetwork()
|
||||
def test_make_shallow_bitbake(self):
|
||||
self.git('remote add origin https://github.com/openembedded/bitbake')
|
||||
self.git('fetch --tags origin')
|
||||
orig_revs = len(self.git('rev-list --all').splitlines())
|
||||
self.make_shallow(['refs/tags/1.10.0'])
|
||||
self.assertRevCount(orig_revs - 1746, ['--all'])
|
||||
|
||||
class GitShallowTest(FetcherTest):
|
||||
def setUp(self):
|
||||
@@ -1436,24 +1451,22 @@ class GitShallowTest(FetcherTest):
|
||||
with self.assertRaises(bb.fetch2.FetchError):
|
||||
self.fetch()
|
||||
|
||||
if os.environ.get("BB_SKIP_NETTESTS") == "yes":
|
||||
print("Unset BB_SKIP_NETTESTS to run network tests")
|
||||
else:
|
||||
def test_bitbake(self):
|
||||
self.git('remote add --mirror=fetch origin git://github.com/openembedded/bitbake', cwd=self.srcdir)
|
||||
self.git('config core.bare true', cwd=self.srcdir)
|
||||
self.git('fetch', cwd=self.srcdir)
|
||||
@skipIfNoNetwork()
|
||||
def test_bitbake(self):
|
||||
self.git('remote add --mirror=fetch origin git://github.com/openembedded/bitbake', cwd=self.srcdir)
|
||||
self.git('config core.bare true', cwd=self.srcdir)
|
||||
self.git('fetch', cwd=self.srcdir)
|
||||
|
||||
self.d.setVar('BB_GIT_SHALLOW_DEPTH', '0')
|
||||
# Note that the 1.10.0 tag is annotated, so this also tests
|
||||
# reference of an annotated vs unannotated tag
|
||||
self.d.setVar('BB_GIT_SHALLOW_REVS', '1.10.0')
|
||||
self.d.setVar('BB_GIT_SHALLOW_DEPTH', '0')
|
||||
# Note that the 1.10.0 tag is annotated, so this also tests
|
||||
# reference of an annotated vs unannotated tag
|
||||
self.d.setVar('BB_GIT_SHALLOW_REVS', '1.10.0')
|
||||
|
||||
self.fetch_shallow()
|
||||
self.fetch_shallow()
|
||||
|
||||
# Confirm that the history of 1.10.0 was removed
|
||||
orig_revs = len(self.git('rev-list master', cwd=self.srcdir).splitlines())
|
||||
revs = len(self.git('rev-list master').splitlines())
|
||||
self.assertNotEqual(orig_revs, revs)
|
||||
self.assertRefs(['master', 'origin/master'])
|
||||
self.assertRevCount(orig_revs - 1758)
|
||||
# Confirm that the history of 1.10.0 was removed
|
||||
orig_revs = len(self.git('rev-list master', cwd=self.srcdir).splitlines())
|
||||
revs = len(self.git('rev-list master').splitlines())
|
||||
self.assertNotEqual(orig_revs, revs)
|
||||
self.assertRefs(['master', 'origin/master'])
|
||||
self.assertRevCount(orig_revs - 1758)
|
||||
|
||||
@@ -322,14 +322,14 @@ class Tinfoil:
|
||||
self.server_connection = None
|
||||
self.recipes_parsed = False
|
||||
self.quiet = 0
|
||||
self.oldhandlers = self.logger.handlers[:]
|
||||
if setup_logging:
|
||||
# This is the *client-side* logger, nothing to do with
|
||||
# logging messages from the server
|
||||
oldhandlers = self.logger.handlers[:]
|
||||
bb.msg.logger_create('BitBake', output)
|
||||
self.localhandlers = []
|
||||
for handler in self.logger.handlers:
|
||||
if handler not in oldhandlers:
|
||||
if handler not in self.oldhandlers:
|
||||
self.localhandlers.append(handler)
|
||||
|
||||
def __enter__(self):
|
||||
@@ -835,6 +835,12 @@ class Tinfoil:
|
||||
self.server_connection.terminate()
|
||||
self.server_connection = None
|
||||
|
||||
# Restore logging handlers to how it looked when we started
|
||||
if self.oldhandlers:
|
||||
for handler in self.logger.handlers:
|
||||
if handler not in self.oldhandlers:
|
||||
self.logger.handlers.remove(handler)
|
||||
|
||||
def _reconvert_type(self, obj, origtypename):
|
||||
"""
|
||||
Convert an object back to the right type, in the case
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
DISTRO = "poky"
|
||||
DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
|
||||
DISTRO_VERSION = "2.4"
|
||||
DISTRO_VERSION = "2.4.1"
|
||||
DISTRO_CODENAME = "rocko"
|
||||
SDK_VENDOR = "-pokysdk"
|
||||
SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}"
|
||||
|
||||
14
meta-selftest/files/static-group
Normal file
14
meta-selftest/files/static-group
Normal file
@@ -0,0 +1,14 @@
|
||||
messagebus:x:500:
|
||||
systemd-bus-proxy:x:501:
|
||||
systemd-network:x:502:
|
||||
systemd-resolve:x:503:
|
||||
systemd-timesync:x:504:
|
||||
polkitd:x:505:
|
||||
lock:x:506:
|
||||
systemd-journal:x:507:
|
||||
netdev:x:508:
|
||||
avahi:x:509:
|
||||
avahi-autoipd:x:510:
|
||||
rpc:x:511:
|
||||
rpcuser:x:513:
|
||||
|
||||
11
meta-selftest/files/static-passwd
Normal file
11
meta-selftest/files/static-passwd
Normal file
@@ -0,0 +1,11 @@
|
||||
messagebus:x:500:500::/var/lib/dbus:/bin/false
|
||||
systemd-bus-proxy:x:501:501::/:/bin/nologin
|
||||
systemd-network:x:502:502::/:/bin/nologin
|
||||
systemd-resolve:x:503:503::/:/bin/nologin
|
||||
systemd-timesync:x:504:504::/:/bin/nologin
|
||||
polkitd:x:505:505::/:/bin/nologin
|
||||
avahi:x:509:509::/:/bin/nologin
|
||||
avahi-autoipd:x:510:510::/:/bin/nologin
|
||||
rpc:x:511:511::/:/bin/nologin
|
||||
distcc:x:512:nogroup::/:/bin/nologin
|
||||
rpcuser:x:513:513::/var/lib/nfs:/bin/nologin
|
||||
@@ -178,7 +178,7 @@ def pkgarch_mapping(d):
|
||||
|
||||
def get_layers_branch_rev(d):
|
||||
layers = (d.getVar("BBLAYERS") or "").split()
|
||||
layers_branch_rev = ["%-17s = \"%s:%s\"" % (os.path.basename(i), \
|
||||
layers_branch_rev = ["%-20s = \"%s:%s\"" % (os.path.basename(i), \
|
||||
base_get_metadata_git_branch(i, None).strip(), \
|
||||
base_get_metadata_git_revision(i, None)) \
|
||||
for i in layers]
|
||||
@@ -206,7 +206,7 @@ def buildcfg_vars(d):
|
||||
for var in statusvars:
|
||||
value = d.getVar(var)
|
||||
if value is not None:
|
||||
yield '%-17s = "%s"' % (var, value)
|
||||
yield '%-20s = "%s"' % (var, value)
|
||||
|
||||
def buildcfg_neededvars(d):
|
||||
needed_vars = oe.data.typed_value("BUILDCFG_NEEDEDVARS", d)
|
||||
@@ -624,7 +624,7 @@ python () {
|
||||
d.appendVarFlag('do_unpack', 'depends', ' lzip-native:do_populate_sysroot')
|
||||
|
||||
# *.xz should DEPEND on xz-native for unpacking
|
||||
elif path.endswith('.xz'):
|
||||
elif path.endswith('.xz') or path.endswith('.txz'):
|
||||
d.appendVarFlag('do_unpack', 'depends', ' xz-native:do_populate_sysroot')
|
||||
|
||||
# .zip should DEPEND on unzip-native for unpacking
|
||||
|
||||
@@ -188,10 +188,8 @@ def srctree_hash_files(d, srcdir=None):
|
||||
git_dir = None
|
||||
|
||||
try:
|
||||
# git rev-parse returns the path relative to the current working
|
||||
# directory
|
||||
git_dir = os.path.join(s_dir,
|
||||
subprocess.check_output(['git', 'rev-parse', '--git-dir'], cwd=s_dir).decode("utf-8").rstrip())
|
||||
subprocess.check_output(['git', '-C', s_dir, 'rev-parse', '--git-dir']).decode("utf-8").rstrip())
|
||||
except subprocess.CalledProcessError:
|
||||
pass
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ COMPATIBLE_HOST_linux-gnux32 = "null"
|
||||
COMPATIBLE_HOST_linux-muslx32 = "null"
|
||||
COMPATIBLE_HOST_powerpc = "null"
|
||||
COMPATIBLE_HOST_powerpc64 = "null"
|
||||
COMPATIBLE_HOST_mipsarchn32 = "null"
|
||||
ARM_INSTRUCTION_SET = "arm"
|
||||
TUNE_CCARGS_remove = "-march=mips32r2"
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ do_compile_prepend_class-target () {
|
||||
# which may then get deleted (or their dependencies) and potentially segfault
|
||||
export GIO_MODULE_DIR=${STAGING_LIBDIR}/gio/modules-dummy
|
||||
|
||||
GIR_EXTRA_LIBS_PATH=\`find ${B} -name *.so -printf %h| tr '\n' ':'\`\$GIR_EXTRA_LIBS_PATH
|
||||
GIR_EXTRA_LIBS_PATH=\`find ${B} -name *.so -printf "%h\n"|sort|uniq| tr '\n' ':'\`\$GIR_EXTRA_LIBS_PATH
|
||||
GIR_EXTRA_LIBS_PATH=\`find ${B} -name .libs| tr '\n' ':'\`\$GIR_EXTRA_LIBS_PATH
|
||||
|
||||
if [ -d ".libs" ]; then
|
||||
|
||||
@@ -145,14 +145,18 @@ IMAGE_TYPE_wic = "image_types_wic"
|
||||
inherit ${IMAGE_TYPE_wic}
|
||||
|
||||
python () {
|
||||
def extraimage_getdepends(task):
|
||||
deps = ""
|
||||
for dep in (d.getVar('EXTRA_IMAGEDEPENDS') or "").split():
|
||||
deps += " %s:%s" % (dep, task)
|
||||
return deps
|
||||
|
||||
d.appendVarFlag('do_image', 'depends', extraimage_getdepends('do_populate_lic'))
|
||||
d.appendVarFlag('do_image_complete', 'depends', extraimage_getdepends('do_populate_sysroot'))
|
||||
|
||||
deps = " " + imagetypes_getdepends(d)
|
||||
d.appendVarFlag('do_rootfs', 'depends', deps)
|
||||
|
||||
deps = ""
|
||||
for dep in (d.getVar('EXTRA_IMAGEDEPENDS') or "").split():
|
||||
deps += " %s:do_populate_sysroot" % dep
|
||||
d.appendVarFlag('do_image_complete', 'depends', deps)
|
||||
|
||||
#process IMAGE_FEATURES, we must do this before runtime_mapping_rename
|
||||
#Check for replaces image features
|
||||
features = set(oe.data.typed_value('IMAGE_FEATURES', d))
|
||||
@@ -440,6 +444,9 @@ python () {
|
||||
localdata.delVar('DATETIME')
|
||||
localdata.delVar('DATE')
|
||||
localdata.delVar('TMPDIR')
|
||||
vardepsexclude = (d.getVarFlag('IMAGE_CMD_' + realt, 'vardepsexclude', True) or '').split()
|
||||
for dep in vardepsexclude:
|
||||
localdata.delVar(dep)
|
||||
|
||||
image_cmd = localdata.getVar("IMAGE_CMD")
|
||||
vardeps.add('IMAGE_CMD_' + realt)
|
||||
@@ -503,7 +510,7 @@ python () {
|
||||
d.prependVarFlag(task, 'postfuncs', ' create_symlinks')
|
||||
d.appendVarFlag(task, 'subimages', ' ' + ' '.join(subimages))
|
||||
d.appendVarFlag(task, 'vardeps', ' ' + ' '.join(vardeps))
|
||||
d.appendVarFlag(task, 'vardepsexclude', 'DATETIME DATE')
|
||||
d.appendVarFlag(task, 'vardepsexclude', 'DATETIME DATE ' + ' '.join(vardepsexclude))
|
||||
|
||||
bb.debug(2, "Adding task %s before %s, after %s" % (task, 'do_image_complete', after))
|
||||
bb.build.addtask(task, 'do_image_complete', after, d)
|
||||
|
||||
@@ -83,7 +83,11 @@ oe_mkext234fs () {
|
||||
eval COUNT=\"$MIN_COUNT\"
|
||||
fi
|
||||
# Create a sparse image block
|
||||
bbdebug 1 Executing "dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype seek=$ROOTFS_SIZE count=$COUNT bs=1024"
|
||||
dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype seek=$ROOTFS_SIZE count=$COUNT bs=1024
|
||||
bbdebug 1 "Actual Rootfs size: `du -s ${IMAGE_ROOTFS}`"
|
||||
bbdebug 1 "Actual Partion size: `ls -s ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype`"
|
||||
bbdebug 1 Executing "mkfs.$fstype -F $extra_imagecmd ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype -d ${IMAGE_ROOTFS}"
|
||||
mkfs.$fstype -F $extra_imagecmd ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype -d ${IMAGE_ROOTFS}
|
||||
# Error codes 0-3 indicate successfull operation of fsck (no errors or errors corrected)
|
||||
fsck.$fstype -pvfD ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype || [ $? -le 3 ]
|
||||
|
||||
@@ -12,7 +12,7 @@ OPKGBUILDCMD ??= "opkg-build"
|
||||
|
||||
OPKG_ARGS += "--force_postinstall --prefer-arch-to-version"
|
||||
OPKG_ARGS += "${@['', '--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS") == "1"]}"
|
||||
OPKG_ARGS += "${@['', '--add-exclude ' + ' --add-exclude '.join((d.getVar('PACKAGE_EXCLUDE') or "").split())][(d.getVar("PACKAGE_EXCLUDE") or "") != ""]}"
|
||||
OPKG_ARGS += "${@['', '--add-exclude ' + ' --add-exclude '.join((d.getVar('PACKAGE_EXCLUDE') or "").split())][(d.getVar("PACKAGE_EXCLUDE") or "").strip() != ""]}"
|
||||
|
||||
OPKGLIBDIR = "${localstatedir}/lib"
|
||||
|
||||
|
||||
@@ -85,7 +85,8 @@ python do_write_qemuboot_conf() {
|
||||
|
||||
qemuboot = "%s/%s.qemuboot.conf" % (d.getVar('IMGDEPLOYDIR'), d.getVar('IMAGE_NAME'))
|
||||
qemuboot_link = "%s/%s.qemuboot.conf" % (d.getVar('IMGDEPLOYDIR'), d.getVar('IMAGE_LINK_NAME'))
|
||||
topdir="%s/"%(d.getVar('TOPDIR')).replace("//","/")
|
||||
finalpath = d.getVar("DEPLOY_DIR_IMAGE")
|
||||
topdir = d.getVar('TOPDIR')
|
||||
cf = configparser.ConfigParser()
|
||||
cf.add_section('config_bsp')
|
||||
for k in sorted(qemuboot_vars(d)):
|
||||
@@ -98,7 +99,8 @@ python do_write_qemuboot_conf() {
|
||||
val = d.getVar(k)
|
||||
# we only want to write out relative paths so that we can relocate images
|
||||
# and still run them
|
||||
val=val.replace(topdir,"")
|
||||
if val.startswith(topdir):
|
||||
val = os.path.relpath(val, finalpath)
|
||||
cf.set('config_bsp', k, '%s' % val)
|
||||
|
||||
# QB_DEFAULT_KERNEL's value of KERNEL_IMAGETYPE is the name of a symlink
|
||||
@@ -108,7 +110,7 @@ python do_write_qemuboot_conf() {
|
||||
kernel = os.path.realpath(kernel_link)
|
||||
# we only want to write out relative paths so that we can relocate images
|
||||
# and still run them
|
||||
kernel=kernel.replace(topdir,"")
|
||||
kernel = os.path.relpath(kernel, finalpath)
|
||||
cf.set('config_bsp', 'QB_DEFAULT_KERNEL', kernel)
|
||||
|
||||
bb.utils.mkdirhier(os.path.dirname(qemuboot))
|
||||
|
||||
@@ -248,7 +248,7 @@ def testimage_main(d):
|
||||
|
||||
# the robot dance
|
||||
target = OERuntimeTestContextExecutor.getTarget(
|
||||
d.getVar("TEST_TARGET"), None, d.getVar("TEST_TARGET_IP"),
|
||||
d.getVar("TEST_TARGET"), logger, d.getVar("TEST_TARGET_IP"),
|
||||
d.getVar("TEST_SERVER_IP"), **target_kwargs)
|
||||
|
||||
# test context
|
||||
@@ -291,11 +291,11 @@ def testimage_main(d):
|
||||
|
||||
# Show results (if we have them)
|
||||
if not results:
|
||||
bb.fatal('%s - FAILED - tests were interrupted during execution' % pn)
|
||||
bb.fatal('%s - FAILED - tests were interrupted during execution' % pn, forcelog=True)
|
||||
results.logDetails()
|
||||
results.logSummary(pn)
|
||||
if not results.wasSuccessful():
|
||||
bb.fatal('%s - FAILED - check the task log and the ssh log' % pn)
|
||||
bb.fatal('%s - FAILED - check the task log and the ssh log' % pn, forcelog=True)
|
||||
|
||||
def get_runtime_paths(d):
|
||||
"""
|
||||
|
||||
@@ -38,30 +38,39 @@ def update_useradd_static_config(d):
|
||||
|
||||
return id_table
|
||||
|
||||
def handle_missing_id(id, type, pkg):
|
||||
def handle_missing_id(id, type, pkg, files, var, value):
|
||||
# For backwards compatibility we accept "1" in addition to "error"
|
||||
if d.getVar('USERADD_ERROR_DYNAMIC') == 'error' or d.getVar('USERADD_ERROR_DYNAMIC') == '1':
|
||||
raise NotImplementedError("%s - %s: %sname %s does not have a static ID defined. Skipping it." % (d.getVar('PN'), pkg, type, id))
|
||||
elif d.getVar('USERADD_ERROR_DYNAMIC') == 'warn':
|
||||
bb.warn("%s - %s: %sname %s does not have a static ID defined." % (d.getVar('PN'), pkg, type, id))
|
||||
error_dynamic = d.getVar('USERADD_ERROR_DYNAMIC')
|
||||
msg = "%s - %s: %sname %s does not have a static ID defined." % (d.getVar('PN'), pkg, type, id)
|
||||
if files:
|
||||
msg += " Add %s to one of these files: %s" % (id, files)
|
||||
else:
|
||||
msg += " %s file(s) not found in BBPATH: %s" % (var, value)
|
||||
if error_dynamic == 'error' or error_dynamic == '1':
|
||||
raise NotImplementedError(msg)
|
||||
elif error_dynamic == 'warn':
|
||||
bb.warn(msg)
|
||||
elif error_dynamic == 'skip':
|
||||
raise bb.parse.SkipRecipe(msg)
|
||||
|
||||
# Return a list of configuration files based on either the default
|
||||
# files/group or the contents of USERADD_GID_TABLES, resp.
|
||||
# files/passwd for USERADD_UID_TABLES.
|
||||
# Paths are resolved via BBPATH.
|
||||
def get_table_list(d, var, default):
|
||||
files = []
|
||||
bbpath = d.getVar('BBPATH', True)
|
||||
tables = d.getVar(var, True)
|
||||
if not tables:
|
||||
tables = default
|
||||
for conf_file in tables.split():
|
||||
files.append(bb.utils.which(bbpath, conf_file))
|
||||
return (' '.join(files), var, default)
|
||||
|
||||
# We parse and rewrite the useradd components
|
||||
def rewrite_useradd(params, is_pkg):
|
||||
parser = oe.useradd.build_useradd_parser()
|
||||
|
||||
# Return a list of configuration files based on either the default
|
||||
# files/passwd or the contents of USERADD_UID_TABLES
|
||||
# paths are resolved via BBPATH
|
||||
def get_passwd_list(d):
|
||||
str = ""
|
||||
bbpath = d.getVar('BBPATH')
|
||||
passwd_tables = d.getVar('USERADD_UID_TABLES')
|
||||
if not passwd_tables:
|
||||
passwd_tables = 'files/passwd'
|
||||
for conf_file in passwd_tables.split():
|
||||
str += " %s" % bb.utils.which(bbpath, conf_file)
|
||||
return str
|
||||
|
||||
newparams = []
|
||||
users = None
|
||||
for param in oe.useradd.split_commands(params):
|
||||
@@ -82,10 +91,12 @@ def update_useradd_static_config(d):
|
||||
# all new users get the default ('*' which prevents login) until the user is
|
||||
# specifically configured by the system admin.
|
||||
if not users:
|
||||
users = merge_files(get_passwd_list(d), 7)
|
||||
files, table_var, table_value = get_table_list(d, 'USERADD_UID_TABLES', 'files/passwd')
|
||||
users = merge_files(files, 7)
|
||||
|
||||
type = 'system user' if uaargs.system else 'normal user'
|
||||
if uaargs.LOGIN not in users:
|
||||
handle_missing_id(uaargs.LOGIN, 'user', pkg)
|
||||
handle_missing_id(uaargs.LOGIN, type, pkg, files, table_var, table_value)
|
||||
newparams.append(param)
|
||||
continue
|
||||
|
||||
@@ -143,7 +154,7 @@ def update_useradd_static_config(d):
|
||||
|
||||
# Should be an error if a specific option is set...
|
||||
if not uaargs.uid or not uaargs.uid.isdigit() or not uaargs.gid:
|
||||
handle_missing_id(uaargs.LOGIN, 'user', pkg)
|
||||
handle_missing_id(uaargs.LOGIN, type, pkg, files, table_var, table_value)
|
||||
|
||||
# Reconstruct the args...
|
||||
newparam = ['', ' --defaults'][uaargs.defaults]
|
||||
@@ -180,19 +191,6 @@ def update_useradd_static_config(d):
|
||||
def rewrite_groupadd(params, is_pkg):
|
||||
parser = oe.useradd.build_groupadd_parser()
|
||||
|
||||
# Return a list of configuration files based on either the default
|
||||
# files/group or the contents of USERADD_GID_TABLES
|
||||
# paths are resolved via BBPATH
|
||||
def get_group_list(d):
|
||||
str = ""
|
||||
bbpath = d.getVar('BBPATH')
|
||||
group_tables = d.getVar('USERADD_GID_TABLES')
|
||||
if not group_tables:
|
||||
group_tables = 'files/group'
|
||||
for conf_file in group_tables.split():
|
||||
str += " %s" % bb.utils.which(bbpath, conf_file)
|
||||
return str
|
||||
|
||||
newparams = []
|
||||
groups = None
|
||||
for param in oe.useradd.split_commands(params):
|
||||
@@ -212,10 +210,12 @@ def update_useradd_static_config(d):
|
||||
# Note: similar to the passwd file, the 'password' filed is ignored
|
||||
# Note: group_members is ignored, group members must be configured with the GROUPMEMS_PARAM
|
||||
if not groups:
|
||||
groups = merge_files(get_group_list(d), 4)
|
||||
files, table_var, table_value = get_table_list(d, 'USERADD_GID_TABLES', 'files/group')
|
||||
groups = merge_files(files, 4)
|
||||
|
||||
type = 'system group' if gaargs.system else 'normal group'
|
||||
if gaargs.GROUP not in groups:
|
||||
handle_missing_id(gaargs.GROUP, 'group', pkg)
|
||||
handle_missing_id(gaargs.GROUP, type, pkg, files, table_var, table_value)
|
||||
newparams.append(param)
|
||||
continue
|
||||
|
||||
@@ -227,7 +227,7 @@ def update_useradd_static_config(d):
|
||||
gaargs.gid = field[2]
|
||||
|
||||
if not gaargs.gid or not gaargs.gid.isdigit():
|
||||
handle_missing_id(gaargs.GROUP, 'group', pkg)
|
||||
handle_missing_id(gaargs.GROUP, type, pkg, files, table_var, table_value)
|
||||
|
||||
# Reconstruct the args...
|
||||
newparam = ['', ' --force'][gaargs.force]
|
||||
|
||||
@@ -118,6 +118,7 @@ useradd_sysroot () {
|
||||
# useradd/groupadd tools are unavailable. If there is no dependency, we assume we don't want to
|
||||
# create users in the sysroot
|
||||
if ! command -v useradd; then
|
||||
bbwarn "command useradd not found!"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ RECIPE_MAINTAINER_pn-apr-util = "Hongxu Jia <hongxu.jia@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-apt = "Aníbal Limón <limon.anibal@gmail.com>"
|
||||
RECIPE_MAINTAINER_pn-apt-native = "Aníbal Limón <limon.anibal@gmail.com>"
|
||||
RECIPE_MAINTAINER_pn-argp-standalone = "Khem Raj <raj.khem@gmail.com>"
|
||||
RECIPE_MAINTAINER_pn-asciidoc = "Dengke Du <dengke.du@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-asciidoc = "Yi Zhao <yi.zhao@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-aspell = "Jose Lamego <jose.a.lamego@linux.intel.com>"
|
||||
RECIPE_MAINTAINER_pn-assimp = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-at = "Chen Qi <Qi.Chen@windriver.com>"
|
||||
@@ -56,8 +56,8 @@ RECIPE_MAINTAINER_pn-autoconf = "Robert Yang <liezhi.yang@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-autoconf-archive = "Robert Yang <liezhi.yang@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-autogen-native = "Robert Yang <liezhi.yang@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-automake = "Robert Yang <liezhi.yang@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-avahi = "Dengke Du <dengke.du@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-avahi-ui = "Dengke Du <dengke.du@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-avahi = "Yi Zhao <yi.zhao@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-avahi-ui = "Yi Zhao <yi.zhao@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-babeltrace = "Alexander Kanavin <alexander.kanavin@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-base-files = "Ross Burton <ross.burton@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-base-passwd = "Ross Burton <ross.burton@intel.com>"
|
||||
@@ -74,7 +74,7 @@ RECIPE_MAINTAINER_pn-binutils-cross-canadian = "Khem Raj <raj.khem@gmail.com>"
|
||||
RECIPE_MAINTAINER_pn-binutils-crosssdk = "Khem Raj <raj.khem@gmail.com>"
|
||||
RECIPE_MAINTAINER_pn-bison = "Chen Qi <Qi.Chen@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-bjam-native = "Alexander Kanavin <alexander.kanavin@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-blktool = "Dengke Du <dengke.du@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-blktool = "Yi Zhao <yi.zhao@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-blktrace = "Alexander Kanavin <alexander.kanavin@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-bluez5 = "Maxin B. John <maxin.john@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-bmap-tools = "Ed Bartosh <ed.bartosh@linux.intel.com>"
|
||||
@@ -95,10 +95,10 @@ RECIPE_MAINTAINER_pn-cairo = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-calibrateproto = "Armin Kuster <akuster@mvista.com>"
|
||||
RECIPE_MAINTAINER_pn-cantarell-fonts = "Alexander Kanavin <alexander.kanavin@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-ccache = "Robert Yang <liezhi.yang@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-cdrtools-native = "Dengke Du <dengke.du@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-chkconfig = "Dengke Du <dengke.du@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-chkconfig-alternatives-native = "Dengke Du <dengke.du@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-chrpath = "Dengke Du <dengke.du@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-cdrtools-native = "Yi Zhao <yi.zhao@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-chkconfig = "Yi Zhao <yi.zhao@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-chkconfig-alternatives-native = "Yi Zhao <yi.zhao@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-chrpath = "Yi Zhao <yi.zhao@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-clutter-1.0 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-clutter-gst-3.0 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-clutter-gtk-1.0 = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
|
||||
@@ -139,17 +139,17 @@ RECIPE_MAINTAINER_pn-diffutils = "Chen Qi <Qi.Chen@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-directfb = "Hongxu Jia <hongxu.jia@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-directfb-examples = "Hongxu Jia <hongxu.jia@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-distcc = "Hongxu Jia <hongxu.jia@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-distcc-config = "Dengke Du <dengke.du@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-distcc-config = "Yi Zhao <yi.zhao@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-dmidecode = "Alexander Kanavin <alexander.kanavin@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-dmxproto = "Armin Kuster <akuster@mvista.com>"
|
||||
RECIPE_MAINTAINER_pn-dnf = "Alexander Kanavin <alexander.kanavin@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-docbook-xml-dtd4 = "Dengke Du <dengke.du@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-docbook-xsl-stylesheets = "Dengke Du <dengke.du@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-dosfstools = "Dengke Du <dengke.du@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-docbook-xml-dtd4 = "Yi Zhao <yi.zhao@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-docbook-xsl-stylesheets = "Yi Zhao <yi.zhao@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-dosfstools = "Yi Zhao <yi.zhao@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-dpkg = "Aníbal Limón <limon.anibal@gmail.com>"
|
||||
RECIPE_MAINTAINER_pn-dri2proto = "Armin Kuster <akuster@mvista.com>"
|
||||
RECIPE_MAINTAINER_pn-dri3proto = "Armin Kuster <akuster@mvista.com>"
|
||||
RECIPE_MAINTAINER_pn-dropbear = "Dengke Du <dengke.du@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-dropbear = "Yi Zhao <yi.zhao@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-dtc = "Alexander Kanavin <alexander.kanavin@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-e2fsprogs = "Robert Yang <liezhi.yang@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-ed = "Alexander Kanavin <alexander.kanavin@intel.com>"
|
||||
@@ -164,7 +164,7 @@ RECIPE_MAINTAINER_pn-encodings = "Armin Kuster <akuster@mvista.com>"
|
||||
RECIPE_MAINTAINER_pn-epiphany = "Alexander Kanavin <alexander.kanavin@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-ethtool = "Changhyeok Bae <changhyeok.bae@lge.com>"
|
||||
RECIPE_MAINTAINER_pn-eudev = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
|
||||
RECIPE_MAINTAINER_pn-expat = "Dengke Du <dengke.du@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-expat = "Yi Zhao <yi.zhao@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-expect = "Alexander Kanavin <alexander.kanavin@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-ffmpeg = "Alexander Kanavin <alexander.kanavin@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-file = "Robert Yang <liezhi.yang@windriver.com>"
|
||||
@@ -224,6 +224,7 @@ RECIPE_MAINTAINER_pn-gnupg = "Hongxu Jia <hongxu.jia@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-gnutls = "Armin Kuster <akuster@mvista.com>"
|
||||
RECIPE_MAINTAINER_pn-go = "Khem Raj <raj.khem@gmail.com>"
|
||||
RECIPE_MAINTAINER_pn-go-cross = "Khem Raj <raj.khem@gmail.com>"
|
||||
RECIPE_MAINTAINER_pn-go-dep = "Otavio Salvador <otavio.salvador@ossystems.com.br>"
|
||||
RECIPE_MAINTAINER_pn-go-helloworld = "Khem Raj <raj.khem@gmail.com>"
|
||||
RECIPE_MAINTAINER_pn-go-native = "Khem Raj <raj.khem@gmail.com>"
|
||||
RECIPE_MAINTAINER_pn-gobject-introspection = "Alexander Kanavin <alexander.kanavin@intel.com>"
|
||||
@@ -287,8 +288,8 @@ RECIPE_MAINTAINER_pn-irda-utils = "Changhyeok Bae <changhyeok.bae@lge.com>"
|
||||
RECIPE_MAINTAINER_pn-iso-codes = "Alexander Kanavin <alexander.kanavin@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-iw = "Changhyeok Bae <changhyeok.bae@lge.com>"
|
||||
RECIPE_MAINTAINER_pn-libjpeg-turbo = "Maxin B. John <maxin.john@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-json-c = "Dengke Du <dengke.du@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-json-glib = "Dengke Du <dengke.du@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-json-c = "Yi Zhao <yi.zhao@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-json-glib = "Yi Zhao <yi.zhao@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-kbd = "Alexander Kanavin <alexander.kanavin@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-kbproto = "Armin Kuster <akuster@mvista.com>"
|
||||
RECIPE_MAINTAINER_pn-kconfig-frontends = "Alexander Kanavin <alexander.kanavin@intel.com>"
|
||||
@@ -358,6 +359,7 @@ RECIPE_MAINTAINER_pn-libinput = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-libjson = "Alexander Kanavin <alexander.kanavin@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-libksba = "Alexander Kanavin <alexander.kanavin@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-libmatchbox = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-libmnl = "Khem Raj <raj.khem@gmail.com>"
|
||||
RECIPE_MAINTAINER_pn-libmpc = "Khem Raj <raj.khem@gmail.com>"
|
||||
RECIPE_MAINTAINER_pn-libnewt = "Hongxu Jia <hongxu.jia@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-libnewt-python = "Hongxu Jia <hongxu.jia@windriver.com>"
|
||||
@@ -463,9 +465,9 @@ RECIPE_MAINTAINER_pn-logrotate = "Robert Yang <liezhi.yang@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-lrzsz = "Maxin B. John <maxin.john@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-lsb = "Hongxu Jia <hongxu.jia@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-lsbinitscripts = "Ross Burton <ross.burton@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-lsbtest = "Dengke Du <dengke.du@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-lsbtest = "Yi Zhao <yi.zhao@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-lsof = "Maxin B. John <maxin.john@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-ltp = "Dengke Du <dengke.du@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-ltp = "Yi Zhao <yi.zhao@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-lttng-modules = "Richard Purdie <richard.purdie@linuxfoundation.org>"
|
||||
RECIPE_MAINTAINER_pn-lttng-tools = "Richard Purdie <richard.purdie@linuxfoundation.org>"
|
||||
RECIPE_MAINTAINER_pn-lttng-ust = "Richard Purdie <richard.purdie@linuxfoundation.org>"
|
||||
@@ -581,7 +583,7 @@ RECIPE_MAINTAINER_pn-pm-utils = "Maxin B. John <maxin.john@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-pointercal = "Alexander Kanavin <alexander.kanavin@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-pointercal-xinput = "Alexander Kanavin <alexander.kanavin@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-pong-clock = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-popt = "Dengke Du <dengke.du@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-popt = "Yi Zhao <yi.zhao@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-portmap = "Robert Yang <liezhi.yang@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-powertop = "Alexander Kanavin <alexander.kanavin@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-ppp = "Hongxu Jia <hongxu.jia@windriver.com>"
|
||||
@@ -591,7 +593,7 @@ RECIPE_MAINTAINER_pn-presentproto = "Armin Kuster <akuster@mvista.com>"
|
||||
RECIPE_MAINTAINER_pn-procps = "Alexander Kanavin <alexander.kanavin@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-pseudo = "Mark Hatle <mark.hatle@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-psmisc = "Alexander Kanavin <alexander.kanavin@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-psplash = "Dengke Du <dengke.du@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-psplash = "Yi Zhao <yi.zhao@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-ptest-runner = "Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>"
|
||||
RECIPE_MAINTAINER_pn-pulseaudio = "Tanu Kaskinen <tanuk@iki.fi>"
|
||||
RECIPE_MAINTAINER_pn-pulseaudio-client-conf-sato = "Tanu Kaskinen <tanuk@iki.fi>"
|
||||
@@ -819,7 +821,7 @@ RECIPE_MAINTAINER_pn-xvideo-tests = "Maxin B. John <maxin.john@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-xvinfo = "Armin Kuster <akuster@mvista.com>"
|
||||
RECIPE_MAINTAINER_pn-xwininfo = "Armin Kuster <akuster@mvista.com>"
|
||||
RECIPE_MAINTAINER_pn-xz = "Denys Dmytriyenko <denys@ti.com>"
|
||||
RECIPE_MAINTAINER_pn-yasm = "Dengke Du <dengke.du@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-yasm = "Yi Zhao <yi.zhao@windriver.com>"
|
||||
RECIPE_MAINTAINER_pn-zip = "Denys Dmytriyenko <denys@ti.com>"
|
||||
RECIPE_MAINTAINER_pn-zisofs-tools-native = "Alexander Kanavin <alexander.kanavin@intel.com>"
|
||||
RECIPE_MAINTAINER_pn-zlib = "Denys Dmytriyenko <denys@ti.com>"
|
||||
|
||||
@@ -14,6 +14,8 @@ PREFERRED_PROVIDER_virtual/libintl ?= "musl"
|
||||
PREFERRED_PROVIDER_virtual/nativesdk-libintl ?= "nativesdk-glibc"
|
||||
PREFERRED_PROVIDER_virtual/nativesdk-libiconv ?= "nativesdk-glibc"
|
||||
|
||||
DISTRO_FEATURES_BACKFILL_CONSIDERED += "ldconfig"
|
||||
|
||||
#USE_NLS ?= "no"
|
||||
|
||||
CXXFLAGS += "-fvisibility-inlines-hidden"
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
TUNEVALID[vfp] = "Enable Vector Floating Point (vfp) unit."
|
||||
TUNE_CCARGS_MFPU .= "${@bb.utils.contains('TUNE_FEATURES', 'vfp', ' vfp', '', d)}"
|
||||
|
||||
TUNE_CCARGS .= "${@ (' -mfpu=%s ' % d.getVar('TUNE_CCARGS_MFPU').split()[-1]) if (d.getVar('TUNE_CCARGS_MFPU') != '') else ''}"
|
||||
ARMPKGSFX_FPU = "${@ ('-%s' % d.getVar('TUNE_CCARGS_MFPU').split()[-1].replace('vfpv3-d16', 'vfpv3d16')) if (d.getVar('TUNE_CCARGS_MFPU') != '') else ''}"
|
||||
TUNE_CCARGS .= "${@ (' -mfpu=%s' % d.getVar('TUNE_CCARGS_MFPU').split()[-1]) if (d.getVar('TUNE_CCARGS_MFPU') != '') else ''}"
|
||||
ARMPKGSFX_FPU = "${@ ('-%s' % d.getVar('TUNE_CCARGS_MFPU').split()[-1].replace('vfpv3-d16', 'vfpv3d16')) if (d.getVar('TUNE_CCARGS_MFPU') != '') else ''}"
|
||||
|
||||
TUNEVALID[callconvention-hard] = "Enable EABI hard float call convention, requires VFP."
|
||||
TUNE_CCARGS_MFLOAT = "${@ bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', 'hard', 'softfp', d) if (d.getVar('TUNE_CCARGS_MFPU') != '') else '' }"
|
||||
|
||||
@@ -25,6 +25,7 @@ EXTRA_IMAGEDEPENDS += "qemu-native qemu-helper-native"
|
||||
|
||||
# Provide the nfs server kernel module for all qemu images
|
||||
KERNEL_FEATURES_append_pn-linux-yocto = " features/nfsd/nfsd-enable.scc"
|
||||
KERNEL_FEATURES_append_pn-linux-yocto-rt = " features/nfsd/nfsd-enable.scc"
|
||||
|
||||
MACHINE_EXTRA_RRECOMMENDS += "rng-tools"
|
||||
|
||||
|
||||
@@ -188,6 +188,11 @@ def patch_recipe_lines(fromlines, values, trailing_newline=True):
|
||||
for wrapline in wrapped[:-1]:
|
||||
addlines.append('%s \\%s' % (wrapline, newline))
|
||||
addlines.append('%s%s' % (wrapped[-1], newline))
|
||||
|
||||
# Split on newlines - this isn't strictly necessary if you are only
|
||||
# going to write the output to disk, but if you want to compare it
|
||||
# (as patch_recipe_file() will do if patch=True) then it's important.
|
||||
addlines = [line for l in addlines for line in l.splitlines(True)]
|
||||
if rewindcomments:
|
||||
# Ensure we insert the lines before any leading comments
|
||||
# (that we'd want to ensure remain leading the next value)
|
||||
@@ -801,7 +806,7 @@ def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False,
|
||||
|
||||
def find_layerdir(fn):
|
||||
""" Figure out the path to the base of the layer containing a file (e.g. a recipe)"""
|
||||
pth = fn
|
||||
pth = os.path.abspath(fn)
|
||||
layerdir = ''
|
||||
while pth:
|
||||
if os.path.exists(os.path.join(pth, 'conf', 'layer.conf')):
|
||||
|
||||
@@ -320,7 +320,7 @@ def find_siginfo(pn, taskname, taskhashlist, d):
|
||||
|
||||
if not taskhashlist or (len(filedates) < 2 and not foundall):
|
||||
# That didn't work, look in sstate-cache
|
||||
hashes = taskhashlist or ['*']
|
||||
hashes = taskhashlist or ['?' * 32]
|
||||
localdata = bb.data.createCopy(d)
|
||||
for hashval in hashes:
|
||||
localdata.setVar('PACKAGE_ARCH', '*')
|
||||
|
||||
@@ -224,7 +224,7 @@ def spawn(name, sh_cmd, title=None, env=None, d=None):
|
||||
import time
|
||||
pidfile = tempfile.NamedTemporaryFile(delete = False).name
|
||||
try:
|
||||
sh_cmd = "oe-gnome-terminal-phonehome " + pidfile + " " + sh_cmd
|
||||
sh_cmd = bb.utils.which(os.getenv('PATH'), "oe-gnome-terminal-phonehome") + " " + pidfile + " " + sh_cmd
|
||||
pipe = terminal(sh_cmd, title, env, d)
|
||||
output = pipe.communicate()[0]
|
||||
if output:
|
||||
|
||||
@@ -108,7 +108,7 @@ class MasterImageHardwareTarget(oeqa.targetcontrol.BaseTarget, metaclass=ABCMeta
|
||||
time.sleep(10)
|
||||
self.power_ctl("cycle")
|
||||
else:
|
||||
status, output = conn.run("reboot")
|
||||
status, output = conn.run("sync; { sleep 1; reboot; } > /dev/null &")
|
||||
if status != 0:
|
||||
bb.error("Failed rebooting target and no power control command defined. You need to manually reset the device.\n%s" % output)
|
||||
|
||||
@@ -143,7 +143,7 @@ class MasterImageHardwareTarget(oeqa.targetcontrol.BaseTarget, metaclass=ABCMeta
|
||||
def _deploy(self):
|
||||
pass
|
||||
|
||||
def start(self, params=None):
|
||||
def start(self, extra_bootparams=None):
|
||||
bb.plain("%s - boot test image on target" % self.pn)
|
||||
self._start()
|
||||
# set the ssh object for the target/test image
|
||||
@@ -156,7 +156,7 @@ class MasterImageHardwareTarget(oeqa.targetcontrol.BaseTarget, metaclass=ABCMeta
|
||||
|
||||
def stop(self):
|
||||
bb.plain("%s - reboot/powercycle target" % self.pn)
|
||||
self.power_cycle(self.connection)
|
||||
self.power_cycle(self.master)
|
||||
|
||||
|
||||
class SystemdbootTarget(MasterImageHardwareTarget):
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# Released under the MIT license (see COPYING.MIT)
|
||||
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import unittest
|
||||
import inspect
|
||||
@@ -39,42 +40,19 @@ def _built_modules_dict(modules):
|
||||
if modules == None:
|
||||
return modules_dict
|
||||
|
||||
for m in modules:
|
||||
ms = m.split('.')
|
||||
for module in modules:
|
||||
# Assumption: package and module names do not contain upper case
|
||||
# characters, whereas class names do
|
||||
m = re.match(r'^([^A-Z]+)(?:\.([A-Z][^.]*)(?:\.([^.]+))?)?$', module)
|
||||
|
||||
if len(ms) == 1:
|
||||
module_name = ms[0]
|
||||
if not module_name in modules_dict:
|
||||
modules_dict[module_name] = {}
|
||||
elif len(ms) == 2:
|
||||
module_name = ms[0]
|
||||
class_name = ms[1]
|
||||
if not module_name in modules_dict:
|
||||
modules_dict[module_name] = {}
|
||||
if not class_name in modules_dict[module_name]:
|
||||
modules_dict[module_name][class_name] = []
|
||||
elif len(ms) == 3:
|
||||
module_name = ms[0]
|
||||
class_name = ms[1]
|
||||
test_name = ms[2]
|
||||
module_name, class_name, test_name = m.groups()
|
||||
|
||||
if not module_name in modules_dict:
|
||||
modules_dict[module_name] = {}
|
||||
if not class_name in modules_dict[module_name]:
|
||||
modules_dict[module_name][class_name] = []
|
||||
if not test_name in modules_dict[module_name][class_name]:
|
||||
modules_dict[module_name][class_name].append(test_name)
|
||||
elif len(ms) >= 4:
|
||||
module_name = '.'.join(ms[0:-2])
|
||||
class_name = ms[-2]
|
||||
test_name = ms[-1]
|
||||
|
||||
if not module_name in modules_dict:
|
||||
modules_dict[module_name] = {}
|
||||
if not class_name in modules_dict[module_name]:
|
||||
modules_dict[module_name][class_name] = []
|
||||
if not test_name in modules_dict[module_name][class_name]:
|
||||
modules_dict[module_name][class_name].append(test_name)
|
||||
if module_name and module_name not in modules_dict:
|
||||
modules_dict[module_name] = {}
|
||||
if class_name and class_name not in modules_dict[module_name]:
|
||||
modules_dict[module_name][class_name] = []
|
||||
if test_name and test_name not in modules_dict[module_name][class_name]:
|
||||
modules_dict[module_name][class_name].append(test_name)
|
||||
|
||||
return modules_dict
|
||||
|
||||
|
||||
@@ -45,6 +45,14 @@ class OETestResult(_TestResult):
|
||||
self.tc = tc
|
||||
self._tc_map_results()
|
||||
|
||||
def startTest(self, test):
|
||||
# Allow us to trigger the testcase buffer mode on a per test basis
|
||||
# so stdout/stderr are only printed upon failure. Enables debugging
|
||||
# but clean output
|
||||
if hasattr(test, "buffer"):
|
||||
self.buffer = test.buffer
|
||||
super(OETestResult, self).startTest(test)
|
||||
|
||||
def _tc_map_results(self):
|
||||
self.tc._results['failures'] = self.failures
|
||||
self.tc._results['errors'] = self.errors
|
||||
|
||||
@@ -31,7 +31,7 @@ class OEQemuTarget(OESSHTarget):
|
||||
deploy_dir_image=dir_image, display=display,
|
||||
logfile=bootlog, boottime=boottime,
|
||||
use_kvm=kvm, dump_dir=dump_dir,
|
||||
dump_host_cmds=dump_host_cmds)
|
||||
dump_host_cmds=dump_host_cmds, logger=logger)
|
||||
|
||||
def start(self, params=None, extra_bootparams=None):
|
||||
if self.runner.start(params, extra_bootparams=extra_bootparams):
|
||||
|
||||
@@ -83,7 +83,7 @@ class OESSHTarget(OETarget):
|
||||
processTimeout = self.timeout
|
||||
|
||||
status, output = self._run(sshCmd, processTimeout, True)
|
||||
self.logger.info('\nCommand: %s\nOutput: %s\n' % (command, output))
|
||||
self.logger.debug('Command: %s\nOutput: %s\n' % (command, output))
|
||||
return (status, output)
|
||||
|
||||
def copyTo(self, localSrc, remoteDst):
|
||||
|
||||
@@ -13,6 +13,8 @@ from oeqa.core.decorator.oeid import OETestID
|
||||
|
||||
class DevtoolBase(OESelftestTestCase):
|
||||
|
||||
buffer = True
|
||||
|
||||
def _test_recipe_contents(self, recipefile, checkvars, checkinherits):
|
||||
with open(recipefile, 'r') as f:
|
||||
invar = None
|
||||
|
||||
@@ -10,6 +10,8 @@ class ImageFeatures(OESelftestTestCase):
|
||||
test_user = 'tester'
|
||||
root_user = 'root'
|
||||
|
||||
buffer = True
|
||||
|
||||
@OETestID(1107)
|
||||
def test_non_root_user_can_connect_via_ssh_without_password(self):
|
||||
"""
|
||||
@@ -226,3 +228,13 @@ class ImageFeatures(OESelftestTestCase):
|
||||
# check if result image is in deploy directory
|
||||
self.assertTrue(os.path.exists(image_path),
|
||||
"%s image %s doesn't exist" % (itype, image_path))
|
||||
|
||||
def test_useradd_static(self):
|
||||
config = """
|
||||
USERADDEXTENSION = "useradd-staticids"
|
||||
USERADD_ERROR_DYNAMIC = "skip"
|
||||
USERADD_UID_TABLES += "files/static-passwd"
|
||||
USERADD_GID_TABLES += "files/static-group"
|
||||
"""
|
||||
self.write_config(config)
|
||||
bitbake("core-image-base")
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
#
|
||||
|
||||
import re
|
||||
import logging
|
||||
|
||||
from oeqa.selftest.case import OESelftestTestCase
|
||||
from oeqa.utils.commands import bitbake, runqemu, get_bb_var
|
||||
@@ -14,6 +13,8 @@ class RunqemuTests(OESelftestTestCase):
|
||||
|
||||
image_is_ready = False
|
||||
deploy_dir_image = ''
|
||||
# We only want to print runqemu stdout/stderr if there is a test case failure
|
||||
buffer = True
|
||||
|
||||
def setUpLocal(self):
|
||||
super(RunqemuTests, self).setUpLocal()
|
||||
@@ -22,10 +23,6 @@ class RunqemuTests(OESelftestTestCase):
|
||||
self.fstypes = "ext4 iso hddimg wic.vmdk wic.qcow2 wic.vdi"
|
||||
self.cmd_common = "runqemu nographic"
|
||||
|
||||
# Avoid emit the same record multiple times.
|
||||
mainlogger = logging.getLogger("BitBake.Main")
|
||||
mainlogger.propagate = False
|
||||
|
||||
self.write_config(
|
||||
"""
|
||||
MACHINE = "%s"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from oeqa.selftest.case import OESelftestTestCase
|
||||
from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu
|
||||
from oeqa.utils.sshcontrol import SSHControl
|
||||
from oeqa.core.decorator.oeid import OETestID
|
||||
import os
|
||||
import re
|
||||
@@ -243,7 +244,7 @@ postinst-delayed-t \
|
||||
with self.subTest(init_manager=init_manager, package_class=classes):
|
||||
features = 'MACHINE = "qemux86"\n'
|
||||
features += 'CORE_IMAGE_EXTRA_INSTALL += "%s %s "\n'% (rootfs_pkg, boot_pkg)
|
||||
features += 'IMAGE_FEATURES += "ssh-server-openssh"\n'
|
||||
features += 'IMAGE_FEATURES += "package-management empty-root-password"\n'
|
||||
features += 'PACKAGE_CLASSES = "%s"\n' % classes
|
||||
if init_manager == "systemd":
|
||||
features += 'DISTRO_FEATURES_append = " systemd"\n'
|
||||
@@ -262,6 +263,5 @@ postinst-delayed-t \
|
||||
|
||||
testcommand = 'ls /etc/' + fileboot_name
|
||||
with runqemu('core-image-minimal') as qemu:
|
||||
sshargs = '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
|
||||
result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand))
|
||||
self.assertEqual(result.status, 0, 'File %s was not created at firts boot'% fileboot_name)
|
||||
status, output = qemu.run_serial("-f /etc/" + fileboot_name)
|
||||
self.assertEqual(status, 0, 'File %s was not created at first boot (%s)' % (fileboot_name, output))
|
||||
|
||||
@@ -18,44 +18,18 @@ from oeqa.utils.dump import TargetDumper
|
||||
from oeqa.controllers.testtargetloader import TestTargetLoader
|
||||
from abc import ABCMeta, abstractmethod
|
||||
|
||||
logger = logging.getLogger('BitBake.QemuRunner')
|
||||
|
||||
def get_target_controller(d):
|
||||
testtarget = d.getVar("TEST_TARGET")
|
||||
# old, simple names
|
||||
if testtarget == "qemu":
|
||||
return QemuTarget(d)
|
||||
elif testtarget == "simpleremote":
|
||||
return SimpleRemoteTarget(d)
|
||||
else:
|
||||
# use the class name
|
||||
try:
|
||||
# is it a core class defined here?
|
||||
controller = getattr(sys.modules[__name__], testtarget)
|
||||
except AttributeError:
|
||||
# nope, perhaps a layer defined one
|
||||
try:
|
||||
bbpath = d.getVar("BBPATH").split(':')
|
||||
testtargetloader = TestTargetLoader()
|
||||
controller = testtargetloader.get_controller_module(testtarget, bbpath)
|
||||
except ImportError as e:
|
||||
bb.fatal("Failed to import {0} from available controller modules:\n{1}".format(testtarget,traceback.format_exc()))
|
||||
except AttributeError as e:
|
||||
bb.fatal("Invalid TEST_TARGET - " + str(e))
|
||||
return controller(d)
|
||||
|
||||
|
||||
class BaseTarget(object, metaclass=ABCMeta):
|
||||
|
||||
supported_image_fstypes = []
|
||||
|
||||
def __init__(self, d):
|
||||
def __init__(self, d, logger):
|
||||
self.connection = None
|
||||
self.ip = None
|
||||
self.server_ip = None
|
||||
self.datetime = d.getVar('DATETIME')
|
||||
self.testdir = d.getVar("TEST_LOG_DIR")
|
||||
self.pn = d.getVar("PN")
|
||||
self.logger = logger
|
||||
|
||||
@abstractmethod
|
||||
def deploy(self):
|
||||
@@ -65,7 +39,7 @@ class BaseTarget(object, metaclass=ABCMeta):
|
||||
if os.path.islink(sshloglink):
|
||||
os.unlink(sshloglink)
|
||||
os.symlink(self.sshlog, sshloglink)
|
||||
logger.info("SSH log file: %s" % self.sshlog)
|
||||
self.logger.info("SSH log file: %s" % self.sshlog)
|
||||
|
||||
@abstractmethod
|
||||
def start(self, params=None, ssh=True, extra_bootparams=None):
|
||||
@@ -115,9 +89,9 @@ class QemuTarget(BaseTarget):
|
||||
|
||||
supported_image_fstypes = ['ext3', 'ext4', 'cpio.gz', 'wic']
|
||||
|
||||
def __init__(self, d, image_fstype=None):
|
||||
def __init__(self, d, logger, image_fstype=None):
|
||||
|
||||
super(QemuTarget, self).__init__(d)
|
||||
super(QemuTarget, self).__init__(d, logger)
|
||||
|
||||
self.rootfs = ''
|
||||
self.kernel = ''
|
||||
@@ -145,7 +119,7 @@ class QemuTarget(BaseTarget):
|
||||
self.qemurunnerlog = os.path.join(self.testdir, 'qemurunner_log.%s' % self.datetime)
|
||||
loggerhandler = logging.FileHandler(self.qemurunnerlog)
|
||||
loggerhandler.setFormatter(logging.Formatter("%(levelname)s: %(message)s"))
|
||||
logger.addHandler(loggerhandler)
|
||||
self.logger.addHandler(loggerhandler)
|
||||
oe.path.symlink(os.path.basename(self.qemurunnerlog), os.path.join(self.testdir, 'qemurunner_log'), force=True)
|
||||
|
||||
if d.getVar("DISTRO") == "poky-tiny":
|
||||
@@ -156,7 +130,8 @@ class QemuTarget(BaseTarget):
|
||||
display = d.getVar("BB_ORIGENV", False).getVar("DISPLAY"),
|
||||
logfile = self.qemulog,
|
||||
kernel = self.kernel,
|
||||
boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT")))
|
||||
boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT")),
|
||||
logger = logger)
|
||||
else:
|
||||
self.runner = QemuRunner(machine=d.getVar("MACHINE"),
|
||||
rootfs=self.rootfs,
|
||||
@@ -167,7 +142,8 @@ class QemuTarget(BaseTarget):
|
||||
boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT")),
|
||||
use_kvm = use_kvm,
|
||||
dump_dir = dump_dir,
|
||||
dump_host_cmds = d.getVar("testimage_dump_host"))
|
||||
dump_host_cmds = d.getVar("testimage_dump_host"),
|
||||
logger = logger)
|
||||
|
||||
self.target_dumper = TargetDumper(dump_target_cmds, dump_dir, self.runner)
|
||||
|
||||
@@ -179,8 +155,8 @@ class QemuTarget(BaseTarget):
|
||||
os.unlink(qemuloglink)
|
||||
os.symlink(self.qemulog, qemuloglink)
|
||||
|
||||
logger.info("rootfs file: %s" % self.rootfs)
|
||||
logger.info("Qemu log file: %s" % self.qemulog)
|
||||
self.logger.info("rootfs file: %s" % self.rootfs)
|
||||
self.logger.info("Qemu log file: %s" % self.qemulog)
|
||||
super(QemuTarget, self).deploy()
|
||||
|
||||
def start(self, params=None, ssh=True, extra_bootparams='', runqemuparams='', launch_cmd='', discard_writes=True):
|
||||
@@ -232,14 +208,14 @@ class SimpleRemoteTarget(BaseTarget):
|
||||
self.port = addr.split(":")[1]
|
||||
except IndexError:
|
||||
self.port = None
|
||||
logger.info("Target IP: %s" % self.ip)
|
||||
self.logger.info("Target IP: %s" % self.ip)
|
||||
self.server_ip = d.getVar("TEST_SERVER_IP")
|
||||
if not self.server_ip:
|
||||
try:
|
||||
self.server_ip = subprocess.check_output(['ip', 'route', 'get', self.ip ]).split("\n")[0].split()[-1]
|
||||
except Exception as e:
|
||||
bb.fatal("Failed to determine the host IP address (alternatively you can set TEST_SERVER_IP with the IP address of this machine): %s" % e)
|
||||
logger.info("Server IP: %s" % self.server_ip)
|
||||
self.logger.info("Server IP: %s" % self.server_ip)
|
||||
|
||||
def deploy(self):
|
||||
super(SimpleRemoteTarget, self).deploy()
|
||||
|
||||
@@ -296,6 +296,12 @@ def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None,
|
||||
import bb.tinfoil
|
||||
import bb.build
|
||||
|
||||
# Need a non-'BitBake' logger to capture the runner output
|
||||
targetlogger = logging.getLogger('TargetRunner')
|
||||
targetlogger.setLevel(logging.DEBUG)
|
||||
handler = logging.StreamHandler(sys.stdout)
|
||||
targetlogger.addHandler(handler)
|
||||
|
||||
tinfoil = bb.tinfoil.Tinfoil()
|
||||
tinfoil.prepare(config_only=False, quiet=True)
|
||||
try:
|
||||
@@ -313,31 +319,15 @@ def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None,
|
||||
for key, value in overrides.items():
|
||||
recipedata.setVar(key, value)
|
||||
|
||||
# The QemuRunner log is saved out, but we need to ensure it is at the right
|
||||
# log level (and then ensure that since it's a child of the BitBake logger,
|
||||
# we disable propagation so we don't then see the log events on the console)
|
||||
logger = logging.getLogger('BitBake.QemuRunner')
|
||||
logger.setLevel(logging.DEBUG)
|
||||
logger.propagate = False
|
||||
logdir = recipedata.getVar("TEST_LOG_DIR")
|
||||
|
||||
qemu = oeqa.targetcontrol.QemuTarget(recipedata, image_fstype)
|
||||
qemu = oeqa.targetcontrol.QemuTarget(recipedata, targetlogger, image_fstype)
|
||||
finally:
|
||||
# We need to shut down tinfoil early here in case we actually want
|
||||
# to run tinfoil-using utilities with the running QEMU instance.
|
||||
# Luckily QemuTarget doesn't need it after the constructor.
|
||||
tinfoil.shutdown()
|
||||
|
||||
# Setup bitbake logger as console handler is removed by tinfoil.shutdown
|
||||
bblogger = logging.getLogger('BitBake')
|
||||
bblogger.setLevel(logging.INFO)
|
||||
console = logging.StreamHandler(sys.stdout)
|
||||
bbformat = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
|
||||
if sys.stdout.isatty():
|
||||
bbformat.enable_color()
|
||||
console.setFormatter(bbformat)
|
||||
bblogger.addHandler(console)
|
||||
|
||||
try:
|
||||
qemu.deploy()
|
||||
try:
|
||||
@@ -352,6 +342,7 @@ def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None,
|
||||
qemu.stop()
|
||||
except:
|
||||
pass
|
||||
targetlogger.removeHandler(handler)
|
||||
|
||||
def updateEnv(env_file):
|
||||
"""
|
||||
|
||||
@@ -28,7 +28,7 @@ re_control_char = re.compile('[%s]' % re.escape("".join(control_chars)))
|
||||
|
||||
class QemuRunner:
|
||||
|
||||
def __init__(self, machine, rootfs, display, tmpdir, deploy_dir_image, logfile, boottime, dump_dir, dump_host_cmds, use_kvm):
|
||||
def __init__(self, machine, rootfs, display, tmpdir, deploy_dir_image, logfile, boottime, dump_dir, dump_host_cmds, use_kvm, logger):
|
||||
|
||||
# Popen object for runqemu
|
||||
self.runqemu = None
|
||||
@@ -57,8 +57,7 @@ class QemuRunner:
|
||||
self.qemu_pidfile = 'pidfile_'+str(os.getpid())
|
||||
self.host_dumper = HostDumper(dump_host_cmds, dump_dir)
|
||||
|
||||
self.logger = logging.getLogger("BitBake.QemuRunner")
|
||||
self.logger.addHandler(logging.StreamHandler(sys.stdout))
|
||||
self.logger = logger
|
||||
|
||||
def create_socket(self):
|
||||
try:
|
||||
@@ -67,7 +66,7 @@ class QemuRunner:
|
||||
sock.bind(("127.0.0.1",0))
|
||||
sock.listen(2)
|
||||
port = sock.getsockname()[1]
|
||||
self.logger.info("Created listening socket for qemu serial console on: 127.0.0.1:%s" % port)
|
||||
self.logger.debug("Created listening socket for qemu serial console on: 127.0.0.1:%s" % port)
|
||||
return (sock, port)
|
||||
|
||||
except socket.error:
|
||||
@@ -94,8 +93,8 @@ class QemuRunner:
|
||||
def handleSIGCHLD(self, signum, frame):
|
||||
if self.runqemu and self.runqemu.poll():
|
||||
if self.runqemu.returncode:
|
||||
self.logger.info('runqemu exited with code %d' % self.runqemu.returncode)
|
||||
self.logger.info("Output from runqemu:\n%s" % self.getOutput(self.runqemu.stdout))
|
||||
self.logger.debug('runqemu exited with code %d' % self.runqemu.returncode)
|
||||
self.logger.debug("Output from runqemu:\n%s" % self.getOutput(self.runqemu.stdout))
|
||||
self.stop()
|
||||
self._dump_host()
|
||||
raise SystemExit
|
||||
@@ -124,10 +123,10 @@ class QemuRunner:
|
||||
if not launch_cmd:
|
||||
launch_cmd = 'runqemu %s %s ' % ('snapshot' if discard_writes else '', runqemuparams)
|
||||
if self.use_kvm:
|
||||
self.logger.info('Using kvm for runqemu')
|
||||
self.logger.debug('Using kvm for runqemu')
|
||||
launch_cmd += ' kvm'
|
||||
else:
|
||||
self.logger.info('Not using kvm for runqemu')
|
||||
self.logger.debug('Not using kvm for runqemu')
|
||||
if not self.display:
|
||||
launch_cmd += ' nographic'
|
||||
launch_cmd += ' %s %s' % (self.machine, self.rootfs)
|
||||
@@ -159,7 +158,7 @@ class QemuRunner:
|
||||
self.origchldhandler = signal.getsignal(signal.SIGCHLD)
|
||||
signal.signal(signal.SIGCHLD, self.handleSIGCHLD)
|
||||
|
||||
self.logger.info('launchcmd=%s'%(launch_cmd))
|
||||
self.logger.debug('launchcmd=%s'%(launch_cmd))
|
||||
|
||||
# FIXME: We pass in stdin=subprocess.PIPE here to work around stty
|
||||
# blocking at the end of the runqemu script when using this within
|
||||
@@ -194,17 +193,17 @@ class QemuRunner:
|
||||
os.killpg(os.getpgid(self.runqemu.pid), signal.SIGTERM)
|
||||
sys.exit(0)
|
||||
|
||||
self.logger.info("runqemu started, pid is %s" % self.runqemu.pid)
|
||||
self.logger.info("waiting at most %s seconds for qemu pid" % self.runqemutime)
|
||||
self.logger.debug("runqemu started, pid is %s" % self.runqemu.pid)
|
||||
self.logger.debug("waiting at most %s seconds for qemu pid" % self.runqemutime)
|
||||
endtime = time.time() + self.runqemutime
|
||||
while not self.is_alive() and time.time() < endtime:
|
||||
if self.runqemu.poll():
|
||||
if self.runqemu.returncode:
|
||||
# No point waiting any longer
|
||||
self.logger.info('runqemu exited with code %d' % self.runqemu.returncode)
|
||||
self.logger.debug('runqemu exited with code %d' % self.runqemu.returncode)
|
||||
self._dump_host()
|
||||
self.stop()
|
||||
self.logger.info("Output from runqemu:\n%s" % self.getOutput(output))
|
||||
self.logger.debug("Output from runqemu:\n%s" % self.getOutput(output))
|
||||
return False
|
||||
time.sleep(0.5)
|
||||
|
||||
@@ -213,7 +212,7 @@ class QemuRunner:
|
||||
# Dump all processes to help us to figure out what is going on...
|
||||
ps = subprocess.Popen(['ps', 'axww', '-o', 'pid,ppid,command '], stdout=subprocess.PIPE).communicate()[0]
|
||||
processes = ps.decode("utf-8")
|
||||
self.logger.info("Running processes:\n%s" % processes)
|
||||
self.logger.debug("Running processes:\n%s" % processes)
|
||||
self._dump_host()
|
||||
self.stop()
|
||||
op = self.getOutput(output)
|
||||
@@ -226,7 +225,7 @@ class QemuRunner:
|
||||
# We are alive: qemu is running
|
||||
out = self.getOutput(output)
|
||||
netconf = False # network configuration is not required by default
|
||||
self.logger.info("qemu started in %s seconds - qemu procces pid is %s" % (time.time() - (endtime - self.runqemutime), self.qemupid))
|
||||
self.logger.debug("qemu started in %s seconds - qemu procces pid is %s" % (time.time() - (endtime - self.runqemutime), self.qemupid))
|
||||
if get_ip:
|
||||
cmdline = ''
|
||||
with open('/proc/%s/cmdline' % self.qemupid) as p:
|
||||
@@ -238,7 +237,7 @@ class QemuRunner:
|
||||
ips = re.findall("((?:[0-9]{1,3}\.){3}[0-9]{1,3})", cmdline.split("ip=")[1])
|
||||
self.ip = ips[0]
|
||||
self.server_ip = ips[1]
|
||||
self.logger.info("qemu cmdline used:\n{}".format(cmdline))
|
||||
self.logger.debug("qemu cmdline used:\n{}".format(cmdline))
|
||||
except (IndexError, ValueError):
|
||||
# Try to get network configuration from runqemu output
|
||||
match = re.match('.*Network configuration: ([0-9.]+)::([0-9.]+):([0-9.]+)$.*',
|
||||
@@ -257,8 +256,8 @@ class QemuRunner:
|
||||
self.stop()
|
||||
return False
|
||||
|
||||
self.logger.info("Target IP: %s" % self.ip)
|
||||
self.logger.info("Server IP: %s" % self.server_ip)
|
||||
self.logger.debug("Target IP: %s" % self.ip)
|
||||
self.logger.debug("Server IP: %s" % self.server_ip)
|
||||
|
||||
self.thread = LoggingThread(self.log, threadsock, self.logger)
|
||||
self.thread.start()
|
||||
@@ -269,14 +268,14 @@ class QemuRunner:
|
||||
self.stop_thread()
|
||||
return False
|
||||
|
||||
self.logger.info("Output from runqemu:\n%s", out)
|
||||
self.logger.info("Waiting at most %d seconds for login banner" % self.boottime)
|
||||
self.logger.debug("Output from runqemu:\n%s", out)
|
||||
self.logger.debug("Waiting at most %d seconds for login banner" % self.boottime)
|
||||
endtime = time.time() + self.boottime
|
||||
socklist = [self.server_socket]
|
||||
reachedlogin = False
|
||||
stopread = False
|
||||
qemusock = None
|
||||
bootlog = ''
|
||||
bootlog = b''
|
||||
data = b''
|
||||
while time.time() < endtime and not stopread:
|
||||
try:
|
||||
@@ -289,21 +288,17 @@ class QemuRunner:
|
||||
qemusock.setblocking(0)
|
||||
socklist.append(qemusock)
|
||||
socklist.remove(self.server_socket)
|
||||
self.logger.info("Connection from %s:%s" % addr)
|
||||
self.logger.debug("Connection from %s:%s" % addr)
|
||||
else:
|
||||
data = data + sock.recv(1024)
|
||||
if data:
|
||||
try:
|
||||
data = data.decode("utf-8", errors="surrogateescape")
|
||||
bootlog += data
|
||||
data = b''
|
||||
if re.search(".* login:", bootlog):
|
||||
self.server_socket = qemusock
|
||||
stopread = True
|
||||
reachedlogin = True
|
||||
self.logger.info("Reached login banner")
|
||||
except UnicodeDecodeError:
|
||||
continue
|
||||
bootlog += data
|
||||
data = b''
|
||||
if b' login:' in bootlog:
|
||||
self.server_socket = qemusock
|
||||
stopread = True
|
||||
reachedlogin = True
|
||||
self.logger.debug("Reached login banner")
|
||||
else:
|
||||
socklist.remove(sock)
|
||||
sock.close()
|
||||
@@ -311,12 +306,12 @@ class QemuRunner:
|
||||
|
||||
|
||||
if not reachedlogin:
|
||||
self.logger.info("Target didn't reached login boot in %d seconds" % self.boottime)
|
||||
self.logger.debug("Target didn't reached login boot in %d seconds" % self.boottime)
|
||||
tail = lambda l: "\n".join(l.splitlines()[-25:])
|
||||
# in case bootlog is empty, use tail qemu log store at self.msg
|
||||
lines = tail(bootlog if bootlog else self.msg)
|
||||
self.logger.info("Last 25 lines of text:\n%s" % lines)
|
||||
self.logger.info("Check full boot log: %s" % self.logfile)
|
||||
self.logger.debug("Last 25 lines of text:\n%s" % lines)
|
||||
self.logger.debug("Check full boot log: %s" % self.logfile)
|
||||
self._dump_host()
|
||||
self.stop()
|
||||
return False
|
||||
@@ -326,20 +321,20 @@ class QemuRunner:
|
||||
(status, output) = self.run_serial("root\n", raw=True)
|
||||
if re.search("root@[a-zA-Z0-9\-]+:~#", output):
|
||||
self.logged = True
|
||||
self.logger.info("Logged as root in serial console")
|
||||
self.logger.debug("Logged as root in serial console")
|
||||
if netconf:
|
||||
# configure guest networking
|
||||
cmd = "ifconfig eth0 %s netmask %s up\n" % (self.ip, self.netmask)
|
||||
output = self.run_serial(cmd, raw=True)[1]
|
||||
if re.search("root@[a-zA-Z0-9\-]+:~#", output):
|
||||
self.logger.info("configured ip address %s", self.ip)
|
||||
self.logger.debug("configured ip address %s", self.ip)
|
||||
else:
|
||||
self.logger.info("Couldn't configure guest networking")
|
||||
else:
|
||||
self.logger.info("Couldn't login into serial console"
|
||||
" as root using blank password")
|
||||
self.logger.debug("Couldn't configure guest networking")
|
||||
else:
|
||||
self.logger.debug("Couldn't login into serial console"
|
||||
" as root using blank password")
|
||||
except:
|
||||
self.logger.info("Serial console failed while trying to login")
|
||||
self.logger.debug("Serial console failed while trying to login")
|
||||
return True
|
||||
|
||||
def stop(self):
|
||||
@@ -350,7 +345,7 @@ class QemuRunner:
|
||||
if self.runqemu:
|
||||
if hasattr(self, "monitorpid"):
|
||||
os.kill(self.monitorpid, signal.SIGKILL)
|
||||
self.logger.info("Sending SIGTERM to runqemu")
|
||||
self.logger.debug("Sending SIGTERM to runqemu")
|
||||
try:
|
||||
os.killpg(os.getpgid(self.runqemu.pid), signal.SIGTERM)
|
||||
except OSError as e:
|
||||
@@ -360,7 +355,7 @@ class QemuRunner:
|
||||
while self.runqemu.poll() is None and time.time() < endtime:
|
||||
time.sleep(1)
|
||||
if self.runqemu.poll() is None:
|
||||
self.logger.info("Sending SIGKILL to runqemu")
|
||||
self.logger.debug("Sending SIGKILL to runqemu")
|
||||
os.killpg(os.getpgid(self.runqemu.pid), signal.SIGKILL)
|
||||
self.runqemu = None
|
||||
if hasattr(self, 'server_socket') and self.server_socket:
|
||||
@@ -385,7 +380,7 @@ class QemuRunner:
|
||||
self.thread.join()
|
||||
|
||||
def restart(self, qemuparams = None):
|
||||
self.logger.info("Restarting qemu process")
|
||||
self.logger.debug("Restarting qemu process")
|
||||
if self.runqemu.poll() is None:
|
||||
self.stop()
|
||||
if self.start(qemuparams):
|
||||
@@ -483,17 +478,17 @@ class LoggingThread(threading.Thread):
|
||||
self.teardown()
|
||||
|
||||
def run(self):
|
||||
self.logger.info("Starting logging thread")
|
||||
self.logger.debug("Starting logging thread")
|
||||
self.readpipe, self.writepipe = os.pipe()
|
||||
threading.Thread.run(self)
|
||||
|
||||
def stop(self):
|
||||
self.logger.info("Stopping logging thread")
|
||||
self.logger.debug("Stopping logging thread")
|
||||
if self.running:
|
||||
os.write(self.writepipe, bytes("stop", "utf-8"))
|
||||
|
||||
def teardown(self):
|
||||
self.logger.info("Tearing down logging thread")
|
||||
self.logger.debug("Tearing down logging thread")
|
||||
self.close_socket(self.serversock)
|
||||
|
||||
if self.readsock is not None:
|
||||
@@ -511,7 +506,7 @@ class LoggingThread(threading.Thread):
|
||||
|
||||
breakout = False
|
||||
self.running = True
|
||||
self.logger.info("Starting thread event loop")
|
||||
self.logger.debug("Starting thread event loop")
|
||||
while not breakout:
|
||||
events = poll.poll()
|
||||
for event in events:
|
||||
@@ -521,19 +516,19 @@ class LoggingThread(threading.Thread):
|
||||
|
||||
# Event to stop the thread
|
||||
if self.readpipe == event[0]:
|
||||
self.logger.info("Stop event received")
|
||||
self.logger.debug("Stop event received")
|
||||
breakout = True
|
||||
break
|
||||
|
||||
# A connection request was received
|
||||
elif self.serversock.fileno() == event[0]:
|
||||
self.logger.info("Connection request received")
|
||||
self.logger.debug("Connection request received")
|
||||
self.readsock, _ = self.serversock.accept()
|
||||
self.readsock.setblocking(0)
|
||||
poll.unregister(self.serversock.fileno())
|
||||
poll.register(self.readsock.fileno(), event_read_mask)
|
||||
|
||||
self.logger.info("Setting connection established event")
|
||||
self.logger.debug("Setting connection established event")
|
||||
self.connection_established.set()
|
||||
|
||||
# Actual data to be logged
|
||||
|
||||
@@ -17,7 +17,7 @@ from .qemurunner import QemuRunner
|
||||
|
||||
class QemuTinyRunner(QemuRunner):
|
||||
|
||||
def __init__(self, machine, rootfs, display, tmpdir, deploy_dir_image, logfile, kernel, boottime):
|
||||
def __init__(self, machine, rootfs, display, tmpdir, deploy_dir_image, logfile, kernel, boottime, logger):
|
||||
|
||||
# Popen object for runqemu
|
||||
self.runqemu = None
|
||||
@@ -40,6 +40,7 @@ class QemuTinyRunner(QemuRunner):
|
||||
self.socketfile = "console.sock"
|
||||
self.server_socket = None
|
||||
self.kernel = kernel
|
||||
self.logger = logger
|
||||
|
||||
|
||||
def create_socket(self):
|
||||
|
||||
@@ -150,12 +150,9 @@ class SSHControl(object):
|
||||
|
||||
def copy_to(self, localpath, remotepath):
|
||||
if os.path.islink(localpath):
|
||||
link = os.readlink(localpath)
|
||||
dst_dir, dst_base = os.path.split(remotepath)
|
||||
return self.run("cd %s; ln -s %s %s" % (dst_dir, link, dst_base))
|
||||
else:
|
||||
command = self.scp + [localpath, '%s@%s:%s' % (self.user, self.ip, remotepath)]
|
||||
return self._internal_run(command, ignore_status=False)
|
||||
localpath = os.path.dirname(localpath) + "/" + os.readlink(localpath)
|
||||
command = self.scp + [localpath, '%s@%s:%s' % (self.user, self.ip, remotepath)]
|
||||
return self._internal_run(command, ignore_status=False)
|
||||
|
||||
def copy_from(self, remotepath, localpath):
|
||||
command = self.scp + ['%s@%s:%s' % (self.user, self.ip, remotepath), localpath]
|
||||
|
||||
@@ -41,6 +41,16 @@ do_install_class-native() {
|
||||
install -m 755 grub-mkimage ${D}${bindir}
|
||||
}
|
||||
|
||||
do_install_append_class-target() {
|
||||
# Remove build host references...
|
||||
find "${D}" -name modinfo.sh -type f -exec \
|
||||
sed -i \
|
||||
-e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
|
||||
-e 's|${DEBUG_PREFIX_MAP}||g' \
|
||||
-e 's:${RECIPE_SYSROOT_NATIVE}::g' \
|
||||
{} +
|
||||
}
|
||||
|
||||
GRUB_BUILDIN ?= "boot linux ext2 fat serial part_msdos part_gpt normal efi_gop iso9660 search"
|
||||
|
||||
do_deploy() {
|
||||
|
||||
@@ -8,6 +8,13 @@ FILES_grub-editenv = "${bindir}/grub-editenv"
|
||||
|
||||
do_install_append () {
|
||||
install -d ${D}${sysconfdir}/grub.d
|
||||
# Remove build host references...
|
||||
find "${D}" -name modinfo.sh -type f -exec \
|
||||
sed -i \
|
||||
-e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
|
||||
-e 's|${DEBUG_PREFIX_MAP}||g' \
|
||||
-e 's:${RECIPE_SYSROOT_NATIVE}::g' \
|
||||
{} +
|
||||
}
|
||||
|
||||
INSANE_SKIP_${PN} = "arch"
|
||||
|
||||
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=dba46507446198119bcde32a4feaab43"
|
||||
|
||||
DEPENDS = "openssl libcap"
|
||||
|
||||
SRC_URI = "ftp://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.gz \
|
||||
SRC_URI = "https://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.gz \
|
||||
file://conf.patch \
|
||||
file://make-etc-initd-bind-stop-work.patch \
|
||||
file://dont-test-on-host.patch \
|
||||
@@ -23,7 +23,7 @@ SRC_URI = "ftp://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.gz \
|
||||
file://use-python3-and-fix-install-lib-path.patch \
|
||||
"
|
||||
|
||||
UPSTREAM_CHECK_URI = "ftp://ftp.isc.org/isc/bind9/"
|
||||
UPSTREAM_CHECK_URI = "https://ftp.isc.org/isc/bind9/"
|
||||
UPSTREAM_CHECK_REGEX = "(?P<pver>9(\.\d+)+(-P\d+)*)/"
|
||||
|
||||
SRC_URI[md5sum] = "d79cafbd9ac76239ee532dd89d05cc83"
|
||||
|
||||
@@ -27,7 +27,7 @@ UPSTREAM_CHECK_REGEX = "(?P<pver>\d+\.\d+\.(\d+?))/"
|
||||
inherit autotools systemd useradd update-rc.d
|
||||
|
||||
USERADD_PACKAGES = "${PN}-server"
|
||||
USERADD_PARAM_${PN}-server = "--system --no-create-home --home-dir /var/run/${PN} --shell /bin/false --user-group ${PN}"
|
||||
USERADD_PARAM_${PN}-server = "--system --no-create-home --home-dir /var/run/${BPN} --shell /bin/false --user-group ${BPN}"
|
||||
|
||||
SYSTEMD_PACKAGES = "${PN}-server ${PN}-relay ${PN}-client"
|
||||
SYSTEMD_SERVICE_${PN}-server = "dhcpd.service dhcpd6.service"
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
From 501543b3ef715488a142e3d301ff2733aa33eec7 Mon Sep 17 00:00:00 2001
|
||||
From: Awais Belal <awais_belal@mentor.com>
|
||||
Date: Wed, 25 Oct 2017 21:00:05 +0500
|
||||
Subject: [PATCH] dhcp: correct the intention for xml2 lib search
|
||||
|
||||
A missing case breaks the build when libxml2 is
|
||||
required and found appropriately. The third argument
|
||||
to the function AC_SEARCH_LIB is action-if-found which
|
||||
was mistakenly been used for the case where the library
|
||||
is not found and hence breaks the configure phase
|
||||
where it shoud actually pass.
|
||||
We now pass on silently when action-if-found is
|
||||
executed.
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Awais Belal <awais_belal@mentor.com>
|
||||
---
|
||||
configure.ac | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index bfe988a..f0459e6 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -608,7 +608,7 @@ AC_ARG_WITH(libxml2,
|
||||
with_libxml2="$withval", with_libxml2="no")
|
||||
|
||||
if test x$with_libxml2 != xno; then
|
||||
- AC_SEARCH_LIBS(xmlTextWriterStartElement, [xml2],
|
||||
+ AC_SEARCH_LIBS(xmlTextWriterStartElement, [xml2],,
|
||||
[if test x$with_libxml2 != xauto; then
|
||||
AC_MSG_FAILURE([*** Cannot find xmlTextWriterStartElement with -lxml2 and libxml2 was requested])
|
||||
fi])
|
||||
--
|
||||
2.11.1
|
||||
|
||||
@@ -11,6 +11,7 @@ SRC_URI += "file://0001-define-macro-_PATH_DHCPD_CONF-and-_PATH_DHCLIENT_CON.pat
|
||||
file://0009-remove-dhclient-script-bash-dependency.patch \
|
||||
file://0010-build-shared-libs.patch \
|
||||
file://0011-Moved-the-call-to-isc_app_ctxstart-to-not-get-signal.patch \
|
||||
file://0012-dhcp-correct-the-intention-for-xml2-lib-search.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "afa6e9b3eb7539ea048421a82c668adc"
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
From 3d9199423d48766649a2b2ebb3924e892ed16fa4 Mon Sep 17 00:00:00 2001
|
||||
From: Randy MacLeod <Randy.MacLeod@windriver.com>
|
||||
Date: Tue, 20 Jun 2017 15:32:08 -0400
|
||||
Subject: [PATCH] openssl: Force soft link to avoid rare race
|
||||
|
||||
This patch works around a rare parallel build race condition.
|
||||
The error seen is:
|
||||
|
||||
ln: failed to create symbolic link 'libssl.so': File exists
|
||||
make[4]: *** [Makefile.shared:171: link_a.gnu] Error 1
|
||||
make[4]: Leaving directory
|
||||
'/.../build/tmp-glibc/work/x86_64-linux/openssl-native/1.0.2k-r0/openssl-1.0.2k'
|
||||
|
||||
The openssl team is rewriting their build files so it's not
|
||||
appropriate for openssl upstream and fixing the root cause of
|
||||
the Makefile race condition was also not pursued.
|
||||
|
||||
Upstream-Status: Inappropriate [build rules rewrite in progress]
|
||||
Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
|
||||
---
|
||||
Makefile.shared | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/Makefile.shared b/Makefile.shared
|
||||
index e8d222a..1bff92f 100644
|
||||
--- a/Makefile.shared
|
||||
+++ b/Makefile.shared
|
||||
@@ -118,14 +118,14 @@
|
||||
if [ -n "$$SHLIB_COMPAT" ]; then \
|
||||
for x in $$SHLIB_COMPAT; do \
|
||||
( $(SET_X); rm -f $$SHLIB$$x$$SHLIB_SUFFIX; \
|
||||
- ln -s $$prev $$SHLIB$$x$$SHLIB_SUFFIX ); \
|
||||
+ ln -sf $$prev $$SHLIB$$x$$SHLIB_SUFFIX ); \
|
||||
prev=$$SHLIB$$x$$SHLIB_SUFFIX; \
|
||||
done; \
|
||||
fi; \
|
||||
if [ -n "$$SHLIB_SOVER" ]; then \
|
||||
[ -e "$$SHLIB$$SHLIB_SUFFIX" ] || \
|
||||
( $(SET_X); rm -f $$SHLIB$$SHLIB_SUFFIX; \
|
||||
- ln -s $$prev $$SHLIB$$SHLIB_SUFFIX ); \
|
||||
+ ln -sf $$prev $$SHLIB$$SHLIB_SUFFIX ); \
|
||||
fi; \
|
||||
fi
|
||||
|
||||
--
|
||||
2.9.3
|
||||
@@ -41,6 +41,7 @@ SRC_URI += "file://find.pl;subdir=openssl-${PV}/util/ \
|
||||
file://openssl-util-perlpath.pl-cwd.patch \
|
||||
file://Use-SHA256-not-MD5-as-default-digest.patch \
|
||||
file://0001-Fix-build-with-clang-using-external-assembler.patch \
|
||||
file://0001-openssl-force-soft-link-to-avoid-rare-race.patch \
|
||||
"
|
||||
SRC_URI[md5sum] = "f85123cd390e864dfbe517e7616e6566"
|
||||
SRC_URI[sha256sum] = "ce07195b659e75f4e1db43552860070061f156a98bb37b672b101ba6e3ddf30c"
|
||||
|
||||
@@ -22,7 +22,7 @@ IMAGE_FSTYPES = "wic.vmdk"
|
||||
|
||||
inherit core-image module-base setuptools3
|
||||
|
||||
SRCREV ?= "1d57ca352f798dd671fd8c15ee4286644c49c4b9"
|
||||
SRCREV ?= "ab4310e7b8eb086e6a04f088e1f6e9e1ebf1b390"
|
||||
SRC_URI = "git://git.yoctoproject.org/poky;branch=master \
|
||||
file://Yocto_Build_Appliance.vmx \
|
||||
file://Yocto_Build_Appliance.vmxf \
|
||||
|
||||
@@ -21,4 +21,4 @@ INHIBIT_DEFAULT_DEPS = "1"
|
||||
|
||||
FILES_${PN} = " /install-efi.sh "
|
||||
|
||||
COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
|
||||
COMPATIBLE_HOST = "(i.86.*|x86_64.*|aarch64.*)-linux"
|
||||
|
||||
@@ -21,4 +21,4 @@ INHIBIT_DEFAULT_DEPS = "1"
|
||||
|
||||
FILES_${PN} = " /install.sh "
|
||||
|
||||
COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
|
||||
COMPATIBLE_HOST = "(i.86.*|x86_64.*|aarch64.*)-linux"
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
SUMMARY = "Host packages for the standalone SDK or external toolchain"
|
||||
PR = "r12"
|
||||
LICENSE = "MIT"
|
||||
|
||||
inherit packagegroup nativesdk
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ for service in $services; do
|
||||
|
||||
# If any new unit types are added to systemd they should be added
|
||||
# to this regular expression.
|
||||
unit_types_re='\.\(service\|socket\|device\|mount\|automount\|swap\|target\|path\|timer\|snapshot\)\s*$'
|
||||
unit_types_re='\.\(service\|socket\|device\|mount\|automount\|swap\|target\|target\.wants\|path\|timer\|snapshot\)\s*$'
|
||||
if [ "$action" = "preset" ]; then
|
||||
action=`egrep -sh $service $ROOT/etc/systemd/user-preset/*.preset | cut -f1 -d' '`
|
||||
if [ -z "$action" ]; then
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
From 3ca5326485cb19e775af6de615c17be66e44e472 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Tue, 24 Oct 2017 23:08:24 -0700
|
||||
Subject: [PATCH] Define _PATH_WTMPX and _PATH_UTMPX if not defined
|
||||
|
||||
Musl needs these defines
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
Upstream-Status: Pending
|
||||
|
||||
src/shared/utmp-wtmp.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/src/shared/utmp-wtmp.c b/src/shared/utmp-wtmp.c
|
||||
index 9750dcd81..bd55d74a1 100644
|
||||
--- a/src/shared/utmp-wtmp.c
|
||||
+++ b/src/shared/utmp-wtmp.c
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <unistd.h>
|
||||
+#include <utmp.h>
|
||||
#include <utmpx.h>
|
||||
|
||||
#include "alloc-util.h"
|
||||
@@ -41,6 +42,13 @@
|
||||
#include "util.h"
|
||||
#include "utmp-wtmp.h"
|
||||
|
||||
+#if defined _PATH_UTMP && !defined _PATH_UTMPX
|
||||
+# define _PATH_UTMPX _PATH_UTMP
|
||||
+#endif
|
||||
+#if defined _PATH_WTMP && !defined _PATH_WTMPX
|
||||
+# define _PATH_WTMPX _PATH_WTMP
|
||||
+#endif
|
||||
+
|
||||
int utmp_get_runlevel(int *runlevel, int *previous) {
|
||||
struct utmpx *found, lookup = { .ut_type = RUN_LVL };
|
||||
int r;
|
||||
--
|
||||
2.14.3
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
From b2d4171c6e521cf1e70331fb769234d63a4a6d44 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Fri, 27 Oct 2017 13:00:41 -0700
|
||||
Subject: [PATCH] Use uintmax_t for handling rlim_t
|
||||
|
||||
PRIu{32,64} is not right format to represent rlim_t type
|
||||
therefore use %ju and typecast the rlim_t variables to
|
||||
uintmax_t.
|
||||
|
||||
Fixes portablility errors like
|
||||
|
||||
execute.c:3446:36: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'rlim_t {aka long long unsigned int}' [-Werror=format=]
|
||||
| fprintf(f, "%s%s: " RLIM_FMT "\n",
|
||||
| ^~~~~~~~
|
||||
| prefix, rlimit_to_string(i), c->rlimit[i]->rlim_max);
|
||||
| ~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
Upstream-Status: Submitted [https://github.com/systemd/systemd/pull/7199]
|
||||
|
||||
src/basic/format-util.h | 8 --------
|
||||
src/basic/rlimit-util.c | 8 ++++----
|
||||
src/core/execute.c | 8 ++++----
|
||||
3 files changed, 8 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/src/basic/format-util.h b/src/basic/format-util.h
|
||||
index ae42a8f89..144249cd6 100644
|
||||
--- a/src/basic/format-util.h
|
||||
+++ b/src/basic/format-util.h
|
||||
@@ -60,14 +60,6 @@
|
||||
# define PRI_TIMEX "li"
|
||||
#endif
|
||||
|
||||
-#if SIZEOF_RLIM_T == 8
|
||||
-# define RLIM_FMT "%" PRIu64
|
||||
-#elif SIZEOF_RLIM_T == 4
|
||||
-# define RLIM_FMT "%" PRIu32
|
||||
-#else
|
||||
-# error Unknown rlim_t size
|
||||
-#endif
|
||||
-
|
||||
#if SIZEOF_DEV_T == 8
|
||||
# define DEV_FMT "%" PRIu64
|
||||
#elif SIZEOF_DEV_T == 4
|
||||
diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c
|
||||
index ca834df62..41fcebb74 100644
|
||||
--- a/src/basic/rlimit-util.c
|
||||
+++ b/src/basic/rlimit-util.c
|
||||
@@ -284,13 +284,13 @@ int rlimit_format(const struct rlimit *rl, char **ret) {
|
||||
if (rl->rlim_cur >= RLIM_INFINITY && rl->rlim_max >= RLIM_INFINITY)
|
||||
s = strdup("infinity");
|
||||
else if (rl->rlim_cur >= RLIM_INFINITY)
|
||||
- (void) asprintf(&s, "infinity:" RLIM_FMT, rl->rlim_max);
|
||||
+ (void) asprintf(&s, "infinity:%ju", (uintmax_t)rl->rlim_max);
|
||||
else if (rl->rlim_max >= RLIM_INFINITY)
|
||||
- (void) asprintf(&s, RLIM_FMT ":infinity", rl->rlim_cur);
|
||||
+ (void) asprintf(&s, "%ju:infinity", (uintmax_t)rl->rlim_cur);
|
||||
else if (rl->rlim_cur == rl->rlim_max)
|
||||
- (void) asprintf(&s, RLIM_FMT, rl->rlim_cur);
|
||||
+ (void) asprintf(&s, "%ju", (uintmax_t)rl->rlim_cur);
|
||||
else
|
||||
- (void) asprintf(&s, RLIM_FMT ":" RLIM_FMT, rl->rlim_cur, rl->rlim_max);
|
||||
+ (void) asprintf(&s, "%ju:%ju", (uintmax_t)rl->rlim_cur, (uintmax_t)rl->rlim_max);
|
||||
|
||||
if (!s)
|
||||
return -ENOMEM;
|
||||
diff --git a/src/core/execute.c b/src/core/execute.c
|
||||
index d72e5bf08..d38946002 100644
|
||||
--- a/src/core/execute.c
|
||||
+++ b/src/core/execute.c
|
||||
@@ -3443,10 +3443,10 @@ void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) {
|
||||
|
||||
for (i = 0; i < RLIM_NLIMITS; i++)
|
||||
if (c->rlimit[i]) {
|
||||
- fprintf(f, "%s%s: " RLIM_FMT "\n",
|
||||
- prefix, rlimit_to_string(i), c->rlimit[i]->rlim_max);
|
||||
- fprintf(f, "%s%sSoft: " RLIM_FMT "\n",
|
||||
- prefix, rlimit_to_string(i), c->rlimit[i]->rlim_cur);
|
||||
+ fprintf(f, "%s%s: %ju\n",
|
||||
+ prefix, rlimit_to_string(i), (uintmax_t)c->rlimit[i]->rlim_max);
|
||||
+ fprintf(f, "%s%sSoft: %ju\n",
|
||||
+ prefix, rlimit_to_string(i), (uintmax_t)c->rlimit[i]->rlim_cur);
|
||||
}
|
||||
|
||||
if (c->ioprio_set) {
|
||||
--
|
||||
2.14.3
|
||||
|
||||
@@ -0,0 +1,433 @@
|
||||
From 0933ca6251808f856b92b0ce8da8696d5febc333 Mon Sep 17 00:00:00 2001
|
||||
From: Emil Renner Berthing <systemd@esmil.dk>
|
||||
Date: Mon, 23 Oct 2017 10:41:39 -0700
|
||||
Subject: [PATCH 01/12] add fallback parse_printf_format implementation
|
||||
|
||||
Signed-off-by: Emil Renner Berthing <systemd@esmil.dk>
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
Upstream-Status: Pending
|
||||
|
||||
Makefile.am | 4 +
|
||||
configure.ac | 2 +
|
||||
src/basic/parse-printf-format.c | 273 ++++++++++++++++++++++++++++++++++++++++
|
||||
src/basic/parse-printf-format.h | 57 +++++++++
|
||||
src/basic/stdio-util.h | 2 +-
|
||||
src/journal/journal-send.c | 2 +-
|
||||
6 files changed, 338 insertions(+), 2 deletions(-)
|
||||
create mode 100644 src/basic/parse-printf-format.c
|
||||
create mode 100644 src/basic/parse-printf-format.h
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 692d7bb95..3cc8f3451 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -997,6 +997,10 @@ libbasic_la_SOURCES = \
|
||||
src/basic/journal-importer.h \
|
||||
src/basic/journal-importer.c
|
||||
|
||||
+if !HAVE_PRINTF_H
|
||||
+libbasic_la_SOURCES += src/basic/parse-printf-format.c
|
||||
+endif
|
||||
+
|
||||
nodist_libbasic_la_SOURCES = \
|
||||
src/basic/errno-from-name.h \
|
||||
src/basic/errno-to-name.h \
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 60e7df5ee..efcdc6c16 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -308,8 +308,10 @@ AC_CHECK_HEADERS([uchar.h], [], [])
|
||||
AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
|
||||
AC_CHECK_HEADERS([linux/btrfs.h], [], [])
|
||||
AC_CHECK_HEADERS([linux/memfd.h], [], [])
|
||||
+AC_CHECK_HEADERS([printf.h], [], [])
|
||||
AC_CHECK_HEADERS([linux/vm_sockets.h], [], [], [#include <sys/socket.h>])
|
||||
|
||||
+AM_CONDITIONAL(HAVE_PRINTF_H, [test "x$ac_cv_header_printf_h" = xyes])
|
||||
# unconditionally pull-in librt with old glibc versions
|
||||
AC_SEARCH_LIBS([clock_gettime], [rt], [], [])
|
||||
|
||||
diff --git a/src/basic/parse-printf-format.c b/src/basic/parse-printf-format.c
|
||||
new file mode 100644
|
||||
index 000000000..49437e544
|
||||
--- /dev/null
|
||||
+++ b/src/basic/parse-printf-format.c
|
||||
@@ -0,0 +1,273 @@
|
||||
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
||||
+
|
||||
+/***
|
||||
+ This file is part of systemd.
|
||||
+
|
||||
+ Copyright 2014 Emil Renner Berthing <systemd@esmil.dk>
|
||||
+
|
||||
+ With parts from the musl C library
|
||||
+ Copyright 2005-2014 Rich Felker, et al.
|
||||
+
|
||||
+ 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.
|
||||
+
|
||||
+ systemd is distributed in the hope that it will be useful, but
|
||||
+ WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ Lesser General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU Lesser General Public License
|
||||
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
+***/
|
||||
+
|
||||
+#include <stddef.h>
|
||||
+#include <string.h>
|
||||
+
|
||||
+#include "parse-printf-format.h"
|
||||
+
|
||||
+static const char *consume_nonarg(const char *fmt)
|
||||
+{
|
||||
+ do {
|
||||
+ if (*fmt == '\0')
|
||||
+ return fmt;
|
||||
+ } while (*fmt++ != '%');
|
||||
+ return fmt;
|
||||
+}
|
||||
+
|
||||
+static const char *consume_num(const char *fmt)
|
||||
+{
|
||||
+ for (;*fmt >= '0' && *fmt <= '9'; fmt++)
|
||||
+ /* do nothing */;
|
||||
+ return fmt;
|
||||
+}
|
||||
+
|
||||
+static const char *consume_argn(const char *fmt, size_t *arg)
|
||||
+{
|
||||
+ const char *p = fmt;
|
||||
+ size_t val = 0;
|
||||
+
|
||||
+ if (*p < '1' || *p > '9')
|
||||
+ return fmt;
|
||||
+ do {
|
||||
+ val = 10*val + (*p++ - '0');
|
||||
+ } while (*p >= '0' && *p <= '9');
|
||||
+
|
||||
+ if (*p != '$')
|
||||
+ return fmt;
|
||||
+ *arg = val;
|
||||
+ return p+1;
|
||||
+}
|
||||
+
|
||||
+static const char *consume_flags(const char *fmt)
|
||||
+{
|
||||
+ while (1) {
|
||||
+ switch (*fmt) {
|
||||
+ case '#':
|
||||
+ case '0':
|
||||
+ case '-':
|
||||
+ case ' ':
|
||||
+ case '+':
|
||||
+ case '\'':
|
||||
+ case 'I':
|
||||
+ fmt++;
|
||||
+ continue;
|
||||
+ }
|
||||
+ return fmt;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+enum state {
|
||||
+ BARE,
|
||||
+ LPRE,
|
||||
+ LLPRE,
|
||||
+ HPRE,
|
||||
+ HHPRE,
|
||||
+ BIGLPRE,
|
||||
+ ZTPRE,
|
||||
+ JPRE,
|
||||
+ STOP
|
||||
+};
|
||||
+
|
||||
+enum type {
|
||||
+ NONE,
|
||||
+ PTR,
|
||||
+ INT,
|
||||
+ UINT,
|
||||
+ ULLONG,
|
||||
+ LONG,
|
||||
+ ULONG,
|
||||
+ SHORT,
|
||||
+ USHORT,
|
||||
+ CHAR,
|
||||
+ UCHAR,
|
||||
+ LLONG,
|
||||
+ SIZET,
|
||||
+ IMAX,
|
||||
+ UMAX,
|
||||
+ PDIFF,
|
||||
+ UIPTR,
|
||||
+ DBL,
|
||||
+ LDBL,
|
||||
+ MAXTYPE
|
||||
+};
|
||||
+
|
||||
+static const short pa_types[MAXTYPE] = {
|
||||
+ [NONE] = PA_INT,
|
||||
+ [PTR] = PA_POINTER,
|
||||
+ [INT] = PA_INT,
|
||||
+ [UINT] = PA_INT,
|
||||
+ [ULLONG] = PA_INT | PA_FLAG_LONG_LONG,
|
||||
+ [LONG] = PA_INT | PA_FLAG_LONG,
|
||||
+ [ULONG] = PA_INT | PA_FLAG_LONG,
|
||||
+ [SHORT] = PA_INT | PA_FLAG_SHORT,
|
||||
+ [USHORT] = PA_INT | PA_FLAG_SHORT,
|
||||
+ [CHAR] = PA_CHAR,
|
||||
+ [UCHAR] = PA_CHAR,
|
||||
+ [LLONG] = PA_INT | PA_FLAG_LONG_LONG,
|
||||
+ [SIZET] = PA_INT | PA_FLAG_LONG,
|
||||
+ [IMAX] = PA_INT | PA_FLAG_LONG_LONG,
|
||||
+ [UMAX] = PA_INT | PA_FLAG_LONG_LONG,
|
||||
+ [PDIFF] = PA_INT | PA_FLAG_LONG_LONG,
|
||||
+ [UIPTR] = PA_INT | PA_FLAG_LONG,
|
||||
+ [DBL] = PA_DOUBLE,
|
||||
+ [LDBL] = PA_DOUBLE | PA_FLAG_LONG_DOUBLE
|
||||
+};
|
||||
+
|
||||
+#define S(x) [(x)-'A']
|
||||
+#define E(x) (STOP + (x))
|
||||
+
|
||||
+static const unsigned char states[]['z'-'A'+1] = {
|
||||
+ { /* 0: bare types */
|
||||
+ S('d') = E(INT), S('i') = E(INT),
|
||||
+ S('o') = E(UINT),S('u') = E(UINT),S('x') = E(UINT), S('X') = E(UINT),
|
||||
+ S('e') = E(DBL), S('f') = E(DBL), S('g') = E(DBL), S('a') = E(DBL),
|
||||
+ S('E') = E(DBL), S('F') = E(DBL), S('G') = E(DBL), S('A') = E(DBL),
|
||||
+ S('c') = E(CHAR),S('C') = E(INT),
|
||||
+ S('s') = E(PTR), S('S') = E(PTR), S('p') = E(UIPTR),S('n') = E(PTR),
|
||||
+ S('m') = E(NONE),
|
||||
+ S('l') = LPRE, S('h') = HPRE, S('L') = BIGLPRE,
|
||||
+ S('z') = ZTPRE, S('j') = JPRE, S('t') = ZTPRE
|
||||
+ }, { /* 1: l-prefixed */
|
||||
+ S('d') = E(LONG), S('i') = E(LONG),
|
||||
+ S('o') = E(ULONG),S('u') = E(ULONG),S('x') = E(ULONG),S('X') = E(ULONG),
|
||||
+ S('e') = E(DBL), S('f') = E(DBL), S('g') = E(DBL), S('a') = E(DBL),
|
||||
+ S('E') = E(DBL), S('F') = E(DBL), S('G') = E(DBL), S('A') = E(DBL),
|
||||
+ S('c') = E(INT), S('s') = E(PTR), S('n') = E(PTR),
|
||||
+ S('l') = LLPRE
|
||||
+ }, { /* 2: ll-prefixed */
|
||||
+ S('d') = E(LLONG), S('i') = E(LLONG),
|
||||
+ S('o') = E(ULLONG),S('u') = E(ULLONG),
|
||||
+ S('x') = E(ULLONG),S('X') = E(ULLONG),
|
||||
+ S('n') = E(PTR)
|
||||
+ }, { /* 3: h-prefixed */
|
||||
+ S('d') = E(SHORT), S('i') = E(SHORT),
|
||||
+ S('o') = E(USHORT),S('u') = E(USHORT),
|
||||
+ S('x') = E(USHORT),S('X') = E(USHORT),
|
||||
+ S('n') = E(PTR),
|
||||
+ S('h') = HHPRE
|
||||
+ }, { /* 4: hh-prefixed */
|
||||
+ S('d') = E(CHAR), S('i') = E(CHAR),
|
||||
+ S('o') = E(UCHAR),S('u') = E(UCHAR),
|
||||
+ S('x') = E(UCHAR),S('X') = E(UCHAR),
|
||||
+ S('n') = E(PTR)
|
||||
+ }, { /* 5: L-prefixed */
|
||||
+ S('e') = E(LDBL),S('f') = E(LDBL),S('g') = E(LDBL), S('a') = E(LDBL),
|
||||
+ S('E') = E(LDBL),S('F') = E(LDBL),S('G') = E(LDBL), S('A') = E(LDBL),
|
||||
+ S('n') = E(PTR)
|
||||
+ }, { /* 6: z- or t-prefixed (assumed to be same size) */
|
||||
+ S('d') = E(PDIFF),S('i') = E(PDIFF),
|
||||
+ S('o') = E(SIZET),S('u') = E(SIZET),
|
||||
+ S('x') = E(SIZET),S('X') = E(SIZET),
|
||||
+ S('n') = E(PTR)
|
||||
+ }, { /* 7: j-prefixed */
|
||||
+ S('d') = E(IMAX), S('i') = E(IMAX),
|
||||
+ S('o') = E(UMAX), S('u') = E(UMAX),
|
||||
+ S('x') = E(UMAX), S('X') = E(UMAX),
|
||||
+ S('n') = E(PTR)
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+size_t parse_printf_format(const char *fmt, size_t n, int *types)
|
||||
+{
|
||||
+ size_t i = 0;
|
||||
+ size_t last = 0;
|
||||
+
|
||||
+ memset(types, 0, n);
|
||||
+
|
||||
+ while (1) {
|
||||
+ size_t arg;
|
||||
+ unsigned int state;
|
||||
+
|
||||
+ fmt = consume_nonarg(fmt);
|
||||
+ if (*fmt == '\0')
|
||||
+ break;
|
||||
+ if (*fmt == '%') {
|
||||
+ fmt++;
|
||||
+ continue;
|
||||
+ }
|
||||
+ arg = 0;
|
||||
+ fmt = consume_argn(fmt, &arg);
|
||||
+ /* flags */
|
||||
+ fmt = consume_flags(fmt);
|
||||
+ /* width */
|
||||
+ if (*fmt == '*') {
|
||||
+ size_t warg = 0;
|
||||
+ fmt = consume_argn(fmt+1, &warg);
|
||||
+ if (warg == 0)
|
||||
+ warg = ++i;
|
||||
+ if (warg > last)
|
||||
+ last = warg;
|
||||
+ if (warg <= n && types[warg-1] == NONE)
|
||||
+ types[warg-1] = INT;
|
||||
+ } else
|
||||
+ fmt = consume_num(fmt);
|
||||
+ /* precision */
|
||||
+ if (*fmt == '.') {
|
||||
+ fmt++;
|
||||
+ if (*fmt == '*') {
|
||||
+ size_t parg = 0;
|
||||
+ fmt = consume_argn(fmt+1, &parg);
|
||||
+ if (parg == 0)
|
||||
+ parg = ++i;
|
||||
+ if (parg > last)
|
||||
+ last = parg;
|
||||
+ if (parg <= n && types[parg-1] == NONE)
|
||||
+ types[parg-1] = INT;
|
||||
+ } else {
|
||||
+ if (*fmt == '-')
|
||||
+ fmt++;
|
||||
+ fmt = consume_num(fmt);
|
||||
+ }
|
||||
+ }
|
||||
+ /* length modifier and conversion specifier */
|
||||
+ state = BARE;
|
||||
+ do {
|
||||
+ unsigned char c = *fmt++;
|
||||
+
|
||||
+ if (c < 'A' || c > 'z')
|
||||
+ continue;
|
||||
+ state = states[state]S(c);
|
||||
+ if (state == 0)
|
||||
+ continue;
|
||||
+ } while (state < STOP);
|
||||
+
|
||||
+ if (state == E(NONE))
|
||||
+ continue;
|
||||
+
|
||||
+ if (arg == 0)
|
||||
+ arg = ++i;
|
||||
+ if (arg > last)
|
||||
+ last = arg;
|
||||
+ if (arg <= n)
|
||||
+ types[arg-1] = state - STOP;
|
||||
+ }
|
||||
+
|
||||
+ if (last > n)
|
||||
+ last = n;
|
||||
+ for (i = 0; i < last; i++)
|
||||
+ types[i] = pa_types[types[i]];
|
||||
+
|
||||
+ return last;
|
||||
+}
|
||||
diff --git a/src/basic/parse-printf-format.h b/src/basic/parse-printf-format.h
|
||||
new file mode 100644
|
||||
index 000000000..4371177b0
|
||||
--- /dev/null
|
||||
+++ b/src/basic/parse-printf-format.h
|
||||
@@ -0,0 +1,57 @@
|
||||
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
||||
+
|
||||
+/***
|
||||
+ This file is part of systemd.
|
||||
+
|
||||
+ Copyright 2014 Emil Renner Berthing <systemd@esmil.dk>
|
||||
+
|
||||
+ With parts from the GNU C Library
|
||||
+ Copyright 1991-2014 Free Software Foundation, Inc.
|
||||
+
|
||||
+ 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.
|
||||
+
|
||||
+ systemd is distributed in the hope that it will be useful, but
|
||||
+ WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ Lesser General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU Lesser General Public License
|
||||
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
+***/
|
||||
+
|
||||
+#pragma once
|
||||
+
|
||||
+#include "config.h"
|
||||
+
|
||||
+#ifdef HAVE_PRINTF_H
|
||||
+#include <printf.h>
|
||||
+#else
|
||||
+
|
||||
+#include <stddef.h>
|
||||
+
|
||||
+enum { /* C type: */
|
||||
+ PA_INT, /* int */
|
||||
+ PA_CHAR, /* int, cast to char */
|
||||
+ PA_WCHAR, /* wide char */
|
||||
+ PA_STRING, /* const char *, a '\0'-terminated string */
|
||||
+ PA_WSTRING, /* const wchar_t *, wide character string */
|
||||
+ PA_POINTER, /* void * */
|
||||
+ PA_FLOAT, /* float */
|
||||
+ PA_DOUBLE, /* double */
|
||||
+ PA_LAST
|
||||
+};
|
||||
+
|
||||
+/* Flag bits that can be set in a type returned by `parse_printf_format'. */
|
||||
+#define PA_FLAG_MASK 0xff00
|
||||
+#define PA_FLAG_LONG_LONG (1 << 8)
|
||||
+#define PA_FLAG_LONG_DOUBLE PA_FLAG_LONG_LONG
|
||||
+#define PA_FLAG_LONG (1 << 9)
|
||||
+#define PA_FLAG_SHORT (1 << 10)
|
||||
+#define PA_FLAG_PTR (1 << 11)
|
||||
+
|
||||
+size_t parse_printf_format(const char *fmt, size_t n, int *types);
|
||||
+
|
||||
+#endif /* HAVE_PRINTF_H */
|
||||
diff --git a/src/basic/stdio-util.h b/src/basic/stdio-util.h
|
||||
index bd1144b4c..c9c95eb54 100644
|
||||
--- a/src/basic/stdio-util.h
|
||||
+++ b/src/basic/stdio-util.h
|
||||
@@ -19,12 +19,12 @@
|
||||
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
***/
|
||||
|
||||
-#include <printf.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "macro.h"
|
||||
+#include "parse-printf-format.h"
|
||||
|
||||
#define xsprintf(buf, fmt, ...) \
|
||||
assert_message_se((size_t) snprintf(buf, ELEMENTSOF(buf), fmt, __VA_ARGS__) < ELEMENTSOF(buf), "xsprintf: " #buf "[] must be big enough")
|
||||
diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c
|
||||
index 440fba67c..0236c43c4 100644
|
||||
--- a/src/journal/journal-send.c
|
||||
+++ b/src/journal/journal-send.c
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
-#include <printf.h>
|
||||
#include <stddef.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
@@ -38,6 +37,7 @@
|
||||
#include "stdio-util.h"
|
||||
#include "string-util.h"
|
||||
#include "util.h"
|
||||
+#include "parse-printf-format.h"
|
||||
|
||||
#define SNDBUF_SIZE (8*1024*1024)
|
||||
|
||||
--
|
||||
2.14.2
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
From 585abd891a56409915314304101cac26b42c076b Mon Sep 17 00:00:00 2001
|
||||
From: Emil Renner Berthing <systemd@esmil.dk>
|
||||
Date: Mon, 23 Oct 2017 10:45:46 -0700
|
||||
Subject: [PATCH 02/12] src/basic/missing.h: check for missing strndupa
|
||||
|
||||
include missing.h for definition of strndupa
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
Upstream-Status: Pending
|
||||
|
||||
configure.ac | 1 +
|
||||
src/basic/missing.h | 11 +++++++++++
|
||||
src/basic/mkdir.c | 1 +
|
||||
src/basic/parse-util.c | 1 +
|
||||
src/shared/pager.c | 1 +
|
||||
src/shared/uid-range.c | 1 +
|
||||
6 files changed, 16 insertions(+)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index efcdc6c16..cd035a971 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -329,6 +329,7 @@ AC_CHECK_DECLS([
|
||||
pivot_root,
|
||||
name_to_handle_at,
|
||||
setns,
|
||||
+ strndupa,
|
||||
renameat2,
|
||||
kcmp,
|
||||
keyctl,
|
||||
diff --git a/src/basic/missing.h b/src/basic/missing.h
|
||||
index 04912bf52..8009888ad 100644
|
||||
--- a/src/basic/missing.h
|
||||
+++ b/src/basic/missing.h
|
||||
@@ -1104,6 +1104,17 @@ typedef int32_t key_serial_t;
|
||||
#define KEYCTL_DESCRIBE 6
|
||||
#endif
|
||||
|
||||
+#if !HAVE_DECL_STRNDUPA
|
||||
+#define strndupa(s, n) \
|
||||
+ ({ \
|
||||
+ const char *__old = (s); \
|
||||
+ size_t __len = strnlen(__old, (n)); \
|
||||
+ char *__new = (char *)alloca(__len + 1); \
|
||||
+ __new[__len] = '\0'; \
|
||||
+ (char *)memcpy(__new, __old, __len); \
|
||||
+ })
|
||||
+#endif
|
||||
+
|
||||
#ifndef KEYCTL_READ
|
||||
#define KEYCTL_READ 11
|
||||
#endif
|
||||
diff --git a/src/basic/mkdir.c b/src/basic/mkdir.c
|
||||
index 6b1a98402..d1388df48 100644
|
||||
--- a/src/basic/mkdir.c
|
||||
+++ b/src/basic/mkdir.c
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "path-util.h"
|
||||
#include "stat-util.h"
|
||||
#include "user-util.h"
|
||||
+#include "missing.h"
|
||||
|
||||
int mkdir_safe_internal(const char *path, mode_t mode, uid_t uid, gid_t gid, mkdir_func_t _mkdir) {
|
||||
struct stat st;
|
||||
diff --git a/src/basic/parse-util.c b/src/basic/parse-util.c
|
||||
index 4532f222c..7a30a0e06 100644
|
||||
--- a/src/basic/parse-util.c
|
||||
+++ b/src/basic/parse-util.c
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "parse-util.h"
|
||||
#include "process-util.h"
|
||||
#include "string-util.h"
|
||||
+#include "missing.h"
|
||||
|
||||
int parse_boolean(const char *v) {
|
||||
assert(v);
|
||||
diff --git a/src/shared/pager.c b/src/shared/pager.c
|
||||
index 4d7b02c63..854efc0c9 100644
|
||||
--- a/src/shared/pager.c
|
||||
+++ b/src/shared/pager.c
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "terminal-util.h"
|
||||
+#include "missing.h"
|
||||
|
||||
static pid_t pager_pid = 0;
|
||||
|
||||
diff --git a/src/shared/uid-range.c b/src/shared/uid-range.c
|
||||
index b6ec47439..91ce9fb7f 100644
|
||||
--- a/src/shared/uid-range.c
|
||||
+++ b/src/shared/uid-range.c
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "macro.h"
|
||||
#include "uid-range.h"
|
||||
#include "user-util.h"
|
||||
+#include "missing.h"
|
||||
|
||||
static bool uid_range_intersect(UidRange *range, uid_t start, uid_t nr) {
|
||||
assert(range);
|
||||
--
|
||||
2.14.2
|
||||
|
||||
@@ -0,0 +1,157 @@
|
||||
From 5bbbc2a08a3b4283ec04af0e77e25fb205aa8b82 Mon Sep 17 00:00:00 2001
|
||||
From: Emil Renner Berthing <systemd@esmil.dk>
|
||||
Date: Mon, 23 Oct 2017 10:50:14 -0700
|
||||
Subject: [PATCH 03/12] don't fail if GLOB_BRACE and GLOB_ALTDIRFUNC is not
|
||||
defined
|
||||
|
||||
If the standard library doesn't provide brace
|
||||
expansion users just won't get it.
|
||||
|
||||
Dont use GNU GLOB extentions on non-glibc systems
|
||||
|
||||
Conditionalize use of GLOB_ALTDIRFUNC
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
Upstream-Status: Pending
|
||||
|
||||
src/basic/glob-util.c | 20 +++++++++++++++++---
|
||||
src/test/test-glob-util.c | 17 +++++++++++++++--
|
||||
src/tmpfiles/tmpfiles.c | 8 ++++++++
|
||||
3 files changed, 40 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/basic/glob-util.c b/src/basic/glob-util.c
|
||||
index f611c42e4..ad6e2be8d 100644
|
||||
--- a/src/basic/glob-util.c
|
||||
+++ b/src/basic/glob-util.c
|
||||
@@ -27,13 +27,18 @@
|
||||
#include "macro.h"
|
||||
#include "path-util.h"
|
||||
#include "strv.h"
|
||||
+/* Don't fail if the standard library
|
||||
+ * doesn't provide brace expansion */
|
||||
+#ifndef GLOB_BRACE
|
||||
+#define GLOB_BRACE 0
|
||||
+#endif
|
||||
|
||||
int safe_glob(const char *path, int flags, glob_t *pglob) {
|
||||
int k;
|
||||
|
||||
+#ifdef GLOB_ALTDIRFUNC
|
||||
/* We want to set GLOB_ALTDIRFUNC ourselves, don't allow it to be set. */
|
||||
assert(!(flags & GLOB_ALTDIRFUNC));
|
||||
-
|
||||
if (!pglob->gl_closedir)
|
||||
pglob->gl_closedir = (void (*)(void *)) closedir;
|
||||
if (!pglob->gl_readdir)
|
||||
@@ -44,10 +49,13 @@ int safe_glob(const char *path, int flags, glob_t *pglob) {
|
||||
pglob->gl_lstat = lstat;
|
||||
if (!pglob->gl_stat)
|
||||
pglob->gl_stat = stat;
|
||||
-
|
||||
+#endif
|
||||
errno = 0;
|
||||
+#ifdef GLOB_ALTDIRFUNC
|
||||
k = glob(path, flags | GLOB_ALTDIRFUNC, NULL, pglob);
|
||||
-
|
||||
+#else
|
||||
+ k = glob(path, flags, NULL, pglob);
|
||||
+#endif
|
||||
if (k == GLOB_NOMATCH)
|
||||
return -ENOENT;
|
||||
if (k == GLOB_NOSPACE)
|
||||
@@ -60,6 +68,12 @@ int safe_glob(const char *path, int flags, glob_t *pglob) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
+/* Don't fail if the standard library
|
||||
+ * doesn't provide brace expansion */
|
||||
+#ifndef GLOB_BRACE
|
||||
+#define GLOB_BRACE 0
|
||||
+#endif
|
||||
+
|
||||
int glob_exists(const char *path) {
|
||||
_cleanup_globfree_ glob_t g = {};
|
||||
int k;
|
||||
diff --git a/src/test/test-glob-util.c b/src/test/test-glob-util.c
|
||||
index af866e004..3afa09ada 100644
|
||||
--- a/src/test/test-glob-util.c
|
||||
+++ b/src/test/test-glob-util.c
|
||||
@@ -29,6 +29,11 @@
|
||||
#include "glob-util.h"
|
||||
#include "macro.h"
|
||||
#include "rm-rf.h"
|
||||
+/* Don't fail if the standard library
|
||||
+ * doesn't provide brace expansion */
|
||||
+#ifndef GLOB_BRACE
|
||||
+#define GLOB_BRACE 0
|
||||
+#endif
|
||||
|
||||
static void test_glob_exists(void) {
|
||||
char name[] = "/tmp/test-glob_exists.XXXXXX";
|
||||
@@ -51,25 +56,33 @@ static void test_glob_exists(void) {
|
||||
static void test_glob_no_dot(void) {
|
||||
char template[] = "/tmp/test-glob-util.XXXXXXX";
|
||||
const char *fn;
|
||||
-
|
||||
_cleanup_globfree_ glob_t g = {
|
||||
+#ifdef GLOB_ALTDIRFUNC
|
||||
.gl_closedir = (void (*)(void *)) closedir,
|
||||
.gl_readdir = (struct dirent *(*)(void *)) readdir_no_dot,
|
||||
.gl_opendir = (void *(*)(const char *)) opendir,
|
||||
.gl_lstat = lstat,
|
||||
.gl_stat = stat,
|
||||
+#endif
|
||||
};
|
||||
-
|
||||
int r;
|
||||
|
||||
assert_se(mkdtemp(template));
|
||||
|
||||
fn = strjoina(template, "/*");
|
||||
+#ifdef GLOB_ALTDIRFUNC
|
||||
r = glob(fn, GLOB_NOSORT|GLOB_BRACE|GLOB_ALTDIRFUNC, NULL, &g);
|
||||
+#else
|
||||
+ r = glob(fn, GLOB_NOSORT|GLOB_BRACE, NULL, &g);
|
||||
+#endif
|
||||
assert_se(r == GLOB_NOMATCH);
|
||||
|
||||
fn = strjoina(template, "/.*");
|
||||
+#ifdef GLOB_ALTDIRFUNC
|
||||
r = glob(fn, GLOB_NOSORT|GLOB_BRACE|GLOB_ALTDIRFUNC, NULL, &g);
|
||||
+#else
|
||||
+ r = glob(fn, GLOB_NOSORT|GLOB_BRACE, NULL, &g);
|
||||
+#endif
|
||||
assert_se(r == GLOB_NOMATCH);
|
||||
|
||||
(void) rm_rf(template, REMOVE_ROOT|REMOVE_PHYSICAL);
|
||||
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
|
||||
index 9419c99e2..07027a765 100644
|
||||
--- a/src/tmpfiles/tmpfiles.c
|
||||
+++ b/src/tmpfiles/tmpfiles.c
|
||||
@@ -71,6 +71,12 @@
|
||||
#include "umask-util.h"
|
||||
#include "user-util.h"
|
||||
#include "util.h"
|
||||
+/* Don't fail if the standard library
|
||||
+ * doesn't provide brace expansion */
|
||||
+#ifndef GLOB_BRACE
|
||||
+#define GLOB_BRACE 0
|
||||
+#endif
|
||||
+
|
||||
|
||||
/* This reads all files listed in /etc/tmpfiles.d/?*.conf and creates
|
||||
* them in the file system. This is intended to be used to create
|
||||
@@ -1092,7 +1098,9 @@ static int item_do_children(Item *i, const char *path, action_t action) {
|
||||
|
||||
static int glob_item(Item *i, action_t action, bool recursive) {
|
||||
_cleanup_globfree_ glob_t g = {
|
||||
+#ifdef GLOB_ALTDIRFUNC
|
||||
.gl_opendir = (void *(*)(const char *)) opendir_nomod,
|
||||
+#endif
|
||||
};
|
||||
int r = 0, k;
|
||||
char **fn;
|
||||
--
|
||||
2.14.2
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
From c850b654e71677e0d6292f1345207b9b5acffc33 Mon Sep 17 00:00:00 2001
|
||||
From: Emil Renner Berthing <systemd@esmil.dk>
|
||||
Date: Mon, 23 Oct 2017 11:31:03 -0700
|
||||
Subject: [PATCH 04/12] src/basic/missing.h: check for missing __compar_fn_t
|
||||
typedef
|
||||
|
||||
include missing.h for missing __compar_fn_t
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
Upstream-Status: Pending
|
||||
|
||||
src/basic/missing.h | 5 +++++
|
||||
src/basic/strbuf.c | 1 +
|
||||
2 files changed, 6 insertions(+)
|
||||
|
||||
diff --git a/src/basic/missing.h b/src/basic/missing.h
|
||||
index 8009888ad..671f341c6 100644
|
||||
--- a/src/basic/missing.h
|
||||
+++ b/src/basic/missing.h
|
||||
@@ -1063,6 +1063,11 @@ struct input_mask {
|
||||
#define RENAME_NOREPLACE (1 << 0)
|
||||
#endif
|
||||
|
||||
+#ifndef __COMPAR_FN_T
|
||||
+#define __COMPAR_FN_T
|
||||
+typedef int (*__compar_fn_t)(const void *, const void *);
|
||||
+#endif
|
||||
+
|
||||
#ifndef KCMP_FILE
|
||||
#define KCMP_FILE 0
|
||||
#endif
|
||||
diff --git a/src/basic/strbuf.c b/src/basic/strbuf.c
|
||||
index 00aaf9e62..9dc4a584a 100644
|
||||
--- a/src/basic/strbuf.c
|
||||
+++ b/src/basic/strbuf.c
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "strbuf.h"
|
||||
+#include "missing.h"
|
||||
|
||||
/*
|
||||
* Strbuf stores given strings in a single continuous allocated memory
|
||||
--
|
||||
2.14.2
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
From 21080b6a40d0a4ddd2db8f0fa37686f6fa885d1c Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Mon, 23 Oct 2017 11:38:33 -0700
|
||||
Subject: [PATCH 06/12] Include netinet/if_ether.h
|
||||
|
||||
Fixes
|
||||
/mnt/a/oe/build/tmp/work/mips32r2-bec-linux-musl/systemd/1_234-r0/recipe-sysroot/usr/include/netinet/if_ether.h:101:8: error: redefinition of 'struct ethhdr'
|
||||
struct ethhdr {
|
||||
^~~~~~
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
Upstream-Status: Pending
|
||||
|
||||
src/libsystemd/sd-netlink/netlink-types.c | 1 +
|
||||
src/network/netdev/tuntap.c | 1 +
|
||||
src/network/networkd-brvlan.c | 1 +
|
||||
src/udev/net/ethtool-util.c | 2 +-
|
||||
src/udev/udev-builtin-net_setup_link.c | 2 +-
|
||||
5 files changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/libsystemd/sd-netlink/netlink-types.c b/src/libsystemd/sd-netlink/netlink-types.c
|
||||
index 923f7dd10..b95b1e4b2 100644
|
||||
--- a/src/libsystemd/sd-netlink/netlink-types.c
|
||||
+++ b/src/libsystemd/sd-netlink/netlink-types.c
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/socket.h>
|
||||
+#include <netinet/if_ether.h>
|
||||
#include <linux/netlink.h>
|
||||
#include <linux/rtnetlink.h>
|
||||
#include <linux/can/netlink.h>
|
||||
diff --git a/src/network/netdev/tuntap.c b/src/network/netdev/tuntap.c
|
||||
index 3d6280884..40e58c38f 100644
|
||||
--- a/src/network/netdev/tuntap.c
|
||||
+++ b/src/network/netdev/tuntap.c
|
||||
@@ -18,6 +18,7 @@
|
||||
***/
|
||||
|
||||
#include <fcntl.h>
|
||||
+#include <netinet/if_ether.h>
|
||||
#include <linux/if_tun.h>
|
||||
#include <net/if.h>
|
||||
#include <netinet/if_ether.h>
|
||||
diff --git a/src/network/networkd-brvlan.c b/src/network/networkd-brvlan.c
|
||||
index fa5d3ee7f..e0828962a 100644
|
||||
--- a/src/network/networkd-brvlan.c
|
||||
+++ b/src/network/networkd-brvlan.c
|
||||
@@ -18,6 +18,7 @@
|
||||
***/
|
||||
|
||||
#include <netinet/in.h>
|
||||
+#include <netinet/if_ether.h>
|
||||
#include <linux/if_bridge.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
diff --git a/src/udev/net/ethtool-util.c b/src/udev/net/ethtool-util.c
|
||||
index 201fc2343..5f7cc2a0a 100644
|
||||
--- a/src/udev/net/ethtool-util.c
|
||||
+++ b/src/udev/net/ethtool-util.c
|
||||
@@ -16,7 +16,7 @@
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
***/
|
||||
-
|
||||
+#include <netinet/if_ether.h>
|
||||
#include <net/if.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <linux/ethtool.h>
|
||||
diff --git a/src/udev/udev-builtin-net_setup_link.c b/src/udev/udev-builtin-net_setup_link.c
|
||||
index 8e4777513..d01fff2a4 100644
|
||||
--- a/src/udev/udev-builtin-net_setup_link.c
|
||||
+++ b/src/udev/udev-builtin-net_setup_link.c
|
||||
@@ -16,7 +16,7 @@
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
***/
|
||||
-
|
||||
+#include <netinet/if_ether.h>
|
||||
#include "alloc-util.h"
|
||||
#include "link-config.h"
|
||||
#include "log.h"
|
||||
--
|
||||
2.14.2
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
From 05dffe67919ffc72be5c017bc6cf82f164b2e8f9 Mon Sep 17 00:00:00 2001
|
||||
From: Emil Renner Berthing <systemd@esmil.dk>
|
||||
Date: Mon, 23 Oct 2017 11:42:03 -0700
|
||||
Subject: [PATCH 07/12] check for missing canonicalize_file_name
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
Upstream-Status: Pending
|
||||
|
||||
configure.ac | 2 ++
|
||||
src/basic/missing.h | 1 +
|
||||
src/basic/missing_syscall.h | 6 ++++++
|
||||
3 files changed, 9 insertions(+)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index cd035a971..3674190fb 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -333,6 +333,7 @@ AC_CHECK_DECLS([
|
||||
renameat2,
|
||||
kcmp,
|
||||
keyctl,
|
||||
+ canonicalize_file_name,
|
||||
LO_FLAGS_PARTSCAN,
|
||||
copy_file_range,
|
||||
explicit_bzero],
|
||||
@@ -343,6 +344,7 @@ AC_CHECK_DECLS([
|
||||
#include <fcntl.h>
|
||||
#include <sched.h>
|
||||
#include <string.h>
|
||||
+#include <stdlib.h>
|
||||
#include <linux/loop.h>
|
||||
]])
|
||||
|
||||
diff --git a/src/basic/missing.h b/src/basic/missing.h
|
||||
index 671f341c6..8ae4964e1 100644
|
||||
--- a/src/basic/missing.h
|
||||
+++ b/src/basic/missing.h
|
||||
@@ -1246,3 +1246,4 @@ struct ethtool_link_settings {
|
||||
#endif
|
||||
|
||||
#include "missing_syscall.h"
|
||||
+
|
||||
diff --git a/src/basic/missing_syscall.h b/src/basic/missing_syscall.h
|
||||
index 898116c7b..4d44ee4fa 100644
|
||||
--- a/src/basic/missing_syscall.h
|
||||
+++ b/src/basic/missing_syscall.h
|
||||
@@ -28,6 +28,12 @@ static inline int pivot_root(const char *new_root, const char *put_old) {
|
||||
}
|
||||
#endif
|
||||
|
||||
+#if !HAVE_DECL_CANONICALIZE_FILE_NAME
|
||||
+static inline char *canonicalize_file_name(const char *path) {
|
||||
+ return realpath(path, NULL);
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
/* ======================================================================= */
|
||||
|
||||
#if !HAVE_DECL_MEMFD_CREATE
|
||||
--
|
||||
2.14.2
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
From 48e7c0f5b2f5d777a16ac5584dc4f50f1dfa832c Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Mon, 23 Oct 2017 12:27:53 -0700
|
||||
Subject: [PATCH 08/12] Do not enable nss tests
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
Upstream-Status: Pending
|
||||
|
||||
Makefile.am | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 3cc8f3451..df20a9a11 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -5290,6 +5290,7 @@ EXTRA_DIST += \
|
||||
src/timesync/timesyncd.conf.in
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
+if ENABLE_NSS_SYSTEMD
|
||||
test_nss_SOURCES = \
|
||||
src/test/test-nss.c
|
||||
|
||||
@@ -5302,7 +5303,6 @@ manual_tests += \
|
||||
test-nss
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
-if ENABLE_NSS_SYSTEMD
|
||||
libnss_systemd_la_SOURCES = \
|
||||
src/nss-systemd/nss-systemd.sym \
|
||||
src/nss-systemd/nss-systemd.c
|
||||
--
|
||||
2.14.2
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
From 75f4e7f167de533a160ee1af2a03fba4c5a5ffc6 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Mon, 23 Oct 2017 12:33:22 -0700
|
||||
Subject: [PATCH 09/12] test-hexdecoct.c: Include missing.h form strndupa
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
Upstream-Status: Pending
|
||||
|
||||
src/test/test-hexdecoct.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/test/test-hexdecoct.c b/src/test/test-hexdecoct.c
|
||||
index fcae427e7..5eb5e2ed7 100644
|
||||
--- a/src/test/test-hexdecoct.c
|
||||
+++ b/src/test/test-hexdecoct.c
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "hexdecoct.h"
|
||||
#include "macro.h"
|
||||
#include "string-util.h"
|
||||
+#include "missing.h"
|
||||
|
||||
static void test_hexchar(void) {
|
||||
assert_se(hexchar(0xa) == 'a');
|
||||
--
|
||||
2.14.2
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
From 6e9d2bcaa6f886b2384c1c35a04e4ebc148aea68 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Mon, 23 Oct 2017 12:40:25 -0700
|
||||
Subject: [PATCH 10/12] test-sizeof.c: Disable tests for missing typedefs in
|
||||
musl
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
Upstream-Status: Pending
|
||||
|
||||
src/test/test-sizeof.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/test/test-sizeof.c b/src/test/test-sizeof.c
|
||||
index 269adfd18..ba7855dff 100644
|
||||
--- a/src/test/test-sizeof.c
|
||||
+++ b/src/test/test-sizeof.c
|
||||
@@ -18,7 +18,6 @@
|
||||
***/
|
||||
|
||||
#include <stdio.h>
|
||||
-
|
||||
#include "time-util.h"
|
||||
|
||||
/* Print information about various types. Useful when diagnosing
|
||||
@@ -48,8 +47,10 @@ int main(void) {
|
||||
info(unsigned);
|
||||
info(long unsigned);
|
||||
info(long long unsigned);
|
||||
+#ifdef __GLIBC__
|
||||
info(__syscall_ulong_t);
|
||||
info(__syscall_slong_t);
|
||||
+#endif
|
||||
|
||||
info(float);
|
||||
info(double);
|
||||
@@ -59,7 +60,9 @@ int main(void) {
|
||||
info(ssize_t);
|
||||
info(time_t);
|
||||
info(usec_t);
|
||||
+#ifdef __GLIBC__
|
||||
info(__time_t);
|
||||
+#endif
|
||||
|
||||
info(enum Enum);
|
||||
info(enum BigEnum);
|
||||
--
|
||||
2.14.2
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
From 2eb45f5a0a8bfb8bdca084587ad28e5001f3cc4b Mon Sep 17 00:00:00 2001
|
||||
From: Emil Renner Berthing <systemd@esmil.dk>
|
||||
Date: Thu, 18 Sep 2014 15:24:56 +0200
|
||||
Subject: [PATCH 11/12] don't use glibc-specific qsort_r
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
Upstream-Status: Pending
|
||||
|
||||
src/hwdb/hwdb.c | 18 +++++++++++-------
|
||||
src/udev/udevadm-hwdb.c | 16 ++++++++++------
|
||||
2 files changed, 21 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/src/hwdb/hwdb.c b/src/hwdb/hwdb.c
|
||||
index 793398ca6..669b00818 100644
|
||||
--- a/src/hwdb/hwdb.c
|
||||
+++ b/src/hwdb/hwdb.c
|
||||
@@ -151,13 +151,12 @@ static void trie_free(struct trie *trie) {
|
||||
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(struct trie*, trie_free);
|
||||
|
||||
-static int trie_values_cmp(const void *v1, const void *v2, void *arg) {
|
||||
+static struct trie *trie_node_add_value_trie;
|
||||
+static int trie_values_cmp(const void *v1, const void *v2) {
|
||||
const struct trie_value_entry *val1 = v1;
|
||||
const struct trie_value_entry *val2 = v2;
|
||||
- struct trie *trie = arg;
|
||||
-
|
||||
- return strcmp(trie->strings->buf + val1->key_off,
|
||||
- trie->strings->buf + val2->key_off);
|
||||
+ return strcmp(trie_node_add_value_trie->strings->buf + val1->key_off,
|
||||
+ trie_node_add_value_trie->strings->buf + val2->key_off);
|
||||
}
|
||||
|
||||
static int trie_node_add_value(struct trie *trie, struct trie_node *node,
|
||||
@@ -182,7 +181,10 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
|
||||
.value_off = v,
|
||||
};
|
||||
|
||||
- val = xbsearch_r(&search, node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp, trie);
|
||||
+ trie_node_add_value_trie = trie;
|
||||
+ val = bsearch(&search, node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp);
|
||||
+ trie_node_add_value_trie = NULL;
|
||||
+
|
||||
if (val) {
|
||||
/* At this point we have 2 identical properties on the same match-string.
|
||||
* Since we process files in order, we just replace the previous value.
|
||||
@@ -207,7 +209,9 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
|
||||
node->values[node->values_count].file_priority = file_priority;
|
||||
node->values[node->values_count].line_number = line_number;
|
||||
node->values_count++;
|
||||
- qsort_r(node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp, trie);
|
||||
+ trie_node_add_value_trie = trie;
|
||||
+ qsort(node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp);
|
||||
+ trie_node_add_value_trie = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/src/udev/udevadm-hwdb.c b/src/udev/udevadm-hwdb.c
|
||||
index 69b0b9025..fbd213300 100644
|
||||
--- a/src/udev/udevadm-hwdb.c
|
||||
+++ b/src/udev/udevadm-hwdb.c
|
||||
@@ -128,13 +128,13 @@ static void trie_node_cleanup(struct trie_node *node) {
|
||||
free(node);
|
||||
}
|
||||
|
||||
-static int trie_values_cmp(const void *v1, const void *v2, void *arg) {
|
||||
+static struct trie *trie_node_add_value_trie;
|
||||
+static int trie_values_cmp(const void *v1, const void *v2) {
|
||||
const struct trie_value_entry *val1 = v1;
|
||||
const struct trie_value_entry *val2 = v2;
|
||||
- struct trie *trie = arg;
|
||||
|
||||
- return strcmp(trie->strings->buf + val1->key_off,
|
||||
- trie->strings->buf + val2->key_off);
|
||||
+ return strcmp(trie_node_add_value_trie->strings->buf + val1->key_off,
|
||||
+ trie_node_add_value_trie->strings->buf + val2->key_off);
|
||||
}
|
||||
|
||||
static int trie_node_add_value(struct trie *trie, struct trie_node *node,
|
||||
@@ -155,7 +155,9 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
|
||||
.value_off = v,
|
||||
};
|
||||
|
||||
- val = xbsearch_r(&search, node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp, trie);
|
||||
+ trie_node_add_value_trie = trie;
|
||||
+ val = bsearch(&search, node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp);
|
||||
+ trie_node_add_value_trie = NULL;
|
||||
if (val) {
|
||||
/* replace existing earlier key with new value */
|
||||
val->value_off = v;
|
||||
@@ -172,7 +174,9 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
|
||||
node->values[node->values_count].key_off = k;
|
||||
node->values[node->values_count].value_off = v;
|
||||
node->values_count++;
|
||||
- qsort_r(node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp, trie);
|
||||
+ trie_node_add_value_trie = trie;
|
||||
+ qsort(node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp);
|
||||
+ trie_node_add_value_trie = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
--
|
||||
2.14.2
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
From 9621618c701a2d5eb3e26f40c68354d4dfb8f872 Mon Sep 17 00:00:00 2001
|
||||
From: Andre McCurdy <armccurdy@gmail.com>
|
||||
Date: Tue, 10 Oct 2017 14:33:30 -0700
|
||||
Subject: [PATCH 12/12] don't pass AT_SYMLINK_NOFOLLOW flag to faccessat()
|
||||
|
||||
Avoid using AT_SYMLINK_NOFOLLOW flag. It doesn't seem like the right
|
||||
thing to do and it's not portable (not supported by musl). See:
|
||||
|
||||
http://lists.landley.net/pipermail/toybox-landley.net/2014-September/003610.html
|
||||
http://www.openwall.com/lists/musl/2015/02/05/2
|
||||
|
||||
Note that laccess() is never passing AT_EACCESS so a lot of the
|
||||
discussion in the links above doesn't apply. Note also that
|
||||
(currently) all systemd callers of laccess() pass mode as F_OK, so
|
||||
only check for existence of a file, not access permissions.
|
||||
Therefore, in this case, the only distiction between faccessat()
|
||||
with (flag == 0) and (flag == AT_SYMLINK_NOFOLLOW) is the behaviour
|
||||
for broken symlinks; laccess() on a broken symlink will succeed with
|
||||
(flag == AT_SYMLINK_NOFOLLOW) and fail (flag == 0).
|
||||
|
||||
The laccess() macros was added to systemd some time ago and it's not
|
||||
clear if or why it needs to return success for broken symlinks. Maybe
|
||||
just historical and not actually necessary or desired behaviour?
|
||||
|
||||
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
|
||||
---
|
||||
Upstream-Status: Pending
|
||||
|
||||
src/basic/fs-util.h | 22 +++++++++++++++++++++-
|
||||
src/shared/base-filesystem.c | 6 +++---
|
||||
2 files changed, 24 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/basic/fs-util.h b/src/basic/fs-util.h
|
||||
index 094acf179..cdbc0ae72 100644
|
||||
--- a/src/basic/fs-util.h
|
||||
+++ b/src/basic/fs-util.h
|
||||
@@ -48,7 +48,27 @@ int fchmod_umask(int fd, mode_t mode);
|
||||
|
||||
int fd_warn_permissions(const char *path, int fd);
|
||||
|
||||
-#define laccess(path, mode) faccessat(AT_FDCWD, (path), (mode), AT_SYMLINK_NOFOLLOW)
|
||||
+/*
|
||||
+ Avoid using AT_SYMLINK_NOFOLLOW flag. It doesn't seem like the right thing to
|
||||
+ do and it's not portable (not supported by musl). See:
|
||||
+
|
||||
+ http://lists.landley.net/pipermail/toybox-landley.net/2014-September/003610.html
|
||||
+ http://www.openwall.com/lists/musl/2015/02/05/2
|
||||
+
|
||||
+ Note that laccess() is never passing AT_EACCESS so a lot of the discussion in
|
||||
+ the links above doesn't apply. Note also that (currently) all systemd callers
|
||||
+ of laccess() pass mode as F_OK, so only check for existence of a file, not
|
||||
+ access permissions. Therefore, in this case, the only distiction between
|
||||
+ faccessat() with (flag == 0) and (flag == AT_SYMLINK_NOFOLLOW) is the
|
||||
+ behaviour for broken symlinks; laccess() on a broken symlink will succeed
|
||||
+ with (flag == AT_SYMLINK_NOFOLLOW) and fail (flag == 0).
|
||||
+
|
||||
+ The laccess() macros was added to systemd some time ago and it's not clear if
|
||||
+ or why it needs to return success for broken symlinks. Maybe just historical
|
||||
+ and not actually necessary or desired behaviour?
|
||||
+*/
|
||||
+
|
||||
+#define laccess(path, mode) faccessat(AT_FDCWD, (path), (mode), 0)
|
||||
|
||||
int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode);
|
||||
int touch(const char *path);
|
||||
diff --git a/src/shared/base-filesystem.c b/src/shared/base-filesystem.c
|
||||
index 903a18786..2f6052ee7 100644
|
||||
--- a/src/shared/base-filesystem.c
|
||||
+++ b/src/shared/base-filesystem.c
|
||||
@@ -70,7 +70,7 @@ int base_filesystem_create(const char *root, uid_t uid, gid_t gid) {
|
||||
return log_error_errno(errno, "Failed to open root file system: %m");
|
||||
|
||||
for (i = 0; i < ELEMENTSOF(table); i ++) {
|
||||
- if (faccessat(fd, table[i].dir, F_OK, AT_SYMLINK_NOFOLLOW) >= 0)
|
||||
+ if (faccessat(fd, table[i].dir, F_OK, 0) >= 0)
|
||||
continue;
|
||||
|
||||
if (table[i].target) {
|
||||
@@ -78,7 +78,7 @@ int base_filesystem_create(const char *root, uid_t uid, gid_t gid) {
|
||||
|
||||
/* check if one of the targets exists */
|
||||
NULSTR_FOREACH(s, table[i].target) {
|
||||
- if (faccessat(fd, s, F_OK, AT_SYMLINK_NOFOLLOW) < 0)
|
||||
+ if (faccessat(fd, s, F_OK, 0) < 0)
|
||||
continue;
|
||||
|
||||
/* check if a specific file exists at the target path */
|
||||
@@ -89,7 +89,7 @@ int base_filesystem_create(const char *root, uid_t uid, gid_t gid) {
|
||||
if (!p)
|
||||
return log_oom();
|
||||
|
||||
- if (faccessat(fd, p, F_OK, AT_SYMLINK_NOFOLLOW) < 0)
|
||||
+ if (faccessat(fd, p, F_OK, 0) < 0)
|
||||
continue;
|
||||
}
|
||||
|
||||
--
|
||||
2.14.2
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
From 4b6733544beb662a0f77310302fae1fb7b76d167 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Sat, 12 Sep 2015 18:53:31 +0000
|
||||
Subject: [PATCH 13/13] comparison_fn_t is glibc specific, use raw signature in
|
||||
function pointer
|
||||
|
||||
make it work with musl where comparison_fn_t is not provided
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
Upstream-Status: Pending
|
||||
|
||||
src/basic/util.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/basic/util.h b/src/basic/util.h
|
||||
index c7da6c39b..87f62b891 100644
|
||||
--- a/src/basic/util.h
|
||||
+++ b/src/basic/util.h
|
||||
@@ -98,7 +98,7 @@ void *xbsearch_r(const void *key, const void *base, size_t nmemb, size_t size,
|
||||
* Normal qsort requires base to be nonnull. Here were require
|
||||
* that only if nmemb > 0.
|
||||
*/
|
||||
-static inline void qsort_safe(void *base, size_t nmemb, size_t size, comparison_fn_t compar) {
|
||||
+static inline void qsort_safe(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)) {
|
||||
if (nmemb <= 1)
|
||||
return;
|
||||
|
||||
--
|
||||
2.14.2
|
||||
|
||||
@@ -10,7 +10,7 @@ SECTION = "base/shell"
|
||||
|
||||
inherit useradd pkgconfig autotools perlnative update-rc.d update-alternatives qemu systemd ptest gettext bash-completion manpages
|
||||
|
||||
SRC_URI += " \
|
||||
SRC_URI = "git://github.com/systemd/systemd.git;protocol=git \
|
||||
file://touchscreen.rules \
|
||||
file://00-create-volatile.conf \
|
||||
file://init \
|
||||
@@ -27,6 +27,20 @@ SRC_URI += " \
|
||||
file://0017-remove-duplicate-include-uchar.h.patch \
|
||||
file://0018-check-for-uchar.h-in-configure.patch \
|
||||
file://0019-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch \
|
||||
file://0001-add-fallback-parse_printf_format-implementation.patch \
|
||||
file://0002-src-basic-missing.h-check-for-missing-strndupa.patch \
|
||||
file://0003-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch \
|
||||
file://0004-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch \
|
||||
file://0006-Include-netinet-if_ether.h.patch \
|
||||
file://0007-check-for-missing-canonicalize_file_name.patch \
|
||||
file://0008-Do-not-enable-nss-tests.patch \
|
||||
file://0009-test-hexdecoct.c-Include-missing.h-form-strndupa.patch \
|
||||
file://0010-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch \
|
||||
file://0011-don-t-use-glibc-specific-qsort_r.patch \
|
||||
file://0012-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch \
|
||||
file://0013-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch \
|
||||
file://0001-Define-_PATH_WTMPX-and-_PATH_UTMPX-if-not-defined.patch \
|
||||
file://0001-Use-uintmax_t-for-handling-rlim_t.patch \
|
||||
"
|
||||
SRC_URI_append_qemuall = " file://0001-core-device.c-Change-the-default-device-timeout-to-2.patch"
|
||||
|
||||
@@ -36,97 +50,117 @@ PAM_PLUGINS = " \
|
||||
pam-plugin-keyinit \
|
||||
"
|
||||
|
||||
PACKAGECONFIG ??= "xz \
|
||||
${@bb.utils.filter('DISTRO_FEATURES', 'efi pam selinux ldconfig usrmerge', d)} \
|
||||
${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \
|
||||
${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \
|
||||
binfmt \
|
||||
randomseed \
|
||||
machined \
|
||||
backlight \
|
||||
vconsole \
|
||||
quotacheck \
|
||||
hostnamed \
|
||||
${@bb.utils.contains('TCLIBC', 'glibc', 'myhostname sysusers', '', d)} \
|
||||
hibernate \
|
||||
timedated \
|
||||
timesyncd \
|
||||
localed \
|
||||
ima \
|
||||
smack \
|
||||
logind \
|
||||
firstboot \
|
||||
utmp \
|
||||
polkit \
|
||||
resolved \
|
||||
networkd \
|
||||
PACKAGECONFIG ??= " \
|
||||
${@bb.utils.filter('DISTRO_FEATURES', 'efi ldconfig pam selinux usrmerge', d)} \
|
||||
${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \
|
||||
${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \
|
||||
backlight \
|
||||
binfmt \
|
||||
firstboot \
|
||||
hibernate \
|
||||
hostnamed \
|
||||
ima \
|
||||
localed \
|
||||
logind \
|
||||
machined \
|
||||
myhostname \
|
||||
networkd \
|
||||
nss \
|
||||
polkit \
|
||||
quotacheck \
|
||||
randomseed \
|
||||
resolved \
|
||||
smack \
|
||||
sysusers \
|
||||
timedated \
|
||||
timesyncd \
|
||||
utmp \
|
||||
vconsole \
|
||||
xz \
|
||||
"
|
||||
|
||||
PACKAGECONFIG_remove_libc-musl = " \
|
||||
localed \
|
||||
myhostname \
|
||||
nss \
|
||||
resolved \
|
||||
selinux \
|
||||
smack \
|
||||
sysusers \
|
||||
utmp \
|
||||
"
|
||||
PACKAGECONFIG_remove_libc-musl = "selinux"
|
||||
PACKAGECONFIG_remove_libc-musl = "smack"
|
||||
|
||||
# Use the upstream systemd serial-getty@.service and rely on
|
||||
# systemd-getty-generator instead of using the OE-core specific
|
||||
# systemd-serialgetty.bb - not enabled by default.
|
||||
PACKAGECONFIG[serial-getty-generator] = ""
|
||||
|
||||
PACKAGECONFIG[journal-upload] = "--enable-libcurl,--disable-libcurl,curl"
|
||||
PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit"
|
||||
PACKAGECONFIG[backlight] = "--enable-backlight,--disable-backlight"
|
||||
PACKAGECONFIG[binfmt] = "--enable-binfmt,--disable-binfmt"
|
||||
PACKAGECONFIG[bzip2] = "--enable-bzip2,--disable-bzip2,bzip2"
|
||||
PACKAGECONFIG[coredump] = "--enable-coredump,--disable-coredump"
|
||||
PACKAGECONFIG[cryptsetup] = "--enable-libcryptsetup,--disable-libcryptsetup,cryptsetup"
|
||||
PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus"
|
||||
PACKAGECONFIG[efi] = "--enable-efi,--disable-efi"
|
||||
PACKAGECONFIG[elfutils] = "--enable-elfutils,--disable-elfutils,elfutils"
|
||||
PACKAGECONFIG[firstboot] = "--enable-firstboot,--disable-firstboot"
|
||||
# Sign the journal for anti-tampering
|
||||
PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt"
|
||||
PACKAGECONFIG[cryptsetup] = "--enable-libcryptsetup,--disable-libcryptsetup,cryptsetup"
|
||||
PACKAGECONFIG[microhttpd] = "--enable-microhttpd,--disable-microhttpd,libmicrohttpd"
|
||||
PACKAGECONFIG[elfutils] = "--enable-elfutils,--disable-elfutils,elfutils"
|
||||
PACKAGECONFIG[resolved] = "--enable-resolved,--disable-resolved"
|
||||
PACKAGECONFIG[networkd] = "--enable-networkd,--disable-networkd"
|
||||
PACKAGECONFIG[machined] = "--enable-machined,--disable-machined"
|
||||
PACKAGECONFIG[backlight] = "--enable-backlight,--disable-backlight"
|
||||
PACKAGECONFIG[vconsole] = "--enable-vconsole,--disable-vconsole,,${PN}-vconsole-setup"
|
||||
PACKAGECONFIG[quotacheck] = "--enable-quotacheck,--disable-quotacheck"
|
||||
PACKAGECONFIG[hostnamed] = "--enable-hostnamed,--disable-hostnamed"
|
||||
PACKAGECONFIG[myhostname] = "--enable-myhostname,--disable-myhostname"
|
||||
PACKAGECONFIG[rfkill] = "--enable-rfkill,--disable-rfkill"
|
||||
PACKAGECONFIG[hibernate] = "--enable-hibernate,--disable-hibernate"
|
||||
PACKAGECONFIG[timedated] = "--enable-timedated,--disable-timedated"
|
||||
PACKAGECONFIG[timesyncd] = "--enable-timesyncd,--disable-timesyncd"
|
||||
PACKAGECONFIG[localed] = "--enable-localed,--disable-localed"
|
||||
PACKAGECONFIG[efi] = "--enable-efi,--disable-efi"
|
||||
PACKAGECONFIG[hostnamed] = "--enable-hostnamed,--disable-hostnamed"
|
||||
PACKAGECONFIG[ima] = "--enable-ima,--disable-ima"
|
||||
PACKAGECONFIG[smack] = "--enable-smack,--disable-smack"
|
||||
# libseccomp is found in meta-security
|
||||
PACKAGECONFIG[seccomp] = "--enable-seccomp,--disable-seccomp,libseccomp"
|
||||
PACKAGECONFIG[logind] = "--enable-logind,--disable-logind"
|
||||
PACKAGECONFIG[sysusers] = "--enable-sysusers,--disable-sysusers"
|
||||
PACKAGECONFIG[firstboot] = "--enable-firstboot,--disable-firstboot"
|
||||
PACKAGECONFIG[randomseed] = "--enable-randomseed,--disable-randomseed"
|
||||
PACKAGECONFIG[binfmt] = "--enable-binfmt,--disable-binfmt"
|
||||
PACKAGECONFIG[utmp] = "--enable-utmp,--disable-utmp"
|
||||
PACKAGECONFIG[polkit] = "--enable-polkit,--disable-polkit"
|
||||
# importd requires curl/xz/zlib/bzip2/gcrypt
|
||||
PACKAGECONFIG[importd] = "--enable-importd,--disable-importd"
|
||||
PACKAGECONFIG[libidn] = "--enable-libidn,--disable-libidn,libidn"
|
||||
PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit"
|
||||
PACKAGECONFIG[manpages] = "--enable-manpages,--disable-manpages,libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
|
||||
PACKAGECONFIG[pam] = "--enable-pam,--disable-pam,libpam,${PAM_PLUGINS}"
|
||||
# Verify keymaps on locale change
|
||||
PACKAGECONFIG[xkbcommon] = "--enable-xkbcommon,--disable-xkbcommon,libxkbcommon"
|
||||
# Update NAT firewall rules
|
||||
PACKAGECONFIG[iptc] = "--enable-libiptc,--disable-libiptc,iptables"
|
||||
PACKAGECONFIG[ldconfig] = "--enable-ldconfig,--disable-ldconfig,,"
|
||||
PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,initscripts-sushell"
|
||||
PACKAGECONFIG[valgrind] = "ac_cv_header_valgrind_memcheck_h=yes ac_cv_header_valgrind_valgrind_h=yes ,ac_cv_header_valgrind_memcheck_h=no ac_cv_header_valgrind_valgrind_h=no ,valgrind"
|
||||
PACKAGECONFIG[qrencode] = "--enable-qrencode,--disable-qrencode,qrencode"
|
||||
PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus"
|
||||
PACKAGECONFIG[coredump] = "--enable-coredump,--disable-coredump"
|
||||
PACKAGECONFIG[bzip2] = "--enable-bzip2,--disable-bzip2,bzip2"
|
||||
PACKAGECONFIG[journal-upload] = "--enable-libcurl,--disable-libcurl,curl"
|
||||
PACKAGECONFIG[ldconfig] = "--enable-ldconfig,--disable-ldconfig"
|
||||
PACKAGECONFIG[libidn] = "--enable-libidn,--disable-libidn,libidn"
|
||||
PACKAGECONFIG[localed] = "--enable-localed,--disable-localed"
|
||||
PACKAGECONFIG[logind] = "--enable-logind,--disable-logind"
|
||||
PACKAGECONFIG[lz4] = "--enable-lz4,--disable-lz4,lz4"
|
||||
PACKAGECONFIG[machined] = "--enable-machined,--disable-machined"
|
||||
PACKAGECONFIG[manpages] = "--enable-manpages,--disable-manpages,libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
|
||||
PACKAGECONFIG[microhttpd] = "--enable-microhttpd,--disable-microhttpd,libmicrohttpd"
|
||||
PACKAGECONFIG[myhostname] = "--enable-myhostname,--disable-myhostname"
|
||||
PACKAGECONFIG[networkd] = "--enable-networkd,--disable-networkd"
|
||||
PACKAGECONFIG[nss] = "--enable-nss-systemd,--disable-nss-systemd"
|
||||
PACKAGECONFIG[pam] = "--enable-pam,--disable-pam,libpam,${PAM_PLUGINS}"
|
||||
PACKAGECONFIG[polkit] = "--enable-polkit,--disable-polkit"
|
||||
PACKAGECONFIG[qrencode] = "--enable-qrencode,--disable-qrencode,qrencode"
|
||||
PACKAGECONFIG[quotacheck] = "--enable-quotacheck,--disable-quotacheck"
|
||||
PACKAGECONFIG[randomseed] = "--enable-randomseed,--disable-randomseed"
|
||||
PACKAGECONFIG[resolved] = "--enable-resolved,--disable-resolved"
|
||||
PACKAGECONFIG[rfkill] = "--enable-rfkill,--disable-rfkill"
|
||||
# libseccomp is found in meta-security
|
||||
PACKAGECONFIG[seccomp] = "--enable-seccomp,--disable-seccomp,libseccomp"
|
||||
PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,initscripts-sushell"
|
||||
PACKAGECONFIG[smack] = "--enable-smack,--disable-smack"
|
||||
PACKAGECONFIG[sysusers] = "--enable-sysusers,--disable-sysusers"
|
||||
PACKAGECONFIG[timedated] = "--enable-timedated,--disable-timedated"
|
||||
PACKAGECONFIG[timesyncd] = "--enable-timesyncd,--disable-timesyncd"
|
||||
PACKAGECONFIG[usrmerge] = "--disable-split-usr,--enable-split-usr"
|
||||
PACKAGECONFIG[utmp] = "--enable-utmp,--disable-utmp"
|
||||
PACKAGECONFIG[valgrind] = "ac_cv_header_valgrind_memcheck_h=yes ac_cv_header_valgrind_valgrind_h=yes,ac_cv_header_valgrind_memcheck_h=no ac_cv_header_valgrind_valgrind_h=no,valgrind"
|
||||
PACKAGECONFIG[vconsole] = "--enable-vconsole,--disable-vconsole,,${PN}-vconsole-setup"
|
||||
# Verify keymaps on locale change
|
||||
PACKAGECONFIG[xkbcommon] = "--enable-xkbcommon,--disable-xkbcommon,libxkbcommon"
|
||||
PACKAGECONFIG[xz] = "--enable-xz,--disable-xz,xz"
|
||||
PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib"
|
||||
PACKAGECONFIG[usrmerge] = "--disable-split-usr, --enable-split-usr"
|
||||
|
||||
CACHED_CONFIGUREVARS += "ac_cv_path_KILL=${base_bindir}/kill"
|
||||
CACHED_CONFIGUREVARS += "ac_cv_path_KMOD=${base_bindir}/kmod"
|
||||
CACHED_CONFIGUREVARS += "ac_cv_path_QUOTACHECK=${sbindir}/quotacheck"
|
||||
CACHED_CONFIGUREVARS += "ac_cv_path_QUOTAON=${sbindir}/quotaon"
|
||||
CACHED_CONFIGUREVARS += "ac_cv_path_SULOGIN=${base_sbindir}/sulogin"
|
||||
# Hardcode target binary paths to avoid AC_PROG_PATH in the systemd
|
||||
# configure script detecting and setting paths from sysroot or host.
|
||||
CACHED_CONFIGUREVARS_class-target = " \
|
||||
ac_cv_path_KEXEC=${sbindir}/kexec \
|
||||
ac_cv_path_KILL=${base_bindir}/kill \
|
||||
ac_cv_path_KMOD=${base_bindir}/kmod \
|
||||
ac_cv_path_MOUNT_PATH=${base_bindir}/mount \
|
||||
ac_cv_path_QUOTACHECK=${sbindir}/quotacheck \
|
||||
ac_cv_path_QUOTAON=${sbindir}/quotaon \
|
||||
ac_cv_path_SULOGIN=${base_sbindir}/sulogin \
|
||||
ac_cv_path_UMOUNT_PATH=${base_bindir}/umount \
|
||||
"
|
||||
|
||||
# Helper variables to clarify locations. This mirrors the logic in systemd's
|
||||
# build system.
|
||||
@@ -134,33 +168,21 @@ rootprefix ?= "${root_prefix}"
|
||||
rootlibdir ?= "${base_libdir}"
|
||||
rootlibexecdir = "${rootprefix}/lib"
|
||||
|
||||
CACHED_CONFIGUREVARS_class-target = "\
|
||||
ac_cv_path_MOUNT_PATH=${base_bindir}/mount \
|
||||
ac_cv_path_UMOUNT_PATH=${base_bindir}/umount \
|
||||
ac_cv_path_KMOD=${base_bindir}/kmod \
|
||||
ac_cv_path_KILL=${base_bindir}/kill \
|
||||
ac_cv_path_SULOGIN=${base_sbindir}/sulogin \
|
||||
ac_cv_path_KEXEC=${sbindir}/kexec \
|
||||
ac_cv_path_QUOTACHECK=${sbindir}/quotacheck \
|
||||
ac_cv_path_QUOTAON=${sbindir}/quotaon \
|
||||
"
|
||||
EXTRA_OECONF = " \
|
||||
--without-python \
|
||||
--with-roothomedir=${ROOT_HOME} \
|
||||
--with-rootlibdir=${rootlibdir} \
|
||||
--with-rootprefix=${rootprefix} \
|
||||
--with-sysvrcnd-path=${sysconfdir} \
|
||||
--with-firmware-path=${nonarch_base_libdir}/firmware \
|
||||
"
|
||||
|
||||
EXTRA_OECONF = " --with-rootprefix=${rootprefix} \
|
||||
--with-rootlibdir=${rootlibdir} \
|
||||
--with-roothomedir=${ROOT_HOME} \
|
||||
--without-python \
|
||||
--with-sysvrcnd-path=${sysconfdir} \
|
||||
--with-firmware-path=${nonarch_base_libdir}/firmware \
|
||||
"
|
||||
# per the systemd README, define VALGRIND=1 to run under valgrind
|
||||
CFLAGS .= "${@bb.utils.contains('PACKAGECONFIG', 'valgrind', ' -DVALGRIND=1', '', d)}"
|
||||
|
||||
# disable problematic GCC 5.2 optimizations [YOCTO #8291]
|
||||
FULL_OPTIMIZATION_append_arm = " -fno-schedule-insns -fno-schedule-insns2"
|
||||
|
||||
# Avoid login failure on qemumips64 when pam is enabled
|
||||
FULL_OPTIMIZATION_append_mips64 = " -fno-tree-switch-conversion -fno-tree-tail-merge"
|
||||
|
||||
COMPILER_NM ?= "${HOST_PREFIX}gcc-nm"
|
||||
COMPILER_AR ?= "${HOST_PREFIX}gcc-ar"
|
||||
COMPILER_RANLIB ?= "${HOST_PREFIX}gcc-ranlib"
|
||||
@@ -195,7 +217,6 @@ do_install() {
|
||||
# 20:12 < mezcalero> koen: you have three options: a) run systemd-machine-id-setup at install time, b) have / read-only and an empty file there (for stateless) and c) boot with / writable
|
||||
touch ${D}${sysconfdir}/machine-id
|
||||
|
||||
|
||||
install -d ${D}${sysconfdir}/udev/rules.d/
|
||||
install -d ${D}${sysconfdir}/tmpfiles.d
|
||||
install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/
|
||||
@@ -251,39 +272,39 @@ do_install() {
|
||||
fi
|
||||
install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${systemd_unitdir}/systemd-sysv-install
|
||||
|
||||
# If polkit is setup fixup permissions and ownership
|
||||
if [ "${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'polkit', '', d)}" = "polkit" ] ; then
|
||||
if [ -d ${D}${datadir}/polkit-1/rules.d ] ; then
|
||||
chmod 700 ${D}${datadir}/polkit-1/rules.d
|
||||
chown polkitd:root ${D}${datadir}/polkit-1/rules.d
|
||||
fi
|
||||
fi
|
||||
# If polkit is setup fixup permissions and ownership
|
||||
if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then
|
||||
if [ -d ${D}${datadir}/polkit-1/rules.d ]; then
|
||||
chmod 700 ${D}${datadir}/polkit-1/rules.d
|
||||
chown polkitd:root ${D}${datadir}/polkit-1/rules.d
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
do_install_ptest () {
|
||||
# install data files needed for tests
|
||||
install -d ${D}${PTEST_PATH}/tests/test
|
||||
cp -rfL ${S}/test/* ${D}${PTEST_PATH}/tests/test
|
||||
# python is disabled for systemd, thus removing these python testing scripts
|
||||
rm ${D}${PTEST_PATH}/tests/test/*.py
|
||||
sed -i 's/"tree"/"ls"/' ${D}${PTEST_PATH}/tests/test/udev-test.pl
|
||||
# install data files needed for tests
|
||||
install -d ${D}${PTEST_PATH}/tests/test
|
||||
cp -rfL ${S}/test/* ${D}${PTEST_PATH}/tests/test
|
||||
# python is disabled for systemd, thus removing these python testing scripts
|
||||
rm ${D}${PTEST_PATH}/tests/test/*.py
|
||||
sed -i 's/"tree"/"ls"/' ${D}${PTEST_PATH}/tests/test/udev-test.pl
|
||||
|
||||
install -d ${D}${PTEST_PATH}/tests/catalog
|
||||
install ${S}/catalog/* ${D}${PTEST_PATH}/tests/catalog/
|
||||
install -d ${D}${PTEST_PATH}/tests/catalog
|
||||
install ${S}/catalog/* ${D}${PTEST_PATH}/tests/catalog/
|
||||
|
||||
install -D ${S}/build-aux/test-driver ${D}${PTEST_PATH}/tests/build-aux/test-driver
|
||||
install -D ${S}/build-aux/test-driver ${D}${PTEST_PATH}/tests/build-aux/test-driver
|
||||
|
||||
install -d ${D}${PTEST_PATH}/tests/rules
|
||||
install ${B}/rules/* ${D}${PTEST_PATH}/tests/rules/
|
||||
install -d ${D}${PTEST_PATH}/tests/rules
|
||||
install ${B}/rules/* ${D}${PTEST_PATH}/tests/rules/
|
||||
|
||||
# This directory needs to be there for udev-test.pl to work.
|
||||
install -d ${D}${libdir}/udev/rules.d
|
||||
# This directory needs to be there for udev-test.pl to work.
|
||||
install -d ${D}${libdir}/udev/rules.d
|
||||
|
||||
# install actual test binaries
|
||||
install -m 0755 ${B}/test-* ${D}${PTEST_PATH}/tests/
|
||||
install -m 0755 ${B}/.libs/test-* ${D}${PTEST_PATH}/tests/
|
||||
# install actual test binaries
|
||||
install -m 0755 ${B}/test-* ${D}${PTEST_PATH}/tests/
|
||||
install -m 0755 ${B}/.libs/test-* ${D}${PTEST_PATH}/tests/
|
||||
|
||||
install ${B}/Makefile ${D}${PTEST_PATH}/tests/
|
||||
install ${B}/Makefile ${D}${PTEST_PATH}/tests/
|
||||
}
|
||||
|
||||
python populate_packages_prepend (){
|
||||
@@ -615,8 +636,4 @@ pkg_prerm_udev-hwdb () {
|
||||
python () {
|
||||
if not bb.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
|
||||
raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES")
|
||||
|
||||
import re
|
||||
if re.match('.*musl*', d.getVar('TARGET_OS')) != None:
|
||||
raise bb.parse.SkipPackage("Not _yet_ supported on musl based targets")
|
||||
}
|
||||
|
||||
@@ -304,7 +304,7 @@ python populate_packages_prepend() {
|
||||
}
|
||||
|
||||
RDEPENDS_${PN}-bash-completion += "util-linux-lsblk"
|
||||
RDEPENDS_${PN}-ptest = "bash grep coreutils"
|
||||
RDEPENDS_${PN}-ptest = "bash grep coreutils which util-linux-blkid util-linux-fsck btrfs-tools"
|
||||
|
||||
do_compile_ptest() {
|
||||
oe_runmake buildtest-TESTS
|
||||
@@ -312,23 +312,30 @@ do_compile_ptest() {
|
||||
|
||||
do_install_ptest() {
|
||||
mkdir -p ${D}${PTEST_PATH}/tests/ts
|
||||
find . -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \;
|
||||
cp ${S}/tests/functions.sh ${D}${PTEST_PATH}/tests/
|
||||
cp ${S}/tests/commands.sh ${D}${PTEST_PATH}/tests/
|
||||
cp ${S}/tests/run.sh ${D}${PTEST_PATH}/tests/
|
||||
cp -pR ${S}/tests/expected ${D}${PTEST_PATH}/tests/expected
|
||||
find . -name 'test*' -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \;
|
||||
find ./.libs -name 'sample*' -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \;
|
||||
find ./.libs -name 'test*' -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \;
|
||||
|
||||
list="bitops build-sys cal col colrm column dmesg fsck hexdump hwclock ipcs isosize login look md5 misc more namei paths schedutils script swapon"
|
||||
# The following tests are not installed yet:
|
||||
# blkid scsi_debug module dependent
|
||||
# cramfs gcc dependent
|
||||
# eject gcc dependent
|
||||
# fdisk scsi_debug module and gcc dependent
|
||||
# lscpu gcc dependant
|
||||
# libmount uuidgen dependent
|
||||
# mount gcc dependant
|
||||
# partx blkid dependant
|
||||
for d in $list; do
|
||||
cp -pR ${S}/tests/ts/$d ${D}${PTEST_PATH}/tests/ts/
|
||||
done
|
||||
cp ${S}/tests/*.sh ${D}${PTEST_PATH}/tests/
|
||||
cp -pR ${S}/tests/expected ${D}${PTEST_PATH}/tests/expected
|
||||
cp -pR ${S}/tests/ts ${D}${PTEST_PATH}/tests/
|
||||
cp ${WORKDIR}/build/config.h ${D}${PTEST_PATH}
|
||||
|
||||
# The original paths of executables to be tested point to a local folder containing
|
||||
# the executables. We want to test the installed executables, not the local copies.
|
||||
# So strip the paths, the executables will be located via "which"
|
||||
sed -i \
|
||||
-e '/^TS_CMD/ s|$top_builddir/||g' \
|
||||
-e '/^TS_HELPER/ s|$top_builddir|${PTEST_PATH}|g' \
|
||||
${D}${PTEST_PATH}/tests/commands.sh
|
||||
|
||||
# Change 'if [ ! -x "$1" ]' to 'if [ ! -x "`which $1 2>/dev/null`"]'
|
||||
sed -i -e \
|
||||
'/^\tif[[:space:]]\[[[:space:]]![[:space:]]-x[[:space:]]"$1"/s|$1|`which $1 2>/dev/null`|g' \
|
||||
${D}${PTEST_PATH}/tests/functions.sh
|
||||
|
||||
# "kill -L" behaves differently than "/bin/kill -L" so we need an additional fix
|
||||
sed -i -e \
|
||||
'/^TS_CMD_KILL/ s|kill|/bin/kill|g' \
|
||||
${D}${PTEST_PATH}/tests/commands.sh
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
require dpkg.inc
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
|
||||
|
||||
SRC_URI = "${DEBIAN_MIRROR}/main/d/${BPN}/${BPN}_${PV}.tar.xz \
|
||||
SRC_URI = "http://snapshot.debian.org/archive/debian/20170518T093838Z/pool/main/d/dpkg/dpkg_1.18.24.tar.xz \
|
||||
file://noman.patch \
|
||||
file://remove-tar-no-timestamp.patch \
|
||||
file://arch_pm.patch \
|
||||
|
||||
@@ -109,4 +109,9 @@ do_install_ptest() {
|
||||
cp -R --no-dereference --preserve=mode,links -v ${B}/tests ${D}${PTEST_PATH}/test
|
||||
cp -R --no-dereference --preserve=mode,links -v ${S}/tests/* ${D}${PTEST_PATH}/test
|
||||
sed -e 's!../e2fsck/e2fsck!e2fsck!g' -i ${D}${PTEST_PATH}/test/*/expect*
|
||||
|
||||
# Remove various files
|
||||
find "${D}${PTEST_PATH}" -type f \
|
||||
\( -name 'Makefile' -o -name 'Makefile.in' -o -name '*.o' -o -name '*.c' -o -name '*.h' \)\
|
||||
-exec rm -f {} +
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ SRC_URI += "\
|
||||
file://0005-fix-a-stack-usage-warning.patch \
|
||||
file://0006-Fix-build-on-aarch64-musl.patch \
|
||||
file://0007-Fix-control-path-where-we-have-str-as-uninitialized-.patch \
|
||||
file://0001-libasm-may-link-with-libbz2-if-found.patch \
|
||||
"
|
||||
SRC_URI_append_libc-musl = " file://0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch"
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
From 7672e363468271b4c63ff58770c5aac15ab8f722 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Wed, 4 Oct 2017 22:30:46 -0700
|
||||
Subject: [PATCH] libasm may link with libbz2 if found
|
||||
|
||||
This can fail to link binaries like objdump
|
||||
where indirect libraries may be not found by linker
|
||||
|
||||
| /mnt/a/oe/build/tmp/work/riscv64-bec-linux/elfutils/0.170-r0/recipe-sysroot/usr/lib/libbz2.so.1: error adding symbols: DSO missing from command line
|
||||
| collect2: error: ld returned 1 exit status
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
Upstream-Status: Pending
|
||||
|
||||
src/Makefile.am | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/Makefile.am b/src/Makefile.am
|
||||
index e03bc32..9b7e853 100644
|
||||
--- a/src/Makefile.am
|
||||
+++ b/src/Makefile.am
|
||||
@@ -39,11 +39,11 @@ EXTRA_DIST += make-debug-archive.in
|
||||
CLEANFILES += make-debug-archive
|
||||
|
||||
if BUILD_STATIC
|
||||
-libasm = ../libasm/libasm.a
|
||||
+libasm = ../libasm/libasm.a $(zip_LIBS)
|
||||
libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl
|
||||
libelf = ../libelf/libelf.a -lz
|
||||
else
|
||||
-libasm = ../libasm/libasm.so
|
||||
+libasm = ../libasm/libasm.so $(zip_LIBS)
|
||||
libdw = ../libdw/libdw.so $(zip_LIBS) $(libelf) $(libebl) -ldl
|
||||
libelf = ../libelf/libelf.so
|
||||
endif
|
||||
--
|
||||
2.14.2
|
||||
|
||||
@@ -78,6 +78,8 @@ SRC_URI = "\
|
||||
${BACKPORTS} \
|
||||
"
|
||||
BACKPORTS = "\
|
||||
file://0051-ARM-PR-82445-suppress-32-bit-aligned-ldrd-strd-peeph.patch \
|
||||
file://0001-PR-rtl-optimization-81803.patch \
|
||||
"
|
||||
SRC_URI[md5sum] = "ff370482573133a7fcdd96cd2f552292"
|
||||
SRC_URI[sha256sum] = "1cf7adf8ff4b5aa49041c8734bbcf1ad18cc4c94d0029aae0f4e48841088479a"
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
From 5cbb8e6b1122092b3eaabd4270b2f316aa40407c Mon Sep 17 00:00:00 2001
|
||||
From: ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
|
||||
Date: Tue, 31 Oct 2017 18:27:52 +0000
|
||||
Subject: [PATCH] PR rtl-optimization/81803 * lra-constraints.c
|
||||
(curr_insn_transform): Also reload the whole register for a strict subreg
|
||||
no wider than a word if this is for a WORD_REGISTER_OPERATIONS target.
|
||||
|
||||
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254275 138bc75d-0d04-0410-961f-82ee72b054a4
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
This patch removes changes to Changelog from the original patch upstream. This is
|
||||
because we are backporting a patch to a stable version, making changes to Changelog,
|
||||
especially up '* GCC 7.2.0 released.', feels a little weird.
|
||||
|
||||
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
|
||||
---
|
||||
gcc/lra-constraints.c | 11 ++++++++---
|
||||
2 files changed, 16 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
|
||||
index a423f069836..3758409bb9c 100644
|
||||
--- a/gcc/lra-constraints.c
|
||||
+++ b/gcc/lra-constraints.c
|
||||
@@ -4207,8 +4207,9 @@ curr_insn_transform (bool check_only_p)
|
||||
reg = SUBREG_REG (*loc);
|
||||
byte = SUBREG_BYTE (*loc);
|
||||
if (REG_P (reg)
|
||||
- /* Strict_low_part requires reload the register not
|
||||
- the sub-register. */
|
||||
+ /* Strict_low_part requires reloading the register and not
|
||||
+ just the subreg. Likewise for a strict subreg no wider
|
||||
+ than a word for WORD_REGISTER_OPERATIONS targets. */
|
||||
&& (curr_static_id->operand[i].strict_low
|
||||
|| (!paradoxical_subreg_p (mode, GET_MODE (reg))
|
||||
&& (hard_regno
|
||||
@@ -4219,7 +4220,11 @@ curr_insn_transform (bool check_only_p)
|
||||
&& (goal_alt[i] == NO_REGS
|
||||
|| (simplify_subreg_regno
|
||||
(ira_class_hard_regs[goal_alt[i]][0],
|
||||
- GET_MODE (reg), byte, mode) >= 0)))))
|
||||
+ GET_MODE (reg), byte, mode) >= 0)))
|
||||
+ || (GET_MODE_PRECISION (mode)
|
||||
+ < GET_MODE_PRECISION (GET_MODE (reg))
|
||||
+ && GET_MODE_SIZE (GET_MODE (reg)) <= UNITS_PER_WORD
|
||||
+ && WORD_REGISTER_OPERATIONS)))
|
||||
{
|
||||
/* An OP_INOUT is required when reloading a subreg of a
|
||||
mode wider than a word to ensure that data beyond the
|
||||
--
|
||||
2.13.0
|
||||
|
||||
@@ -0,0 +1,194 @@
|
||||
From 8c18b422211878ba02503462cb22a2cc25a0a325 Mon Sep 17 00:00:00 2001
|
||||
From: rearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4>
|
||||
Date: Thu, 19 Oct 2017 13:14:55 +0000
|
||||
Subject: [PATCH] [ARM] PR 82445 - suppress 32-bit aligned ldrd/strd peepholing
|
||||
with -mno-unaligned-access
|
||||
|
||||
Peephole patterns exist in the arm backend to spot load/store
|
||||
operations to adjacent memory operations in order to convert them into
|
||||
ldrd/strd instructions. However, when we have strict alignment
|
||||
enforced, then we can only do this if the accesses are known to be
|
||||
64-bit aligned; this is unlikely to be the case for most loads. The
|
||||
patch adds some alignment checking to the code that validates the
|
||||
addresses for use in the peephole patterns. This should also fix
|
||||
incorrect generation of ldrd/strd with unaligned accesses that could
|
||||
previously have occurred on ARMv5e where all such operations must be
|
||||
64-bit aligned.
|
||||
|
||||
I've added some new tests as well. In doing so I discovered that the
|
||||
ldrd/strd peephole tests could never fail since they would match the
|
||||
source file name in the scanned assembly as well as any instructions
|
||||
of the intended type. I've fixed those by tightening the scan results
|
||||
slightly.
|
||||
|
||||
gcc:
|
||||
|
||||
* config/arm/arm.c (align_ok_ldrd_strd): New function.
|
||||
(mem_ok_for_ldrd_strd): New parameter align. Extract the alignment of the
|
||||
mem into it.
|
||||
(gen_operands_ldrd_strd): Validate the alignment of the accesses.
|
||||
|
||||
testsuite:
|
||||
|
||||
* gcc.target/arm/peep-ldrd-1.c: Tighten test scan pattern.
|
||||
* gcc.target/arm/peep-strd-1.c: Likewise.
|
||||
* gcc.target/arm/peep-ldrd-2.c: New test.
|
||||
* gcc.target/arm/peep-strd-2.c: New test.
|
||||
|
||||
|
||||
|
||||
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@253891 138bc75d-0d04-0410-961f-82ee72b054a4
|
||||
---
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
|
||||
gcc/ChangeLog | 8 +++++++
|
||||
gcc/config/arm/arm.c | 27 ++++++++++++++++++----
|
||||
gcc/testsuite/ChangeLog | 8 +++++++
|
||||
gcc/testsuite/gcc.target/arm/peep-ldrd-1.c | 2 +-
|
||||
.../arm/{peep-ldrd-1.c => peep-ldrd-2.c} | 4 ++--
|
||||
gcc/testsuite/gcc.target/arm/peep-strd-1.c | 2 +-
|
||||
.../arm/{peep-strd-1.c => peep-strd-2.c} | 4 ++--
|
||||
7 files changed, 44 insertions(+), 11 deletions(-)
|
||||
copy gcc/testsuite/gcc.target/arm/{peep-ldrd-1.c => peep-ldrd-2.c} (63%)
|
||||
copy gcc/testsuite/gcc.target/arm/{peep-strd-1.c => peep-strd-2.c} (58%)
|
||||
|
||||
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
|
||||
index 1ded0d2a17d..989957f048e 100644
|
||||
--- a/gcc/config/arm/arm.c
|
||||
+++ b/gcc/config/arm/arm.c
|
||||
@@ -15199,12 +15199,23 @@ operands_ok_ldrd_strd (rtx rt, rtx rt2, rtx rn, HOST_WIDE_INT offset,
|
||||
return true;
|
||||
}
|
||||
|
||||
+/* Return true if a 64-bit access with alignment ALIGN and with a
|
||||
+ constant offset OFFSET from the base pointer is permitted on this
|
||||
+ architecture. */
|
||||
+static bool
|
||||
+align_ok_ldrd_strd (HOST_WIDE_INT align, HOST_WIDE_INT offset)
|
||||
+{
|
||||
+ return (unaligned_access
|
||||
+ ? (align >= BITS_PER_WORD && (offset & 3) == 0)
|
||||
+ : (align >= 2 * BITS_PER_WORD && (offset & 7) == 0));
|
||||
+}
|
||||
+
|
||||
/* Helper for gen_operands_ldrd_strd. Returns true iff the memory
|
||||
operand MEM's address contains an immediate offset from the base
|
||||
- register and has no side effects, in which case it sets BASE and
|
||||
- OFFSET accordingly. */
|
||||
+ register and has no side effects, in which case it sets BASE,
|
||||
+ OFFSET and ALIGN accordingly. */
|
||||
static bool
|
||||
-mem_ok_for_ldrd_strd (rtx mem, rtx *base, rtx *offset)
|
||||
+mem_ok_for_ldrd_strd (rtx mem, rtx *base, rtx *offset, HOST_WIDE_INT *align)
|
||||
{
|
||||
rtx addr;
|
||||
|
||||
@@ -15223,6 +15234,7 @@ mem_ok_for_ldrd_strd (rtx mem, rtx *base, rtx *offset)
|
||||
gcc_assert (MEM_P (mem));
|
||||
|
||||
*offset = const0_rtx;
|
||||
+ *align = MEM_ALIGN (mem);
|
||||
|
||||
addr = XEXP (mem, 0);
|
||||
|
||||
@@ -15263,7 +15275,7 @@ gen_operands_ldrd_strd (rtx *operands, bool load,
|
||||
bool const_store, bool commute)
|
||||
{
|
||||
int nops = 2;
|
||||
- HOST_WIDE_INT offsets[2], offset;
|
||||
+ HOST_WIDE_INT offsets[2], offset, align[2];
|
||||
rtx base = NULL_RTX;
|
||||
rtx cur_base, cur_offset, tmp;
|
||||
int i, gap;
|
||||
@@ -15275,7 +15287,8 @@ gen_operands_ldrd_strd (rtx *operands, bool load,
|
||||
registers, and the corresponding memory offsets. */
|
||||
for (i = 0; i < nops; i++)
|
||||
{
|
||||
- if (!mem_ok_for_ldrd_strd (operands[nops+i], &cur_base, &cur_offset))
|
||||
+ if (!mem_ok_for_ldrd_strd (operands[nops+i], &cur_base, &cur_offset,
|
||||
+ &align[i]))
|
||||
return false;
|
||||
|
||||
if (i == 0)
|
||||
@@ -15389,6 +15402,7 @@ gen_operands_ldrd_strd (rtx *operands, bool load,
|
||||
/* Swap the instructions such that lower memory is accessed first. */
|
||||
std::swap (operands[0], operands[1]);
|
||||
std::swap (operands[2], operands[3]);
|
||||
+ std::swap (align[0], align[1]);
|
||||
if (const_store)
|
||||
std::swap (operands[4], operands[5]);
|
||||
}
|
||||
@@ -15402,6 +15416,9 @@ gen_operands_ldrd_strd (rtx *operands, bool load,
|
||||
if (gap != 4)
|
||||
return false;
|
||||
|
||||
+ if (!align_ok_ldrd_strd (align[0], offset))
|
||||
+ return false;
|
||||
+
|
||||
/* Make sure we generate legal instructions. */
|
||||
if (operands_ok_ldrd_strd (operands[0], operands[1], base, offset,
|
||||
false, load))
|
||||
diff --git a/gcc/testsuite/gcc.target/arm/peep-ldrd-1.c b/gcc/testsuite/gcc.target/arm/peep-ldrd-1.c
|
||||
index eb2b86ee7b6..d49eff6b87e 100644
|
||||
--- a/gcc/testsuite/gcc.target/arm/peep-ldrd-1.c
|
||||
+++ b/gcc/testsuite/gcc.target/arm/peep-ldrd-1.c
|
||||
@@ -8,4 +8,4 @@ int foo(int a, int b, int* p, int *q)
|
||||
*p = a;
|
||||
return a;
|
||||
}
|
||||
-/* { dg-final { scan-assembler "ldrd" } } */
|
||||
+/* { dg-final { scan-assembler "ldrd\\t" } } */
|
||||
diff --git a/gcc/testsuite/gcc.target/arm/peep-ldrd-1.c b/gcc/testsuite/gcc.target/arm/peep-ldrd-2.c
|
||||
similarity index 63%
|
||||
copy from gcc/testsuite/gcc.target/arm/peep-ldrd-1.c
|
||||
copy to gcc/testsuite/gcc.target/arm/peep-ldrd-2.c
|
||||
index eb2b86ee7b6..6822c2b1454 100644
|
||||
--- a/gcc/testsuite/gcc.target/arm/peep-ldrd-1.c
|
||||
+++ b/gcc/testsuite/gcc.target/arm/peep-ldrd-2.c
|
||||
@@ -1,6 +1,6 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-require-effective-target arm_prefer_ldrd_strd } */
|
||||
-/* { dg-options "-O2" } */
|
||||
+/* { dg-options "-O2 -mno-unaligned-access" } */
|
||||
int foo(int a, int b, int* p, int *q)
|
||||
{
|
||||
a = p[2] + p[3];
|
||||
@@ -8,4 +8,4 @@ int foo(int a, int b, int* p, int *q)
|
||||
*p = a;
|
||||
return a;
|
||||
}
|
||||
-/* { dg-final { scan-assembler "ldrd" } } */
|
||||
+/* { dg-final { scan-assembler-not "ldrd\\t" } } */
|
||||
diff --git a/gcc/testsuite/gcc.target/arm/peep-strd-1.c b/gcc/testsuite/gcc.target/arm/peep-strd-1.c
|
||||
index bd330769599..fe1beac7229 100644
|
||||
--- a/gcc/testsuite/gcc.target/arm/peep-strd-1.c
|
||||
+++ b/gcc/testsuite/gcc.target/arm/peep-strd-1.c
|
||||
@@ -6,4 +6,4 @@ void foo(int a, int b, int* p)
|
||||
p[2] = a;
|
||||
p[3] = b;
|
||||
}
|
||||
-/* { dg-final { scan-assembler "strd" } } */
|
||||
+/* { dg-final { scan-assembler "strd\\t" } } */
|
||||
diff --git a/gcc/testsuite/gcc.target/arm/peep-strd-1.c b/gcc/testsuite/gcc.target/arm/peep-strd-2.c
|
||||
similarity index 58%
|
||||
copy from gcc/testsuite/gcc.target/arm/peep-strd-1.c
|
||||
copy to gcc/testsuite/gcc.target/arm/peep-strd-2.c
|
||||
index bd330769599..bfc5ebe9eec 100644
|
||||
--- a/gcc/testsuite/gcc.target/arm/peep-strd-1.c
|
||||
+++ b/gcc/testsuite/gcc.target/arm/peep-strd-2.c
|
||||
@@ -1,9 +1,9 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-require-effective-target arm_prefer_ldrd_strd } */
|
||||
-/* { dg-options "-O2" } */
|
||||
+/* { dg-options "-O2 -mno-unaligned-access" } */
|
||||
void foo(int a, int b, int* p)
|
||||
{
|
||||
p[2] = a;
|
||||
p[3] = b;
|
||||
}
|
||||
-/* { dg-final { scan-assembler "strd" } } */
|
||||
+/* { dg-final { scan-assembler-not "strd\\t" } } */
|
||||
--
|
||||
2.15.0
|
||||
|
||||
@@ -15,6 +15,9 @@ SRC_URI += "\
|
||||
file://0007-ld-add-soname-to-shareable-objects.patch \
|
||||
file://0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch \
|
||||
file://0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch \
|
||||
file://0010-make.bash-override-CC-when-building-dist-and-go_boot.patch \
|
||||
"
|
||||
SRC_URI_append_libc-musl = " file://set-external-linker.patch"
|
||||
|
||||
SRC_URI[main.md5sum] = "da2d44ea384076efec43ee1f8b7d45d2"
|
||||
SRC_URI[main.sha256sum] = "a4ab229028ed167ba1986825751463605264e44868362ca8e7accc8be057e993"
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
From 21d83dd9499e5be30eea28dd7034d1ea2a01c838 Mon Sep 17 00:00:00 2001
|
||||
From: Matt Madison <matt@madison.systems>
|
||||
Date: Tue, 14 Nov 2017 07:38:42 -0800
|
||||
Subject: [PATCH 10/10] make.bash: override CC when building dist and
|
||||
go_bootstrap
|
||||
|
||||
For cross-canadian builds, dist and go_bootstrap
|
||||
run on the build host, so CC needs to point to the
|
||||
build host's C compiler. Add a BUILD_CC environment
|
||||
for this, falling back to $CC if not present.
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Matt Madison <matt@madison.systems>
|
||||
---
|
||||
src/make.bash | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/make.bash b/src/make.bash
|
||||
index 0bdadc6..f199349 100755
|
||||
--- a/src/make.bash
|
||||
+++ b/src/make.bash
|
||||
@@ -131,7 +131,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then
|
||||
exit 1
|
||||
fi
|
||||
rm -f cmd/dist/dist
|
||||
-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
|
||||
+CC=${BUILD_CC:-${CC}} GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
|
||||
|
||||
# -e doesn't propagate out of eval, so check success by hand.
|
||||
eval $(./cmd/dist/dist env -p || echo FAIL=true)
|
||||
@@ -167,7 +167,7 @@ elif [ "$1" = "--host-only" ]; then
|
||||
fi
|
||||
|
||||
if [ "$do_host_build" = "yes" ]; then
|
||||
- ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
|
||||
+ CC=${BUILD_CC:-${CC}} ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
|
||||
# Delay move of dist tool to now, because bootstrap may clear tool directory.
|
||||
mv cmd/dist/dist "$GOTOOLDIR"/dist
|
||||
echo
|
||||
--
|
||||
2.7.4
|
||||
|
||||
111
meta/recipes-devtools/go/go-1.9/set-external-linker.patch
Normal file
111
meta/recipes-devtools/go/go-1.9/set-external-linker.patch
Normal file
@@ -0,0 +1,111 @@
|
||||
Change the dynamic linker hardcoding to use musl when not using glibc
|
||||
this should be applied conditional to musl being the system C library
|
||||
|
||||
Upstream-Status: Inappropriate [Real Fix should be portable across libcs]
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
|
||||
Index: go/src/cmd/link/internal/amd64/obj.go
|
||||
===================================================================
|
||||
--- go.orig/src/cmd/link/internal/amd64/obj.go
|
||||
+++ go/src/cmd/link/internal/amd64/obj.go
|
||||
@@ -67,7 +67,7 @@ func Init() {
|
||||
ld.Thearch.Append64 = ld.Append64l
|
||||
ld.Thearch.TLSIEtoLE = tlsIEtoLE
|
||||
|
||||
- ld.Thearch.Linuxdynld = "/lib64/ld-linux-x86-64.so.2"
|
||||
+ ld.Thearch.Linuxdynld = "/lib/ld-musl-x86_64.so.1"
|
||||
ld.Thearch.Freebsddynld = "/libexec/ld-elf.so.1"
|
||||
ld.Thearch.Openbsddynld = "/usr/libexec/ld.so"
|
||||
ld.Thearch.Netbsddynld = "/libexec/ld.elf_so"
|
||||
Index: go/src/cmd/link/internal/arm/obj.go
|
||||
===================================================================
|
||||
--- go.orig/src/cmd/link/internal/arm/obj.go
|
||||
+++ go/src/cmd/link/internal/arm/obj.go
|
||||
@@ -63,7 +63,7 @@ func Init() {
|
||||
ld.Thearch.Append32 = ld.Append32l
|
||||
ld.Thearch.Append64 = ld.Append64l
|
||||
|
||||
- ld.Thearch.Linuxdynld = "/lib/ld-linux.so.3" // 2 for OABI, 3 for EABI
|
||||
+ ld.Thearch.Linuxdynld = "/lib/ld-musl-armhf.so.1"
|
||||
ld.Thearch.Freebsddynld = "/usr/libexec/ld-elf.so.1"
|
||||
ld.Thearch.Openbsddynld = "/usr/libexec/ld.so"
|
||||
ld.Thearch.Netbsddynld = "/libexec/ld.elf_so"
|
||||
Index: go/src/cmd/link/internal/arm64/obj.go
|
||||
===================================================================
|
||||
--- go.orig/src/cmd/link/internal/arm64/obj.go
|
||||
+++ go/src/cmd/link/internal/arm64/obj.go
|
||||
@@ -62,7 +62,7 @@ func Init() {
|
||||
ld.Thearch.Append32 = ld.Append32l
|
||||
ld.Thearch.Append64 = ld.Append64l
|
||||
|
||||
- ld.Thearch.Linuxdynld = "/lib/ld-linux-aarch64.so.1"
|
||||
+ ld.Thearch.Linuxdynld = "/lib/ld-musl-aarch64.so.1"
|
||||
|
||||
ld.Thearch.Freebsddynld = "XXX"
|
||||
ld.Thearch.Openbsddynld = "XXX"
|
||||
Index: go/src/cmd/link/internal/mips/obj.go
|
||||
===================================================================
|
||||
--- go.orig/src/cmd/link/internal/mips/obj.go
|
||||
+++ go/src/cmd/link/internal/mips/obj.go
|
||||
@@ -77,7 +77,7 @@ func Init() {
|
||||
ld.Thearch.Append64 = ld.Append64b
|
||||
}
|
||||
|
||||
- ld.Thearch.Linuxdynld = "/lib/ld.so.1"
|
||||
+ ld.Thearch.Linuxdynld = "/lib/ld-musl-mipsle.so.1"
|
||||
|
||||
ld.Thearch.Freebsddynld = "XXX"
|
||||
ld.Thearch.Openbsddynld = "XXX"
|
||||
Index: go/src/cmd/link/internal/mips64/obj.go
|
||||
===================================================================
|
||||
--- go.orig/src/cmd/link/internal/mips64/obj.go
|
||||
+++ go/src/cmd/link/internal/mips64/obj.go
|
||||
@@ -75,7 +75,7 @@ func Init() {
|
||||
ld.Thearch.Append64 = ld.Append64b
|
||||
}
|
||||
|
||||
- ld.Thearch.Linuxdynld = "/lib64/ld64.so.1"
|
||||
+ ld.Thearch.Linuxdynld = "/lib64/ld-musl-mips64le.so.1"
|
||||
|
||||
ld.Thearch.Freebsddynld = "XXX"
|
||||
ld.Thearch.Openbsddynld = "XXX"
|
||||
Index: go/src/cmd/link/internal/ppc64/obj.go
|
||||
===================================================================
|
||||
--- go.orig/src/cmd/link/internal/ppc64/obj.go
|
||||
+++ go/src/cmd/link/internal/ppc64/obj.go
|
||||
@@ -77,7 +77,7 @@ func Init() {
|
||||
}
|
||||
|
||||
// TODO(austin): ABI v1 uses /usr/lib/ld.so.1
|
||||
- ld.Thearch.Linuxdynld = "/lib64/ld64.so.1"
|
||||
+ ld.Thearch.Linuxdynld = "/lib/ld-musl-powerpc64le.so.1"
|
||||
|
||||
ld.Thearch.Freebsddynld = "XXX"
|
||||
ld.Thearch.Openbsddynld = "XXX"
|
||||
Index: go/src/cmd/link/internal/s390x/obj.go
|
||||
===================================================================
|
||||
--- go.orig/src/cmd/link/internal/s390x/obj.go
|
||||
+++ go/src/cmd/link/internal/s390x/obj.go
|
||||
@@ -62,7 +62,7 @@ func Init() {
|
||||
ld.Thearch.Append32 = ld.Append32b
|
||||
ld.Thearch.Append64 = ld.Append64b
|
||||
|
||||
- ld.Thearch.Linuxdynld = "/lib64/ld64.so.1"
|
||||
+ ld.Thearch.Linuxdynld = "/lib/ld-musl-s390x.so.1"
|
||||
|
||||
// not relevant for s390x
|
||||
ld.Thearch.Freebsddynld = "XXX"
|
||||
Index: go/src/cmd/link/internal/x86/obj.go
|
||||
===================================================================
|
||||
--- go.orig/src/cmd/link/internal/x86/obj.go
|
||||
+++ go/src/cmd/link/internal/x86/obj.go
|
||||
@@ -63,7 +63,7 @@ func Init() {
|
||||
ld.Thearch.Append32 = ld.Append32l
|
||||
ld.Thearch.Append64 = ld.Append64l
|
||||
|
||||
- ld.Thearch.Linuxdynld = "/lib/ld-linux.so.2"
|
||||
+ ld.Thearch.Linuxdynld = "/lib/ld-musl-i386.so.1"
|
||||
ld.Thearch.Freebsddynld = "/usr/libexec/ld-elf.so.1"
|
||||
ld.Thearch.Openbsddynld = "/usr/libexec/ld.so"
|
||||
ld.Thearch.Netbsddynld = "/usr/libexec/ld.elf_so"
|
||||
@@ -20,3 +20,7 @@ B = "${S}"
|
||||
|
||||
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
|
||||
SSTATE_SCAN_CMD = "true"
|
||||
|
||||
do_compile_prepend() {
|
||||
BUILD_CC=${BUILD_CC}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ do_configure () {
|
||||
-Dcc="${CC}" \
|
||||
-Dcflags="${CFLAGS}" \
|
||||
-Dldflags="${LDFLAGS}" \
|
||||
-Dlddlflags="${LDFLAGS} -shared" \
|
||||
-Dcf_by="Open Embedded" \
|
||||
-Dprefix=${prefix} \
|
||||
-Dvendorprefix=${prefix} \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
require python.inc
|
||||
DEPENDS = "python-native libffi bzip2 db gdbm openssl readline sqlite3 zlib"
|
||||
DEPENDS = "python-native libffi bzip2 gdbm openssl readline sqlite3 zlib"
|
||||
PR = "${INC_PR}"
|
||||
|
||||
DISTRO_SRC_URI ?= "file://sitecustomize.py"
|
||||
@@ -39,6 +39,9 @@ CONFIGUREOPTS += " --with-system-ffi "
|
||||
|
||||
EXTRA_OECONF += "ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no"
|
||||
|
||||
PACKAGECONFIG ??= "bdb"
|
||||
PACKAGECONFIG[bdb] = ",,db"
|
||||
|
||||
do_configure_append() {
|
||||
rm -f ${S}/Makefile.orig
|
||||
autoreconf -Wcross --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
|
||||
@@ -118,6 +121,10 @@ do_install() {
|
||||
fi
|
||||
|
||||
oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h
|
||||
|
||||
if [ -z "${@bb.utils.filter('PACKAGECONFIG', 'bdb', d)}" ]; then
|
||||
rm -rf ${D}/${libdir}/python${PYTHON_MAJMIN}/bsddb
|
||||
fi
|
||||
}
|
||||
|
||||
do_install_append_class-nativesdk () {
|
||||
@@ -154,6 +161,8 @@ FILES_lib${BPN}2 = "${libdir}/libpython*.so.*"
|
||||
PACKAGES += "${PN}-misc"
|
||||
FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}"
|
||||
RDEPENDS_${PN}-modules += "${PN}-misc"
|
||||
|
||||
# ptest
|
||||
RDEPENDS_${PN}-ptest = "${PN}-modules ${PN}-tests"
|
||||
#inherit ptest after "require python-${PYTHON_MAJMIN}-manifest.inc" so PACKAGES doesn't get overwritten
|
||||
inherit ptest
|
||||
@@ -180,4 +189,7 @@ do_install_ptest() {
|
||||
PACKAGES += "${PN}-man"
|
||||
FILES_${PN}-man = "${datadir}/man"
|
||||
|
||||
# Nasty but if bdb isn't enabled the package won't be generated
|
||||
RDEPENDS_${PN}-modules_remove = "${@bb.utils.contains('PACKAGECONFIG', 'bdb', '', '${PN}-bsddb', d)}"
|
||||
|
||||
BBCLASSEXTEND = "nativesdk"
|
||||
|
||||
105
meta/recipes-devtools/qemu/qemu/ppc_locking.patch
Normal file
105
meta/recipes-devtools/qemu/qemu/ppc_locking.patch
Normal file
@@ -0,0 +1,105 @@
|
||||
I've tracked down what I think is a problem causing qemu-system-ppc
|
||||
to hang whilst booting images.
|
||||
|
||||
I believe the decrementer timer stops receiving interrupts so
|
||||
tasks in our images hang indefinitely as the timer stopped.
|
||||
|
||||
It can be summed up with this line of debug:
|
||||
|
||||
ppc_set_irq: 0x55b4e0d562f0 n_IRQ 8 level 1 => pending 00000100req 00000004
|
||||
|
||||
It should normally read:
|
||||
|
||||
ppc_set_irq: 0x55b4e0d562f0 n_IRQ 8 level 1 => pending 00000100req 00000002
|
||||
|
||||
The question is why CPU_INTERRUPT_EXITTB ends up being set when the
|
||||
lines above this log message clearly sets CPU_INTERRUPT_HARD (via
|
||||
cpu_interrupt() ).
|
||||
|
||||
I note in cpu.h:
|
||||
|
||||
/* updates protected by BQL */
|
||||
uint32_t interrupt_request;
|
||||
|
||||
(for struct CPUState)
|
||||
|
||||
The ppc code does "cs->interrupt_request |= CPU_INTERRUPT_EXITTB" in 5
|
||||
places, 3 in excp_helper.c and 2 in helper_regs.h. In all cases,
|
||||
g_assert(qemu_mutex_iothread_locked()); fails. If I do something like:
|
||||
|
||||
if (!qemu_mutex_iothread_locked()) {
|
||||
qemu_mutex_lock_iothread();
|
||||
cpu_interrupt(cs, CPU_INTERRUPT_EXITTB);
|
||||
qemu_mutex_unlock_iothread();
|
||||
} else {
|
||||
cpu_interrupt(cs, CPU_INTERRUPT_EXITTB);
|
||||
}
|
||||
|
||||
in these call sites then I can no longer lock qemu up with my test
|
||||
case.
|
||||
|
||||
I suspect the _HARD setting gets overwritten which stops the
|
||||
decrementer interrupts being delivered.
|
||||
|
||||
Upstream-Status: Submitted [Issue discussed on qemu mailing list 2017/11/20]
|
||||
RP 2017/11/20
|
||||
|
||||
Index: qemu-2.10.1/target/ppc/excp_helper.c
|
||||
===================================================================
|
||||
--- qemu-2.10.1.orig/target/ppc/excp_helper.c
|
||||
+++ qemu-2.10.1/target/ppc/excp_helper.c
|
||||
@@ -207,7 +207,9 @@ static inline void powerpc_excp(PowerPCC
|
||||
"Entering checkstop state\n");
|
||||
}
|
||||
cs->halted = 1;
|
||||
- cs->interrupt_request |= CPU_INTERRUPT_EXITTB;
|
||||
+ qemu_mutex_lock_iothread();
|
||||
+ cpu_interrupt(cs, CPU_INTERRUPT_EXITTB);
|
||||
+ qemu_mutex_unlock_iothread();
|
||||
}
|
||||
if (env->msr_mask & MSR_HVB) {
|
||||
/* ISA specifies HV, but can be delivered to guest with HV clear
|
||||
@@ -940,7 +942,9 @@ void helper_store_msr(CPUPPCState *env,
|
||||
|
||||
if (excp != 0) {
|
||||
CPUState *cs = CPU(ppc_env_get_cpu(env));
|
||||
- cs->interrupt_request |= CPU_INTERRUPT_EXITTB;
|
||||
+ qemu_mutex_lock_iothread();
|
||||
+ cpu_interrupt(cs, CPU_INTERRUPT_EXITTB);
|
||||
+ qemu_mutex_unlock_iothread();
|
||||
raise_exception(env, excp);
|
||||
}
|
||||
}
|
||||
@@ -995,7 +999,9 @@ static inline void do_rfi(CPUPPCState *e
|
||||
/* No need to raise an exception here,
|
||||
* as rfi is always the last insn of a TB
|
||||
*/
|
||||
- cs->interrupt_request |= CPU_INTERRUPT_EXITTB;
|
||||
+ qemu_mutex_lock_iothread();
|
||||
+ cpu_interrupt(cs, CPU_INTERRUPT_EXITTB);
|
||||
+ qemu_mutex_unlock_iothread();
|
||||
|
||||
/* Reset the reservation */
|
||||
env->reserve_addr = -1;
|
||||
Index: qemu-2.10.1/target/ppc/helper_regs.h
|
||||
===================================================================
|
||||
--- qemu-2.10.1.orig/target/ppc/helper_regs.h
|
||||
+++ qemu-2.10.1/target/ppc/helper_regs.h
|
||||
@@ -114,11 +114,15 @@ static inline int hreg_store_msr(CPUPPCS
|
||||
}
|
||||
if (((value >> MSR_IR) & 1) != msr_ir ||
|
||||
((value >> MSR_DR) & 1) != msr_dr) {
|
||||
- cs->interrupt_request |= CPU_INTERRUPT_EXITTB;
|
||||
+ qemu_mutex_lock_iothread();
|
||||
+ cpu_interrupt(cs, CPU_INTERRUPT_EXITTB);
|
||||
+ qemu_mutex_unlock_iothread();
|
||||
}
|
||||
if ((env->mmu_model & POWERPC_MMU_BOOKE) &&
|
||||
((value >> MSR_GS) & 1) != msr_gs) {
|
||||
- cs->interrupt_request |= CPU_INTERRUPT_EXITTB;
|
||||
+ qemu_mutex_lock_iothread();
|
||||
+ cpu_interrupt(cs, CPU_INTERRUPT_EXITTB);
|
||||
+ qemu_mutex_unlock_iothread();
|
||||
}
|
||||
if (unlikely((env->flags & POWERPC_FLAG_TGPR) &&
|
||||
((value ^ env->msr) & (1 << MSR_TGPR)))) {
|
||||
@@ -28,6 +28,7 @@ SRC_URI = "http://wiki.qemu-project.org/download/${BP}.tar.bz2 \
|
||||
file://CVE-2017-13673.patch \
|
||||
file://CVE-2017-13672.patch \
|
||||
file://CVE-2017-14167.patch \
|
||||
file://ppc_locking.patch \
|
||||
"
|
||||
UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+\..*)\.tar"
|
||||
|
||||
|
||||
@@ -107,7 +107,8 @@ do_install_append_class-target() {
|
||||
}
|
||||
|
||||
do_install_append () {
|
||||
sed -i -e 's:${HOSTTOOLS_DIR}/::g' ${D}/${libdir}/rpm/macros
|
||||
sed -i -e 's:${HOSTTOOLS_DIR}/::g' \
|
||||
${D}/${libdir}/rpm/macros
|
||||
|
||||
sed -i -e 's|/usr/bin/python|${USRBINPATH}/env ${PYTHON_PN}|' \
|
||||
${D}${libdir}/rpm/pythondistdeps.py
|
||||
@@ -127,3 +128,11 @@ FILES_python3-rpm = "${PYTHON_SITEPACKAGES_DIR}/rpm/*"
|
||||
RPROVIDES_${PN} += "rpm-build"
|
||||
|
||||
RDEPENDS_${PN} = "bash perl python3-core"
|
||||
|
||||
PACKAGE_PREPROCESS_FUNCS += "rpm_package_preprocess"
|
||||
|
||||
# Do not specify a sysroot when compiling on a target.
|
||||
rpm_package_preprocess () {
|
||||
sed -i -e 's:--sysroot[^ ]*::g' \
|
||||
${PKGD}/${libdir}/rpm/macros
|
||||
}
|
||||
|
||||
@@ -86,3 +86,16 @@ BINCONFIG_GLOB = "*Config.sh"
|
||||
|
||||
# Fix the path in sstate
|
||||
SSTATE_SCAN_FILES += "*Config.sh"
|
||||
|
||||
# Cleanup host path from ${libdir}/tclConfig.sh and remove the
|
||||
# ${bindir_crossscripts}/tclConfig.sh from target
|
||||
PACKAGE_PREPROCESS_FUNCS += "tcl_package_preprocess"
|
||||
tcl_package_preprocess() {
|
||||
sed -i -e "s;${DEBUG_PREFIX_MAP};;g" \
|
||||
-e "s;-L${STAGING_LIBDIR};-L${libdir};g" \
|
||||
-e "s;${STAGING_INCDIR};${includedir};g" \
|
||||
-e "s;--sysroot=${RECIPE_SYSROOT};;g" \
|
||||
${PKGD}${libdir}/tclConfig.sh
|
||||
|
||||
rm -f ${PKGD}${bindir_crossscripts}/tclConfig.sh
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ inherit ptest
|
||||
|
||||
do_install_ptest() {
|
||||
mkdir ${D}${PTEST_PATH}/test
|
||||
for i in `grep -vE "@|^$|#|Gt-dummy" ${S}/test/Maketests |awk -F: '{print $1}'` Maketests; \
|
||||
for i in `grep -vE "@|^$|#|Gt-dummy" ${S}/test/Maketests |awk -F: '{print $1}'` Maketests inclib.awk; \
|
||||
do cp ${S}/test/$i* ${D}${PTEST_PATH}/test; \
|
||||
done
|
||||
}
|
||||
|
||||
@@ -34,3 +34,4 @@ do_install_append() {
|
||||
|
||||
FILES_${PN} += "${libdir}/nsl/*.so.*"
|
||||
FILES_${PN}-dev += "${includedir}/nsl ${libdir}/nsl/*.so"
|
||||
FILES_${PN}-staticdev += "${libdir}/nsl/*.a"
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
From 1c4c935cb73ac1ccb9693df1a51ba218a22e8ca8 Mon Sep 17 00:00:00 2001
|
||||
From: Ming Liu <liu.ming50@gmail.com>
|
||||
Date: Sat, 30 Sep 2017 11:15:16 +0800
|
||||
Subject: [PATCH] repo_rpmdb.c: increase MAX_HDR_CNT and MAX_HDR_DSIZE
|
||||
|
||||
Upstream-Status: Submitted [https://github.com/openSUSE/libsolv/pull/230]
|
||||
|
||||
We encountered 'corrupt rpm' issues when installing extreme big RPM
|
||||
packages like the kernel-devsrc package of Yocto project.
|
||||
|
||||
It can be fixed by increasing MAX_HDR_CNT and MAX_HDR_DSIZE per test.
|
||||
|
||||
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
|
||||
---
|
||||
ext/repo_rpmdb.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/ext/repo_rpmdb.c b/ext/repo_rpmdb.c
|
||||
index c7000a9..7000835 100644
|
||||
--- a/ext/repo_rpmdb.c
|
||||
+++ b/ext/repo_rpmdb.c
|
||||
@@ -170,8 +170,8 @@
|
||||
#define MAX_SIG_CNT 0x100000
|
||||
#define MAX_SIG_DSIZE 0x100000
|
||||
|
||||
-#define MAX_HDR_CNT 0x100000
|
||||
-#define MAX_HDR_DSIZE 0x2000000
|
||||
+#define MAX_HDR_CNT 0x200000
|
||||
+#define MAX_HDR_DSIZE 0x4000000
|
||||
|
||||
typedef struct rpmhead {
|
||||
int cnt;
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -8,7 +8,8 @@ LIC_FILES_CHKSUM = "file://LICENSE.BSD;md5=62272bd11c97396d4aaf1c41bc11f7d8"
|
||||
DEPENDS = "expat zlib rpm"
|
||||
|
||||
SRC_URI = "git://github.com/openSUSE/libsolv.git \
|
||||
"
|
||||
file://0001-repo_rpmdb.c-increase-MAX_HDR_CNT-and-MAX_HDR_DSIZE.patch \
|
||||
"
|
||||
SRC_URI_append_libc-musl = " file://0001-Add-fallback-fopencookie-implementation.patch \
|
||||
file://0002-Fixes-to-internal-fopencookie-implementation.patch \
|
||||
"
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
From a129ee6d80f3b2cda0d827c35fa81a517cf6d505 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Fri, 13 Oct 2017 10:27:34 -0700
|
||||
Subject: [PATCH] Use CC to check for implicit-fallthrough warning support
|
||||
|
||||
This warning it new in gcc7 and in cross compile case
|
||||
its possible that build host gcc is version 7+ but the
|
||||
cross compile used for compiling mdadm is < version 7
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
Upstream-Status: Pending
|
||||
Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index d207ee4..971f255 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -48,7 +48,7 @@ ifdef WARN_UNUSED
|
||||
CWFLAGS += -Wp,-D_FORTIFY_SOURCE=2 -O3
|
||||
endif
|
||||
|
||||
-FALLTHROUGH := $(shell gcc -v --help 2>&1 | grep "implicit-fallthrough" | wc -l)
|
||||
+FALLTHROUGH := $(shell ${CC} -v --help 2>&1 | grep "implicit-fallthrough" | wc -l)
|
||||
ifneq "$(FALLTHROUGH)" "0"
|
||||
CWFLAGS += -Wimplicit-fallthrough=0
|
||||
endif
|
||||
--
|
||||
2.14.2
|
||||
|
||||
@@ -21,6 +21,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \
|
||||
file://0003-Replace-snprintf-with-strncpy-at-some-places-to-avoi.patch \
|
||||
file://0004-mdadm-Forced-type-conversion-to-avoid-truncation.patch \
|
||||
file://0005-Add-a-comment-to-indicate-valid-fallthrough.patch \
|
||||
file://0001-Use-CC-to-check-for-implicit-fallthrough-warning-sup.patch \
|
||||
"
|
||||
SRC_URI[md5sum] = "2cb4feffea9167ba71b5f346a0c0a40d"
|
||||
SRC_URI[sha256sum] = "1d6ae7f24ced3a0fa7b5613b32f4a589bb4881e3946a5a2c3724056254ada3a9"
|
||||
|
||||
@@ -81,20 +81,12 @@ do_configure() {
|
||||
|
||||
do_compile() {
|
||||
# net-tools use COPTS/LOPTS to allow adding custom options
|
||||
export COPTS="$CFLAGS"
|
||||
export LOPTS="$LDFLAGS"
|
||||
unset CFLAGS
|
||||
unset LDFLAGS
|
||||
|
||||
oe_runmake
|
||||
oe_runmake COPTS="$CFLAGS" LOPTS="$LDFLAGS"
|
||||
}
|
||||
|
||||
do_install() {
|
||||
export COPTS="$CFLAGS"
|
||||
export LOPTS="$LDFLAGS"
|
||||
unset CFLAGS
|
||||
unset LDFLAGS
|
||||
oe_runmake 'BASEDIR=${D}' install
|
||||
# We don't need COPTS or LOPTS, but let's be consistent.
|
||||
oe_runmake COPTS="$CFLAGS" LOPTS="$LDFLAGS" 'BASEDIR=${D}' install
|
||||
|
||||
if [ "${base_bindir}" != "/bin" ]; then
|
||||
mkdir -p ${D}/${base_bindir}
|
||||
|
||||
@@ -27,6 +27,12 @@ EXTRA_OECONF_append_libc-musl = " --disable-hardening "
|
||||
|
||||
# mksigname/mksiglist are used on build host to generate source files
|
||||
do_compile_prepend () {
|
||||
# Remove build host references from sudo_usage.h
|
||||
sed -i \
|
||||
-e 's,--with-libtool-sysroot=${STAGING_DIR_TARGET},,g' \
|
||||
-e 's,--build=${BUILD_SYS},,g' \
|
||||
-e 's,--host=${HOST_SYS},,g' \
|
||||
${B}/src/sudo_usage.h
|
||||
oe_runmake SSP_CFLAGS="" SSP_LDFLAGS="" CC="$BUILD_CC" CFLAGS="$BUILD_CFLAGS" CPPFLAGS="$BUILD_CPPFLAGS -I${S}/include -I${S} -I${B}" -C lib/util mksigname mksiglist
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,174 @@
|
||||
From b520d20b8122a783f99f088758b78d928f70ee34 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Eggert <eggert@cs.ucla.edu>
|
||||
Date: Mon, 23 Oct 2017 11:42:45 -0700
|
||||
Subject: [PATCH] Fix Makefile quoting bug
|
||||
|
||||
Problem with INSTALLARGS reported by Zefram in:
|
||||
https://mm.icann.org/pipermail/tz/2017-October/025360.html
|
||||
Fix similar problems too.
|
||||
* Makefile (ZIC_INSTALL, VALIDATE_ENV, CC, install)
|
||||
(INSTALL, version, INSTALLARGS, right_posix, posix_right)
|
||||
(check_public): Use apostrophes to prevent undesirable
|
||||
interpretation of names by the shell. We still do not support
|
||||
directory names containing apostrophes or newlines, but this is
|
||||
good enough.
|
||||
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
* NEWS: Mention this.
|
||||
---
|
||||
Makefile | 64 ++++++++++++++++++++++++++++++++--------------------------------
|
||||
NEWS | 8 ++++++++
|
||||
2 files changed, 40 insertions(+), 32 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index c92edc0..97649ca 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -313,7 +313,7 @@ ZFLAGS=
|
||||
|
||||
# How to use zic to install tz binary files.
|
||||
|
||||
-ZIC_INSTALL= $(ZIC) -d $(DESTDIR)$(TZDIR) $(LEAPSECONDS)
|
||||
+ZIC_INSTALL= $(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS)
|
||||
|
||||
# The name of a Posix-compliant 'awk' on your system.
|
||||
AWK= awk
|
||||
@@ -341,8 +341,8 @@ SGML_CATALOG_FILES= \
|
||||
VALIDATE = nsgmls
|
||||
VALIDATE_FLAGS = -s -B -wall -wno-unused-param
|
||||
VALIDATE_ENV = \
|
||||
- SGML_CATALOG_FILES=$(SGML_CATALOG_FILES) \
|
||||
- SGML_SEARCH_PATH=$(SGML_SEARCH_PATH) \
|
||||
+ SGML_CATALOG_FILES='$(SGML_CATALOG_FILES)' \
|
||||
+ SGML_SEARCH_PATH='$(SGML_SEARCH_PATH)' \
|
||||
SP_CHARSET_FIXED=YES \
|
||||
SP_ENCODING=UTF-8
|
||||
|
||||
@@ -396,7 +396,7 @@ GZIPFLAGS= -9n
|
||||
#MAKE= make
|
||||
|
||||
cc= cc
|
||||
-CC= $(cc) -DTZDIR=\"$(TZDIR)\"
|
||||
+CC= $(cc) -DTZDIR='"$(TZDIR)"'
|
||||
|
||||
AR= ar
|
||||
|
||||
@@ -473,29 +473,29 @@ all: tzselect yearistype zic zdump libtz.a $(TABDATA)
|
||||
ALL: all date $(ENCHILADA)
|
||||
|
||||
install: all $(DATA) $(REDO) $(MANS)
|
||||
- mkdir -p $(DESTDIR)$(ETCDIR) $(DESTDIR)$(TZDIR) \
|
||||
- $(DESTDIR)$(LIBDIR) \
|
||||
- $(DESTDIR)$(MANDIR)/man3 $(DESTDIR)$(MANDIR)/man5 \
|
||||
- $(DESTDIR)$(MANDIR)/man8
|
||||
+ mkdir -p '$(DESTDIR)$(ETCDIR)' '$(DESTDIR)$(TZDIR)' \
|
||||
+ '$(DESTDIR)$(LIBDIR)' \
|
||||
+ '$(DESTDIR)$(MANDIR)/man3' '$(DESTDIR)$(MANDIR)/man5' \
|
||||
+ '$(DESTDIR)$(MANDIR)/man8'
|
||||
$(ZIC_INSTALL) -l $(LOCALTIME) -p $(POSIXRULES)
|
||||
- cp -f $(TABDATA) $(DESTDIR)$(TZDIR)/.
|
||||
- cp tzselect zic zdump $(DESTDIR)$(ETCDIR)/.
|
||||
- cp libtz.a $(DESTDIR)$(LIBDIR)/.
|
||||
- $(RANLIB) $(DESTDIR)$(LIBDIR)/libtz.a
|
||||
- cp -f newctime.3 newtzset.3 $(DESTDIR)$(MANDIR)/man3/.
|
||||
- cp -f tzfile.5 $(DESTDIR)$(MANDIR)/man5/.
|
||||
- cp -f tzselect.8 zdump.8 zic.8 $(DESTDIR)$(MANDIR)/man8/.
|
||||
+ cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.'
|
||||
+ cp tzselect zic zdump '$(DESTDIR)$(ETCDIR)/.'
|
||||
+ cp libtz.a '$(DESTDIR)$(LIBDIR)/.'
|
||||
+ $(RANLIB) '$(DESTDIR)$(LIBDIR)/libtz.a'
|
||||
+ cp -f newctime.3 newtzset.3 '$(DESTDIR)$(MANDIR)/man3/.'
|
||||
+ cp -f tzfile.5 '$(DESTDIR)$(MANDIR)/man5/.'
|
||||
+ cp -f tzselect.8 zdump.8 zic.8 '$(DESTDIR)$(MANDIR)/man8/.'
|
||||
|
||||
INSTALL: ALL install date.1
|
||||
- mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man1
|
||||
- cp date $(DESTDIR)$(BINDIR)/.
|
||||
- cp -f date.1 $(DESTDIR)$(MANDIR)/man1/.
|
||||
+ mkdir -p '$(DESTDIR)$(BINDIR)' '$(DESTDIR)$(MANDIR)/man1'
|
||||
+ cp date '$(DESTDIR)$(BINDIR)/.'
|
||||
+ cp -f date.1 '$(DESTDIR)$(MANDIR)/man1/.'
|
||||
|
||||
version: $(VERSION_DEPS)
|
||||
{ (type git) >/dev/null 2>&1 && \
|
||||
V=`git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \
|
||||
--abbrev=7 --dirty` || \
|
||||
- V=$(VERSION); } && \
|
||||
+ V='$(VERSION)'; } && \
|
||||
printf '%s\n' "$$V" >$@.out
|
||||
mv $@.out $@
|
||||
|
||||
@@ -529,12 +529,12 @@ leapseconds: $(LEAP_DEPS)
|
||||
# Arguments to pass to submakes of install_data.
|
||||
# They can be overridden by later submake arguments.
|
||||
INSTALLARGS = \
|
||||
- BACKWARD=$(BACKWARD) \
|
||||
- DESTDIR=$(DESTDIR) \
|
||||
+ BACKWARD='$(BACKWARD)' \
|
||||
+ DESTDIR='$(DESTDIR)' \
|
||||
LEAPSECONDS='$(LEAPSECONDS)' \
|
||||
PACKRATDATA='$(PACKRATDATA)' \
|
||||
- TZDIR=$(TZDIR) \
|
||||
- YEARISTYPE=$(YEARISTYPE) \
|
||||
+ TZDIR='$(TZDIR)' \
|
||||
+ YEARISTYPE='$(YEARISTYPE)' \
|
||||
ZIC='$(ZIC)'
|
||||
|
||||
# 'make install_data' installs one set of tz binary files.
|
||||
@@ -558,16 +558,16 @@ right_only:
|
||||
# You must replace all of $(TZDIR) to switch from not using leap seconds
|
||||
# to using them, or vice versa.
|
||||
right_posix: right_only
|
||||
- rm -fr $(DESTDIR)$(TZDIR)-leaps
|
||||
- ln -s $(TZDIR_BASENAME) $(DESTDIR)$(TZDIR)-leaps || \
|
||||
- $(MAKE) $(INSTALLARGS) TZDIR=$(TZDIR)-leaps right_only
|
||||
- $(MAKE) $(INSTALLARGS) TZDIR=$(TZDIR)-posix posix_only
|
||||
+ rm -fr '$(DESTDIR)$(TZDIR)-leaps'
|
||||
+ ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-leaps' || \
|
||||
+ $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only
|
||||
+ $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only
|
||||
|
||||
posix_right: posix_only
|
||||
- rm -fr $(DESTDIR)$(TZDIR)-posix
|
||||
- ln -s $(TZDIR_BASENAME) $(DESTDIR)$(TZDIR)-posix || \
|
||||
- $(MAKE) $(INSTALLARGS) TZDIR=$(TZDIR)-posix posix_only
|
||||
- $(MAKE) $(INSTALLARGS) TZDIR=$(TZDIR)-leaps right_only
|
||||
+ rm -fr '$(DESTDIR)$(TZDIR)-posix'
|
||||
+ ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-posix' || \
|
||||
+ $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only
|
||||
+ $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only
|
||||
|
||||
# This obsolescent rule is present for backwards compatibility with
|
||||
# tz releases 2014g through 2015g. It should go away eventually.
|
||||
@@ -764,7 +764,7 @@ set-timestamps.out: $(ENCHILADA)
|
||||
|
||||
check_public:
|
||||
$(MAKE) maintainer-clean
|
||||
- $(MAKE) "CFLAGS=$(GCC_DEBUG_FLAGS)" ALL
|
||||
+ $(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' ALL
|
||||
mkdir -p public.dir
|
||||
for i in $(TDATA) tzdata.zi; do \
|
||||
$(zic) -v -d public.dir $$i 2>&1 || exit; \
|
||||
diff --git a/NEWS b/NEWS
|
||||
index bd2bec2..75ab095 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -1,5 +1,13 @@
|
||||
News for the tz database
|
||||
|
||||
+Unreleased, experimental changes
|
||||
+
|
||||
+ Changes to build procedure
|
||||
+
|
||||
+ The Makefile now quotes values like BACKWARD more carefully when
|
||||
+ passing them to the shell. (Problem reported by Zefram.)
|
||||
+
|
||||
+
|
||||
Release 2017c - 2017-10-20 14:49:34 -0700
|
||||
|
||||
Briefly:
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
From e231da4fb2beb17c60b4b1a5c276366d6a6e433f Mon Sep 17 00:00:00 2001
|
||||
From: Paul Eggert <eggert@cs.ucla.edu>
|
||||
Date: Mon, 23 Oct 2017 17:58:36 -0700
|
||||
Subject: [PATCH] Port zdump to C90 + snprintf
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Problem reported by Jon Skeet in:
|
||||
https://mm.icann.org/pipermail/tz/2017-October/025362.html
|
||||
* NEWS: Mention this.
|
||||
* zdump.c (my_snprintf): New macro or function. If a macro, it is
|
||||
just snprintf. If a function, it is the same as the old snprintf
|
||||
static function, with an ATTRIBUTE_FORMAT to pacify modern GCC.
|
||||
All uses of snprintf changed to use my_snprintf. This way,
|
||||
installers don’t need to specify -DHAVE_SNPRINTF if they are using
|
||||
a pre-C99 compiler with a library that has snprintf.
|
||||
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
NEWS | 4 ++++
|
||||
zdump.c | 29 ++++++++++++++++-------------
|
||||
2 files changed, 20 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index 75ab095..dea08b8 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -7,6 +7,10 @@ Unreleased, experimental changes
|
||||
The Makefile now quotes values like BACKWARD more carefully when
|
||||
passing them to the shell. (Problem reported by Zefram.)
|
||||
|
||||
+ Builders no longer need to specify -DHAVE_SNPRINTF on platforms
|
||||
+ that have snprintf and use pre-C99 compilers. (Problem reported
|
||||
+ by Jon Skeet.)
|
||||
+
|
||||
|
||||
Release 2017c - 2017-10-20 14:49:34 -0700
|
||||
|
||||
diff --git a/zdump.c b/zdump.c
|
||||
index 8e3bf3e..d4e6084 100644
|
||||
--- a/zdump.c
|
||||
+++ b/zdump.c
|
||||
@@ -795,12 +795,14 @@ show(timezone_t tz, char *zone, time_t t, bool v)
|
||||
abbrok(abbr(tmp), zone);
|
||||
}
|
||||
|
||||
-#if !HAVE_SNPRINTF
|
||||
+#if HAVE_SNPRINTF
|
||||
+# define my_snprintf snprintf
|
||||
+#else
|
||||
# include <stdarg.h>
|
||||
|
||||
/* A substitute for snprintf that is good enough for zdump. */
|
||||
-static int
|
||||
-snprintf(char *s, size_t size, char const *format, ...)
|
||||
+static int ATTRIBUTE_FORMAT((printf, 3, 4))
|
||||
+my_snprintf(char *s, size_t size, char const *format, ...)
|
||||
{
|
||||
int n;
|
||||
va_list args;
|
||||
@@ -839,10 +841,10 @@ format_local_time(char *buf, size_t size, struct tm const *tm)
|
||||
{
|
||||
int ss = tm->tm_sec, mm = tm->tm_min, hh = tm->tm_hour;
|
||||
return (ss
|
||||
- ? snprintf(buf, size, "%02d:%02d:%02d", hh, mm, ss)
|
||||
+ ? my_snprintf(buf, size, "%02d:%02d:%02d", hh, mm, ss)
|
||||
: mm
|
||||
- ? snprintf(buf, size, "%02d:%02d", hh, mm)
|
||||
- : snprintf(buf, size, "%02d", hh));
|
||||
+ ? my_snprintf(buf, size, "%02d:%02d", hh, mm)
|
||||
+ : my_snprintf(buf, size, "%02d", hh));
|
||||
}
|
||||
|
||||
/* Store into BUF, of size SIZE, a formatted UTC offset for the
|
||||
@@ -877,10 +879,10 @@ format_utc_offset(char *buf, size_t size, struct tm const *tm, time_t t)
|
||||
mm = off / 60 % 60;
|
||||
hh = off / 60 / 60;
|
||||
return (ss || 100 <= hh
|
||||
- ? snprintf(buf, size, "%c%02ld%02d%02d", sign, hh, mm, ss)
|
||||
+ ? my_snprintf(buf, size, "%c%02ld%02d%02d", sign, hh, mm, ss)
|
||||
: mm
|
||||
- ? snprintf(buf, size, "%c%02ld%02d", sign, hh, mm)
|
||||
- : snprintf(buf, size, "%c%02ld", sign, hh));
|
||||
+ ? my_snprintf(buf, size, "%c%02ld%02d", sign, hh, mm)
|
||||
+ : my_snprintf(buf, size, "%c%02ld", sign, hh));
|
||||
}
|
||||
|
||||
/* Store into BUF (of size SIZE) a quoted string representation of P.
|
||||
@@ -983,15 +985,16 @@ istrftime(char *buf, size_t size, char const *time_fmt,
|
||||
for (abp = ab; is_alpha(*abp); abp++)
|
||||
continue;
|
||||
len = (!*abp && *ab
|
||||
- ? snprintf(b, s, "%s", ab)
|
||||
+ ? my_snprintf(b, s, "%s", ab)
|
||||
: format_quoted_string(b, s, ab));
|
||||
if (s <= len)
|
||||
return false;
|
||||
b += len, s -= len;
|
||||
}
|
||||
- formatted_len = (tm->tm_isdst
|
||||
- ? snprintf(b, s, &"\t\t%d"[show_abbr], tm->tm_isdst)
|
||||
- : 0);
|
||||
+ formatted_len
|
||||
+ = (tm->tm_isdst
|
||||
+ ? my_snprintf(b, s, &"\t\t%d"[show_abbr], tm->tm_isdst)
|
||||
+ : 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -3,16 +3,19 @@
|
||||
SUMMARY = "tzcode, timezone zoneinfo utils -- zic, zdump, tzselect"
|
||||
LICENSE = "PD & BSD & BSD-3-Clause"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=ef1a352b901ee7b75a75df8171d6aca7"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=c679c9d6b02bc2757b3eaf8f53c43fba"
|
||||
|
||||
SRC_URI =" http://www.iana.org/time-zones/repository/releases/tzcode${PV}.tar.gz;name=tzcode \
|
||||
http://www.iana.org/time-zones/repository/releases/tzdata${PV}.tar.gz;name=tzdata"
|
||||
http://www.iana.org/time-zones/repository/releases/tzdata${PV}.tar.gz;name=tzdata \
|
||||
file://0001-Fix-Makefile-quoting-bug.patch \
|
||||
file://0002-Port-zdump-to-C90-snprintf.patch"
|
||||
|
||||
UPSTREAM_CHECK_URI = "http://www.iana.org/time-zones"
|
||||
|
||||
SRC_URI[tzcode.md5sum] = "afaf15deb13759e8b543d86350385b16"
|
||||
SRC_URI[tzcode.sha256sum] = "4d1735bb54e22b8d7443d4d1f1a13d007ae11be79a35e51f8e8322fb8e292d40"
|
||||
SRC_URI[tzdata.md5sum] = "50dc0dc50c68644c1f70804f2e7a1625"
|
||||
SRC_URI[tzdata.sha256sum] = "f8242a522ea3496b0ce4ff4f2e75a049178da21001a08b8e666d8cbe07d18086"
|
||||
SRC_URI[tzcode.md5sum] = "2fe6986231db5182c61d565021a0cd7b"
|
||||
SRC_URI[tzcode.sha256sum] = "81e8b4bc23e60906640c266bbff3789661e22f0fa29fe61b96ec7c2816c079b7"
|
||||
SRC_URI[tzdata.md5sum] = "1e751e7e08f8b68530674f04619d894d"
|
||||
SRC_URI[tzdata.sha256sum] = "d6543f92a929826318e2f44ff3a7611ce5f565a43e10250b42599d0ba4cbd90b"
|
||||
|
||||
S = "${WORKDIR}"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user