Skip to main content
Topic: [SOLVED] Set ARMtix chroot to cross compile (Read 664 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[SOLVED] Set ARMtix chroot to cross compile

I downloaded and extracted the tarball.

When I used artix-chroot:
Code: [Select]
==> WARNING: Documents/iso/armtix/armtix-dinit-20240303 is not a mountpoint. This may have undesirable side effects.

I got an error about missing space in cache when I started using it:
Code: [Select]
pacman -S git
...
:: Proceed with installation? [Y/n]
error: could not determine cachedir mount point /var/cache/pacman/pkg
error: failed to commit transaction (not enough free disk space)
Errors occurred, no packages were upgraded.

How do I make something to chroot into? To build packages.

Re: Set ARMtix chroot to cross compile

Reply #1
Just bind mount chroot to itself, like so: mount -o bind <path> <path>
ARMtix

Re: [SOLVED] Set ARMtix chroot to cross compile

Reply #2
That works, thanks.

Re: [SOLVED] Set ARMtix chroot to cross compile

Reply #3
After updating I cannot chroot:
Code: [Select]
chroot: failed to run command '/bin/bash': Exec format error
That should be the error when you do not have the necessary things.

Not sure to how check what's wrong:
Code: [Select]
dinitctl status binfmt
Service: binfmt
    State: STARTED
    Activation: start due to dependent(s)

world/qemu-user 9.0.0-1 [installed]
    QEMU user mode emulation
world/qemu-user-binfmt 9.0.0-1
    Binary format rules for QEMU user mode emulation
world/qemu-user-static 9.0.0-1 [installed]
    QEMU static user mode emulation
world/qemu-user-static-binfmt 9.0.0-1 [installed]


 

Re: Set ARMtix chroot to cross compile

Reply #4
https://www.kernel.org/doc/html/v5.9/admin-guide/binfmt-misc.html
https://wiki.archlinux.org/title/Binfmt_misc_for_Java

I had to mount it:
Code: [Select]
mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc

After I restart binfmt service but again error so I did it manually:
Code: [Select]
cat /usr/lib/binfmt.d/qemu-aarch64-static.conf
:qemu-aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-aarch64-static:FP

echo ':qemu-aarch64 [...] static:FP' > /proc/sys/fs/binfmt_misc/register

I wonder if something is wrong here locally or "/lib/artix/binfmt.sh" or something has a bug.

Re: Set ARMtix chroot to cross compile

Reply #5

I wonder if something is wrong here locally or "/lib/artix/binfmt.sh" or something has a bug.


This is not on openrc, right?

If so, could you please do a test?

In your /usr/lib/artix/ binfmt.sh, remove
Code: [Select]
"%d"
from the printf:

https://gitea.artixlinux.org/artix/artix-cgroups/src/branch/master/src/binfmt.sh.in#L36

Report back please.

Re: Set ARMtix chroot to cross compile

Reply #6
Right, I use dinit.

Now binfmt_misc is mounted but I have to write manually as before:

Code: [Select]
echo ':qemu-aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-aarch64-static:FP' >  /proc/sys/fs/binfmt_misc/register

Re: Set ARMtix chroot to cross compile

Reply #7
I think I can reproduce it. I pushed a fix. Wait for artix-cgroups-0.7.2 to hit the nearest mirror.
now only the dinit guy in artix

Re: Set ARMtix chroot to cross compile

Reply #8
I updated artix-cgroups and the system and now I can chroot.

For some reason cryptsetup service was disabled in the process.
I see some warning or error about dinit that cannot open /etc/dinit.d/live.d for tinydm service, which indeed does not exist.
I think that I did not have that before.
Maybe related to the update?

Re: Set ARMtix chroot to cross compile

Reply #9
Hi, I also use armtix much kudos to phoenix_king_rus. I use distcc to compile some packages including the linux kernel, but I always start the build on an aarch64  machine (rpi4/5). I have a couple of x86_64 machines where I offload some of the compilation. A late kernel (6.6.30) still takes a couple of hours, but I get it with an armtix logo :)

I have tried running qemu armv8 on an x86_64 box before, but it seemed fairly slow.

I tried to follow this thread, but have lost track a bit. I think it would be very helpful if someone could summarise what is actually needed to setup an aarch64 chroot on a an x86_x64 artix.