Skip to content

Error while building 64-bit image #189

Closed

Description

@tampe125

Hello,

I'm currently trying to build an image from standard Raspberry Pi 64-bit image (2022-09-22-raspios-bullseye-arm64). However it fails with the following error:

++ uname -m
+ '[' x86_64 '!=' armv7l ']'
++ uname -m
+ '[' x86_64 '!=' aarch64 ']'
+ '[' armv7l == armv7l ']'
+ grep -q gentoo /etc/os-release
++ which qemu-arm-static
+ cp /usr/bin/qemu-arm-static usr/bin/qemu-arm-static
+ cp /home/tampe125/git/CustomPiOS/src/modules/base/start_chroot_script chroot_script
+ chmod 755 chroot_script
+ cp /home/tampe125/git/CustomPiOS/src/common.sh common.sh
+ chmod 755 common.sh
++ uname -m
+ '[' x86_64 '!=' armv7l ']'
++ uname -m
+ '[' x86_64 '!=' aarch64 ']'
++ uname -m
+ '[' x86_64 '!=' arm64 ']'
+ '[' armv7l == armv7l ']'
+ echo 'Building on non-ARM device a armv7l system, using qemu-arm-static'
Building on non-ARM device a armv7l system, using qemu-arm-static
+ grep -q gentoo /etc/os-release
+ chroot . usr/bin/qemu-arm-static /bin/bash /chroot_script
qemu-arm-static: /bin/bash: Invalid ELF image for this architecture

Any clues on that? Am I missing something or 64-bit images are not supported?
I'm currently using Ubuntu 22.04

Activity

  1. guysoft commented on Jan 16, 2023

    @guysoft
    Owner

    Hey, what is the output of uname -m on your pi? and what is the output of arch?
    Because it looks like the pi is saying its using a 32bit system.

    It might also be related to a commit that went in yesterday that changed the detection method:
    7657844

    cc @bwalex who made that commit if its relevant

  2. tampe125 commented on Jan 16, 2023

    @tampe125
    Author

    Mhm wait, I'm building the image from my workstation, not from my pi, so I'm doing a cross compilation here.
    Do you still need the output from those two commands you posted?

    Edit: I'm not running it from Docker, but from the "live" system

  3. guysoft commented on Jan 16, 2023

    @guysoft
    Owner

    A full log might help.

    The error at the bottom is that its using qemu-arm-static which is not compatible with the /bin/bash in the image.
    If you are building on ubuntu perhaps using the docker build method would be a good way to ensure that there is no environment irregularity.

  4. hrueger commented on Jan 17, 2023

    @hrueger

    @tampe125 did you add export BASE_ARCH=arm64 to the config file? that solves the issue for me.

  5. guysoft commented on Jan 18, 2023

    @guysoft
    Owner
  6. dirkhh commented on Apr 21, 2023

    @dirkhh
    Contributor

    So the challenge that I see with this is that when I try to build an armv7l distro on an aarch64 system, it fails with

    ++++ uname -m
    +++ '[' aarch64 '!=' aarch64 ']'
    +++ echo 'Building on ARM device a armv7l/aarch64/arm64 system, not using qemu'
    Building on ARM device a armv7l/aarch64/arm64 system, not using qemu
    +++ chroot . /bin/bash /chroot_script
    chroot: failed to run command '/bin/bash': Exec format error
    

    i.e., it fails to run the shell inside the chroot

  7. guysoft commented on Apr 25, 2023

    @guysoft
    Owner

    @dirkhh
    hmm, it looks like the arch is set to 64bit.
    I am pushing a fix, make sure that you set in config:

    export BASE_ARCH=armv7l

    Could you test that it works for you?
    If not a full log might help me diagnose better

  8. guysoft commented on Aug 21, 2023

    @guysoft
    Owner

    Any news on this? Closing if no reply.

  9. dirkhh commented on Aug 21, 2023

    @dirkhh
    Contributor

    My issue is solved, but I'm not the original poster...

  10. guysoft commented on Aug 21, 2023

    @guysoft
    Owner

    Will wait to see if @tampe125 has an answer, and if not will close it

  11. tampe125 commented on Aug 21, 2023

    @tampe125
    Author

    Hello,
    Thank you for the ping. Honestly I simply reverted to the 32-bit version, since it's pretty critical for my application. Maybe in the future I'll try again, if I have problems I'll open a new issue

  12. guysoft commented on Aug 21, 2023

    @guysoft
    Owner

    Ok, since we think its fixed closing for now. If you change your mind feel free to re-open the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions