ARM SBC Support Discussion

The IPFire buildscript also support cross compiling via qemu_user but this needs even longer time and some special binary settings on the host.

If your kernel on the VIM3 is compiled with CONFIG_COMPAT it should also be able to execute and compile also armv7 code. I use a Odroid-C2 (AMLogic Cortex-A53 Quadcore) to build IPFire.

Yes we do have qemu static package already on Manjaro. Ok So I can try it on my new desktop hoping it won’t take very long over qemu, as my experience with qemu on my old device was not so good.

Currently I don’t plan to do build for armv7 instead will just re-use your ready to flash img for R1 as ipfire already have good support for it, but my R1 is still in shipment.
Building all the packages from scratch on vim3 did take a lot of time and it failed due to storage full issue, My request is to add clean in make command in the script like we use makepkg --clean which removed the src after every successful build.
Due to not enough space and time it takes on vim3 to build all ipfire packages I will try it once on AMD Ryzen 5 and see how long it takes over qemu.

I see, You have a lot of patience hahahaha, How long does it take for it to build all the packages from scratch? I have other devices too which are quite powerful as compared to C2 like Vim2 ( Amlogic S912 – Octa-core ARM Cortex-A53 based SoC (Big.LITTLE configuration 4x1.5 GHz and 4x1.0 GHz))
Amlogic S922x.

If you can tell me the faster way to build over any of these devices can I can put it to build on ipfire packages and can keep it always on where we can make it a runner for ipfire packages directly from git CI.

Not really.

The first build is taken around 24 hours the second is much faster because the buildsystem use ccache.
I use an USB2 SSD as storage on the C2. I have tested this also on a Ryzen 5 for intel builds and the time difference between SATA and USB2 is around 3 Minutes so USB2 is OK on ARM sbc’s.

Usually I use the C2 only for builds if the nightly builders has problems. The nightlies are built at amazon and this machines are twice fast than our Intel builders.

https://nightly.ipfire.org/next/2020-08-03%2019:52:38%20+0200-03cd6810/aarch64/build.log

1 Like

I am putting 2.x to build on Amd Ryzen5 3550H to see how long it will take.

I am not sure of the argument I have to pass to make it build aarch64 image. I will try and get back to you.

Thanks.

Update 1: I have put it to pull src but looks like the mirror is slow in pulling the src its just utilizing 1/4 of my internet speed :frowning:

In this pic it is only 390 kb/s download while it should go upto 2.5mb/s

Update2:
I used ./make.sh build --target=aarch64
It is compiling.

Update3:
Base build failed.
Logs here. _build.base.tar.gz (353.9 KB)
Will continue this tomorrow.

Thanks

source.ipfire.org should have more than 100Mbit/s

In the log i found no reason why it break the glibc locale generation. Looks like a hardware crash.

1 Like

It has a gigabit which is not saturated at all.

1 Like

Is this correct? As idk what build_arch it is using as there is not information before it starts to compile,

I will try again today. I doubt it just be due to use logout which shouldn’t be the case though.

I think the argument needs to come before the command.

I always type ./make.sh --target=aarch64 build.

It is documented here.

https://git.ipfire.org/?p=ipfire-2.x.git;a=blob;f=doc/make.sh-usage;h=78a73efacbbce7c881805c9c499a650c474911c8;hb=HEAD

However, this will probably build a lot slower than on native ARM hardware.

Hello,
Thanks for updating on the argument.
Looks like it have some problem with chroot

Checking for necessary space on disk                                 [ DONE ]
chroot: failed to run command 'env': No such file or directory
stage1                             

You will need to download the toolchain first, because you cannot build it on your system:

./make.sh --target=aarch64 gettoolchain
1 Like

Oh yea that is what I was wondering it is only getting X86_64 toolchain, Now it have fetched the toolchain and I cleaned the build dir and tried to build again with correct target and it still failed with same error base_build.log have a single ling chroot: failed to run command 'env': Exec format error

Sorry for bugging you, Once I get the hang of it then I will be able to work on it myself.

Update1: I removed the toolchain and doing gettoolchain again for aarch64.
Stil it failed to build stage2 which is the first package to build in the list.
chroot: failed to run command env: Exec format error.

I have updated the whole system so make sure all packages are latest.

Update2: I am on Manjaro Arch Linux so I will look into it as the native chroot is not working i guess.

No worries. We are here to help.

What does this give you?

file build/bin/bash
file build/bin/bash
build/bin/bash: cannot open `build/bin/bash' (No such file or directory)

Please don’t tell me I have to download src for target =aarch64 ? coz I suppose src will be common for all arch.
As it takes alot of time to download src coz of the slow download speed.

Then qemu-user-static or binfmt is not configured for aarch64 binaries.

Oh. make.sh should automatically do this for you. I have never tested it with aarch64.

The magic for aarch64 is missing in qemu_find_build_helper_name() and also in qemu_is_required() aarch64 in not handled yet.

We have never used this for aarch64.

Thank you for informing, I am still reading the huge make.sh script, I will see if I can do any local changes to make it build over chroot.

If you find any more hints then please do shared as with my limited knowledge of the content in make.sh it will take sometime for me to correct it, while you might know a quick fix as you have been working on it since long time.

Thanks.

https://git.ipfire.org/?p=people/ms/ipfire-2.x.git;a=commitdiff;h=f5637566d81b39bcda42e8943a313474869b5979

Pull this commit into your branch and you can run it as described.

1 Like

Thanks alot.

That was so fast.

Ill try it now.

Hi @ms Ive tried using this patch and get the same error with chroot even after patching the make script and make script usage.
Ok, I am following the codes as it flows, so we need to add x86_65aarch64 in qemu_is_required call, then it gives me
ERROR: Could not find a binfmt_misc helper entry for aarch64 [ FAIL ]
We also need to add aarch64 in qemu_environ call I tried to define cortex-a57 as per the qemu arm documentation but I think there is something else needed to make it work.
I am still following the codes. If you have any hint please share when free.

Update:
The above error points me back to qemu_find_build_helper_name so I am in a loop to know what wrong in the codes.

Update:
I think there is something to do here
Or maybe the qemu-${target-arch} is not defined somewhere. Cannot find much now.

Thanks.

Make sure that the qemu static and binfmt helpers are installed and registered on your host os.

On linux mint i need to install qemu qemu-user-static and binfmt-support.
apt-get install qemu qemu-user-static binfmt-support

See “Use Qemu user mode” - Arm64Qemu - Debian Wiki