-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgraded patch for Mender package builds.
- Loading branch information
Showing
4 changed files
with
36 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
From 5dd05921a17a02366a0624cd233c2179f63ba4de Mon Sep 17 00:00:00 2001 | ||
From 1813d0dee11b077df0d34de26e47168909b65757 Mon Sep 17 00:00:00 2001 | ||
From: Matthias Luescher <[email protected]> | ||
Date: Fri, 28 Jun 2024 13:50:26 +0200 | ||
Subject: [PATCH] Removed Raspbian specific setup, allow cross compilation on | ||
arm64. | ||
Date: Fri, 6 Dec 2024 14:36:20 +0100 | ||
Subject: [PATCH] Allow cross compilation on arm64, use podman. | ||
|
||
--- | ||
docker-build-package | 26 ++++++++-------- | ||
mender-deb-package | 70 +++++++++++++++++++++++++------------------- | ||
2 files changed, 52 insertions(+), 44 deletions(-) | ||
docker-build-package | 22 +++++++++--------- | ||
mender-deb-package | 53 +++++++++++++++++++++++++++++++------------- | ||
2 files changed, 49 insertions(+), 26 deletions(-) | ||
|
||
diff --git a/docker-build-package b/docker-build-package | ||
index eafb1a4..01f22fb 100755 | ||
index 600b6db..7b916a2 100755 | ||
--- a/docker-build-package | ||
+++ b/docker-build-package | ||
@@ -16,7 +16,7 @@ | ||
|
@@ -22,7 +21,7 @@ index eafb1a4..01f22fb 100755 | |
|
||
declare -A mender_client_props=( | ||
[recipe_name]="mender-client" | ||
@@ -138,8 +138,10 @@ if [ $commercial = "true" -a -z "${MENDER_PRIVATE_REPO_ACCESS_TOKEN}" ]; then | ||
@@ -139,8 +139,10 @@ if [ $commercial = "true" -a -z "${MENDER_PRIVATE_REPO_ACCESS_TOKEN}" ]; then | ||
exit 1 | ||
fi | ||
|
||
|
@@ -35,7 +34,7 @@ index eafb1a4..01f22fb 100755 | |
echo "Not building arch independent package $recipe_name on architecture $ARCH" | ||
exit 0 | ||
fi | ||
@@ -155,31 +157,27 @@ orig_dir="output/orig" | ||
@@ -156,18 +158,18 @@ orig_dir="output/orig" | ||
|
||
mkdir -p "${output_dir}" "${orig_dir}" | ||
|
||
|
@@ -59,47 +58,38 @@ index eafb1a4..01f22fb 100755 | |
echo "Including source packages in the build." | ||
BUILD_TYPE="source,${BUILD_TYPE}" | ||
fi | ||
@@ -180,7 +182,7 @@ fi | ||
|
||
PLATFORM="" | ||
|
||
-if [ "$ARCH" = "armhf" -a "$DISTRO" = "debian" ]; then | ||
- PLATFORM="--platform=linux/arm/v6" | ||
-fi | ||
- | ||
echo | ||
|
||
-docker run --rm \ | ||
+podman run --rm \ | ||
--volume $(pwd)/recipes:/recipes \ | ||
--volume $(pwd)/${output_dir}:/output \ | ||
--volume $(pwd)/${orig_dir}:/orig \ | ||
@@ -188,7 +186,7 @@ docker run --rm \ | ||
@@ -189,7 +191,7 @@ docker run --rm \ | ||
--env MENDER_PRIVATE_GPG_KEY_BUILD \ | ||
--env OVERRIDE_DEBIAN_SUFFIX \ | ||
${PLATFORM} \ | ||
- ${IMAGE_NAME_PREFIX}-${DISTRO}-${RELEASE}-${ARCH}-${IMAGE_VERSION:-master} \ | ||
- ${IMAGE_NAME_PREFIX}-${BUILD}-${DISTRO}-${RELEASE}-${ARCH}-${IMAGE_VERSION:-master} \ | ||
+ ${IMAGE_NAME_PREFIX}-${DISTRO}-${RELEASE} \ | ||
/script \ | ||
${recipe_name} \ | ||
${BUILD_TYPE} \ | ||
diff --git a/mender-deb-package b/mender-deb-package | ||
index 291de2c..d410429 100755 | ||
index 42d5f7d..f8cfb4e 100755 | ||
--- a/mender-deb-package | ||
+++ b/mender-deb-package | ||
@@ -61,11 +61,8 @@ checkout_repo() { | ||
@@ -61,7 +61,7 @@ checkout_repo() { | ||
|
||
install_go() { | ||
local GOLANG_VERSION=1.21.1 | ||
- local GOLANG_ARCH=amd64 | ||
+ local GOLANG_ARCH=${HOST_ARCHITECTURE} | ||
local golang_version_set | ||
- if [ $ARCH = "armhf" -a $OS_DISTRO = "debian" ]; then | ||
- local GOLANG_ARCH=armv6l | ||
- fi | ||
|
||
golang_version_set=$(sed -n '/[^ ]*GOLANG_VERSION:[ "0-9]/{s/.*GOLANG_VERSION:[ ]*\(["0-9\.]*\).*/\1/p;q}' .gitlab-ci.yml) | ||
golang_version_set=${golang_version_set//\"/} | ||
@@ -232,46 +229,57 @@ build_packages() { | ||
if [ $ARCH = "armhf" -a $OS_DISTRO = "raspbian" ]; then | ||
local GOLANG_ARCH=armv6l | ||
@@ -234,11 +234,23 @@ build_packages() { | ||
|
||
case "$ARCH" in | ||
amd64) | ||
|
@@ -108,60 +98,40 @@ index 291de2c..d410429 100755 | |
- ${sign_flags} \ | ||
- ${dpkg_build_ignore_flag} \ | ||
- --build=$DEB_BUILD_TYPE | ||
- ;; | ||
- | ||
- armhf) | ||
- if [ "$OS_DISTRO" = "debian" ]; then | ||
- # Native build (emulated ARM v6) | ||
- dpkg-buildpackage \ | ||
- ${sign_flags} \ | ||
- ${dpkg_build_ignore_flag} \ | ||
- --build=$DEB_BUILD_TYPE | ||
- else | ||
- # Debian ARM 32bit toolchain | ||
- CROSS_COMPILE="arm-linux-gnueabihf" \ | ||
+ if [ "$ARCH" != "${HOST_ARCHITECTURE}" ]; then | ||
+ CROSS_COMPILE="x86_64-linux-gnu" \ | ||
CC="$CROSS_COMPILE-gcc" \ | ||
- PKG_CONFIG_PATH="/usr/lib/arm-linux-gnueabihf/pkgconfig/" \ | ||
- GOARCH=arm \ | ||
+ CC="$CROSS_COMPILE-gcc" \ | ||
+ PKG_CONFIG_PATH="/usr/lib/x86_64-linux-gnu/pkgconfig/" \ | ||
+ GOARCH=amd64 \ | ||
dpkg-buildpackage \ | ||
- --target-arch armhf \ | ||
+ dpkg-buildpackage \ | ||
+ --target-arch amd64 \ | ||
${sign_flags} \ | ||
${dpkg_build_ignore_flag} \ | ||
--build=$DEB_BUILD_TYPE | ||
+ ${sign_flags} \ | ||
+ ${dpkg_build_ignore_flag} \ | ||
+ --build=$DEB_BUILD_TYPE | ||
+ else | ||
+ # Native build (amd64) | ||
+ dpkg-buildpackage \ | ||
+ ${sign_flags} \ | ||
+ ${dpkg_build_ignore_flag} \ | ||
+ --build=$DEB_BUILD_TYPE | ||
fi | ||
+ fi | ||
;; | ||
|
||
armhf) | ||
@@ -263,16 +275,23 @@ build_packages() { | ||
;; | ||
|
||
- arm64) | ||
arm64) | ||
- # Debian ARM 64bit toolchain | ||
- CROSS_COMPILE="aarch64-linux-gnu" \ | ||
+ armhf) | ||
+ # Debian ARM 32bit toolchain | ||
+ CROSS_COMPILE="arm-linux-gnueabihf" \ | ||
CC="$CROSS_COMPILE-gcc" \ | ||
- CC="$CROSS_COMPILE-gcc" \ | ||
- PKG_CONFIG_PATH="/usr/lib/aarch64-linux-gnu/pkgconfig/" \ | ||
- GOARCH=arm64 \ | ||
+ PKG_CONFIG_PATH="/usr/lib/arm-linux-gnueabihf/pkgconfig/" \ | ||
+ GOARCH=arm \ | ||
dpkg-buildpackage \ | ||
- dpkg-buildpackage \ | ||
- --target-arch arm64 \ | ||
+ --target-arch armhf \ | ||
${sign_flags} \ | ||
${dpkg_build_ignore_flag} \ | ||
--build=$DEB_BUILD_TYPE | ||
;; | ||
+ | ||
+ arm64) | ||
- ${sign_flags} \ | ||
- ${dpkg_build_ignore_flag} \ | ||
- --build=$DEB_BUILD_TYPE | ||
+ if [ "$ARCH" != "${HOST_ARCHITECTURE}" ]; then | ||
+ # Debian ARM 64bit toolchain | ||
+ CROSS_COMPILE="aarch64-linux-gnu" \ | ||
|
@@ -179,11 +149,10 @@ index 291de2c..d410429 100755 | |
+ ${dpkg_build_ignore_flag} \ | ||
+ --build=$DEB_BUILD_TYPE | ||
+ fi | ||
+ ;; | ||
;; | ||
esac | ||
} | ||
|
||
@@ -298,6 +306,8 @@ copy_deb_packages() { | ||
@@ -300,6 +319,8 @@ copy_deb_packages() { | ||
# Run script # | ||
############## | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters