support/scripts/check-bin-arch: ignore symbolic links
PATCH 1/1 support/scripts/check-bin-arch: ignore symbolic links
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)
--- support/scripts/check-bin-arch | 6 ++++++ 1 file changed, 6 insertions(+)
support/scripts/check-bin-arch +6 -0
@@ -36,6 +36,12 @@ while read f; do continue fi + # Skip symlinks. Some symlinks may have absolute paths as + # target, pointing to host binaries while we're building. + if [[ -L "${f}" ]]; 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.13.5
PATCH 1/1 support/scripts/check-bin-arch: ignore symbolic links
Thomas, All,
On 2017-09-03 16:09 +0200, Thomas Petazzoni spake thusly:
Quoted 46 lines
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/ifupTherefore, 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/ifupabove). In this case,/sbin/ifupwill 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 <[email protected]>--- support/scripts/check-bin-arch | 6 ++++++ 1 file changed, 6 insertions(+)support/scripts/check-bin-arch +0
-0
support/scripts/check-bin-arch while read f; do · line 41
Quoted 6 lines
support/scripts/check-bin-arch +3
-0@@ -36,6 +36,12 @@ while read f; do continue fi + # Skip symlinks. Some symlinks may have absolute paths as + # target, pointing to host binaries while we're building. + if [[ -L "${f}" ]]; then
I don't like that we use the bashism [[...]] when the POSIX [...] works perfectly well. And we also use 'test' below, which is not very consistent...
But oh, well...
Regards,
Yann E. MORIN.
Quoted 9 lines
support/scripts/check-bin-arch +3
-0+ 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.13.5
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/1 support/scripts/check-bin-arch: ignore symbolic links
Hello,
Quoted 7 lines · Yann E. MORIN
support/scripts/check-bin-arch while read f; do · line 41
Quoted 3 lines
support/scripts/check-bin-arch +3
-0+ # Skip symlinks. Some symlinks may have absolute paths as + # target, pointing to host binaries while we're building. + if [[ -L "${f}" ]]; thenI don't like that we use the bashism [[...]] when the POSIX [...] works perfectly well. And we also use 'test' below, which is not very consistent...
Agreed, but there are already such tests in the script, so I just used the same syntax. We can fix that up as a follow-up patch.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
Thomas Petazzoni
AppliedPATCH 1/1 support/scripts/check-bin-arch: ignore symbolic links
In reply to Thomas PetazzoniHello,
Quoted 33 lines · Thomas Petazzoni
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/ifupTherefore, 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/ifupabove). In this case,/sbin/ifupwill 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)
Quoted 7 lines
http://autobuild.buildroot.net/results/1db65973e782bfa61abcbccd3501bfd235f77288/
(gawk)Signed-off-by Thomas Petazzoni <[email protected]>--- support/scripts/check-bin-arch | 6 ++++++ 1 file changed, 6 insertions(+)
Applied to master, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/1 support/scripts/check-bin-arch: ignore symbolic links
In reply to Thomas PetazzoniQuoted 32 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
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/ifupTherefore, 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/ifupabove). In this case,/sbin/ifupwill 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)
Quoted 7 lines
http://autobuild.buildroot.net/results/50429c0f63a8befff9e20899327b9a8d754d99be/
(ifupdown)http://autobuild.buildroot.net/results/1db65973e782bfa61abcbccd3501bfd235f77288/
(gawk)Signed-off-by Thomas Petazzoni <[email protected]>
Committed to 2017.08.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard