ARM: native build support
This PR introduces native ARM64 build support. Related to #682.
Thanks to @t3rminus for the initial attempt.
Current limitations:
- A newer version of
live-buildis required. - ~The
io.elementary.installerpackage is currently not included in metapackages/live-arm64, preventing installation to disk.~
Tested using UTM on Apple Silicon Mac.
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.
I just copied latest distinst to the patches PPA which should also have support for arm64
@NN708 what is your workflow for testing this out? I would like to see if I could get this built as well to test
@RMcNeely Thanks for your interest! Here's my workflow:
- Remove the patch line at build.sh#L38
- Set
CHANNELtodailyat etc/terraform-arm64.conf#L17 - Run the build using Debian sid as the builder image:
docker run --rm --privileged -it -v /proc:/proc -v $PWD:/working_dir -w /working_dir debian:sid ./build.sh etc/terraform-arm64.conf
@RMcNeely Thanks for your interest! Here's my workflow:
1. Remove the patch line at [build.sh#L38](https://github.com/NN708/os/blob/master/build.sh#L38) 2. Run the build using Debian sid as the builder image:docker run --rm --privileged -it -v /proc:/proc -v $PWD:/working_dir -w /working_dir debian:sid ./build.sh etc/terraform-arm64.conf
Thanks for the response, running via UTM on a M4 Mac is exactly what I'm trying to do as well.
I presume that since the script is mounting the /proc directory its actually pretty important to do this in a Debian container? Does it have to be Sid or can it be another release?
I presume that since the script is mounting the
/procdirectory its actually pretty important to do this in a Debian container? Does it have to be Sid or can it be another release?
The build fails on Debian Bookworm because its repository includes an older version of live-build. You can try building this on other distros, but I can't confirm whether it will work.
@RMcNeely Thanks for your interest! Here's my workflow: 1. Remove the patch line at build.sh#L38 2. Run the build using Debian sid as the builder image:
docker run --rm --privileged -it -v /proc:/proc -v $PWD:/working_dir -w /working_dir debian:sid ./build.sh etc/terraform-arm64.conf
I can confirm that this does produce a bootable arm64 ISO that I can run in UTM on an M3 Macbook Pro, albeit this one does not include the installer; it simply boots to a live, default desktop, and appears to still use the Ubuntu logo.
Regardless... this is amazing!
I seem to be unable to get past libpam with this no matter what I try from. Anyone know of a good way to debug livebuild crashes?
I can confirm that this does produce a bootable arm64 ISO that I can run in UTM on an M3 Macbook Pro, albeit this one does not include the installer; it simply boots to a live, default desktop, and appears to still use the Ubuntu logo.
@t3rminus Thanks for testing! I just realized I forgot to mention that CHANNEL in etc/terraform-arm64.conf should be set to daily, since the io.elementary.installer package for ARM64 is currently only available in the daily channel.
I seem to be unable to get past libpam with this no matter what I try from. Anyone know of a good way to debug
livebuildcrashes?
@RMcNeely Are you using the same container setup?
I am running your docker slscript from above on a M4 MBP. I have tried modifying it slightly to test both debian:sid and debian:latest but both run into the same error extracting libpam-runtime. When I have a chance later I will attach a screenshot.
@NN708 if you can confirm the installer from daily works as intended I can kick off a build for stable :)
@NN708 if you can confirm the installer from daily works as intended I can kick off a build for stable :)
@danirabbit I can confirm that the installer runs successfully from the daily channel, but I haven't yet verified whether the entire installation process completes without issues. I'll test this further and update you soon. Thanks for your support!
I was able to run it in docker using this command on my M4 Mac Studio:
❯ docker run --rm -it --privileged -v "$PWD:/working_dir" -w /working_dir debian:sid ./build.sh etc/terraform-arm64.conf
The build worked with modifications I made to build.sh, the changes are in my fork from @NN708 repo.
In modification, I attempted to add the ubiquity installer. However, after attempting to install elementary in a Parallels VM, the installer crashed
The live os works as expected
Hopefully, we can figure out why the installer crashes after copying files over to the disk.
@texasbe2trill we don’t use ubiquity so it’s probably not worth trying to make it work :p
@danirabbit Thanks! After removing the ubiquity installer, I was able to build successfully on a M4 Mac. With this new build, there isn't an option to install elementary. It boots directly to the live os. I'll search for the correct installer and try again. 😅
@RMcNeely Adding mount to /proc did not cause the build to fail. I installed Docker via HomeBrew. Here's the command I ran from my Mac Terminal to get it working: docker run --rm -it --privileged -v /proc:/proc -v "$PWD:/working_dir" -w /working_dir debian:sid ./build.sh etc/terraform-arm64.conf
Success! I was able to build with the changes that @texasbe2trill made and by not mounting the /proc folder. I still don't have any good clue why it was failing before your changes building in the /tmp Chris. From the commits I'm guessing you were getting errors about something not being executable in current directory? I'm still thinking that there may be an issue with my host. I have just installed the Docker Desktop app on my M4.
Just to clarify, I'm building the ISO using Docker/Podman on ARM64 Linux (regardless of whether it's real hardware or a virtual machine), not Docker Desktop on Mac. This difference might explain the issue you're encountering.
@NN708 thanks for clarifying, I expect that's where the issues are coming from. I haven't gotten around to setting up Docker/Podman in my VM to test everything on ARM 64 Linux yet.
Just refreshed seeds/metapackages so installer should now be added for ARM https://github.com/elementary/metapackages/commit/c0e30068ce30dbfbf801aa878dd3d602c2dba825
Just gotta wait for the build to publish in LP. Should kick off automatically in a couple hours: https://code.launchpad.net/~elementary-os/+recipe/seed-metapackages-noble-daily
Hi @danirabbit,
I encountered an error during the installation process. The system attempted to remove grub2-common, resulting in a dependency error. However, I can't locate where the package list is defined. Could you please provide some guidance?
INFO: removing packages: ["btrfs-progs", "casper", "cifs-utils", "discover", "discover-data", "distinst", "dmraid", "elementary-live", "expect", "f2fs-tools", "fatresize", "fdisk", "finalrd", "gettext", "gparted", "gparted-common", "grub-common", "grub2-common", "io.elementary.installer", "io.elementary.installer-session", "keyutils", "kpartx", "kpartx-boot", "libatkmm-1.6-1v5:arm64", "libcairomm-1.0-1v5:arm64", "libdiscover2", "libdistinst", "libdmraid1.0.0.rc16:arm64", "libefiboot1t64:arm64", "libefivar1t64:arm64", "libglibmm-2.4-1t64:arm64", "libgtkmm-3.0-1t64:arm64", "libinih1:arm64", "libnss-mymachines:arm64", "libpangomm-1.4-1v5:arm64", "libparted-fs-resize0t64:arm64", "libreiserfscore0t64", "libsigc++-2.0-0v5:arm64", "liburcu8t64:arm64", "localechooser-data", "os-prober", "reiserfsprogs", "systemd-container", "tcl-expect:arm64", "user-setup", "wingpanel", "xfsprogs"]
INFO: running env -i DEBIAN_FRONTEND="noninteractive" HOME="/root" LC_ALL="en_US.UTF-8" PATH="/usr/sbin:/usr/bin:/sbin:/bin" "chroot" "/tmp/distinst.vUPHj4AgrGYJ" "apt-get" "purge" "-y" "btrfs-progs" "casper" "cifs-utils" "discover" "discover-data" "distinst" "dmraid" "elementary-live" "expect" "f2fs-tools" "fatresize" "fdisk" "finalrd" "gettext" "gparted" "gparted-common" "grub-common" "grub2-common" "io.elementary.installer" "io.elementary.installer-session" "keyutils" "kpartx" "kpartx-boot" "libatkmm-1.6-1v5:arm64" "libcairomm-1.0-1v5:arm64" "libdiscover2" "libdistinst" "libdmraid1.0.0.rc16:arm64" "libefiboot1t64:arm64" "libefivar1t64:arm64" "libglibmm-2.4-1t64:arm64" "libgtkmm-3.0-1t64:arm64" "libinih1:arm64" "libnss-mymachines:arm64" "libpangomm-1.4-1v5:arm64" "libparted-fs-resize0t64:arm64" "libreiserfscore0t64" "libsigc++-2.0-0v5:arm64" "liburcu8t64:arm64" "localechooser-data" "os-prober" "reiserfsprogs" "systemd-container" "tcl-expect:arm64" "user-setup" "wingpanel" "xfsprogs"
INFO: Reading package lists...
INFO: Building dependency tree...
INFO: Reading state information...
INFO: Some packages could not be installed. This may mean that you have
INFO: requested an impossible situation or if you are using the unstable
INFO: distribution that some required packages have not yet been created
INFO: or been moved out of Incoming.
INFO: The following information may help to resolve the situation:
INFO:
INFO: The following packages have unmet dependencies:
INFO: shim-signed : Depends: grub-efi-amd64-signed (>= 1.191~) but it is not installable or
INFO: grub-efi-arm64-signed (>= 1.191~) but it is not going to be installed or
INFO: base-files (< 12.3) but 13ubuntu10.2+elementary10~ubuntu8.1 is to be installed
INFO: Depends: grub-efi-amd64-signed (>= 1.187.2~) but it is not installable or
INFO: grub-efi-arm64-signed (>= 1.187.2~) but it is not going to be installed
INFO: Depends: grub2-common (>= 2.04-1ubuntu24) but it is not going to be installed
INFO: Depends: mokutil (>= 0.3.0+1538710437.fb6250f-0ubuntu2) but it is not going to be installed
WARN: E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
INFO: creating recovery partition
WARN: recovery at /tmp/distinst.vUPHj4AgrGYJ/recovery was not found, therefore no recovery partition will be created
ERROR: configuring chroot error: error removing packages: command failed with exit status: exit status: 100
ERROR: errored while installing system: error removing packages: command failed with exit status: exit status: 100
INFO: Install error: error removing packages: command failed with exit status: exit status: 100
@NN708 the package list for metapackages is defined in seeds: https://github.com/elementary/seeds/tree/noble
Tha'ts weird that it's trying to remove grub, I wonder what that's about
Success! I was able to build with the changes that @texasbe2trill made and by not mounting the
/procfolder. I still don't have any good clue why it was failing before your changes building in the/tmpChris. From the commits I'm guessing you were getting errors about something not being executable in current directory? I'm still thinking that there may be an issue with my host. I have just installed the Docker Desktop app on my M4.
@RMcNeely I think I ran into that because I wasn't apart of the docker group, at least when I ran it in the Ubuntu VM in parallels. Once I was in the docker group in Ubuntu, the build proceeded normally. In macOS I received the not being executable in the current directory. After making those changes to the build.sh, the build was successful.
It appears the builds are now uploaded to LP. @danirabbit armhf build is failing for some reason.
Hi @danirabbit,
I encountered an error during the installation process. The system attempted to remove
grub2-common, resulting in a dependency error. However, I can't locate where the package list is defined. Could you please provide some guidance?INFO: removing packages: ["btrfs-progs", "casper", "cifs-utils", "discover", "discover-data", "distinst", "dmraid", "elementary-live", "expect", "f2fs-tools", "fatresize", "fdisk", "finalrd", "gettext", "gparted", "gparted-common", "grub-common", "grub2-common", "io.elementary.installer", "io.elementary.installer-session", "keyutils", "kpartx", "kpartx-boot", "libatkmm-1.6-1v5:arm64", "libcairomm-1.0-1v5:arm64", "libdiscover2", "libdistinst", "libdmraid1.0.0.rc16:arm64", "libefiboot1t64:arm64", "libefivar1t64:arm64", "libglibmm-2.4-1t64:arm64", "libgtkmm-3.0-1t64:arm64", "libinih1:arm64", "libnss-mymachines:arm64", "libpangomm-1.4-1v5:arm64", "libparted-fs-resize0t64:arm64", "libreiserfscore0t64", "libsigc++-2.0-0v5:arm64", "liburcu8t64:arm64", "localechooser-data", "os-prober", "reiserfsprogs", "systemd-container", "tcl-expect:arm64", "user-setup", "wingpanel", "xfsprogs"] INFO: running env -i DEBIAN_FRONTEND="noninteractive" HOME="/root" LC_ALL="en_US.UTF-8" PATH="/usr/sbin:/usr/bin:/sbin:/bin" "chroot" "/tmp/distinst.vUPHj4AgrGYJ" "apt-get" "purge" "-y" "btrfs-progs" "casper" "cifs-utils" "discover" "discover-data" "distinst" "dmraid" "elementary-live" "expect" "f2fs-tools" "fatresize" "fdisk" "finalrd" "gettext" "gparted" "gparted-common" "grub-common" "grub2-common" "io.elementary.installer" "io.elementary.installer-session" "keyutils" "kpartx" "kpartx-boot" "libatkmm-1.6-1v5:arm64" "libcairomm-1.0-1v5:arm64" "libdiscover2" "libdistinst" "libdmraid1.0.0.rc16:arm64" "libefiboot1t64:arm64" "libefivar1t64:arm64" "libglibmm-2.4-1t64:arm64" "libgtkmm-3.0-1t64:arm64" "libinih1:arm64" "libnss-mymachines:arm64" "libpangomm-1.4-1v5:arm64" "libparted-fs-resize0t64:arm64" "libreiserfscore0t64" "libsigc++-2.0-0v5:arm64" "liburcu8t64:arm64" "localechooser-data" "os-prober" "reiserfsprogs" "systemd-container" "tcl-expect:arm64" "user-setup" "wingpanel" "xfsprogs" INFO: Reading package lists... INFO: Building dependency tree... INFO: Reading state information... INFO: Some packages could not be installed. This may mean that you have INFO: requested an impossible situation or if you are using the unstable INFO: distribution that some required packages have not yet been created INFO: or been moved out of Incoming. INFO: The following information may help to resolve the situation: INFO: INFO: The following packages have unmet dependencies: INFO: shim-signed : Depends: grub-efi-amd64-signed (>= 1.191~) but it is not installable or INFO: grub-efi-arm64-signed (>= 1.191~) but it is not going to be installed or INFO: base-files (< 12.3) but 13ubuntu10.2+elementary10~ubuntu8.1 is to be installed INFO: Depends: grub-efi-amd64-signed (>= 1.187.2~) but it is not installable or INFO: grub-efi-arm64-signed (>= 1.187.2~) but it is not going to be installed INFO: Depends: grub2-common (>= 2.04-1ubuntu24) but it is not going to be installed INFO: Depends: mokutil (>= 0.3.0+1538710437.fb6250f-0ubuntu2) but it is not going to be installed WARN: E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages. INFO: creating recovery partition WARN: recovery at /tmp/distinst.vUPHj4AgrGYJ/recovery was not found, therefore no recovery partition will be created ERROR: configuring chroot error: error removing packages: command failed with exit status: exit status: 100 ERROR: errored while installing system: error removing packages: command failed with exit status: exit status: 100 INFO: Install error: error removing packages: command failed with exit status: exit status: 100
I'm running into the same issue as @NN708. grub2-common is being removed during the installer process. The build process works flawlessly from M series macOS Terminal.
Install to disk fails because of grub related issues:
Live OS still working as expected.
I'm not sure why that would happen. Maybe someone would @davidmhewitt or @tintou would have more insight into how the installer determines what to remove and why it wants to remove grub
I'm not sure why that would happen. Maybe someone would @davidmhewitt or @tintou would have more insight into how the installer determines what to remove and why it wants to remove grub
I have a theory. I think the version of the base-file is too new for shim-signed. shim-signed requires base-files < 12.3.
I'm trying the build by commenting references to shim, shim-signed, and grub-efi-armm64-signed. This will kill secure boot but wanted to narrow down the the grub problem and test the above theory.
I'm not sure why that would happen. Maybe someone would @davidmhewitt or @tintou would have more insight into how the installer determines what to remove and why it wants to remove grub
I have a theory. I think the version of the
base-fileis too new forshim-signed.shim-signedrequires base-files < 12.3.I'm trying the build by commenting references to
shim,shim-signed, andgrub-fi-armm64-signed. This will kill secure boot but wanted to narrow down the the grub problem and test the above theory.
This did not work. It definitely does seem like a shim-signed issue though. If you purge & hold shim-signed, the installer fails during the system configuration step because grub-efi-arm64-signed requires shim-signed. The system seems to copy things over to the disk just fine but you won't be able to boot into it.
I'm not sure why that would happen. Maybe someone would @davidmhewitt or @tintou would have more insight into how the installer determines what to remove and why it wants to remove grub
This is probably related to distinst. I haven't checked what version/commit we're using but it's probably an older version that doesn't support arm64 yet and tries to install amd64 packages on ARM systems. Even the latest version wouldn't support elementary OS arm64 yet, so I've opened a PR here and we'll need to test that in daily once it's merged: https://github.com/pop-os/distinst/pull/342
The new version of distinst is building on Launchpad now, it should be possible to rebuild an iso in a few hours and test it: https://launchpad.net/~elementary-os/+archive/ubuntu/os-patches/+packages
Just need to check that the 0.3.2~1748042323~24.04~d34fd00~dev version is installed.
However, I'm also slightly concerned by some of these screenshots that elementary OS is being detected as Ubuntu, so possibly the base-files patches are not being installed for some reason. That could also possibly cause installation issues.