pi-builder icon indicating copy to clipboard operation
pi-builder copied to clipboard

ARM64 Support

Open faddat opened this issue 4 years ago • 15 comments

Some of our software has known security issues in 32 bit environments.

Would you accept a patch that extends pi-builder to support the creation of 64 bit images?

faddat avatar Nov 10 '20 06:11 faddat

Hi! Yes, why not. Check the commit #6d5ccc76a2bc7b0b829a94ec99150accac53e3df to start. I used to have aarch64 support, but I removed it because I didn't use it. it seems that there was a basic working capacity, but it was a long time ago and I don't remember the details anymore. Note that QEMU 5.1 is broken, so you need to use QEMU 5.0.1 right now.

mdevaev avatar Nov 11 '20 04:11 mdevaev

That's wonderful.

I haven't made the transition yet but my expectation is that I will be able to use your software to dramatically reduce our image build times.

faddat avatar Nov 12 '20 03:11 faddat

Ha-ha, well, that's the main reason I did it :) This helped me a lot when developing Pi-KVM, otherwise I could have waited hours for the build to complete.

mdevaev avatar Nov 12 '20 03:11 mdevaev

So even with us, build times are still kind of an issue for me. I am hoping to figure out a way to make this even faster and possibly slim down arch linux arm. `bout 5 years ago I remember setting up Arch for an Orange Pi, and I recall just using pacstrap. I don't know if it's still possible or what might be making the initial download the 400 MB that it is but I am hoping to reduce that as well.

For the kind of thing I'm working on, less software ends up being exponentially more.

faddat avatar Nov 14 '20 11:11 faddat

If it's not currently desired then I can tell you that the default raspberry Pi 64-bit kernel is actually not all that stable and you probably don't want to use it so I think that for now I'm going to close this issue.

I solved the problem by using a user contributed kernel that more closely matches what the raspberry Pi inc developers were doing.

faddat avatar Nov 19 '20 10:11 faddat

Okay, if you want to go back to this issue, I won't mind.

mdevaev avatar Nov 19 '20 11:11 mdevaev

OK, I'll leave it open-- when mainline smoothly supports Pi 4, it'll make good sense to add arm64 support, I reckon.

faddat avatar Nov 19 '20 18:11 faddat

I'm also interested to have 64bit build or can you confirm if it possible to run 32bit packages what you provide on aarch64 arch linux?

mdef avatar Nov 24 '20 20:11 mdef

I haven't tested this case, so I can't answer.

mdevaev avatar Nov 25 '20 03:11 mdevaev

You can't run 32-bit packages on 64-bit arch, unless you want to play with qemu binfmt_misc.

But there are builds of everything in the default repositories though so you shouldn't really need to run 32-bit packages

faddat avatar Nov 26 '20 03:11 faddat

I'm actually interested to have 64bit arch linux to run pikvm on it, and other sortware in docker. Will it work this way:

  • install ArchLinuxARM-rpi-aarch64-latest.tar.gz
  • install precompiled pikvm for aarch64 if the exists somewhere Thank you in advance

mdef avatar Nov 28 '20 22:11 mdef

64bit is not compatible with omx encoder required for tc358743. perhaps something else is not working, I have not studied this issue in detail

mdevaev avatar Nov 29 '20 00:11 mdevaev

I'm actually interested to have 64bit arch linux to run pikvm on it, and other sortware in docker. Will it work this way:

  • install ArchLinuxARM-rpi-aarch64-latest.tar.gz
  • install precompiled pikvm for aarch64 if the exists somewhere Thank you in advance

No, but it will work this way:

https://github.com/faddat/sos/blob/dcdfa6e029d683d38e379389f2fdad7f393bd0c0/Dockerfile#L29-L33

Those lines are in fact super important. Also, if you'd like, you can just try forking SOS which is more or less a derivative of pi-builder here in fact. The biggest difference between SOS and Pi builder is probably that I offer the user fewer options, and don't really do very much parameterization or use of variables. The build script is quite linear.

I'm also pretty confident that you can actually build SOS on your pi. Typically, I build SOS on an AWS graviton instance, the experience is just delightful.

@mdef I should also mention that I may have been wrong, you may actually be able to run 32 bit arm packages on your 64-bit arm CPU. Of course, your mileage may vary.

faddat avatar Dec 05 '20 23:12 faddat

So the thing that I'd like to contribute I think is actually the use of Docker buildx.

I'm also going to look over that PR that adds multi-device support because I'm tinkering with the same stuff in SOS.

faddat avatar Dec 09 '20 05:12 faddat

Coming up on two years later and no progress :(

Zitt avatar Aug 05 '22 02:08 Zitt

Hey guys, better late than never, right?

I have added basic aarch64 support. Not all stages work with them (there is no watchdog, for example), but in general it should work.

However, I caution against further use of pi-builder on x86_64. It will be better to use it on arm or aarch64, i.e. build Raspberry on Raspberry. The reason is that QEMU can fail unpredictably inside different installation scripts in the package manager, and this can lead to unpredictable behavior and generation of faulty OS images. The new QEMU works poorly, QEMU for AArch64 is even more unstable, and the only thing that works well now is old QEMU armv7 on x86_64. I have abandoned cross-assembly and use a cluster of several Raspberries for my purposes.

mdevaev avatar Nov 18 '23 20:11 mdevaev

Wow that's awesome, can't wait download the image and flash it when it's all ready

onedr0p avatar Nov 18 '23 21:11 onedr0p

I'm marking this as solved, since technically the ability to build ARM64 images has already been implemented. OS for PiKVM is a separate stage.

mdevaev avatar Dec 01 '23 21:12 mdevaev

@mdevaev is there an issue for tracking building/publishing arm64 images for PiKVM? I would like to use the PiKVM for a few more network utilities/apps in my homelab but the armv7 arch is very limiting.

onedr0p avatar Apr 23 '24 19:04 onedr0p

I'm not working on it right now, but I have some plans for this year.

mdevaev avatar Apr 24 '24 21:04 mdevaev