* Re: [PATCH] package.bbclass: allow using EXCLUDE_FROM_SHLIBS for subpackages
From: Andrii Bordunov @ 2016-11-15 15:05 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <2f612347-5351-fc20-956e-1cf84a5189ff@cisco.com>
Ping-2. Guys? Anything?
Thank you,
Andrii
On 19.10.16 16:58, Andrii Bordunov wrote:
> Ping? Any comments?
>
>
>
> Thank you,
> Andrii
>
> On 10.10.16 20:02, Andrii Bordunov wrote:
>> Some packages containing shared libraries might be registered
>> as shlib providers when they shouldn't (for example, the lib is for
>> their private use and must not generate any dependency).
>>
>> EXCLUDE_FROM_SHLIBS is targeted at that, but it could be set
>> for entire recipe only.
>>
>> This patch expands EXCLUDE_FROM_SHLIBS usage, so now it's possible
>> to set it in a style similar with RDEPENDS. For example:
>> EXCLUDE_FROM_SHLIBS_${PN}-ptest = "1"
>>
>> Signed-off-by: Andrii Bordunov <aborduno@cisco.com>
>> ---
>> meta/classes/package.bbclass | 12 ++++++++++--
>> 1 file changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
>> index a6f0a7a..9bf43dc 100644
>> --- a/meta/classes/package.bbclass
>> +++ b/meta/classes/package.bbclass
>> @@ -1499,6 +1499,14 @@ python package_do_shlibs() {
>> libdir_re = re.compile(".*/%s$" % d.getVar('baselib', True))
>>
>> packages = d.getVar('PACKAGES', True)
>> +
>> + shlib_pkgs = []
>> + for pkg in packages.split():
>> + if d.getVar('EXCLUDE_FROM_SHLIBS_' + pkg, 0):
>> + bb.note("not generating shlibs for %s" % pkg)
>> + else:
>> + shlib_pkgs.append(pkg)
>> +
>> targetos = d.getVar('TARGET_OS', True)
>>
>> workdir = d.getVar('WORKDIR', True)
>> @@ -1614,7 +1622,7 @@ python package_do_shlibs() {
>> needed = {}
>> shlib_provider = oe.package.read_shlib_providers(d)
>>
>> - for pkg in packages.split():
>> + for pkg in shlib_pkgs:
>> private_libs = d.getVar('PRIVATE_LIBS_' + pkg, True) or
>> d.getVar('PRIVATE_LIBS', True) or ""
>> private_libs = private_libs.split()
>> needs_ldconfig = False
>> @@ -1684,7 +1692,7 @@ python package_do_shlibs() {
>>
>> libsearchpath = [d.getVar('libdir', True),
>> d.getVar('base_libdir', True)]
>>
>> - for pkg in packages.split():
>> + for pkg in shlib_pkgs:
>> bb.debug(2, "calculating shlib requirements for %s" % pkg)
>>
>> deps = list()
>>
^ permalink raw reply
* [PATCH V3] subprocess: remove strings and migrate to direct arrays
From: Stephano Cetola @ 2016-11-15 14:28 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <20161115142842.75276-1-stephano.cetola@linux.intel.com>
When using subprocess call and check_output, it is better to use arrays
rather than strings when possible to avoid whitespace and quoting
problems.
[ YOCTO #9342 ]
Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
---
meta/lib/oe/package.py | 13 +--
meta/lib/oe/package_manager.py | 229 ++++++++++++++++++++---------------------
2 files changed, 118 insertions(+), 124 deletions(-)
diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py
index 02642f2..ae60a58 100644
--- a/meta/lib/oe/package.py
+++ b/meta/lib/oe/package.py
@@ -18,23 +18,24 @@ def runstrip(arg):
newmode = origmode | stat.S_IWRITE | stat.S_IREAD
os.chmod(file, newmode)
- extraflags = ""
+ stripcmd = [strip]
# kernel module
if elftype & 16:
- extraflags = "--strip-debug --remove-section=.comment --remove-section=.note --preserve-dates"
+ stripcmd.extend(["--strip-debug", "--remove-section=.comment",
+ "--remove-section=.note", "--preserve-dates"])
# .so and shared library
elif ".so" in file and elftype & 8:
- extraflags = "--remove-section=.comment --remove-section=.note --strip-unneeded"
+ stripcmd.extend(["--remove-section=.comment", "--remove-section=.note", "--strip-unneeded"])
# shared or executable:
elif elftype & 8 or elftype & 4:
- extraflags = "--remove-section=.comment --remove-section=.note"
+ stripcmd.extend(["--remove-section=.comment", "--remove-section=.note"])
- stripcmd = "'%s' %s '%s'" % (strip, extraflags, file)
+ stripcmd.append(file)
bb.debug(1, "runstrip: %s" % stripcmd)
try:
- output = subprocess.check_output(stripcmd, stderr=subprocess.STDOUT, shell=True)
+ output = subprocess.check_output(stripcmd, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
bb.error("runstrip: '%s' strip command failed with %s (%s)" % (stripcmd, e.returncode, e.output))
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index a9d216a..5fbfa7a 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -358,12 +358,11 @@ class RpmPkgsList(PkgsList):
RpmIndexer(d, rootfs_dir).get_ml_prefix_and_os_list(arch_var, os_var)
# Determine rpm version
- cmd = "%s --version" % self.rpm_cmd
try:
- output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True).decode("utf-8")
+ output = subprocess.check_output([self.rpm_cmd, "--version"], stderr=subprocess.STDOUT).decode("utf-8")
except subprocess.CalledProcessError as e:
bb.fatal("Getting rpm version failed. Command '%s' "
- "returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8")))
+ "returned %d:\n%s" % (self.rpm_cmd, e.returncode, e.output.decode("utf-8")))
'''
Translate the RPM/Smart format names to the OE multilib format names
@@ -412,16 +411,15 @@ class RpmPkgsList(PkgsList):
return output
def list_pkgs(self):
- cmd = self.rpm_cmd + ' --root ' + self.rootfs_dir
- cmd += ' -D "_dbpath /var/lib/rpm" -qa'
- cmd += " --qf '[%{NAME} %{ARCH} %{VERSION} %{PACKAGEORIGIN}\n]'"
+ cmd = [self.rpm_cmd, '--root', self.rootfs_dir]
+ cmd.extend(['-D', '_dbpath /var/lib/rpm'])
+ cmd.extend(['-qa', '--qf', '[%{NAME} %{ARCH} %{VERSION} %{PACKAGEORIGIN}\n]'])
try:
- # bb.note(cmd)
- tmp_output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True).strip().decode("utf-8")
+ tmp_output = subprocess.check_output(cmd, stderr=subprocess.STDOUT).strip().decode("utf-8")
except subprocess.CalledProcessError as e:
bb.fatal("Cannot get the installed packages list. Command '%s' "
- "returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8")))
+ "returned %d:\n%s" % (' '.join(cmd), e.returncode, e.output.decode("utf-8")))
output = dict()
deps = dict()
@@ -672,11 +670,11 @@ class RpmPM(PackageManager):
# 2 = --log-level=debug
# 3 = --log-level=debug plus dumps of scriplet content and command invocation
self.debug_level = int(d.getVar('ROOTFS_RPM_DEBUG', True) or "0")
- self.smart_opt = "--log-level=%s --data-dir=%s" % \
+ self.smart_opt = ["--log-level=%s" %
("warning" if self.debug_level == 0 else
"info" if self.debug_level == 1 else
- "debug",
- os.path.join(target_rootfs, 'var/lib/smart'))
+ "debug"), "--data-dir=%s" %
+ os.path.join(target_rootfs, 'var/lib/smart')]
self.scriptlet_wrapper = self.d.expand('${WORKDIR}/scriptlet_wrapper')
self.solution_manifest = self.d.expand('${T}/saved/%s_solution' %
self.task_name)
@@ -732,18 +730,18 @@ class RpmPM(PackageManager):
for arch in arch_list:
bb.note('Adding Smart channel url%d%s (%s)' %
(uri_iterator, arch, channel_priority))
- self._invoke_smart('channel --add url%d-%s type=rpm-md baseurl=%s/%s -y'
- % (uri_iterator, arch, uri, arch))
- self._invoke_smart('channel --set url%d-%s priority=%d' %
- (uri_iterator, arch, channel_priority))
+ self._invoke_smart(['channel', '--add', 'url%d-%s' % (uri_iterator, arch),
+ 'type=rpm-md', 'baseurl=%s/%s' % (uri, arch), '-y'])
+ self._invoke_smart(['channel', '--set', 'url%d-%s' % (uri_iterator, arch),
+ 'priority=%d' % channel_priority])
channel_priority -= 5
else:
bb.note('Adding Smart channel url%d (%s)' %
(uri_iterator, channel_priority))
- self._invoke_smart('channel --add url%d type=rpm-md baseurl=%s -y'
- % (uri_iterator, uri))
- self._invoke_smart('channel --set url%d priority=%d' %
- (uri_iterator, channel_priority))
+ self._invoke_smart(['channel', '--add', 'url%d' % uri_iterator,
+ 'type=rpm-md', 'baseurl=%s' % uri, '-y'])
+ self._invoke_smart(['channel', '--set', 'url%d' % uri_iterator,
+ 'priority=%d' % channel_priority])
channel_priority -= 5
uri_iterator += 1
@@ -774,18 +772,17 @@ class RpmPM(PackageManager):
self._create_configs(platform, platform_extra)
+ #takes array args
def _invoke_smart(self, args):
- cmd = "%s %s %s" % (self.smart_cmd, self.smart_opt, args)
+ cmd = [self.smart_cmd] + self.smart_opt + args
# bb.note(cmd)
try:
- complementary_pkgs = subprocess.check_output(cmd,
- stderr=subprocess.STDOUT,
- shell=True).decode("utf-8")
+ complementary_pkgs = subprocess.check_output(cmd,stderr=subprocess.STDOUT).decode("utf-8")
# bb.note(complementary_pkgs)
return complementary_pkgs
except subprocess.CalledProcessError as e:
bb.fatal("Could not invoke smart. Command "
- "'%s' returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8")))
+ "'%s' returned %d:\n%s" % (' '.join(cmd), e.returncode, e.output.decode("utf-8")))
def _search_pkg_name_in_feeds(self, pkg, feed_archs):
for arch in feed_archs:
@@ -800,19 +797,23 @@ class RpmPM(PackageManager):
# Search provides if not found by pkgname.
bb.note('Not found %s by name, searching provides ...' % pkg)
- cmd = "%s %s query --provides %s --show-format='$name-$version'" % \
- (self.smart_cmd, self.smart_opt, pkg)
- cmd += " | sed -ne 's/ *Provides://p'"
- bb.note('cmd: %s' % cmd)
- output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True).decode("utf-8")
- # Found a provider
- if output:
- bb.note('Found providers for %s: %s' % (pkg, output))
- for p in output.split():
- for arch in feed_archs:
- arch = arch.replace('-', '_')
- if p.rstrip().endswith('@' + arch):
- return p
+ cmd = [self.smart_cmd] + self.smart_opt + ["query", "--provides", pkg,
+ "--show-format='$name-$version'"]
+ bb.note('cmd: %s' % ' '.join(cmd))
+ ps = subprocess.Popen(cmd, stdout=subprocess.PIPE)
+ try:
+ output = subprocess.check_output(["sed", "-ne", "s/ *Provides://p"],
+ stdin=ps.stdout, stderr=subprocess.STDOUT).decode("utf-8")
+ # Found a provider
+ if output:
+ bb.note('Found providers for %s: %s' % (pkg, output))
+ for p in output.split():
+ for arch in feed_archs:
+ arch = arch.replace('-', '_')
+ if p.rstrip().endswith('@' + arch):
+ return p
+ except subprocess.CalledProcessError as e:
+ bb.error("Failed running smart query on package %s." % pkg)
return ""
@@ -949,30 +950,32 @@ class RpmPM(PackageManager):
open(db_config_dir, 'w+').write(DB_CONFIG_CONTENT)
# Create database so that smart doesn't complain (lazy init)
- opt = "-qa"
- cmd = "%s --root %s --dbpath /var/lib/rpm %s > /dev/null" % (
- self.rpm_cmd, self.target_rootfs, opt)
+ cmd = [self.rpm_cmd, '--root', self.target_rootfs, '--dbpath', '/var/lib/rpm', '-qa']
try:
- subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+ subprocess.check_output(cmd, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
bb.fatal("Create rpm database failed. Command '%s' "
- "returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8")))
+ "returned %d:\n%s" % (' '.join(cmd), e.returncode, e.output.decode("utf-8")))
# Import GPG key to RPM database of the target system
if self.d.getVar('RPM_SIGN_PACKAGES', True) == '1':
pubkey_path = self.d.getVar('RPM_GPG_PUBKEY', True)
- cmd = "%s --root %s --dbpath /var/lib/rpm --import %s > /dev/null" % (
- self.rpm_cmd, self.target_rootfs, pubkey_path)
- subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+ cmd = [self.rpm_cmd, '--root', self.target_rootfs, '--dbpath', '/var/lib/rpm', '--import', pubkey_path]
+ try:
+ subprocess.check_output(cmd, stderr=subprocess.STDOUT)
+ except subprocess.CalledProcessError as e:
+ bb.fatal("Import GPG key failed. Command '%s' "
+ "returned %d:\n%s" % (' '.join(cmd), e.returncode, e.output.decode("utf-8")))
+
# Configure smart
bb.note("configuring Smart settings")
bb.utils.remove(os.path.join(self.target_rootfs, 'var/lib/smart'),
True)
- self._invoke_smart('config --set rpm-root=%s' % self.target_rootfs)
- self._invoke_smart('config --set rpm-dbpath=/var/lib/rpm')
- self._invoke_smart('config --set rpm-extra-macros._var=%s' %
- self.d.getVar('localstatedir', True))
- cmd = "config --set rpm-extra-macros._tmppath=/%s/tmp" % (self.install_dir_name)
+ self._invoke_smart(['config', '--set', 'rpm-root=%s' % self.target_rootfs])
+ self._invoke_smart(['config', '--set', 'rpm-dbpath=/var/lib/rpm'])
+ self._invoke_smart(['config', '--set', 'rpm-extra-macros._var=%s' %
+ self.d.getVar('localstatedir', True)])
+ cmd = ["config", "--set", "rpm-extra-macros._tmppath=/%s/tmp" % self.install_dir_name]
prefer_color = self.d.getVar('RPM_PREFER_ELF_ARCH', True)
if prefer_color:
@@ -986,32 +989,32 @@ class RpmPM(PackageManager):
['mips64', 'mips64el']:
bb.fatal("RPM_PREFER_ELF_ARCH = \"4\" is for mips64 or mips64el "
"only.")
- self._invoke_smart('config --set rpm-extra-macros._prefer_color=%s'
- % prefer_color)
+ self._invoke_smart(['config', '--set', 'rpm-extra-macros._prefer_color=%s'
+ % prefer_color])
self._invoke_smart(cmd)
- self._invoke_smart('config --set rpm-ignoresize=1')
+ self._invoke_smart(['config', '--set', 'rpm-ignoresize=1'])
# Write common configuration for host and target usage
- self._invoke_smart('config --set rpm-nolinktos=1')
- self._invoke_smart('config --set rpm-noparentdirs=1')
+ self._invoke_smart(['config', '--set', 'rpm-nolinktos=1'])
+ self._invoke_smart(['config', '--set', 'rpm-noparentdirs=1'])
check_signature = self.d.getVar('RPM_CHECK_SIGNATURES', True)
if check_signature and check_signature.strip() == "0":
- self._invoke_smart('config --set rpm-check-signatures=false')
+ self._invoke_smart(['config', '--set rpm-check-signatures=false'])
for i in self.d.getVar('BAD_RECOMMENDATIONS', True).split():
- self._invoke_smart('flag --set ignore-recommends %s' % i)
+ self._invoke_smart(['flag', '--set', 'ignore-recommends', i])
# Do the following configurations here, to avoid them being
# saved for field upgrade
if self.d.getVar('NO_RECOMMENDATIONS', True).strip() == "1":
- self._invoke_smart('config --set ignore-all-recommends=1')
+ self._invoke_smart(['config', '--set', 'ignore-all-recommends=1'])
pkg_exclude = self.d.getVar('PACKAGE_EXCLUDE', True) or ""
for i in pkg_exclude.split():
- self._invoke_smart('flag --set exclude-packages %s' % i)
+ self._invoke_smart(['flag', '--set', 'exclude-packages', i])
# Optional debugging
- # self._invoke_smart('config --set rpm-log-level=debug')
- # cmd = 'config --set rpm-log-file=/tmp/smart-debug-logfile'
+ # self._invoke_smart(['config', '--set', 'rpm-log-level=debug'])
+ # cmd = ['config', '--set', 'rpm-log-file=/tmp/smart-debug-logfile']
# self._invoke_smart(cmd)
ch_already_added = []
for canonical_arch in platform_extra:
@@ -1030,16 +1033,16 @@ class RpmPM(PackageManager):
if not arch in ch_already_added:
bb.note('Adding Smart channel %s (%s)' %
(arch, channel_priority))
- self._invoke_smart('channel --add %s type=rpm-md baseurl=%s -y'
- % (arch, arch_channel))
- self._invoke_smart('channel --set %s priority=%d' %
- (arch, channel_priority))
+ self._invoke_smart(['channel', '--add', arch, 'type=rpm-md',
+ 'baseurl=%s' % arch_channel, '-y'])
+ self._invoke_smart(['channel', '--set', arch, 'priority=%d' %
+ channel_priority])
channel_priority -= 5
ch_already_added.append(arch)
bb.note('adding Smart RPM DB channel')
- self._invoke_smart('channel --add rpmsys type=rpm-sys -y')
+ self._invoke_smart(['channel', '--add', 'rpmsys', 'type=rpm-sys', '-y'])
# Construct install scriptlet wrapper.
# Scripts need to be ordered when executed, this ensures numeric order.
@@ -1102,15 +1105,15 @@ class RpmPM(PackageManager):
bb.note("configuring RPM cross-install scriptlet_wrapper")
os.chmod(self.scriptlet_wrapper, 0o755)
- cmd = 'config --set rpm-extra-macros._cross_scriptlet_wrapper=%s' % \
- self.scriptlet_wrapper
+ cmd = ['config', '--set', 'rpm-extra-macros._cross_scriptlet_wrapper=%s' %
+ self.scriptlet_wrapper]
self._invoke_smart(cmd)
# Debug to show smart config info
- # bb.note(self._invoke_smart('config --show'))
+ # bb.note(self._invoke_smart(['config', '--show']))
def update(self):
- self._invoke_smart('update rpmsys')
+ self._invoke_smart(['update', 'rpmsys'])
def get_rdepends_recursively(self, pkgs):
# pkgs will be changed during the loop, so use [:] to make a copy.
@@ -1207,20 +1210,19 @@ class RpmPM(PackageManager):
return
if not attempt_only:
bb.note('to be installed: %s' % ' '.join(pkgs))
- cmd = "%s %s install -y %s" % \
- (self.smart_cmd, self.smart_opt, ' '.join(pkgs))
- bb.note(cmd)
+ cmd = [self.smart_cmd] + self.smart_opt + ["install", "-y"] + pkgs
+ bb.note(' '.join(cmd))
else:
bb.note('installing attempt only packages...')
bb.note('Attempting %s' % ' '.join(pkgs))
- cmd = "%s %s install --attempt -y %s" % \
- (self.smart_cmd, self.smart_opt, ' '.join(pkgs))
+ cmd = [self.smart_cmd] + self.smart_opt + ["install", "--attempt",
+ "-y"] + pkgs
try:
- output = subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT).decode("utf-8")
+ output = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode("utf-8")
bb.note(output)
except subprocess.CalledProcessError as e:
bb.fatal("Unable to install packages. Command '%s' "
- "returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8")))
+ "returned %d:\n%s" % (' '.join(cmd), e.returncode, e.output.decode("utf-8")))
'''
Remove pkgs with smart, the pkg name is smart/rpm format
@@ -1229,24 +1231,19 @@ class RpmPM(PackageManager):
bb.note('to be removed: ' + ' '.join(pkgs))
if not with_dependencies:
- cmd = "%s -e --nodeps " % self.rpm_cmd
- cmd += "--root=%s " % self.target_rootfs
- cmd += "--dbpath=/var/lib/rpm "
- cmd += "--define='_cross_scriptlet_wrapper %s' " % \
- self.scriptlet_wrapper
- cmd += "--define='_tmppath /%s/tmp' %s" % (self.install_dir_name, ' '.join(pkgs))
+ cmd = [self.rpm_cmd] + ["-e", "--nodeps", "--root=%s" %
+ self.target_rootfs, "--dbpath=/var/lib/rpm",
+ "--define='_cross_scriptlet_wrapper %s'" %
+ self.scriptlet_wrapper,
+ "--define='_tmppath /%s/tmp'" % self.install_dir_name] + pkgs
else:
# for pkg in pkgs:
# bb.note('Debug: What required: %s' % pkg)
- # bb.note(self._invoke_smart('query %s --show-requiredby' % pkg))
-
- cmd = "%s %s remove -y %s" % (self.smart_cmd,
- self.smart_opt,
- ' '.join(pkgs))
-
+ # bb.note(self._invoke_smart(['query', pkg, '--show-requiredby']))
+ cmd = [self.smart_cmd] + self.smart_opt + ["remove", "-y"] + pkgs
try:
- bb.note(cmd)
- output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True).decode("utf-8")
+ bb.note(' '.join(cmd))
+ output = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode("utf-8")
bb.note(output)
except subprocess.CalledProcessError as e:
bb.note("Unable to remove packages. Command '%s' "
@@ -1254,7 +1251,7 @@ class RpmPM(PackageManager):
def upgrade(self):
bb.note('smart upgrade')
- self._invoke_smart('upgrade')
+ self._invoke_smart(['upgrade'])
def write_index(self):
result = self.indexer.write_index()
@@ -1307,16 +1304,13 @@ class RpmPM(PackageManager):
pkgs = self._pkg_translate_oe_to_smart(pkgs, False)
install_pkgs = list()
- cmd = "%s %s install -y --dump %s 2>%s" % \
- (self.smart_cmd,
- self.smart_opt,
- ' '.join(pkgs),
- self.solution_manifest)
+ cmd = [self.smart_cmd] + self.smart_opt + ['install', '-y', '--dump',
+ self.solution_manifest]
try:
# Disable rpmsys channel for the fake install
- self._invoke_smart('channel --disable rpmsys')
+ self._invoke_smart(['channel', '--disable', 'rpmsys'])
- subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+ subprocess.check_output(cmd, stderr=subprocess.STDOUT)
with open(self.solution_manifest, 'r') as manifest:
for pkg in manifest.read().split('\n'):
if '@' in pkg:
@@ -1325,7 +1319,7 @@ class RpmPM(PackageManager):
bb.note("Unable to dump install packages. Command '%s' "
"returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8")))
# Recovery rpmsys channel
- self._invoke_smart('channel --enable rpmsys')
+ self._invoke_smart(['channel', '--enable', 'rpmsys'])
return install_pkgs
'''
@@ -1355,17 +1349,16 @@ class RpmPM(PackageManager):
def dump_all_available_pkgs(self):
available_manifest = self.d.expand('${T}/saved/available_pkgs.txt')
available_pkgs = list()
- cmd = "%s %s query --output %s" % \
- (self.smart_cmd, self.smart_opt, available_manifest)
+ cmd = [self.smart_cmd] + self.smart_opt + ['query', '--output', available_manifest]
try:
- subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+ subprocess.check_output(cmd, stderr=subprocess.STDOUT)
with open(available_manifest, 'r') as manifest:
for pkg in manifest.read().split('\n'):
if '@' in pkg:
available_pkgs.append(pkg.strip())
except subprocess.CalledProcessError as e:
bb.note("Unable to list all available packages. Command '%s' "
- "returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8")))
+ "returned %d:\n%s" % (' '.join(cmd), e.returncode, e.output.decode("utf-8")))
self.fullpkglist = available_pkgs
@@ -1404,11 +1397,11 @@ class RpmPM(PackageManager):
bb.utils.remove(os.path.join(self.target_rootfs, 'var/lib/smart'),
True)
- self._invoke_smart('config --set rpm-nolinktos=1')
- self._invoke_smart('config --set rpm-noparentdirs=1')
+ self._invoke_smart(['config', '--set', 'rpm-nolinktos=1'])
+ self._invoke_smart(['config', '--set', 'rpm-noparentdirs=1'])
for i in self.d.getVar('BAD_RECOMMENDATIONS', True).split():
- self._invoke_smart('flag --set ignore-recommends %s' % i)
- self._invoke_smart('channel --add rpmsys type=rpm-sys -y')
+ self._invoke_smart(['flag', '--set', 'ignore-recommends', i])
+ self._invoke_smart(['channel', '--add', 'rpmsys', 'type=rpm-sys', '-y'])
'''
The rpm db lock files were produced after invoking rpm to query on
@@ -1425,12 +1418,12 @@ class RpmPM(PackageManager):
Returns a dictionary with the package info.
"""
def package_info(self, pkg):
- cmd = "%s %s info --urls %s" % (self.smart_cmd, self.smart_opt, pkg)
+ cmd = [self.smart_cmd] + self.smart_opt + ['info', '--urls', pkg]
try:
- output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True).decode("utf-8")
+ output = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode("utf-8")
except subprocess.CalledProcessError as e:
bb.fatal("Unable to list available packages. Command '%s' "
- "returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8")))
+ "returned %d:\n%s" % (' '.join(cmd), e.returncode, e.output.decode("utf-8")))
# Set default values to avoid UnboundLocalError
arch = ""
@@ -1550,18 +1543,18 @@ class OpkgDpkgPM(PackageManager):
os.chdir(tmp_dir)
try:
- cmd = "%s x %s" % (ar_cmd, pkg_path)
- output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
- cmd = "%s xf data.tar.*" % tar_cmd
- output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+ cmd = [ar_cmd, 'x', pkg_path]
+ output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
+ cmd = [tar_cmd, 'xf', 'data.tar.*']
+ output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
bb.utils.remove(tmp_dir, recurse=True)
bb.fatal("Unable to extract %s package. Command '%s' "
- "returned %d:\n%s" % (pkg_path, cmd, e.returncode, e.output.decode("utf-8")))
+ "returned %d:\n%s" % (pkg_path, ' '.join(cmd), e.returncode, e.output.decode("utf-8")))
except OSError as e:
bb.utils.remove(tmp_dir, recurse=True)
bb.fatal("Unable to extract %s package. Command '%s' "
- "returned %d:\n%s at %s" % (pkg_path, cmd, e.errno, e.strerror, e.filename))
+ "returned %d:\n%s at %s" % (pkg_path, ' '.join(cmd), e.errno, e.strerror, e.filename))
bb.note("Extracted %s to %s" % (pkg_path, tmp_dir))
bb.utils.remove(os.path.join(tmp_dir, "debian-binary"))
--
2.10.2
^ permalink raw reply related
* [PATCH V3] Cleanup subprocess calls
From: Stephano Cetola @ 2016-11-15 14:28 UTC (permalink / raw)
To: openembedded-core
Changed since V2:
Fixed rpm "remove" function, changing strings to arrays.
This fixes the error when using "read-only-rootfs" image feature.
Stephano Cetola (1):
subprocess: remove strings and migrate to direct arrays
meta/lib/oe/package.py | 13 +--
meta/lib/oe/package_manager.py | 229 ++++++++++++++++++++---------------------
2 files changed, 118 insertions(+), 124 deletions(-)
--
2.10.2
^ permalink raw reply
* Re: [PATCH] added recipe for libdbus-c++
From: Burton, Ross @ 2016-11-15 14:23 UTC (permalink / raw)
To: Thilo Cestonaro; +Cc: OE-core
In-Reply-To: <20161115134607.13337-1-thilo.cestonaro@ts.fujitsu.com>
[-- Attachment #1: Type: text/plain, Size: 1168 bytes --]
On 15 November 2016 at 13:46, Thilo Cestonaro <
thilo.cestonaro@ts.fujitsu.com> wrote:
> Signed-off-by: Thilo Cestonaro <thilo.cestonaro@ts.fujitsu.com>
>
As Alex said, please submit this to meta-oe as there's no strong rationale
to keep it in oe-core, especially considering it's abandoned.
The remove_CXX_FOR_BUILD-stuff patch can be trimmed to just modify
configure.ac and tools/Makefile.am, the other files will be regenerated at
do_configure and patching them can cause conflicts if upstream ever makes a
new release.
Also please explain clearly why that has to be removed in the patch header
because usually we need to patch *in* the _FOR_BUILD macros: I was curious
and ended up looking at the build to understand why. AFAICT it's because
upstream if cross-compiling it refuses to build target tools and will only
build host tools so the test suite can run, but disabling the tests and
patching out CXX_FOR_BUILD we can build target tools. The downside is that
we have no test suite, which is useful (see the ptest class).
Thank you for being the first person in a long time to actually submit the
recipe to the community!
Ross
[-- Attachment #2: Type: text/html, Size: 1868 bytes --]
^ permalink raw reply
* Re: [PATCH] added recipe for libdbus-c++
From: Alexander Kanavin @ 2016-11-15 14:05 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <20161115134607.13337-1-thilo.cestonaro@ts.fujitsu.com>
On 11/15/2016 03:46 PM, Thilo Cestonaro wrote:
> Signed-off-by: Thilo Cestonaro <thilo.cestonaro@ts.fujitsu.com>
> ---
> .../fix-missing-unistd.h-include.patch | 12 +
> .../remove-CXX_FOR_BUILD-stuff.patch | 257 +++++++++++++++++++++
> meta/recipes-core/dbus/libdbus-c++_0.9.0.bb | 24 ++
The whole thing should go to meta-openembedded (mailing list
openembedded-devel). Patches are missing description of what they are
for, and Upstream-Status, and Signed-off-by lines. Follow this please:
http://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Alex
^ permalink raw reply
* [PATCH] added recipe for libdbus-c++
From: Thilo Cestonaro @ 2016-11-15 13:46 UTC (permalink / raw)
To: openembedded-core
Signed-off-by: Thilo Cestonaro <thilo.cestonaro@ts.fujitsu.com>
---
.../fix-missing-unistd.h-include.patch | 12 +
.../remove-CXX_FOR_BUILD-stuff.patch | 257 +++++++++++++++++++++
meta/recipes-core/dbus/libdbus-c++_0.9.0.bb | 24 ++
3 files changed, 293 insertions(+)
create mode 100644 meta/recipes-core/dbus/libdbus-c++-0.9.0/fix-missing-unistd.h-include.patch
create mode 100644 meta/recipes-core/dbus/libdbus-c++-0.9.0/remove-CXX_FOR_BUILD-stuff.patch
create mode 100644 meta/recipes-core/dbus/libdbus-c++_0.9.0.bb
diff --git a/meta/recipes-core/dbus/libdbus-c++-0.9.0/fix-missing-unistd.h-include.patch b/meta/recipes-core/dbus/libdbus-c++-0.9.0/fix-missing-unistd.h-include.patch
new file mode 100644
index 0000000..5cb8096
--- /dev/null
+++ b/meta/recipes-core/dbus/libdbus-c++-0.9.0/fix-missing-unistd.h-include.patch
@@ -0,0 +1,12 @@
+diff --git a/include/dbus-c++/eventloop-integration.h b/include/dbus-c++/eventloop-integration.h
+index 1b0302e..3e44304 100644
+--- a/include/dbus-c++/eventloop-integration.h
++++ b/include/dbus-c++/eventloop-integration.h
+@@ -26,6 +26,7 @@
+ #define __DBUSXX_EVENTLOOP_INTEGRATION_H
+
+ #include <errno.h>
++#include <unistd.h>
+ #include "api.h"
+ #include "dispatcher.h"
+ #include "util.h"
diff --git a/meta/recipes-core/dbus/libdbus-c++-0.9.0/remove-CXX_FOR_BUILD-stuff.patch b/meta/recipes-core/dbus/libdbus-c++-0.9.0/remove-CXX_FOR_BUILD-stuff.patch
new file mode 100644
index 0000000..af87174
--- /dev/null
+++ b/meta/recipes-core/dbus/libdbus-c++-0.9.0/remove-CXX_FOR_BUILD-stuff.patch
@@ -0,0 +1,257 @@
+diff -Naur libdbus-c++-0.9.0.ori/configure libdbus-c++-0.9.0/configure
+--- libdbus-c++-0.9.0.ori/configure 2016-11-15 14:25:36.085882774 +0100
++++ libdbus-c++-0.9.0/configure 2016-11-15 14:27:55.402913346 +0100
+@@ -800,7 +800,6 @@
+ GREP
+ SED
+ LIBTOOL
+-CXX_FOR_BUILD
+ am__fastdepCXX_FALSE
+ am__fastdepCXX_TRUE
+ CXXDEPMODE
+@@ -5233,8 +5232,6 @@
+
+
+
+-CXX_FOR_BUILD=${CXX_FOR_BUILD-${CXX}}
+-
+
+ case `pwd` in
+ *\ * | *\ *)
+diff -Naur libdbus-c++-0.9.0.ori/configure.ac libdbus-c++-0.9.0/configure.ac
+--- libdbus-c++-0.9.0.ori/configure.ac 2016-11-15 14:25:36.085882774 +0100
++++ libdbus-c++-0.9.0/configure.ac 2016-11-15 14:27:08.814568717 +0100
+@@ -64,9 +64,6 @@
+ AC_PROG_CC
+ AC_PROG_CXX
+
+-CXX_FOR_BUILD=${CXX_FOR_BUILD-${CXX}}
+-AC_SUBST(CXX_FOR_BUILD)
+-
+ AM_PROG_LIBTOOL
+
+ PKG_PROG_PKG_CONFIG
+diff -Naur libdbus-c++-0.9.0.ori/data/Makefile.in libdbus-c++-0.9.0/data/Makefile.in
+--- libdbus-c++-0.9.0.ori/data/Makefile.in 2016-11-15 14:25:36.085882774 +0100
++++ libdbus-c++-0.9.0/data/Makefile.in 2016-11-15 14:26:59.746501637 +0100
+@@ -66,7 +66,6 @@
+ CXXCPP = @CXXCPP@
+ CXXDEPMODE = @CXXDEPMODE@
+ CXXFLAGS = @CXXFLAGS@
+-CXX_FOR_BUILD = @CXX_FOR_BUILD@
+ CYGPATH_W = @CYGPATH_W@
+ DEFS = @DEFS@
+ DEPDIR = @DEPDIR@
+diff -Naur libdbus-c++-0.9.0.ori/doc/Makefile.in libdbus-c++-0.9.0/doc/Makefile.in
+--- libdbus-c++-0.9.0.ori/doc/Makefile.in 2016-11-15 14:25:36.085882774 +0100
++++ libdbus-c++-0.9.0/doc/Makefile.in 2016-11-15 14:27:33.790753474 +0100
+@@ -67,7 +67,6 @@
+ CXXCPP = @CXXCPP@
+ CXXDEPMODE = @CXXDEPMODE@
+ CXXFLAGS = @CXXFLAGS@
+-CXX_FOR_BUILD = @CXX_FOR_BUILD@
+ CYGPATH_W = @CYGPATH_W@
+ DEFS = @DEFS@
+ DEPDIR = @DEPDIR@
+diff -Naur libdbus-c++-0.9.0.ori/examples/echo/Makefile.in libdbus-c++-0.9.0/examples/echo/Makefile.in
+--- libdbus-c++-0.9.0.ori/examples/echo/Makefile.in 2016-11-15 14:25:36.089882803 +0100
++++ libdbus-c++-0.9.0/examples/echo/Makefile.in 2016-11-15 14:26:28.722272141 +0100
+@@ -105,7 +105,6 @@
+ CXXCPP = @CXXCPP@
+ CXXDEPMODE = @CXXDEPMODE@
+ CXXFLAGS = @CXXFLAGS@
+-CXX_FOR_BUILD = @CXX_FOR_BUILD@
+ CYGPATH_W = @CYGPATH_W@
+ DEFS = @DEFS@
+ DEPDIR = @DEPDIR@
+diff -Naur libdbus-c++-0.9.0.ori/examples/echo_ecore/Makefile.in libdbus-c++-0.9.0/examples/echo_ecore/Makefile.in
+--- libdbus-c++-0.9.0.ori/examples/echo_ecore/Makefile.in 2016-11-15 14:25:36.089882803 +0100
++++ libdbus-c++-0.9.0/examples/echo_ecore/Makefile.in 2016-11-15 14:26:41.446366266 +0100
+@@ -110,7 +110,6 @@
+ CXXCPP = @CXXCPP@
+ CXXDEPMODE = @CXXDEPMODE@
+ CXXFLAGS = @CXXFLAGS@
+-CXX_FOR_BUILD = @CXX_FOR_BUILD@
+ CYGPATH_W = @CYGPATH_W@
+ DEFS = @DEFS@
+ DEPDIR = @DEPDIR@
+diff -Naur libdbus-c++-0.9.0.ori/examples/ecore/Makefile.in libdbus-c++-0.9.0/examples/ecore/Makefile.in
+--- libdbus-c++-0.9.0.ori/examples/ecore/Makefile.in 2016-11-15 14:25:36.089882803 +0100
++++ libdbus-c++-0.9.0/examples/ecore/Makefile.in 2016-11-15 14:26:37.074333925 +0100
+@@ -100,7 +100,6 @@
+ CXXCPP = @CXXCPP@
+ CXXDEPMODE = @CXXDEPMODE@
+ CXXFLAGS = @CXXFLAGS@
+-CXX_FOR_BUILD = @CXX_FOR_BUILD@
+ CYGPATH_W = @CYGPATH_W@
+ DEFS = @DEFS@
+ DEPDIR = @DEPDIR@
+diff -Naur libdbus-c++-0.9.0.ori/examples/glib/Makefile.in libdbus-c++-0.9.0/examples/glib/Makefile.in
+--- libdbus-c++-0.9.0.ori/examples/glib/Makefile.in 2016-11-15 14:25:36.089882803 +0100
++++ libdbus-c++-0.9.0/examples/glib/Makefile.in 2016-11-15 14:26:33.630308448 +0100
+@@ -99,7 +99,6 @@
+ CXXCPP = @CXXCPP@
+ CXXDEPMODE = @CXXDEPMODE@
+ CXXFLAGS = @CXXFLAGS@
+-CXX_FOR_BUILD = @CXX_FOR_BUILD@
+ CYGPATH_W = @CYGPATH_W@
+ DEFS = @DEFS@
+ DEPDIR = @DEPDIR@
+diff -Naur libdbus-c++-0.9.0.ori/examples/hal/Makefile.in libdbus-c++-0.9.0/examples/hal/Makefile.in
+--- libdbus-c++-0.9.0.ori/examples/hal/Makefile.in 2016-11-15 14:25:36.089882803 +0100
++++ libdbus-c++-0.9.0/examples/hal/Makefile.in 2016-11-15 14:26:55.014466633 +0100
+@@ -96,7 +96,6 @@
+ CXXCPP = @CXXCPP@
+ CXXDEPMODE = @CXXDEPMODE@
+ CXXFLAGS = @CXXFLAGS@
+-CXX_FOR_BUILD = @CXX_FOR_BUILD@
+ CYGPATH_W = @CYGPATH_W@
+ DEFS = @DEFS@
+ DEPDIR = @DEPDIR@
+diff -Naur libdbus-c++-0.9.0.ori/examples/Makefile.in libdbus-c++-0.9.0/examples/Makefile.in
+--- libdbus-c++-0.9.0.ori/examples/Makefile.in 2016-11-15 14:25:36.089882803 +0100
++++ libdbus-c++-0.9.0/examples/Makefile.in 2016-11-15 14:26:46.122400856 +0100
+@@ -106,7 +106,6 @@
+ CXXCPP = @CXXCPP@
+ CXXDEPMODE = @CXXDEPMODE@
+ CXXFLAGS = @CXXFLAGS@
+-CXX_FOR_BUILD = @CXX_FOR_BUILD@
+ CYGPATH_W = @CYGPATH_W@
+ DEFS = @DEFS@
+ DEPDIR = @DEPDIR@
+diff -Naur libdbus-c++-0.9.0.ori/examples/properties/Makefile.in libdbus-c++-0.9.0/examples/properties/Makefile.in
+--- libdbus-c++-0.9.0.ori/examples/properties/Makefile.in 2016-11-15 14:25:36.089882803 +0100
++++ libdbus-c++-0.9.0/examples/properties/Makefile.in 2016-11-15 14:26:50.818435594 +0100
+@@ -99,7 +99,6 @@
+ CXXCPP = @CXXCPP@
+ CXXDEPMODE = @CXXDEPMODE@
+ CXXFLAGS = @CXXFLAGS@
+-CXX_FOR_BUILD = @CXX_FOR_BUILD@
+ CYGPATH_W = @CYGPATH_W@
+ DEFS = @DEFS@
+ DEPDIR = @DEPDIR@
+diff -Naur libdbus-c++-0.9.0.ori/Makefile.in libdbus-c++-0.9.0/Makefile.in
+--- libdbus-c++-0.9.0.ori/Makefile.in 2016-11-15 14:25:36.085882774 +0100
++++ libdbus-c++-0.9.0/Makefile.in 2016-11-15 14:27:02.834524481 +0100
+@@ -155,7 +155,6 @@
+ CXXCPP = @CXXCPP@
+ CXXDEPMODE = @CXXDEPMODE@
+ CXXFLAGS = @CXXFLAGS@
+-CXX_FOR_BUILD = @CXX_FOR_BUILD@
+ CYGPATH_W = @CYGPATH_W@
+ DEFS = @DEFS@
+ DEPDIR = @DEPDIR@
+diff -Naur libdbus-c++-0.9.0.ori/src/integration/ecore/Makefile.in libdbus-c++-0.9.0/src/integration/ecore/Makefile.in
+--- libdbus-c++-0.9.0.ori/src/integration/ecore/Makefile.in 2016-11-15 14:25:36.089882803 +0100
++++ libdbus-c++-0.9.0/src/integration/ecore/Makefile.in 2016-11-15 14:27:21.206660385 +0100
+@@ -122,7 +122,6 @@
+ CXXCPP = @CXXCPP@
+ CXXDEPMODE = @CXXDEPMODE@
+ CXXFLAGS = @CXXFLAGS@
+-CXX_FOR_BUILD = @CXX_FOR_BUILD@
+ CYGPATH_W = @CYGPATH_W@
+ DEFS = @DEFS@
+ DEPDIR = @DEPDIR@
+diff -Naur libdbus-c++-0.9.0.ori/src/integration/glib/Makefile.in libdbus-c++-0.9.0/src/integration/glib/Makefile.in
+--- libdbus-c++-0.9.0.ori/src/integration/glib/Makefile.in 2016-11-15 14:25:36.089882803 +0100
++++ libdbus-c++-0.9.0/src/integration/glib/Makefile.in 2016-11-15 14:27:17.274631299 +0100
+@@ -123,7 +123,6 @@
+ CXXCPP = @CXXCPP@
+ CXXDEPMODE = @CXXDEPMODE@
+ CXXFLAGS = @CXXFLAGS@
+-CXX_FOR_BUILD = @CXX_FOR_BUILD@
+ CYGPATH_W = @CYGPATH_W@
+ DEFS = @DEFS@
+ DEPDIR = @DEPDIR@
+diff -Naur libdbus-c++-0.9.0.ori/src/integration/Makefile.in libdbus-c++-0.9.0/src/integration/Makefile.in
+--- libdbus-c++-0.9.0.ori/src/integration/Makefile.in 2016-11-15 14:25:36.089882803 +0100
++++ libdbus-c++-0.9.0/src/integration/Makefile.in 2016-11-15 14:27:23.698678820 +0100
+@@ -106,7 +106,6 @@
+ CXXCPP = @CXXCPP@
+ CXXDEPMODE = @CXXDEPMODE@
+ CXXFLAGS = @CXXFLAGS@
+-CXX_FOR_BUILD = @CXX_FOR_BUILD@
+ CYGPATH_W = @CYGPATH_W@
+ DEFS = @DEFS@
+ DEPDIR = @DEPDIR@
+diff -Naur libdbus-c++-0.9.0.ori/src/Makefile.in libdbus-c++-0.9.0/src/Makefile.in
+--- libdbus-c++-0.9.0.ori/src/Makefile.in 2016-11-15 14:25:36.089882803 +0100
++++ libdbus-c++-0.9.0/src/Makefile.in 2016-11-15 14:27:12.270594283 +0100
+@@ -172,7 +172,6 @@
+ CXXCPP = @CXXCPP@
+ CXXDEPMODE = @CXXDEPMODE@
+ CXXFLAGS = @CXXFLAGS@
+-CXX_FOR_BUILD = @CXX_FOR_BUILD@
+ CYGPATH_W = @CYGPATH_W@
+ DEFS = @DEFS@
+ DEPDIR = @DEPDIR@
+diff -Naur libdbus-c++-0.9.0.ori/test/functional/Makefile.in libdbus-c++-0.9.0/test/functional/Makefile.in
+--- libdbus-c++-0.9.0.ori/test/functional/Makefile.in 2016-11-15 14:25:36.085882774 +0100
++++ libdbus-c++-0.9.0/test/functional/Makefile.in 2016-11-15 14:26:15.126171567 +0100
+@@ -106,7 +106,6 @@
+ CXXCPP = @CXXCPP@
+ CXXDEPMODE = @CXXDEPMODE@
+ CXXFLAGS = @CXXFLAGS@
+-CXX_FOR_BUILD = @CXX_FOR_BUILD@
+ CYGPATH_W = @CYGPATH_W@
+ DEFS = @DEFS@
+ DEPDIR = @DEPDIR@
+diff -Naur libdbus-c++-0.9.0.ori/test/functional/Test1/Makefile.in libdbus-c++-0.9.0/test/functional/Test1/Makefile.in
+--- libdbus-c++-0.9.0.ori/test/functional/Test1/Makefile.in 2016-11-15 14:25:36.085882774 +0100
++++ libdbus-c++-0.9.0/test/functional/Test1/Makefile.in 2016-11-15 14:26:11.670146002 +0100
+@@ -105,7 +105,6 @@
+ CXXCPP = @CXXCPP@
+ CXXDEPMODE = @CXXDEPMODE@
+ CXXFLAGS = @CXXFLAGS@
+-CXX_FOR_BUILD = @CXX_FOR_BUILD@
+ CYGPATH_W = @CYGPATH_W@
+ DEFS = @DEFS@
+ DEPDIR = @DEPDIR@
+diff -Naur libdbus-c++-0.9.0.ori/test/generator/Makefile.in libdbus-c++-0.9.0/test/generator/Makefile.in
+--- libdbus-c++-0.9.0.ori/test/generator/Makefile.in 2016-11-15 14:25:36.085882774 +0100
++++ libdbus-c++-0.9.0/test/generator/Makefile.in 2016-11-15 14:26:02.622079070 +0100
+@@ -114,7 +114,6 @@
+ CXXCPP = @CXXCPP@
+ CXXDEPMODE = @CXXDEPMODE@
+ CXXFLAGS = @CXXFLAGS@
+-CXX_FOR_BUILD = @CXX_FOR_BUILD@
+ CYGPATH_W = @CYGPATH_W@
+ DEFS = @DEFS@
+ DEPDIR = @DEPDIR@
+diff -Naur libdbus-c++-0.9.0.ori/test/Makefile.in libdbus-c++-0.9.0/test/Makefile.in
+--- libdbus-c++-0.9.0.ori/test/Makefile.in 2016-11-15 14:25:36.085882774 +0100
++++ libdbus-c++-0.9.0/test/Makefile.in 2016-11-15 14:26:07.770117152 +0100
+@@ -106,7 +106,6 @@
+ CXXCPP = @CXXCPP@
+ CXXDEPMODE = @CXXDEPMODE@
+ CXXFLAGS = @CXXFLAGS@
+-CXX_FOR_BUILD = @CXX_FOR_BUILD@
+ CYGPATH_W = @CYGPATH_W@
+ DEFS = @DEFS@
+ DEPDIR = @DEPDIR@
+diff -Naur libdbus-c++-0.9.0.ori/tools/Makefile.am libdbus-c++-0.9.0/tools/Makefile.am
+--- libdbus-c++-0.9.0.ori/tools/Makefile.am 2016-11-15 14:25:36.089882803 +0100
++++ libdbus-c++-0.9.0/tools/Makefile.am 2016-11-15 14:26:19.454203583 +0100
+@@ -1,7 +1,5 @@
+ # hacky, but ...
+
+-CXX = $(CXX_FOR_BUILD)
+-
+ AM_CPPFLAGS = \
+ $(dbus_CFLAGS) \
+ $(xml_CFLAGS) \
+diff -Naur libdbus-c++-0.9.0.ori/tools/Makefile.in libdbus-c++-0.9.0/tools/Makefile.in
+--- libdbus-c++-0.9.0.ori/tools/Makefile.in 2016-11-15 14:25:36.089882803 +0100
++++ libdbus-c++-0.9.0/tools/Makefile.in 2016-11-15 14:27:44.306831265 +0100
+@@ -101,11 +101,9 @@
+ CFLAGS = @CFLAGS@
+ CPP = @CPP@
+ CPPFLAGS = @CPPFLAGS@
+-CXX = $(CXX_FOR_BUILD)
+ CXXCPP = @CXXCPP@
+ CXXDEPMODE = @CXXDEPMODE@
+ CXXFLAGS = @CXXFLAGS@
+-CXX_FOR_BUILD = @CXX_FOR_BUILD@
+ CYGPATH_W = @CYGPATH_W@
+ DEFS = @DEFS@
+ DEPDIR = @DEPDIR@
diff --git a/meta/recipes-core/dbus/libdbus-c++_0.9.0.bb b/meta/recipes-core/dbus/libdbus-c++_0.9.0.bb
new file mode 100644
index 0000000..7edaffc
--- /dev/null
+++ b/meta/recipes-core/dbus/libdbus-c++_0.9.0.bb
@@ -0,0 +1,24 @@
+SUMMARY = "DBus-C++ Library"
+DESCRIPTION = "DBus-c++ attempts to provide a C++ API for D-BUS. The library has a glib and an Ecore mainloop integration. It also offers an optional own main loop."
+HOMEPAGE = "http://dbus-cplusplus.sourceforge.net"
+SECTION = "base"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
+DEPENDS = "dbus glib-2.0 libpcre"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/dbus-cplusplus/dbus-c++/${PV}/${BPN}-${PV}.tar.gz \
+ file://fix-missing-unistd.h-include.patch \
+ file://remove-CXX_FOR_BUILD-stuff.patch"
+SRC_URI[md5sum] = "e752116f523fa88ef041e63d3dee4de2"
+SRC_URI[sha256sum] = "bc11ac297b3cb010be904c72789695543ee3fdf3d75cdc8225fd371385af4e61"
+
+EXTRA_OECONF = "--disable-ecore --disable-examples --disable-tests"
+
+inherit autotools pkgconfig
+
+PACKAGES += "${PN}-tools"
+
+FILES_${PN} = "${libdir}"
+FILES_${PN}-tools = "${bindir}"
+
+BBCLASSEXTEND = "native"
--
2.10.2
^ permalink raw reply related
* [PATCH 2/2] x11-common: Merge into xserver-nodm-init
From: Jussi Kukkonen @ 2016-11-15 11:41 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <cover.1479130124.git.jussi.kukkonen@intel.com>
Move the (non-factual) x utils dependencies from x11-common to
x11 packagegroup.
Remove some obsolete configuration from x11-common:
* Xsession.d/12keymap.sh: commented out xmodmap call for kdrive
* default.xmodmap: xmodmap file used by 12keymap.sh
* Xdefaults: rxvt configuration
At this point x11-common is just /etc/X11/Xsession and three
non-intrusive Xsession scripts: make these explicitly part of
xserver-nodm-init. RCONFLICT with the versions of xserver-common
that also provide these files.
VIRTUAL-RUNTIME_xserver_common is no longer a real abstraction but
preserve the setting for backwards compatibility (if the variable
is set to "xserver-common", the right thing still happens).
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
---
meta/conf/distro/include/distro_alias.inc | 1 -
.../packagegroups/packagegroup-core-x11.bb | 9 +-
.../x11-common/x11-common/etc/X11/Xdefaults | 3 -
.../x11-common/etc/X11/Xsession.d/12keymap.sh | 4 -
.../x11-common/x11-common/etc/X11/default.xmodmap | 260 ---------------
.../x11-common/x11-common/gplv2-license.patch | 355 ---------------------
meta/recipes-graphics/x11-common/x11-common_0.1.bb | 22 --
.../etc => xserver-nodm-init}/X11/Xsession | 0
.../X11/Xsession.d/13xdgbasedirs.sh | 0
.../X11/Xsession.d/89xdgautostart.sh | 0
.../X11/Xsession.d/90XWindowManager.sh | 0
.../x11-common/xserver-nodm-init_3.0.bb | 5 +
12 files changed, 11 insertions(+), 648 deletions(-)
delete mode 100644 meta/recipes-graphics/x11-common/x11-common/etc/X11/Xdefaults
delete mode 100644 meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/12keymap.sh
delete mode 100644 meta/recipes-graphics/x11-common/x11-common/etc/X11/default.xmodmap
delete mode 100644 meta/recipes-graphics/x11-common/x11-common/gplv2-license.patch
delete mode 100644 meta/recipes-graphics/x11-common/x11-common_0.1.bb
rename meta/recipes-graphics/x11-common/{x11-common/etc => xserver-nodm-init}/X11/Xsession (100%)
rename meta/recipes-graphics/x11-common/{x11-common/etc => xserver-nodm-init}/X11/Xsession.d/13xdgbasedirs.sh (100%)
rename meta/recipes-graphics/x11-common/{x11-common/etc => xserver-nodm-init}/X11/Xsession.d/89xdgautostart.sh (100%)
rename meta/recipes-graphics/x11-common/{x11-common/etc => xserver-nodm-init}/X11/Xsession.d/90XWindowManager.sh (100%)
diff --git a/meta/conf/distro/include/distro_alias.inc b/meta/conf/distro/include/distro_alias.inc
index 10efb09..a59265a 100644
--- a/meta/conf/distro/include/distro_alias.inc
+++ b/meta/conf/distro/include/distro_alias.inc
@@ -400,7 +400,6 @@ DISTRO_PN_ALIAS_pn-weston = "Fedora=weston OpenSuSE=weston"
DISTRO_PN_ALIAS_pn-weston-init = "OE-Core"
DISTRO_PN_ALIAS_pn-which = "Mandriva=which Fedora=which"
DISTRO_PN_ALIAS_pn-wpa-supplicant = "Meego=wpa_supplicant Fedora=wpa_supplicant OpenSuSE=wpa_supplicant Ubuntu=wpasupplicant Mandriva=wpa_supplicant Debian=wpasupplicant"
-DISTRO_PN_ALIAS_pn-x11-common = "OE-Core"
DISTRO_PN_ALIAS_pn-x11perf = "Fedora=xorg-x11-apps Ubuntu=x11-apps"
DISTRO_PN_ALIAS_pn-xcb-util-image = "Debian=xcb-util Fedora=xcb-util"
DISTRO_PN_ALIAS_pn-xcb-util-keysyms = "Debian=xcb-util Fedora=xcb-util"
diff --git a/meta/recipes-graphics/packagegroups/packagegroup-core-x11.bb b/meta/recipes-graphics/packagegroups/packagegroup-core-x11.bb
index 4291424..001db9e 100644
--- a/meta/recipes-graphics/packagegroups/packagegroup-core-x11.bb
+++ b/meta/recipes-graphics/packagegroups/packagegroup-core-x11.bb
@@ -5,13 +5,12 @@
PR = "r40"
inherit packagegroup distro_features_check
-# rdepends on x11-common
REQUIRED_DISTRO_FEATURES = "x11"
PACKAGES = "${PN} ${PN}-utils"
-# xserver-common, x11-common
-VIRTUAL-RUNTIME_xserver_common ?= "x11-common"
+# backwards compatibility for xserver-common
+VIRTUAL-RUNTIME_xserver_common ?= ""
# elsa, xserver-nodm-init
VIRTUAL-RUNTIME_graphical_init_manager ?= "xserver-nodm-init"
@@ -30,4 +29,8 @@ RDEPENDS_${PN}-utils = "\
xhost \
xset \
xrandr \
+ xmodmap \
+ xdpyinfo \
+ xinput-calibrator \
+ dbus-x11 \
"
diff --git a/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xdefaults b/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xdefaults
deleted file mode 100644
index f5b69dd..0000000
--- a/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xdefaults
+++ /dev/null
@@ -1,3 +0,0 @@
-Rxvt*scrollBar_right: true
-Rxvt*font: xft:Mono:pixelsize=9
-
diff --git a/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/12keymap.sh b/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/12keymap.sh
deleted file mode 100644
index a9d102c..0000000
--- a/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/12keymap.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-# kdrive 1.4 does not have default keymap in server
-#xmodmap - </etc/X11/default.xmodmap
diff --git a/meta/recipes-graphics/x11-common/x11-common/etc/X11/default.xmodmap b/meta/recipes-graphics/x11-common/x11-common/etc/X11/default.xmodmap
deleted file mode 100644
index 05a13fa..0000000
--- a/meta/recipes-graphics/x11-common/x11-common/etc/X11/default.xmodmap
+++ /dev/null
@@ -1,260 +0,0 @@
-keycode 8 =
-keycode 9 = Escape
-keycode 10 = 1 exclam
-keycode 11 = 2 at
-keycode 12 = 3 numbersign
-keycode 13 = 4 dollar
-keycode 14 = 5 percent
-keycode 15 = 6 asciicircum
-keycode 16 = 7 ampersand braceleft
-keycode 17 = 8 asterisk bracketleft
-keycode 18 = 9 parenleft bracketright
-keycode 19 = 0 parenright braceright
-keycode 20 = minus underscore backslash
-keycode 21 = equal plus
-keycode 22 = BackSpace
-keycode 23 = Tab
-keycode 24 = q Q q
-keycode 25 = w W w
-keycode 26 = e E
-keycode 27 = r R r
-keycode 28 = t T t
-keycode 29 = y Y y
-keycode 30 = u U u
-keycode 31 = i I i
-keycode 32 = o O o
-keycode 33 = p P p
-keycode 34 = bracketleft braceleft
-keycode 35 = bracketright braceright asciitilde
-keycode 36 = Return
-keycode 37 = Control_L
-keycode 38 = a A
-keycode 39 = s S s
-keycode 40 = d D
-keycode 41 = f F
-keycode 42 = g G g
-keycode 43 = h H h
-keycode 44 = j J j
-keycode 45 = k K k
-keycode 46 = l L l
-keycode 47 = semicolon colon
-keycode 48 = apostrophe quotedbl
-keycode 49 = grave asciitilde
-keycode 50 = Shift_L
-keycode 51 = backslash bar
-keycode 52 = z Z z
-keycode 53 = x X x
-keycode 54 = c C
-keycode 55 = v V v
-keycode 56 = b B
-keycode 57 = n N n
-keycode 58 = m M m
-keycode 59 = comma less
-keycode 60 = period greater
-keycode 61 = slash question
-keycode 62 = Shift_R
-keycode 63 = KP_Multiply
-keycode 64 = Alt_L
-keycode 65 = space
-keycode 66 = Caps_Lock
-keycode 67 = F1 F11
-keycode 68 = F2 F12
-keycode 69 = F3 F13
-keycode 70 = F4 F14
-keycode 71 = F5 F15
-keycode 72 = F6 F16
-keycode 73 = F7 F17
-keycode 74 = F8 F18
-keycode 75 = F9 F19
-keycode 76 = F10 F20
-keycode 77 = Num_Lock
-keycode 78 = Scroll_Lock
-keycode 79 = KP_7
-keycode 80 = KP_8
-keycode 81 = KP_9
-keycode 82 = KP_Subtract
-keycode 83 = KP_4
-keycode 84 = KP_5
-keycode 85 = KP_6
-keycode 86 = KP_Add
-keycode 87 = KP_1
-keycode 88 = KP_2
-keycode 89 = KP_3
-keycode 90 = KP_0
-keycode 91 = KP_Decimal
-keycode 92 =
-keycode 93 =
-keycode 94 = less greater bar
-keycode 95 = F11
-keycode 96 = F12
-keycode 97 =
-keycode 98 =
-keycode 99 =
-keycode 100 =
-keycode 101 =
-keycode 102 =
-keycode 103 =
-keycode 104 = KP_Enter
-keycode 105 = Control_R
-keycode 106 = KP_Divide
-keycode 107 =
-keycode 108 = Mode_switch
-keycode 109 = Break
-keycode 110 = Home
-keycode 111 = Up
-keycode 112 = Prior
-keycode 113 = Left
-keycode 114 = Right
-keycode 115 = End
-keycode 116 = Down
-keycode 117 = Next
-keycode 118 = Insert
-keycode 119 = Delete
-keycode 120 = Menu
-keycode 121 = F13
-keycode 122 = F14
-keycode 123 = Help
-keycode 124 = Execute
-keycode 125 = F17
-keycode 126 = KP_Subtract
-keycode 127 = Pause
-keycode 128 =
-keycode 129 =
-keycode 130 =
-keycode 131 =
-keycode 132 =
-keycode 133 =
-keycode 134 =
-keycode 135 =
-keycode 136 =
-keycode 137 =
-keycode 138 =
-keycode 139 =
-keycode 140 =
-keycode 141 =
-keycode 142 =
-keycode 143 =
-keycode 144 =
-keycode 145 =
-keycode 146 =
-keycode 147 =
-keycode 148 =
-keycode 149 =
-keycode 150 =
-keycode 151 =
-keycode 152 =
-keycode 153 =
-keycode 154 =
-keycode 155 =
-keycode 156 =
-keycode 157 =
-keycode 158 =
-keycode 159 =
-keycode 160 =
-keycode 161 =
-keycode 162 =
-keycode 163 =
-keycode 164 =
-keycode 165 =
-keycode 166 =
-keycode 167 =
-keycode 168 =
-keycode 169 =
-keycode 170 =
-keycode 171 =
-keycode 172 =
-keycode 173 =
-keycode 174 =
-keycode 175 =
-keycode 176 =
-keycode 177 =
-keycode 178 =
-keycode 179 =
-keycode 180 =
-keycode 181 =
-keycode 182 =
-keycode 183 =
-keycode 184 =
-keycode 185 =
-keycode 186 =
-keycode 187 =
-keycode 188 =
-keycode 189 =
-keycode 190 =
-keycode 191 =
-keycode 192 =
-keycode 193 =
-keycode 194 =
-keycode 195 =
-keycode 196 =
-keycode 197 =
-keycode 198 =
-keycode 199 =
-keycode 200 =
-keycode 201 =
-keycode 202 =
-keycode 203 =
-keycode 204 =
-keycode 205 =
-keycode 206 =
-keycode 207 =
-keycode 208 =
-keycode 209 =
-keycode 210 =
-keycode 211 =
-keycode 212 =
-keycode 213 =
-keycode 214 =
-keycode 215 =
-keycode 216 =
-keycode 217 =
-keycode 218 =
-keycode 219 =
-keycode 220 =
-keycode 221 =
-keycode 222 =
-keycode 223 =
-keycode 224 =
-keycode 225 =
-keycode 226 =
-keycode 227 =
-keycode 228 =
-keycode 229 =
-keycode 230 =
-keycode 231 =
-keycode 232 =
-keycode 233 =
-keycode 234 =
-keycode 235 =
-keycode 236 =
-keycode 237 =
-keycode 238 =
-keycode 239 =
-keycode 240 =
-keycode 241 =
-keycode 242 =
-keycode 243 =
-keycode 244 =
-keycode 245 =
-keycode 246 =
-keycode 247 =
-keycode 248 =
-keycode 249 =
-keycode 250 =
-keycode 251 =
-keycode 252 =
-keycode 253 =
-keycode 254 =
-
-add shift = Shift_L
-add shift = Shift_R
-add shift = Menu
-add lock = Caps_Lock
-add control = Control_L
-add control = Control_R
-add mod1 = Alt_L
-add mod2 = Num_Lock
-!mod3
-add mod4 = Mode_switch
-!mod5
-
diff --git a/meta/recipes-graphics/x11-common/x11-common/gplv2-license.patch b/meta/recipes-graphics/x11-common/x11-common/gplv2-license.patch
deleted file mode 100644
index eff975e..0000000
--- a/meta/recipes-graphics/x11-common/x11-common/gplv2-license.patch
+++ /dev/null
@@ -1,355 +0,0 @@
-COPYING: add GPLv2 license file
-
-this is a local file recipe and the license file is missing.In order
-to pass the license checksum checking, the license file is needed. So
-this patch add the GPLv2 license file.
-
-Upstream-Status: Inappropriate [licensing]
-
-Signed-off-by: Yu Ke <ke.yu@intel.com>
-
-diff --git a/COPYING b/COPYING
-new file mode 100644
-index 0000000..d511905
---- /dev/null
-+++ b/COPYING
-@@ -0,0 +1,339 @@
-+ GNU GENERAL PUBLIC LICENSE
-+ Version 2, June 1991
-+
-+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
-+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-+ Everyone is permitted to copy and distribute verbatim copies
-+ of this license document, but changing it is not allowed.
-+
-+ Preamble
-+
-+ The licenses for most software are designed to take away your
-+freedom to share and change it. By contrast, the GNU General Public
-+License is intended to guarantee your freedom to share and change free
-+software--to make sure the software is free for all its users. This
-+General Public License applies to most of the Free Software
-+Foundation's software and to any other program whose authors commit to
-+using it. (Some other Free Software Foundation software is covered by
-+the GNU Lesser General Public License instead.) You can apply it to
-+your programs, too.
-+
-+ When we speak of free software, we are referring to freedom, not
-+price. Our General Public Licenses are designed to make sure that you
-+have the freedom to distribute copies of free software (and charge for
-+this service if you wish), that you receive source code or can get it
-+if you want it, that you can change the software or use pieces of it
-+in new free programs; and that you know you can do these things.
-+
-+ To protect your rights, we need to make restrictions that forbid
-+anyone to deny you these rights or to ask you to surrender the rights.
-+These restrictions translate to certain responsibilities for you if you
-+distribute copies of the software, or if you modify it.
-+
-+ For example, if you distribute copies of such a program, whether
-+gratis or for a fee, you must give the recipients all the rights that
-+you have. You must make sure that they, too, receive or can get the
-+source code. And you must show them these terms so they know their
-+rights.
-+
-+ We protect your rights with two steps: (1) copyright the software, and
-+(2) offer you this license which gives you legal permission to copy,
-+distribute and/or modify the software.
-+
-+ Also, for each author's protection and ours, we want to make certain
-+that everyone understands that there is no warranty for this free
-+software. If the software is modified by someone else and passed on, we
-+want its recipients to know that what they have is not the original, so
-+that any problems introduced by others will not reflect on the original
-+authors' reputations.
-+
-+ Finally, any free program is threatened constantly by software
-+patents. We wish to avoid the danger that redistributors of a free
-+program will individually obtain patent licenses, in effect making the
-+program proprietary. To prevent this, we have made it clear that any
-+patent must be licensed for everyone's free use or not licensed at all.
-+
-+ The precise terms and conditions for copying, distribution and
-+modification follow.
-+
-+ GNU GENERAL PUBLIC LICENSE
-+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-+
-+ 0. This License applies to any program or other work which contains
-+a notice placed by the copyright holder saying it may be distributed
-+under the terms of this General Public License. The "Program", below,
-+refers to any such program or work, and a "work based on the Program"
-+means either the Program or any derivative work under copyright law:
-+that is to say, a work containing the Program or a portion of it,
-+either verbatim or with modifications and/or translated into another
-+language. (Hereinafter, translation is included without limitation in
-+the term "modification".) Each licensee is addressed as "you".
-+
-+Activities other than copying, distribution and modification are not
-+covered by this License; they are outside its scope. The act of
-+running the Program is not restricted, and the output from the Program
-+is covered only if its contents constitute a work based on the
-+Program (independent of having been made by running the Program).
-+Whether that is true depends on what the Program does.
-+
-+ 1. You may copy and distribute verbatim copies of the Program's
-+source code as you receive it, in any medium, provided that you
-+conspicuously and appropriately publish on each copy an appropriate
-+copyright notice and disclaimer of warranty; keep intact all the
-+notices that refer to this License and to the absence of any warranty;
-+and give any other recipients of the Program a copy of this License
-+along with the Program.
-+
-+You may charge a fee for the physical act of transferring a copy, and
-+you may at your option offer warranty protection in exchange for a fee.
-+
-+ 2. You may modify your copy or copies of the Program or any portion
-+of it, thus forming a work based on the Program, and copy and
-+distribute such modifications or work under the terms of Section 1
-+above, provided that you also meet all of these conditions:
-+
-+ a) You must cause the modified files to carry prominent notices
-+ stating that you changed the files and the date of any change.
-+
-+ b) You must cause any work that you distribute or publish, that in
-+ whole or in part contains or is derived from the Program or any
-+ part thereof, to be licensed as a whole at no charge to all third
-+ parties under the terms of this License.
-+
-+ c) If the modified program normally reads commands interactively
-+ when run, you must cause it, when started running for such
-+ interactive use in the most ordinary way, to print or display an
-+ announcement including an appropriate copyright notice and a
-+ notice that there is no warranty (or else, saying that you provide
-+ a warranty) and that users may redistribute the program under
-+ these conditions, and telling the user how to view a copy of this
-+ License. (Exception: if the Program itself is interactive but
-+ does not normally print such an announcement, your work based on
-+ the Program is not required to print an announcement.)
-+
-+These requirements apply to the modified work as a whole. If
-+identifiable sections of that work are not derived from the Program,
-+and can be reasonably considered independent and separate works in
-+themselves, then this License, and its terms, do not apply to those
-+sections when you distribute them as separate works. But when you
-+distribute the same sections as part of a whole which is a work based
-+on the Program, the distribution of the whole must be on the terms of
-+this License, whose permissions for other licensees extend to the
-+entire whole, and thus to each and every part regardless of who wrote it.
-+
-+Thus, it is not the intent of this section to claim rights or contest
-+your rights to work written entirely by you; rather, the intent is to
-+exercise the right to control the distribution of derivative or
-+collective works based on the Program.
-+
-+In addition, mere aggregation of another work not based on the Program
-+with the Program (or with a work based on the Program) on a volume of
-+a storage or distribution medium does not bring the other work under
-+the scope of this License.
-+
-+ 3. You may copy and distribute the Program (or a work based on it,
-+under Section 2) in object code or executable form under the terms of
-+Sections 1 and 2 above provided that you also do one of the following:
-+
-+ a) Accompany it with the complete corresponding machine-readable
-+ source code, which must be distributed under the terms of Sections
-+ 1 and 2 above on a medium customarily used for software interchange; or,
-+
-+ b) Accompany it with a written offer, valid for at least three
-+ years, to give any third party, for a charge no more than your
-+ cost of physically performing source distribution, a complete
-+ machine-readable copy of the corresponding source code, to be
-+ distributed under the terms of Sections 1 and 2 above on a medium
-+ customarily used for software interchange; or,
-+
-+ c) Accompany it with the information you received as to the offer
-+ to distribute corresponding source code. (This alternative is
-+ allowed only for noncommercial distribution and only if you
-+ received the program in object code or executable form with such
-+ an offer, in accord with Subsection b above.)
-+
-+The source code for a work means the preferred form of the work for
-+making modifications to it. For an executable work, complete source
-+code means all the source code for all modules it contains, plus any
-+associated interface definition files, plus the scripts used to
-+control compilation and installation of the executable. However, as a
-+special exception, the source code distributed need not include
-+anything that is normally distributed (in either source or binary
-+form) with the major components (compiler, kernel, and so on) of the
-+operating system on which the executable runs, unless that component
-+itself accompanies the executable.
-+
-+If distribution of executable or object code is made by offering
-+access to copy from a designated place, then offering equivalent
-+access to copy the source code from the same place counts as
-+distribution of the source code, even though third parties are not
-+compelled to copy the source along with the object code.
-+
-+ 4. You may not copy, modify, sublicense, or distribute the Program
-+except as expressly provided under this License. Any attempt
-+otherwise to copy, modify, sublicense or distribute the Program is
-+void, and will automatically terminate your rights under this License.
-+However, parties who have received copies, or rights, from you under
-+this License will not have their licenses terminated so long as such
-+parties remain in full compliance.
-+
-+ 5. You are not required to accept this License, since you have not
-+signed it. However, nothing else grants you permission to modify or
-+distribute the Program or its derivative works. These actions are
-+prohibited by law if you do not accept this License. Therefore, by
-+modifying or distributing the Program (or any work based on the
-+Program), you indicate your acceptance of this License to do so, and
-+all its terms and conditions for copying, distributing or modifying
-+the Program or works based on it.
-+
-+ 6. Each time you redistribute the Program (or any work based on the
-+Program), the recipient automatically receives a license from the
-+original licensor to copy, distribute or modify the Program subject to
-+these terms and conditions. You may not impose any further
-+restrictions on the recipients' exercise of the rights granted herein.
-+You are not responsible for enforcing compliance by third parties to
-+this License.
-+
-+ 7. If, as a consequence of a court judgment or allegation of patent
-+infringement or for any other reason (not limited to patent issues),
-+conditions are imposed on you (whether by court order, agreement or
-+otherwise) that contradict the conditions of this License, they do not
-+excuse you from the conditions of this License. If you cannot
-+distribute so as to satisfy simultaneously your obligations under this
-+License and any other pertinent obligations, then as a consequence you
-+may not distribute the Program at all. For example, if a patent
-+license would not permit royalty-free redistribution of the Program by
-+all those who receive copies directly or indirectly through you, then
-+the only way you could satisfy both it and this License would be to
-+refrain entirely from distribution of the Program.
-+
-+If any portion of this section is held invalid or unenforceable under
-+any particular circumstance, the balance of the section is intended to
-+apply and the section as a whole is intended to apply in other
-+circumstances.
-+
-+It is not the purpose of this section to induce you to infringe any
-+patents or other property right claims or to contest validity of any
-+such claims; this section has the sole purpose of protecting the
-+integrity of the free software distribution system, which is
-+implemented by public license practices. Many people have made
-+generous contributions to the wide range of software distributed
-+through that system in reliance on consistent application of that
-+system; it is up to the author/donor to decide if he or she is willing
-+to distribute software through any other system and a licensee cannot
-+impose that choice.
-+
-+This section is intended to make thoroughly clear what is believed to
-+be a consequence of the rest of this License.
-+
-+ 8. If the distribution and/or use of the Program is restricted in
-+certain countries either by patents or by copyrighted interfaces, the
-+original copyright holder who places the Program under this License
-+may add an explicit geographical distribution limitation excluding
-+those countries, so that distribution is permitted only in or among
-+countries not thus excluded. In such case, this License incorporates
-+the limitation as if written in the body of this License.
-+
-+ 9. The Free Software Foundation may publish revised and/or new versions
-+of the General Public License from time to time. Such new versions will
-+be similar in spirit to the present version, but may differ in detail to
-+address new problems or concerns.
-+
-+Each version is given a distinguishing version number. If the Program
-+specifies a version number of this License which applies to it and "any
-+later version", you have the option of following the terms and conditions
-+either of that version or of any later version published by the Free
-+Software Foundation. If the Program does not specify a version number of
-+this License, you may choose any version ever published by the Free Software
-+Foundation.
-+
-+ 10. If you wish to incorporate parts of the Program into other free
-+programs whose distribution conditions are different, write to the author
-+to ask for permission. For software which is copyrighted by the Free
-+Software Foundation, write to the Free Software Foundation; we sometimes
-+make exceptions for this. Our decision will be guided by the two goals
-+of preserving the free status of all derivatives of our free software and
-+of promoting the sharing and reuse of software generally.
-+
-+ NO WARRANTY
-+
-+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-+REPAIR OR CORRECTION.
-+
-+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-+POSSIBILITY OF SUCH DAMAGES.
-+
-+ END OF TERMS AND CONDITIONS
-+
-+ How to Apply These Terms to Your New Programs
-+
-+ If you develop a new program, and you want it to be of the greatest
-+possible use to the public, the best way to achieve this is to make it
-+free software which everyone can redistribute and change under these terms.
-+
-+ To do so, attach the following notices to the program. It is safest
-+to attach them to the start of each source file to most effectively
-+convey the exclusion of warranty; and each file should have at least
-+the "copyright" line and a pointer to where the full notice is found.
-+
-+ <one line to give the program's name and a brief idea of what it does.>
-+ Copyright (C) <year> <name of author>
-+
-+ This program is free software; you can redistribute it and/or modify
-+ it under the terms of the GNU General Public License as published by
-+ the Free Software Foundation; either version 2 of the License, or
-+ (at your option) any later version.
-+
-+ This program is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ GNU General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License along
-+ with this program; if not, write to the Free Software Foundation, Inc.,
-+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-+
-+Also add information on how to contact you by electronic and paper mail.
-+
-+If the program is interactive, make it output a short notice like this
-+when it starts in an interactive mode:
-+
-+ Gnomovision version 69, Copyright (C) year name of author
-+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-+ This is free software, and you are welcome to redistribute it
-+ under certain conditions; type `show c' for details.
-+
-+The hypothetical commands `show w' and `show c' should show the appropriate
-+parts of the General Public License. Of course, the commands you use may
-+be called something other than `show w' and `show c'; they could even be
-+mouse-clicks or menu items--whatever suits your program.
-+
-+You should also get your employer (if you work as a programmer) or your
-+school, if any, to sign a "copyright disclaimer" for the program, if
-+necessary. Here is a sample; alter the names:
-+
-+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
-+
-+ <signature of Ty Coon>, 1 April 1989
-+ Ty Coon, President of Vice
-+
-+This General Public License does not permit incorporating your program into
-+proprietary programs. If your program is a subroutine library, you may
-+consider it more useful to permit linking proprietary applications with the
-+library. If this is what you want to do, use the GNU Lesser General
-+Public License instead of this License.
diff --git a/meta/recipes-graphics/x11-common/x11-common_0.1.bb b/meta/recipes-graphics/x11-common/x11-common_0.1.bb
deleted file mode 100644
index ab9a939..0000000
--- a/meta/recipes-graphics/x11-common/x11-common_0.1.bb
+++ /dev/null
@@ -1,22 +0,0 @@
-SUMMARY = "Common X11 scripts and configuration files"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
-SECTION = "x11"
-PR = "r47"
-
-inherit distro_features_check
-# rdepends on xdypinfo xmodmap xinit
-REQUIRED_DISTRO_FEATURES = "x11"
-
-SRC_URI = "file://etc \
- file://gplv2-license.patch"
-
-S = "${WORKDIR}"
-
-do_install() {
- cp -R ${S}/etc ${D}${sysconfdir}
- chmod -R 755 ${D}${sysconfdir}
-}
-
-RDEPENDS_${PN} = "dbus-x11 xmodmap xdpyinfo xinput-calibrator formfactor"
-
diff --git a/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession b/meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession
similarity index 100%
rename from meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession
rename to meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession
diff --git a/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/13xdgbasedirs.sh b/meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession.d/13xdgbasedirs.sh
similarity index 100%
rename from meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/13xdgbasedirs.sh
rename to meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession.d/13xdgbasedirs.sh
diff --git a/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/89xdgautostart.sh b/meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession.d/89xdgautostart.sh
similarity index 100%
rename from meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/89xdgautostart.sh
rename to meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession.d/89xdgautostart.sh
diff --git a/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/90XWindowManager.sh b/meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession.d/90XWindowManager.sh
similarity index 100%
rename from meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/90XWindowManager.sh
rename to meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession.d/90XWindowManager.sh
diff --git a/meta/recipes-graphics/x11-common/xserver-nodm-init_3.0.bb b/meta/recipes-graphics/x11-common/xserver-nodm-init_3.0.bb
index a6d0d5e..62da118 100644
--- a/meta/recipes-graphics/x11-common/xserver-nodm-init_3.0.bb
+++ b/meta/recipes-graphics/x11-common/xserver-nodm-init_3.0.bb
@@ -6,6 +6,7 @@ PR = "r31"
SRC_URI = "file://xserver-nodm \
file://Xserver \
+ file://X11 \
file://gplv2-license.patch \
file://xserver-nodm.service.in \
file://xserver-nodm.conf.in \
@@ -29,6 +30,9 @@ do_install() {
install xserver-nodm.conf.in ${D}${sysconfdir}/default/xserver-nodm
install -d ${D}${sysconfdir}/xserver-nodm
install Xserver ${D}${sysconfdir}/xserver-nodm/Xserver
+ install -d ${D}${sysconfdir}/X11/Xsession.d
+ install X11/Xsession.d/* ${D}${sysconfdir}/X11/Xsession.d/
+ install X11/Xsession ${D}${sysconfdir}/X11/
BLANK_ARGS="${@bb.utils.contains('PACKAGECONFIG', 'blank', '', '-s 0 -dpms', d)}"
if [ "${ROOTLESS_X}" = "1" ] ; then
@@ -59,3 +63,4 @@ INITSCRIPT_NAME = "xserver-nodm"
INITSCRIPT_PARAMS = "start 9 5 . stop 20 0 1 2 3 6 ."
SYSTEMD_SERVICE_${PN} = "xserver-nodm.service"
+RCONFLICTS_${PN} = "xserver-common (< 1.34-r9) x11-common"
--
2.1.4
^ permalink raw reply related
* [PATCH 1/2] xserver-nodm-init: Bump PV to ensure upgrade from 2.0
From: Jussi Kukkonen @ 2016-11-15 11:41 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <cover.1479130124.git.jussi.kukkonen@intel.com>
meta-oe provides a 2.0 version of this recipe, but this one now
does everything the meta-oe version does.
There's one exception though: xserver-common is not a runtime
dependency. This needs to be added elsewhere for the platforms that
require it.
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
---
.../x11-common/{xserver-nodm-init.bb => xserver-nodm-init_3.0.bb} | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename meta/recipes-graphics/x11-common/{xserver-nodm-init.bb => xserver-nodm-init_3.0.bb} (100%)
diff --git a/meta/recipes-graphics/x11-common/xserver-nodm-init.bb b/meta/recipes-graphics/x11-common/xserver-nodm-init_3.0.bb
similarity index 100%
rename from meta/recipes-graphics/x11-common/xserver-nodm-init.bb
rename to meta/recipes-graphics/x11-common/xserver-nodm-init_3.0.bb
--
2.1.4
^ permalink raw reply
* [PATCH 0/2] X initialization refactoring
From: Jussi Kukkonen @ 2016-11-15 11:41 UTC (permalink / raw)
To: openembedded-core
This set has a companion set on meta-oe, neither set makes much sense
without the other. Cover letters are identical. Please CC both lists
if needed.
Current state:
* meta-oe and oe-core both provide xserver-nodm-init: the oe-core
version should already do everything the meta-oe version does, but
the meta-oe version gets selected by default because of layer
priority.
* meta-oe and oe-core provide xserver-common and x11-common:
x11-common files are essentially a subset of xserver-common files.
Goals:
* Adding meta-oe to bblayers alone should not modify X initialization
* meta-oe and oe-core should not duplicate content without reason
* xserver startup should still be modifiable from other layers
(just not implicitly)
What was done to achieve those goals:
* (oe-core) Removed old cruft from x11-common. What was left is
Xsession and a few Xsession scripts.
* (oe-core) Merged what's left of x11-common into xserver-nodm-init
* (meta-oe) Removed xserver-nodm-init-2.0 as unneeded
* (meta-oe) No longer install files in xserver-common that oe-core
xserver-nodm-init installs
xserver-common now has to be explicitly installed if it is wanted.
There are multiple ways to solve these issues: I'm prepared to try
alternative approaches if needed. Testing results are appreciated
as well.
Cheers,
Jussi
The following changes since commit 43e652f3d1fee5ce7fad67e6400315eab1b34270:
devtool: add "rename" subcommand (2016-11-07 11:04:22 +0000)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib jku/x-init-refactor
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=jku/x-init-refactor
Jussi Kukkonen (2):
xserver-nodm-init: Bump PV to ensure upgrade from 2.0
x11-common: Merge into xserver-nodm-init
meta/conf/distro/include/distro_alias.inc | 1 -
.../packagegroups/packagegroup-core-x11.bb | 9 +-
.../x11-common/x11-common/etc/X11/Xdefaults | 3 -
.../x11-common/etc/X11/Xsession.d/12keymap.sh | 4 -
.../x11-common/x11-common/etc/X11/default.xmodmap | 260 ---------------
.../x11-common/x11-common/gplv2-license.patch | 355 ---------------------
meta/recipes-graphics/x11-common/x11-common_0.1.bb | 22 --
.../etc => xserver-nodm-init}/X11/Xsession | 0
.../X11/Xsession.d/13xdgbasedirs.sh | 0
.../X11/Xsession.d/89xdgautostart.sh | 0
.../X11/Xsession.d/90XWindowManager.sh | 0
...erver-nodm-init.bb => xserver-nodm-init_3.0.bb} | 5 +
12 files changed, 11 insertions(+), 648 deletions(-)
delete mode 100644 meta/recipes-graphics/x11-common/x11-common/etc/X11/Xdefaults
delete mode 100644 meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/12keymap.sh
delete mode 100644 meta/recipes-graphics/x11-common/x11-common/etc/X11/default.xmodmap
delete mode 100644 meta/recipes-graphics/x11-common/x11-common/gplv2-license.patch
delete mode 100644 meta/recipes-graphics/x11-common/x11-common_0.1.bb
rename meta/recipes-graphics/x11-common/{x11-common/etc => xserver-nodm-init}/X11/Xsession (100%)
rename meta/recipes-graphics/x11-common/{x11-common/etc => xserver-nodm-init}/X11/Xsession.d/13xdgbasedirs.sh (100%)
rename meta/recipes-graphics/x11-common/{x11-common/etc => xserver-nodm-init}/X11/Xsession.d/89xdgautostart.sh (100%)
rename meta/recipes-graphics/x11-common/{x11-common/etc => xserver-nodm-init}/X11/Xsession.d/90XWindowManager.sh (100%)
rename meta/recipes-graphics/x11-common/{xserver-nodm-init.bb => xserver-nodm-init_3.0.bb} (89%)
--
2.1.4
^ permalink raw reply
* Re: libdbus-c++
From: Burton, Ross @ 2016-11-15 11:40 UTC (permalink / raw)
To: thilo.cestonaro@ts.fujitsu.com; +Cc: openembedded-core@lists.openembedded.org
In-Reply-To: <1479130386.8647.5.camel@ts.fujitsu.com>
[-- Attachment #1: Type: text/plain, Size: 985 bytes --]
On 14 November 2016 at 13:33, thilo.cestonaro@ts.fujitsu.com <
thilo.cestonaro@ts.fujitsu.com> wrote:
> Yeah I propably can and will be if I need to write my own. But the funny
> thing is, that there ones was a meta-oe dbus-c++ recipe and this was
> removed with the comment, that it didn't work and it's
> better to use the one from oe-core :)
>
Just found this recipe in my WIP folder, no idea if it works but it's
probably a starting point:
$ cat dbus-cxx_0.8.0.bb
SUMMARY = "C++ bindings for dbus"
HOMEPAGE = "http://dbus-cxx.sourceforge.net/"
SECTION = "libs"
LICENSE = "GPLv3"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
DEPENDS = "dbus libsigc++-2.0 popt"
SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.bz2"
SRC_URI[md5sum] = "ab89f48dd0cd3c581a9228fcbb3af96b"
SRC_URI[sha256sum] =
"a7c179cb7ecafc6477c789b080bd936ac3620220604ffb2ae214a33719839d13"
inherit autotools pkgconfig
BBCLASSEXTEND = "native"
Ross
[-- Attachment #2: Type: text/html, Size: 2329 bytes --]
^ permalink raw reply
* Re: [PATCH v2] xinput-calibrator: use up-to-date git version
From: Burton, Ross @ 2016-11-15 11:18 UTC (permalink / raw)
To: Diego Rondini; +Cc: OE-core
In-Reply-To: <1479208109-20859-1-git-send-email-diego.ml@zoho.com>
[-- Attachment #1: Type: text/plain, Size: 758 bytes --]
On 15 November 2016 at 11:08, Diego Rondini <diego.ml@zoho.com> wrote:
> Use up-to-date version from git. While currently there aren't official
> releases
> newer than 0.7.5, quite some new features have been added in git, for
> example
> the ability to disable the calibration screen timeout.
>
buildhistory-diff in my local automated testing says:
packages/corei7-64-poky-linux/xinput-calibrator/xinput-calibrator:
RDEPENDS: removed "libxrandr (['>= 1.5.1'])"
https://github.com/tias/xinput_calibrator/blob/master/configure.ac#L72
shows that xinput-calibrator has an automatic dependency on xrandr. We
build and ship this, and I can't see any downside to using it, so this
should be in DEPENDS so the build is deterministic.
Ross
[-- Attachment #2: Type: text/html, Size: 1523 bytes --]
^ permalink raw reply
* [PATCH v2] xinput-calibrator: use up-to-date git version
From: Diego Rondini @ 2016-11-15 11:08 UTC (permalink / raw)
To: openembedded-core; +Cc: Diego Rondini
Use up-to-date version from git. While currently there aren't official releases
newer than 0.7.5, quite some new features have been added in git, for example
the ability to disable the calibration screen timeout.
Signed-off-by: Diego Rondini <diego.ml@zoho.com>
---
meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb b/meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb
index 57c3a7a..87f09e7 100644
--- a/meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb
+++ b/meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb
@@ -11,7 +11,7 @@ inherit autotools pkgconfig distro_features_check
# depends on virtual/libx11
REQUIRED_DISTRO_FEATURES = "x11"
-SRCREV = "c01c5af807cb4b0157b882ab07a893df9a810111"
+SRCREV = "03dadf55109bd43d3380f040debe9f82f66f2f35"
SRC_URI = "git://github.com/tias/xinput_calibrator.git \
file://30xinput_calibrate.sh \
file://Allow-xinput_calibrator_pointercal.sh-to-be-run-as-n.patch \
--
1.9.1
^ permalink raw reply related
* Re: [PATCH] xinput-calibrator: use up-to-date git version
From: Burton, Ross @ 2016-11-15 10:43 UTC (permalink / raw)
To: Diego Rondini; +Cc: OE-core
In-Reply-To: <1479202785-20652-1-git-send-email-diego.ml@zoho.com>
[-- Attachment #1: Type: text/plain, Size: 205 bytes --]
On 15 November 2016 at 09:39, Diego Rondini <diego.ml@zoho.com> wrote:
> -PR = "r6"
> +PR = "r7"
>
No need to bump PR anymore, this is historical and when they release PR can
be removed.
Ross
[-- Attachment #2: Type: text/html, Size: 630 bytes --]
^ permalink raw reply
* Re: [PATCH v3 00/11] wic: bugfixes & --fixed-size support, tests, oe-selftest: minor fixes
From: Maciej Borzęcki @ 2016-11-15 10:37 UTC (permalink / raw)
To: Burton, Ross; +Cc: Paul Eggleton, Maciej Borzecki, OE-core
In-Reply-To: <CAJTo0LYeL-yaSsM2yp_Ss8FQAGbBGwaJCB=ZO4jEy1c_SSrUkg@mail.gmail.com>
On Tue, Nov 15, 2016 at 11:32 AM, Burton, Ross <ross.burton@intel.com> wrote:
>
> On 15 November 2016 at 09:52, Maciej Borzecki <maciej.borzecki@rndity.com>
> wrote:
>>
>> I have noticed that Ross has cherry-picked some patches into his
>> pull request to master. Just for reference, the patches are included in
>> this
>> series, but have not been changed since the previous version. The
>> patches in question are:
>> oe-selftest: fix handling of test cases without ID in --list-tests-by
>> wic: make sure that partition size is always an integer in internal
>> processing
>> wic: use partition size when creating empty partition files
>> wic: check that filesystem is specified for a rootfs partition
>> wic: fix function comment typos
>> wic: add --fixed-size wks option
>
>
> These were simple and/or fixing serious problems, hope I didn't cause too
> much inconvenience doing this.
None at all. I was actually about to propose cherry picking those
patches along with `oe-selftest: enforce en_US.UTF-8 locale`, when your
pull request to OE-core came in.
--
Maciej Borzecki
RnDity
^ permalink raw reply
* Re: [PATCH v3 00/11] wic: bugfixes & --fixed-size support, tests, oe-selftest: minor fixes
From: Burton, Ross @ 2016-11-15 10:32 UTC (permalink / raw)
To: Maciej Borzecki; +Cc: Paul Eggleton, Maciej Borzecki, OE-core
In-Reply-To: <cover.1479201985.git.maciej.borzecki@rndity.com>
[-- Attachment #1: Type: text/plain, Size: 828 bytes --]
On 15 November 2016 at 09:52, Maciej Borzecki <maciej.borzecki@rndity.com>
wrote:
> I have noticed that Ross has cherry-picked some patches into his
> pull request to master. Just for reference, the patches are included in
> this
> series, but have not been changed since the previous version. The
> patches in question are:
> oe-selftest: fix handling of test cases without ID in --list-tests-by
> wic: make sure that partition size is always an integer in internal
> processing
> wic: use partition size when creating empty partition files
> wic: check that filesystem is specified for a rootfs partition
> wic: fix function comment typos
> wic: add --fixed-size wks option
>
These were simple and/or fixing serious problems, hope I didn't cause too
much inconvenience doing this.
Ross
[-- Attachment #2: Type: text/html, Size: 1264 bytes --]
^ permalink raw reply
* [PATCH v3 11/11] oe-selftest: enforce en_US.UTF-8 locale
From: Maciej Borzecki @ 2016-11-15 9:52 UTC (permalink / raw)
To: openembedded-core; +Cc: Paul Eggleton, Maciej Borzecki
In-Reply-To: <cover.1479203195.git.maciej.borzecki@rndity.com>
Replicate bitbake and eforce en_US.UTF-8 locale so that ouptut of locale-aware
tools remains stable.
Signed-off-by: Maciej Birzecki <maciej.borzecki@rndity.com>
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
---
scripts/oe-selftest | 3 +++
1 file changed, 3 insertions(+)
diff --git a/scripts/oe-selftest b/scripts/oe-selftest
index c3215ea6592e128d17da550d778272985f5bd1a6..deaa4324cc888ea261687f90f83e8759c4436a15 100755
--- a/scripts/oe-selftest
+++ b/scripts/oe-selftest
@@ -468,6 +468,9 @@ def main():
sys.path.extend(layer_libdirs)
imp.reload(oeqa.selftest)
+ # act like bitbake and enforce en_US.UTF-8 locale
+ os.environ["LC_ALL"] = "en_US.UTF-8"
+
if args.run_tests_by and len(args.run_tests_by) >= 2:
valid_options = ['name', 'class', 'module', 'id', 'tag']
if args.run_tests_by[0] not in valid_options:
--
2.5.0
^ permalink raw reply related
* [PATCH v3 10/11] oe-selftest: fix handling of test cases without ID in --list-tests-by
From: Maciej Borzecki @ 2016-11-15 9:52 UTC (permalink / raw)
To: openembedded-core; +Cc: Paul Eggleton, Maciej Borzecki
In-Reply-To: <cover.1479203195.git.maciej.borzecki@rndity.com>
Running `oe-selftest --list-tests-by module wic` will produce the
following backtrace:
Traceback (most recent call last):
File "<snip>/poky/scripts/oe-selftest", line 668, in <module>
ret = main()
File "<snip>/poky/scripts/oe-selftest", line 486, in main
list_testsuite_by(criteria, keyword)
File "<snip>/poky/scripts/oe-selftest", line 340, in list_testsuite_by
ts = sorted([ (tc.tcid, tc.tctag, tc.tcname, tc.tcclass, tc.tcmodule) for tc in get_testsuite_by(criteria, keyword) ])
TypeError: unorderable types: int() < NoneType()
The root cause is that a test case does not necessarily have an ID
assigned, hence its value is None. Since Python 3 does not allow
comparison of heterogeneous types, TypeError is raised.
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
---
scripts/oe-selftest | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/scripts/oe-selftest b/scripts/oe-selftest
index d9ffd40e8c4caa734cd490d77304cc600cc75b73..c3215ea6592e128d17da550d778272985f5bd1a6 100755
--- a/scripts/oe-selftest
+++ b/scripts/oe-selftest
@@ -336,10 +336,15 @@ def list_testsuite_by(criteria, keyword):
# Get a testsuite based on 'keyword'
# criteria: name, class, module, id, tag
# keyword: a list of tests, classes, modules, ids, tags
-
- ts = sorted([ (tc.tcid, tc.tctag, tc.tcname, tc.tcclass, tc.tcmodule) for tc in get_testsuite_by(criteria, keyword) ])
-
- print('%-4s\t%-20s\t%-60s\t%-25s\t%-20s' % ('id', 'tag', 'name', 'class', 'module'))
+ def tc_key(t):
+ if t[0] is None:
+ return (0,) + t[1:]
+ return t
+ # tcid may be None if no ID was assigned, in which case sorted() will throw
+ # a TypeError as Python 3 does not allow comparison (<,<=,>=,>) of
+ # heterogeneous types, handle this by using a custom key generator
+ ts = sorted([ (tc.tcid, tc.tctag, tc.tcname, tc.tcclass, tc.tcmodule) \
+ for tc in get_testsuite_by(criteria, keyword) ], key=tc_key)
print('_' * 150)
for t in ts:
if isinstance(t[1], (tuple, list)):
--
2.5.0
^ permalink raw reply related
* [PATCH v3 09/11] wic: selftest: add tests for --fixed-size partition flags
From: Maciej Borzecki @ 2016-11-15 9:52 UTC (permalink / raw)
To: openembedded-core; +Cc: Paul Eggleton, Maciej Borzecki
In-Reply-To: <cover.1479203195.git.maciej.borzecki@rndity.com>
wic has a new flag for setting a fixed parition size --fixed-size. Add
tests that verify if partition is indeed sized properly and that errors
are signaled when there is not enough space to fit partition data.
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
---
meta/lib/oeqa/selftest/wic.py | 65 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 65 insertions(+)
diff --git a/meta/lib/oeqa/selftest/wic.py b/meta/lib/oeqa/selftest/wic.py
index ad783043b92130a023fd70120becec479c6253a7..052d77d510adf4b3fe56ab8fcc87a834c15b1d4c 100644
--- a/meta/lib/oeqa/selftest/wic.py
+++ b/meta/lib/oeqa/selftest/wic.py
@@ -29,6 +29,7 @@ import unittest
from glob import glob
from shutil import rmtree
from functools import wraps
+from tempfile import NamedTemporaryFile
from oeqa.selftest.base import oeSelfTest
from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu
@@ -378,3 +379,67 @@ class Wic(oeSelfTest):
self.assertEqual(0, runCmd("wic create %(wks)s -e %(image)s" \
% wic_cmd_vars).status)
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
+
+ def _make_fixed_size_wks(self, size):
+ """
+ Create a wks of an image with a single partition. Size of the partition is set
+ using --fixed-size flag. Returns a tuple: (path to wks file, wks image name)
+ """
+ with NamedTemporaryFile("w", suffix=".wks", delete=False) as tf:
+ wkspath = tf.name
+ tf.write("part " \
+ "--source rootfs --ondisk hda --align 4 --fixed-size %d "
+ "--fstype=ext4\n" % size)
+ wksname = os.path.splitext(os.path.basename(wkspath))[0]
+
+ return (wkspath, wksname)
+
+ def test_fixed_size(self):
+ """
+ Test creation of a simple image with partition size controlled through
+ --fixed-size flag
+ """
+ wkspath, wksname = self._make_fixed_size_wks(200)
+
+ wic_cmd_vars = {
+ 'wks': wkspath,
+ 'image': self.OE_IMAGE,
+ }
+ self.assertEqual(0, runCmd("wic create %(wks)s -e %(image)s" \
+ % wic_cmd_vars).status)
+ os.remove(wkspath)
+ wicout = glob(self.resultdir + "%s-*direct" % wksname)
+ self.assertEqual(1, len(wicout))
+
+ wicimg = wicout[0]
+
+ # verify partition size with wic
+ res = runCmd("parted -m %s unit mib p 2>/dev/null" % wicimg, ignore_status=True)
+ self.assertEqual(0, res.status)
+
+ # parse parted output which looks like this:
+ # BYT;\n
+ # /var/tmp/wic/build/tmpfwvjjkf_-201611101222-hda.direct:200MiB:file:512:512:msdos::;\n
+ # 1:0.00MiB:200MiB:200MiB:ext4::;\n
+ partlns = res.output.splitlines()[2:]
+
+ self.assertEqual(1, len(partlns))
+ self.assertEqual("1:0.00MiB:200MiB:200MiB:ext4::;", partlns[0])
+
+ def test_fixed_size_error(self):
+ """
+ Test creation of a simple image with partition size controlled through
+ --fixed-size flag. The size of partition is intentionally set to 1MiB
+ in order to trigger an error in wic.
+ """
+ wkspath, wksname = self._make_fixed_size_wks(1)
+
+ wic_cmd_vars = {
+ 'wks': wkspath,
+ 'image': self.OE_IMAGE,
+ }
+ self.assertEqual(1, runCmd("wic create %(wks)s -e %(image)s" \
+ % wic_cmd_vars, ignore_status=True).status)
+ os.remove(wkspath)
+ wicout = glob(self.resultdir + "%s-*direct" % wksname)
+ self.assertEqual(0, len(wicout))
--
2.5.0
^ permalink raw reply related
* [PATCH v3 08/11] wic: selftest: do not assume bzImage kernel image
From: Maciej Borzecki @ 2016-11-15 9:52 UTC (permalink / raw)
To: openembedded-core; +Cc: Paul Eggleton, Maciej Borzecki
In-Reply-To: <cover.1479203195.git.maciej.borzecki@rndity.com>
Instead of assuming that bzImage is available, query bitbake enviroment
for KERNEL_IMAGETYPE.
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
---
meta/lib/oeqa/selftest/wic.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meta/lib/oeqa/selftest/wic.py b/meta/lib/oeqa/selftest/wic.py
index 37ed2c6de5a7f22f982f921476fa392304995b2e..ad783043b92130a023fd70120becec479c6253a7 100644
--- a/meta/lib/oeqa/selftest/wic.py
+++ b/meta/lib/oeqa/selftest/wic.py
@@ -369,7 +369,8 @@ class Wic(oeSelfTest):
def test_sdimage_bootpart(self):
"""Test creation of sdimage-bootpart image"""
image = "sdimage-bootpart"
- self.write_config('IMAGE_BOOT_FILES = "bzImage"\n')
+ kimgtype = get_bb_var('KERNEL_IMAGETYPE', self.OE_IMAGE)
+ self.write_config('IMAGE_BOOT_FILES = "%s"\n' % kimgtype)
wic_cmd_vars = {
'wks': image,
'image': self.OE_IMAGE,
--
2.5.0
^ permalink raw reply related
* [PATCH v3 07/11] wic: selftest: do not repeat core-image-minimal
From: Maciej Borzecki @ 2016-11-15 9:52 UTC (permalink / raw)
To: openembedded-core; +Cc: Paul Eggleton, Maciej Borzecki
In-Reply-To: <cover.1479203195.git.maciej.borzecki@rndity.com>
Replace repeated core-image-minimal with Wic class field.
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
---
meta/lib/oeqa/selftest/wic.py | 111 +++++++++++++++++++++++++++---------------
1 file changed, 73 insertions(+), 38 deletions(-)
diff --git a/meta/lib/oeqa/selftest/wic.py b/meta/lib/oeqa/selftest/wic.py
index 2db14445956bc5adcf1e755844bbdb69edcb468f..37ed2c6de5a7f22f982f921476fa392304995b2e 100644
--- a/meta/lib/oeqa/selftest/wic.py
+++ b/meta/lib/oeqa/selftest/wic.py
@@ -57,6 +57,8 @@ class Wic(oeSelfTest):
resultdir = "/var/tmp/wic/build/"
image_is_ready = False
+ OE_IMAGE = "core-image-minimal"
+
def setUpLocal(self):
"""This code is executed before each test method."""
arch = get_bb_var('HOST_ARCH', 'core-image-minimal')
@@ -75,7 +77,7 @@ class Wic(oeSelfTest):
tools += ' syslinux syslinux-native'
bitbake(tools)
- bitbake('core-image-minimal')
+ bitbake(self.OE_IMAGE)
Wic.image_is_ready = True
rmtree(self.resultdir, ignore_errors=True)
@@ -100,14 +102,14 @@ class Wic(oeSelfTest):
def test_build_image_name(self):
"""Test wic create directdisk --image-name core-image-minimal"""
self.assertEqual(0, runCmd("wic create directdisk "
- "--image-name core-image-minimal").status)
+ "--image-name %s" % self.OE_IMAGE).status)
self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
@testcase(1212)
@onlyForArch('i586', 'i686', 'x86_64')
def test_build_artifacts(self):
"""Test wic create directdisk providing all artifacts."""
- bbvars = dict((var.lower(), get_bb_var(var, 'core-image-minimal')) \
+ bbvars = dict((var.lower(), get_bb_var(var, self.OE_IMAGE)) \
for var in ('STAGING_DATADIR', 'DEPLOY_DIR_IMAGE',
'STAGING_DIR_NATIVE', 'IMAGE_ROOTFS'))
status = runCmd("wic create directdisk "
@@ -123,7 +125,7 @@ class Wic(oeSelfTest):
def test_gpt_image(self):
"""Test creation of core-image-minimal with gpt table and UUID boot"""
self.assertEqual(0, runCmd("wic create directdisk-gpt "
- "--image-name core-image-minimal").status)
+ "--image-name %s" % self.OE_IMAGE).status)
self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
@testcase(1213)
@@ -157,8 +159,8 @@ class Wic(oeSelfTest):
def test_compress_gzip(self):
"""Test compressing an image with gzip"""
self.assertEqual(0, runCmd("wic create directdisk "
- "--image-name core-image-minimal "
- "-c gzip").status)
+ "--image-name %s "
+ "-c gzip" % self.OE_IMAGE).status)
self.assertEqual(1, len(glob(self.resultdir + \
"directdisk-*.direct.gz")))
@@ -167,8 +169,8 @@ class Wic(oeSelfTest):
def test_compress_bzip2(self):
"""Test compressing an image with bzip2"""
self.assertEqual(0, runCmd("wic create directdisk "
- "--image-name core-image-minimal "
- "-c bzip2").status)
+ "--image-name %s "
+ "-c bzip2" % self.OE_IMAGE).status)
self.assertEqual(1, len(glob(self.resultdir + \
"directdisk-*.direct.bz2")))
@@ -177,8 +179,8 @@ class Wic(oeSelfTest):
def test_compress_xz(self):
"""Test compressing an image with xz"""
self.assertEqual(0, runCmd("wic create directdisk "
- "--image-name core-image-minimal "
- "-c xz").status)
+ "--image-name %s "
+ "-c xz" % self.OE_IMAGE).status)
self.assertEqual(1, len(glob(self.resultdir + \
"directdisk-*.direct.xz")))
@@ -187,26 +189,31 @@ class Wic(oeSelfTest):
def test_wrong_compressor(self):
"""Test how wic breaks if wrong compressor is provided"""
self.assertEqual(2, runCmd("wic create directdisk "
- "--image-name core-image-minimal "
- "-c wrong", ignore_status=True).status)
+ "--image-name %s "
+ "-c wrong" % self.OE_IMAGE,
+ ignore_status=True).status)
@testcase(1268)
@onlyForArch('i586', 'i686', 'x86_64')
def test_rootfs_indirect_recipes(self):
"""Test usage of rootfs plugin with rootfs recipes"""
wks = "directdisk-multi-rootfs"
- self.assertEqual(0, runCmd("wic create %s "
- "--image-name core-image-minimal "
- "--rootfs rootfs1=core-image-minimal "
- "--rootfs rootfs2=core-image-minimal" \
- % wks).status)
+ wic_cmd_vars = {
+ 'wks': wks,
+ 'image': self.OE_IMAGE,
+ }
+ self.assertEqual(0, runCmd("wic create %(wks)s "
+ "--image-name %(image)s "
+ "--rootfs rootfs1=%(image)s "
+ "--rootfs rootfs2=%(image)s" \
+ % wic_cmd_vars).status)
self.assertEqual(1, len(glob(self.resultdir + "%s*.direct" % wks)))
@testcase(1269)
@onlyForArch('i586', 'i686', 'x86_64')
def test_rootfs_artifacts(self):
"""Test usage of rootfs plugin with rootfs paths"""
- bbvars = dict((var.lower(), get_bb_var(var, 'core-image-minimal')) \
+ bbvars = dict((var.lower(), get_bb_var(var, self.OE_IMAGE)) \
for var in ('STAGING_DATADIR', 'DEPLOY_DIR_IMAGE',
'STAGING_DIR_NATIVE', 'IMAGE_ROOTFS'))
bbvars['wks'] = "directdisk-multi-rootfs"
@@ -226,24 +233,23 @@ class Wic(oeSelfTest):
def test_iso_image(self):
"""Test creation of hybrid iso image with legacy and EFI boot"""
self.assertEqual(0, runCmd("wic create mkhybridiso "
- "--image-name core-image-minimal").status)
+ "--image-name %s" % self.OE_IMAGE).status)
self.assertEqual(1, len(glob(self.resultdir + "HYBRID_ISO_IMG-*.direct")))
self.assertEqual(1, len(glob(self.resultdir + "HYBRID_ISO_IMG-*.iso")))
@testcase(1347)
def test_image_env(self):
"""Test generation of <image>.env files."""
- image = 'core-image-minimal'
- self.assertEqual(0, bitbake('%s -c do_rootfs_wicenv' % image).status)
- stdir = get_bb_var('STAGING_DIR_TARGET', image)
+ self.assertEqual(0, bitbake('%s -c do_rootfs_wicenv' % self.OE_IMAGE).status)
+ stdir = get_bb_var('STAGING_DIR_TARGET', self.OE_IMAGE)
imgdatadir = os.path.join(stdir, 'imgdata')
- basename = get_bb_var('IMAGE_BASENAME', image)
- self.assertEqual(basename, image)
+ basename = get_bb_var('IMAGE_BASENAME', self.OE_IMAGE)
+ self.assertEqual(basename, self.OE_IMAGE)
path = os.path.join(imgdatadir, basename) + '.env'
self.assertTrue(os.path.isfile(path))
- wicvars = set(get_bb_var('WICVARS', image).split())
+ wicvars = set(get_bb_var('WICVARS', self.OE_IMAGE).split())
# filter out optional variables
wicvars = wicvars.difference(('HDDDIR', 'IMAGE_BOOT_FILES',
'INITRD', 'ISODIR'))
@@ -275,8 +281,12 @@ class Wic(oeSelfTest):
def test_qemux86_directdisk(self):
"""Test creation of qemux-86-directdisk image"""
image = "qemux86-directdisk"
- self.assertEqual(0, runCmd("wic create %s -e core-image-minimal" \
- % image).status)
+ wic_cmd_vars = {
+ 'wks': image,
+ 'image': self.OE_IMAGE,
+ }
+ self.assertEqual(0, runCmd("wic create %(wks)s -e %(image)s" \
+ % wic_cmd_vars).status)
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
@testcase(1349)
@@ -284,8 +294,12 @@ class Wic(oeSelfTest):
def test_mkgummidisk(self):
"""Test creation of mkgummidisk image"""
image = "mkgummidisk"
- self.assertEqual(0, runCmd("wic create %s -e core-image-minimal" \
- % image).status)
+ wic_cmd_vars = {
+ 'wks': image,
+ 'image': self.OE_IMAGE,
+ }
+ self.assertEqual(0, runCmd("wic create %(wks)s -e %(image)s" \
+ % wic_cmd_vars).status)
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
@testcase(1350)
@@ -293,8 +307,12 @@ class Wic(oeSelfTest):
def test_mkefidisk(self):
"""Test creation of mkefidisk image"""
image = "mkefidisk"
- self.assertEqual(0, runCmd("wic create %s -e core-image-minimal" \
- % image).status)
+ wic_cmd_vars = {
+ 'wks': image,
+ 'image': self.OE_IMAGE,
+ }
+ self.assertEqual(0, runCmd("wic create %(wks)s -e %(image)s" \
+ % wic_cmd_vars).status)
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
@testcase(1385)
@@ -302,8 +320,12 @@ class Wic(oeSelfTest):
def test_directdisk_bootloader_config(self):
"""Test creation of directdisk-bootloader-config image"""
image = "directdisk-bootloader-config"
- self.assertEqual(0, runCmd("wic create %s -e core-image-minimal" \
- % image).status)
+ wic_cmd_vars = {
+ 'wks': image,
+ 'image': self.OE_IMAGE,
+ }
+ self.assertEqual(0, runCmd("wic create %(wks)s -e %(image)s" \
+ % wic_cmd_vars).status)
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
@testcase(1422)
@@ -322,7 +344,12 @@ class Wic(oeSelfTest):
def test_bmap(self):
"""Test generation of .bmap file"""
image = "directdisk"
- status = runCmd("wic create %s -e core-image-minimal --bmap" % image).status
+ wic_cmd_vars = {
+ 'wks': image,
+ 'image': self.OE_IMAGE,
+ }
+ status = runCmd("wic create %(wks)s -e %(image)s --bmap" \
+ % wic_cmd_vars).status
self.assertEqual(0, status)
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct.bmap" % image)))
@@ -331,14 +358,22 @@ class Wic(oeSelfTest):
def test_systemd_bootdisk(self):
"""Test creation of systemd-bootdisk image"""
image = "systemd-bootdisk"
- self.assertEqual(0, runCmd("wic create %s -e core-image-minimal" \
- % image).status)
+ wic_cmd_vars = {
+ 'wks': image,
+ 'image': self.OE_IMAGE,
+ }
+ self.assertEqual(0, runCmd("wic create %(wks)s -e %(image)s" \
+ % wic_cmd_vars).status)
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
def test_sdimage_bootpart(self):
"""Test creation of sdimage-bootpart image"""
image = "sdimage-bootpart"
self.write_config('IMAGE_BOOT_FILES = "bzImage"\n')
- self.assertEqual(0, runCmd("wic create %s -e core-image-minimal" \
- % image).status)
+ wic_cmd_vars = {
+ 'wks': image,
+ 'image': self.OE_IMAGE,
+ }
+ self.assertEqual(0, runCmd("wic create %(wks)s -e %(image)s" \
+ % wic_cmd_vars).status)
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
--
2.5.0
^ permalink raw reply related
* [PATCH v3 06/11] wic: selftest: avoid COMPATIBLE_HOST issues
From: Maciej Borzecki @ 2016-11-15 9:52 UTC (permalink / raw)
To: openembedded-core; +Cc: Paul Eggleton, Maciej Borzecki
In-Reply-To: <cover.1479203195.git.maciej.borzecki@rndity.com>
wic tests will unconditionally attempt to build syslinux and add
configuration options that may not be compatible with current machine.
Resolve this by consulting HOST_ARCH (which defaults to TARGET_ARCH) and build
recipes, add configuration options or skip tests conditionally.
A convenience decorator onlyForArch() can be used to skip test cases for
specific architectures.
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
---
meta/lib/oeqa/selftest/wic.py | 51 +++++++++++++++++++++++++++++++++++++++----
1 file changed, 47 insertions(+), 4 deletions(-)
diff --git a/meta/lib/oeqa/selftest/wic.py b/meta/lib/oeqa/selftest/wic.py
index faac11e21643e4c32a83b649b6ae986fead498f1..2db14445956bc5adcf1e755844bbdb69edcb468f 100644
--- a/meta/lib/oeqa/selftest/wic.py
+++ b/meta/lib/oeqa/selftest/wic.py
@@ -24,15 +24,33 @@
"""Test cases for wic."""
import os
+import unittest
from glob import glob
from shutil import rmtree
+from functools import wraps
from oeqa.selftest.base import oeSelfTest
from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu
from oeqa.utils.decorators import testcase
+class onlyForArch(object):
+
+ def __init__(self, *args):
+ self.archs = args
+
+ def __call__(self,f):
+ @wraps(f)
+ def wrapped_f(*args, **kwargs):
+ arch = get_bb_var('HOST_ARCH', 'core-image-minimal')
+ if self.archs and arch not in self.archs :
+ raise unittest.SkipTest("Testcase arch dependency not met: %s" % arch)
+ return f(*args, **kwargs)
+ wrapped_f.__name__ = f.__name__
+ return wrapped_f
+
+
class Wic(oeSelfTest):
"""Wic test class."""
@@ -41,15 +59,22 @@ class Wic(oeSelfTest):
def setUpLocal(self):
"""This code is executed before each test method."""
- self.write_config('IMAGE_FSTYPES += " hddimg"\n'
- 'MACHINE_FEATURES_append = " efi"\n')
+ arch = get_bb_var('HOST_ARCH', 'core-image-minimal')
+ is_x86 = arch in ['i586', 'i686', 'x86_64']
+ if is_x86:
+ self.write_config('IMAGE_FSTYPES += " hddimg"\n' \
+ 'MACHINE_FEATURES_append = " efi"\n')
# Do this here instead of in setUpClass as the base setUp does some
# clean up which can result in the native tools built earlier in
# setUpClass being unavailable.
if not Wic.image_is_ready:
- bitbake('syslinux syslinux-native parted-native gptfdisk-native '
- 'dosfstools-native mtools-native bmap-tools-native')
+ tools = 'parted-native gptfdisk-native ' \
+ 'dosfstools-native mtools-native bmap-tools-native'
+ if is_x86:
+ tools += ' syslinux syslinux-native'
+ bitbake(tools)
+
bitbake('core-image-minimal')
Wic.image_is_ready = True
@@ -71,6 +96,7 @@ class Wic(oeSelfTest):
self.assertEqual(0, runCmd('wic list --help').status)
@testcase(1211)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_build_image_name(self):
"""Test wic create directdisk --image-name core-image-minimal"""
self.assertEqual(0, runCmd("wic create directdisk "
@@ -78,6 +104,7 @@ class Wic(oeSelfTest):
self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
@testcase(1212)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_build_artifacts(self):
"""Test wic create directdisk providing all artifacts."""
bbvars = dict((var.lower(), get_bb_var(var, 'core-image-minimal')) \
@@ -92,6 +119,7 @@ class Wic(oeSelfTest):
self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
@testcase(1157)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_gpt_image(self):
"""Test creation of core-image-minimal with gpt table and UUID boot"""
self.assertEqual(0, runCmd("wic create directdisk-gpt "
@@ -125,6 +153,7 @@ class Wic(oeSelfTest):
self.assertEqual(0, runCmd('wic help kickstart').status)
@testcase(1264)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_compress_gzip(self):
"""Test compressing an image with gzip"""
self.assertEqual(0, runCmd("wic create directdisk "
@@ -134,6 +163,7 @@ class Wic(oeSelfTest):
"directdisk-*.direct.gz")))
@testcase(1265)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_compress_bzip2(self):
"""Test compressing an image with bzip2"""
self.assertEqual(0, runCmd("wic create directdisk "
@@ -143,6 +173,7 @@ class Wic(oeSelfTest):
"directdisk-*.direct.bz2")))
@testcase(1266)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_compress_xz(self):
"""Test compressing an image with xz"""
self.assertEqual(0, runCmd("wic create directdisk "
@@ -152,6 +183,7 @@ class Wic(oeSelfTest):
"directdisk-*.direct.xz")))
@testcase(1267)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_wrong_compressor(self):
"""Test how wic breaks if wrong compressor is provided"""
self.assertEqual(2, runCmd("wic create directdisk "
@@ -159,6 +191,7 @@ class Wic(oeSelfTest):
"-c wrong", ignore_status=True).status)
@testcase(1268)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_rootfs_indirect_recipes(self):
"""Test usage of rootfs plugin with rootfs recipes"""
wks = "directdisk-multi-rootfs"
@@ -170,6 +203,7 @@ class Wic(oeSelfTest):
self.assertEqual(1, len(glob(self.resultdir + "%s*.direct" % wks)))
@testcase(1269)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_rootfs_artifacts(self):
"""Test usage of rootfs plugin with rootfs paths"""
bbvars = dict((var.lower(), get_bb_var(var, 'core-image-minimal')) \
@@ -188,6 +222,7 @@ class Wic(oeSelfTest):
"%(wks)s-*.direct" % bbvars)))
@testcase(1346)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_iso_image(self):
"""Test creation of hybrid iso image with legacy and EFI boot"""
self.assertEqual(0, runCmd("wic create mkhybridiso "
@@ -220,6 +255,7 @@ class Wic(oeSelfTest):
self.assertTrue(content[var])
@testcase(1351)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_wic_image_type(self):
"""Test building wic images by bitbake"""
self.assertEqual(0, bitbake('wic-image-minimal').status)
@@ -235,6 +271,7 @@ class Wic(oeSelfTest):
self.assertTrue(os.path.isfile(os.path.realpath(path)))
@testcase(1348)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_qemux86_directdisk(self):
"""Test creation of qemux-86-directdisk image"""
image = "qemux86-directdisk"
@@ -243,6 +280,7 @@ class Wic(oeSelfTest):
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
@testcase(1349)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_mkgummidisk(self):
"""Test creation of mkgummidisk image"""
image = "mkgummidisk"
@@ -251,6 +289,7 @@ class Wic(oeSelfTest):
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
@testcase(1350)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_mkefidisk(self):
"""Test creation of mkefidisk image"""
image = "mkefidisk"
@@ -259,6 +298,7 @@ class Wic(oeSelfTest):
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
@testcase(1385)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_directdisk_bootloader_config(self):
"""Test creation of directdisk-bootloader-config image"""
image = "directdisk-bootloader-config"
@@ -267,6 +307,7 @@ class Wic(oeSelfTest):
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
@testcase(1422)
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_qemu(self):
"""Test wic-image-minimal under qemu"""
self.assertEqual(0, bitbake('wic-image-minimal').status)
@@ -277,6 +318,7 @@ class Wic(oeSelfTest):
self.assertEqual(1, status, 'Failed to run command "%s": %s' % (command, output))
self.assertEqual(output, '/dev/root /\r\n/dev/vda3 /mnt')
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_bmap(self):
"""Test generation of .bmap file"""
image = "directdisk"
@@ -285,6 +327,7 @@ class Wic(oeSelfTest):
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
self.assertEqual(1, len(glob(self.resultdir + "%s-*direct.bmap" % image)))
+ @onlyForArch('i586', 'i686', 'x86_64')
def test_systemd_bootdisk(self):
"""Test creation of systemd-bootdisk image"""
image = "systemd-bootdisk"
--
2.5.0
^ permalink raw reply related
* [PATCH v3 05/11] wic: add --fixed-size wks option
From: Maciej Borzecki @ 2016-11-15 9:52 UTC (permalink / raw)
To: openembedded-core; +Cc: Paul Eggleton, Maciej Borzecki
In-Reply-To: <cover.1479203195.git.maciej.borzecki@rndity.com>
Added new option --fixed-size to wks. The option can be used to indicate
the exact size of a partition. The option cannot be added together with
--size, in which case an error will be raised. Other options that
influence automatic partition size (--extra-space, --overhead-factor),
if specifiec along with --fixed-size, will raise an error.
If it partition data is larger than the amount of space specified with
--fixed-size option wic will raise an error.
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
---
scripts/lib/wic/help.py | 14 ++++--
scripts/lib/wic/imager/direct.py | 2 +-
scripts/lib/wic/ksparser.py | 41 ++++++++++++++--
scripts/lib/wic/partition.py | 88 +++++++++++++++++++++-------------
scripts/lib/wic/utils/partitionedfs.py | 2 +-
5 files changed, 105 insertions(+), 42 deletions(-)
diff --git a/scripts/lib/wic/help.py b/scripts/lib/wic/help.py
index e5347ec4b7c900c68fc64351a5293e75de0672b3..daa11bf489c135627ddfe4cef968e48f8e3ad1d8 100644
--- a/scripts/lib/wic/help.py
+++ b/scripts/lib/wic/help.py
@@ -646,6 +646,12 @@ DESCRIPTION
not specified, the size is in MB.
You do not need this option if you use --source.
+ --fixed-size: Exact partition size. Value format is the same
+ as for --size option. This option cannot be
+ specified along with --size. If partition data
+ is larger than --fixed-size and error will be
+ raised when assembling disk image.
+
--source: This option is a wic-specific option that names the
source of the data that will populate the
partition. The most common value for this option
@@ -719,13 +725,15 @@ DESCRIPTION
space after the space filled by the content
of the partition. The final size can go
beyond the size specified by --size.
- By default, 10MB.
+ By default, 10MB. This option cannot be used
+ with --fixed-size option.
--overhead-factor: This option is specific to wic. The
size of the partition is multiplied by
this factor. It has to be greater than or
- equal to 1.
- The default value is 1.3.
+ equal to 1. The default value is 1.3.
+ This option cannot be used with --fixed-size
+ option.
--part-type: This option is specific to wic. It specifies partition
type GUID for GPT partitions.
diff --git a/scripts/lib/wic/imager/direct.py b/scripts/lib/wic/imager/direct.py
index 2bedef08d6450096c786def6f75a9ee53fcd4b3b..11ec15e33f65885618c7adc83e55c6a39fedbe99 100644
--- a/scripts/lib/wic/imager/direct.py
+++ b/scripts/lib/wic/imager/direct.py
@@ -290,7 +290,7 @@ class DirectImageCreator(BaseImageCreator):
self.bootimg_dir, self.kernel_dir, self.native_sysroot)
- self.__image.add_partition(int(part.size),
+ self.__image.add_partition(part.disk_size,
part.disk,
part.mountpoint,
part.source_file,
diff --git a/scripts/lib/wic/ksparser.py b/scripts/lib/wic/ksparser.py
index 0894e2b199a299fbbed272f2e1c95e9d692e3ab1..62c490274aa92bf82aac304d9323250e3b728d0c 100644
--- a/scripts/lib/wic/ksparser.py
+++ b/scripts/lib/wic/ksparser.py
@@ -113,6 +113,9 @@ def systemidtype(arg):
class KickStart():
""""Kickstart parser implementation."""
+ DEFAULT_EXTRA_SPACE = 10*1024
+ DEFAULT_OVERHEAD_FACTOR = 1.3
+
def __init__(self, confpath):
self.partitions = []
@@ -127,16 +130,24 @@ class KickStart():
part.add_argument('mountpoint', nargs='?')
part.add_argument('--active', action='store_true')
part.add_argument('--align', type=int)
- part.add_argument("--extra-space", type=sizetype, default=10*1024)
+ part.add_argument("--extra-space", type=sizetype)
part.add_argument('--fsoptions', dest='fsopts')
part.add_argument('--fstype')
part.add_argument('--label')
part.add_argument('--no-table', action='store_true')
part.add_argument('--ondisk', '--ondrive', dest='disk')
- part.add_argument("--overhead-factor", type=overheadtype, default=1.3)
+ part.add_argument("--overhead-factor", type=overheadtype)
part.add_argument('--part-type')
part.add_argument('--rootfs-dir')
- part.add_argument('--size', type=sizetype, default=0)
+
+ # --size and --fixed-size cannot be specified together; options
+ # ----extra-space and --overhead-factor should also raise a parser
+ # --error, but since nesting mutually exclusive groups does not work,
+ # ----extra-space/--overhead-factor are handled later
+ sizeexcl = part.add_mutually_exclusive_group()
+ sizeexcl.add_argument('--size', type=sizetype, default=0)
+ sizeexcl.add_argument('--fixed-size', type=sizetype, default=0)
+
part.add_argument('--source')
part.add_argument('--sourceparams')
part.add_argument('--system-id', type=systemidtype)
@@ -170,11 +181,33 @@ class KickStart():
lineno += 1
if line and line[0] != '#':
try:
- parsed = parser.parse_args(shlex.split(line))
+ line_args = shlex.split(line)
+ parsed = parser.parse_args(line_args)
except ArgumentError as err:
raise KickStartError('%s:%d: %s' % \
(confpath, lineno, err))
if line.startswith('part'):
+ # using ArgumentParser one cannot easily tell if option
+ # was passed as argument, if said option has a default
+ # value; --overhead-factor/--extra-space cannot be used
+ # with --fixed-size, so at least detect when these were
+ # passed with non-0 values ...
+ if parsed.fixed_size:
+ if parsed.overhead_factor or parsed.extra_space:
+ err = "%s:%d: arguments --overhead-factor and --extra-space not "\
+ "allowed with argument --fixed-size" \
+ % (confpath, lineno)
+ raise KickStartError(err)
+ else:
+ # ... and provide defaults if not using
+ # --fixed-size iff given option was not used
+ # (again, one cannot tell if option was passed but
+ # with value equal to 0)
+ if '--overhead-factor' not in line_args:
+ parsed.overhead_factor = self.DEFAULT_OVERHEAD_FACTOR
+ if '--extra-space' not in line_args:
+ parsed.extra_space = self.DEFAULT_EXTRA_SPACE
+
self.partnum += 1
self.partitions.append(Partition(parsed, self.partnum))
elif line.startswith('include'):
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
index ac4c836bdb53300d3a4e4c09926b7b1514b8faf2..8cf966ebc6d07490c44cefc93acbe5868be30ac7 100644
--- a/scripts/lib/wic/partition.py
+++ b/scripts/lib/wic/partition.py
@@ -54,6 +54,7 @@ class Partition():
self.part_type = args.part_type
self.rootfs_dir = args.rootfs_dir
self.size = args.size
+ self.fixed_size = args.fixed_size
self.source = args.source
self.sourceparams = args.sourceparams
self.system_id = args.system_id
@@ -87,6 +88,41 @@ class Partition():
else:
return 0
+ def get_rootfs_size(self, actual_rootfs_size=0):
+ """
+ Calculate the required size of rootfs taking into consideration
+ --size/--fixed-size flags as well as overhead and extra space, as
+ specified in kickstart file. Raises an error if the
+ `actual_rootfs_size` is larger than fixed-size rootfs.
+
+ """
+ if self.fixed_size:
+ rootfs_size = self.fixed_size
+ if actual_rootfs_size > rootfs_size:
+ msger.error("Actual rootfs size (%d kB) is larger than allowed size %d kB" \
+ %(actual_rootfs_size, rootfs_size))
+ else:
+ extra_blocks = self.get_extra_block_count(actual_rootfs_size)
+ if extra_blocks < self.extra_space:
+ extra_blocks = self.extra_space
+
+ rootfs_size = actual_rootfs_size + extra_blocks
+ rootfs_size *= self.overhead_factor
+
+ msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \
+ (extra_blocks, self.mountpoint, rootfs_size))
+
+ return rootfs_size
+
+ @property
+ def disk_size(self):
+ """
+ Obtain on-disk size of partition taking into consideration
+ --size/--fixed-size options.
+
+ """
+ return self.fixed_size if self.fixed_size else self.size
+
def prepare(self, creator, cr_workdir, oe_builddir, rootfs_dir,
bootimg_dir, kernel_dir, native_sysroot):
"""
@@ -97,9 +133,9 @@ class Partition():
self.sourceparams_dict = parse_sourceparams(self.sourceparams)
if not self.source:
- if not self.size:
- msger.error("The %s partition has a size of zero. Please "
- "specify a non-zero --size for that partition." % \
+ if not self.size and not self.fixed_size:
+ msger.error("The %s partition has a size of zero. Please "
+ "specify a non-zero --size/--fixed-size for that partition." % \
self.mountpoint)
if self.fstype and self.fstype == "swap":
self.prepare_swap_partition(cr_workdir, oe_builddir,
@@ -146,6 +182,7 @@ class Partition():
oe_builddir,
bootimg_dir, kernel_dir, rootfs_dir,
native_sysroot)
+
# further processing required Partition.size to be an integer, make
# sure that it is one
if type(self.size) is not int:
@@ -153,6 +190,12 @@ class Partition():
"This a bug in source plugin %s and needs to be fixed." \
% (self.mountpoint, self.source))
+ if self.fixed_size and self.size > self.fixed_size:
+ msger.error("File system image of partition %s is larger (%d kB) than its"\
+ "allowed size %d kB" % (self.mountpoint,
+ self.size, self.fixed_size))
+
+
def prepare_rootfs_from_fs_image(self, cr_workdir, oe_builddir,
rootfs_dir):
"""
@@ -217,15 +260,7 @@ class Partition():
out = exec_cmd(du_cmd)
actual_rootfs_size = int(out.split()[0])
- extra_blocks = self.get_extra_block_count(actual_rootfs_size)
- if extra_blocks < self.extra_space:
- extra_blocks = self.extra_space
-
- rootfs_size = actual_rootfs_size + extra_blocks
- rootfs_size *= self.overhead_factor
-
- msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \
- (extra_blocks, self.mountpoint, rootfs_size))
+ rootfs_size = self.get_rootfs_size(actual_rootfs_size)
with open(rootfs, 'w') as sparse:
os.ftruncate(sparse.fileno(), rootfs_size * 1024)
@@ -251,15 +286,7 @@ class Partition():
out = exec_cmd(du_cmd)
actual_rootfs_size = int(out.split()[0])
- extra_blocks = self.get_extra_block_count(actual_rootfs_size)
- if extra_blocks < self.extra_space:
- extra_blocks = self.extra_space
-
- rootfs_size = actual_rootfs_size + extra_blocks
- rootfs_size *= self.overhead_factor
-
- msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \
- (extra_blocks, self.mountpoint, rootfs_size))
+ rootfs_size = self.get_rootfs_size(actual_rootfs_size)
with open(rootfs, 'w') as sparse:
os.ftruncate(sparse.fileno(), rootfs_size * 1024)
@@ -281,20 +308,13 @@ class Partition():
out = exec_cmd(du_cmd)
blocks = int(out.split()[0])
- extra_blocks = self.get_extra_block_count(blocks)
- if extra_blocks < self.extra_space:
- extra_blocks = self.extra_space
-
- blocks += extra_blocks
-
- msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \
- (extra_blocks, self.mountpoint, blocks))
+ rootfs_size = self.get_rootfs_size(blocks)
label_str = "-n boot"
if self.label:
label_str = "-n %s" % self.label
- dosfs_cmd = "mkdosfs %s -S 512 -C %s %d" % (label_str, rootfs, blocks)
+ dosfs_cmd = "mkdosfs %s -S 512 -C %s %d" % (label_str, rootfs, rootfs_size)
exec_native_cmd(dosfs_cmd, native_sysroot)
mcopy_cmd = "mcopy -i %s -s %s/* ::/" % (rootfs, rootfs_dir)
@@ -317,8 +337,9 @@ class Partition():
"""
Prepare an empty ext2/3/4 partition.
"""
+ size = self.disk_size
with open(rootfs, 'w') as sparse:
- os.ftruncate(sparse.fileno(), self.size * 1024)
+ os.ftruncate(sparse.fileno(), size * 1024)
extra_imagecmd = "-i 8192"
@@ -335,8 +356,9 @@ class Partition():
"""
Prepare an empty btrfs partition.
"""
+ size = self.disk_size
with open(rootfs, 'w') as sparse:
- os.ftruncate(sparse.fileno(), self.size * 1024)
+ os.ftruncate(sparse.fileno(), size * 1024)
label_str = ""
if self.label:
@@ -351,7 +373,7 @@ class Partition():
"""
Prepare an empty vfat partition.
"""
- blocks = self.size
+ blocks = self.disk_size
label_str = "-n boot"
if self.label:
diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py
index 9e76487844eebfffc7227d053a65dc9fdab3678b..cfa5f5ce09b764c1c2a9b7a3f7bf7d677a6811c4 100644
--- a/scripts/lib/wic/utils/partitionedfs.py
+++ b/scripts/lib/wic/utils/partitionedfs.py
@@ -209,7 +209,7 @@ class Image():
msger.debug("Assigned %s to %s%d, sectors range %d-%d size %d "
"sectors (%d bytes)." \
% (part['mountpoint'], part['disk_name'], part['num'],
- part['start'], part['start'] + part['size'] - 1,
+ part['start'], disk['offset'] - 1,
part['size'], part['size'] * self.sector_size))
# Once all the partitions have been layed out, we can calculate the
--
2.5.0
^ permalink raw reply related
* [PATCH v3 04/11] wic: fix function comment typos
From: Maciej Borzecki @ 2016-11-15 9:52 UTC (permalink / raw)
To: openembedded-core; +Cc: Paul Eggleton, Maciej Borzecki
In-Reply-To: <cover.1479203195.git.maciej.borzecki@rndity.com>
Fix typos in documentation of Image.add_partition() and
Image.__format_disks().
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
---
scripts/lib/wic/utils/partitionedfs.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py
index cb03009fc7e3c97305079629ded7d2ff01eba4c4..9e76487844eebfffc7227d053a65dc9fdab3678b 100644
--- a/scripts/lib/wic/utils/partitionedfs.py
+++ b/scripts/lib/wic/utils/partitionedfs.py
@@ -92,7 +92,7 @@ class Image():
def add_partition(self, size, disk_name, mountpoint, source_file=None, fstype=None,
label=None, fsopts=None, boot=False, align=None, no_table=False,
part_type=None, uuid=None, system_id=None):
- """ Add the next partition. Prtitions have to be added in the
+ """ Add the next partition. Partitions have to be added in the
first-to-last order. """
ks_pnum = len(self.partitions)
@@ -292,7 +292,7 @@ class Image():
# even number of sectors.
if part['mountpoint'] == "/boot" and part['fstype'] in ["vfat", "msdos"] \
and part['size'] % 2:
- msger.debug("Substracting one sector from '%s' partition to " \
+ msger.debug("Subtracting one sector from '%s' partition to " \
"get even number of sectors for the partition" % \
part['mountpoint'])
part['size'] -= 1
--
2.5.0
^ permalink raw reply related
* [PATCH v3 03/11] wic: check that filesystem is specified for a rootfs partition
From: Maciej Borzecki @ 2016-11-15 9:52 UTC (permalink / raw)
To: openembedded-core; +Cc: Paul Eggleton, Maciej Borzecki
In-Reply-To: <cover.1479203195.git.maciej.borzecki@rndity.com>
We explicitly check for --fstype if no source was provided for a
partition. However, this was not the case for rootfs partitions. Make
sure to raise an error if filesystem was left unspecified when preparing
a rootfs partition image.
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
---
scripts/lib/wic/partition.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
index f3835339afc5091604ffd7f0d0acf1d1ad4351cc..ac4c836bdb53300d3a4e4c09926b7b1514b8faf2 100644
--- a/scripts/lib/wic/partition.py
+++ b/scripts/lib/wic/partition.py
@@ -190,6 +190,10 @@ class Partition():
if os.path.isfile(rootfs):
os.remove(rootfs)
+ if not self.fstype:
+ msger.error("File system for partition %s not specified in kickstart, " \
+ "use --fstype option" % (self.mountpoint))
+
for prefix in ("ext", "btrfs", "vfat", "squashfs"):
if self.fstype.startswith(prefix):
method = getattr(self, "prepare_rootfs_" + prefix)
--
2.5.0
^ permalink raw reply related
* [PATCH v3 02/11] wic: use partition size when creating empty partition files
From: Maciej Borzecki @ 2016-11-15 9:52 UTC (permalink / raw)
To: openembedded-core; +Cc: Paul Eggleton, Maciej Borzecki
In-Reply-To: <cover.1479203195.git.maciej.borzecki@rndity.com>
It seems that prepare_empty_partition_ext() and
prepare_empty_partition_btrfs() got broken in commit
c8669749e37fe865c197c98d5671d9de176ff4dd, thus one could observe the
following backtrace:
Backtrace:
File "<snip>/poky/scripts/lib/wic/plugins/imager/direct_plugin.py", line 93, in do_create
creator.create()
File "<snip>/poky/scripts/lib/wic/imager/baseimager.py", line 159, in create
self._create()
File "<snip>/poky/scripts/lib/wic/imager/direct.py", line 290, in _create
self.bootimg_dir, self.kernel_dir, self.native_sysroot)
File "<snip>/poky/scripts/lib/wic/partition.py", line 146, in prepare
method(rootfs, oe_builddir, native_sysroot)
File "<snip>/poky/scripts/lib/wic/partition.py", line 325, in prepare_empty_partition_ext
os.ftruncate(sparse.fileno(), rootfs_size * 1024)
NameError: name 'rootfs_size' is not defined
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
---
scripts/lib/wic/partition.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
index 959035a97110244ffe56e95a886e122c400d4779..f3835339afc5091604ffd7f0d0acf1d1ad4351cc 100644
--- a/scripts/lib/wic/partition.py
+++ b/scripts/lib/wic/partition.py
@@ -314,7 +314,7 @@ class Partition():
Prepare an empty ext2/3/4 partition.
"""
with open(rootfs, 'w') as sparse:
- os.ftruncate(sparse.fileno(), rootfs_size * 1024)
+ os.ftruncate(sparse.fileno(), self.size * 1024)
extra_imagecmd = "-i 8192"
@@ -332,7 +332,7 @@ class Partition():
Prepare an empty btrfs partition.
"""
with open(rootfs, 'w') as sparse:
- os.ftruncate(sparse.fileno(), rootfs_size * 1024)
+ os.ftruncate(sparse.fileno(), self.size * 1024)
label_str = ""
if self.label:
--
2.5.0
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox