Skip to content

ARM: native build support #754

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

ARM: native build support #754

wants to merge 1 commit into from

Conversation

NN708
Copy link
Contributor

@NN708 NN708 commented Mar 4, 2025

This PR introduces native ARM64 build support. Related to #682.

Thanks to @t3rminus for the initial attempt.

Current limitations:

  1. A newer version of live-build is required.
  2. The io.elementary.installer package is currently not included in metapackages/live-arm64, preventing installation to disk.

Tested using UTM on Apple Silicon Mac.

Screenshot

Copy link
Member

@ryonakano ryonakano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this! Leaving few comments, I don't test this yet though.

Comment on lines +17 to +27
case "$ARCH" in
amd64|i386)
MIRROR_BINARY_URL="http://archive.ubuntu.com/ubuntu/"
MIRROR_BINARY_SECURITY_URL="http://security.ubuntu.com/ubuntu/"
;;
arm64)
MIRROR_BINARY_URL="http://ports.ubuntu.com/ubuntu-ports/"
MIRROR_BINARY_SECURITY_URL="http://ports.ubuntu.com/ubuntu-ports/"
;;
esac

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we may want to put these variables into terraform*.conf and remove the case sentence here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand your suggestion; however, MIRROR_URL currently varies across etc/terraform*.conf files (official or Azure source), while these MIRROR_BINARY_URL and MIRROR_BINARY_SECURITY_URL should use the official source and remain consistent. Moving them into etc/terraform*.conf files would introduce duplication, conflicting with the single source of truth principle.

@@ -0,0 +1,33 @@
# target architecture - i386, amd64 or all
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we release stable arm64 images soon because it needs testing, could you rename this file to etc/terraform-daily-8.0-arm64.conf?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also you should update the comment i386, amd64 or all in terraform*.conf.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe etc/terraform-arm64.conf (similar to etc/terraform.conf) is intended for local builds and testing. Perhaps I should add a etc/terraform-daily-8.0-arm64.conf to align with etc/terraform-daily-8.0-azure.conf?

VERSION="8.0"

# distribution channel
CHANNEL="stable"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
CHANNEL="stable"
CHANNEL="daily"

Based on etc/terraform-daily-8.0-azure.conf

MIRROR_URL="http://ports.ubuntu.com/ubuntu-ports/"

# use HWE kernel and packages?
HWE_KERNEL="yes"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
HWE_KERNEL="yes"
HWE_KERNEL="no"

Based on etc/terraform-daily-8.0-azure.conf

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused about the configuration here. I noticed that daily builds are set with HWE_KERNEL="no", while stable builds use HWE_KERNEL="yes". Could you clarify the reasoning behind this?

For ARM64 specifically, since mainline kernel support for most hardware is still a work in progress, the HWE kernel may perform better.

@ryonakano
Copy link
Member

The io.elementary.installer package is currently not included in metapackages/live-arm64, preventing installation to disk.

I think this is because the installer is only built for amd64 at the moment, maybe because we only provide arm64 image for Raspberry Pi and PineBook Pro, which users write images to SD cards directly and don't use the installer.

https://github.com/elementary/installer/blob/50378ef67e1cf1c4aea8248d4ba2b68838b83471/debian/control#L23

The above file you mentioned is generated from this and it's simply ignored if there is no such package in the each architectures.

@danirabbit
Copy link
Member

danirabbit commented Apr 14, 2025

I just copied latest distinst to the patches PPA which should also have support for arm64

@NN708 NN708 mentioned this pull request Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants