support/check-bin-arch: add support for excluding arbitrary locations
cover support/check-bin-arch: add support for excluding arbitrary locations
Hello All!
Users have started reporting issues with this check, when they have local packages (mostly out-of-tree, proprietary) that install binary blobs (like co-processor firmwares) in arbitrary locations, like /opt, which we currently do not exclude from the check.
Regards,
Yann E. MORIN.
The following changes since commit 74295b02d4b380e5267357be0ae1281c7410cdc2
ipset: bump to version 6.36 (2018-03-06 15:44:18 +0100)
are available in the git repository at:
git://git.buildroot.org/~ymorin/git/buildroot.git
for you to fetch changes up to ce786b49c9bbe6a3e2ebde9ca28b56de86e68b2e
support/check-bin-arch: exclude kernel modules for merged /usr (2018-03-07 21:17:11 +0100)
----------------------------------------------------------------
Yann E. MORIN (2):
spport/check-bin-arch: accept arbitrary ignore paths support/check-bin-arch: exclude kernel modules for merged /usr
docs/manual/adding-packages-generic.txt | 7 ++++ package/pkg-generic.mk | 1 + support/scripts/check-bin-arch | 59 +++++++++++++++++++++------------ 3 files changed, 45 insertions(+), 22 deletions(-)
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 1/2 spport/check-bin-arch: accept arbitrary ignore paths
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.
--- docs/manual/adding-packages-generic.txt | 7 ++++ package/pkg-generic.mk | 1 + support/scripts/check-bin-arch | 58 ++++++++++++++++++++------------- 3 files changed, 44 insertions(+), 22 deletions(-)
docs/manual/adding-packages-generic.txt +7 -0
@@ -453,6 +453,13 @@ information is (assuming the package name is +libfoo+) : FLAT binary format is only 4k bytes. If the application consumes more stack, append the required number here. +* +LIBFOO_BIN_ARCH_EXCLUDE+ is a space-separated list of path (relative + to the target directory) to ignore when checking that the package + installs correctly cross-compiled binaries. You seldom need to set this + variable, unless the package installs installs binary blobs in the + non-default locations: `/lib/firmware`, `/usr/lib/firmware`, + `/lib/modules`, and `/usr/share`. + The recommended way to define these variables is to use the following syntax:
package/pkg-generic.mk +1 -0
@@ -112,6 +112,7 @@ define check_bin_arch $(if $(filter end-install-target,$(1)-$(2)),\ support/scripts/check-bin-arch -p $(3) \ -l $(BUILD_DIR)/packages-file-list.txt \ + $(foreach i,$($(PKG)_BIN_ARCH_EXCLUDE),-i "$(i)") \ -r $(TARGET_READELF) \ -a $(BR2_READELF_ARCH_NAME)) endef
support/scripts/check-bin-arch +36 -22
80 lines not on this page · raw message
Signature · 1 line
2.14.1
PATCH 2/2 support/check-bin-arch: exclude kernel modules for merged /usr
In reply to Yann E. MORINWhen using a merged /usr, the kernel module path is really /usr/lib/modules, as /lib is a symlink to usr/lib .
--- support/scripts/check-bin-arch | 1 + 1 file changed, 1 insertion(+)
support/scripts/check-bin-arch +1 -0
@@ -14,6 +14,7 @@ declare -a IGNORES=( # and its modules may still be 64-bit. To keep the basic # check-bin-arch logic simple, just skip this directory. "/lib/modules" + "/usr/lib/modules" # Skip files in /usr/share, several packages (qemu, # pru-software-support) legitimately install ELF binaries that
Signature · 1 line
2.14.1
PATCH 1/2 spport/check-bin-arch: accept arbitrary ignore paths
In reply to Yann E. MORINQuoted 24 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yann" == Yann E MORIN <[email protected]> writes:
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" <[email protected]>Cc Peter Korsgaard <[email protected]>Cc Thomas Petazzoni <[email protected]>--- docs/manual/adding-packages-generic.txt | 7 ++++ package/pkg-generic.mk | 1 + support/scripts/check-bin-arch | 58 ++++++++++++++++++++------------- 3 files changed, 44 insertions(+), 22 deletions(-)docs/manual/adding-packages-generic.txt +0
-0
docs/manual/adding-packages-generic.txt information is (assuming the package name is +libfoo+) : · line 456
Quoted 4 lines
docs/manual/adding-packages-generic.txt +1
-0@@ -453,6 +453,13 @@ information is (assuming the package name is +libfoo+) : FLAT binary format is only 4k bytes. If the application consumes more stack, append the required number here. +* +LIBFOO_BIN_ARCH_EXCLUDE+ is a space-separated list of path (relative
s/path/paths/
docs/manual/adding-packages-generic.txt information is (assuming the package name is +libfoo+) : · line 459
Quoted 3 lines
docs/manual/adding-packages-generic.txt +3
-0+ to the target directory) to ignore when checking that the package + installs correctly cross-compiled binaries. You seldom need to set this + variable, unless the package installs installs binary blobs in the
s/installs installs/installs/
docs/manual/adding-packages-generic.txt information is (assuming the package name is +libfoo+) : · line 461
Quoted 2 lines
docs/manual/adding-packages-generic.txt +2
-0+ non-default locations: `/lib/firmware`, `/usr/lib/firmware`, + `/lib/modules`, and `/usr/share`.
This sounds a bit confusing to me, E.G. like these are non default locations.
Perhaps we should instead write:
variable, unless the package installs binary blobs outside the default locations, which are /lib/firmware, /usr/lib/firmware, /lib/modules and '/usr/share`, as these locations are automatically excluded.
docs/manual/adding-packages-generic.txt information is (assuming the package name is +libfoo+) : · line 463
Quoted 3 lines
docs/manual/adding-packages-generic.txt +1
-1if test -z "${package}" -o -z "${pkg_list}" -o -z "${readelf}" -o -z "${arch_name}" ; then - echo "Usage: $0 -p <pkg> -l <pkg-file-list> -r <readelf> -a <arch name>" + echo "Usage: $0 -p <pkg> -l <pkg-file-list> -r <readelf> -a <arch name> [-i PATTERN ...]"
We don't really document this as a pattern (even if it gets passed to ~= in the end), so perhaps it would be clearer to say [ -i PATH ]?
Otherwise it looks good to me, thanks!
Signature · 1 line
Bye, Peter Korsgaard
PATCH 2/2 support/check-bin-arch: exclude kernel modules for merged /usr
In reply to Yann E. MORINQuoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yann" == Yann E MORIN <[email protected]> writes:
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" <[email protected]>Cc Thomas Petazzoni <[email protected]>
Signature · 1 line
Bye, Peter Korsgaard
PATCH 1/2 spport/check-bin-arch: accept arbitrary ignore paths
In reply to Peter KorsgaardPeter, All,
On 2018-03-07 21:45 +0100, Peter Korsgaard spake thusly:
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yann" == Yann E MORIN <[email protected]> writes:
[--SNIP--]
Quoted 6 lines
Quoted 1 line
+* +LIBFOO_BIN_ARCH_EXCLUDE+ is a space-separated list of path (relative
s/path/paths/
docs/manual/adding-packages-generic.txt information is (assuming the package name is +libfoo+) : · line 459
Quoted 3 lines
docs/manual/adding-packages-generic.txt +3
-0+ to the target directory) to ignore when checking that the package + installs correctly cross-compiled binaries. You seldom need to set this + variable, unless the package installs installs binary blobs in thes/installs installs/installs/
Typoes fixed.
Quoted 6 lines
docs/manual/adding-packages-generic.txt information is (assuming the package name is +libfoo+) : · line 461
Quoted 2 lines
docs/manual/adding-packages-generic.txt +2
-0+ non-default locations: `/lib/firmware`, `/usr/lib/firmware`, + `/lib/modules`, and `/usr/share`.This sounds a bit confusing to me, E.G. like these are non default locations.
Quoted 6 lines
Perhaps we should instead write:
variable, unless the package installs binary blobs outside the default locations, which are
/lib/firmware,/usr/lib/firmware,/lib/modulesand '/usr/share`, as these locations are automatically excluded.
Indeed, it was not clear (except maybe just in my twisted head). I've rephrased slightly differently from your suggestion, but if you don;t like it, we can go with yours instead.
Quoted 6 lines
support/scripts/check-bin-arch line 44
Quoted 3 lines
if test -z "${package}" -o -z "${pkg_list}" -o -z "${readelf}" -o -z "${arch_name}" ; then
support/scripts/check-bin-arch +1
-1- echo "Usage: $0 -p <pkg> -l <pkg-file-list> -r <readelf> -a <arch name>" + echo "Usage: $0 -p <pkg> -l <pkg-file-list> -r <readelf> -a <arch name> [-i PATTERN ...]"We don't really document this as a pattern (even if it gets passed to ~= in the end), so perhaps it would be clearer to say [ -i PATH ]?
ACK.
Quoted 1 line
Otherwise it looks good to me, thanks!
Thanks! :-)
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 2/2 support/check-bin-arch: exclude kernel modules for merged /usr
In reply to Peter KorsgaardPeter, All,
On 2018-03-07 21:45 +0100, Peter Korsgaard spake thusly:
Quoted 9 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yann" == Yann E MORIN <[email protected]> writes:
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" <[email protected]>Cc Thomas Petazzoni <[email protected]>Reviewed-by Peter Korsgaard <[email protected]>
But I forgot to update the manual with this new location! ;-)
Should I still cary your rev-tag in round 2?
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 2/2 support/check-bin-arch: exclude kernel modules for merged /usr
Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yann" == Yann E MORIN <[email protected]> writes:
Peter, All,
On 2018-03-07 21:45 +0100, Peter Korsgaard spake thusly:Quoted 5 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yann" == Yann E MORIN <[email protected]> writes:
When using a merged /usr, the kernel module path is really
/usr/lib/modules, as /lib is a symlink to usr/lib .
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Thomas Petazzoni <[email protected]>Reviewed-by Peter Korsgaard <[email protected]>But I forgot to update the manual with this new location! ;-)
Should I still cary your rev-tag in round 2?
Sure!
Signature · 1 line
Bye, Peter Korsgaard