summaryrefslogtreecommitdiffstats
path: root/support/scripts/check-bin-arch
Commit message (Collapse)AuthorAgeFilesLines
* boot/grub2: add option to install toolsErico Nunes2018-11-261-0/+4
| | | | | | | | | | | Add an option to install grub2 support tools to the target. In the context of Buildroot, some useful target tools provided are grub2-editenv, grub2-reboot, which provide means to manage the grub2, environment, boot order, and others. Signed-off-by: Erico Nunes <nunes.erico@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* support/check-bin-arch: exclude kernel modules for merged /usrYann E. MORIN2018-03-071-0/+1
| | | | | | | | | | | 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" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Peter Korsgaard <peter@korsgaard.com> Reviewed-by: Peter Korsgaard <peter@korsgaard.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* spport/check-bin-arch: accept arbitrary per-package ignore pathsYann E. MORIN2018-03-071-22/+34
| | | | | | | | | | | | | | | 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" <yann.morin.1998@free.fr> Cc: Peter Korsgaard <peter@korsgaard.com> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* check-bin-arch: skip /lib/modules to allow 32-bit userland on 64-bit archThomas De Schampheleire2018-02-251-0/+8
| | | | | | | | | | | | | | | | | | 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 <thomas.de_schampheleire@nokia.com> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* support/scripts/check-bin-arch: fix symbolic link checkThomas Petazzoni2017-09-051-1/+1
| | | | | | | | | | | | 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 <thomas.petazzoni@free-electrons.com>
* support/scripts/check-bin-arch: ignore symbolic linksThomas Petazzoni2017-09-041-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 -> /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 <thomas.petazzoni@free-electrons.com> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support/scripts: fix shebang with bashFrancois Perrad2017-06-081-1/+1
| | | | | | Signed-off-by: Francois Perrad <francois.perrad@gadz.org> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support/scripts/check-bin-arch: fix after "fix for filenames with spaces"Thomas Petazzoni2017-03-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <thomas.petazzoni@free-electrons.com>
* support/script/check-bin-arch: ignore /usr/shareThomas Petazzoni2017-03-211-0/+7
| | | | | | | | | | | | | | | | | | | | | /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 <thomas.petazzoni@free-electrons.com> Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* support/check-bin-arch: fix for filenames with spacesYann E. MORIN2017-03-211-4/+6
| | | | | | | | | | | | | 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 <peter@korsgaard.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Peter Korsgaard <peter@korsgaard.com> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* Makefile: add check of binaries architectureThomas Petazzoni2017-03-201-0/+52
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 <thomas.petazzoni@free-electrons.com>
OpenPOWER on IntegriCloud