Skip to content

Commit

Permalink
Add aarch64 support to the base image
Browse files Browse the repository at this point in the history
Uses already compiled static build of QEMU to avoid reaching the storage
limit of the job

To simplify binfmt registering, update-binfmt (Debian tooling) is
installed and the needed template generated
  • Loading branch information
tytan652 committed Jan 2, 2024
1 parent dcb3fda commit 0fcd43a
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 0 deletions.
16 changes: 16 additions & 0 deletions buildstream/elements/components/binfmt-support.bst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
kind: autotools

build-depends:
- freedesktop-sdk.bst:public-stacks/buildsystem-autotools.bst

depends:
- freedesktop-sdk.bst:components/libpipeline.bst

variables:
conf-local: >-
--disable-upstart

sources:
- kind: tar
url: https://download.savannah.nongnu.org/releases/binfmt-support/binfmt-support-2.2.2.tar.gz
ref: cce14163f9b526283e6f0d00f3be1cfe239fa2c7574e5e0ba8ad3db74166a4a5
30 changes: 30 additions & 0 deletions buildstream/elements/components/qemu-user.bst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
kind: manual

build-depends:
- freedesktop-sdk.bst:components/util-linux.bst

config:
configure-commands:
- |
sed -i 's|${qemu_target_list}|"aarch64"|g' src/scripts/qemu-binfmt-conf.sh

install-commands:
- |
install -Dm755 -t "%{install-root}%{bindir}" qemu-aarch64
- |
mkdir -p %{install-root}%{datadir}/binfmts
src/scripts/qemu-binfmt-conf.sh --debian --exportdir "%{install-root}%{datadir}/binfmts" --qemu-path "%{bindir}" --persistent yes --preserve-argv0 yes

strip-commands:
- true

sources:
- kind: tar
base-dir: ''
url:
github_files:tonistiigi/binfmt/releases/download/deploy%2Fv8.0.4-33/qemu_v8.0.4_linux-amd64.tar.gz
ref: 924cd873807a87d800ea914a7d4b1d81973e935839e9596cf4ff7183290b4572
- kind: tar
directory: src
url: qemu:qemu-8.0.4.tar.xz
ref: 81c817dda38af958be5bef1a6cf55b658bb2d3fb87c1e6a571de6b7b2c44516c
2 changes: 2 additions & 0 deletions buildstream/elements/tooling.bst
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ depends:
- freedesktop-sdk.bst:components/appstream-glib.bst
- gnome-build-meta.bst:vm/git-lfs.bst
- gnome-build-meta.bst:core-deps/xvfb.bst
- components/binfmt-support.bst
- components/flatpak-builder-lint.bst
- components/gh-cli.bst
- components/qemu-user.bst
- flatpakrepo/flathub.bst
- flatpakrepo/flathub-beta.bst
- flatpakrepo/gnome-nightly.bst
1 change: 1 addition & 0 deletions buildstream/include/aliases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ aliases:
github_files: https://github.com/
gnome_nightly: https://nightly.gnome.org/
pypi: https://files.pythonhosted.org/packages/
qemu: https://download.qemu.org/

# git aliases go here
github: https://github.com/
Expand Down
1 change: 1 addition & 0 deletions buildstream/project.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ plugins:
- origin: junction
junction: plugins/buildstream-plugins.bst
elements:
- autotools
- meson
sources:
- cargo
Expand Down

0 comments on commit 0fcd43a

Please sign in to comment.