<feed xmlns='http://www.w3.org/2005/Atom'>
<title>buildroot/support/scripts/check-bin-arch, branch 2018.02-op-build</title>
<subtitle>OpenPOWER buildroot sources</subtitle>
<id>http://git.raptorcs.com/git/buildroot/atom?h=2018.02-op-build</id>
<link rel='self' href='http://git.raptorcs.com/git/buildroot/atom?h=2018.02-op-build'/>
<link rel='alternate' type='text/html' href='http://git.raptorcs.com/git/buildroot/'/>
<updated>2018-03-30T20:11:20+00:00</updated>
<entry>
<title>support/check-bin-arch: exclude kernel modules for merged /usr</title>
<updated>2018-03-30T20:11:20+00:00</updated>
<author>
<name>Yann E. MORIN</name>
<email>yann.morin.1998@free.fr</email>
</author>
<published>2018-03-07T21:51:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.raptorcs.com/git/buildroot/commit/?id=ac076f59de92cbea22bc26e5c83bbbdf75e9c70f'/>
<id>urn:sha1:ac076f59de92cbea22bc26e5c83bbbdf75e9c70f</id>
<content type='text'>
When using a merged /usr, the kernel module path is really
/usr/lib/modules, as /lib is a symlink to usr/lib .

Signed-off-by: "Yann E. MORIN" &lt;yann.morin.1998@free.fr&gt;
Cc: Thomas Petazzoni &lt;thomas.petazzoni@bootlin.com&gt;
Cc: Peter Korsgaard &lt;peter@korsgaard.com&gt;
Reviewed-by: Peter Korsgaard &lt;peter@korsgaard.com&gt;
Signed-off-by: Peter Korsgaard &lt;peter@korsgaard.com&gt;
(cherry picked from commit 1b9a57442d0a234b03585235f516d755372f29b3)
Signed-off-by: Peter Korsgaard &lt;peter@korsgaard.com&gt;
</content>
</entry>
<entry>
<title>spport/check-bin-arch: accept arbitrary per-package ignore paths</title>
<updated>2018-03-30T20:11:10+00:00</updated>
<author>
<name>Yann E. MORIN</name>
<email>yann.morin.1998@free.fr</email>
</author>
<published>2018-03-07T21:51:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.raptorcs.com/git/buildroot/commit/?id=086b43f698108b5d88d69e400aa9784353873429'/>
<id>urn:sha1:086b43f698108b5d88d69e400aa9784353873429</id>
<content type='text'>
Some packages (mostly, out-of-tree) may want to install binary blobs for
another architecture,  outside the locations we currently exclude, like
in /opt or whatever...

Add support in check-bin-arch to accept any arbitrary location, that
individual package can each request to excude from the check, when they
are installed.

Signed-off-by: "Yann E. MORIN" &lt;yann.morin.1998@free.fr&gt;
Cc: Peter Korsgaard &lt;peter@korsgaard.com&gt;
Cc: Thomas Petazzoni &lt;thomas.petazzoni@bootlin.com&gt;
Signed-off-by: Peter Korsgaard &lt;peter@korsgaard.com&gt;
(cherry picked from commit 01d90f0d093ff16ab3c1a9466430cee6fb7842d8)
Signed-off-by: Peter Korsgaard &lt;peter@korsgaard.com&gt;
</content>
</entry>
<entry>
<title>check-bin-arch: skip /lib/modules to allow 32-bit userland on 64-bit arch</title>
<updated>2018-02-25T22:16:05+00:00</updated>
<author>
<name>Thomas De Schampheleire</name>
<email>thomas.de_schampheleire@nokia.com</email>
</author>
<published>2018-02-20T11:11:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.raptorcs.com/git/buildroot/commit/?id=78ec4bd9e639616480d3e024a2bd6b2e52b4072d'/>
<id>urn:sha1:78ec4bd9e639616480d3e024a2bd6b2e52b4072d</id>
<content type='text'>
The script check-bin-arch fails as follows on a config for PowerPC e6500
(64-bit CPU) with BR2_ARCH="powerpc" (32-bit userland desired):

ERROR: architecture for "/lib/modules/..../lib/libcrc32c.ko"
            is "PowerPC64", should be "PowerPC"

This situation is perfectly acceptable: the kernel is 64-bit and so are its
modules, even though userland is 32-bit.

To keep check-bin-arch and its caller simple, just skip /lib/modules/
entirely, like is done for /lib/firmware and some others.

Signed-off-by: Thomas De Schampheleire &lt;thomas.de_schampheleire@nokia.com&gt;
Reviewed-by: "Yann E. MORIN" &lt;yann.morin.1998@free.fr&gt;
Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>support/scripts/check-bin-arch: fix symbolic link check</title>
<updated>2017-09-05T18:59:04+00:00</updated>
<author>
<name>Thomas Petazzoni</name>
<email>thomas.petazzoni@free-electrons.com</email>
</author>
<published>2017-09-05T18:59:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.raptorcs.com/git/buildroot/commit/?id=cb0f3fa13f315a1aa0469d3479673860dcba8eb9'/>
<id>urn:sha1:cb0f3fa13f315a1aa0469d3479673860dcba8eb9</id>
<content type='text'>
Commit c96b8675ea03a5d3194d439f740c725dd239ed1a
("support/scripts/check-bin-arch: ignore symbolic links") was bogus,
because it tested ${f}, which is the relative path of the file inside
${TARGET_DIR}, so we end up testing if ${f} on the system is a
symbolic link.

This commit fixes that by testing ${TARGET_DIR}/${f}.

Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@free-electrons.com&gt;
</content>
</entry>
<entry>
<title>support/scripts/check-bin-arch: ignore symbolic links</title>
<updated>2017-09-04T14:01:51+00:00</updated>
<author>
<name>Thomas Petazzoni</name>
<email>thomas.petazzoni@free-electrons.com</email>
</author>
<published>2017-09-03T14:09:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.raptorcs.com/git/buildroot/commit/?id=c96b8675ea03a5d3194d439f740c725dd239ed1a'/>
<id>urn:sha1:c96b8675ea03a5d3194d439f740c725dd239ed1a</id>
<content type='text'>
Since commit da32b49f0091ee9dfb613e0f00973bf6893bfa84
("instrumentation: extend packages-file-list.txt with symlinks and
directories"), the packages-file-list.txt also contains symbolic
links. Therefore, check-bin-arch is now also checking symbolic links.

However, symbolic links in $(TARGET_DIR) can have absolute path as
targets, such as:

$ ls -l output/target/sbin/ifdown
lrwxrwxrwx 1 thomas thomas 10 Sep  3 15:55 output/target/sbin/ifdown -&gt; /sbin/ifup

Therefore, we are now potentially checking a host binary, which
obviously makes check-bin-arch fail.

This commit changes check-bin-arch to ignore symbolic links. Indeed,
we have two cases:

 - The symbolic link really points to something that will in the
   rootfs (such as /sbin/ifup above). In this case, /sbin/ifup will be
   checked separately by check-bin-arch.

 - The symbolic link doesn't point to something that will be in the
   rootfs, and that is not a problem from the perspective of
   check-bin-arch, which checks the architecture of target binaries.

Fixes:

  http://autobuild.buildroot.net/results/16d384a0183d477646ac7692feb65f00dde7d068/
  (vim)

  http://autobuild.buildroot.net/results/50429c0f63a8befff9e20899327b9a8d754d99be/
  (ifupdown)

  http://autobuild.buildroot.net/results/1db65973e782bfa61abcbccd3501bfd235f77288/
  (gawk)

Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@free-electrons.com&gt;
Reviewed-by: "Yann E. MORIN" &lt;yann.morin.1998@free.fr&gt;
Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@free-electrons.com&gt;
</content>
</entry>
<entry>
<title>support/scripts: fix shebang with bash</title>
<updated>2017-06-08T19:43:05+00:00</updated>
<author>
<name>Francois Perrad</name>
<email>fperrad@gmail.com</email>
</author>
<published>2017-06-05T07:37:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.raptorcs.com/git/buildroot/commit/?id=9cbe364f578bba25d499a45c46c56ced35153ae3'/>
<id>urn:sha1:9cbe364f578bba25d499a45c46c56ced35153ae3</id>
<content type='text'>
Signed-off-by: Francois Perrad &lt;francois.perrad@gadz.org&gt;
Reviewed-by: "Yann E. MORIN" &lt;yann.morin.1998@free.fr&gt;
Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@free-electrons.com&gt;
</content>
</entry>
<entry>
<title>support/scripts/check-bin-arch: fix after "fix for filenames with spaces"</title>
<updated>2017-03-22T20:43:54+00:00</updated>
<author>
<name>Thomas Petazzoni</name>
<email>thomas.petazzoni@free-electrons.com</email>
</author>
<published>2017-03-22T20:43:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.raptorcs.com/git/buildroot/commit/?id=d5d642a43f4bba00111aff021de6c65b77358e31'/>
<id>urn:sha1:d5d642a43f4bba00111aff021de6c65b77358e31</id>
<content type='text'>
In commit 2f6c5e513cf6688f9343a25ac90138e9ad751eb5
("support/check-bin-arch: fix for filenames with spaces"), Yann
adjuste the check-bin-arch script to properly handle filenames with
spaces.

However, he also did a subtle change of the regexp that extracts the
path of the files. It was:

  "/^${package},(.+)$/!d; s//\1/;"

and Yann changed it to:

  "/^${package},\.(.+)$/!d; s//\1/;"

So the file paths used to start with a dot (like "./usr/share/foo"),
and now they no longer start with a dot (like "/usr/share/foo"). While
this modification is good and makes sense, the match for
/lib/firmware/ was not adjusted accordingly, and the follow-up patch
also ignoring /usr/share was not adjusted as well.

This commit fixes those /lib/firmware/ and /usr/share/ special cases,
which will fix:

  http://autobuild.buildroot.net/results/76a1475f4cdedb80426fb022ef2e644aa5625660/

Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@free-electrons.com&gt;
</content>
</entry>
<entry>
<title>support/script/check-bin-arch: ignore /usr/share</title>
<updated>2017-03-21T21:14:50+00:00</updated>
<author>
<name>Thomas Petazzoni</name>
<email>thomas.petazzoni@free-electrons.com</email>
</author>
<published>2017-03-21T20:35:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.raptorcs.com/git/buildroot/commit/?id=ba72d71d79f623ae2a7c62a6fa32a77b951666ac'/>
<id>urn:sha1:ba72d71d79f623ae2a7c62a6fa32a77b951666ac</id>
<content type='text'>
/usr/share normally should not contain binaries executable for the
target platform. However, it might contain ELF binaries for other
platforms, such as firmware files installed by Qemu or
pru-software-support.

Instead of special-casing each package, let's simply ignore /usr/share.

Fixes:

  http://autobuild.buildroot.net/results/6f3fea9f6adaef1573fbb0dd6903b5d99e470610/
  (pru-software-support)

  http://autobuild.buildroot.net/results/fe8892bc22a03299fc41e30bfea5e42166838f88/
  (qemu)

Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@free-electrons.com&gt;
Acked-by: "Yann E. MORIN" &lt;yann.morin.1998@free.fr&gt;
Signed-off-by: Peter Korsgaard &lt;peter@korsgaard.com&gt;
</content>
</entry>
<entry>
<title>support/check-bin-arch: fix for filenames with spaces</title>
<updated>2017-03-21T21:14:17+00:00</updated>
<author>
<name>Yann E. MORIN</name>
<email>yann.morin.1998@free.fr</email>
</author>
<published>2017-03-21T19:01:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.raptorcs.com/git/buildroot/commit/?id=2f6c5e513cf6688f9343a25ac90138e9ad751eb5'/>
<id>urn:sha1:2f6c5e513cf6688f9343a25ac90138e9ad751eb5</id>
<content type='text'>
Filenames with spaces will break the current for loop.

Fix that by using a while-read loop, fed with the list of files on
stdin, using process substitution.

Reported-by: Peter Korsgaard &lt;peter@korsgaard.com&gt;
Signed-off-by: "Yann E. MORIN" &lt;yann.morin.1998@free.fr&gt;
Cc: Peter Korsgaard &lt;peter@korsgaard.com&gt;
Cc: Thomas Petazzoni &lt;thomas.petazzoni@free-electrons.com&gt;
Signed-off-by: Peter Korsgaard &lt;peter@korsgaard.com&gt;
</content>
</entry>
<entry>
<title>Makefile: add check of binaries architecture</title>
<updated>2017-03-20T21:22:22+00:00</updated>
<author>
<name>Thomas Petazzoni</name>
<email>thomas.petazzoni@free-electrons.com</email>
</author>
<published>2017-03-19T13:07:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.raptorcs.com/git/buildroot/commit/?id=bbb7f6c16cd5ff04ec9b78713f42ea53a940529f'/>
<id>urn:sha1:bbb7f6c16cd5ff04ec9b78713f42ea53a940529f</id>
<content type='text'>
As shown recently by the firejail example, it is easy to miss that a
package builds and installs binaries without actually cross-compiling
them: they are built for the host architecture instead of the target
architecture.

This commit adds a small helper script, check-bin-arch, called as a
GLOBAL_INSTRUMENTATION_HOOKS at the end of the target installation of
each package, to verify that the files installed by this package have
been built for the correct architecture.

Being called as a GLOBAL_INSTRUMENTATION_HOOKS allows the build to error
out right after the installation of the faulty package, and therefore
get autobuilder error detection properly assigned to this specific
package.

Example output with the firejail package enabled, when building for an
ARM target:

ERROR: architecture for ./usr/lib/firejail/libconnect.so is Advanced Micro Devices X86-64, should be ARM
ERROR: architecture for ./usr/bin/firejail is Advanced Micro Devices X86-64, should be ARM
ERROR: architecture for ./usr/lib/firejail/libtrace.so is Advanced Micro Devices X86-64, should be ARM
ERROR: architecture for ./usr/lib/firejail/libtracelog.so is Advanced Micro Devices X86-64, should be ARM
ERROR: architecture for ./usr/lib/firejail/ftee is Advanced Micro Devices X86-64, should be ARM
ERROR: architecture for ./usr/lib/firejail/faudit is Advanced Micro Devices X86-64, should be ARM
ERROR: architecture for ./usr/bin/firemon is Advanced Micro Devices X86-64, should be ARM
ERROR: architecture for ./usr/bin/firecfg is Advanced Micro Devices X86-64, should be ARM

Many thanks to Yann E. Morin and Arnout Vandecappelle for their reviews
and suggestions.

Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@free-electrons.com&gt;
</content>
</entry>
</feed>
