Skip to content

Commit 135c8e6

Browse files
TUN-6362: Add armhf support to cloudflare packaging
We now will have `armhf` based debs on our github pages This will also sync to our R2 Release process allowing legacy rpi users to eventually be able to apt-get install cloudflared.
1 parent 420e80e commit 135c8e6

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@ else
9898
TARGET_PUBLIC_REPO ?= $(FLAVOR)
9999
endif
100100

101+
ifneq ($(TARGET_ARM), )
102+
ARM_COMMAND := GOARM=$(TARGET_ARM)
103+
endif
104+
105+
ifeq ($(TARGET_ARM), 7)
106+
PACKAGE_ARCH := armhf
107+
else
108+
PACKAGE_ARCH := $(TARGET_ARCH)
109+
endif
110+
101111
.PHONY: all
102112
all: cloudflared test
103113

@@ -111,7 +121,7 @@ ifeq ($(FIPS), true)
111121
$(info Building cloudflared with go-fips)
112122
cp -f fips/fips.go.linux-amd64 cmd/cloudflared/fips.go
113123
endif
114-
GOOS=$(TARGET_OS) GOARCH=$(TARGET_ARCH) go build -v -mod=vendor $(GO_BUILD_TAGS) $(LDFLAGS) $(IMPORT_PATH)/cmd/cloudflared
124+
GOOS=$(TARGET_OS) GOARCH=$(TARGET_ARCH) $(ARM_COMMAND) go build -v -mod=vendor $(GO_BUILD_TAGS) $(LDFLAGS) $(IMPORT_PATH)/cmd/cloudflared
115125
ifeq ($(FIPS), true)
116126
rm -f cmd/cloudflared/fips.go
117127
./check-fips.sh cloudflared
@@ -171,7 +181,7 @@ define build_package
171181
--license 'Apache License Version 2.0' \
172182
--url 'https://github.com/cloudflare/cloudflared' \
173183
-m 'Cloudflare <[email protected]>' \
174-
-a $(TARGET_ARCH) -v $(VERSION) -n $(DEB_PACKAGE_NAME) $(NIGHTLY_FLAGS) --after-install postinst.sh --after-remove postrm.sh \
184+
-a $(PACKAGE_ARCH) -v $(VERSION) -n $(DEB_PACKAGE_NAME) $(NIGHTLY_FLAGS) --after-install postinst.sh --after-remove postrm.sh \
175185
cloudflared=$(INSTALL_BINDIR) cloudflared.1=$(INSTALL_MANDIR)
176186
endef
177187

build-packages.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,18 @@ for arch in ${windowsArchs[@]}; do
1717
done
1818

1919

20-
linuxArchs=("386" "amd64" "arm" "arm64")
20+
linuxArchs=("386" "amd64" "arm" "armhf" "arm64")
2121
export TARGET_OS=linux
2222
for arch in ${linuxArchs[@]}; do
23+
unset TARGET_ARM
2324
export TARGET_ARCH=$arch
25+
26+
## Support for armhf builds
27+
if [[ $arch == armhf ]] ; then
28+
export TARGET_ARCH=arm
29+
export TARGET_ARM=7
30+
fi
31+
2432
make cloudflared-deb
2533
mv cloudflared\_$VERSION\_$arch.deb $ARTIFACT_DIR/cloudflared-linux-$arch.deb
2634

release_pkgs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ def parse_args():
354354
)
355355

356356
parser.add_argument(
357-
"--archs", default=["amd64", "386", "arm64", "arm"], help="list of architectures we want to package for. Note that\
357+
"--archs", default=["amd64", "386", "arm64", "arm", "armhf"], help="list of architectures we want to package for. Note that\
358358
it is the caller's responsiblity to ensure that these debs are already present in a directory. This script\
359359
will not build binaries or create their debs."
360360
)

0 commit comments

Comments
 (0)