[OE-core] [PATCH] kernel.bbclass: allow custom KERNEL_IMAGEDEST

2018-10-22 Thread Ioan-Adrian Ratiu
Some distros want to install the kernel in a custom location other
than /boot and have it properly packaged, so it's useful to use a
weaker assignment.

Signed-off-by: Ioan-Adrian Ratiu 
---
 meta/classes/kernel.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index d0fbbd1989..e04d2fe004 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -164,7 +164,7 @@ KERNEL_RELEASE ?= "${KERNEL_VERSION}"
 
 # The directory where built kernel lies in the kernel tree
 KERNEL_OUTPUT_DIR ?= "arch/${ARCH}/boot"
-KERNEL_IMAGEDEST = "boot"
+KERNEL_IMAGEDEST ?= "boot"
 
 #
 # configuration
-- 
2.19.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v2] rootfs: always update the opkg index

2018-09-25 Thread Ioan-Adrian Ratiu
The previous logic assumed that if $BUILD_IMAGES_FROM_FEEDS=1 then a
complete set of ipk feeds from which to build the image is already
present under $IPK_FEED_URIS at do_rootfs runtime.

$IPK_FEED_URIS usually contains "file://${DEPLOY_DIR_IPK}" which
renders the above assumption bad because some recipes in the current
build can contain code like do_install[nostamp] = "1" which will cause
rebuilds bumping $PR and invalidating the index.

Even when the index is manually re-created before an image build
("bitbake package-index"), the nostamp will cause failures because the
dependency gets rebuilt before do_rootfs in the "bitbake " call.

So make the opkg rootfs index logic the same as for rpm/deb, to always
update the index in $DEPLOY_DIR_IPK to fix the above nostamp failure.

Feeds outside $DEPLOY_DIR_IPK added to $IPK_FEED_URIS continue to work
as usual, for eg. by using a http:// URI.

Signed-off-by: Ioan-Adrian Ratiu 
---
 meta/lib/oe/rootfs.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index cdb86f7715..67ae281e47 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -853,9 +853,8 @@ class OpkgRootfs(DpkgOpkgRootfs):
 opkg_pre_process_cmds = self.d.getVar('OPKG_PREPROCESS_COMMANDS')
 opkg_post_process_cmds = self.d.getVar('OPKG_POSTPROCESS_COMMANDS')
 
-# update PM index files, unless users provide their own feeds
-if (self.d.getVar('BUILD_IMAGES_FROM_FEEDS') or "") != "1":
-self.pm.write_index()
+# update PM index files
+self.pm.write_index()
 
 execute_pre_post_process(self.d, opkg_pre_process_cmds)
 
-- 
2.19.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [bitbake-devel][PATCH] utils: lockfile: Fix infinite loop

2018-09-25 Thread Ioan-Adrian Ratiu
A nasty corner case leads to a hang when utils.lockfile is called from
oe-core's package-manager:deploy_dir_lock (in turn called from
rootfs:_create further up the call stack) with "name" owned by root
and the user running bitbake has no write access.

Because this code runs under pseudo, the UID and EUID of the bitbake
worker process are 0, so the os.access(dirname, os.W_OK) returns True
i.e. it thinks the path is writable when in fact it's not writable.

Only later when trying to open the file an Exception it thrown because
the OS prohibits writing, but the Exception is ignored and the open is
retried leading to an infinite loop.

So this fix is to not ignore the "Permission Denied" exception.

An alternative fix would be to replace the os.access() call with an
try: open() except() at the beginning of the function.

Signed-off-by: Ioan-Adrian Ratiu 
---
 lib/bb/utils.py | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/bb/utils.py b/lib/bb/utils.py
index 56894f13..73b6cb42 100644
--- a/lib/bb/utils.py
+++ b/lib/bb/utils.py
@@ -497,7 +497,11 @@ def lockfile(name, shared=False, retry=True, block=False):
 if statinfo.st_ino == statinfo2.st_ino:
 return lf
 lf.close()
-except Exception:
+except OSError as e:
+if e.errno == errno.EACCES:
+logger.error("Unable to acquire lock '%s', %s",
+ e.strerror, name)
+sys.exit(1)
 try:
 lf.close()
 except Exception:
-- 
2.19.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] rootfs: always update the opkg index

2018-09-25 Thread Ioan-Adrian Ratiu
On Tue, 25 Sep 2018, Ioan-Adrian Ratiu  wrote:
> On Mon, 24 Sep 2018, richard.pur...@linuxfoundation.org wrote:
>> On Mon, 2018-09-24 at 18:00 +0300, Ioan-Adrian Ratiu wrote:
>>> > With master, a copy of the feed is constructed under WORKDIR which
>>> > is
>>> > then indexed since other image generation or package writes could
>>> > occur
>>> > and the index isn't static. I'm guessing it doesn't do this for
>>> > external feeds and assumes those feeds are static.
>>> 
>>> My description of the problem mirrors my understanding of the feed
>>> construction process which might be limited especially if it changed
>>> on master post-Sumo, but the answer is yes, external feeds are
>>> assumed static.
>>
>> Ok.
>>
>>> > I am wondering what happens if you put a remote (http://) url into
>>> > this
>>> > though? Does that still work or does it break?
>>> 
>>> It still works, we're using http paths all the time in our distro
>>> (public feed server is at http://download.ni.com/ni-linux-rt/)
>>
>> That is good to know and worth mentioning in the commit message as that
>> isn't clear.
>>
>>> > 
>>> > I'm also worried about what happens if the file:// path you point
>>> > at is
>>> > owned by another user and isn't writable.
>>> 
>>> Thanks for pointing this out. Looks like it enters an infinite loop:
>>> the
>>> do_rootfs task is stuck at 3% and a worker process pegs a core to
>>> 100%.
>>> 
>>> Without this change, do_rootfs gets stuck at 12%, worker pegging a
>>> core
>>> if the feed is owned by another user with no write permissions.
>>> 
>>> This was unexpected :) I'll roll up my sleeves and start digging.
>>> 
>>> Do you have any pointers about what might be happening?
>>
>> I was expecting it to error, not hang. If I had to totally guess, I'd
>> guess at the bb.utils.lockfile() hanging.
>
> I can't reproduce the hang anymore (with or without my change)... I
> tried re-using the sstate, clearing it, all combinations of calling
> bitbake packagegroups, package-index, image, etc and still no hang.
>
> I'm thinking the hang was caused by a build race I can't easily
> reproduce.
>
> Now I get "operation not permitted" errors every time like this one:
>
> Exception: subprocess.CalledProcessError: Command 'cd
> (...)/tmp-glibc/work/core2-64-nilrt-linux/safemode-image/1.0-r0/deploy-ipks; 
> find . -type d -print | tar --xattrs --xattrs-include='*' -cf - -C 
> (...)/tmp-glibc/work/core2-64-nilrt-linux/safemode-image/1.0-r0/deploy-ipks
> -p --no-recursion --files-from - | tar --xattrs --xattrs-include='*' -xhf - 
> -C (...)/tmp-glibc/deploy/ipk' returned non-zero exit status 2.
>
> Subprocess output:
> tar: ./core2-64: Cannot utime: Operation not permitted
> tar: .: Cannot utime: Operation not permitted
> tar: Exiting with failure status due to previous errors
>
> ERROR: safemode-image-1.0-r0 do_package_write_ipk: Function failed:
> sstate_task_postfunc
> ERROR: Logfile of failure stored in:
> (...)/tmp-glibc/work/core2-64-nilrt-linux/safemode-image/1.0-r0/temp/log.do_package_write_ipk.21668
>
> Seeing that the hang is not related to this change, are you ok with
> integrating v2 in which I'll update the commit message to mention
> http:// URI's still work as expected?

Please ignore this message, I was misled by the bad naming (the
safemode-image is actually a package), the hang reproduces, I'm on it.

>
>>
>> Cheers,
>>
>> Richard
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] rootfs: always update the opkg index

2018-09-25 Thread Ioan-Adrian Ratiu
On Mon, 24 Sep 2018, richard.pur...@linuxfoundation.org wrote:
> On Mon, 2018-09-24 at 18:00 +0300, Ioan-Adrian Ratiu wrote:
>> > With master, a copy of the feed is constructed under WORKDIR which
>> > is
>> > then indexed since other image generation or package writes could
>> > occur
>> > and the index isn't static. I'm guessing it doesn't do this for
>> > external feeds and assumes those feeds are static.
>> 
>> My description of the problem mirrors my understanding of the feed
>> construction process which might be limited especially if it changed
>> on master post-Sumo, but the answer is yes, external feeds are
>> assumed static.
>
> Ok.
>
>> > I am wondering what happens if you put a remote (http://) url into
>> > this
>> > though? Does that still work or does it break?
>> 
>> It still works, we're using http paths all the time in our distro
>> (public feed server is at http://download.ni.com/ni-linux-rt/)
>
> That is good to know and worth mentioning in the commit message as that
> isn't clear.
>
>> > 
>> > I'm also worried about what happens if the file:// path you point
>> > at is
>> > owned by another user and isn't writable.
>> 
>> Thanks for pointing this out. Looks like it enters an infinite loop:
>> the
>> do_rootfs task is stuck at 3% and a worker process pegs a core to
>> 100%.
>> 
>> Without this change, do_rootfs gets stuck at 12%, worker pegging a
>> core
>> if the feed is owned by another user with no write permissions.
>> 
>> This was unexpected :) I'll roll up my sleeves and start digging.
>> 
>> Do you have any pointers about what might be happening?
>
> I was expecting it to error, not hang. If I had to totally guess, I'd
> guess at the bb.utils.lockfile() hanging.

I can't reproduce the hang anymore (with or without my change)... I
tried re-using the sstate, clearing it, all combinations of calling
bitbake packagegroups, package-index, image, etc and still no hang.

I'm thinking the hang was caused by a build race I can't easily
reproduce.

Now I get "operation not permitted" errors every time like this one:

Exception: subprocess.CalledProcessError: Command 'cd
(...)/tmp-glibc/work/core2-64-nilrt-linux/safemode-image/1.0-r0/deploy-ipks; 
find . -type d -print | tar --xattrs --xattrs-include='*' -cf - -C 
(...)/tmp-glibc/work/core2-64-nilrt-linux/safemode-image/1.0-r0/deploy-ipks
-p --no-recursion --files-from - | tar --xattrs --xattrs-include='*' -xhf - -C 
(...)/tmp-glibc/deploy/ipk' returned non-zero exit status 2.

Subprocess output:
tar: ./core2-64: Cannot utime: Operation not permitted
tar: .: Cannot utime: Operation not permitted
tar: Exiting with failure status due to previous errors

ERROR: safemode-image-1.0-r0 do_package_write_ipk: Function failed:
sstate_task_postfunc
ERROR: Logfile of failure stored in:
(...)/tmp-glibc/work/core2-64-nilrt-linux/safemode-image/1.0-r0/temp/log.do_package_write_ipk.21668

Seeing that the hang is not related to this change, are you ok with
integrating v2 in which I'll update the commit message to mention
http:// URI's still work as expected?

>
> Cheers,
>
> Richard
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] rootfs: always update the opkg index

2018-09-24 Thread Ioan-Adrian Ratiu
On Mon, 24 Sep 2018, Richard Purdie  wrote:
> On Mon, 2018-09-24 at 16:25 +0300, Ioan-Adrian Ratiu wrote:
>> The previous logic assumed that if $BUILD_IMAGES_FROM_FEEDS=1 then a
>> complete set of ipk feeds from which to build the image is already
>> present under $IPK_FEED_URIS at do_rootfs runtime.
>> 
>> $IPK_FEED_URIS usually contains "file://${DEPLOY_DIR_IPK}" which
>> renders the above assumption bad because some recipes in the current
>> build can contain code like do_install[nostamp] = "1" which will
>> cause
>> rebuilds bumping $PR and invalidating the index.
>> 
>> Even when the index is manually re-created before an image build
>> ("bitbake package-index"), the nostamp will cause failures because
>> the
>> dependency gets rebuilt before do_rootfs in the "bitbake "
>> call.
>> 
>> So make the opkg rootfs index logic the same as for rpm/deb, to
>> always
>> update the index in $DEPLOY_DIR_IPK to fix the above nostamp failure.
>> 
>> Feeds outside $DEPLOY_DIR_IPK continue to work as usual.
>
> Is this with master or an older branch?

I've extensively tested this with Sumo, on master I could only verify
the build passes and a minimal image boots.

>
> With master, a copy of the feed is constructed under WORKDIR which is
> then indexed since other image generation or package writes could occur
> and the index isn't static. I'm guessing it doesn't do this for
> external feeds and assumes those feeds are static.

My description of the problem mirrors my understanding of the feed
construction process which might be limited especially if it changed on
master post-Sumo, but the answer is yes, external feeds are assumed
static.

>
> I am wondering what happens if you put a remote (http://) url into this
> though? Does that still work or does it break?

It still works, we're using http paths all the time in our distro
(public feed server is at http://download.ni.com/ni-linux-rt/)

>
> I'm also worried about what happens if the file:// path you point at is
> owned by another user and isn't writable.

Thanks for pointing this out. Looks like it enters an infinite loop: the
do_rootfs task is stuck at 3% and a worker process pegs a core to 100%.

Without this change, do_rootfs gets stuck at 12%, worker pegging a core
if the feed is owned by another user with no write permissions.

This was unexpected :) I'll roll up my sleeves and start digging.

Do you have any pointers about what might be happening?

>
> Cheers,
>
> Richard
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] rootfs: always update the opkg index

2018-09-24 Thread Ioan-Adrian Ratiu
The previous logic assumed that if $BUILD_IMAGES_FROM_FEEDS=1 then a
complete set of ipk feeds from which to build the image is already
present under $IPK_FEED_URIS at do_rootfs runtime.

$IPK_FEED_URIS usually contains "file://${DEPLOY_DIR_IPK}" which
renders the above assumption bad because some recipes in the current
build can contain code like do_install[nostamp] = "1" which will cause
rebuilds bumping $PR and invalidating the index.

Even when the index is manually re-created before an image build
("bitbake package-index"), the nostamp will cause failures because the
dependency gets rebuilt before do_rootfs in the "bitbake " call.

So make the opkg rootfs index logic the same as for rpm/deb, to always
update the index in $DEPLOY_DIR_IPK to fix the above nostamp failure.

Feeds outside $DEPLOY_DIR_IPK continue to work as usual.

Signed-off-by: Ioan-Adrian Ratiu 
---
 meta/lib/oe/rootfs.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index cdb86f7715..67ae281e47 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -853,9 +853,8 @@ class OpkgRootfs(DpkgOpkgRootfs):
 opkg_pre_process_cmds = self.d.getVar('OPKG_PREPROCESS_COMMANDS')
 opkg_post_process_cmds = self.d.getVar('OPKG_POSTPROCESS_COMMANDS')
 
-# update PM index files, unless users provide their own feeds
-if (self.d.getVar('BUILD_IMAGES_FROM_FEEDS') or "") != "1":
-self.pm.write_index()
+# update PM index files
+self.pm.write_index()
 
 execute_pre_post_process(self.d, opkg_pre_process_cmds)
 
-- 
2.19.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v2] isoimage-isohybrid: don't include cpio in cpio image

2018-09-18 Thread Ioan-Adrian Ratiu
Because the find | cpio processes execute in parallel connected via
the pipe, and the cpio outputs in the same dir find searches for
source files, the cpio will be included in itself partially, depending
on how fast the build machine creates the cpio file before cpio
gobbles it up.

This bloats the ISO image, though compression reduces the .iso file size,
once the kernel decompresses the cpio image and boots it live, it uses
up to double the RAM memory.

Fix this by creating the initrd.cpio file directly inside cr_workdir.

Signed-off-by: Ioan-Adrian Ratiu 
---
 scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py 
b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
index 25a695da17..170077c22c 100644
--- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
+++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -191,10 +191,9 @@ class IsoImagePlugin(SourcePlugin):
 else:
 raise WicError("Couldn't find or build initrd, exiting.")
 
-exec_cmd("cd %s && find . | cpio -o -H newc -R root:root 
>./initrd.cpio " \
-% initrd_dir, as_shell=True)
-exec_cmd("gzip -f -9 -c %s/initrd.cpio > %s" \
-% (initrd_dir, initrd), as_shell=True)
+exec_cmd("cd %s && find . | cpio -o -H newc -R root:root 
>%s/initrd.cpio " \
+ % (initrd_dir, cr_workdir), as_shell=True)
+exec_cmd("gzip -f -9 %s/initrd.cpio" % cr_workdir, as_shell=True)
 shutil.rmtree(initrd_dir)
 
 return initrd
-- 
2.19.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] isoimage-isohybrid: don't include cpio in cpio image

2018-09-18 Thread Ioan-Adrian Ratiu
Because the find | cpio processes execute in parallel connected via
the pipe, and the cpio outputs in the same dir find searches for
source files, the cpio will be included in itself partially, depending
on how fast the build machine creates the cpio file before cpio
gobbles it up.

This bloats the ISO image, though compression reduces the .iso file size,
once the kernel decompresses the cpio image and boots it live, it uses
up to double the RAM memory.

Fix this by creating the initrd.cpio file directly inside cr_workdir.

Signed-off-by: Ioan-Adrian Ratiu 
---
 scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py 
b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
index 25a695da17..3006223cda 100644
--- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
+++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -172,7 +172,6 @@ class IsoImagePlugin(SourcePlugin):
 
 if not initrd or not os.path.exists(initrd):
 # Create initrd from rootfs directory
-initrd = "%s/initrd.cpio.gz" % cr_workdir
 initrd_dir = "%s/INITRD" % cr_workdir
 shutil.copytree("%s" % rootfs_dir, \
 "%s" % initrd_dir, symlinks=True)
@@ -191,10 +190,9 @@ class IsoImagePlugin(SourcePlugin):
 else:
 raise WicError("Couldn't find or build initrd, exiting.")
 
-exec_cmd("cd %s && find . | cpio -o -H newc -R root:root 
>./initrd.cpio " \
-% initrd_dir, as_shell=True)
-exec_cmd("gzip -f -9 -c %s/initrd.cpio > %s" \
-% (initrd_dir, initrd), as_shell=True)
+exec_cmd("cd %s && find . | cpio -o -H newc -R root:root 
>%s/initrd.cpio " \
+ % (initrd_dir, cr_workdir), as_shell=True)
+exec_cmd("gzip -f -9 %s/initrd.cpio" % cr_workdir, as_shell=True)
 shutil.rmtree(initrd_dir)
 
 return initrd
-- 
2.19.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH 3/3] image_types_wic: Add variable WIC_EXTENSION

2018-08-28 Thread Ioan-Adrian Ratiu
On Tue, 28 Aug 2018, Richard Purdie  wrote:
> On Mon, 2018-08-27 at 17:31 +0300, Alexandru Vasiu wrote:
>> Used to specify what extention will have the image file which
>> is created using wic. The default value is wic. For creating an
>> ISO image, WIC_EXTENSION will be iso.
>> 
>> Signed-off-by: Alexandru Vasiu 
>> ---
>>  meta/classes/image.bbclass   | 2 ++
>>  meta/classes/image_types_wic.bbclass | 3 ++-
>>  2 files changed, 4 insertions(+), 1 deletion(-)
>> 
>> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
>> index 024d2d4c96..c6833a6770 100644
>> --- a/meta/classes/image.bbclass
>> +++ b/meta/classes/image.bbclass
>> @@ -607,6 +607,8 @@ python create_symlinks() {
>>  if not link_name:
>>  return
>>  for type in subimages:
>> +if type == 'wic':
>> +type = d.getVar('WIC_EXTENSION')
>>  dst = os.path.join(deploy_dir, link_name + "." + type)
>>  src = img_name + imgsuffix + type
>>  if os.path.exists(os.path.join(deploy_dir, src)):
>
> This is hardcoding an image type specific issue into common code. I
> really want to avoid doing that.
>
> In the past I started the process of trying to untangle the spaghetti
> we had in image.bbclass and abstract it into common building blocks.
> The hope was to eventually have proper APIs around this.
>
> I never really got back to do further rounds of cleanup/improvement to
> get to that goal but the more image type specific pieces we add back
> in, the harder it will make those goals and the less maintainable the
> coed will become.
>
> So is there some other way we can handle this. It looks like we don't
> even use this iso mode in OE-Core which is bad from a testing
> perspective too? I don't see WIC_EXTENSION being set to iso anywhere?

Our problem is this: all WIC images built & symlinked under
${DEPLOY_DIR_IMAGE} have the extension .wic, including the iso's.

We want our build pipeline to output an iso directly after issuing
"bitbake " by adding IMAGE_FSTYPES += "wic" and having an
..wks which speficfies the isoimage-isohybrid plugin.

I agree this solution is hacky. An alternative would be to just rename
the image .wic extension to .iso in our piepline outside bitbake and be
done with it.

How about adding an IMAGE_FSTYPES += "iso" and creating the associated
logic/bbclasses? Is that amount of code justified to have .iso
extensions to wic-built images or are we better of just renaming .wic
to .iso?

>
> Cheers,
>
> Richard
> -- 
> ___
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.openembedded.org_mailman_listinfo_openembedded-2Dcore=DwICAg=I_0YwoKy7z5LMTVdyO6YCiE2uzI1jjZZuIPelcSjixA=fzwh7IUt7VYYiD6094geII0kSDP3DkEnN0B8zB62AxE=TX1s2gOuF5JVPXLJ60USSIym1ujQ2VDP00KcC-1c-_c=pYCCOX_mHEmd8jE8DN3zmrnoYuL35Wz_sA2MuuYDNrw=
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] util-linux.inc: add fallocate only for class-target

2018-07-26 Thread Ioan-Adrian Ratiu
Thank you Martin! The different behaviours between combinations of
appends and overrides has always been confusing to me.

On Thu, 26 Jul 2018, Martin Jansa  wrote:
> I went ahead and sent v2 with the fix as I had it locally already anyway.
>
> To illustrate what was wrong with using the override, see following output
> from bitbake -e:
>
> env.util-linux.append+override:ALTERNATIVE_util-linux="dmesg kill more
> mkswap blockdev pivot_root switch_root hexdump last lastb logger mesg
> renice wall unshare setsid chrt flock utmpdump eject nologin taskset
> fallocate"
> env.util-linux.before:ALTERNATIVE_util-linux="dmesg kill more mkswap
> blockdev pivot_root switch_root hexdump last lastb logger mesg renice wall
> fallocate unshare setsid chrt flock utmpdump eject nologin taskset"
> env.util-linux.override:ALTERNATIVE_util-linux=" fallocate"
>
> # $ALTERNATIVE_util-linux [2 operations]
> #   rename from ALTERNATIVE_${PN} data.py:116 [expandKeys]
> # "dmesg kill more mkswap blockdev pivot_root switch_root hexdump last
> lastb logger mesg renice wall unshare setsid chrt flock utmpdump eject
> nologin taskset"
> #   override[class-target]:rename from ALTERNATIVE_${PN}_class-target
> data_smart.py:641 [renameVar]
> # " fallocate"
> # pre-expansion value:
> #   " fallocate"
> ALTERNATIVE_util-linux=" fallocate"
>
> # $ALTERNATIVE_util-linux_class-target
> #   rename from ALTERNATIVE_${PN}_class-target data_smart.py:641 [renameVar]
> # " fallocate"
> ALTERNATIVE_util-linux_class-target=" fallocate"
>
> # $ALTERNATIVE [19 operations]
> #   set /OE/build/oe-core/openembedded-core/meta/conf/documentation.conf:63
> # [doc] "Lists commands in a package that need an alternative binary
> naming scheme."
> #   override[util-linux-hwclock]:set
> /OE/build/oe-core/openembedded-core/meta/recipes-core/util-linux/util-linux.inc:245
> # "hwclock"
> #   override[util-linux-fdisk]:set
> /OE/build/oe-core/openembedded-core/meta/recipes-core/util-linux/util-linux.inc:248
> # "fdisk"
> #   override[util-linux-fstrim]:set
> /OE/build/oe-core/openembedded-core/meta/recipes-core/util-linux/util-linux.inc:251
> # "fstrim"
> #   override[util-linux-agetty]:set
> /OE/build/oe-core/openembedded-core/meta/recipes-core/util-linux/util-linux.inc:254
> # "getty"
> #   override[util-linux-mount]:set
> /OE/build/oe-core/openembedded-core/meta/recipes-core/util-linux/util-linux.inc:258
> # "mount"
> #   override[util-linux-umount]:set
> /OE/build/oe-core/openembedded-core/meta/recipes-core/util-linux/util-linux.inc:261
> # "umount"
> #   override[util-linux-readprofile]:set
> /OE/build/oe-core/openembedded-core/meta/recipes-core/util-linux/util-linux.inc:264
> # "readprofile"
> #   override[util-linux-losetup]:set
> /OE/build/oe-core/openembedded-core/meta/recipes-core/util-linux/util-linux.inc:267
> # "losetup"
> #   override[util-linux-swaponoff]:set
> /OE/build/oe-core/openembedded-core/meta/recipes-core/util-linux/util-linux.inc:270
> # "swapoff swapon"
> #   override[util-linux-fsck]:set
> /OE/build/oe-core/openembedded-core/meta/recipes-core/util-linux/util-linux.inc:274
> # "fsck"
> #   override[util-linux-blkid]:set
> /OE/build/oe-core/openembedded-core/meta/recipes-core/util-linux/util-linux.inc:277
> # "blkid"
> #   override[util-linux-rfkill]:set
> /OE/build/oe-core/openembedded-core/meta/recipes-core/util-linux/util-linux.inc:280
> # "rfkill"
> #   override[util-linux-getopt]:set
> /OE/build/oe-core/openembedded-core/meta/recipes-core/util-linux/util-linux.inc:283
> # "getopt"
> #   override[util-linux-sulogin]:set
> /OE/build/oe-core/openembedded-core/meta/recipes-core/util-linux/util-linux.inc:286
> # "sulogin"
> #   override[util-linux-mountpoint]:set
> /OE/build/oe-core/openembedded-core/meta/recipes-core/util-linux/util-linux.inc:289
> # "mountpoint"
> #   override[util-linux]:rename from ALTERNATIVE_${PN} data.py:116
> [expandKeys]
> # "dmesg kill more mkswap blockdev pivot_root switch_root hexdump last
> lastb logger mesg renice wall unshare setsid chrt flock utmpdump eject
> nologin taskset"
> #   override[util-linux_class-target]:rename from
> ALTERNATIVE_${PN}_class-target data_smart.py:641 [renameVar]
> # " fallocate"
> #   override[util-linux-doc]:rename from ALTERNATIVE_${PN}-doc data.py:116
> [expandKeys]
> # "mountpoint.1 last.1 lastb.1 mesg.1 wall.1 nologin.8 sulogin.8
> utmpdump.1 rfk

[OE-core] [PATCH] util-linux.inc: add fallocate only for class-target

2018-07-26 Thread Ioan-Adrian Ratiu
Because the util-linux_2.32.bb recipe explicitely disables fallocate
for nativesdk triggering build warnings:

WARNING: nativesdk-util-linux-2.32-r0 do_package: util-linux:
alternative target (sdk/usr/bin/fallocate or sdk/usr/bin/fallocate.util-linux)
does not exist, skipping...
WARNING: nativesdk-util-linux-2.32-r0 do_package: util-linux: NOT adding
alternative provide sdk/usr/bin/fallocate: sdk/usr/bin/fallocate.util-linux
does not exist
WARNING: nativesdk-util-linux-2.32-r0 do_package: util-linux: alt_link ==
alt_target: sdk/usr/bin/fallocate == sdk/usr/bin/fallocate

Signed-off-by: Ioan-Adrian Ratiu 
---
 meta/recipes-core/util-linux/util-linux.inc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index ed5c618750..504f3c5b61 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -206,8 +206,9 @@ do_install_append_class-native () {
 ALTERNATIVE_PRIORITY = "80"
 
 ALTERNATIVE_${PN}  = "dmesg kill more mkswap blockdev pivot_root switch_root"
-ALTERNATIVE_${PN} += "hexdump last lastb logger mesg renice wall fallocate 
unshare"
+ALTERNATIVE_${PN} += "hexdump last lastb logger mesg renice wall unshare"
 ALTERNATIVE_${PN} += "setsid chrt flock utmpdump eject nologin taskset"
+ALTERNATIVE_${PN}_class-target += "fallocate"
 
 ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg"
 ALTERNATIVE_LINK_NAME[kill] = "${base_bindir}/kill"
-- 
2.18.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] util-linux.inc: add fallocate & unshare to alternatives

2018-07-26 Thread Ioan-Adrian Ratiu
Ok, I'll send another patch since this one was already applied to
master. Thanks!

On Thu, 26 Jul 2018, Martin Jansa  wrote:
> This is good, but the fallocate alternative should be added only for target
> build.
>
> nativesdk explicitly disables fallocate in
> meta/recipes-core/util-linux/util-linux_2.32.bb
>
> EXTRA_OECONF_class-nativesdk = "${SHARED_EXTRA_OECONF} \
> --disable-fallocate \
> --disable-use-tty-group \
> "
>
> so now nativesdk builds have new warning:
> WARNING: nativesdk-util-linux-2.32-r0 do_package: util-linux: alternative
> target (sdk/usr/bin/fallocate or sdk/usr/bin/fallocate.util-linux) does not
> exist, skipping...
> WARNING: nativesdk-util-linux-2.32-r0 do_package: util-linux: NOT adding
> alternative provide sdk/usr/bin/fallocate: sdk/usr/bin/fallocate.util-linux
> does not exist
> WARNING: nativesdk-util-linux-2.32-r0 do_package: util-linux: alt_link ==
> alt_target: sdk/usr/bin/fallocate == sdk/usr/bin/fallocate
>
>
> On Thu, Jul 5, 2018 at 10:56 AM Ioan-Adrian Ratiu 
> wrote:
>
>> These binaries can be provided by busybox triggering a conflict in
>> do_rootfs so update-alternatives needs to know about them to properly
>> create the symlinks.
>>
>> Signed-off-by: Ioan-Adrian Ratiu 
>> ---
>>  meta/recipes-core/util-linux/util-linux.inc | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/meta/recipes-core/util-linux/util-linux.inc
>> b/meta/recipes-core/util-linux/util-linux.inc
>> index 8d8f3962ff..ed5c618750 100644
>> --- a/meta/recipes-core/util-linux/util-linux.inc
>> +++ b/meta/recipes-core/util-linux/util-linux.inc
>> @@ -206,7 +206,7 @@ do_install_append_class-native () {
>>  ALTERNATIVE_PRIORITY = "80"
>>
>>  ALTERNATIVE_${PN}  = "dmesg kill more mkswap blockdev pivot_root
>> switch_root"
>> -ALTERNATIVE_${PN} += "hexdump last lastb logger mesg renice wall"
>> +ALTERNATIVE_${PN} += "hexdump last lastb logger mesg renice wall
>> fallocate unshare"
>>  ALTERNATIVE_${PN} += "setsid chrt flock utmpdump eject nologin taskset"
>>
>>  ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg"
>> @@ -217,6 +217,8 @@ ALTERNATIVE_LINK_NAME[blockdev] =
>> "${base_sbindir}/blockdev"
>>  ALTERNATIVE_LINK_NAME[pivot_root] = "${base_sbindir}/pivot_root"
>>  ALTERNATIVE_LINK_NAME[switch_root] = "${base_sbindir}/switch_root"
>>  ALTERNATIVE_LINK_NAME[eject] = "${bindir}/eject"
>> +ALTERNATIVE_LINK_NAME[unshare] = "${bindir}/unshare"
>> +ALTERNATIVE_LINK_NAME[fallocate] = "${bindir}/fallocate"
>>  ALTERNATIVE_LINK_NAME[nologin] = "${base_sbindir}/nologin"
>>
>>  ALTERNATIVE_${PN}-doc = "mountpoint.1 last.1 lastb.1 mesg.1 wall.1
>> nologin.8 sulogin.8 utmpdump.1 rfkill.8 kill.1 libblkid.3 blkid.8 findfs.8
>> fsck.8 uuid.3 eject.1 logger.1"
>> --
>> 2.18.0
>>
>> --
>> ___
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.openembedded.org_mailman_listinfo_openembedded-2Dcore=DwIBaQ=I_0YwoKy7z5LMTVdyO6YCiE2uzI1jjZZuIPelcSjixA=fzwh7IUt7VYYiD6094geII0kSDP3DkEnN0B8zB62AxE=V1fZFZwpNWpU4wVVxA-URTy3cqjalPaY7s7P99Cn6xw=J2ilhEzLUQJ5xhlsLhxVBkxW-1jbHNDeulD8sKxaP7A=
>>
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v3] lsb: fix usrmerge install paths

2018-07-20 Thread Ioan-Adrian Ratiu
${base_prefix} is set in bitbake.conf to empty. This makes lsb_release
always install under /bin which is a problem if usrmerge is in
DISTRO_FEATURES, because it needs to be installed under /usr/bin.

By using ${root_prefix} instead, we fix the usrmerge install path and
the following QA warning goes away while keeping the non-usrmerge path
identical.

WARNING: lsb-5.0-r0 do_package: QA Issue: lsb: Files/directories were
installed but not shipped in any package:
  /bin
  /bin/lsb_release
Please set FILES such that these items are packaged. Alternatively
if they are unneeded, avoid installing them or delete them within do_install.
lsb: 2 installed and not shipped files. [installed-vs-shipped]

Also if usrmerge is defined don't try to create the lib64 symlink
because base-files handles it to avoid the do_rootfs error

Collected errors:
 * check_data_file_clashes: Package lsb wants to install file
 tmp-glibc/work/x64-nilrt-linux/test-image/1.0-r0/rootfs/lib64
 But that file is already provided by package  * base-files

Signed-off-by: Ioan-Adrian Ratiu 
---
 meta/recipes-extended/lsb/lsb_5.0.bb | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-extended/lsb/lsb_5.0.bb 
b/meta/recipes-extended/lsb/lsb_5.0.bb
index df4812e4bc..d1de334008 100644
--- a/meta/recipes-extended/lsb/lsb_5.0.bb
+++ b/meta/recipes-extended/lsb/lsb_5.0.bb
@@ -34,7 +34,7 @@ S = "${WORKDIR}/lsb-release-1.4"
 CLEANBROKEN = "1"
 
 do_install() {
-   oe_runmake install prefix=${D}${base_prefix} mandir=${D}${datadir}/man/ 
DESTDIR=${D}
+   oe_runmake install prefix=${D}${root_prefix} mandir=${D}${datadir}/man/ 
DESTDIR=${D}
 
# these two dirs are needed by package lsb-dist-checker
mkdir -p ${D}${sysconfdir}/opt
@@ -99,7 +99,9 @@ do_install_append() {
fi
 
if [ "${TARGET_ARCH}" = "x86_64" ]; then
-   if [ "${base_libdir}" != "${base_prefix}/lib64" ]; then
+  # don't symlink if usrmerge is in DISTRO_FEATURES as it 
manages the symlink
+   if 
${@bb.utils.contains('DISTRO_FEATURES','usrmerge','false','true',d)} && \
+ [ "${base_libdir}" != "${base_prefix}/lib64" ]; then
lnr ${D}${base_libdir} ${D}${base_prefix}/lib64
fi
   cd ${D}${base_libdir}
-- 
2.18.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v2] lsb: fix usrmerge install path & QA warning

2018-07-20 Thread Ioan-Adrian Ratiu
${base_prefix} is set in bitbake.conf to empty. This makes lsb_release
always install under /bin which is a problem if usrmerge is in
DISTRO_FEATURES, because it needs to be installed under /usr/bin.

By using ${root_prefix} instead, we fix the usrmerge install path and
the following QA warning goes away while keeping the non-usrmerge path
identical.

WARNING: lsb-5.0-r0 do_package: QA Issue: lsb: Files/directories were
installed but not shipped in any package:
  /bin
  /bin/lsb_release
Please set FILES such that these items are packaged. Alternatively
if they are unneeded, avoid installing them or delete them within do_install.
lsb: 2 installed and not shipped files. [installed-vs-shipped]

Signed-off-by: Ioan-Adrian Ratiu 
---
 meta/recipes-extended/lsb/lsb_5.0.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-extended/lsb/lsb_5.0.bb 
b/meta/recipes-extended/lsb/lsb_5.0.bb
index df4812e4bc..0a00086d88 100644
--- a/meta/recipes-extended/lsb/lsb_5.0.bb
+++ b/meta/recipes-extended/lsb/lsb_5.0.bb
@@ -34,7 +34,7 @@ S = "${WORKDIR}/lsb-release-1.4"
 CLEANBROKEN = "1"
 
 do_install() {
-   oe_runmake install prefix=${D}${base_prefix} mandir=${D}${datadir}/man/ 
DESTDIR=${D}
+   oe_runmake install prefix=${D}${root_prefix} mandir=${D}${datadir}/man/ 
DESTDIR=${D}
 
# these two dirs are needed by package lsb-dist-checker
mkdir -p ${D}${sysconfdir}/opt
-- 
2.18.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] lsb: fix usrmerge install path & QA warning

2018-07-20 Thread Ioan-Adrian Ratiu
On Fri, 20 Jul 2018, "Burton, Ross"  wrote:
> Remember to check what happens without usrmerge:
>
> packages/corei7-64-poky-linux/lsb/lsb: FILELIST: directory renamed
> /bin -> /bin/bin, changed order
>
> lsb:
> /bin/bin/lsb_release

Sorry about that and thanks! I'll send v2 where I'll use ${root_prefix}
which takes into account the presence of usrmerge.

>
> Ross
>
> On 19 July 2018 at 14:41, Ioan-Adrian Ratiu  wrote:
>> ${base_prefix} is set in bitbake.conf to empty. This makes lsb_release
>> always install under /bin which is a problem if usrmerge is in
>> DISTRO_FEATURES, because it needs to be installed under /usr/bin.
>>
>> By using ${base_bindir} instead, we fix the usrmerge install path and
>> the following QA warning goes away.
>>
>> WARNING: lsb-5.0-r0 do_package: QA Issue: lsb: Files/directories were
>> installed but not shipped in any package:
>>   /bin
>>   /bin/lsb_release
>> Please set FILES such that these items are packaged. Alternatively
>> if they are unneeded, avoid installing them or delete them within do_install.
>> lsb: 2 installed and not shipped files. [installed-vs-shipped]
>>
>> Signed-off-by: Ioan-Adrian Ratiu 
>> ---
>>  meta/recipes-extended/lsb/lsb_5.0.bb | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/meta/recipes-extended/lsb/lsb_5.0.bb 
>> b/meta/recipes-extended/lsb/lsb_5.0.bb
>> index 746204b6ec..1657ba6f78 100644
>> --- a/meta/recipes-extended/lsb/lsb_5.0.bb
>> +++ b/meta/recipes-extended/lsb/lsb_5.0.bb
>> @@ -33,7 +33,7 @@ S = "${WORKDIR}/lsb-release-1.4"
>>  CLEANBROKEN = "1"
>>
>>  do_install() {
>> -   oe_runmake install prefix=${D}${base_prefix} 
>> mandir=${D}${datadir}/man/ DESTDIR=${D}
>> +   oe_runmake install prefix=${D}${base_bindir} 
>> mandir=${D}${datadir}/man/ DESTDIR=${D}
>>
>> # these two dirs are needed by package lsb-dist-checker
>> mkdir -p ${D}${sysconfdir}/opt
>> --
>> 2.18.0
>>
>> --
>> ___
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] lsb: fix usrmerge install path & QA warning

2018-07-19 Thread Ioan-Adrian Ratiu
${base_prefix} is set in bitbake.conf to empty. This makes lsb_release
always install under /bin which is a problem if usrmerge is in
DISTRO_FEATURES, because it needs to be installed under /usr/bin.

By using ${base_bindir} instead, we fix the usrmerge install path and
the following QA warning goes away.

WARNING: lsb-5.0-r0 do_package: QA Issue: lsb: Files/directories were
installed but not shipped in any package:
  /bin
  /bin/lsb_release
Please set FILES such that these items are packaged. Alternatively
if they are unneeded, avoid installing them or delete them within do_install.
lsb: 2 installed and not shipped files. [installed-vs-shipped]

Signed-off-by: Ioan-Adrian Ratiu 
---
 meta/recipes-extended/lsb/lsb_5.0.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-extended/lsb/lsb_5.0.bb 
b/meta/recipes-extended/lsb/lsb_5.0.bb
index 746204b6ec..1657ba6f78 100644
--- a/meta/recipes-extended/lsb/lsb_5.0.bb
+++ b/meta/recipes-extended/lsb/lsb_5.0.bb
@@ -33,7 +33,7 @@ S = "${WORKDIR}/lsb-release-1.4"
 CLEANBROKEN = "1"
 
 do_install() {
-   oe_runmake install prefix=${D}${base_prefix} mandir=${D}${datadir}/man/ 
DESTDIR=${D}
+   oe_runmake install prefix=${D}${base_bindir} mandir=${D}${datadir}/man/ 
DESTDIR=${D}
 
# these two dirs are needed by package lsb-dist-checker
mkdir -p ${D}${sysconfdir}/opt
-- 
2.18.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v3] lsbinitscripts: replace dependency with initd-functions

2018-07-17 Thread Ioan-Adrian Ratiu
Commits 1202307b24 ("lsbinitscripts: don't use update-alternatives")
cdcebd81c87 ("initscripts: don't use update-alternatives") and
061fa614cec ("update-alternatives.bbclass: refuse to manage SysV init
scripts") make sure that the lsbinitscripts and initscripts conflict
with eachother and can't be alternatives on target devices.

lsb has a hardcoded dependency on lsbinitscripts which makes it
impossible to install on systems using initscripts and lsbinitscripts
in turn has a runtime dependency on the full util-linux package,
making it an unwanted dependency on busybox systems.

Therefore make lsb depend on initd-functions, which lsbinitscripts
RPROVIDES, allowing for multiple versions of /etc/init.d/functions and
installing lsb depending on initscripts without the full util-linux.

The default initd-functions provider is initscripts, so this changes
the dependency of lsb (but no the runtime behaviour AFAIK). I did not
change the default provider because sysvinit depends on initscripts
being the default.

The old dependency, previous to this change, can be brought back with
PREFERRED_RPROVIDER_initd-functions = "lsbinitscripts".

Signed-off-by: Ioan-Adrian Ratiu 
---
 meta/recipes-extended/lsb/lsb_5.0.bb | 3 +--
 meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-extended/lsb/lsb_5.0.bb 
b/meta/recipes-extended/lsb/lsb_5.0.bb
index df4812e4bc..746204b6ec 100644
--- a/meta/recipes-extended/lsb/lsb_5.0.bb
+++ b/meta/recipes-extended/lsb/lsb_5.0.bb
@@ -8,8 +8,7 @@ LSB_CORE_x86 = "lsb-core-ia32"
 LSB_CORE_x86-64 = "lsb-core-amd64"
 RPROVIDES_${PN} += "${LSB_CORE}"
 
-# lsb_release needs getopt, lsbinitscripts
-RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_getopt} lsbinitscripts"
+RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_getopt} initd-functions"
 
 LIC_FILES_CHKSUM = "file://README;md5=12da544b1a3a5a1795a21160b49471cf"
 
diff --git a/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb 
b/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
index ef6347c712..47789d556a 100644
--- a/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
+++ b/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
@@ -118,7 +118,7 @@ RDEPENDS_packagegroup-core-lsb-misc = "\
 gettext \
 gettext-runtime \
 groff \
-lsbinitscripts \
+initd-functions \
 lsbtest \
 lsof \
 strace \
-- 
2.18.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [] default-providers: introduce VIRTUAL-RUNTIME_initscripts

2018-07-13 Thread Ioan-Adrian Ratiu
On Fri, 13 Jul 2018, Khem Raj  wrote:
> On 7/13/18 3:22 AM, Ioan-Adrian Ratiu wrote:
>> On Thu, 12 Jul 2018, Khem Raj  wrote:
>>> On 7/10/18 7:44 AM, Ioan-Adrian Ratiu wrote:
>>>> Commits 1202307b24 ("lsbinitscripts: don't use update-alternatives")
>>>> cdcebd81c87 ("initscripts: don't use update-alternatives") and
>>>> 061fa614cec ("update-alternatives.bbclass: refuse to manage SysV init
>>>> scripts") make sure that the lsbinitscripts and initscripts packages
>>>> conflict with eachother and can't be alternatives.
>>>>
>>>> lsb has a hardcoded dependency on lsbinitscripts which makes it
>>>> impossible to install on systems using initscripts (acl depends on
>>>> initscripts) and lsbinitscripts also has a runtime dependency on the
>>>> full util-linux package making it an unwanted dependency on busybox
>>>> systems.
>>>>
>>>> Therefore introduce VIRTUAL-RUNTIME_initscripts to choose between the
>>>> versions of /etc/init.d/functions and allow installing lsb alongside
>>>> initscripts avoiding the full util-linux dependency.
>>>>
>>>> Default it to lsbinitscripts so we don't have a change in the existing
>>>> behavior; distros/users can override it in their conf when needed.
>>>>
>>>
>>> We already have PREFERRED_RPROVIDER_initd-functions I wonder if that is
>>> the right option to use here.
>> 
>> (I've sent patch v2 which fixes a build-error causing typo, sorry for it :)
>> 
>> We could use PREFERRED_RPROVIDER_initd-functions but that currently
>> defaults to "initscripts". In all my layers nothing is using that
>> variable, so would it be ok to change its default to lsbinitscripts to
>> preserve the current default lsb/util-linux behaviour?
>> 
>> Or are you ok with using it as is, leaving the default to "initscripts"
>> and just change the lsb dependency?
>> 
>
> if it is unused then change it to lsbscripts.
>

Ok, thanks. Please discard these VIRTUAL-RUNTIME_initscripts patches.

>>>
>>>> Signed-off-by: Ioan-Adrian Ratiu 
>>>> ---
>>>>  meta/conf/distro/include/default-providers.inc   | 1 +
>>>>  meta/recipes-extended/lsb/lsb_5.0.bb | 3 +--
>>>>  meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb | 2 +-
>>>>  3 files changed, 3 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/meta/conf/distro/include/default-providers.inc 
>>>> b/meta/conf/distro/include/default-providers.inc
>>>> index e65c1ed323..37e7478ea0 100644
>>>> --- a/meta/conf/distro/include/default-providers.inc
>>>> +++ b/meta/conf/distro/include/default-providers.inc
>>>> @@ -23,6 +23,7 @@ VIRTUAL-RUNTIME_update-alternatives ?= 
>>>> "update-alternatives-opkg"
>>>>  VIRTUAL-RUNTIME_apm ?= "apm"
>>>>  VIRTUAL-RUNTIME_alsa-state ?= "alsa-state"
>>>>  VIRTUAL-RUNTIME_getopt ?= "util-linux-getopt"
>>>> +VIRTUAL-RUNTIME_initscripts ?= "lsbinitscripts"
>>>>  VIRTUAL-RUNTIME_wireless-tools ?= "iw wireless-tools"
>>>>  VIRTUAL-RUNTIME_base-utils ?= "busybox"
>>>>  VIRTUAL-RUNTIME_base-utils-hwclock ?= "busybox-hwclock"
>>>> diff --git a/meta/recipes-extended/lsb/lsb_5.0.bb 
>>>> b/meta/recipes-extended/lsb/lsb_5.0.bb
>>>> index df4812e4bc..6cb1751664 100644
>>>> --- a/meta/recipes-extended/lsb/lsb_5.0.bb
>>>> +++ b/meta/recipes-extended/lsb/lsb_5.0.bb
>>>> @@ -8,8 +8,7 @@ LSB_CORE_x86 = "lsb-core-ia32"
>>>>  LSB_CORE_x86-64 = "lsb-core-amd64"
>>>>  RPROVIDES_${PN} += "${LSB_CORE}"
>>>>  
>>>> -# lsb_release needs getopt, lsbinitscripts
>>>> -RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_getopt} lsbinitscripts"
>>>> +RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_getopt} 
>>>> ${VIRTUAL-RUNTIME_initscripts}"
>>>>  
>>>>  LIC_FILES_CHKSUM = "file://README;md5=12da544b1a3a5a1795a21160b49471cf"
>>>>  
>>>> diff --git a/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb 
>>>> b/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
>>>> index 53d100ce74..74547b0773 100644
>>>> --- a/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
>>>> +++ b/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
>>>> @@ -118,7 +118,7 @@ RDEPENDS_packagegroup-core-lsb-misc = "\
>>>>  gettext \
>>>>  gettext-runtime \
>>>>  groff \
>>>> -lsbinitscripts \
>>>> +${VIRTUAL_RUNTIME-initscripts} \
>>>>  lsbtest \
>>>>  lsof \
>>>>  strace \
>>>>
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [] default-providers: introduce VIRTUAL-RUNTIME_initscripts

2018-07-13 Thread Ioan-Adrian Ratiu
On Thu, 12 Jul 2018, Khem Raj  wrote:
> On 7/10/18 7:44 AM, Ioan-Adrian Ratiu wrote:
>> Commits 1202307b24 ("lsbinitscripts: don't use update-alternatives")
>> cdcebd81c87 ("initscripts: don't use update-alternatives") and
>> 061fa614cec ("update-alternatives.bbclass: refuse to manage SysV init
>> scripts") make sure that the lsbinitscripts and initscripts packages
>> conflict with eachother and can't be alternatives.
>> 
>> lsb has a hardcoded dependency on lsbinitscripts which makes it
>> impossible to install on systems using initscripts (acl depends on
>> initscripts) and lsbinitscripts also has a runtime dependency on the
>> full util-linux package making it an unwanted dependency on busybox
>> systems.
>> 
>> Therefore introduce VIRTUAL-RUNTIME_initscripts to choose between the
>> versions of /etc/init.d/functions and allow installing lsb alongside
>> initscripts avoiding the full util-linux dependency.
>> 
>> Default it to lsbinitscripts so we don't have a change in the existing
>> behavior; distros/users can override it in their conf when needed.
>> 
>
> We already have PREFERRED_RPROVIDER_initd-functions I wonder if that is
> the right option to use here.

(I've sent patch v2 which fixes a build-error causing typo, sorry for it :)

We could use PREFERRED_RPROVIDER_initd-functions but that currently
defaults to "initscripts". In all my layers nothing is using that
variable, so would it be ok to change its default to lsbinitscripts to
preserve the current default lsb/util-linux behaviour?

Or are you ok with using it as is, leaving the default to "initscripts"
and just change the lsb dependency?

>
>> Signed-off-by: Ioan-Adrian Ratiu 
>> ---
>>  meta/conf/distro/include/default-providers.inc   | 1 +
>>  meta/recipes-extended/lsb/lsb_5.0.bb | 3 +--
>>  meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb | 2 +-
>>  3 files changed, 3 insertions(+), 3 deletions(-)
>> 
>> diff --git a/meta/conf/distro/include/default-providers.inc 
>> b/meta/conf/distro/include/default-providers.inc
>> index e65c1ed323..37e7478ea0 100644
>> --- a/meta/conf/distro/include/default-providers.inc
>> +++ b/meta/conf/distro/include/default-providers.inc
>> @@ -23,6 +23,7 @@ VIRTUAL-RUNTIME_update-alternatives ?= 
>> "update-alternatives-opkg"
>>  VIRTUAL-RUNTIME_apm ?= "apm"
>>  VIRTUAL-RUNTIME_alsa-state ?= "alsa-state"
>>  VIRTUAL-RUNTIME_getopt ?= "util-linux-getopt"
>> +VIRTUAL-RUNTIME_initscripts ?= "lsbinitscripts"
>>  VIRTUAL-RUNTIME_wireless-tools ?= "iw wireless-tools"
>>  VIRTUAL-RUNTIME_base-utils ?= "busybox"
>>  VIRTUAL-RUNTIME_base-utils-hwclock ?= "busybox-hwclock"
>> diff --git a/meta/recipes-extended/lsb/lsb_5.0.bb 
>> b/meta/recipes-extended/lsb/lsb_5.0.bb
>> index df4812e4bc..6cb1751664 100644
>> --- a/meta/recipes-extended/lsb/lsb_5.0.bb
>> +++ b/meta/recipes-extended/lsb/lsb_5.0.bb
>> @@ -8,8 +8,7 @@ LSB_CORE_x86 = "lsb-core-ia32"
>>  LSB_CORE_x86-64 = "lsb-core-amd64"
>>  RPROVIDES_${PN} += "${LSB_CORE}"
>>  
>> -# lsb_release needs getopt, lsbinitscripts
>> -RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_getopt} lsbinitscripts"
>> +RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_getopt} ${VIRTUAL-RUNTIME_initscripts}"
>>  
>>  LIC_FILES_CHKSUM = "file://README;md5=12da544b1a3a5a1795a21160b49471cf"
>>  
>> diff --git a/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb 
>> b/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
>> index 53d100ce74..74547b0773 100644
>> --- a/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
>> +++ b/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
>> @@ -118,7 +118,7 @@ RDEPENDS_packagegroup-core-lsb-misc = "\
>>  gettext \
>>  gettext-runtime \
>>  groff \
>> -lsbinitscripts \
>> +${VIRTUAL_RUNTIME-initscripts} \
>>  lsbtest \
>>  lsof \
>>  strace \
>> 
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v2] default-providers: introduce VIRTUAL-RUNTIME_initscripts

2018-07-12 Thread Ioan-Adrian Ratiu
Commits 1202307b24 ("lsbinitscripts: don't use update-alternatives")
cdcebd81c87 ("initscripts: don't use update-alternatives") and
061fa614cec ("update-alternatives.bbclass: refuse to manage SysV init
scripts") make sure that the lsbinitscripts and initscripts packages
conflict with eachother and can't be alternatives.

lsb has a hardcoded dependency on lsbinitscripts which makes it
impossible to install on systems using initscripts (acl depends on
initscripts) and lsbinitscripts also has a runtime dependency on the
full util-linux package making it an unwanted dependency on busybox
systems.

Therefore introduce VIRTUAL-RUNTIME_initscripts to choose between the
versions of /etc/init.d/functions and allow installing lsb alongside
initscripts avoiding the full util-linux dependency.

Default it to lsbinitscripts so we don't have a change in the existing
behavior; distros/users can override it in their conf when needed.

Signed-off-by: Ioan-Adrian Ratiu 
---
 meta/conf/distro/include/default-providers.inc   | 1 +
 meta/recipes-extended/lsb/lsb_5.0.bb | 3 +--
 meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/conf/distro/include/default-providers.inc 
b/meta/conf/distro/include/default-providers.inc
index 779b03d50c..173aa44b09 100644
--- a/meta/conf/distro/include/default-providers.inc
+++ b/meta/conf/distro/include/default-providers.inc
@@ -23,6 +23,7 @@ VIRTUAL-RUNTIME_update-alternatives ?= 
"update-alternatives-opkg"
 VIRTUAL-RUNTIME_apm ?= "apm"
 VIRTUAL-RUNTIME_alsa-state ?= "alsa-state"
 VIRTUAL-RUNTIME_getopt ?= "util-linux-getopt"
+VIRTUAL-RUNTIME_initscripts ?= "lsbinitscripts"
 VIRTUAL-RUNTIME_base-utils ?= "busybox"
 VIRTUAL-RUNTIME_base-utils-hwclock ?= "busybox-hwclock"
 
diff --git a/meta/recipes-extended/lsb/lsb_5.0.bb 
b/meta/recipes-extended/lsb/lsb_5.0.bb
index df4812e4bc..6cb1751664 100644
--- a/meta/recipes-extended/lsb/lsb_5.0.bb
+++ b/meta/recipes-extended/lsb/lsb_5.0.bb
@@ -8,8 +8,7 @@ LSB_CORE_x86 = "lsb-core-ia32"
 LSB_CORE_x86-64 = "lsb-core-amd64"
 RPROVIDES_${PN} += "${LSB_CORE}"
 
-# lsb_release needs getopt, lsbinitscripts
-RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_getopt} lsbinitscripts"
+RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_getopt} ${VIRTUAL-RUNTIME_initscripts}"
 
 LIC_FILES_CHKSUM = "file://README;md5=12da544b1a3a5a1795a21160b49471cf"
 
diff --git a/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb 
b/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
index ef6347c712..c3ffac74f3 100644
--- a/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
+++ b/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
@@ -118,7 +118,7 @@ RDEPENDS_packagegroup-core-lsb-misc = "\
 gettext \
 gettext-runtime \
 groff \
-lsbinitscripts \
+${VIRTUAL-RUNTIME_initscripts} \
 lsbtest \
 lsof \
 strace \
-- 
2.18.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [] default-providers: introduce VIRTUAL-RUNTIME_initscripts

2018-07-10 Thread Ioan-Adrian Ratiu
Commits 1202307b24 ("lsbinitscripts: don't use update-alternatives")
cdcebd81c87 ("initscripts: don't use update-alternatives") and
061fa614cec ("update-alternatives.bbclass: refuse to manage SysV init
scripts") make sure that the lsbinitscripts and initscripts packages
conflict with eachother and can't be alternatives.

lsb has a hardcoded dependency on lsbinitscripts which makes it
impossible to install on systems using initscripts (acl depends on
initscripts) and lsbinitscripts also has a runtime dependency on the
full util-linux package making it an unwanted dependency on busybox
systems.

Therefore introduce VIRTUAL-RUNTIME_initscripts to choose between the
versions of /etc/init.d/functions and allow installing lsb alongside
initscripts avoiding the full util-linux dependency.

Default it to lsbinitscripts so we don't have a change in the existing
behavior; distros/users can override it in their conf when needed.

Signed-off-by: Ioan-Adrian Ratiu 
---
 meta/conf/distro/include/default-providers.inc   | 1 +
 meta/recipes-extended/lsb/lsb_5.0.bb | 3 +--
 meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/conf/distro/include/default-providers.inc 
b/meta/conf/distro/include/default-providers.inc
index e65c1ed323..37e7478ea0 100644
--- a/meta/conf/distro/include/default-providers.inc
+++ b/meta/conf/distro/include/default-providers.inc
@@ -23,6 +23,7 @@ VIRTUAL-RUNTIME_update-alternatives ?= 
"update-alternatives-opkg"
 VIRTUAL-RUNTIME_apm ?= "apm"
 VIRTUAL-RUNTIME_alsa-state ?= "alsa-state"
 VIRTUAL-RUNTIME_getopt ?= "util-linux-getopt"
+VIRTUAL-RUNTIME_initscripts ?= "lsbinitscripts"
 VIRTUAL-RUNTIME_wireless-tools ?= "iw wireless-tools"
 VIRTUAL-RUNTIME_base-utils ?= "busybox"
 VIRTUAL-RUNTIME_base-utils-hwclock ?= "busybox-hwclock"
diff --git a/meta/recipes-extended/lsb/lsb_5.0.bb 
b/meta/recipes-extended/lsb/lsb_5.0.bb
index df4812e4bc..6cb1751664 100644
--- a/meta/recipes-extended/lsb/lsb_5.0.bb
+++ b/meta/recipes-extended/lsb/lsb_5.0.bb
@@ -8,8 +8,7 @@ LSB_CORE_x86 = "lsb-core-ia32"
 LSB_CORE_x86-64 = "lsb-core-amd64"
 RPROVIDES_${PN} += "${LSB_CORE}"
 
-# lsb_release needs getopt, lsbinitscripts
-RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_getopt} lsbinitscripts"
+RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_getopt} ${VIRTUAL-RUNTIME_initscripts}"
 
 LIC_FILES_CHKSUM = "file://README;md5=12da544b1a3a5a1795a21160b49471cf"
 
diff --git a/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb 
b/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
index 53d100ce74..74547b0773 100644
--- a/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
+++ b/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
@@ -118,7 +118,7 @@ RDEPENDS_packagegroup-core-lsb-misc = "\
 gettext \
 gettext-runtime \
 groff \
-lsbinitscripts \
+${VIRTUAL_RUNTIME-initscripts} \
 lsbtest \
 lsof \
 strace \
-- 
2.18.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] util-linux.inc: add fallocate & unshare to alternatives

2018-07-05 Thread Ioan-Adrian Ratiu
These binaries can be provided by busybox triggering a conflict in
do_rootfs so update-alternatives needs to know about them to properly
create the symlinks.

Signed-off-by: Ioan-Adrian Ratiu 
---
 meta/recipes-core/util-linux/util-linux.inc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index 8d8f3962ff..ed5c618750 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -206,7 +206,7 @@ do_install_append_class-native () {
 ALTERNATIVE_PRIORITY = "80"
 
 ALTERNATIVE_${PN}  = "dmesg kill more mkswap blockdev pivot_root switch_root"
-ALTERNATIVE_${PN} += "hexdump last lastb logger mesg renice wall"
+ALTERNATIVE_${PN} += "hexdump last lastb logger mesg renice wall fallocate 
unshare"
 ALTERNATIVE_${PN} += "setsid chrt flock utmpdump eject nologin taskset"
 
 ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg"
@@ -217,6 +217,8 @@ ALTERNATIVE_LINK_NAME[blockdev] = "${base_sbindir}/blockdev"
 ALTERNATIVE_LINK_NAME[pivot_root] = "${base_sbindir}/pivot_root"
 ALTERNATIVE_LINK_NAME[switch_root] = "${base_sbindir}/switch_root"
 ALTERNATIVE_LINK_NAME[eject] = "${bindir}/eject"
+ALTERNATIVE_LINK_NAME[unshare] = "${bindir}/unshare"
+ALTERNATIVE_LINK_NAME[fallocate] = "${bindir}/fallocate"
 ALTERNATIVE_LINK_NAME[nologin] = "${base_sbindir}/nologin"
 
 ALTERNATIVE_${PN}-doc = "mountpoint.1 last.1 lastb.1 mesg.1 wall.1 nologin.8 
sulogin.8 utmpdump.1 rfkill.8 kill.1 libblkid.3 blkid.8 findfs.8 fsck.8 uuid.3 
eject.1 logger.1"
-- 
2.18.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 1/2] wic: isoimage-isohybrid: fix UEFI spec breakage

2018-06-28 Thread Ioan-Adrian Ratiu
It's really good that OE supports multiple EFI_PROVIDERs and that
commit 9a1709278de87 ("wic: isoimage-isohybrid: use grub-efi from
deploy dir") makes re-use of the grub-efi built image, but we should
still respect the standard otherwise the ISO will not boot, so install
grub images as boot[x64|ia32].efi not ${PN}-boot[x64|ia32].efi.

Signed-off-by: Ioan-Adrian Ratiu 
---
 scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py 
b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
index d6bd3bff7b..b119c9c2fd 100644
--- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
+++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -328,16 +328,18 @@ class IsoImagePlugin(SourcePlugin):
 raise WicError("Coludn't find target architecture")
 
 if re.match("x86_64", target_arch):
-grub_image = "grub-efi-bootx64.efi"
+grub_src_image = "grub-efi-bootx64.efi"
+grub_dest_image = "bootx64.efi"
 elif re.match('i.86', target_arch):
-grub_image = "grub-efi-bootia32.efi"
+grub_src_image = "grub-efi-bootia32.efi"
+grub_dest_image = "bootia32.efi"
 else:
 raise WicError("grub-efi is incompatible with target %s" %
target_arch)
 
-grub_target = os.path.join(target_dir, grub_image)
+grub_target = os.path.join(target_dir, grub_dest_image)
 if not os.path.isfile(grub_target):
-grub_src = os.path.join(deploy_dir, grub_image)
+grub_src = os.path.join(deploy_dir, grub_src_image)
 if not os.path.exists(grub_src):
 raise WicError("Grub loader %s is not found in %s. "
"Please build grub-efi first" % 
(grub_image, deploy_dir))
-- 
2.18.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 2/2] wic: isoimage-isohybrid: debloat image of redundant rootfs

2018-06-28 Thread Ioan-Adrian Ratiu
There's no reason to have that rootfs.img filesystem in the image:
it's not used for anything because both the EFI and legacy boot paths
use the /initrd which contains the same contents as the rootfs.img,
only compressed. It was probably forgotten in there :)

My iso went down from 224 to 94 mb.

Tested using UEFI/legacy boots on CD-roms, usb dongle and qemu VM's.

Signed-off-by: Ioan-Adrian Ratiu 
---
 scripts/lib/wic/canned-wks/mkhybridiso.wks|  2 +-
 .../wic/plugins/source/isoimage-isohybrid.py  | 27 +--
 2 files changed, 2 insertions(+), 27 deletions(-)

diff --git a/scripts/lib/wic/canned-wks/mkhybridiso.wks 
b/scripts/lib/wic/canned-wks/mkhybridiso.wks
index 9d34e9b477..48c5ac4791 100644
--- a/scripts/lib/wic/canned-wks/mkhybridiso.wks
+++ b/scripts/lib/wic/canned-wks/mkhybridiso.wks
@@ -2,6 +2,6 @@
 # long-description: Creates an EFI and legacy bootable hybrid ISO image
 # which can be used on optical media as well as USB media.
 
-part /boot --source isoimage-isohybrid 
--sourceparams="loader=grub-efi,image_name=HYBRID_ISO_IMG" --ondisk cd --label 
HYBRIDISO --fstype=ext4
+part /boot --source isoimage-isohybrid 
--sourceparams="loader=grub-efi,image_name=HYBRID_ISO_IMG" --ondisk cd --label 
HYBRIDISO
 
 bootloader  --timeout=15  --append=""
diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py 
b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
index b119c9c2fd..0d4f50d1f7 100644
--- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
+++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -47,7 +47,7 @@ class IsoImagePlugin(SourcePlugin):
 
 Example kickstart file:
 part /boot --source isoimage-isohybrid --sourceparams="loader=grub-efi, \\
-image_name= IsoImage" --ondisk cd --label LIVECD --fstype=ext2
+image_name= IsoImage" --ondisk cd --label LIVECD
 bootloader  --timeout=10  --append=" "
 
 In --sourceparams "loader" specifies the bootloader used for booting in EFI
@@ -253,33 +253,8 @@ class IsoImagePlugin(SourcePlugin):
 raise WicError("Couldn't find IMAGE_ROOTFS, exiting.")
 
 part.rootfs_dir = rootfs_dir
-
-# Prepare rootfs.img
 deploy_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
 img_iso_dir = get_bitbake_var("ISODIR")
-rootfs_img = "%s/rootfs.img" % img_iso_dir
-if not os.path.isfile(rootfs_img):
-# check if rootfs.img is in deploydir
-deploy_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
-image_name = get_bitbake_var("IMAGE_LINK_NAME")
-rootfs_img = "%s/%s.%s" \
-% (deploy_dir, image_name, part.fstype)
-
-if not os.path.isfile(rootfs_img):
-# create image file with type specified by --fstype
-# which contains rootfs
-du_cmd = "du -bks %s" % rootfs_dir
-out = exec_cmd(du_cmd)
-part.size = int(out.split()[0])
-part.extra_space = 0
-part.overhead_factor = 1.2
-part.prepare_rootfs(cr_workdir, oe_builddir, rootfs_dir, \
-native_sysroot)
-rootfs_img = part.source_file
-
-install_cmd = "install -m 0644 %s %s/rootfs.img" \
-% (rootfs_img, isodir)
-exec_cmd(install_cmd)
 
 # Remove the temporary file created by part.prepare_rootfs()
 if os.path.isfile(part.source_file):
-- 
2.18.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v2 2/2] diffutils: allow native & nativesdk builds

2018-03-04 Thread Ioan-Adrian Ratiu
Required by the new dtc rdepends to avoid errors like this:

ERROR: Required build target 'ionel-rpi-image' has no buildable providers.
Missing or unbuildable dependency chain was: ['ionel-rpi-image', 
'nativesdk-packagegroup-sdk-host', 'nativesdk-qemu', 'nativesdk-dtc', 
'nativesdk-diffutils']

Signed-off-by: Ioan-Adrian Ratiu <a...@adirat.com>
---
 meta/recipes-extended/diffutils/diffutils.inc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-extended/diffutils/diffutils.inc 
b/meta/recipes-extended/diffutils/diffutils.inc
index 7c5be50fb7..c9e3130587 100644
--- a/meta/recipes-extended/diffutils/diffutils.inc
+++ b/meta/recipes-extended/diffutils/diffutils.inc
@@ -10,3 +10,4 @@ inherit autotools texinfo update-alternatives gettext
 ALTERNATIVE_${PN} = "diff cmp"
 ALTERNATIVE_PRIORITY = "100"
 
+BBCLASSEXTEND = "native nativesdk"
-- 
2.16.2

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v2 1/2] dtc: add rdepends_${PN}-misc = diffutils

2018-03-04 Thread Ioan-Adrian Ratiu
Needed by dtdiff which calls `diff` to display its result.

Signed-off-by: Ioan-Adrian Ratiu <a...@adirat.com>
---
 meta/recipes-kernel/dtc/dtc.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-kernel/dtc/dtc.inc b/meta/recipes-kernel/dtc/dtc.inc
index d259c57e8d..9a90d44041 100644
--- a/meta/recipes-kernel/dtc/dtc.inc
+++ b/meta/recipes-kernel/dtc/dtc.inc
@@ -22,4 +22,4 @@ do_install () {
 PACKAGES =+ "${PN}-misc"
 FILES_${PN}-misc = "${bindir}/convert-dtsv0 ${bindir}/ftdump ${bindir}/dtdiff"
 
-RDEPENDS_${PN}-misc += "bash"
+RDEPENDS_${PN}-misc += "bash diffutils"
-- 
2.16.2

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] dtc: add rdepends_${PN}-misc = diffutils

2018-03-02 Thread Ioan-Adrian Ratiu
Needed by dtdiff which calls `diff` to display its result.

Signed-off-by: Ioan-Adrian Ratiu <a...@adirat.com>
---
 meta/recipes-kernel/dtc/dtc.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-kernel/dtc/dtc.inc b/meta/recipes-kernel/dtc/dtc.inc
index d259c57e8d..9a90d44041 100644
--- a/meta/recipes-kernel/dtc/dtc.inc
+++ b/meta/recipes-kernel/dtc/dtc.inc
@@ -22,4 +22,4 @@ do_install () {
 PACKAGES =+ "${PN}-misc"
 FILES_${PN}-misc = "${bindir}/convert-dtsv0 ${bindir}/ftdump ${bindir}/dtdiff"
 
-RDEPENDS_${PN}-misc += "bash"
+RDEPENDS_${PN}-misc += "bash diffutils"
-- 
2.16.2

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] site/*-linux: don't cache ac_cv_sizeof_bool

2017-12-18 Thread Ioan-Adrian Ratiu
The value was hardcoded from the time it couldn't be computed, which
is no longer the case. After C99 'bool' is only defined if stdbool.h
is included, it's implementation defined and not required to be 1, so
caching it doesn't make sense and certain recipes whoose code test
ac_cv_sizeof_bool fail to build.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/site/arm-linux   | 1 -
 meta/site/nios2-linux | 1 -
 meta/site/powerpc32-linux | 1 -
 3 files changed, 3 deletions(-)

diff --git a/meta/site/arm-linux b/meta/site/arm-linux
index 7bf073eb77..fb3c81d0e9 100644
--- a/meta/site/arm-linux
+++ b/meta/site/arm-linux
@@ -3,7 +3,6 @@ ac_cv_sizeof___int64=${ac_cv_sizeof___int64=0}
 ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
 ac_cv_sizeof_wchar_t=${ac_cv_sizeof_wchar_t=1}
 ac_cv_sizeof_unsigned_char=${ac_cv_sizeof_unsigned_char=1}
-ac_cv_sizeof_bool=${ac_cv_sizeof_bool=1}
 ac_cv_sizeof_char_p=${ac_cv_sizeof_int_p=4}
 ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
 ac_cv_sizeof_int_p=${ac_cv_sizeof_int_p=4}
diff --git a/meta/site/nios2-linux b/meta/site/nios2-linux
index 24bc5b033a..67a3fc8a75 100644
--- a/meta/site/nios2-linux
+++ b/meta/site/nios2-linux
@@ -232,7 +232,6 @@ ac_cv_sizeof___int64=${ac_cv_sizeof___int64=0}
 ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
 ac_cv_sizeof_wchar_t=${ac_cv_sizeof_wchar_t=1}
 ac_cv_sizeof_unsigned_char=${ac_cv_sizeof_unsigned_char=1}
-ac_cv_sizeof_bool=${ac_cv_sizeof_bool=1}
 ac_cv_sizeof_char_p=${ac_cv_sizeof_int_p=4}
 ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
 ac_cv_sizeof_int_p=${ac_cv_sizeof_int_p=4}
diff --git a/meta/site/powerpc32-linux b/meta/site/powerpc32-linux
index 06d961f5ce..f37e915cb3 100644
--- a/meta/site/powerpc32-linux
+++ b/meta/site/powerpc32-linux
@@ -1,6 +1,5 @@
 ac_cv_func_setvbuf_reversed=no
 ac_cv_sizeof___int64=${ac_cv_sizeof___int64=0}
-ac_cv_sizeof_bool=${ac_cv_sizeof_bool=1}
 ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
 ac_cv_sizeof_char_p=${ac_cv_sizeof_char_p=4}
 ac_cv_sizeof_double=${ac_cv_sizeof_double=8}
-- 
2.15.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] util-linux: package switch_root separately

2017-09-18 Thread Ioan-Adrian Ratiu
Having only this utility is useful for tiny initramfs'es which don't
need the whole util-linux package (and neither the busybox binary
which is much bigger than switch_root) to do operations like decrypt
a rootfs & switch to it in the init file.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/recipes-core/util-linux/util-linux.inc | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index ba5d320321..5c4694b1fd 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -35,7 +35,7 @@ PACKAGES =+ "util-linux-agetty util-linux-fdisk 
util-linux-cfdisk util-linux-sfd
  util-linux-lsblk util-linux-mkfs.cramfs util-linux-fstrim \
  util-linux-partx util-linux-hwclock util-linux-mountpoint \
  util-linux-findfs util-linux-getopt util-linux-sulogin 
util-linux-prlimit \
- util-linux-ionice"
+ util-linux-ionice util-linux-switch-root"
 PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 
'util-linux-pylibmount', '', d)}"
 PACKAGES =+ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 
'util-linux-runuser util-linux-su', '', d)}"
 
@@ -112,6 +112,8 @@ FILES_util-linux-mkfs.cramfs = "${sbindir}/mkfs.cramfs"
 FILES_util-linux-sulogin = "${base_sbindir}/sulogin*"
 FILES_util-linux-mountpoint = "${base_bindir}/mountpoint.${BPN}"
 
+FILES_util-linux-switch-root = "${base_sbindir}/switch_root.${BPN}"
+
 # Util-linux' blkid replaces the e2fsprogs one
 FILES_util-linux-blkid = "${base_sbindir}/blkid*"
 RCONFLICTS_util-linux-blkid = "e2fsprogs-blkid"
@@ -126,7 +128,7 @@ RDEPENDS_util-linux-su += "libpam"
 RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup 
util-linux-sulogin util-linux-lsblk"
 RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 
'util-linux-runuser util-linux-su', '', d)}"
 
-RRECOMMENDS_${PN} = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk 
util-linux-mount util-linux-readprofile util-linux-mkfs util-linux-mountpoint 
util-linux-prlimit util-linux-ionice"
+RRECOMMENDS_${PN} = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk 
util-linux-mount util-linux-readprofile util-linux-mkfs util-linux-mountpoint 
util-linux-prlimit util-linux-ionice util-linux-switch-root"
 
 RRECOMMENDS_${PN}_class-native = ""
 RRECOMMENDS_${PN}_class-nativesdk = ""
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v2] oe/path.py: copyhardlinktree: don't overwrite existing symlinks

2017-08-21 Thread Ioan-Adrian Ratiu
Before GNU tar 1.24, only the archive creation command had the '-h'
argument to preserve and follow symlinks. After >= 1.24 via commit
14efeb9f956e38d7be (tar: --dereference consistency) the capability to
preserve symlinks was also added to the archive extraction command.

-h is default at archive creation but is not default at extraction,
meaning that it will replace symlinks with directories even if the
original filesystem directory tree and archive contains them.

Add -h to the copyhardlinktree extraction step so the build can
support symlinks in variables like ${DEPLOY_DIR_IPK/RPM/DEB}.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/lib/oe/path.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
index 448a2b944e..1ea03d5d56 100644
--- a/meta/lib/oe/path.py
+++ b/meta/lib/oe/path.py
@@ -98,7 +98,7 @@ def copyhardlinktree(src, dst):
 if (os.stat(src).st_dev ==  os.stat(dst).st_dev):
 # Need to copy directories only with tar first since cp will error if 
two 
 # writers try and create a directory at the same time
-cmd = "cd %s; find . -type d -print | tar --xattrs 
--xattrs-include='*' -cf - -C %s -p --no-recursion --files-from - | tar 
--xattrs --xattrs-include='*' -xf - -C %s" % (src, src, dst)
+cmd = "cd %s; find . -type d -print | tar --xattrs 
--xattrs-include='*' -cf - -C %s -p --no-recursion --files-from - | tar 
--xattrs --xattrs-include='*' -xhf - -C %s" % (src, src, dst)
 subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
 source = ''
 if os.path.isdir(src):
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] oe/path.py: copyhardlinktree: don't overwrite existing symlinks

2017-08-21 Thread Ioan-Adrian Ratiu
On Fri, 18 Aug 2017, Richard Purdie <richard.pur...@linuxfoundation.org> wrote:
> On Wed, 2017-08-16 at 14:13 +0300, Ioan-Adrian Ratiu wrote:
>> Starting with tar>=1.26 the default behaviour when extracting is to
>> overwrite symlinks and a '-h' flag was added for tar to follow them.
>>
>> The primary use case for this is to allow ${DEPLOY_DIR_IPK/RPM/DEB}
>> to
>> be symlinks and avoid copyhardlinktree replacing those symlinks with
>> a
>> normal directory.
>>
>> Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
>> ---
>>  meta/lib/oe/path.py | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Does the -h option exist for tar < 1.26?

Actually it was introduced for extraction in tar 1.24, but for the
archiving command it existed much longer (I went back and confirmed
until release 1.14 in 2004 where the tar git log ends).

The tar git commit which added -h for extraction in 1.24 is:
14efeb9f956e38d7be (tar: --dereference consistency)

-h is set by default when creating archives for systems supporting
symlinks, but -h when extracting is not set by default.

Sorry for the 1.24/1.26 mixup, I'll ammend the patch msg in v2.

Do you want me to do some version checking? (GNU tar 1.24 was released
in 2011).

Ionel

>
> Cheers,
>
> Richard
National Instruments Romania S.R.L.
--
B-dul 21 Decembrie 1989, nr. 77, A2
Cluj-Napoca 400604, Romania
C.I.F.: RO17961616 | O.R.C.: J12/3337/2005
Telefon: +40 264 406428 | Fax: +40 264 406429
E-mail: office.c...@ni.com
Web: romania.ni.com

Vanzari si suport tehnic:
Telefon gratuit : 0800 070071
E-mail vanzari: ni.roma...@ni.com
E-mail suport tehnic: techsupp...@ni.com
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] oe/path.py: copyhardlinktree: don't overwrite existing symlinks

2017-08-16 Thread Ioan-Adrian Ratiu
Starting with tar>=1.26 the default behaviour when extracting is to
overwrite symlinks and a '-h' flag was added for tar to follow them.

The primary use case for this is to allow ${DEPLOY_DIR_IPK/RPM/DEB} to
be symlinks and avoid copyhardlinktree replacing those symlinks with a
normal directory.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/lib/oe/path.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
index 448a2b944e..1ea03d5d56 100644
--- a/meta/lib/oe/path.py
+++ b/meta/lib/oe/path.py
@@ -98,7 +98,7 @@ def copyhardlinktree(src, dst):
 if (os.stat(src).st_dev ==  os.stat(dst).st_dev):
 # Need to copy directories only with tar first since cp will error if 
two 
 # writers try and create a directory at the same time
-cmd = "cd %s; find . -type d -print | tar --xattrs 
--xattrs-include='*' -cf - -C %s -p --no-recursion --files-from - | tar 
--xattrs --xattrs-include='*' -xf - -C %s" % (src, src, dst)
+cmd = "cd %s; find . -type d -print | tar --xattrs 
--xattrs-include='*' -cf - -C %s -p --no-recursion --files-from - | tar 
--xattrs --xattrs-include='*' -xhf - -C %s" % (src, src, dst)
 subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
 source = ''
 if os.path.isdir(src):
-- 
2.14.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] useradd_base: keep group if it still has users

2017-01-23 Thread Ioan-Adrian Ratiu
perform_groupdel() tries to delete a group irrespective if other
users have it as their primary group, thus the call to groupdel will
fail with the following error error:

groupdel: cannot remove the primary group of user ''

Add a check to perform_groupdel() to determine if there are other
users and keep the group, printing a warning. This is called right
after a user is deleted to delete it's group. If the last user is
deleted, only then the group is also deleted.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/classes/useradd_base.bbclass | 18 ++
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/meta/classes/useradd_base.bbclass 
b/meta/classes/useradd_base.bbclass
index ba87edc57a..551c82c322 100644
--- a/meta/classes/useradd_base.bbclass
+++ b/meta/classes/useradd_base.bbclass
@@ -69,11 +69,21 @@ perform_groupdel () {
bbnote "${PN}: Performing groupdel with [$opts]"
local groupname=`echo "$opts" | awk '{ print $NF }'`
local group_exists="`grep "^$groupname:" $rootdir/etc/group || true`"
+
if test "x$group_exists" != "x"; then
-   eval flock -x $rootdir${sysconfdir} -c \"$PSEUDO groupdel 
\$opts\" || true
-   group_exists="`grep "^$groupname:" $rootdir/etc/group || true`"
-   if test "x$group_exists" != "x"; then
-   bbfatal "${PN}: groupdel command did not succeed."
+   local awk_input='BEGIN {FS=":"}; $1=="'$groupname'" { print $3 
}'
+   local groupid=`echo "$awk_input" | awk -f- $rootdir/etc/group`
+   local awk_check_users='BEGIN {FS=":"}; $4=="'$groupid'" {print 
$1}'
+   local other_users=`echo "$awk_check_users" | awk -f- 
$rootdir/etc/passwd`
+
+   if test "x$other_users" = "x"; then
+   eval flock -x $rootdir${sysconfdir} -c \"$PSEUDO 
groupdel \$opts\" || true
+   group_exists="`grep "^$groupname:" $rootdir/etc/group 
|| true`"
+   if test "x$group_exists" != "x"; then
+   bbfatal "${PN}: groupdel command did not 
succeed."
+   fi
+   else
+   bbnote "${PN}: '$groupname' is primary group for users 
'$other_users', not removing it"
fi
else
bbnote "${PN}: group $groupname doesn't exist, not removing it"
-- 
2.11.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v4] wic/isoimage-isohybrid: remove do_stage_partition()

2017-01-07 Thread Ioan-Adrian Ratiu
The purpouse of this function was to check dependencies for building a
hybrid iso and build them using bitbake if not found. Calling bitbake in
this context means this wic plugin itself cannot be instrumented inside
bitbake recipes which is undesirable, the benefits of this are clear:
there is no need to maintain outside scripts to generate an iso using wic
and the isohybrid building logic can be further abstracted away into an
isohybrid.bbclass in the future which can be easily inherited or something
similar.

So remove the function and add all dependencies to NATIVE_RECIPES so that
wic can print useful errors when they're not built.

To automate building the isohybrid image dependencies, add the following
somewhere in your image build inheritence hierarcy (or maybe create a
bbclass in the future to do these sort of things automatically):

DEPENDS += "syslinux syslinux-native cdrtools-native e2fsprogs-native \
parted-native dosfstools-native mtools-native grub-efi-native"

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 .../lib/wic/plugins/source/isoimage-isohybrid.py   | 49 --
 scripts/lib/wic/utils/oe/misc.py   |  4 ++
 2 files changed, 4 insertions(+), 49 deletions(-)

diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py 
b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
index 3858fd439b..15fd858d22 100644
--- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
+++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -194,55 +194,6 @@ class IsoImagePlugin(SourcePlugin):
 return initrd
 
 @classmethod
-def do_stage_partition(cls, part, source_params, creator, cr_workdir,
-   oe_builddir, bootimg_dir, kernel_dir,
-   native_sysroot):
-"""
-Special content staging called before do_prepare_partition().
-It cheks if all necessary tools are available, if not
-tries to instal them.
-"""
-# Make sure parted is available in native sysroot
-if not os.path.isfile("%s/usr/sbin/parted" % native_sysroot):
-msger.info("Building parted-native...\n")
-exec_cmd("bitbake parted-native")
-
-# Make sure mkfs.ext2/3/4 is available in native sysroot
-if not os.path.isfile("%s/sbin/mkfs.ext2" % native_sysroot):
-msger.info("Building e2fsprogs-native...\n")
-exec_cmd("bitbake e2fsprogs-native")
-
-# Make sure syslinux is available in sysroot and in native sysroot
-syslinux_dir = get_bitbake_var("STAGING_DATADIR")
-if not syslinux_dir:
-msger.error("Couldn't find STAGING_DATADIR, exiting.\n")
-if not os.path.exists("%s/syslinux" % syslinux_dir):
-msger.info("Building syslinux...\n")
-exec_cmd("bitbake syslinux")
-if not os.path.exists("%s/syslinux" % syslinux_dir):
-msger.error("Please build syslinux first\n")
-
-# Make sure syslinux is available in native sysroot
-if not os.path.exists("%s/usr/bin/syslinux" % native_sysroot):
-msger.info("Building syslinux-native...\n")
-exec_cmd("bitbake syslinux-native")
-
-#Make sure mkisofs is available in native sysroot
-if not os.path.isfile("%s/usr/bin/mkisofs" % native_sysroot):
-msger.info("Building cdrtools-native...\n")
-exec_cmd("bitbake cdrtools-native")
-
-# Make sure mkfs.vfat is available in native sysroot
-if not os.path.isfile("%s/sbin/mkfs.vfat" % native_sysroot):
-msger.info("Building dosfstools-native...\n")
-exec_cmd("bitbake dosfstools-native")
-
-# Make sure mtools is available in native sysroot
-if not os.path.isfile("%s/usr/bin/mcopy" % native_sysroot):
-msger.info("Building mtools-native...\n")
-exec_cmd("bitbake mtools-native")
-
-@classmethod
 def do_configure_partition(cls, part, source_params, creator, cr_workdir,
oe_builddir, bootimg_dir, kernel_dir,
native_sysroot):
diff --git a/scripts/lib/wic/utils/oe/misc.py b/scripts/lib/wic/utils/oe/misc.py
index fe188c9d26..489393a24e 100644
--- a/scripts/lib/wic/utils/oe/misc.py
+++ b/scripts/lib/wic/utils/oe/misc.py
@@ -35,8 +35,11 @@ from wic.utils import runner
 
 # executable -> recipe pairs for exec_native_cmd
 NATIVE_RECIPES = {"bmaptool": "bmap-tools",
+  "grub-mkimage": "grub-efi",
+  "isohybrid": "syslinux",
   "mcopy": &qu

Re: [OE-core] [meta-virtualization][PATCH v3] wic/isoimage-isohybrid: remove do_stage_partition()

2017-01-06 Thread Ioan-Adrian Ratiu

The meta-virtualization tag is a mistake, this is sent and meant only
for the OE-core ML.

On Fri, 06 Jan 2017, Ioan-Adrian Ratiu <adrian.ra...@ni.com> wrote:
> The purpouse of this function was to check dependencies for building a
> hybrid iso and build them using bitbake if not found. Calling bitbake in
> this context means this wic plugin itself cannot be instrumented inside
> bitbake recipes which is undesirable, the benefits of this are clear:
> there is no need to maintain outside scripts to generate an iso using wic
> and the isohybrid building logic can be further abstracted away into an
> isohybrid.bbclass in the future which can be easily inherited or something
> similar.
>
> So remove the function and add all dependencies to NATIVE_RECIPES so that
> wic can print useful errors when they're not built.
>
> To automate building the isohybrid image dependencies, add the following
> somewhere in your image build inheritence hierarcy (or maybe create a
> bbclass in the future to do these sort of things automatically):
>
> DEPENDS += "syslinux syslinux-native cdrtools-native e2fsprogs-native \
> parted-native dosfstools-native mtools-native grub-efi-native"
>
> Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
> ---
>  .../lib/wic/plugins/source/isoimage-isohybrid.py   | 49 
> --
>  scripts/lib/wic/utils/oe/misc.py   |  4 ++
>  2 files changed, 4 insertions(+), 49 deletions(-)
>
> diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py 
> b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
> index 3858fd439b..15fd858d22 100644
> --- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
> +++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
> @@ -194,55 +194,6 @@ class IsoImagePlugin(SourcePlugin):
>  return initrd
>  
>  @classmethod
> -def do_stage_partition(cls, part, source_params, creator, cr_workdir,
> -   oe_builddir, bootimg_dir, kernel_dir,
> -   native_sysroot):
> -"""
> -Special content staging called before do_prepare_partition().
> -It cheks if all necessary tools are available, if not
> -tries to instal them.
> -"""
> -# Make sure parted is available in native sysroot
> -if not os.path.isfile("%s/usr/sbin/parted" % native_sysroot):
> -msger.info("Building parted-native...\n")
> -exec_cmd("bitbake parted-native")
> -
> -# Make sure mkfs.ext2/3/4 is available in native sysroot
> -if not os.path.isfile("%s/sbin/mkfs.ext2" % native_sysroot):
> -msger.info("Building e2fsprogs-native...\n")
> -exec_cmd("bitbake e2fsprogs-native")
> -
> -# Make sure syslinux is available in sysroot and in native sysroot
> -syslinux_dir = get_bitbake_var("STAGING_DATADIR")
> -if not syslinux_dir:
> -msger.error("Couldn't find STAGING_DATADIR, exiting.\n")
> -if not os.path.exists("%s/syslinux" % syslinux_dir):
> -msger.info("Building syslinux...\n")
> -exec_cmd("bitbake syslinux")
> -if not os.path.exists("%s/syslinux" % syslinux_dir):
> -msger.error("Please build syslinux first\n")
> -
> -# Make sure syslinux is available in native sysroot
> -if not os.path.exists("%s/usr/bin/syslinux" % native_sysroot):
> -msger.info("Building syslinux-native...\n")
> -exec_cmd("bitbake syslinux-native")
> -
> -#Make sure mkisofs is available in native sysroot
> -if not os.path.isfile("%s/usr/bin/mkisofs" % native_sysroot):
> -msger.info("Building cdrtools-native...\n")
> -exec_cmd("bitbake cdrtools-native")
> -
> -# Make sure mkfs.vfat is available in native sysroot
> -if not os.path.isfile("%s/sbin/mkfs.vfat" % native_sysroot):
> -msger.info("Building dosfstools-native...\n")
> -exec_cmd("bitbake dosfstools-native")
> -
> -# Make sure mtools is available in native sysroot
> -if not os.path.isfile("%s/usr/bin/mcopy" % native_sysroot):
> -msger.info("Building mtools-native...\n")
> -exec_cmd("bitbake mtools-native")
> -
> -@classmethod
>  def do_configure_partition(cls, part, source_params, creator, cr_workdir,
> oe_builddir, bootimg_dir, k

[OE-core] [meta-virtualization][PATCH v3] wic/isoimage-isohybrid: remove do_stage_partition()

2017-01-06 Thread Ioan-Adrian Ratiu
The purpouse of this function was to check dependencies for building a
hybrid iso and build them using bitbake if not found. Calling bitbake in
this context means this wic plugin itself cannot be instrumented inside
bitbake recipes which is undesirable, the benefits of this are clear:
there is no need to maintain outside scripts to generate an iso using wic
and the isohybrid building logic can be further abstracted away into an
isohybrid.bbclass in the future which can be easily inherited or something
similar.

So remove the function and add all dependencies to NATIVE_RECIPES so that
wic can print useful errors when they're not built.

To automate building the isohybrid image dependencies, add the following
somewhere in your image build inheritence hierarcy (or maybe create a
bbclass in the future to do these sort of things automatically):

DEPENDS += "syslinux syslinux-native cdrtools-native e2fsprogs-native \
parted-native dosfstools-native mtools-native grub-efi-native"

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 .../lib/wic/plugins/source/isoimage-isohybrid.py   | 49 --
 scripts/lib/wic/utils/oe/misc.py   |  4 ++
 2 files changed, 4 insertions(+), 49 deletions(-)

diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py 
b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
index 3858fd439b..15fd858d22 100644
--- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
+++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -194,55 +194,6 @@ class IsoImagePlugin(SourcePlugin):
 return initrd
 
 @classmethod
-def do_stage_partition(cls, part, source_params, creator, cr_workdir,
-   oe_builddir, bootimg_dir, kernel_dir,
-   native_sysroot):
-"""
-Special content staging called before do_prepare_partition().
-It cheks if all necessary tools are available, if not
-tries to instal them.
-"""
-# Make sure parted is available in native sysroot
-if not os.path.isfile("%s/usr/sbin/parted" % native_sysroot):
-msger.info("Building parted-native...\n")
-exec_cmd("bitbake parted-native")
-
-# Make sure mkfs.ext2/3/4 is available in native sysroot
-if not os.path.isfile("%s/sbin/mkfs.ext2" % native_sysroot):
-msger.info("Building e2fsprogs-native...\n")
-exec_cmd("bitbake e2fsprogs-native")
-
-# Make sure syslinux is available in sysroot and in native sysroot
-syslinux_dir = get_bitbake_var("STAGING_DATADIR")
-if not syslinux_dir:
-msger.error("Couldn't find STAGING_DATADIR, exiting.\n")
-if not os.path.exists("%s/syslinux" % syslinux_dir):
-msger.info("Building syslinux...\n")
-exec_cmd("bitbake syslinux")
-if not os.path.exists("%s/syslinux" % syslinux_dir):
-msger.error("Please build syslinux first\n")
-
-# Make sure syslinux is available in native sysroot
-if not os.path.exists("%s/usr/bin/syslinux" % native_sysroot):
-msger.info("Building syslinux-native...\n")
-exec_cmd("bitbake syslinux-native")
-
-#Make sure mkisofs is available in native sysroot
-if not os.path.isfile("%s/usr/bin/mkisofs" % native_sysroot):
-msger.info("Building cdrtools-native...\n")
-exec_cmd("bitbake cdrtools-native")
-
-# Make sure mkfs.vfat is available in native sysroot
-if not os.path.isfile("%s/sbin/mkfs.vfat" % native_sysroot):
-msger.info("Building dosfstools-native...\n")
-exec_cmd("bitbake dosfstools-native")
-
-# Make sure mtools is available in native sysroot
-if not os.path.isfile("%s/usr/bin/mcopy" % native_sysroot):
-msger.info("Building mtools-native...\n")
-exec_cmd("bitbake mtools-native")
-
-@classmethod
 def do_configure_partition(cls, part, source_params, creator, cr_workdir,
oe_builddir, bootimg_dir, kernel_dir,
native_sysroot):
diff --git a/scripts/lib/wic/utils/oe/misc.py b/scripts/lib/wic/utils/oe/misc.py
index fe188c9d26..cbb0a942c4 100644
--- a/scripts/lib/wic/utils/oe/misc.py
+++ b/scripts/lib/wic/utils/oe/misc.py
@@ -35,8 +35,11 @@ from wic.utils import runner
 
 # executable -> recipe pairs for exec_native_cmd
 NATIVE_RECIPES = {"bmaptool": "bmap-tools",
+  "grub-mkimage": "grub-efi-native",
+  "isohybrid": "syslinux",

[OE-core] [PATCH v2] wic/isoimage-isohybrid: remove do_stage_partition()

2017-01-06 Thread Ioan-Adrian Ratiu
The purpouse of this function was to check dependencies for building a
hybrid iso and build them using bitbake if not found. Calling bitbake in
this context means this wic plugin itself cannot be instrumented inside
bitbake recipes which is undesirable, the benefits of this are clear:
there is no need to maintain outside scripts to generate an iso using wic
and the isohybrid building logic can be further abstracted away into an
isohybrid.bbclass in the future which can be easily inherited or something
similar.

So remove the function and add all dependencies to NATIVE_RECIPES so that
wic can print useful errors when they're not built.

To automate building the isohybrid image dependencies, add the following
somewhere in your image build inheritence hierarcy (or maybe create a
bbclass in the future to do these sort of things automatically):

DEPENDS += "syslinux syslinux-native cdrtools-native e2fsprogs-native \
parted-native dosfstools-native mtools-native"

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 .../lib/wic/plugins/source/isoimage-isohybrid.py   | 49 --
 scripts/lib/wic/utils/oe/misc.py   |  3 ++
 2 files changed, 3 insertions(+), 49 deletions(-)

diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py 
b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
index 3858fd439b..15fd858d22 100644
--- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
+++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -194,55 +194,6 @@ class IsoImagePlugin(SourcePlugin):
 return initrd
 
 @classmethod
-def do_stage_partition(cls, part, source_params, creator, cr_workdir,
-   oe_builddir, bootimg_dir, kernel_dir,
-   native_sysroot):
-"""
-Special content staging called before do_prepare_partition().
-It cheks if all necessary tools are available, if not
-tries to instal them.
-"""
-# Make sure parted is available in native sysroot
-if not os.path.isfile("%s/usr/sbin/parted" % native_sysroot):
-msger.info("Building parted-native...\n")
-exec_cmd("bitbake parted-native")
-
-# Make sure mkfs.ext2/3/4 is available in native sysroot
-if not os.path.isfile("%s/sbin/mkfs.ext2" % native_sysroot):
-msger.info("Building e2fsprogs-native...\n")
-exec_cmd("bitbake e2fsprogs-native")
-
-# Make sure syslinux is available in sysroot and in native sysroot
-syslinux_dir = get_bitbake_var("STAGING_DATADIR")
-if not syslinux_dir:
-msger.error("Couldn't find STAGING_DATADIR, exiting.\n")
-if not os.path.exists("%s/syslinux" % syslinux_dir):
-msger.info("Building syslinux...\n")
-exec_cmd("bitbake syslinux")
-if not os.path.exists("%s/syslinux" % syslinux_dir):
-msger.error("Please build syslinux first\n")
-
-# Make sure syslinux is available in native sysroot
-if not os.path.exists("%s/usr/bin/syslinux" % native_sysroot):
-msger.info("Building syslinux-native...\n")
-exec_cmd("bitbake syslinux-native")
-
-#Make sure mkisofs is available in native sysroot
-if not os.path.isfile("%s/usr/bin/mkisofs" % native_sysroot):
-msger.info("Building cdrtools-native...\n")
-exec_cmd("bitbake cdrtools-native")
-
-# Make sure mkfs.vfat is available in native sysroot
-if not os.path.isfile("%s/sbin/mkfs.vfat" % native_sysroot):
-msger.info("Building dosfstools-native...\n")
-exec_cmd("bitbake dosfstools-native")
-
-# Make sure mtools is available in native sysroot
-if not os.path.isfile("%s/usr/bin/mcopy" % native_sysroot):
-msger.info("Building mtools-native...\n")
-exec_cmd("bitbake mtools-native")
-
-@classmethod
 def do_configure_partition(cls, part, source_params, creator, cr_workdir,
oe_builddir, bootimg_dir, kernel_dir,
native_sysroot):
diff --git a/scripts/lib/wic/utils/oe/misc.py b/scripts/lib/wic/utils/oe/misc.py
index fe188c9d26..288c058d2c 100644
--- a/scripts/lib/wic/utils/oe/misc.py
+++ b/scripts/lib/wic/utils/oe/misc.py
@@ -35,8 +35,10 @@ from wic.utils import runner
 
 # executable -> recipe pairs for exec_native_cmd
 NATIVE_RECIPES = {"bmaptool": "bmap-tools",
+  "isohybrid": "syslinux",
   "mcopy": "mtools",
   "mkdosfs": "dosfstools",

Re: [OE-core] [PATCH v2] wic/isoimage-isohybrid: check for grub-mkimage

2017-01-05 Thread Ioan-Adrian Ratiu
Hi

On Wed, 04 Jan 2017, Ed Bartosh <ed.bart...@linux.intel.com> wrote:
> On Wed, Jan 04, 2017 at 10:12:55PM +0200, Ed Bartosh wrote:
>> On Wed, Jan 04, 2017 at 09:04:43PM +0200, Ioan-Adrian Ratiu wrote:
>> > The isohybrid plugin uses grub-mkimage but doesn't make sure it gets built.
>> > Add a check to avoid the following error:
>> > 
>> > Error: A native program grub-mkimage required to build the image was not 
>> > found (see details above).
>> > 
>> > Wic failed to find a recipe to build native grub-mkimage. Please file a 
>> > bug against wic.
>> > 
>> > Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
>> > ---
>> >  scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 5 +
>> >  1 file changed, 5 insertions(+)
>> > 
>> > diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py 
>> > b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
>> > index 849fd8bea3..d616316d61 100644
>> > --- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
>> > +++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
>> > @@ -242,6 +242,11 @@ class IsoImagePlugin(SourcePlugin):
>> >  msger.info("Building mtools-native...\n")
>> >  exec_cmd("bitbake mtools-native")
>> >  
>> > +# Make sure grub-mkimage is available in native sysroot
>> > +if not os.path.isfile("%s/usr/bin/grub-mkimage" % native_sysroot):
>> > +msger.info("Building grub-native...\n")
>> > +exec_cmd("bitbake grub-native")
>> > +
>> >  @classmethod
>> >  def do_configure_partition(cls, part, source_params, creator, 
>> > cr_workdir,
>> > oe_builddir, bootimg_dir, kernel_dir,
>> 
>> Unfortunately this approach will not work if wic is run from bitbake.
>> 
>> I'd suggest to simply add grub-native to NATIVE_RECIPES dictionary in
>> scripts/lib/wic/utils/oe/misc.py
>> It will make error message more informative and useful.
>> 
> The same should probably be done with the rest of native tools called from
> this module. It's better to avoid building them implicitly.

Thank you for the feedback. I agree. I will send another patch.

Ionel

>
> --
> Regards,
> Ed
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v2] wic/isoimage-isohybrid: check for grub-mkimage

2017-01-04 Thread Ioan-Adrian Ratiu
The isohybrid plugin uses grub-mkimage but doesn't make sure it gets built.
Add a check to avoid the following error:

Error: A native program grub-mkimage required to build the image was not found 
(see details above).

Wic failed to find a recipe to build native grub-mkimage. Please file a bug 
against wic.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 5 +
 1 file changed, 5 insertions(+)

diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py 
b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
index 849fd8bea3..d616316d61 100644
--- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
+++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -242,6 +242,11 @@ class IsoImagePlugin(SourcePlugin):
 msger.info("Building mtools-native...\n")
 exec_cmd("bitbake mtools-native")
 
+# Make sure grub-mkimage is available in native sysroot
+if not os.path.isfile("%s/usr/bin/grub-mkimage" % native_sysroot):
+msger.info("Building grub-native...\n")
+exec_cmd("bitbake grub-native")
+
 @classmethod
 def do_configure_partition(cls, part, source_params, creator, cr_workdir,
oe_builddir, bootimg_dir, kernel_dir,
-- 
2.11.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] wic/isoimage-isohybrid: check for grub-mkimage

2017-01-04 Thread Ioan-Adrian Ratiu
The isohybrid plugin uses grub-mkimage but doesn't make sure it gets built.
Add a check to avoid the following error:

Error: A native program grub-mkimage required to build the image was not found 
(see details above).

Wic failed to find a recipe to build native grub-mkimage. Please file a bug 
against wic.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 5 +
 1 file changed, 5 insertions(+)

diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py 
b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
index 3858fd439b..9c408d046f 100644
--- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
+++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -242,6 +242,11 @@ class IsoImagePlugin(SourcePlugin):
 msger.info("Building mtools-native...\n")
 exec_cmd("bitbake mtools-native")
 
+# Make sure grub-mkconfig is available in native sysroot
+if not os.path.isfile("%s/usr/bin/grub-mkimage" % native_sysroot):
+msger.info("Building grub-native...\n")
+exec_cmd("bitbake grub-native")
+
 @classmethod
 def do_configure_partition(cls, part, source_params, creator, cr_workdir,
oe_builddir, bootimg_dir, kernel_dir,
-- 
2.11.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] grub: split grub-editenv in both grub and grub-efi

2016-12-15 Thread Ioan-Adrian Ratiu
We also need to split grub-editenv in grub-efi not just in grub, so move
the logic from grub_2.00.bb to the .inc file where it's inherited by both.

(grub-editenv is useful for editing the grub environment at runtime)

Doing this also reduces packaging differences between grub and grub-efi.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/recipes-bsp/grub/grub2.inc| 6 ++
 meta/recipes-bsp/grub/grub_2.00.bb | 6 +-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc
index b69de9f..b8a2bb2 100644
--- a/meta/recipes-bsp/grub/grub2.inc
+++ b/meta/recipes-bsp/grub/grub2.inc
@@ -71,3 +71,9 @@ do_configure_prepend() {
 # grub and grub-efi's sysroot/${datadir}/grub/grub-mkconfig_lib are
 # conflicted, remove it since no one uses it.
 SYSROOT_DIRS_BLACKLIST += "${datadir}/grub/grub-mkconfig_lib"
+
+RDEPENDS_${PN} = "grub-editenv"
+
+PACKAGES =+ "grub-editenv"
+
+FILES_grub-editenv = "${bindir}/grub-editenv"
diff --git a/meta/recipes-bsp/grub/grub_2.00.bb 
b/meta/recipes-bsp/grub/grub_2.00.bb
index 07e1d10..778074a 100644
--- a/meta/recipes-bsp/grub/grub_2.00.bb
+++ b/meta/recipes-bsp/grub/grub_2.00.bb
@@ -1,6 +1,6 @@
 require grub2.inc
 
-RDEPENDS_${PN} = "diffutils freetype grub-editenv"
+RDEPENDS_${PN} = "diffutils freetype"
 PR = "r1"
 
 EXTRA_OECONF = "--with-platform=pc --disable-grub-mkfont --program-prefix="" \
@@ -8,10 +8,6 @@ EXTRA_OECONF = "--with-platform=pc --disable-grub-mkfont 
--program-prefix="" \
 
 EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 
'--enable-largefile', '--disable-largefile', d)}"
 
-PACKAGES =+ "grub-editenv"
-
-FILES_grub-editenv = "${bindir}/grub-editenv"
-
 do_install_append () {
 install -d ${D}${sysconfdir}/grub.d
 }
-- 
2.10.2

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] pango: add libpcre to DEPENDS

2016-10-05 Thread Ioan-Adrian Ratiu
On Wed, 05 Oct 2016, "Burton, Ross" <ross.bur...@intel.com> wrote:
> On 5 October 2016 at 12:59, Ioan-Adrian Ratiu <adrian.ra...@ni.com> wrote:
>
>> I think libpcre_%.bbappend in meta-selinux is just missing the following
>> line:
>>
>> ln -sf ${relpath}/${realsofile} ${D}${libdir}/libpcre.so.1
>>
>> after creating this symlink the build works without problems (previously
>> only libpcre.so symlink was created).
>>
>> Is this a proper solution?
>>
>
> As meta-selinux is messing around with library locations, yes.

This may be a stupid question (sorry) but here goes: Why can't ldconfig
be made to search also in /lib, beside /usr/lib? That way it could find
the moved libraries, right?

>
> Ross
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] pango: add libpcre to DEPENDS

2016-10-05 Thread Ioan-Adrian Ratiu
Hi again

On Fri, 09 Sep 2016, "Burton, Ross" <ross.bur...@intel.com> wrote:
> On 9 September 2016 at 10:32, Ioan-Adrian Ratiu <adrian.ra...@ni.com> wrote:
>
>> I cleared the build directory and sstate cache, started with a clean
>> rebuild and I can't reproduce the error anymore. gen-all-unicode is
>> built as expected and at runtime it links with libpcre as expected
>> and the build succeeds. This is really weird, I didn't touch these
>> packages at all, they just sporadically failed out of the blue and now
>> they work.
>>
>
> That's good, right? :)
>
> If you ever manage to replicate, please save the build directory for
> inspection.

I managed to replicate this and save the build directory to inspect it!

Here's what happens:
Besides oe-core we're using meta-selinux which has a libpcre-%.bbappend
which moves the location of libpcre.so from /usr/lib to /lib in the
sysroot and points the symlink to the file in /lib using relative paths.

ldd tests/gen-all-unicode gives this:

$ ldd tests/gen-all-unicode
linux-vdso.so.1 (0x7fff27263000)
libglib-2.0.so.0 => 
/mnt/build/jenkins-jobs/nilrt_OE_toolchain-cardassia/workspace/build/tmp-glibc/sysroots/x86_64-linux/usr/lib/libglib-2.0.so.0
 (0x7f542823a000)
libpcre.so.1 => not found
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 
(0x7f542801d000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x7f5427c72000)
libpcre.so.1 => 
/mnt/build/jenkins-jobs/nilrt_OE_toolchain/workspace/build/tmp-glibc/sysroots/x86_64-linux/usr/lib/../../lib/libpcre.so.1
 (0x7f5427a2f000)
/lib64/ld-linux-x86-64.so.2 (0x7f5428546000)

I don't understand why libpcre.so.1 appears twice with the first not found.

The file pointed to by the libpcre.so.1 symlink exists but somehow the
loader can't find it? Maybe it's the ../.. in the path? or does an
variable like LD_LIBRARY_PATH need to be set in the bb recipe/append?

Ionel

>
> Ross
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [=OE-core][PATCH] populate_sdk_base.bbclass: fix broken variables

2016-09-27 Thread Ioan-Adrian Ratiu
This function never worked because the SDK_OUTPUT and SDKPATH vars are
written bash-style in a python function. The only reason it never failed
a build is because the function bails out the start because of the flag
CHECK_SDK_SYSROOTS.

And I guess nobody tested with CHECK_SDK_SYSROOTS enabled until now.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/classes/populate_sdk_base.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/classes/populate_sdk_base.bbclass 
b/meta/classes/populate_sdk_base.bbclass
index ce12f27..a23775e 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -147,7 +147,8 @@ python check_sdk_sysroots() {
 return os.path.abspath(path)
 
 # Get scan root
-SCAN_ROOT = norm_path("${SDK_OUTPUT}/${SDKPATH}/sysroots/")
+SCAN_ROOT = norm_path("%s/%s/sysroots/" % (d.getVar('SDK_OUTPUT', True),
+   d.getVar('SDKPATH', True)))
 
 bb.note('Checking SDK sysroots at ' + SCAN_ROOT)
 
-- 
2.10.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] pango: add libpcre to DEPENDS

2016-09-09 Thread Ioan-Adrian Ratiu
On Thu, 08 Sep 2016, "Burton, Ross" <ross.bur...@intel.com> wrote:
> On 8 September 2016 at 11:37, Ioan-Adrian Ratiu <adrian.ra...@ni.com> wrote:
>
>> No. It fails sporadically on the jenkins build machine when it's under
>> load. Somehow adding the pcre dependency directly to pango fixes the
>> build machine which is really weird. I can't replicate this on my dev
>> machine.
>>
>
> Can you get access to the build directory when it fails?  It would be
> interesting to see what ldd says the gen-all-unicode is linking to.

I cleared the build directory and sstate cache, started with a clean
rebuild and I can't reproduce the error anymore. gen-all-unicode is
built as expected and at runtime it links with libpcre as expected
and the build succeeds. This is really weird, I didn't touch these
packages at all, they just sporadically failed out of the blue and now
they work.

>
> Ross
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] pango: add libpcre to DEPENDS

2016-09-08 Thread Ioan-Adrian Ratiu
On Thu, 08 Sep 2016, "Burton, Ross" <ross.bur...@intel.com> wrote:
> On 8 September 2016 at 10:56, Ioan-Adrian Ratiu <adrian.ra...@ni.com> wrote:
>
>> | ./gen-all-unicode > all-unicode.txt
>> | ./gen-all-unicode: error while loading shared libraries: libpcre.so.1:
>> cannot open shared object file: No such file or directory
>>
>
> Can you replicate this on demand?  For gen-all-unicode to have been built
> the library must have been in the sysroot, and removed by the time it was
> executed.  However, pcre is a dependency of glib which is a dependency of
> pango, so I'm not sure how this happened.

No. It fails sporadically on the jenkins build machine when it's under
load. Somehow adding the pcre dependency directly to pango fixes the
build machine which is really weird. I can't replicate this on my dev
machine.

>
> Ross
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] pango: add libpcre to DEPENDS

2016-09-08 Thread Ioan-Adrian Ratiu
pango has a build time dependency on libpcre which causes a build
race, if pango gets built before libpcre, it fails with the error:

| ./gen-all-unicode > all-unicode.txt
| ./gen-all-unicode: error while loading shared libraries: libpcre.so.1: cannot 
open shared object file: No such file or directory
| Makefile:1459: recipe for target 'all-unicode.txt' failed
| make[2]: *** [all-unicode.txt] Error 127
| make[2]: *** Waiting for unfinished jobs
| make[2]: Leaving directory 
'/mnt/build/jenkins-jobs/nilrt_OE_core_x64-pname/workspace/build/tmp-glibc/work/core2-64-nilrt-linux/pango/1.40.1-r0/build/tests'
| Makefile:576: recipe for target 'all-recursive' failed
| make[1]: *** [all-recursive] Error 1
| make[1]: Leaving directory 
'/mnt/build/jenkins-jobs/nilrt_OE_core_x64-pname/workspace/build/tmp-glibc/work/core2-64-nilrt-linux/pango/1.40.1-r0/build'

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/recipes-graphics/pango/pango_1.40.1.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-graphics/pango/pango_1.40.1.bb 
b/meta/recipes-graphics/pango/pango_1.40.1.bb
index 60288a1..159f591 100644
--- a/meta/recipes-graphics/pango/pango_1.40.1.bb
+++ b/meta/recipes-graphics/pango/pango_1.40.1.bb
@@ -19,7 +19,7 @@ SRC_URI += "file://run-ptest \
 SRC_URI[archive.md5sum] = "6fc88c6529890d6c8e03074d57a3eceb"
 SRC_URI[archive.sha256sum] = 
"e27af54172c72b3ac6be53c9a4c67053e16c905e02addcf3a603ceb2005c1a40"
 
-DEPENDS = "glib-2.0 glib-2.0-native fontconfig freetype virtual/libiconv cairo 
harfbuzz"
+DEPENDS = "glib-2.0 glib-2.0-native fontconfig freetype virtual/libiconv cairo 
harfbuzz libpcre"
 
 PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', 
d)}"
 PACKAGECONFIG[x11] = "--with-xft,--without-xft,virtual/libx11 libxft"
-- 
2.9.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v2] linux-firmware: package carl9170 separately

2016-09-01 Thread Ioan-Adrian Ratiu
Package the carl9170 binary firmware separately because it is needed
by various usb dongles and installing whole linux-firmware is overkill.

carl9170 is an atheros-based firmware, the succesor of ar9170 which is
deprecated and its driver (ar9170) was removed from the kernel tree.
carl9170 comes both as a binary blob and also with free sources; the
sources are deleted in linux-firmware.bb to avoid depeding on bash/etc.

Also we should keep ar9170 as is because OOT drivers might still use it.

The license for carl9170 is GPLv2 (sources are beside the bin in the
linux-firmware git repo).

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/recipes-kernel/linux-firmware/linux-firmware_git.bb | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb 
b/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
index ed0c6ec..14f1f77 100644
--- a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
+++ b/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
@@ -226,7 +226,7 @@ PACKAGES =+ "${PN}-ralink-license ${PN}-ralink \
  ${PN}-vt6656-license ${PN}-vt6656 \
  ${PN}-rtl-license ${PN}-rtl8192cu ${PN}-rtl8192ce ${PN}-rtl8192su 
\
  ${PN}-broadcom-license ${PN}-bcm4329 ${PN}-bcm4330 ${PN}-bcm4334 
${PN}-bcm43340 ${PN}-bcm4339 ${PN}-bcm4354 \
- ${PN}-atheros-license ${PN}-ar9170 ${PN}-ath6k ${PN}-ath9k \
+ ${PN}-atheros-license ${PN}-ar9170 ${PN}-carl9170 ${PN}-ath6k 
${PN}-ath9k \
  ${PN}-ar3k-license  ${PN}-ar3k  ${PN}-ath10k-license  
${PN}-ath10k  \
  \
  ${PN}-iwlwifi-license ${PN}-iwlwifi \
@@ -255,6 +255,9 @@ FILES_${PN}-atheros-license = 
"/lib/firmware/LICENCE.atheros_firmware"
 FILES_${PN}-ar9170 = " \
   /lib/firmware/ar9170*.fw \
 "
+FILES_${PN}-carl9170 = " \
+  /lib/firmware/carl9170*.fw \
+"
 FILES_${PN}-ath6k = " \
   /lib/firmware/ath6k \
 "
@@ -266,6 +269,7 @@ FILES_${PN}-ath9k = " \
 "
 
 RDEPENDS_${PN}-ar9170 += "${PN}-atheros-license"
+RDEPENDS_${PN}-carl9170 += "${PN}-atheros-license"
 RDEPENDS_${PN}-ath6k += "${PN}-atheros-license"
 RDEPENDS_${PN}-ath9k += "${PN}-atheros-license"
 
-- 
2.9.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] kernel-yocto: do_kernel_configme: Fix silent sysroot poisoning error

2016-08-29 Thread Ioan-Adrian Ratiu
On Mon, 29 Aug 2016, Bruce Ashfield <bruce.ashfi...@gmail.com> wrote:
> On Mon, Aug 29, 2016 at 10:05 AM, Ioan-Adrian Ratiu <adrian.ra...@ni.com>
> wrote:
>
>> On Mon, 29 Aug 2016, Bruce Ashfield <bruce.ashfi...@gmail.com> wrote:
>> > On Mon, Aug 29, 2016 at 5:19 AM, Ioan-Adrian Ratiu <adrian.ra...@ni.com>
>> > wrote:
>> >
>> >> do_kernel_configme calls merge_config.sh (installed in the sysroot by
>> >> the kern-tools-native recipe) which calls make to fill in any missing
>> >> symbols from the resulting merged config.
>> >
>> >
>> > That's not what it does ... but that isn't important.
>> >
>> >
>> >>
>> >> This errors out on my system because of sysroot poisoning [1]. Here is
>> >> a partial output from my .kernel-meta/cfg/merge_config_build.log (this
>> >> file is created in do_kernel_configme() while callig merge_config.sh):
>> >>
>> >> make[1]: Entering directory '/media/adi/ssd/nilrt-master/
>> >> build/tmp-glibc/work/x64-nilrt-linux/linux-nilrt/4.1+
>> >> gitAUTOINC+a7e53ecc27-r0/linux-x64-standard-build'
>> >>   HOSTCC  scripts/basic/fixdep
>> >> /media/adi/ssd/nilrt-master/build/tmp-glibc/work-shared/
>> >> x64/kernel-source/scripts/basic/fixdep.c:106:23: fatal error:
>> >> sys/types.h: No such file or directory
>> >> compilation terminated.
>> >> make[2]: *** [/media/adi/ssd/nilrt-master/build/tmp-glibc/work-shared/
>> >> x64/kernel-source/scripts/basic/Makefile:22:
>> scripts/basic/x86_64-nilrt-linux-fixdep]
>> >> Error 1
>> >>
>> >
>> > This just means that we are missing a dependency. Everything that
>> > merge_config
>> > needs should be already in place before it runs, i.e. do_kernel_metadata
>> > should
>> > have already run and built any host tools that it needs.
>> >
>> > How are you managing to trigger this error ? I've done plenty of builds,
>> > and haven't
>> > seen this one before.
>>
>> Maybe some context is in order for how I build the kernel. I'm using a
>> custom kernel recipe which inherits from linux-yocto.inc. My kernel
>> tree contains a defconfig which is passed to OE in my kernel recipe
>> using KBUILD_DEFCONFIG and KCONFIG_MODE="--alldefconfig".
>>
>
> And that would be the difference, which is what I was looking for. The tools
> are always built for the linux-yocto path, hence why I can never reproduce
> the issue.
>
> I can take the kernel-yocto patch and queue it, but I'm going to leave
> merge_config
> untouched, since that change can go via the kernel path.

Thank you.

Can you please explain a little what you mean by "go via the kernel path"?

>
> Bruce
>
>
>>
>> I have no configuration fragments.
>>
>> As expected I need the merge_configs script to automatically fill in any
>> missing CONFIG symbols before building the kernel and this is where it
>> fails because the sysroot is poisoned since 2014.
>>
>> >
>> > Bruce
>> >
>> >
>> >>
>> >> This issue is hard to debug because merge_config.sh does NOT check the
>> >> error output of its make call (this is added in the second patch) and
>> >> even though make errors out, the build continues as if nothing happened
>> >> and compiles a kernel with garbage configs (the .config generated by
>> >> do_kernel_configme is empty and gets filled later) which doesn't boot.
>> >>
>> >> Adding $TOOLCHAIN_OPTIONS to $CFLAGS before calling merge_configs.sh
>> >> fixes the error because $TOOLCHAIN_OPTIONS defines the sysroot and make
>> >> uses it to correctly compile & fill all missing kernel config options.
>> >>
>> >> [1] http://lists.openembedded.org/pipermail/openembedded-core/
>> >> 2014-October/098253.html
>> >>
>> >> Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
>> >> ---
>> >>  meta/classes/kernel-yocto.bbclass | 2 +-
>> >>  1 file changed, 1 insertion(+), 1 deletion(-)
>> >>
>> >> diff --git a/meta/classes/kernel-yocto.bbclass
>> >> b/meta/classes/kernel-yocto.bbclass
>> >> index 8650e55..4397a9d 100644
>> >> --- a/meta/classes/kernel-yocto.bbclass
>> >> +++ b/meta/classes/kernel-yocto.bbclass
>> >> @@ -249,7 +249,7 @@ do_kernel_configme() {
>> >> bbfatal_log "Could not 

Re: [OE-core] [PATCH] kernel-yocto: do_kernel_configme: Fix silent sysroot poisoning error

2016-08-29 Thread Ioan-Adrian Ratiu
On Mon, 29 Aug 2016, Bruce Ashfield <bruce.ashfi...@gmail.com> wrote:
> On Mon, Aug 29, 2016 at 5:19 AM, Ioan-Adrian Ratiu <adrian.ra...@ni.com>
> wrote:
>
>> do_kernel_configme calls merge_config.sh (installed in the sysroot by
>> the kern-tools-native recipe) which calls make to fill in any missing
>> symbols from the resulting merged config.
>
>
> That's not what it does ... but that isn't important.
>
>
>>
>> This errors out on my system because of sysroot poisoning [1]. Here is
>> a partial output from my .kernel-meta/cfg/merge_config_build.log (this
>> file is created in do_kernel_configme() while callig merge_config.sh):
>>
>> make[1]: Entering directory '/media/adi/ssd/nilrt-master/
>> build/tmp-glibc/work/x64-nilrt-linux/linux-nilrt/4.1+
>> gitAUTOINC+a7e53ecc27-r0/linux-x64-standard-build'
>>   HOSTCC  scripts/basic/fixdep
>> /media/adi/ssd/nilrt-master/build/tmp-glibc/work-shared/
>> x64/kernel-source/scripts/basic/fixdep.c:106:23: fatal error:
>> sys/types.h: No such file or directory
>> compilation terminated.
>> make[2]: *** [/media/adi/ssd/nilrt-master/build/tmp-glibc/work-shared/
>> x64/kernel-source/scripts/basic/Makefile:22: 
>> scripts/basic/x86_64-nilrt-linux-fixdep]
>> Error 1
>>
>
> This just means that we are missing a dependency. Everything that
> merge_config
> needs should be already in place before it runs, i.e. do_kernel_metadata
> should
> have already run and built any host tools that it needs.
>
> How are you managing to trigger this error ? I've done plenty of builds,
> and haven't
> seen this one before.

Maybe some context is in order for how I build the kernel. I'm using a
custom kernel recipe which inherits from linux-yocto.inc. My kernel
tree contains a defconfig which is passed to OE in my kernel recipe
using KBUILD_DEFCONFIG and KCONFIG_MODE="--alldefconfig".

I have no configuration fragments.

As expected I need the merge_configs script to automatically fill in any
missing CONFIG symbols before building the kernel and this is where it
fails because the sysroot is poisoned since 2014.

>
> Bruce
>
>
>>
>> This issue is hard to debug because merge_config.sh does NOT check the
>> error output of its make call (this is added in the second patch) and
>> even though make errors out, the build continues as if nothing happened
>> and compiles a kernel with garbage configs (the .config generated by
>> do_kernel_configme is empty and gets filled later) which doesn't boot.
>>
>> Adding $TOOLCHAIN_OPTIONS to $CFLAGS before calling merge_configs.sh
>> fixes the error because $TOOLCHAIN_OPTIONS defines the sysroot and make
>> uses it to correctly compile & fill all missing kernel config options.
>>
>> [1] http://lists.openembedded.org/pipermail/openembedded-core/
>> 2014-October/098253.html
>>
>> Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
>> ---
>>  meta/classes/kernel-yocto.bbclass | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/meta/classes/kernel-yocto.bbclass
>> b/meta/classes/kernel-yocto.bbclass
>> index 8650e55..4397a9d 100644
>> --- a/meta/classes/kernel-yocto.bbclass
>> +++ b/meta/classes/kernel-yocto.bbclass
>> @@ -249,7 +249,7 @@ do_kernel_configme() {
>> bbfatal_log "Could not find configuration queue
>> (${meta_dir}/config.queue)"
>> fi
>>
>> -   ARCH=${ARCH} merge_config.sh -O ${B} ${config_flags} ${configs} >
>> ${meta_dir}/cfg/merge_config_build.log 2>&1
>> +   CFLAGS="${CFLAGS} ${TOOLCHAIN_OPTIONS}" ARCH=${ARCH}
>> merge_config.sh -O ${B} ${config_flags} ${configs} >
>> ${meta_dir}/cfg/merge_config_build.log 2>&1
>> if [ $? -ne 0 ]; then
>> bbfatal_log "Could not configure
>> ${KMACHINE}-${LINUX_KERNEL_TYPE}"
>> fi
>> --
>> 2.9.3
>>
>>
>
>
> -- 
> "Thou shalt not follow the NULL pointer, for chaos and madness await thee
> at its end"
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] kernel-yocto: do_kernel_configme: Fix silent sysroot poisoning error

2016-08-29 Thread Ioan-Adrian Ratiu
On Mon, 29 Aug 2016, Bruce Ashfield <bruce.ashfi...@gmail.com> wrote:
> On Mon, Aug 29, 2016 at 9:14 AM, Ioan-Adrian Ratiu <adrian.ra...@ni.com>
> wrote:
>
>> On Mon, 29 Aug 2016, Bruce Ashfield <bruce.ashfi...@gmail.com> wrote:
>> > On Mon, Aug 29, 2016 at 5:19 AM, Ioan-Adrian Ratiu <adrian.ra...@ni.com>
>> > wrote:
>> >
>> >> do_kernel_configme calls merge_config.sh (installed in the sysroot by
>> >> the kern-tools-native recipe) which calls make to fill in any missing
>> >> symbols from the resulting merged config.
>> >
>> >
>> > That's not what it does ... but that isn't important.
>>
>> Can you please explain in a simple sentence what it does?
>>
>
> It concatenates/merges configuration fragments.
>
> The need to run make, or fill in any additional symbols is the optional
> behaviour
> of the script and isn't the essential service of what it provides. Since
> for the
> most part, it does very little if well specified configs and defconfigs are
> passed.

Even if it is an optional behaviour, this is exactly what make does, so
I don't know how I mistated what it does (it fills in missing symbols).
This is exactly what I said.

The important issue is that it can fail and if it can fail then we need
to check its return code. Isn't this true?



>
>
>>
>> >
>> >
>> >>
>> >> This errors out on my system because of sysroot poisoning [1]. Here is
>> >> a partial output from my .kernel-meta/cfg/merge_config_build.log (this
>> >> file is created in do_kernel_configme() while callig merge_config.sh):
>> >>
>> >> make[1]: Entering directory '/media/adi/ssd/nilrt-master/
>> >> build/tmp-glibc/work/x64-nilrt-linux/linux-nilrt/4.1+
>> >> gitAUTOINC+a7e53ecc27-r0/linux-x64-standard-build'
>> >>   HOSTCC  scripts/basic/fixdep
>> >> /media/adi/ssd/nilrt-master/build/tmp-glibc/work-shared/
>> >> x64/kernel-source/scripts/basic/fixdep.c:106:23: fatal error:
>> >> sys/types.h: No such file or directory
>> >> compilation terminated.
>> >> make[2]: *** [/media/adi/ssd/nilrt-master/build/tmp-glibc/work-shared/
>> >> x64/kernel-source/scripts/basic/Makefile:22:
>> scripts/basic/x86_64-nilrt-linux-fixdep]
>> >> Error 1
>> >>
>> >
>> > This just means that we are missing a dependency. Everything that
>> > merge_config
>> > needs should be already in place before it runs, i.e. do_kernel_metadata
>> > should
>> > have already run and built any host tools that it needs.
>>
>> This is not a missing dependency. The problem is the make command called
>> in merge_configs fails silently because of a misconfigured sysroot. The
>> correct sysroot is in the TOOLCHAIN_OPTIONS variable and it does not get
>> passed to the make call in merge_configs.
>>
>
> That's my definition of a missing dependency. The host tools should already
> exist before
> merge_config ever runs. It shouldn't need to build anything.
>
>
>>
>> >
>> > How are you managing to trigger this error ? I've done plenty of builds,
>> > and haven't
>> > seen this one before.
>>
>> Every one of my builds error out in that make call from merge_config
>> without this change because make does not search in the correct sysroot.
>>
>>
> So there's something drastically different. I've done hundreds of builds
> before
> and after my changes to the kern tools.
>
> I need to understand what is different.
>
> What's your configuration ? Are you building linux-yocto, or something else
> ?
> (so I can run the same build here.)
>
> Bruce
>
>
>> >
>> > Bruce
>> >
>> >
>> >>
>> >> This issue is hard to debug because merge_config.sh does NOT check the
>> >> error output of its make call (this is added in the second patch) and
>> >> even though make errors out, the build continues as if nothing happened
>> >> and compiles a kernel with garbage configs (the .config generated by
>> >> do_kernel_configme is empty and gets filled later) which doesn't boot.
>> >>
>> >> Adding $TOOLCHAIN_OPTIONS to $CFLAGS before calling merge_configs.sh
>> >> fixes the error because $TOOLCHAIN_OPTIONS defines the sysroot and make
>> >> uses it to correctly compile & fill all missing kernel config options.
>> >>
>> >> [1] http://lists.openembedded.org/pipermail/openembedded-core/
>> >> 2014-Oc

Re: [OE-core] [yocto] [yocto-kernel-tools][PATCH] merge_configs.sh: fail loudly if make also fails

2016-08-29 Thread Ioan-Adrian Ratiu
On Mon, 29 Aug 2016, Bruce Ashfield <bruce.ashfi...@windriver.com> wrote:
> On 2016-08-29 08:07 AM, Bruce Ashfield wrote:
>>
>>
>> On Mon, Aug 29, 2016 at 5:19 AM, Ioan-Adrian Ratiu <adrian.ra...@ni.com
>> <mailto:adrian.ra...@ni.com>> wrote:
>>
>> merge_configs.sh calls make on the generated kernel config from
>> the defconfig + fragments to fill in any missing symbols. make
>> can fail and this can lead to nasty errors further on in the
>> build like generating an unbootable kernel image.
>>
>> Check the make return code and fail loudly if non-zero.
>>
>>
>> We don't want merge config to fail in a scenario like this. It is up to
>> whatever
>> calls merge_config to add that sort of logic. Which is what I do with
>> the kernel
>> audit phase of linux-yocto.
>
> I saw the other patch after replying here. So this is causing some sort
> of non Kconfig related error (i.e. host contamination) ? If so, that is
> a different scenario than I was thinking of when I wrote this.

Yes, exactly.

>
> Either way, like I said in my other email, I'd like to understand why
> this is popping up now, since I'm not seeing anything like it in my
> builds .. with my recent changes, all that I've essentially done is
> expose merge_config to the actual tasks, so if this is showing an error
> I jiggled something else, or it was always around.

It was always around, even before the cleanup you did in this area .
Remember I sent you a year ago patches for this issue when you were on
vacation and you told me you didn't need that patch?

These patches are a rebase on top of the current master of those from
a year ago. This issue is around since the sysroot poisoning commit back
in 2014.

>
> Bruce
>
>>
>> If you do want to try and make it fail in a scenario like this, the
>> patch needs to
>> go to the linux kernel mailing list.
>>
>> Cheers,
>>
>> Bruce
>>
>>
>>
>> Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com
>> <mailto:adrian.ra...@ni.com>>
>> ---
>>  tools/merge_config.sh | 5 -
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/tools/merge_config.sh b/tools/merge_config.sh
>> index 67d1314..5212f37 100755
>> --- a/tools/merge_config.sh
>> +++ b/tools/merge_config.sh
>> @@ -152,7 +152,10 @@ fi
>>  # alldefconfig: Fills in any missing symbols with Kconfig default
>>  # allnoconfig: Fills in any missing symbols with # CONFIG_* is not set
>>  make KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET
>> -
>> +if [ "$?" -ne 0 ]; then
>> +echo "Make failed to fill missing config symbols. Exit." >&2
>> +exit 1
>> +fi
>>
>>
>>  # Check all specified config values took (might have
>> missed-dependency issues)
>>  for CFG in $(sed -n "$SED_CONFIG_EXP" $TMP_FILE); do
>> --
>> 2.9.3
>>
>>
>>
>>
>> --
>> "Thou shalt not follow the NULL pointer, for chaos and madness await
>> thee at its end"
>>
>>
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] kernel-yocto: do_kernel_configme: Fix silent sysroot poisoning error

2016-08-29 Thread Ioan-Adrian Ratiu
On Mon, 29 Aug 2016, Bruce Ashfield <bruce.ashfi...@gmail.com> wrote:
> On Mon, Aug 29, 2016 at 5:19 AM, Ioan-Adrian Ratiu <adrian.ra...@ni.com>
> wrote:
>
>> do_kernel_configme calls merge_config.sh (installed in the sysroot by
>> the kern-tools-native recipe) which calls make to fill in any missing
>> symbols from the resulting merged config.
>
>
> That's not what it does ... but that isn't important.

Can you please explain in a simple sentence what it does?

>
>
>>
>> This errors out on my system because of sysroot poisoning [1]. Here is
>> a partial output from my .kernel-meta/cfg/merge_config_build.log (this
>> file is created in do_kernel_configme() while callig merge_config.sh):
>>
>> make[1]: Entering directory '/media/adi/ssd/nilrt-master/
>> build/tmp-glibc/work/x64-nilrt-linux/linux-nilrt/4.1+
>> gitAUTOINC+a7e53ecc27-r0/linux-x64-standard-build'
>>   HOSTCC  scripts/basic/fixdep
>> /media/adi/ssd/nilrt-master/build/tmp-glibc/work-shared/
>> x64/kernel-source/scripts/basic/fixdep.c:106:23: fatal error:
>> sys/types.h: No such file or directory
>> compilation terminated.
>> make[2]: *** [/media/adi/ssd/nilrt-master/build/tmp-glibc/work-shared/
>> x64/kernel-source/scripts/basic/Makefile:22: 
>> scripts/basic/x86_64-nilrt-linux-fixdep]
>> Error 1
>>
>
> This just means that we are missing a dependency. Everything that
> merge_config
> needs should be already in place before it runs, i.e. do_kernel_metadata
> should
> have already run and built any host tools that it needs.

This is not a missing dependency. The problem is the make command called
in merge_configs fails silently because of a misconfigured sysroot. The
correct sysroot is in the TOOLCHAIN_OPTIONS variable and it does not get
passed to the make call in merge_configs.

>
> How are you managing to trigger this error ? I've done plenty of builds,
> and haven't
> seen this one before.

Every one of my builds error out in that make call from merge_config
without this change because make does not search in the correct sysroot.

>
> Bruce
>
>
>>
>> This issue is hard to debug because merge_config.sh does NOT check the
>> error output of its make call (this is added in the second patch) and
>> even though make errors out, the build continues as if nothing happened
>> and compiles a kernel with garbage configs (the .config generated by
>> do_kernel_configme is empty and gets filled later) which doesn't boot.
>>
>> Adding $TOOLCHAIN_OPTIONS to $CFLAGS before calling merge_configs.sh
>> fixes the error because $TOOLCHAIN_OPTIONS defines the sysroot and make
>> uses it to correctly compile & fill all missing kernel config options.
>>
>> [1] http://lists.openembedded.org/pipermail/openembedded-core/
>> 2014-October/098253.html
>>
>> Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
>> ---
>>  meta/classes/kernel-yocto.bbclass | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/meta/classes/kernel-yocto.bbclass
>> b/meta/classes/kernel-yocto.bbclass
>> index 8650e55..4397a9d 100644
>> --- a/meta/classes/kernel-yocto.bbclass
>> +++ b/meta/classes/kernel-yocto.bbclass
>> @@ -249,7 +249,7 @@ do_kernel_configme() {
>> bbfatal_log "Could not find configuration queue
>> (${meta_dir}/config.queue)"
>> fi
>>
>> -   ARCH=${ARCH} merge_config.sh -O ${B} ${config_flags} ${configs} >
>> ${meta_dir}/cfg/merge_config_build.log 2>&1
>> +   CFLAGS="${CFLAGS} ${TOOLCHAIN_OPTIONS}" ARCH=${ARCH}
>> merge_config.sh -O ${B} ${config_flags} ${configs} >
>> ${meta_dir}/cfg/merge_config_build.log 2>&1
>> if [ $? -ne 0 ]; then
>> bbfatal_log "Could not configure
>> ${KMACHINE}-${LINUX_KERNEL_TYPE}"
>> fi
>> --
>> 2.9.3
>>
>>
>
>
> -- 
> "Thou shalt not follow the NULL pointer, for chaos and madness await thee
> at its end"
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [yocto-kernel-tools][PATCH] merge_configs.sh: fail loudly if make also fails

2016-08-29 Thread Ioan-Adrian Ratiu
On Mon, 29 Aug 2016, Bruce Ashfield <bruce.ashfi...@gmail.com> wrote:
> On Mon, Aug 29, 2016 at 5:19 AM, Ioan-Adrian Ratiu <adrian.ra...@ni.com>
> wrote:
>
>> merge_configs.sh calls make on the generated kernel config from
>> the defconfig + fragments to fill in any missing symbols. make
>> can fail and this can lead to nasty errors further on in the
>> build like generating an unbootable kernel image.
>>
>> Check the make return code and fail loudly if non-zero.
>>
>
> We don't want merge config to fail in a scenario like this. It is up to
> whatever
> calls merge_config to add that sort of logic. Which is what I do with the
> kernel
> audit phase of linux-yocto.

Why exactly don't we want to check for errors here? Anyone calling
merge_configs has no way of knowing if this make call failed if we don't
check its return code and pass the error up the call chain.

>
> If you do want to try and make it fail in a scenario like this, the patch
> needs to
> go to the linux kernel mailing list.

I don't understand how sending this patch to lkml helps because
yocto-kernel-tools is a yocto/oe project and is outside the kernel
codebase, no?

>
> Cheers,
>
> Bruce
>
>
>>
>> Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
>> ---
>>  tools/merge_config.sh | 5 -
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/tools/merge_config.sh b/tools/merge_config.sh
>> index 67d1314..5212f37 100755
>> --- a/tools/merge_config.sh
>> +++ b/tools/merge_config.sh
>> @@ -152,7 +152,10 @@ fi
>>  # alldefconfig: Fills in any missing symbols with Kconfig default
>>  # allnoconfig: Fills in any missing symbols with # CONFIG_* is not set
>>  make KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET
>> -
>> +if [ "$?" -ne 0 ]; then
>> +echo "Make failed to fill missing config symbols. Exit." >&2
>> +exit 1
>> +fi
>
>
>>  # Check all specified config values took (might have missed-dependency
>> issues)
>>  for CFG in $(sed -n "$SED_CONFIG_EXP" $TMP_FILE); do
>> --
>> 2.9.3
>>
>>
>
>
> -- 
> "Thou shalt not follow the NULL pointer, for chaos and madness await thee
> at its end"
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] kernel-yocto: do_kernel_configme: Fix silent sysroot poisoning error

2016-08-29 Thread Ioan-Adrian Ratiu
do_kernel_configme calls merge_config.sh (installed in the sysroot by
the kern-tools-native recipe) which calls make to fill in any missing
symbols from the resulting merged config.

This errors out on my system because of sysroot poisoning [1]. Here is
a partial output from my .kernel-meta/cfg/merge_config_build.log (this
file is created in do_kernel_configme() while callig merge_config.sh):

make[1]: Entering directory 
'/media/adi/ssd/nilrt-master/build/tmp-glibc/work/x64-nilrt-linux/linux-nilrt/4.1+gitAUTOINC+a7e53ecc27-r0/linux-x64-standard-build'
  HOSTCC  scripts/basic/fixdep
/media/adi/ssd/nilrt-master/build/tmp-glibc/work-shared/x64/kernel-source/scripts/basic/fixdep.c:106:23:
 fatal error: sys/types.h: No such file or directory
compilation terminated.
make[2]: *** 
[/media/adi/ssd/nilrt-master/build/tmp-glibc/work-shared/x64/kernel-source/scripts/basic/Makefile:22:
 scripts/basic/x86_64-nilrt-linux-fixdep] Error 1

This issue is hard to debug because merge_config.sh does NOT check the
error output of its make call (this is added in the second patch) and
even though make errors out, the build continues as if nothing happened
and compiles a kernel with garbage configs (the .config generated by
do_kernel_configme is empty and gets filled later) which doesn't boot.

Adding $TOOLCHAIN_OPTIONS to $CFLAGS before calling merge_configs.sh
fixes the error because $TOOLCHAIN_OPTIONS defines the sysroot and make
uses it to correctly compile & fill all missing kernel config options.

[1] 
http://lists.openembedded.org/pipermail/openembedded-core/2014-October/098253.html

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/classes/kernel-yocto.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/kernel-yocto.bbclass 
b/meta/classes/kernel-yocto.bbclass
index 8650e55..4397a9d 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -249,7 +249,7 @@ do_kernel_configme() {
bbfatal_log "Could not find configuration queue 
(${meta_dir}/config.queue)"
fi
 
-   ARCH=${ARCH} merge_config.sh -O ${B} ${config_flags} ${configs} > 
${meta_dir}/cfg/merge_config_build.log 2>&1
+   CFLAGS="${CFLAGS} ${TOOLCHAIN_OPTIONS}" ARCH=${ARCH} merge_config.sh -O 
${B} ${config_flags} ${configs} > ${meta_dir}/cfg/merge_config_build.log 2>&1
if [ $? -ne 0 ]; then
bbfatal_log "Could not configure 
${KMACHINE}-${LINUX_KERNEL_TYPE}"
fi
-- 
2.9.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [yocto-kernel-tools][PATCH] merge_configs.sh: fail loudly if make also fails

2016-08-29 Thread Ioan-Adrian Ratiu
merge_configs.sh calls make on the generated kernel config from
the defconfig + fragments to fill in any missing symbols. make
can fail and this can lead to nasty errors further on in the
build like generating an unbootable kernel image.

Check the make return code and fail loudly if non-zero.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 tools/merge_config.sh | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/merge_config.sh b/tools/merge_config.sh
index 67d1314..5212f37 100755
--- a/tools/merge_config.sh
+++ b/tools/merge_config.sh
@@ -152,7 +152,10 @@ fi
 # alldefconfig: Fills in any missing symbols with Kconfig default
 # allnoconfig: Fills in any missing symbols with # CONFIG_* is not set
 make KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET
-
+if [ "$?" -ne 0 ]; then
+echo "Make failed to fill missing config symbols. Exit." >&2
+exit 1
+fi
 
 # Check all specified config values took (might have missed-dependency issues)
 for CFG in $(sed -n "$SED_CONFIG_EXP" $TMP_FILE); do
-- 
2.9.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] linux-firmware: package carl9170 separately

2016-08-26 Thread Ioan-Adrian Ratiu
On Wed, 24 Aug 2016, Khem Raj <raj.k...@gmail.com> wrote:
> [ Unknown signature status ]
>
>> On Aug 24, 2016, at 5:22 AM, Ioan-Adrian Ratiu <adrian.ra...@ni.com> wrote:
>> 
>> carl9170 is an atheros-based firmware, the succesor of ar9170 which is
>> deprecated and its driver (ar9170) was removed from the kernel tree.
>> carl9170 comes both as a binary blob and also with free sources; the
>> sources are deleted in linux-firmware.bb to avoid depeding on bash/etc.
>> 
>> Package the carl9170 binary firmware separately because it is needed
>> by various usb dongles and installing whole linux-firmware is overkill.
>
> while you are at it. Can you also scrutinize the license needs for this 
> firmware ?
> should it require packaging a license file explicitly into rootfs or some such

The carl9170 firmware license is GPLv2, sources are also included in the
linux-firmware tree besides the binary. I don't think we need to do
anything special for it.

>
>> 
>> Also we should keep ar9170 as is because OOT drivers might still use it.
>> 
>> Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
>> ---
>> meta/recipes-kernel/linux-firmware/linux-firmware_git.bb | 6 +-
>> 1 file changed, 5 insertions(+), 1 deletion(-)
>> 
>> diff --git a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb 
>> b/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
>> index 948dfa8..1657445 100644
>> --- a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
>> +++ b/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
>> @@ -226,7 +226,7 @@ PACKAGES =+ "${PN}-ralink-license ${PN}-ralink \
>>  ${PN}-vt6656-license ${PN}-vt6656 \
>>  ${PN}-rtl-license ${PN}-rtl8192cu ${PN}-rtl8192ce 
>> ${PN}-rtl8192su \
>>  ${PN}-broadcom-license ${PN}-bcm4329 ${PN}-bcm4330 
>> ${PN}-bcm4334 ${PN}-bcm43340 ${PN}-bcm4339 ${PN}-bcm4354 \
>> - ${PN}-atheros-license ${PN}-ar9170 ${PN}-ath6k ${PN}-ath9k \
>> + ${PN}-atheros-license ${PN}-ar9170 ${PN}-carl9170 ${PN}-ath6k 
>> ${PN}-ath9k \
>>  ${PN}-ar3k-license  ${PN}-ar3k  ${PN}-ath10k-license  
>> ${PN}-ath10k  \
>>  \
>>  ${PN}-iwlwifi-license ${PN}-iwlwifi \
>> @@ -255,6 +255,9 @@ FILES_${PN}-atheros-license = 
>> "/lib/firmware/LICENCE.atheros_firmware"
>> FILES_${PN}-ar9170 = " \
>>   /lib/firmware/ar9170*.fw \
>> "
>> +FILES_${PN}-carl9170 = " \
>> +  /lib/firmware/carl9170*.fw \
>> +"
>> FILES_${PN}-ath6k = " \
>>   /lib/firmware/ath6k \
>> "
>> @@ -266,6 +269,7 @@ FILES_${PN}-ath9k = " \
>> "
>> 
>> RDEPENDS_${PN}-ar9170 += "${PN}-atheros-license"
>> +RDEPENDS_${PN}-carl9170 += "${PN}-atheros-license"
>> RDEPENDS_${PN}-ath6k += "${PN}-atheros-license"
>> RDEPENDS_${PN}-ath9k += "${PN}-atheros-license"
>> 
>> --
>> 2.9.3
>> 
>> --
>> ___
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] linux-firmware: package carl9170 separately

2016-08-24 Thread Ioan-Adrian Ratiu
carl9170 is an atheros-based firmware, the succesor of ar9170 which is
deprecated and its driver (ar9170) was removed from the kernel tree.
carl9170 comes both as a binary blob and also with free sources; the
sources are deleted in linux-firmware.bb to avoid depeding on bash/etc.

Package the carl9170 binary firmware separately because it is needed
by various usb dongles and installing whole linux-firmware is overkill.

Also we should keep ar9170 as is because OOT drivers might still use it.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/recipes-kernel/linux-firmware/linux-firmware_git.bb | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb 
b/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
index 948dfa8..1657445 100644
--- a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
+++ b/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
@@ -226,7 +226,7 @@ PACKAGES =+ "${PN}-ralink-license ${PN}-ralink \
  ${PN}-vt6656-license ${PN}-vt6656 \
  ${PN}-rtl-license ${PN}-rtl8192cu ${PN}-rtl8192ce ${PN}-rtl8192su 
\
  ${PN}-broadcom-license ${PN}-bcm4329 ${PN}-bcm4330 ${PN}-bcm4334 
${PN}-bcm43340 ${PN}-bcm4339 ${PN}-bcm4354 \
- ${PN}-atheros-license ${PN}-ar9170 ${PN}-ath6k ${PN}-ath9k \
+ ${PN}-atheros-license ${PN}-ar9170 ${PN}-carl9170 ${PN}-ath6k 
${PN}-ath9k \
  ${PN}-ar3k-license  ${PN}-ar3k  ${PN}-ath10k-license  
${PN}-ath10k  \
  \
  ${PN}-iwlwifi-license ${PN}-iwlwifi \
@@ -255,6 +255,9 @@ FILES_${PN}-atheros-license = 
"/lib/firmware/LICENCE.atheros_firmware"
 FILES_${PN}-ar9170 = " \
   /lib/firmware/ar9170*.fw \
 "
+FILES_${PN}-carl9170 = " \
+  /lib/firmware/carl9170*.fw \
+"
 FILES_${PN}-ath6k = " \
   /lib/firmware/ath6k \
 "
@@ -266,6 +269,7 @@ FILES_${PN}-ath9k = " \
 "
 
 RDEPENDS_${PN}-ar9170 += "${PN}-atheros-license"
+RDEPENDS_${PN}-carl9170 += "${PN}-atheros-license"
 RDEPENDS_${PN}-ath6k += "${PN}-atheros-license"
 RDEPENDS_${PN}-ath9k += "${PN}-atheros-license"
 
-- 
2.9.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v2] grub: split grub-editenv into it's own package

2016-08-16 Thread Ioan-Adrian Ratiu
From: Alejandro del Castillo <alejandro.delcasti...@ni.com>

grub-editenv edits the env block at runtime on a booted system. Other
tools can depend on it to configure a live system, for ex. to set next
boot mode upon reboot. By splitting grub-editenv, tools don't have to
depend on the entire grub package (grub-editenv just edits one file).

Signed-off-by: Alejandro del Castillo <alejandro.delcasti...@ni.com>
Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/recipes-bsp/grub/grub_2.00.bb | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-bsp/grub/grub_2.00.bb 
b/meta/recipes-bsp/grub/grub_2.00.bb
index 778074a..07e1d10 100644
--- a/meta/recipes-bsp/grub/grub_2.00.bb
+++ b/meta/recipes-bsp/grub/grub_2.00.bb
@@ -1,6 +1,6 @@
 require grub2.inc
 
-RDEPENDS_${PN} = "diffutils freetype"
+RDEPENDS_${PN} = "diffutils freetype grub-editenv"
 PR = "r1"
 
 EXTRA_OECONF = "--with-platform=pc --disable-grub-mkfont --program-prefix="" \
@@ -8,6 +8,10 @@ EXTRA_OECONF = "--with-platform=pc --disable-grub-mkfont 
--program-prefix="" \
 
 EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 
'--enable-largefile', '--disable-largefile', d)}"
 
+PACKAGES =+ "grub-editenv"
+
+FILES_grub-editenv = "${bindir}/grub-editenv"
+
 do_install_append () {
 install -d ${D}${sysconfdir}/grub.d
 }
-- 
2.9.2

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] grub: split grub-editenv into it's own package

2016-08-16 Thread Ioan-Adrian Ratiu
On Tue, 16 Aug 2016, "Burton, Ross" <ross.bur...@intel.com> wrote:
> On 12 August 2016 at 14:15, Ioan-Adrian Ratiu <adrian.ra...@ni.com> wrote:
>
>> +PACKAGES =+ "grub-editenv"
>> +
>> +FILES_grub-editenv = "${bindir}/grub-editenv"
>>
>
> Shouldn't grub rdepend, or at least rrecommend, grub-editenv?

Good catch. RDEPENDS_grub would preserve the previous behaviour.
I'll send v2.

Thank you!

>
> Ross
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] initscripts: Check for logrotate in dmesg.sh

2016-08-12 Thread Ioan-Adrian Ratiu
From: Ovidiu Vancea <ovidiu.van...@ni.com>

Autodetect previously hardcoded logrotate location because it can be
installed in multiple places like /usr/bin/logrotate which is very
common besides /usr/sbin

Signed-off-by: Ovidiu Vancea <ovidiu.van...@ni.com>
Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 mode change 100644 => 100755 
meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh

diff --git a/meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh 
b/meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh
old mode 100644
new mode 100755
index a97b068..2b9eba6
--- a/meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh
@@ -8,8 +8,8 @@
 ### END INIT INFO
 
 if [ -f /var/log/dmesg ]; then
-   if [ -f /usr/sbin/logrotate ]; then
-   logrotate -f /etc/logrotate-dmesg.conf
+   if LOGPATH=$(which logrotate); then
+   $LOGPATH -f /etc/logrotate-dmesg.conf
else
mv -f /var/log/dmesg /var/log/dmesg.old
fi
-- 
2.9.2

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] grub: split grub-editenv into it's own package

2016-08-12 Thread Ioan-Adrian Ratiu
From: Alejandro del Castillo <alejandro.delcasti...@ni.com>

grub-editenv edits the env block at runtime on a booted system. Other
tools can depend on it to configure a live system, for ex. to set next
boot mode upon reboot. By splitting grub-editenv, tools don't have to
depend on the entire grub package (grub-editenv just edits one file).

Signed-off-by: Alejandro del Castillo <alejandro.delcasti...@ni.com>
Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/recipes-bsp/grub/grub_2.00.bb | 4 
 1 file changed, 4 insertions(+)

diff --git a/meta/recipes-bsp/grub/grub_2.00.bb 
b/meta/recipes-bsp/grub/grub_2.00.bb
index 778074a..f983e77 100644
--- a/meta/recipes-bsp/grub/grub_2.00.bb
+++ b/meta/recipes-bsp/grub/grub_2.00.bb
@@ -8,6 +8,10 @@ EXTRA_OECONF = "--with-platform=pc --disable-grub-mkfont 
--program-prefix="" \
 
 EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 
'--enable-largefile', '--disable-largefile', d)}"
 
+PACKAGES =+ "grub-editenv"
+
+FILES_grub-editenv = "${bindir}/grub-editenv"
+
 do_install_append () {
 install -d ${D}${sysconfdir}/grub.d
 }
-- 
2.9.2

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] perl-native: backport libnm link fix

2016-08-11 Thread Ioan-Adrian Ratiu
pre-5.25.0 perl by default tries to link to an antiquated libnm (new
math) which is not used anymore since the early 1990's. After 2014
another libnm appeared for NetworkManager causing build failures.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/recipes-devtools/perl/perl-native_5.22.1.bb   |  1 +
 .../perl/perl/perl-remove-nm-from-libswanted.patch | 30 ++
 2 files changed, 31 insertions(+)
 create mode 100644 
meta/recipes-devtools/perl/perl/perl-remove-nm-from-libswanted.patch

diff --git a/meta/recipes-devtools/perl/perl-native_5.22.1.bb 
b/meta/recipes-devtools/perl/perl-native_5.22.1.bb
index ed8222f..1c21522 100644
--- a/meta/recipes-devtools/perl/perl-native_5.22.1.bb
+++ b/meta/recipes-devtools/perl/perl-native_5.22.1.bb
@@ -11,6 +11,7 @@ SRC_URI += "\
file://debian/errno_ver.diff \
file://dynaloaderhack.patch \
file://perl-PathTools-don-t-filter-out-blib-from-INC.patch \
+   file://perl-remove-nm-from-libswanted.patch \
   "
 
 SRC_URI[md5sum] = "6671e4829cbaf9cecafa9a84f141b0a3"
diff --git 
a/meta/recipes-devtools/perl/perl/perl-remove-nm-from-libswanted.patch 
b/meta/recipes-devtools/perl/perl/perl-remove-nm-from-libswanted.patch
new file mode 100644
index 000..c489f05
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/perl-remove-nm-from-libswanted.patch
@@ -0,0 +1,30 @@
+From 4732711e2548b6d734ca831d65dbcf501a89774e Mon Sep 17 00:00:00 2001
+From: Andreas Koenig <a...@cpan.org>
+Date: Sun, 3 Jan 2016 08:40:33 +0100
+Subject: [PATCH] Remove nm from libswanted
+
+Nm stood for "New Math" library in the context of 1994. 2014 a conflicting
+library libnm appeared that has a network manager context.
+
+Upstream-Status: Backport [commit 4732711e on branch blead, tag v5.25.0]
+
+---
+ Configure | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Configure b/Configure
+index 0e71b4b..cfbdaa1 100755
+--- a/Configure
 b/Configure
+@@ -1464,7 +1464,7 @@ libswanted_uselargefiles=''
+ : set usesocks on the Configure command line to enable socks.
+ : List of libraries we want.
+ : If anyone needs extra -lxxx, put those in a hint file.
+-libswanted="cl pthread socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld"
++libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
+ libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
+ : We probably want to search /usr/shlib before most other libraries.
+ : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
+-- 
+2.9.2
+
-- 
2.9.2

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH v2] kernel.bbclass: fix emit_depmod_pkgdata() workdir

2016-08-11 Thread Ioan-Adrian Ratiu
On Thu, 11 Aug 2016, Ioan-Adrian Ratiu <adrian.ra...@ni.com> wrote:
> On Thu, 11 Aug 2016, "Burton, Ross" <ross.bur...@intel.com> wrote:
>> On 11 August 2016 at 10:39, Ioan-Adrian Ratiu <adrian.ra...@ni.com> wrote:
>>
>>> bitbake commit 67a7b8b02 "build: don't use $B as the default cwd for
>>> functions" breaks the assumption that this function is running under
>>> ${B}. This causes build failures because System.map is under ${B}.
>>> Fix this by using an absolute path instead of relying on cwd.
>>>
>>
>> This failed to apply and I noticed that I fixed this myself in July...
>
> What commit id is the fix on the master branch? I can't find it..
>

I managed to find it d596286bc4cf1977 thanks!

>>
>> Ross
> -- 
> ___
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH v2] kernel.bbclass: fix emit_depmod_pkgdata() workdir

2016-08-11 Thread Ioan-Adrian Ratiu
On Thu, 11 Aug 2016, "Burton, Ross" <ross.bur...@intel.com> wrote:
> On 11 August 2016 at 10:39, Ioan-Adrian Ratiu <adrian.ra...@ni.com> wrote:
>
>> bitbake commit 67a7b8b02 "build: don't use $B as the default cwd for
>> functions" breaks the assumption that this function is running under
>> ${B}. This causes build failures because System.map is under ${B}.
>> Fix this by using an absolute path instead of relying on cwd.
>>
>
> This failed to apply and I noticed that I fixed this myself in July...

What commit id is the fix on the master branch? I can't find it..

>
> Ross
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v2] kernel.bbclass: fix emit_depmod_pkgdata() workdir

2016-08-11 Thread Ioan-Adrian Ratiu
bitbake commit 67a7b8b02 "build: don't use $B as the default cwd for
functions" breaks the assumption that this function is running under
${B}. This causes build failures because System.map is under ${B}.
Fix this by using an absolute path instead of relying on cwd.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/classes/kernel.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 062a0df..f3e1bee 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -359,7 +359,7 @@ emit_depmod_pkgdata() {
# Stash data for depmod
install -d ${PKGDESTWORK}/${KERNEL_PACKAGE_NAME}-depmod/
echo "${KERNEL_VERSION}" > 
${PKGDESTWORK}/${KERNEL_PACKAGE_NAME}-depmod/${KERNEL_PACKAGE_NAME}-abiversion
-   cp System.map 
${PKGDESTWORK}/${KERNEL_PACKAGE_NAME}-depmod/System.map-${KERNEL_VERSION}
+   cp ${B}/System.map 
${PKGDESTWORK}/${KERNEL_PACKAGE_NAME}-depmod/System.map-${KERNEL_VERSION}
 }
 
 PACKAGEFUNCS += "emit_depmod_pkgdata"
-- 
2.9.2

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH RESEND] kernel.bbclass: fix emit_depmod_pkgdata() workdir

2016-08-11 Thread Ioan-Adrian Ratiu
On Thu, 11 Aug 2016, Ioan-Adrian Ratiu <adrian.ra...@ni.com> wrote:
> On Wed, 10 Aug 2016, "Burton, Ross" <ross.bur...@intel.com> wrote:
>> On 10 August 2016 at 16:58, Ioan-Adrian Ratiu <adrian.ra...@ni.com> wrote:
>>
>>> bitbake commit 67a7b8b02 "build: don't use $B as the default cwd for
>>> functions" breaks the assumption that this function is running under
>>> ${B}. This causes build failures because System.map is under ${B}.
>>>
>>
>> For clarity, can the function simply always use absolute paths instead of
>> relying on cwd?
>
> Yes, but other functions inside this bbclass also rely on cwd being
> ${B}; should I modify only this one to absolute paths or modify all of
> these functions (do_shared_workdir, or do_strip) to maintain consistency?
>

Ah nvm, I've looked closer at them functions and their use of cwd = $B
makes sense so it doesn't need modyfing. I'll resubmit only this patch.

>>
>> Ross
> -- 
> ___
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH RESEND] kernel.bbclass: fix emit_depmod_pkgdata() workdir

2016-08-11 Thread Ioan-Adrian Ratiu
On Wed, 10 Aug 2016, "Burton, Ross" <ross.bur...@intel.com> wrote:
> On 10 August 2016 at 16:58, Ioan-Adrian Ratiu <adrian.ra...@ni.com> wrote:
>
>> bitbake commit 67a7b8b02 "build: don't use $B as the default cwd for
>> functions" breaks the assumption that this function is running under
>> ${B}. This causes build failures because System.map is under ${B}.
>>
>
> For clarity, can the function simply always use absolute paths instead of
> relying on cwd?

Yes, but other functions inside this bbclass also rely on cwd being
${B}; should I modify only this one to absolute paths or modify all of
these functions (do_shared_workdir, or do_strip) to maintain consistency?

>
> Ross
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH RESEND] kernel.bbclass: fix emit_depmod_pkgdata() workdir

2016-08-10 Thread Ioan-Adrian Ratiu
bitbake commit 67a7b8b02 "build: don't use $B as the default cwd for
functions" breaks the assumption that this function is running under
${B}. This causes build failures because System.map is under ${B}.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/classes/kernel.bbclass | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 062a0df..1a9b404 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -356,6 +356,7 @@ do_shared_workdir_setscene () {
 }
 
 emit_depmod_pkgdata() {
+   cd ${B}
# Stash data for depmod
install -d ${PKGDESTWORK}/${KERNEL_PACKAGE_NAME}-depmod/
echo "${KERNEL_VERSION}" > 
${PKGDESTWORK}/${KERNEL_PACKAGE_NAME}-depmod/${KERNEL_PACKAGE_NAME}-abiversion
-- 
2.9.2

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] dbus: backport stdint.h build fix

2016-08-09 Thread Ioan-Adrian Ratiu
This patch fixes an error where dbus configure doesn't detect
stdint.h correctly.

Upstream commit 1bfde222 on branches dbus-1.10 and master

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 ...1-configure.ac-explicitely-check-stdint.h.patch | 38 ++
 meta/recipes-core/dbus/dbus_1.10.8.bb  |  1 +
 2 files changed, 39 insertions(+)
 create mode 100644 
meta/recipes-core/dbus/dbus/0001-configure.ac-explicitely-check-stdint.h.patch

diff --git 
a/meta/recipes-core/dbus/dbus/0001-configure.ac-explicitely-check-stdint.h.patch
 
b/meta/recipes-core/dbus/dbus/0001-configure.ac-explicitely-check-stdint.h.patch
new file mode 100644
index 000..85acb7b
--- /dev/null
+++ 
b/meta/recipes-core/dbus/dbus/0001-configure.ac-explicitely-check-stdint.h.patch
@@ -0,0 +1,38 @@
+From 1bfde222926be624a30a6e4b2cdc2c5064a36298 Mon Sep 17 00:00:00 2001
+From: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
+Date: Fri, 29 Jul 2016 01:19:37 +0300
+Subject: [PATCH] configure.ac: explicitely check stdint.h
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Otherwise HAVE_STDINT_H will not be defined or the var will not be
+picked up from cache so builds could fail with errors like:
+| ../../dbus-1.10.8/dbus/dbus-internals.h:239:8: error: ‘uintptr_t’ undeclared 
(first use in this function)
+
+Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
+[smcv: fix Autoconf underquoting]
+Reviewed-by: Simon McVittie <simon.mcvit...@collabora.co.uk>
+
+Upstream-Status: Backport [from dbus-1.10]
+
+---
+ configure.ac | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index cf5c5b9..a228d63 100644
+--- a/configure.ac
 b/configure.ac
+@@ -699,6 +699,8 @@ AC_CHECK_HEADERS(byteswap.h)
+ 
+ AC_CHECK_HEADERS(unistd.h)
+ 
++AC_CHECK_HEADERS([stdint.h])
++
+ AC_CHECK_HEADERS(ws2tcpip.h)
+ 
+ AC_CHECK_HEADERS(alloca.h)
+-- 
+2.9.2
+
diff --git a/meta/recipes-core/dbus/dbus_1.10.8.bb 
b/meta/recipes-core/dbus/dbus_1.10.8.bb
index bfaf65a..62dd8bb 100644
--- a/meta/recipes-core/dbus/dbus_1.10.8.bb
+++ b/meta/recipes-core/dbus/dbus_1.10.8.bb
@@ -17,6 +17,7 @@ SRC_URI = 
"http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
file://dbus-1.init \
file://os-test.patch \
file://clear-guid_from_server-if-send_negotiate_unix_f.patch \
+   file://0001-configure.ac-explicitely-check-stdint.h.patch \
 "
 
 SRC_URI[md5sum] = "e912e930f249454752512aa7ac864d43"
-- 
2.9.2

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] kernel.bbclass: fix emit_depmod_pkgdata() workdir

2016-07-26 Thread Ioan-Adrian Ratiu
bitbake commit 67a7b8b02 "build: don't use $B as the default cwd for
functions" breaks the assumption that this function is running under
${B}. This causes build failures because System.map is under ${B}.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/classes/kernel.bbclass | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index c17165a..125ad33 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -356,6 +356,7 @@ do_shared_workdir_setscene () {
 }
 
 emit_depmod_pkgdata() {
+   cd ${B}
# Stash data for depmod
install -d ${PKGDESTWORK}/${KERNEL_PACKAGE_NAME}-depmod/
echo "${KERNEL_VERSION}" > 
${PKGDESTWORK}/${KERNEL_PACKAGE_NAME}-depmod/${KERNEL_PACKAGE_NAME}-abiversion
-- 
2.9.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] grub-efi: run autogen.sh before configure

2016-07-12 Thread Ioan-Adrian Ratiu
Hello

On Tue, 12 Jul 2016 11:27:15 +0800
"Yu, Mingli"  wrote:

> On 2016年07月11日 18:22, Burton, Ross wrote:
> >
> > On 6 May 2016 at 13:13, Catalin Enache  > > wrote:
> >
> >   DEPENDS_class-target = "grub-efi-native"
> >   RDEPENDS_${PN}_class-target = "diffutils freetype"
> > +DEPENDS += "autogen-native"
> >
> >
> > Because += happens after overrides this results in autogen-native only a
> > dependency in native builds, so you can't be sure it will be present for
> > target builds.  
> 
> Thanks Ross! Will update the line as:
> DEPENDS_append = " autogen-native"
> >
> > Should the configure_prepend and autogen-native be added to grub2.inc so
> > that every recipe has that dependency?  
> 
> Hi Catalin,
> Could you help to confirm if the three recipes (grub-efi_2.00.bb, 
> grub_2.00.bb, grub_git.bb) all need configure_prepend and 
> autogen-native? if yes, I will resent the patch to add configure_prepend 
> and autogen-native to grub2.inc, if not, then we still let it stay in 
> grub-efi recipe.

I would really appreciate if you could add the autogen call to all grub recipes,
not only to grub-efi, because I'm also carrying OOT patches and have to add
it into a bbappend.

> 
> Thanks,
> Grace
> >
> > Ross
> >
> >  

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [Krogoth][PATCH v2] gcc-4.9: fix build with gcc 6

2016-05-18 Thread Ioan-Adrian Ratiu
Building gcc-cross 4.9.3 with gcc 6 fails with the following error:

error: 'const char* libc_name_p(const char*, unsigned int)' redeclared inline 
with 'gnu_inline' attribute

This is a backport of the upstream fix.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/recipes-devtools/gcc/gcc-4.9.inc  |   1 +
 .../gcc/gcc-4.9/0076-Fix-build-with-gcc-6.patch| 151 +
 2 files changed, 152 insertions(+)
 create mode 100644 
meta/recipes-devtools/gcc/gcc-4.9/0076-Fix-build-with-gcc-6.patch

diff --git a/meta/recipes-devtools/gcc/gcc-4.9.inc 
b/meta/recipes-devtools/gcc/gcc-4.9.inc
index 208e092..0cd9826 100644
--- a/meta/recipes-devtools/gcc/gcc-4.9.inc
+++ b/meta/recipes-devtools/gcc/gcc-4.9.inc
@@ -91,6 +91,7 @@ SRC_URI = "\
 file://0073-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch \
 file://0074-fdebug-prefix-map-support-to-remap-relative-path.patch \
 file://0075-libgcc-use-ldflags.patch \
+file://0076-Fix-build-with-gcc-6.patch \
 "
 SRC_URI[md5sum] = "6f831b4d251872736e8e9cc09746f327"
 SRC_URI[sha256sum] = 
"2332b2a5a321b57508b9031354a8503af6fdfb868b8c1748d33028d100a8b67e"
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0076-Fix-build-with-gcc-6.patch 
b/meta/recipes-devtools/gcc/gcc-4.9/0076-Fix-build-with-gcc-6.patch
new file mode 100644
index 000..f865d4f
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0076-Fix-build-with-gcc-6.patch
@@ -0,0 +1,151 @@
+From efdf2b53b907c96ad3f00275588eb311335d0c91 Mon Sep 17 00:00:00 2001
+From: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
+Date: Thu, 12 May 2016 15:24:25 +0300
+Subject: [PATCH] Fix build with gcc 6
+
+* Make-lang.in: Invoke gperf with -L C++.
+* cfns.gperf: Remove prototypes for hash and libc_name_p
+inlines.
+* cfns.h: Regenerated.
+* except.c (nothrow_libfn_p): Adjust.
+
+svn rev: r233572
+
+Upstream-status: Backport [gcc 4.9]
+
+Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
+---
+ gcc/cp/Make-lang.in |  2 +-
+ gcc/cp/cfns.gperf   | 10 ++
+ gcc/cp/cfns.h   | 41 ++---
+ gcc/cp/except.c |  3 ++-
+ 4 files changed, 19 insertions(+), 37 deletions(-)
+
+diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
+index bd1c1d7..a0ea0d4 100644
+--- a/gcc/cp/Make-lang.in
 b/gcc/cp/Make-lang.in
+@@ -111,7 +111,7 @@ else
+ # deleting the $(srcdir)/cp/cfns.h file.
+ $(srcdir)/cp/cfns.h:
+ endif
+-  gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \
++  gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L C++ \
+   $(srcdir)/cp/cfns.gperf --output-file $(srcdir)/cp/cfns.h
+ 
+ #
+diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf
+index 05ca753..d9b16b8 100644
+--- a/gcc/cp/cfns.gperf
 b/gcc/cp/cfns.gperf
+@@ -1,3 +1,5 @@
++%language=C++
++%define class-name libc_name
+ %{
+ /* Copyright (C) 2000-2014 Free Software Foundation, Inc.
+ 
+@@ -16,14 +18,6 @@ for more details.
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+-#ifdef __GNUC__
+-__inline
+-#endif
+-static unsigned int hash (const char *, unsigned int);
+-#ifdef __GNUC__
+-__inline
+-#endif
+-const char * libc_name_p (const char *, unsigned int);
+ %}
+ %%
+ # The standard C library functions, for feeding to gperf; the result is used
+diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h
+index c845ddf..65801d1 100644
+--- a/gcc/cp/cfns.h
 b/gcc/cp/cfns.h
+@@ -1,5 +1,5 @@
+-/* ANSI-C code produced by gperf version 3.0.3 */
+-/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C 
cfns.gperf  */
++/* C++ code produced by gperf version 3.0.4 */
++/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L C++ 
--output-file cfns.h cfns.gperf  */
+ 
+ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+   && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
+@@ -28,7 +28,7 @@
+ #error "gperf generated tables don't work with this execution character set. 
Please report a bug to <bug-gnu-gp...@gnu.org>."
+ #endif
+ 
+-#line 1 "cfns.gperf"
++#line 3 "cfns.gperf"
+ 
+ /* Copyright (C) 2000-2014 Free Software Foundation, Inc.
+ 
+@@ -47,25 +47,18 @@ for more details.
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+-#ifdef __GNUC__
+-__inline
+-#endif
+-static unsigned int hash (const char *, unsigned int);
+-#ifdef __GNUC__
+-__inline
+-#endif
+-const char * libc_name_p (const char *, unsigned int);
+ /* maximum key range = 391, duplicates = 0 */
+ 
+-#ifdef __GNUC__
+-__inline
+-#else
+-#ifdef __cplusplus
+-inline
+-#endif
+-#endif
+-static unsigned int
+-h

[OE-core] [Krogoth][PATCH] gcc-4.9: fix build with gcc 6

2016-05-12 Thread Ioan-Adrian Ratiu
Building gcc-cross 4.9.3 with gcc 6 fails with the following error:

error: 'const char* libc_name_p(const char*, unsigned int)' redeclared inline 
with 'gnu_inline' attribute

This is a backport of the upstream fix.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/recipes-devtools/gcc/gcc-4.9.inc  |   1 +
 .../gcc/gcc-4.9/0075-Fix-build-with-gcc-6.patch| 151 +
 2 files changed, 152 insertions(+)
 create mode 100644 
meta/recipes-devtools/gcc/gcc-4.9/0075-Fix-build-with-gcc-6.patch

diff --git a/meta/recipes-devtools/gcc/gcc-4.9.inc 
b/meta/recipes-devtools/gcc/gcc-4.9.inc
index 7e03f31..a38a68b 100644
--- a/meta/recipes-devtools/gcc/gcc-4.9.inc
+++ b/meta/recipes-devtools/gcc/gcc-4.9.inc
@@ -90,6 +90,7 @@ SRC_URI = "\
 file://0072-support-ffile-prefix-map.patch \
 file://0073-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch \
 file://0074-fdebug-prefix-map-support-to-remap-relative-path.patch \
+file://0075-Fix-build-with-gcc-6.patch \
 "
 SRC_URI[md5sum] = "6f831b4d251872736e8e9cc09746f327"
 SRC_URI[sha256sum] = 
"2332b2a5a321b57508b9031354a8503af6fdfb868b8c1748d33028d100a8b67e"
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0075-Fix-build-with-gcc-6.patch 
b/meta/recipes-devtools/gcc/gcc-4.9/0075-Fix-build-with-gcc-6.patch
new file mode 100644
index 000..f865d4f
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0075-Fix-build-with-gcc-6.patch
@@ -0,0 +1,151 @@
+From efdf2b53b907c96ad3f00275588eb311335d0c91 Mon Sep 17 00:00:00 2001
+From: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
+Date: Thu, 12 May 2016 15:24:25 +0300
+Subject: [PATCH] Fix build with gcc 6
+
+* Make-lang.in: Invoke gperf with -L C++.
+* cfns.gperf: Remove prototypes for hash and libc_name_p
+inlines.
+* cfns.h: Regenerated.
+* except.c (nothrow_libfn_p): Adjust.
+
+svn rev: r233572
+
+Upstream-status: Backport [gcc 4.9]
+
+Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
+---
+ gcc/cp/Make-lang.in |  2 +-
+ gcc/cp/cfns.gperf   | 10 ++
+ gcc/cp/cfns.h   | 41 ++---
+ gcc/cp/except.c |  3 ++-
+ 4 files changed, 19 insertions(+), 37 deletions(-)
+
+diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
+index bd1c1d7..a0ea0d4 100644
+--- a/gcc/cp/Make-lang.in
 b/gcc/cp/Make-lang.in
+@@ -111,7 +111,7 @@ else
+ # deleting the $(srcdir)/cp/cfns.h file.
+ $(srcdir)/cp/cfns.h:
+ endif
+-  gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \
++  gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L C++ \
+   $(srcdir)/cp/cfns.gperf --output-file $(srcdir)/cp/cfns.h
+ 
+ #
+diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf
+index 05ca753..d9b16b8 100644
+--- a/gcc/cp/cfns.gperf
 b/gcc/cp/cfns.gperf
+@@ -1,3 +1,5 @@
++%language=C++
++%define class-name libc_name
+ %{
+ /* Copyright (C) 2000-2014 Free Software Foundation, Inc.
+ 
+@@ -16,14 +18,6 @@ for more details.
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+-#ifdef __GNUC__
+-__inline
+-#endif
+-static unsigned int hash (const char *, unsigned int);
+-#ifdef __GNUC__
+-__inline
+-#endif
+-const char * libc_name_p (const char *, unsigned int);
+ %}
+ %%
+ # The standard C library functions, for feeding to gperf; the result is used
+diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h
+index c845ddf..65801d1 100644
+--- a/gcc/cp/cfns.h
 b/gcc/cp/cfns.h
+@@ -1,5 +1,5 @@
+-/* ANSI-C code produced by gperf version 3.0.3 */
+-/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C 
cfns.gperf  */
++/* C++ code produced by gperf version 3.0.4 */
++/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L C++ 
--output-file cfns.h cfns.gperf  */
+ 
+ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+   && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
+@@ -28,7 +28,7 @@
+ #error "gperf generated tables don't work with this execution character set. 
Please report a bug to <bug-gnu-gp...@gnu.org>."
+ #endif
+ 
+-#line 1 "cfns.gperf"
++#line 3 "cfns.gperf"
+ 
+ /* Copyright (C) 2000-2014 Free Software Foundation, Inc.
+ 
+@@ -47,25 +47,18 @@ for more details.
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+-#ifdef __GNUC__
+-__inline
+-#endif
+-static unsigned int hash (const char *, unsigned int);
+-#ifdef __GNUC__
+-__inline
+-#endif
+-const char * libc_name_p (const char *, unsigned int);
+ /* maximum key range = 391, duplicates = 0 */
+ 
+-#ifdef __GNUC__
+-__inline
+-#else
+-#ifdef __cplusplus
+-inline
+-#endif
+-#endif
+-static unsigned int
+-h

Re: [OE-core] [PATCH] gcc-4.9: fix build with gcc 6

2016-05-12 Thread Ioan-Adrian Ratiu
On Thu, 12 May 2016 07:38:00 -0700
Khem Raj <raj.k...@gmail.com> wrote:

> On Thu, May 12, 2016 at 6:12 AM, Ioan-Adrian Ratiu <adrian.ra...@ni.com> 
> wrote:
> > Building gcc-cross 4.9.3 with gcc 6 fails with the following error:
> >
> > error: 'const char* libc_name_p(const char*, unsigned int)' redeclared 
> > inline with 'gnu_inline' attribute
> >
> > This is a backport of the upstream fix.  
> 
> I have seen couple of such patches being proposed. I was of the
> opinion to drop 4.9 from master however if we still want to
> refresh it the I would propose that we change the SRC_URI to point to
> latest on gcc-4_9-branch and remove any backports
> we have done since 4.9.3 release. It can also be merged into krogoth.
> Then we can latest decide if we want to keep 4.9 in
> 2.2 release or not. Would you be able to test such a patch

Actually I'm all for dropping gcc 4 from master. It's about time IMO.

I need this patch to fix the build in krogoth and was just waiting for
feedback on master before I sent this patch there.

I'll resend for krogoth directly then :)

Thank you,
Ioan

> 
> >
> > Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
> > ---
> >  meta/recipes-devtools/gcc/gcc-4.9.inc  |   1 +
> >  .../gcc/gcc-4.9/0076-Fix-build-with-gcc-6.patch| 151 
> > +
> >  2 files changed, 152 insertions(+)
> >  create mode 100644 
> > meta/recipes-devtools/gcc/gcc-4.9/0076-Fix-build-with-gcc-6.patch
> >
> > diff --git a/meta/recipes-devtools/gcc/gcc-4.9.inc 
> > b/meta/recipes-devtools/gcc/gcc-4.9.inc
> > index 208e092..0cd9826 100644
> > --- a/meta/recipes-devtools/gcc/gcc-4.9.inc
> > +++ b/meta/recipes-devtools/gcc/gcc-4.9.inc
> > @@ -91,6 +91,7 @@ SRC_URI = "\
> >  file://0073-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch \
> >  file://0074-fdebug-prefix-map-support-to-remap-relative-path.patch \
> >  file://0075-libgcc-use-ldflags.patch \
> > +file://0076-Fix-build-with-gcc-6.patch \
> >  "
> >  SRC_URI[md5sum] = "6f831b4d251872736e8e9cc09746f327"
> >  SRC_URI[sha256sum] = 
> > "2332b2a5a321b57508b9031354a8503af6fdfb868b8c1748d33028d100a8b67e"
> > diff --git 
> > a/meta/recipes-devtools/gcc/gcc-4.9/0076-Fix-build-with-gcc-6.patch 
> > b/meta/recipes-devtools/gcc/gcc-4.9/0076-Fix-build-with-gcc-6.patch
> > new file mode 100644
> > index 000..f865d4f
> > --- /dev/null
> > +++ b/meta/recipes-devtools/gcc/gcc-4.9/0076-Fix-build-with-gcc-6.patch
> > @@ -0,0 +1,151 @@
> > +From efdf2b53b907c96ad3f00275588eb311335d0c91 Mon Sep 17 00:00:00 2001
> > +From: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
> > +Date: Thu, 12 May 2016 15:24:25 +0300
> > +Subject: [PATCH] Fix build with gcc 6
> > +
> > +* Make-lang.in: Invoke gperf with -L C++.
> > +* cfns.gperf: Remove prototypes for hash and libc_name_p
> > +inlines.
> > +* cfns.h: Regenerated.
> > +* except.c (nothrow_libfn_p): Adjust.
> > +
> > +svn rev: r233572
> > +
> > +Upstream-status: Backport [gcc 4.9]
> > +
> > +Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
> > +---
> > + gcc/cp/Make-lang.in |  2 +-
> > + gcc/cp/cfns.gperf   | 10 ++
> > + gcc/cp/cfns.h   | 41 ++---
> > + gcc/cp/except.c |  3 ++-
> > + 4 files changed, 19 insertions(+), 37 deletions(-)
> > +
> > +diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
> > +index bd1c1d7..a0ea0d4 100644
> > +--- a/gcc/cp/Make-lang.in
> >  b/gcc/cp/Make-lang.in
> > +@@ -111,7 +111,7 @@ else
> > + # deleting the $(srcdir)/cp/cfns.h file.
> > + $(srcdir)/cp/cfns.h:
> > + endif
> > +-  gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \
> > ++  gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L C++ \
> > +   $(srcdir)/cp/cfns.gperf --output-file $(srcdir)/cp/cfns.h
> > +
> > + #
> > +diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf
> > +index 05ca753..d9b16b8 100644
> > +--- a/gcc/cp/cfns.gperf
> >  b/gcc/cp/cfns.gperf
> > +@@ -1,3 +1,5 @@
> > ++%language=C++
> > ++%define class-name libc_name
> > + %{
> > + /* Copyright (C) 2000-2014 Free Software Foundation, Inc.
> > +
> > +@@ -16,14 +18,6 @@ for more details.
> > + You should have received a copy of the GNU General Public License
> > + along with GCC; see the file COPYING3.  If not see
> > + <http://www.gnu.org/licenses/>.  */
> &g

Re: [OE-core] [PATCH 00/42] GCC/GDB/Binutils Upgrades

2016-05-12 Thread Ioan-Adrian Ratiu
On Thu, 12 May 2016 07:19:50 -0700
akuster808 <akuster...@gmail.com> wrote:

> On 05/12/2016 02:05 AM, Ioan-Adrian Ratiu wrote:
> > Hello
> > 
> > Can the gcc 6 fixes be pulled into the krogoth branch as well?  
> 
> GCC 6 is new so we wont be pull that over to Krogoth. Any fixes you are
> interested in, patches are welcome.

I'm not talking about putting gcc 6 inside the krogoth branches, I'm
talking about using gcc 6 on the native system which builds the krogoth
branches, specifically about the patches which fix the -native packages
which are compiled using the native gcc 6.

Khem's patches for master apply cleanly and fix the -native build errors,
I'll pick and resend them for Krogoth if you want, but they are identical.

Ionel

> 
> - armin
> 
> > 
> > On Wed, 11 May 2016 10:35:25 -0700
> > Khem Raj <raj.k...@gmail.com> wrote:
> >   
> >> This patchset covers gcc 6 upgrade along with gdb 7.11
> >> and glibc 2.24 ( upcoming ) release.
> >>
> >> Rest of upgrades are necessaciated by gcc-6 due to backports
> >> that were already in newer versions of packages
> >>
> >> It has been boot tested with core-image-minimal on all qemu
> >> machines
> >>
> >> The following changes since commit 
> >> a5970809a2f01dbd152684266e2a3d946d896620:
> >>
> >>   oeqa/lic-checksum: Update after recent LIC_FILES_CHKSUM changes 
> >> (2016-05-11 10:33:16 +0100)
> >>
> >> are available in the git repository at:
> >>
> >>   git://git.openembedded.org/openembedded-core-contrib kraj/gcc-6
> >>   
> >> http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=kraj/gcc-6
> >>
> >> Dan McGregor (2):
> >>   pkgconfig: Fix build with gcc-6 and upgrade to 0.29.1
> >>   binutils: disable werror on native build
> >>
> >> Khem Raj (39):
> >>   gcc: Add gcc6 recipes
> >>   glibc: Add recipes for 2.24 release
> >>   glib-2.0: Ignore useless warning found with gcc-6
> >>   elfutils: Upgrade to 0.166
> >>   rpm: Fix build with gcc6
> >>   alsa-tools: Fix build with gcc6
> >>   lzop: Fix build with gcc-6
> >>   webkitgtk: Upgrade to 2.12.1
> >>   oprofile: Fix with gcc6
> >>   mdadm: Fix gcc 6 warnings
> >>   nss: Upgrade to 3.23
> >>   grub: Fix build with gcc-6
> >>   valgrind: Fix build with gcc6
> >>   busybox/mdev: Ensure /sys is mounted before using it
> >>   libc-common.bbclass: Use sed instead of grep
> >>   conf: bump minimum kernel to 3.2.0
> >>   systemd: Create missing sysusers offline
> >>   grub_git: Upgrade to latest tip
> >>   libunwind: Upgrade to 1.2rc1+
> >>   linux-yocto: Fix build on ppc with gcc-6
> >>   linux-yocto: Fix build with gcc6 on mips
> >>   python-native: Point to expat in native sysroot
> >>   bitbake.conf: Empty out BUILDSDK_CPPFLAGS
> >>   strace: Remove pipe.expected
> >>   musl: Upgrade to tip of tree
> >>   libgcc: Ensure that gcc configure options are passed to libgcc too
> >>   libunwind: Upgrade to 1.2rc1+
> >>   libgcc: Ensure that gcc configure options are passed to libgcc too
> >>   gdb,strace: Fix builds on ppc/musl
> >>   libunwind: Add a confgure option for tests
> >>   gdb: Upgrade to 7.11
> >>   gdb: Disable binutils components
> >>   tcmode-default: Bump gcc,glibc,gdb
> >>   musl: Create symlinks for stub libraries
> >>   mdadm: Fix build with clang
> >>   distcc: Upgrade to 3.2
> >>   ruby: Upgrade to 2.2.5
> >>   mpfr: Upgrade to 3.1.4
> >>   gcc-runtime,libgcc: Symlink c++ header and startup files in
> >> target_triplet for SDK use
> >>
> >> Marek Vasut (1):
> >>   bitbake: Oldest kernel for nios2 is 3.19
> >>
> >>  meta/classes/cross-canadian.bbclass|1 +
> >>  meta/classes/libc-common.bbclass   |6 +-
> >>  meta/classes/populate_sdk_base.bbclass |2 +-
> >>  meta/conf/bitbake.conf |7 +-
> >>  meta/conf/distro/include/tcmode-default.inc|6 +-
> >>  ...ettext-gettext.c-main_context-secondary_c.patch |   39 +
> >>  meta/recipes-bsp/grub/grub2.inc|1 +
> >>  meta/recipes-bsp/grub/grub_git.bb  |2 +-
> >>  meta/recipes-core/busybox/files/mdev   |4 +-
> >>  .../0001-Do-not-ignore-return-value-of-write.patch |   42 +
> >>  .../glib-2.0/

[OE-core] [PATCH] gcc-4.9: fix build with gcc 6

2016-05-12 Thread Ioan-Adrian Ratiu
Building gcc-cross 4.9.3 with gcc 6 fails with the following error:

error: 'const char* libc_name_p(const char*, unsigned int)' redeclared inline 
with 'gnu_inline' attribute

This is a backport of the upstream fix.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/recipes-devtools/gcc/gcc-4.9.inc  |   1 +
 .../gcc/gcc-4.9/0076-Fix-build-with-gcc-6.patch| 151 +
 2 files changed, 152 insertions(+)
 create mode 100644 
meta/recipes-devtools/gcc/gcc-4.9/0076-Fix-build-with-gcc-6.patch

diff --git a/meta/recipes-devtools/gcc/gcc-4.9.inc 
b/meta/recipes-devtools/gcc/gcc-4.9.inc
index 208e092..0cd9826 100644
--- a/meta/recipes-devtools/gcc/gcc-4.9.inc
+++ b/meta/recipes-devtools/gcc/gcc-4.9.inc
@@ -91,6 +91,7 @@ SRC_URI = "\
 file://0073-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch \
 file://0074-fdebug-prefix-map-support-to-remap-relative-path.patch \
 file://0075-libgcc-use-ldflags.patch \
+file://0076-Fix-build-with-gcc-6.patch \
 "
 SRC_URI[md5sum] = "6f831b4d251872736e8e9cc09746f327"
 SRC_URI[sha256sum] = 
"2332b2a5a321b57508b9031354a8503af6fdfb868b8c1748d33028d100a8b67e"
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0076-Fix-build-with-gcc-6.patch 
b/meta/recipes-devtools/gcc/gcc-4.9/0076-Fix-build-with-gcc-6.patch
new file mode 100644
index 000..f865d4f
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0076-Fix-build-with-gcc-6.patch
@@ -0,0 +1,151 @@
+From efdf2b53b907c96ad3f00275588eb311335d0c91 Mon Sep 17 00:00:00 2001
+From: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
+Date: Thu, 12 May 2016 15:24:25 +0300
+Subject: [PATCH] Fix build with gcc 6
+
+* Make-lang.in: Invoke gperf with -L C++.
+* cfns.gperf: Remove prototypes for hash and libc_name_p
+inlines.
+* cfns.h: Regenerated.
+* except.c (nothrow_libfn_p): Adjust.
+
+svn rev: r233572
+
+Upstream-status: Backport [gcc 4.9]
+
+Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
+---
+ gcc/cp/Make-lang.in |  2 +-
+ gcc/cp/cfns.gperf   | 10 ++
+ gcc/cp/cfns.h   | 41 ++---
+ gcc/cp/except.c |  3 ++-
+ 4 files changed, 19 insertions(+), 37 deletions(-)
+
+diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
+index bd1c1d7..a0ea0d4 100644
+--- a/gcc/cp/Make-lang.in
 b/gcc/cp/Make-lang.in
+@@ -111,7 +111,7 @@ else
+ # deleting the $(srcdir)/cp/cfns.h file.
+ $(srcdir)/cp/cfns.h:
+ endif
+-  gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \
++  gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L C++ \
+   $(srcdir)/cp/cfns.gperf --output-file $(srcdir)/cp/cfns.h
+ 
+ #
+diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf
+index 05ca753..d9b16b8 100644
+--- a/gcc/cp/cfns.gperf
 b/gcc/cp/cfns.gperf
+@@ -1,3 +1,5 @@
++%language=C++
++%define class-name libc_name
+ %{
+ /* Copyright (C) 2000-2014 Free Software Foundation, Inc.
+ 
+@@ -16,14 +18,6 @@ for more details.
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+-#ifdef __GNUC__
+-__inline
+-#endif
+-static unsigned int hash (const char *, unsigned int);
+-#ifdef __GNUC__
+-__inline
+-#endif
+-const char * libc_name_p (const char *, unsigned int);
+ %}
+ %%
+ # The standard C library functions, for feeding to gperf; the result is used
+diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h
+index c845ddf..65801d1 100644
+--- a/gcc/cp/cfns.h
 b/gcc/cp/cfns.h
+@@ -1,5 +1,5 @@
+-/* ANSI-C code produced by gperf version 3.0.3 */
+-/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C 
cfns.gperf  */
++/* C++ code produced by gperf version 3.0.4 */
++/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L C++ 
--output-file cfns.h cfns.gperf  */
+ 
+ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+   && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
+@@ -28,7 +28,7 @@
+ #error "gperf generated tables don't work with this execution character set. 
Please report a bug to <bug-gnu-gp...@gnu.org>."
+ #endif
+ 
+-#line 1 "cfns.gperf"
++#line 3 "cfns.gperf"
+ 
+ /* Copyright (C) 2000-2014 Free Software Foundation, Inc.
+ 
+@@ -47,25 +47,18 @@ for more details.
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+-#ifdef __GNUC__
+-__inline
+-#endif
+-static unsigned int hash (const char *, unsigned int);
+-#ifdef __GNUC__
+-__inline
+-#endif
+-const char * libc_name_p (const char *, unsigned int);
+ /* maximum key range = 391, duplicates = 0 */
+ 
+-#ifdef __GNUC__
+-__inline
+-#else
+-#ifdef __cplusplus
+-inline
+-#endif
+-#endif
+-static unsigned int
+-h

Re: [OE-core] [PATCH 00/42] GCC/GDB/Binutils Upgrades

2016-05-12 Thread Ioan-Adrian Ratiu
Hello

Can the gcc 6 fixes be pulled into the krogoth branch as well?

On Wed, 11 May 2016 10:35:25 -0700
Khem Raj  wrote:

> This patchset covers gcc 6 upgrade along with gdb 7.11
> and glibc 2.24 ( upcoming ) release.
> 
> Rest of upgrades are necessaciated by gcc-6 due to backports
> that were already in newer versions of packages
> 
> It has been boot tested with core-image-minimal on all qemu
> machines
> 
> The following changes since commit a5970809a2f01dbd152684266e2a3d946d896620:
> 
>   oeqa/lic-checksum: Update after recent LIC_FILES_CHKSUM changes (2016-05-11 
> 10:33:16 +0100)
> 
> are available in the git repository at:
> 
>   git://git.openembedded.org/openembedded-core-contrib kraj/gcc-6
>   
> http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=kraj/gcc-6
> 
> Dan McGregor (2):
>   pkgconfig: Fix build with gcc-6 and upgrade to 0.29.1
>   binutils: disable werror on native build
> 
> Khem Raj (39):
>   gcc: Add gcc6 recipes
>   glibc: Add recipes for 2.24 release
>   glib-2.0: Ignore useless warning found with gcc-6
>   elfutils: Upgrade to 0.166
>   rpm: Fix build with gcc6
>   alsa-tools: Fix build with gcc6
>   lzop: Fix build with gcc-6
>   webkitgtk: Upgrade to 2.12.1
>   oprofile: Fix with gcc6
>   mdadm: Fix gcc 6 warnings
>   nss: Upgrade to 3.23
>   grub: Fix build with gcc-6
>   valgrind: Fix build with gcc6
>   busybox/mdev: Ensure /sys is mounted before using it
>   libc-common.bbclass: Use sed instead of grep
>   conf: bump minimum kernel to 3.2.0
>   systemd: Create missing sysusers offline
>   grub_git: Upgrade to latest tip
>   libunwind: Upgrade to 1.2rc1+
>   linux-yocto: Fix build on ppc with gcc-6
>   linux-yocto: Fix build with gcc6 on mips
>   python-native: Point to expat in native sysroot
>   bitbake.conf: Empty out BUILDSDK_CPPFLAGS
>   strace: Remove pipe.expected
>   musl: Upgrade to tip of tree
>   libgcc: Ensure that gcc configure options are passed to libgcc too
>   libunwind: Upgrade to 1.2rc1+
>   libgcc: Ensure that gcc configure options are passed to libgcc too
>   gdb,strace: Fix builds on ppc/musl
>   libunwind: Add a confgure option for tests
>   gdb: Upgrade to 7.11
>   gdb: Disable binutils components
>   tcmode-default: Bump gcc,glibc,gdb
>   musl: Create symlinks for stub libraries
>   mdadm: Fix build with clang
>   distcc: Upgrade to 3.2
>   ruby: Upgrade to 2.2.5
>   mpfr: Upgrade to 3.1.4
>   gcc-runtime,libgcc: Symlink c++ header and startup files in
> target_triplet for SDK use
> 
> Marek Vasut (1):
>   bitbake: Oldest kernel for nios2 is 3.19
> 
>  meta/classes/cross-canadian.bbclass|1 +
>  meta/classes/libc-common.bbclass   |6 +-
>  meta/classes/populate_sdk_base.bbclass |2 +-
>  meta/conf/bitbake.conf |7 +-
>  meta/conf/distro/include/tcmode-default.inc|6 +-
>  ...ettext-gettext.c-main_context-secondary_c.patch |   39 +
>  meta/recipes-bsp/grub/grub2.inc|1 +
>  meta/recipes-bsp/grub/grub_git.bb  |2 +-
>  meta/recipes-core/busybox/files/mdev   |4 +-
>  .../0001-Do-not-ignore-return-value-of-write.patch |   42 +
>  .../glib-2.0/0002-tests-Ignore-y2k-warnings.patch  |   42 +
>  .../ignore-format-nonliteral-warning.patch |   39 +
>  meta/recipes-core/glib-2.0/glib-2.0_2.46.2.bb  |7 +-
>  .../fix_for_centos_5.8.patch   |   18 -
>  ...tive_2.23.bb => cross-localedef-native_2.24.bb} |   26 +-
>  ...glibc-initial_2.23.bb => glibc-initial_2.24.bb} |0
>  .../{glibc-locale_2.23.bb => glibc-locale_2.24.bb} |0
>  .../{glibc-mtrace_2.23.bb => glibc-mtrace_2.24.bb} |0
>  ...glibc-scripts_2.23.bb => glibc-scripts_2.24.bb} |0
>  ...libc-Look-for-host-system-ld.so.cache-as-.patch |8 +-
>  ...libc-Fix-buffer-overrun-with-a-relocated-.patch |8 +-
>  ...libc-Raise-the-size-of-arrays-containing-.patch |   34 +-
>  ...ivesdk-glibc-Allow-64-bit-atomics-for-x86.patch |   10 +-
>  ...500-e5500-e6500-603e-fsqrt-implementation.patch |6 +-
>  ...-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch |8 +-
>  ...-Fix-undefined-reference-to-__sqrt_finite.patch |6 +-
>  ...qrt-f-are-now-inline-functions-and-call-o.patch |6 +-
>  ...bug-1443-which-explains-what-the-patch-do.patch |8 +-
>  ...n-libm-err-tab.pl-with-specific-dirs-in-S.patch |   10 +-
>  ...qrt-f-are-now-inline-functions-and-call-o.patch |6 +-
>  ...ersion-output-matching-grok-gold-s-output.patch |   14 +-
>  ...-configure.ac-handle-correctly-libc_cv_ro.patch |6 +-
>  .../glibc/glibc/0014-Add-unused-attribute.patch|8 +-
>  ...thin-the-path-sets-wrong-config-variables.patch |   10 +-
>  ...-timezone-re-written-tzselect-as-posix-sh.patch |   16 +-
>  ...move-bash-dependency-for-nscd-init-script.patch |8 +-
>  ...c-Cross-building-and-testing-instructions.patch |6 +-
>  

[OE-core] [PATCH v3 2/2] wic: isoimage-isohybrid: fix splash file paths

2016-04-21 Thread Ioan-Adrian Ratiu
os.path.join discards the cr_workdir var contents if the path of the
second arguments is absolute.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py 
b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
index 8440581..ed59d85 100644
--- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
+++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -60,7 +60,7 @@ class IsoImagePlugin(SourcePlugin):
 """
 Create loader-specific (syslinux) config
 """
-splash = os.path.join(cr_workdir, "/ISO/boot/splash.jpg")
+splash = os.path.join(cr_workdir, "ISO/boot/splash.jpg")
 if os.path.exists(splash):
 splashline = "menu background splash.jpg"
 else:
@@ -105,7 +105,7 @@ class IsoImagePlugin(SourcePlugin):
 msger.error("configfile is specified but failed to "
 "get it from %s." % configfile)
 else:
-splash = os.path.join(cr_workdir, "/EFI/boot/splash.jpg")
+splash = os.path.join(cr_workdir, "EFI/boot/splash.jpg")
 if os.path.exists(splash):
 splashline = "menu background splash.jpg"
 else:
-- 
2.8.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v3 1/2] wic: isoimage-isohybrid: add grubefi configfile support

2016-04-21 Thread Ioan-Adrian Ratiu
The latest wic kickstart refactoring introduced a bootloader option
"--configfile" which lets wks' specify a custom grub.cfg for use
while booting. This is very useful for creating stuff like boot menus.

This change lets isoimage-isohybrid use --configfile; if this option is
not specified in a wks, it generates a default cfg as before.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 .../lib/wic/plugins/source/isoimage-isohybrid.py   | 53 +-
 1 file changed, 32 insertions(+), 21 deletions(-)

diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py 
b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
index bc99283..8440581 100644
--- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
+++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -27,6 +27,7 @@ import glob
 
 from wic import msger
 from wic.pluginbase import SourcePlugin
+from wic.utils.misc import get_custom_config
 from wic.utils.oe.misc import exec_cmd, exec_native_cmd, get_bitbake_var
 
 class IsoImagePlugin(SourcePlugin):
@@ -94,33 +95,43 @@ class IsoImagePlugin(SourcePlugin):
 """
 Create loader-specific (grub-efi) config
 """
-splash = os.path.join(cr_workdir, "/EFI/boot/splash.jpg")
-if os.path.exists(splash):
-splashline = "menu background splash.jpg"
+configfile = creator.ks.bootloader.configfile
+if configfile:
+grubefi_conf = get_custom_config(configfile)
+if grubefi_conf:
+msger.debug("Using custom configuration file "
+"%s for grub.cfg" % configfile)
+else:
+msger.error("configfile is specified but failed to "
+"get it from %s." % configfile)
 else:
-splashline = ""
+splash = os.path.join(cr_workdir, "/EFI/boot/splash.jpg")
+if os.path.exists(splash):
+splashline = "menu background splash.jpg"
+else:
+splashline = ""
 
-bootloader = creator.ks.bootloader
+bootloader = creator.ks.bootloader
 
-grubefi_conf = ""
-grubefi_conf += "serial --unit=0 --speed=115200 --word=8 "
-grubefi_conf += "--parity=no --stop=1\n"
-grubefi_conf += "default=boot\n"
-grubefi_conf += "timeout=%s\n" % (bootloader.timeout or 10)
-grubefi_conf += "\n"
-grubefi_conf += "search --set=root --label %s " % part.label
-grubefi_conf += "\n"
-grubefi_conf += "menuentry 'boot'{\n"
+grubefi_conf = ""
+grubefi_conf += "serial --unit=0 --speed=115200 --word=8 "
+grubefi_conf += "--parity=no --stop=1\n"
+grubefi_conf += "default=boot\n"
+grubefi_conf += "timeout=%s\n" % (bootloader.timeout or 10)
+grubefi_conf += "\n"
+grubefi_conf += "search --set=root --label %s " % part.label
+grubefi_conf += "\n"
+grubefi_conf += "menuentry 'boot'{\n"
 
-kernel = "/bzImage"
+kernel = "/bzImage"
 
-grubefi_conf += "linux %s rootwait %s\n" \
-% (kernel, bootloader.append)
-grubefi_conf += "initrd /initrd \n"
-grubefi_conf += "}\n"
+grubefi_conf += "linux %s rootwait %s\n" \
+% (kernel, bootloader.append)
+grubefi_conf += "initrd /initrd \n"
+grubefi_conf += "}\n"
 
-if splashline:
-grubefi_conf += "%s\n" % splashline
+if splashline:
+grubefi_conf += "%s\n" % splashline
 
 msger.debug("Writing grubefi config %s/EFI/BOOT/grub.cfg" \
 % cr_workdir)
-- 
2.8.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] wic: isoimage-isohybrid: add grubefi configfile support

2016-04-21 Thread Ioan-Adrian Ratiu
On Thu, 21 Apr 2016 10:03:31 +0300
Ed Bartosh <ed.bart...@linux.intel.com> wrote:

> On Wed, Apr 20, 2016 at 06:08:38PM +0300, Ioan-Adrian Ratiu wrote:
> > I forgot to mention this is v2... sorry.
> > 
> > On Wed, 20 Apr 2016 18:06:15 +0300
> > Ioan-Adrian Ratiu <adrian.ra...@ni.com> wrote:
> >   
> > > The latest wic kickstart refactoring introduced a bootloader option
> > > "--configfile" which lets wks' specify a custom grub.cfg for use
> > > while booting. This is very useful for creating stuff like boot menus.
> > > 
> > > This change lets isoimage-isohybrid use --configfile; if this option is
> > > not specified in a wks, it generates a default cfg as before.
> > > 
> > > Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
> > > ---
> > >  .../lib/wic/plugins/source/isoimage-isohybrid.py   | 53 
> > > +-
> > >  1 file changed, 32 insertions(+), 21 deletions(-)
> > > 
> > > diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py 
> > > b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
> > > index bc99283..8440581 100644
> > > --- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
> > > +++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
> > > @@ -27,6 +27,7 @@ import glob
> > >  
> > >  from wic import msger
> > >  from wic.pluginbase import SourcePlugin
> > > +from wic.utils.misc import get_custom_config
> > >  from wic.utils.oe.misc import exec_cmd, exec_native_cmd, get_bitbake_var
> > >  
> > >  class IsoImagePlugin(SourcePlugin):
> > > @@ -94,33 +95,43 @@ class IsoImagePlugin(SourcePlugin):
> > >  """
> > >  Create loader-specific (grub-efi) config
> > >  """
> > > -splash = os.path.join(cr_workdir, "/EFI/boot/splash.jpg")
> > > -if os.path.exists(splash):
> > > -splashline = "menu background splash.jpg"
> > > +configfile = creator.ks.bootloader.configfile
> > > +if configfile:
> > > +grubefi_conf = get_custom_config(configfile)
> > > +if grubefi_conf:
> > > +msger.debug("Using custom configuration file "
> > > +"%s for grub.cfg" % configfile)
> > > +else:
> > > +msger.error("configfile is specified but failed to "
> > > +"get it from %s." % configfile)
> > >  else:
> > > -splashline = ""
> > > +splash = os.path.join(cr_workdir, "/EFI/boot/splash.jpg")  
> I know, it's not your code, but it looks like the result path(splash
> variable) will not include workdir. Look:
> 
> In [2]: os.path.join('/path/to/workdir', '/EFI/boot/splash.jpg')
> Out[2]: '/EFI/boot/splash.jpg'
> 
> In [3]: os.path.join('/path/to/workdir/', '/EFI/boot/splash.jpg')
> Out[3]: '/EFI/boot/splash.jpg'
> 
> It works this way:
> In [4]: os.path.join('/path/to/workdir/', 'EFI/boot/splash.jpg')
> Out[4]: '/path/to/workdir/EFI/boot/splash.jpg'
> 

Thanks for spotting this. I'll send another patch to fix it.

Ioan

> > > +if os.path.exists(splash):
> > > +splashline = "menu background splash.jpg"
> > > +else:
> > > +splashline = ""
> > >  
> > > -bootloader = creator.ks.bootloader
> > > +bootloader = creator.ks.bootloader
> > >  
> > > -grubefi_conf = ""
> > > -grubefi_conf += "serial --unit=0 --speed=115200 --word=8 "
> > > -grubefi_conf += "--parity=no --stop=1\n"
> > > -grubefi_conf += "default=boot\n"
> > > -grubefi_conf += "timeout=%s\n" % (bootloader.timeout or 10)
> > > -grubefi_conf += "\n"
> > > -grubefi_conf += "search --set=root --label %s " % part.label
> > > -grubefi_conf += "\n"
> > > -grubefi_conf += "menuentry 'boot'{\n"
> > > +grubefi_conf = ""
> > > +grubefi_conf += "serial --unit=0 --speed=115200 --word=8 "
> > > +grubefi_conf += "--parity=no --stop=1\n"
> > > +grubefi_conf += "default=boot\n"
> > > + 

Re: [OE-core] [PATCH] wic: isoimage-isohybrid: add grubefi configfile support

2016-04-20 Thread Ioan-Adrian Ratiu
I forgot to mention this is v2... sorry.

On Wed, 20 Apr 2016 18:06:15 +0300
Ioan-Adrian Ratiu <adrian.ra...@ni.com> wrote:

> The latest wic kickstart refactoring introduced a bootloader option
> "--configfile" which lets wks' specify a custom grub.cfg for use
> while booting. This is very useful for creating stuff like boot menus.
> 
> This change lets isoimage-isohybrid use --configfile; if this option is
> not specified in a wks, it generates a default cfg as before.
> 
> Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
> ---
>  .../lib/wic/plugins/source/isoimage-isohybrid.py   | 53 
> +-
>  1 file changed, 32 insertions(+), 21 deletions(-)
> 
> diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py 
> b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
> index bc99283..8440581 100644
> --- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
> +++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
> @@ -27,6 +27,7 @@ import glob
>  
>  from wic import msger
>  from wic.pluginbase import SourcePlugin
> +from wic.utils.misc import get_custom_config
>  from wic.utils.oe.misc import exec_cmd, exec_native_cmd, get_bitbake_var
>  
>  class IsoImagePlugin(SourcePlugin):
> @@ -94,33 +95,43 @@ class IsoImagePlugin(SourcePlugin):
>  """
>  Create loader-specific (grub-efi) config
>  """
> -splash = os.path.join(cr_workdir, "/EFI/boot/splash.jpg")
> -if os.path.exists(splash):
> -splashline = "menu background splash.jpg"
> +configfile = creator.ks.bootloader.configfile
> +if configfile:
> +grubefi_conf = get_custom_config(configfile)
> +if grubefi_conf:
> +msger.debug("Using custom configuration file "
> +"%s for grub.cfg" % configfile)
> +else:
> +msger.error("configfile is specified but failed to "
> +"get it from %s." % configfile)
>  else:
> -splashline = ""
> +splash = os.path.join(cr_workdir, "/EFI/boot/splash.jpg")
> +if os.path.exists(splash):
> +splashline = "menu background splash.jpg"
> +else:
> +splashline = ""
>  
> -bootloader = creator.ks.bootloader
> +bootloader = creator.ks.bootloader
>  
> -grubefi_conf = ""
> -grubefi_conf += "serial --unit=0 --speed=115200 --word=8 "
> -grubefi_conf += "--parity=no --stop=1\n"
> -grubefi_conf += "default=boot\n"
> -grubefi_conf += "timeout=%s\n" % (bootloader.timeout or 10)
> -grubefi_conf += "\n"
> -grubefi_conf += "search --set=root --label %s " % part.label
> -grubefi_conf += "\n"
> -grubefi_conf += "menuentry 'boot'{\n"
> +grubefi_conf = ""
> +grubefi_conf += "serial --unit=0 --speed=115200 --word=8 "
> +grubefi_conf += "--parity=no --stop=1\n"
> +grubefi_conf += "default=boot\n"
> +grubefi_conf += "timeout=%s\n" % (bootloader.timeout or 10)
> +grubefi_conf += "\n"
> +grubefi_conf += "search --set=root --label %s " % part.label
> +grubefi_conf += "\n"
> +grubefi_conf += "menuentry 'boot'{\n"
>  
> -kernel = "/bzImage"
> +kernel = "/bzImage"
>  
> -grubefi_conf += "linux %s rootwait %s\n" \
> -% (kernel, bootloader.append)
> -grubefi_conf += "initrd /initrd \n"
> -grubefi_conf += "}\n"
> +grubefi_conf += "linux %s rootwait %s\n" \
> +% (kernel, bootloader.append)
> +grubefi_conf += "initrd /initrd \n"
> +grubefi_conf += "}\n"
>  
> -if splashline:
> -grubefi_conf += "%s\n" % splashline
> +if splashline:
> +grubefi_conf += "%s\n" % splashline
>  
>  msger.debug("Writing grubefi config %s/EFI/BOOT/grub.cfg" \
>  % cr_workdir)

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] wic: isoimage-isohybrid: add grubefi configfile support

2016-04-20 Thread Ioan-Adrian Ratiu
The latest wic kickstart refactoring introduced a bootloader option
"--configfile" which lets wks' specify a custom grub.cfg for use
while booting. This is very useful for creating stuff like boot menus.

This change lets isoimage-isohybrid use --configfile; if this option is
not specified in a wks, it generates a default cfg as before.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 .../lib/wic/plugins/source/isoimage-isohybrid.py   | 53 +-
 1 file changed, 32 insertions(+), 21 deletions(-)

diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py 
b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
index bc99283..8440581 100644
--- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
+++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -27,6 +27,7 @@ import glob
 
 from wic import msger
 from wic.pluginbase import SourcePlugin
+from wic.utils.misc import get_custom_config
 from wic.utils.oe.misc import exec_cmd, exec_native_cmd, get_bitbake_var
 
 class IsoImagePlugin(SourcePlugin):
@@ -94,33 +95,43 @@ class IsoImagePlugin(SourcePlugin):
 """
 Create loader-specific (grub-efi) config
 """
-splash = os.path.join(cr_workdir, "/EFI/boot/splash.jpg")
-if os.path.exists(splash):
-splashline = "menu background splash.jpg"
+configfile = creator.ks.bootloader.configfile
+if configfile:
+grubefi_conf = get_custom_config(configfile)
+if grubefi_conf:
+msger.debug("Using custom configuration file "
+"%s for grub.cfg" % configfile)
+else:
+msger.error("configfile is specified but failed to "
+"get it from %s." % configfile)
 else:
-splashline = ""
+splash = os.path.join(cr_workdir, "/EFI/boot/splash.jpg")
+if os.path.exists(splash):
+splashline = "menu background splash.jpg"
+else:
+splashline = ""
 
-bootloader = creator.ks.bootloader
+bootloader = creator.ks.bootloader
 
-grubefi_conf = ""
-grubefi_conf += "serial --unit=0 --speed=115200 --word=8 "
-grubefi_conf += "--parity=no --stop=1\n"
-grubefi_conf += "default=boot\n"
-grubefi_conf += "timeout=%s\n" % (bootloader.timeout or 10)
-grubefi_conf += "\n"
-grubefi_conf += "search --set=root --label %s " % part.label
-grubefi_conf += "\n"
-grubefi_conf += "menuentry 'boot'{\n"
+grubefi_conf = ""
+grubefi_conf += "serial --unit=0 --speed=115200 --word=8 "
+grubefi_conf += "--parity=no --stop=1\n"
+grubefi_conf += "default=boot\n"
+grubefi_conf += "timeout=%s\n" % (bootloader.timeout or 10)
+grubefi_conf += "\n"
+grubefi_conf += "search --set=root --label %s " % part.label
+grubefi_conf += "\n"
+grubefi_conf += "menuentry 'boot'{\n"
 
-kernel = "/bzImage"
+kernel = "/bzImage"
 
-grubefi_conf += "linux %s rootwait %s\n" \
-% (kernel, bootloader.append)
-grubefi_conf += "initrd /initrd \n"
-grubefi_conf += "}\n"
+grubefi_conf += "linux %s rootwait %s\n" \
+% (kernel, bootloader.append)
+grubefi_conf += "initrd /initrd \n"
+grubefi_conf += "}\n"
 
-if splashline:
-grubefi_conf += "%s\n" % splashline
+if splashline:
+grubefi_conf += "%s\n" % splashline
 
 msger.debug("Writing grubefi config %s/EFI/BOOT/grub.cfg" \
 % cr_workdir)
-- 
2.8.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] wic: isoimage-isohybrid: add grubefi configfile support

2016-04-20 Thread Ioan-Adrian Ratiu
The latest wic kickstart refactoring introduced a bootloader option
"--configfile" which lets wks' specify a custom grub.cfg for use
while booting. This is very useful for creating stuff like boot menus.

This change lets isoimage-isohybrid use --configfile; if this option is
not specified in a wks, it generates a default cfg as before.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 .../lib/wic/plugins/source/isoimage-isohybrid.py   | 59 ++
 1 file changed, 37 insertions(+), 22 deletions(-)

diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py 
b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
index bc99283..37d2fc2 100644
--- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
+++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -27,6 +27,7 @@ import glob
 
 from wic import msger
 from wic.pluginbase import SourcePlugin
+from wic.utils.misc import get_custom_config
 from wic.utils.oe.misc import exec_cmd, exec_native_cmd, get_bitbake_var
 
 class IsoImagePlugin(SourcePlugin):
@@ -94,33 +95,47 @@ class IsoImagePlugin(SourcePlugin):
 """
 Create loader-specific (grub-efi) config
 """
-splash = os.path.join(cr_workdir, "/EFI/boot/splash.jpg")
-if os.path.exists(splash):
-splashline = "menu background splash.jpg"
-else:
-splashline = ""
+configfile = creator.ks.bootloader.configfile
+custom_cfg = None
+if configfile:
+custom_cfg = get_custom_config(configfile)
+if custom_cfg:
+# Use a custom configuration for grub
+grubefi_conf = custom_cfg
+msger.debug("Using custom configuration file "
+"%s for grub.cfg" % configfile)
+else:
+msger.error("configfile is specified but failed to "
+"get it from %s." % configfile)
 
-bootloader = creator.ks.bootloader
+if not custom_cfg:
+splash = os.path.join(cr_workdir, "/EFI/boot/splash.jpg")
+if os.path.exists(splash):
+splashline = "menu background splash.jpg"
+else:
+splashline = ""
 
-grubefi_conf = ""
-grubefi_conf += "serial --unit=0 --speed=115200 --word=8 "
-grubefi_conf += "--parity=no --stop=1\n"
-grubefi_conf += "default=boot\n"
-grubefi_conf += "timeout=%s\n" % (bootloader.timeout or 10)
-grubefi_conf += "\n"
-grubefi_conf += "search --set=root --label %s " % part.label
-grubefi_conf += "\n"
-grubefi_conf += "menuentry 'boot'{\n"
+bootloader = creator.ks.bootloader
 
-kernel = "/bzImage"
+grubefi_conf = ""
+grubefi_conf += "serial --unit=0 --speed=115200 --word=8 "
+grubefi_conf += "--parity=no --stop=1\n"
+grubefi_conf += "default=boot\n"
+grubefi_conf += "timeout=%s\n" % (bootloader.timeout or 10)
+grubefi_conf += "\n"
+grubefi_conf += "search --set=root --label %s " % part.label
+grubefi_conf += "\n"
+grubefi_conf += "menuentry 'boot'{\n"
 
-grubefi_conf += "linux %s rootwait %s\n" \
-% (kernel, bootloader.append)
-grubefi_conf += "initrd /initrd \n"
-grubefi_conf += "}\n"
+kernel = "/bzImage"
 
-if splashline:
-grubefi_conf += "%s\n" % splashline
+grubefi_conf += "linux %s rootwait %s\n" \
+% (kernel, bootloader.append)
+grubefi_conf += "initrd /initrd \n"
+grubefi_conf += "}\n"
+
+if splashline:
+grubefi_conf += "%s\n" % splashline
 
 msger.debug("Writing grubefi config %s/EFI/BOOT/grub.cfg" \
 % cr_workdir)
-- 
2.8.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] wic: isoimage-isohybrid: implement grubefi menu logic

2016-04-20 Thread Ioan-Adrian Ratiu
Hello Ed,

I've looked a little at the wic rewrites in master and they're really really 
awesome!

Just to verify if I understood correctly: Now if I want custom menus in grub I
can specify them directly in a custom .cfg supplied in the wks by the 
"configfile"
bootloader option, so there's no need anymore for that "--menu" option + all the
ugly string parsing code from my previous patch.

Is this correct?

Thank you,
Ioan

On Tue, 19 Apr 2016 13:15:36 +0300
Ed Bartosh <ed.bart...@linux.intel.com> wrote:

> Hi Ioan-Adrian,
> 
> It's my fault as I've rewritten ks parser and missed --menu implementation.
> Let me know if you need my help with this.
> 
> It would be great if you also add test case for this feature to wic 
> oe-selftest suite.
> 
> Regards,
> Ed
> 
> On Tue, Apr 19, 2016 at 03:17:56PM +0300, Ioan-Adrian Ratiu wrote:
> > Hello Ed,
> > 
> > I've tested it on Jethro. Sorry about this. I'll look at the changes in 
> > wic's kickstart and redo/resubmit.
> > 
> > Thank you,
> > Ioan
> > 
> > On Mon, 18 Apr 2016 16:24:11 +0300
> > Ed Bartosh <ed.bart...@linux.intel.com> wrote:
> >   
> > > Hi Ioan-Adrian,
> > > 
> > > Did you test if this patch works on master?
> > > From the first look I'd say it will not work as --menu bootloader
> > > option is not implemented there.
> > > 
> > > On Mon, Apr 18, 2016 at 03:46:22PM +0300, Ioan-Adrian Ratiu wrote:  
> > > > Right now isoimage-isohybrid creates a single boot menu entry "boot"
> > > > and passes it the arguments supplied with "--append". There is logic
> > > > for creating custom grub menus, but it is sadly not used. "boot" is
> > > > hardcoded.
> > > > 
> > > > This change makes isoimage use the wic bootloader "--menu" argument to
> > > > create its menus. The syntax used for menu specification was chosen so
> > > > it does not conflict with the kernel parameter syntax (you can pass
> > > > custom kernel arguments from the generated grub menu entries, like for
> > > > example silent booting, thread affinity etc.).
> > > > 
> > > > The "--menu" argument syntax is as following. The argument supplies a
> > > > collection of menu entry names and kernel parameters. Menu name entries
> > > > can contain any ASCII character except | or : which are separators.
> > > > Kernel parameters obey the syntax defined by the kernel documentation.
> > > > | is the menu separator and : is the separator between the menu names
> > > > and parameters.
> > > > 
> > > > Example for use in wks files:
> > > >   --menu "Menu Name:firstarg,secondard|Menu Name 2:anotherarg,otherarg"
> > > > 
> > > > Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
> > > > ---
> > > >  .../lib/wic/plugins/source/isoimage-isohybrid.py   | 35 
> > > > --
> > > >  1 file changed, 26 insertions(+), 9 deletions(-)
> > > > 
> > > > diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py 
> > > > b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
> > > > index bc99283..4b0b035 100644
> > > > --- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
> > > > +++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
> > > > @@ -101,23 +101,40 @@ class IsoImagePlugin(SourcePlugin):
> > > >  splashline = ""
> > > >  
> > > >  bootloader = creator.ks.bootloader
> > > > +kernel = "/bzImage"
> > > > +default_options = bootloader.append
> > > > +default_menu_to_boot = "Default boot"
> > > > +grub_menus = ""
> > > > +
> > > > +# menu separators are '|', custom boot args separated by ':', 
> > > > ex.
> > > > +# --menu "Menu Name:firstarg,secondard|Menu Name 
> > > > 2:anotherarg,otherarg"
> > > > +for menu in bootloader.menus.split('|'):
> > > > +menu_list = menu.split(":")
> > > > +menu_name = menu_list[0]
> > > > +grub_menu_options = ""
> > > > +
> > > > +if (len(menu_list) > 1):
> > > > +menu_params = menu_list[1]
> > > > +for param in menu_params.split(','):

Re: [OE-core] [PATCH] wic: isoimage-isohybrid: implement grubefi menu logic

2016-04-19 Thread Ioan-Adrian Ratiu
Hello Ed,

I've tested it on Jethro. Sorry about this. I'll look at the changes in wic's 
kickstart and redo/resubmit.

Thank you,
Ioan

On Mon, 18 Apr 2016 16:24:11 +0300
Ed Bartosh <ed.bart...@linux.intel.com> wrote:

> Hi Ioan-Adrian,
> 
> Did you test if this patch works on master?
> From the first look I'd say it will not work as --menu bootloader
> option is not implemented there.
> 
> On Mon, Apr 18, 2016 at 03:46:22PM +0300, Ioan-Adrian Ratiu wrote:
> > Right now isoimage-isohybrid creates a single boot menu entry "boot"
> > and passes it the arguments supplied with "--append". There is logic
> > for creating custom grub menus, but it is sadly not used. "boot" is
> > hardcoded.
> > 
> > This change makes isoimage use the wic bootloader "--menu" argument to
> > create its menus. The syntax used for menu specification was chosen so
> > it does not conflict with the kernel parameter syntax (you can pass
> > custom kernel arguments from the generated grub menu entries, like for
> > example silent booting, thread affinity etc.).
> > 
> > The "--menu" argument syntax is as following. The argument supplies a
> > collection of menu entry names and kernel parameters. Menu name entries
> > can contain any ASCII character except | or : which are separators.
> > Kernel parameters obey the syntax defined by the kernel documentation.
> > | is the menu separator and : is the separator between the menu names
> > and parameters.
> > 
> > Example for use in wks files:
> >   --menu "Menu Name:firstarg,secondard|Menu Name 2:anotherarg,otherarg"
> > 
> > Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
> > ---
> >  .../lib/wic/plugins/source/isoimage-isohybrid.py   | 35 
> > --
> >  1 file changed, 26 insertions(+), 9 deletions(-)
> > 
> > diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py 
> > b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
> > index bc99283..4b0b035 100644
> > --- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
> > +++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
> > @@ -101,23 +101,40 @@ class IsoImagePlugin(SourcePlugin):
> >  splashline = ""
> >  
> >  bootloader = creator.ks.bootloader
> > +kernel = "/bzImage"
> > +default_options = bootloader.append
> > +default_menu_to_boot = "Default boot"
> > +grub_menus = ""
> > +
> > +# menu separators are '|', custom boot args separated by ':', ex.
> > +# --menu "Menu Name:firstarg,secondard|Menu Name 
> > 2:anotherarg,otherarg"
> > +for menu in bootloader.menus.split('|'):
> > +menu_list = menu.split(":")
> > +menu_name = menu_list[0]
> > +grub_menu_options = ""
> > +
> > +if (len(menu_list) > 1):
> > +menu_params = menu_list[1]
> > +for param in menu_params.split(','):
> > +if param.lower() == "default":
> > +default_menu_to_boot = menu_name
> > +else: grub_menu_options += " " + param
> > +
> > +grub_menus += "menuentry '%s' {\n" % menu_name
> > +grub_menus += "linux %s rootwait %s %s\n" % \
> > +(kernel, default_options, grub_menu_options)
> > +grub_menus += "initrd /initrd \n"
> > +grub_menus += "}\n"
> >  
> >  grubefi_conf = ""
> >  grubefi_conf += "serial --unit=0 --speed=115200 --word=8 "
> >  grubefi_conf += "--parity=no --stop=1\n"
> > -grubefi_conf += "default=boot\n"
> > +grubefi_conf += "default=%s\n" % default_menu_to_boot
> >  grubefi_conf += "timeout=%s\n" % (bootloader.timeout or 10)
> >  grubefi_conf += "\n"
> >  grubefi_conf += "search --set=root --label %s " % part.label
> >  grubefi_conf += "\n"
> > -grubefi_conf += "menuentry 'boot'{\n"
> > -
> > -kernel = "/bzImage"
> > -
> > -grubefi_conf += "linux %s rootwait %s\n" \
> > -% (kernel, bootloader.append)
> > -grubefi_conf += "initrd /initrd \n"
> > -grubefi_conf += "}\n"
> > +grubefi_conf += grub_menus
> >  
> >  if splashline:
> >  grubefi_conf += "%s\n" % splashline  
> 
> --
> Regards,
> Ed

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] wic: isoimage-isohybrid: implement grubefi menu logic

2016-04-18 Thread Ioan-Adrian Ratiu
Right now isoimage-isohybrid creates a single boot menu entry "boot"
and passes it the arguments supplied with "--append". There is logic
for creating custom grub menus, but it is sadly not used. "boot" is
hardcoded.

This change makes isoimage use the wic bootloader "--menu" argument to
create its menus. The syntax used for menu specification was chosen so
it does not conflict with the kernel parameter syntax (you can pass
custom kernel arguments from the generated grub menu entries, like for
example silent booting, thread affinity etc.).

The "--menu" argument syntax is as following. The argument supplies a
collection of menu entry names and kernel parameters. Menu name entries
can contain any ASCII character except | or : which are separators.
Kernel parameters obey the syntax defined by the kernel documentation.
| is the menu separator and : is the separator between the menu names
and parameters.

Example for use in wks files:
  --menu "Menu Name:firstarg,secondard|Menu Name 2:anotherarg,otherarg"

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 .../lib/wic/plugins/source/isoimage-isohybrid.py   | 35 --
 1 file changed, 26 insertions(+), 9 deletions(-)

diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py 
b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
index bc99283..4b0b035 100644
--- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
+++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -101,23 +101,40 @@ class IsoImagePlugin(SourcePlugin):
 splashline = ""
 
 bootloader = creator.ks.bootloader
+kernel = "/bzImage"
+default_options = bootloader.append
+default_menu_to_boot = "Default boot"
+grub_menus = ""
+
+# menu separators are '|', custom boot args separated by ':', ex.
+# --menu "Menu Name:firstarg,secondard|Menu Name 2:anotherarg,otherarg"
+for menu in bootloader.menus.split('|'):
+menu_list = menu.split(":")
+menu_name = menu_list[0]
+grub_menu_options = ""
+
+if (len(menu_list) > 1):
+menu_params = menu_list[1]
+for param in menu_params.split(','):
+if param.lower() == "default":
+default_menu_to_boot = menu_name
+else: grub_menu_options += " " + param
+
+grub_menus += "menuentry '%s' {\n" % menu_name
+grub_menus += "linux %s rootwait %s %s\n" % \
+(kernel, default_options, grub_menu_options)
+grub_menus += "initrd /initrd \n"
+grub_menus += "}\n"
 
 grubefi_conf = ""
 grubefi_conf += "serial --unit=0 --speed=115200 --word=8 "
 grubefi_conf += "--parity=no --stop=1\n"
-grubefi_conf += "default=boot\n"
+grubefi_conf += "default=%s\n" % default_menu_to_boot
 grubefi_conf += "timeout=%s\n" % (bootloader.timeout or 10)
 grubefi_conf += "\n"
 grubefi_conf += "search --set=root --label %s " % part.label
 grubefi_conf += "\n"
-grubefi_conf += "menuentry 'boot'{\n"
-
-kernel = "/bzImage"
-
-grubefi_conf += "linux %s rootwait %s\n" \
-% (kernel, bootloader.append)
-grubefi_conf += "initrd /initrd \n"
-grubefi_conf += "}\n"
+grubefi_conf += grub_menus
 
 if splashline:
 grubefi_conf += "%s\n" % splashline
-- 
2.8.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 1/2] isoimage-isohybrid.py: use glob to find initramfs location

2016-04-01 Thread Ioan-Adrian Ratiu
Some filenames can omit 'initramfs', or use other names. This makes
detection more flexible by using only the image name, machine arch and
image type in a glob wildcard.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py 
b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
index 31dc9b6..de99ad8 100644
--- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
+++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -23,6 +23,7 @@
 import os
 import re
 import shutil
+import glob
 
 from wic import msger
 from wic.pluginbase import SourcePlugin
@@ -150,8 +151,7 @@ class IsoImagePlugin(SourcePlugin):
 if not machine_arch:
 msger.error("Couldn't find MACHINE_ARCH, exiting.\n")
 
-initrd = "%s/%s-initramfs-%s.%s" \
-% (initrd_dir, image_name, machine_arch, image_type)
+initrd = glob.glob('%s/%s*%s.%s' % (initrd_dir, image_name, 
machine_arch, image_type))[0]
 
 if not os.path.exists(initrd):
 # Create initrd from rootfs directory
-- 
2.7.4

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 2/2] isoimage-isohybrid.py: change cpio generated uid to root

2016-04-01 Thread Ioan-Adrian Ratiu
By default cpio preserves the uid's of the original user which
leads to host contamination and boot failures because commands like
mount from initramfs expect to be run by root and the original host
user might not even exist on the target.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py 
b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
index de99ad8..bc99283 100644
--- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
+++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -174,8 +174,8 @@ class IsoImagePlugin(SourcePlugin):
 else:
 msger.error("Couldn't find or build initrd, exiting.\n")
 
-exec_cmd("find %s | cpio -o -H newc >%s/initrd.cpio " \
-% (initrd_dir, cr_workdir), as_shell=True)
+exec_cmd("cd %s && find . | cpio -o -H newc -R +0:+0 
>./initrd.cpio " \
+% initrd_dir, as_shell=True)
 exec_cmd("gzip -f -9 -c %s/initrd.cpio > %s" \
 % (cr_workdir, initrd), as_shell=True)
 shutil.rmtree(initrd_dir)
-- 
2.7.4

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 3/3] sysvinit: downgrade ALTERNATIVE_PRIORITY[mountpoint]

2016-03-22 Thread Ioan-Adrian Ratiu
From: Richard Tollerton <rich.toller...@ni.com>

sysvinit is objectively less maintained than util-linux or busybox, each
of which may supply its own mountpoint implementation. Adjust the
ALTERNATIVE_PRIORITY to select the sysvinit implementation as the last
resort.

Signed-off-by: Richard Tollerton <rich.toller...@ni.com>
Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb 
b/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
index e4aa4c3..0f0df85 100644
--- a/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
+++ b/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
@@ -39,6 +39,8 @@ ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init"
 ALTERNATIVE_PRIORITY[init] = "50"
 
 ALTERNATIVE_LINK_NAME[mountpoint] = "${base_bindir}/mountpoint"
+ALTERNATIVE_PRIORITY[mountpoint] = "20"
+
 ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
 ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
 ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
-- 
2.7.4

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 1/3] util-linux: split out util-linux-mountpoint

2016-03-22 Thread Ioan-Adrian Ratiu
From: Richard Tollerton <rich.toller...@ni.com>

Allow mountpoint to be installed separately from the rest of util-linux,
to conserve disk space, and to minimize the impact of switching to/from
this version of mountpoint.

Signed-off-by: Richard Tollerton <rich.toller...@ni.com>
Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/recipes-core/util-linux/util-linux.inc | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index 08ca040..c2a91e1 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -31,7 +31,7 @@ PACKAGES =+ "util-linux-agetty util-linux-fdisk 
util-linux-cfdisk util-linux-sfd
  util-linux-uuidgen util-linux-lscpu util-linux-fsck 
util-linux-blkid \
  util-linux-mkfs util-linux-mcookie util-linux-reset \
  util-linux-mkfs.cramfs util-linux-fsck.cramfs util-linux-fstrim \
- util-linux-partx util-linux-hwclock \
+ util-linux-partx util-linux-hwclock util-linux-mountpoint \
  util-linux-findfs util-linux-getopt util-linux-sulogin"
 PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 
'util-linux-pylibmount', '', d)}"
 PACKAGES =+ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 
'util-linux-runuser', '', d)}"
@@ -100,6 +100,7 @@ FILES_util-linux-fsck.cramfs = "${sbindir}/fsck.cramfs"
 FILES_util-linux-mkfs.cramfs = "${sbindir}/mkfs.cramfs"
 
 FILES_util-linux-sulogin = "${base_sbindir}/sulogin*"
+FILES_util-linux-mountpoint = "${base_bindir}/mountpoint.${BPN}"
 
 # Util-linux' blkid replaces the e2fsprogs one
 FILES_util-linux-blkid = "${base_sbindir}/blkid*"
@@ -114,7 +115,7 @@ RDEPENDS_util-linux-runuser += "libpam"
 RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup 
util-linux-sulogin"
 RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 
'util-linux-runuser', '', d)}"
 
-RRECOMMENDS_${PN} = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk 
util-linux-mount util-linux-readprofile util-linux-mkfs "
+RRECOMMENDS_${PN} = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk 
util-linux-mount util-linux-readprofile util-linux-mkfs util-linux-mountpoint"
 
 RRECOMMENDS_${PN}_class-native = ""
 RRECOMMENDS_${PN}_class-nativesdk = ""
@@ -146,7 +147,7 @@ do_install () {
 
 sbinprogs="agetty ctrlaltdel cfdisk vipw vigr"
 sbinprogs_a="pivot_root hwclock mkswap mkfs.minix fsck.minix losetup 
swapon swapoff fdisk fsck blkid blockdev fstrim sulogin switch_root"
-binprogs_a="dmesg getopt kill more umount mount login reset su"
+binprogs_a="dmesg getopt kill more umount mount login reset su 
mountpoint"
 
 if [ "${base_sbindir}" != "${sbindir}" ]; then
mkdir -p ${D}${base_sbindir}
@@ -264,6 +265,9 @@ ALTERNATIVE_LINK_NAME[getopt] = "${base_bindir}/getopt"
 ALTERNATIVE_util-linux-sulogin = "sulogin"
 ALTERNATIVE_LINK_NAME[sulogin] = "${base_sbindir}/sulogin"
 
+ALTERNATIVE_util-linux-mountpoint = "mountpoint"
+ALTERNATIVE_LINK_NAME[mountpoint] = "${base_bindir}/mountpoint"
+
 BBCLASSEXTEND = "native nativesdk"
 
 python do_package_prepend () {
-- 
2.7.4

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 2/3] default-providers.inc: add VIRTUAL-RUNTIME_mountpoint

2016-03-22 Thread Ioan-Adrian Ratiu
From: Richard Tollerton <rich.toller...@ni.com>

util-linux, sysvinit, and busybox are all capable of providing
mountpoint; add a VIRTUAL-RUNTIME_mountpoint in order to switch
runtime dependencies between the three at build time.

Signed-off-by: Richard Tollerton <rich.toller...@ni.com>
Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/conf/distro/include/default-providers.inc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/conf/distro/include/default-providers.inc 
b/meta/conf/distro/include/default-providers.inc
index ba85c78..d13e3ad 100644
--- a/meta/conf/distro/include/default-providers.inc
+++ b/meta/conf/distro/include/default-providers.inc
@@ -26,6 +26,7 @@ VIRTUAL-RUNTIME_getopt ?= "util-linux-getopt"
 VIRTUAL-RUNTIME_wireless-tools ?= "iw wireless-tools"
 VIRTUAL-RUNTIME_base-utils ?= "busybox"
 VIRTUAL-RUNTIME_base-utils-hwclock ?= "busybox-hwclock"
+VIRTUAL-RUNTIME_mountpoint ?= "util-linux-mountpoint"
 
 #
 # Default recipe providers
-- 
2.7.4

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] ParaTypeFFL-1.3: Add license file

2016-03-19 Thread Ioan-Adrian Ratiu
The ParaType Free Font License is used by various fonts, out of which a
recipe will be added to meta-openembedded for ttf-pt-sans.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/files/common-licenses/ParaTypeFFL-1.3 | 44 ++
 1 file changed, 44 insertions(+)
 create mode 100644 meta/files/common-licenses/ParaTypeFFL-1.3

diff --git a/meta/files/common-licenses/ParaTypeFFL-1.3 
b/meta/files/common-licenses/ParaTypeFFL-1.3
new file mode 100644
index 000..8357965
--- /dev/null
+++ b/meta/files/common-licenses/ParaTypeFFL-1.3
@@ -0,0 +1,44 @@
+ParaType Free Font Licensing Agreement
+
+Copyright (c) 2009, ParaType Ltd. All Rights Reserved.
+
+LICENSING AGREEMENT
+for the fonts with Original Name: PT Sans, PT Serif, PT Mono
+Version 1.3 - January 20, 2012
+
+GRANT OF LICENSE
+ParaType Ltd grants you the right to use, copy, modify the fonts and
+distribute modified and unmodified copies of the fonts by any means,
+including placing on Web servers for free downloading, embedding in
+documents and Web pages, bundling with commercial and non commercial
+products, if it does not conflict with the conditions listed below:
+
+- You may bundle the fonts with commercial software, but you may not
+sell the fonts by themselves. They are free.
+
+- You may distribute the fonts in modified or unmodified versions only
+together with this Licensing Agreement and with above copyright notice.
+You have no right to modify the text of Licensing Agreement. It can be
+placed in a separate text file or inserted into the font file, but it
+must be easily viewed by users.
+
+- You may not distribute modified version of the font under the Original
+name or a combination of Original name with any other words without
+explicit written permission from ParaType.
+
+TERMINATION & TERRITORY
+This license has no limits on time and territory, but it becomes null
+and void if any of the above conditions are not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
+PARATYPE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
+ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
+OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS
+IN THE FONT SOFTWARE.
+
+ParaType Ltd
-- 
2.7.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v8 6/6] sign_package_feed: add feed signature type

2016-03-10 Thread Ioan-Adrian Ratiu
Signing package feeds will default to ascii armored signatures (ASC) the
other option being binary (BIN). This is for both rpm and ipk backends.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/classes/sign_package_feed.bbclass | 12 +++-
 meta/lib/oe/package_manager.py | 10 --
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/meta/classes/sign_package_feed.bbclass 
b/meta/classes/sign_package_feed.bbclass
index e1ec82e..31a6e9b 100644
--- a/meta/classes/sign_package_feed.bbclass
+++ b/meta/classes/sign_package_feed.bbclass
@@ -10,6 +10,12 @@
 #   Optional variable for specifying the backend to use for signing.
 #   Currently the only available option is 'local', i.e. local signing
 #   on the build host.
+# PACKAGE_FEED_GPG_SIGNATURE_TYPE
+#   Optional variable for specifying the type of gpg signature, can be:
+#   1. Ascii armored (ASC), default if not set
+#   2. Binary (BIN)
+#   This variable is only available for IPK feeds. It is ignored on
+#   other packaging backends.
 # GPG_BIN
 #   Optional variable for specifying the gpg binary/wrapper to use for
 #   signing.
@@ -20,13 +26,17 @@ inherit sanity
 
 PACKAGE_FEED_SIGN = '1'
 PACKAGE_FEED_GPG_BACKEND ?= 'local'
-
+PACKAGE_FEED_GPG_SIGNATURE_TYPE ?= 'ASC'
 
 python () {
 # Check sanity of configuration
 for var in ('PACKAGE_FEED_GPG_NAME', 'PACKAGE_FEED_GPG_PASSPHRASE_FILE'):
 if not d.getVar(var, True):
 raise_sanity_error("You need to define %s in the config" % var, d)
+
+sigtype = d.getVar("PACKAGE_FEED_GPG_SIGNATURE_TYPE", True)
+if sigtype.upper() != "ASC" and sigtype.upper() != "BIN":
+raise_sanity_error("Bad value for PACKAGE_FEED_GPG_SIGNATURE_TYPE 
(%s), use either ASC or BIN" % sigtype)
 }
 
 do_package_index[depends] += "signing-keys:do_deploy"
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index dc49903..83f8de4 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -141,9 +141,12 @@ class RpmIndexer(Indexer):
 # Sign repomd
 if signer:
 for repomd in repomd_files:
+feed_sig_type = 
self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE', True)
+is_ascii_sig = (feed_sig_type.upper() != "BIN")
 signer.detach_sign(repomd,
self.d.getVar('PACKAGE_FEED_GPG_NAME', 
True),
-   
self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE', True))
+   
self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE', True),
+   armor=is_ascii_sig)
 
 
 class OpkgIndexer(Indexer):
@@ -192,10 +195,13 @@ class OpkgIndexer(Indexer):
 bb.fatal('%s' % ('\n'.join(result)))
 
 if signer:
+feed_sig_type = self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE', 
True)
+is_ascii_sig = (feed_sig_type.upper() != "BIN")
 for f in index_sign_files:
 signer.detach_sign(f,
self.d.getVar('PACKAGE_FEED_GPG_NAME', 
True),
-   
self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE', True))
+   
self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE', True),
+   armor=is_ascii_sig)
 
 
 class DpkgIndexer(Indexer):
-- 
2.7.2

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v8 3/6] gpg_sign: export_pubkey: add signature type support

2016-03-10 Thread Ioan-Adrian Ratiu
Add support for multiple types of signatures (binary or ascii)
in export_pubkey(). There is no change in behaviour for the function,
the previous implicit default is the new parameter "armor" default.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/lib/oe/gpg_sign.py | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oe/gpg_sign.py b/meta/lib/oe/gpg_sign.py
index 0b5dc20..e738397 100644
--- a/meta/lib/oe/gpg_sign.py
+++ b/meta/lib/oe/gpg_sign.py
@@ -12,12 +12,14 @@ class LocalSigner(object):
 self.gpg_path = d.getVar('GPG_PATH', True)
 self.rpm_bin = bb.utils.which(os.getenv('PATH'), "rpm")
 
-def export_pubkey(self, output_file, keyid):
+def export_pubkey(self, output_file, keyid, armor=True):
 """Export GPG public key to a file"""
-cmd = '%s --batch --yes --export --armor -o %s ' % \
+cmd = '%s --batch --yes --export -o %s ' % \
 (self.gpg_bin, output_file)
 if self.gpg_path:
 cmd += "--homedir %s " % self.gpg_path
+if armor:
+cmd += "--armor "
 cmd += keyid
 status, output = oe.utils.getstatusoutput(cmd)
 if status:
-- 
2.7.2

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v8 5/6] package_manager: sign IPK package feeds

2016-03-10 Thread Ioan-Adrian Ratiu
Create gpg signed ipk package feeds using the gpg backend if configured

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/lib/oe/package_manager.py | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 5cd43e9..dc49903 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -153,11 +153,16 @@ class OpkgIndexer(Indexer):
  "MULTILIB_ARCHS"]
 
 opkg_index_cmd = bb.utils.which(os.getenv('PATH'), "opkg-make-index")
+if self.d.getVar('PACKAGE_FEED_SIGN', True) == '1':
+signer = get_signer(self.d, 
self.d.getVar('PACKAGE_FEED_GPG_BACKEND', True))
+else:
+signer = None
 
 if not os.path.exists(os.path.join(self.deploy_dir, "Packages")):
 open(os.path.join(self.deploy_dir, "Packages"), "w").close()
 
 index_cmds = []
+index_sign_files = []
 for arch_var in arch_vars:
 archs = self.d.getVar(arch_var, True)
 if archs is None:
@@ -176,6 +181,8 @@ class OpkgIndexer(Indexer):
 index_cmds.append('%s -r %s -p %s -m %s' %
   (opkg_index_cmd, pkgs_file, pkgs_file, 
pkgs_dir))
 
+index_sign_files.append(pkgs_file)
+
 if len(index_cmds) == 0:
 bb.note("There are no packages in %s!" % self.deploy_dir)
 return
@@ -183,9 +190,12 @@ class OpkgIndexer(Indexer):
 result = oe.utils.multiprocess_exec(index_cmds, create_index)
 if result:
 bb.fatal('%s' % ('\n'.join(result)))
-if self.d.getVar('PACKAGE_FEED_SIGN', True) == '1':
-raise NotImplementedError('Package feed signing not implementd for 
ipk')
 
+if signer:
+for f in index_sign_files:
+signer.detach_sign(f,
+   self.d.getVar('PACKAGE_FEED_GPG_NAME', 
True),
+   
self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE', True))
 
 
 class DpkgIndexer(Indexer):
-- 
2.7.2

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v8 2/6] gpg_sign: detach_sign: fix gpg > 2.1 STDIN file descriptor

2016-03-10 Thread Ioan-Adrian Ratiu
Starting from v2.1 passing passwords directly to gpg does not work
anymore [1], instead a loopback interface must be used otherwise
gpg >2.1 will error out with:
"gpg: signing failed: Inappropriate ioctl for device"

gpg <2.1 does not work with the new --pinentry-mode arg and gives an
invalid option error, so we detect what is the running version of gpg
and pass it accordingly.

[1] https://wiki.archlinux.org/index.php/GnuPG#Unattended_passphrase

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/lib/oe/gpg_sign.py | 16 
 1 file changed, 16 insertions(+)

diff --git a/meta/lib/oe/gpg_sign.py b/meta/lib/oe/gpg_sign.py
index 059381d..0b5dc20 100644
--- a/meta/lib/oe/gpg_sign.py
+++ b/meta/lib/oe/gpg_sign.py
@@ -66,6 +66,13 @@ class LocalSigner(object):
 if armor:
 cmd += ['--armor']
 
+#gpg > 2.1 supports password pipes only through the loopback interface
+#gpg < 2.1 errors out if given unknown parameters
+dots = self.get_gpg_version().split('.')
+assert len(dots) >= 2
+if int(dots[0]) >= 2 and int(dots[1]) >= 1:
+cmd += ['--pinentry-mode', 'loopback']
+
 cmd += [input_file]
 
 try:
@@ -89,6 +96,15 @@ class LocalSigner(object):
 raise Exception("Failed to sign '%s" % input_file)
 
 
+def get_gpg_version(self):
+"""Return the gpg version"""
+import subprocess
+try:
+return subprocess.check_output((self.gpg_bin, 
"--version")).split()[2]
+except subprocess.CalledProcessError as e:
+raise bb.build.FuncFailed("Could not get gpg version: %s" % e)
+
+
 def verify(self, sig_file):
 """Verify signature"""
 cmd = self.gpg_bin + " --verify "
-- 
2.7.2

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v8 1/6] gpg_sign: add local ipk package signing functionality

2016-03-10 Thread Ioan-Adrian Ratiu
Implement ipk signing inside the sign_ipk bbclass using the gpg_sign
module and configure signing similar to how rpm does it. sign_ipk uses
gpg_sign's detach_sign because its functionality is identical to package
feed signing.

IPK signing process is a bit different from rpm:
- Signatures are stored outside ipk files; opkg connects to a feed
server and downloads them to verify a package.
- Signatures are of two types (both supported by opkg): binary or
ascii armoured. By default we sign using ascii armoured.
- Public keys are stored on targets to verify ipks using the
opkg-keyrings recipe.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/classes/package_ipk.bbclass |  5 
 meta/classes/sign_ipk.bbclass| 52 
 meta/lib/oe/gpg_sign.py  | 38 +++--
 3 files changed, 83 insertions(+), 12 deletions(-)
 create mode 100644 meta/classes/sign_ipk.bbclass

diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index 51bee28..f1ad1d5 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -246,6 +246,11 @@ python do_package_ipk () {
 bb.utils.unlockfile(lf)
 raise bb.build.FuncFailed("opkg-build execution failed")
 
+if d.getVar('IPK_SIGN_PACKAGES', True) == '1':
+ipkver = "%s-%s" % (d.getVar('PKGV', True), d.getVar('PKGR', True))
+ipk_to_sign = "%s/%s_%s_%s.ipk" % (pkgoutdir, pkgname, ipkver, 
d.getVar('PACKAGE_ARCH', True))
+sign_ipk(d, ipk_to_sign)
+
 cleanupcontrol(root)
 bb.utils.unlockfile(lf)
 
diff --git a/meta/classes/sign_ipk.bbclass b/meta/classes/sign_ipk.bbclass
new file mode 100644
index 000..a481f6d
--- /dev/null
+++ b/meta/classes/sign_ipk.bbclass
@@ -0,0 +1,52 @@
+# Class for generating signed IPK packages.
+#
+# Configuration variables used by this class:
+# IPK_GPG_PASSPHRASE_FILE
+#   Path to a file containing the passphrase of the signing key.
+# IPK_GPG_NAME
+#   Name of the key to sign with.
+# IPK_GPG_BACKEND
+#   Optional variable for specifying the backend to use for signing.
+#   Currently the only available option is 'local', i.e. local signing
+#   on the build host.
+# IPK_GPG_SIGNATURE_TYPE
+#   Optional variable for specifying the type of gpg signatures, can 
be:
+# 1. Ascii armored (ASC), default if not set
+# 2. Binary (BIN)
+# GPG_BIN
+#   Optional variable for specifying the gpg binary/wrapper to use for
+#   signing.
+# GPG_PATH
+#   Optional variable for specifying the gnupg "home" directory:
+#
+
+inherit sanity
+
+IPK_SIGN_PACKAGES = '1'
+IPK_GPG_BACKEND ?= 'local'
+IPK_GPG_SIGNATURE_TYPE ?= 'ASC'
+
+python () {
+# Check configuration
+for var in ('IPK_GPG_NAME', 'IPK_GPG_PASSPHRASE_FILE'):
+if not d.getVar(var, True):
+raise_sanity_error("You need to define %s in the config" % var, d)
+
+sigtype = d.getVar("IPK_GPG_SIGNATURE_TYPE", True)
+if sigtype.upper() != "ASC" and sigtype.upper() != "BIN":
+raise_sanity_error("Bad value for IPK_GPG_SIGNATURE_TYPE (%s), use 
either ASC or BIN" % sigtype)
+}
+
+def sign_ipk(d, ipk_to_sign):
+from oe.gpg_sign import get_signer
+
+bb.debug(1, 'Signing ipk: %s' % ipk_to_sign)
+
+signer = get_signer(d, d.getVar('IPK_GPG_BACKEND', True))
+sig_type = d.getVar('IPK_GPG_SIGNATURE_TYPE', True)
+is_ascii_sig = (sig_type.upper() != "BIN")
+
+signer.detach_sign(ipk_to_sign,
+   d.getVar('IPK_GPG_NAME', True),
+   d.getVar('IPK_GPG_PASSPHRASE_FILE', True),
+   armor=is_ascii_sig)
diff --git a/meta/lib/oe/gpg_sign.py b/meta/lib/oe/gpg_sign.py
index ada1b2f..059381d 100644
--- a/meta/lib/oe/gpg_sign.py
+++ b/meta/lib/oe/gpg_sign.py
@@ -50,6 +50,7 @@ class LocalSigner(object):
 bb.error('rpmsign failed: %s' % proc.before.strip())
 raise bb.build.FuncFailed("Failed to sign RPM packages")
 
+
 def detach_sign(self, input_file, keyid, passphrase_file, passphrase=None, 
armor=True):
 """Create a detached signature of a file"""
 import subprocess
@@ -58,22 +59,35 @@ class LocalSigner(object):
 raise Exception("You should use either passphrase_file of 
passphrase, not both")
 
 cmd = [self.gpg_bin, '--detach-sign', '--batch', '--no-tty', '--yes',
-   '-u', keyid]
-if passphrase_file:
-cmd += ['--passphrase-file', passphrase_file]
-else:
-cmd += ['--passphrase-fd', '0']
+   '--passphrase-fd', '0', '-u', keyid]
+
 if self.gpg_path:
 cmd += ['--homedir', self.gpg_path]
 i

[OE-core] [PATCH v8 4/6] signing-keys: create ipk package

2016-03-10 Thread Ioan-Adrian Ratiu
Store the ascii armored pubkey generated using gpg_sign.export_pubkey()
in its own package.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ra...@ni.com>
---
 meta/recipes-core/meta/signing-keys.bb | 15 ++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-core/meta/signing-keys.bb 
b/meta/recipes-core/meta/signing-keys.bb
index 1d0e834..e843301 100644
--- a/meta/recipes-core/meta/signing-keys.bb
+++ b/meta/recipes-core/meta/signing-keys.bb
@@ -12,9 +12,10 @@ inherit allarch deploy
 EXCLUDE_FROM_WORLD = "1"
 INHIBIT_DEFAULT_DEPS = "1"
 
-PACKAGES =+ "${PN}-rpm ${PN}-packagefeed"
+PACKAGES =+ "${PN}-ipk ${PN}-rpm ${PN}-packagefeed"
 
 FILES_${PN}-rpm = "${sysconfdir}/pki/rpm-gpg"
+FILES_${PN}-ipk = "${sysconfdir}/pki/ipk-gpg"
 FILES_${PN}-packagefeed = "${sysconfdir}/pki/packagefeed-gpg"
 
 python do_get_public_keys () {
@@ -26,6 +27,12 @@ python do_get_public_keys () {
 signer.export_pubkey(os.path.join(d.expand('${B}'), 'rpm-key'),
  d.getVar('RPM_GPG_NAME', True))
 
+if d.getVar("IPK_SIGN_PACKAGES", True):
+# Export public key of the ipk signing key
+signer = get_signer(d, d.getVar('IPK_GPG_BACKEND', True))
+signer.export_pubkey(os.path.join(d.expand('${B}'), 'ipk-key'),
+ d.getVar('IPK_GPG_NAME', True))
+
 if d.getVar('PACKAGE_FEED_SIGN', True) == '1':
 # Export public key of the feed signing key
 signer = get_signer(d, d.getVar('PACKAGE_FEED_GPG_BACKEND', True))
@@ -39,6 +46,9 @@ do_install () {
 if [ -f "${B}/rpm-key" ]; then
 install -D -m 0644 "${B}/rpm-key" 
"${D}${sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-${DISTRO_VERSION}"
 fi
+if [ -f "${B}/ipk-key" ]; then
+install -D -m 0644 "${B}/ipk-key" 
"${D}${sysconfdir}/pki/ipk-gpg/IPK-GPG-KEY-${DISTRO_VERSION}"
+fi
 if [ -f "${B}/pf-key" ]; then
 install -D -m 0644 "${B}/pf-key" 
"${D}${sysconfdir}/pki/packagefeed-gpg/PACKAGEFEED-GPG-KEY-${DISTRO_VERSION}"
 fi
@@ -52,6 +62,9 @@ do_deploy () {
 if [ -f "${B}/rpm-key" ]; then
 install -D -m 0644 "${B}/rpm-key" 
"${DEPLOYDIR}/RPM-GPG-KEY-${DISTRO_VERSION}"
 fi
+if [ -f "${B}/ipk-key" ]; then
+install -D -m 0644 "${B}/ipk-key" 
"${DEPLOYDIR}/IPK-GPG-KEY-${DISTRO_VERSION}"
+fi
 if [ -f "${B}/pf-key" ]; then
 install -D -m 0644 "${B}/pf-key" 
"${DEPLOYDIR}/PACKAGEFEED-GPG-KEY-${DISTRO_VERSION}"
 fi
-- 
2.7.2

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


  1   2   >