mirror of
https://ops.gitlab.net/gitlab-org/gitlab-build-images.git
synced 2025-12-10 02:22:57 +01:00
Update scripts to compile arm64 based images
This changes all binaries to be platform dependent instead of being amd64 hardcoded.
This commit is contained in:
parent
65292a9a9c
commit
384f6231b4
9 changed files with 91 additions and 19 deletions
24
scripts/validate-binaries-architecture
Executable file
24
scripts/validate-binaries-architecture
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
# convert architecture of a system into
|
||||
# - use `arch` to show current system architecture
|
||||
# - do not use `uname -m` as this shows kernel architecture
|
||||
# - the `arch != uname -m` will be different when doing cross-compilation using `qemu-user`
|
||||
# x86_64 -> x86-64
|
||||
# aarch64 -> aarch64
|
||||
ARCH=$(arch | tr '_' '-')
|
||||
|
||||
# find all executables in $PATH
|
||||
CMDs=$(compgen -c)
|
||||
CMD_PATHs=$(which $CMDs || true) # some CMDs might be missing
|
||||
|
||||
if files=$(file $CMD_PATHs | grep "ELF " | grep -v "$ARCH")
|
||||
then
|
||||
echo "Found files of different architecture than $(ARCH):"
|
||||
echo "$files"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Validated $(echo $CMD_PATHs | wc -w) binaries."
|
||||
Loading…
Add table
Add a link
Reference in a new issue