Skip to contentSkip to conversation

support/script/check-bin-arch: ignore /usr/lib/grub

PATCH New Andrew Pilloud 2 participants 4 messages Aug 16, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 support/script/check-bin-arch: ignore /usr/lib/grub

/usr/lib/grub may contain binaries for the grub bootloader. These ELF binaries may be for other platforms.

---
 support/scripts/check-bin-arch | 6 ++++++
 1 file changed, 6 insertions(+)
support/scripts/check-bin-arch +6 -0
index b822cdd60d..2bb9d0a6b9 100755
@@ -36,6 +36,12 @@ while read f; do
 		continue
 	fi
 
+	# Skip files in /usr/lib/grub, grub legitimately installs ELF
+	# binaries that are not for the target architecture
+	if [[ "${f}" =~ ^/usr/lib/grub/.* ]]; then
+		continue
+	fi
+
 	# Get architecture using readelf. We pipe through 'head -1' so
 	# that when the file is a static library (.a), we only take
 	# into account the architecture of the first object file.
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 support/script/check-bin-arch: ignore /usr/lib/grub

Hello,

Quoted 4 lines · Andrew Pilloud

/usr/lib/grub may contain binaries for the grub bootloader. These ELF binaries may be for other platforms.

I've built both grub and grub2, and I don't get anything installed in /usr/lib/grub. Could you give more details on how you get binaries installed in /usr/lib/grub ?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 support/script/check-bin-arch: ignore /usr/lib/grub

Quoted 6 lines · Thomas Petazzoni

Hello,

Quoted 3 lines · Andrew Pilloud

/usr/lib/grub may contain binaries for the grub bootloader. These ELF binaries may be for other platforms.

Quoted 8 lines
Quoted 1 line

I've built both grub and grub2, and I don't get anything installed in /usr/lib/grub. Could you give more details on how you get binaries installed in /usr/lib/grub ?

Thanks!

Thomas

The grub2 package that ships with buildroot does not install the grub2 tools or modules in the target. I have a version of the grub2 package that does install the tools and modules in the target in my EXTERNAL tree. (I could submit a patch to make that an option on the grub2 package that ships with buildroot.) As best as I can tell, there is no way for a package to request specific files or folders be exempt from this check. There also doesn't appear to be a way to disable the test.

Suggestions?

Andrew

#3 lore raw

PATCH 1/1 support/script/check-bin-arch: ignore /usr/lib/grub

Hello,

Quoted 4 lines · Andrew Pilloud

The grub2 package that ships with buildroot does not install the grub2 tools or modules in the target. I have a version of the grub2 package that does install the tools and modules in the target in my EXTERNAL tree.

OK. Why would the grub2 tools be built for a different architecture than the target architecture ?

I do understand that grub2 modules can be built 32-bit, while the target is 64-bit. But the grub2 tools ?

Quoted 4 lines

(I could submit a patch to make that an option on the grub2 package that ships with buildroot.) As best as I can tell, there is no way for a package to request specific files or folders be exempt from this check. There also doesn't appear to be a way to disable the test.

For your information, Erico Nunes has submitted a patch series on grub2, which includes adding a grub2-tools package, that allows installing the grub2 tools to the target. See:

Subject: [Buildroot] [PATCH v2 2/8] grub2-tools: new package
Date: Wed, 26 Apr 2017 23:39:47 +0200

in the mailing list archives. It hasn't been merged yet, as some comments were made, but it's definitely something we want to merge ultimately.

Regarding the ability for a package to specify some folders to be excluded from the architecture check, we indeed did not implement such a thing because there was no real need so far. What you're bringing is really the first package-specific exclusion, so I think we would still prefer to handle it in check-bin-arch for now rather than adding a more involved mechanism.

However, I'm not a big fan of adding such a exclusion in check-bin-arch if there is no package in Buildroot that installs stuff
in /usr/lib/grub that makes the exclusion needed.

Could you work with Erico Nunes, and get your grub2 patches upstream? Adding the exclusion to check-bin-arch would then of course be part of such a patch series, and would be accepted with no problem.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com