Patchwork [2/2] Fix grep pattern when mklibs collects executables in rootfs

login
register
mail settings
Submitter Lei Liu
Date Nov. 11, 2013, 9:27 a.m.
Message ID <1384162062-30319-2-git-send-email-layliu@gmail.com>
Download mbox | patch
Permalink /patch/61413/
State New
Headers show

Comments

Lei Liu - Nov. 11, 2013, 9:27 a.m.
From: Lei Liu <lei.liu2@windriver.com>

File command in some version could print extra space between
"LSB" and "executable" - it causes mklibs can't find any executables
using grep "LSB executable".  Fix the grep pattern to catch
multiple spaces.

Signed-off-by: Lei Liu <lei.liu2@windriver.com>
---
 meta/classes/image-mklibs.bbclass |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Richard Purdie - Nov. 12, 2013, 10:23 a.m.
On Mon, 2013-11-11 at 17:27 +0800, Lei Liu wrote:
> From: Lei Liu <lei.liu2@windriver.com>
> 
> File command in some version could print extra space between
> "LSB" and "executable" - it causes mklibs can't find any executables
> using grep "LSB executable".  Fix the grep pattern to catch
> multiple spaces.
> 
> Signed-off-by: Lei Liu <lei.liu2@windriver.com>
> ---
>  meta/classes/image-mklibs.bbclass |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

I've queued this but please put the area name in the short line of the
commit in future ("image-mklibs: " in this case).

Cheers,

Richard
Lei Liu - Nov. 13, 2013, 3:05 a.m.
On 2013?11?12? 18:23, Richard Purdie wrote:
> On Mon, 2013-11-11 at 17:27 +0800, Lei Liu wrote:
>> From: Lei Liu <lei.liu2@windriver.com>
>>
>> File command in some version could print extra space between
>> "LSB" and "executable" - it causes mklibs can't find any executables
>> using grep "LSB executable".  Fix the grep pattern to catch
>> multiple spaces.
>>
>> Signed-off-by: Lei Liu <lei.liu2@windriver.com>
>> ---
>>  meta/classes/image-mklibs.bbclass |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
> I've queued this but please put the area name in the short line of the
> commit in future ("image-mklibs: " in this case).
>

Okay.  Thanks.

Lei
Nicolas Dechesne - Nov. 22, 2013, 10:33 p.m.
hi,

On Wed, Nov 13, 2013 at 4:05 AM, Lei Liu <layliu@gmail.com> wrote:

> On 2013?11?12? 18:23, Richard Purdie wrote:
> > On Mon, 2013-11-11 at 17:27 +0800, Lei Liu wrote:
> >> From: Lei Liu <lei.liu2@windriver.com>
> >>
> >> File command in some version could print extra space between
> >> "LSB" and "executable" - it causes mklibs can't find any executables
> >> using grep "LSB executable".  Fix the grep pattern to catch
> >> multiple spaces.
> >>
> >> Signed-off-by: Lei Liu <lei.liu2@windriver.com>
> >> ---
> >>  meta/classes/image-mklibs.bbclass |    2 +-
> >>  1 files changed, 1 insertions(+), 1 deletions(-)
> > I've queued this but please put the area name in the short line of the
> > commit in future ("image-mklibs: " in this case).
> >
>
> Okay.  Thanks.


First of all, this patch is needed on dora branch too , and it applies
cleanly, can that be merged?

Now, the real question... i am not able to get mklibs to work at all (even
with this patch). What i am seeing is that mklibs 0.1.38 doesn't support
anymore the use of 'sysroot'. I think this is because of this upstream
change

http://anonscm.debian.org/gitweb/?p=d-i/mklibs.git;a=commit;h=60bda7e2132d197e1c88afb5012f9677b6967db2

If I revert to 0.1.34 (that we had on dylan branch), i can build my image
just fine (note that I am building an arm soft-float image), so are you
able to use image-mklibs with dora or master which have 0.1.38?
Nicolas Dechesne - Nov. 27, 2013, 1 p.m.
On Wed, Nov 27, 2013 at 3:36 AM, Lei Liu <layliu@gmail.com> wrote:

> > If I revert to 0.1.34 (that we had on dylan branch), i can build my
> image just fine (note that I am building an arm soft-float image), so are
> you able to use image-mklibs with dora or master which have 0.1.38?
> >
>
> Hi,
>
> I'm testing on master.  And I'm able to build my qemux86 image with
> mklibs-0.1.38.
>

ok, thanks for your answer.

I tested this morning, and confirm that 'master' + mklibs is broken on ARM
(i tested qemuarm), altough qemux86 is working.. i will try to look into
that... in fact to be honest, i still believe that mklibs 0.1.38 is broken,
even on x86 and that it's working for qemux86 because it uses the loader
from your host instead of the one in the sysroot. In my case it's failing
because it doesn't find the loader in /lib (/lib in my host):

Exception: Cannot find lib /lib/ld-linux.so.3

it should in theory look for that file in the sysroot... if you look at the
upstream commit i referenced above, upstream no longer uses 'sysroot'
variable to locate the loader...

Patch

diff --git a/meta/classes/image-mklibs.bbclass b/meta/classes/image-mklibs.bbclass
index 66b0f52..e975f5d 100644
--- a/meta/classes/image-mklibs.bbclass
+++ b/meta/classes/image-mklibs.bbclass
@@ -9,7 +9,7 @@  mklibs_optimize_image_doit() {
 	du -bs > ${WORKDIR}/mklibs/du.before.mklibs.txt
 	for i in `find .`; do file $i; done \
 		| grep ELF \
-		| grep "LSB executable" \
+		| grep "LSB *executable" \
 		| grep "dynamically linked" \
 		| sed "s/:.*//" \
 		| sed "s+^\./++" \