GithubHelp home page GithubHelp logo

Comments (8)

zerog2k avatar zerog2k commented on May 27, 2024 1

thanks @viraniac but looking at my host os I see this:

jens@mars:~$ dpkg -l | grep binfmt
ii  binfmt-support                         2.1.8-2                                              amd64        Support for extra binary formats
ii  qemu-user-binfmt                       1:2.11+dfsg-1ubuntu7.42+esm1                         amd64        QEMU user mode binfmt registration for qemu-user
jens@mars:~$ /usr/sbin/update-binfmts --display qemu-arm
qemu-arm (enabled):
     package = qemu-user-binfmt
        type = magic
      offset = 0
       magic = \x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00
        mask = \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff
 interpreter = /usr/bin/qemu-arm
    detector = 

(this is after a reboot)

I'll try to remove the armbian build container and reproduce the issue...

from build.

github-actions avatar github-actions commented on May 27, 2024

Jira ticket: AR-1989

from build.

zerog2k avatar zerog2k commented on May 27, 2024

I want to dig into the Dockerfile and container build process a bit more, but this appears to be a bit more dynamically built.
I do see the build process here:
https://gist.github.com/zerog2k/e5987095fd0a67d648d402f3f7e7bbf3#file-gistfile1-txt-L9-L198
but there is nothing obvious to me (i.e. failing pkg install, etc) which is standing out.
It appears that the package is already installed in the base container (ghcr.io/armbian/docker-armbian-build:armbian-ubuntu-jammy-latest)?

jens@mars:~/build/armbian$ docker ps --no-trunc
CONTAINER ID                                                       IMAGE                                                                     COMMAND                                                                                                                                                                                                                                                                                        CREATED          STATUS                PORTS                                                                                                                                                                     NAMES
7727cfee645eab8fdcbe0dc4eadf37d29ea30bf55da3b7f16784b5816f60b3c9   armbian.local.only/armbian-build:initial                                  "/bin/bash /armbian/compile.sh PREFER_DOCKER=no BUILD_MINIMAL=no BUILD_DESKTOP=no ARMBIAN_BUILD_UUID=f10848de-ba80-4825-a9e3-3c68b2f2a277 ARMBIAN_RELAUNCHED=yes BRANCH=edge EXTRAWIFI=no BOARD=onecloud SKIP_LOG_ARCHIVE=yes SET_OWNER_TO_UID=1000 RELEASE=jammy KERNEL_CONFIGURE=no build"   25 minutes ago   Up 25 minutes                                                                                                                                                                                   sweet_aryabhata

if there are any docs or pointers on digging into the Dockerfile build process, I may be able to resolve this myself.

from build.

viraniac avatar viraniac commented on May 27, 2024

Try installing binfmt-support on your host OS (ubuntu-18.04). That will add a service which will update binary format information. I think the issue is caused as nothing is running /usr/sbin/update-binfmts --enable on your system and hence even though docker container has binfmt-support and qemu-user-static installed, its not able to run the binary. When you reinstalled qemu-user-static, the post install procedure of the deb file would have called the same, making it look like that the issue is resolved. If my understanding is correct, the issue might re-appear if you restart your system.

Its also possible that you already installed qemu-user-static on your host os after encountering this issue. That would have installed binfmt support thereby fixing the issue.

from build.

viraniac avatar viraniac commented on May 27, 2024

I'll try to remove the armbian build container and reproduce the issue...

The container is removed after compile.sh finishes execution. Atleast thats what happens for me on MacOS. Is it being retained on Linux?

from build.

zerog2k avatar zerog2k commented on May 27, 2024

So I had to do a different arm64 build, and I run into the same thing:
https://paste.next.armbian.com/ebediyagof

If i run compile.sh docker-shell, then I can see with /usr/sbin/update-binfmts --display that all of them are disabled. Back in the host os, /usr/sbin/update-binfmts --display shows all are enabled.

so after a bit of reading on qemu & binfmt, i found this extremely helpful article:
https://medium.com/@artur.klauser/building-multi-architecture-docker-images-with-buildx-27d80f7e2408

it has two scripts which were helpful, as ubuntu 18.04 seems to suffer from the
ERROR: QEMU not registered in binfmt_misc with fix-binary (F) flag. issue

jens@mars:~$ bin/check-qemu-binfmt.sh 
OK: docker 20.10.21 supports buildx experimental feature.
OK: kernel 4.15.0-219-generic has binfmt_misc fix-binary (F) support.
OK: /proc/sys/fs/binfmt_misc is mounted
OK: update-binfmts 2.1.8 has fix-binary (F) support.
ERROR: QEMU not registered in binfmt_misc with fix-binary (F) flag.

jens@mars:~$ sudo bin/reregister-qemu-binfmt.sh 
Reregistering arch aarch64
Reregistering arch alpha
Reregistering arch arm
Reregistering arch armeb
Reregistering arch cris
Reregistering arch m68k
Reregistering arch microblaze
Reregistering arch mips
Reregistering arch mips64
Reregistering arch mips64el
Reregistering arch mipsel
Reregistering arch ppc
Reregistering arch ppc64
Reregistering arch ppc64abi32
Reregistering arch ppc64le
head: cannot open '/var/lib/binfmts/qemu-riscv64' for reading: No such file or directory

jens@mars:~$ bin/check-qemu-binfmt.sh 
OK: docker 20.10.21 supports buildx experimental feature.
OK: kernel 4.15.0-219-generic has binfmt_misc fix-binary (F) support.
OK: /proc/sys/fs/binfmt_misc is mounted
OK: update-binfmts 2.1.8 has fix-binary (F) support.
OK: QEMU registered in binfmt_misc with flags OCF (F is required).
Host looks good for docker buildx multi-architecture support.

armbian compile seems to be running now, although I'm getting alot of qemu: Unsupported syscall: 293 types of errors.

will do some more testing

from build.

zerog2k avatar zerog2k commented on May 27, 2024

ubuntu-18.04 is EOL now anyhow, but unfortunately my ancient build box still has to run this (with 4.x kernel) due to ancient nvidia card and driver support which doesnt work with newer kernels/xorg in ubuntu-20+ :(
so I'm going to chalk this up to, an ubuntu-18 issue which, is a wontfix

from build.

zerog2k avatar zerog2k commented on May 27, 2024

just dropping a note of closure here, just in case anyone else is trying to figure this out

looks like I also needed to uncomment the

DOCKER_FLAGS+=(--privileged)

in userpatches/config-docker.conf, and this took care of the qemu unsupported syscalls, and everythign is building fine

from build.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.