Build ipfire aarch64 on odriodC4

I try to build an aarch64 version for my rpi on an odroidC4 Ubuntu 22.04 mini. Building glibc fails with a this result.Tried the common workflow without any changes

-	INSTALL	/usr/local/share/man/man8/tzselect.8
-	INSTALL	/usr/local/share/man/man8/zdump.8
-	INSTALL	/usr/local/share/man/man8/zic.8
make[1]: Leaving directory '/usr/src/man-pages-5.13'
cd /usr/src/man-pages-5.13 && make install
make[1]: Entering directory '/usr/src/man-pages-5.13'
make[1]: Leaving directory '/usr/src/man-pages-5.13'
Updating linker cache...
Install done; saving file list to /usr/src/log/man-pages-5.13 ...

Apr 26 11:15:10: Building glibc glibc-2.37.tar.xz checksum OK
+ cd /usr/src/lfs
+ make -f glibc LFS_BASEDIR=/usr/src install
====================================== Installing glibc-2.37 ...
Install started; saving file list to /usr/src/lsalr ...
cd /usr/src/glibc-2.37 && patch -Np1 < /usr/src/src/patches/glibc-localedef-no-archive.patch
patching file localedata/Makefile
Hunk #1 succeeded at 466 with fuzz 1 (offset 243 lines).
cd /usr/src/glibc-build && \
	CFLAGS="-O2 -pipe -Wall -fexceptions -fPIC  -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -fstack-clash-protection -Wno-error=maybe-uninitialized -fno-asynchronous-unwind-tables" \
	/usr/src/glibc-2.37/configure --build=aarch64-pc-linux-gnu --prefix=/usr --libexecdir=/usr/lib/glibc --enable-stack-protector=strong --disable-profile --enable-kernel=4.14.0 --enable-add-ons --without-selinux --enable-experimental-malloc --enable-bind-now --disable-crypt --enable-memory-tagging
ls: cannot access '.': Function not implemented
configure: error: working directory cannot be determined
make: *** [glibc:114: /usr/src/log/glibc-2.37] Error 2

Entering the build chroot shell (sudo ./make.sh shell) shows indeed a strange env, in my opinion:

odroid@odroid:/mnt/ipfire/ipfire-2.x$ sudo ./make.sh shell
Checking for necessary space on disk                                                                           [ DONE ]
Set cache size limit to 2.0 GB
Entering to a shell inside LFS chroot, go out with exit
ipfire build chroot (aarch64) root:/$ ls -la
ls: cannot access 'home': Function not implemented
ls: cannot access 'var': Function not implemented
ls: cannot access 'boot': Function not implemented
ls: cannot access 'root': Function not implemented
ls: cannot access 'bin': Function not implemented
ls: cannot access 'tmp': Function not implemented
ls: cannot access 'tools_aarch64': Function not implemented
ls: cannot access 'lib': Function not implemented
ls: cannot access '..': Function not implemented
ls: cannot access 'run': Function not implemented
ls: cannot access 'media': Function not implemented
ls: cannot access 'sys': Function not implemented
ls: cannot access 'dev': Function not implemented
ls: cannot access 'proc': Function not implemented
ls: cannot access 'lib64': Function not implemented
ls: cannot access 'etc': Function not implemented
ls: cannot access 'usr': Function not implemented
ls: cannot access 'opt': Function not implemented
ls: cannot access 'sbin': Function not implemented
ls: cannot access 'srv': Function not implemented
ls: cannot access '.': Function not implemented
ls: cannot access 'mnt': Function not implemented
total 0
d????????? ? ? ? ?            ? .
d????????? ? ? ? ?            ? ..
d????????? ? ? ? ?            ? bin
d????????? ? ? ? ?            ? boot
d????????? ? ? ? ?            ? dev
d????????? ? ? ? ?            ? etc
d????????? ? ? ? ?            ? home
d????????? ? ? ? ?            ? lib
l????????? ? ? ? ?            ? lib64
d????????? ? ? ? ?            ? media
d????????? ? ? ? ?            ? mnt
d????????? ? ? ? ?            ? opt
d????????? ? ? ? ?            ? proc
d????????? ? ? ? ?            ? root
d????????? ? ? ? ?            ? run
d????????? ? ? ? ?            ? sbin
d????????? ? ? ? ?            ? srv
d????????? ? ? ? ?            ? sys
d????????? ? ? ? ?            ? tmp
d????????? ? ? ? ?            ? tools_aarch64
d????????? ? ? ? ?            ? usr
d????????? ? ? ? ?            ? var
ipfire build chroot (aarch64) root:/$ ls -la bin
ls: cannot access 'bin': Function not implemented
ipfire build chroot (aarch64) root:/$

Is there a hint where the trouble comes from? Is there something special depending the chroot env?

Looking in the wiki it mentions about needing to make a symlink with ubuntu otherwise you will have problems compiling glibc. Did you follow those instructions?

https://wiki.ipfire.org/devel/ipfire-2-x/build-initial

Thank you, but I already tried this.
It doesn’t work with or without modifing the symlink.
In my opinion the wiki also say, that the mod is not needed with 22.04, isn’t it?
I aslo tested a build on my i5 for x86 target with Ubuntu 22.04 and without mod and this build was fine.
On the odriod I also tested running the build on sdcard and usb stick, both tests with the same result.

You are correct. I read through it very quickly yesterday before I sent my response. Sorry.

The error is indicating that it couldn’t find the function ls which comes from coreutils.

In the buildbase part of IPFIre, coreutils is built after glibc. Therefore the ls command is made available from the pre-compiled toolchain.

Did you run the ./make gettoolchain command to download the pre-compiled toolchain before running the ./make clean and ./make build commands?

The toolchain, if downloaded, will be in
ipfire-2.x/cache/toolchains/
with a file similar to
ipfire-2.27-toolchain-20230210-x86_64.tar.zst
but with x86_64 replaced with aarch64

yes I’ve always downloaded the toolchain package with

sudo ./make.sh gettoolchain

and also the toolchain depending to the arch was downloaded.
The message

ls: cannot access '.': Function not implemented

looks a little strange, in my opinion, doesn’t it say that . is not readable at this point?

It is saying that it can’t access anything in the current directory because the function is not implemented and the only function I can think of that it means is ls.

If when you are in the /ipfire-2.x/ directory what happens if you do ls -la and sudo ls -la

Can you see the directories and their permissions/ownerships or do you see the same thing as when you were in the shell.

from th ordroid os side it looks good

odroid@odroid:/mnt/ipfire/ipfire-2.x$ ls -la
total 168
drwxrwxr-x 14 odroid odroid  4096 Apr 26 11:12 .
drwxrwxrwx  4 root   root    4096 Apr 26 11:07 ..
drwxrwxr-x  8 odroid odroid  4096 Apr 26 15:08 .git
-rw-rw-r--  1 odroid odroid   159 Apr 26 10:44 .gitignore
-rw-rw-r--  1 odroid odroid  1726 Apr 26 10:44 .mailmap
-rw-rw-r--  1 odroid odroid  1069 Apr 26 10:44 README.md
drwxr-xr-x 21 root   root    4096 Apr 26 11:12 build
drwxr-xr-x  3 root   root   36864 Apr 26 11:12 cache
drwxr-xr-x  3 root   root    4096 Apr 26 11:12 ccache
drwxrwxr-x 94 odroid odroid  4096 Apr 26 10:44 config
drwxrwxr-x  2 odroid odroid  4096 Apr 26 10:44 doc
drwxrwxr-x  4 odroid odroid  4096 Apr 26 10:44 html
drwxrwxr-x 11 odroid odroid  4096 Apr 26 10:44 langs
drwxrwxr-x  2 odroid odroid 20480 Apr 26 10:44 lfs
drwxr-xr-x  2 root   root    4096 Apr 26 11:15 log
-rwxrwxr-x  1 odroid odroid 50806 Apr 26 10:45 make.sh
drwxrwxr-x 17 odroid odroid  4096 Apr 26 10:44 src
drwxrwxr-x  3 odroid odroid  4096 Apr 26 10:44 tools
odroid@odroid:/mnt/ipfire/ipfire-2.x$ ls -la build
total 84
drwxr-xr-x 21 root   root   4096 Apr 26 11:12 .
drwxrwxr-x 14 odroid odroid 4096 Apr 26 11:12 ..
drwxr-xr-x  2 root   root   4096 Apr 26 11:12 bin
drwxr-xr-x  2 root   root   4096 Apr 26 11:12 boot
drwxr-xr-x  4 root   root   4096 Apr 26 11:12 dev
drwxr-xr-x  5 root   root   4096 Apr 26 11:12 etc
drwxr-xr-x  3 root   root   4096 Apr 26 11:12 home
drwxr-xr-x  3 root   root   4096 Apr 26 11:12 lib
lrwxrwxrwx  1 root   root      3 Apr 26 11:12 lib64 -> lib
drwxr-xr-x  5 root   root   4096 Apr 26 11:12 media
drwxr-xr-x  2 root   root   4096 Apr 26 11:12 mnt
drwxr-xr-x  3 root   root   4096 Apr 26 11:12 opt
drwxr-xr-x  2 root   root   4096 Apr 26 11:12 proc
drwxr-x---  2 root   root   4096 Apr 26 15:19 root
drwxr-xr-x  2 root   root   4096 Apr 26 11:12 run
drwxr-xr-x  2 root   root   4096 Apr 26 11:12 sbin
drwxr-xr-x  2 root   root   4096 Apr 26 11:12 srv
drwxr-xr-x  2 root   root   4096 Apr 26 11:12 sys
drwxrwxrwt  2 root   root   4096 Apr 26 11:14 tmp
drwxr-xr-x 13 root   root   4096 Feb 10 16:06 tools_aarch64
drwxr-xr-x  9 root   root   4096 Apr 26 11:12 usr
drwxr-xr-x 12 root   root   4096 Apr 26 11:12 var
odroid@odroid:/mnt/ipfire/ipfire-2.x$

but from inside the shell don’t (sse above)
I also cleaned up all directories and restarted from the biginning 2 or 3 times, but always with the exact same result.

I think your best bet is going to be to join the development mailing list, see the wiki under Development and ask the question there. There are people better placed to be able to figure out what is going on.

What kernel are you running this on?

It looks like it is too old and does not support a syscall that the IPFire environment is using.

1 Like

4.9 indeed an older one, Thank You

We currently require at least 4.14:

https://git.ipfire.org/?p=ipfire-2.x.git;a=blob;f=lfs/glibc;h=05179fcc9c93fc51187699ab689c66e460323f9e;hb=HEAD#l59

Are you able to update your host OS? Otherwise, IPFire should run on the device and should be able to compile itself as it has a newer kernel.

Is seems not at the moment. looking to the wiki shows, that 4.9 seems the most common version for odroid boards. There is also a 5.4 kernel source on github but not with a C4 config.
I’ll ask the community there for a possibility.

Thank you so far :slight_smile:

1 Like

https://docs.linuxfactory.or.kr/install/odroidc4/image.html may help, I’ll check it out … works so far :slight_smile: