Jump to content

Problem building from source code


Go to solution Solved by Eric Johnson,

Recommended Posts

Posted

I'm not certain this is in the correct forum. Please advise or move if not 😕

 

I'm trying to build from source code, and running into a problem between chroot & qemu - I'm not really sure which or both or what. When I attempt to build with SHARE_LOG=yes, I get "Error: cannot post" as the result.

 

So, I'm building from:

Windows 11 Home 23H2
i5-10500H

Ubuntu 24.04 WSL from Windows Terminal

 

I'm building for:

Orange Pi Zero 3 4gb

Armbian Edge

Bookworm Server

 

I get the following error:

 

[💲|🌱] Applying distribution specific tweaks for [ bookworm ]
[💲|🔨]   chroot: failed to run command ‘/usr/bin/env’: Exec format error
[💲|💥] Cleaning up [ please wait for cleanups to finish ]
[💲|🌿] Unmounting recursively [ SDCARD - be patient ]
[💲|🌿] Unmounting recursively [ MOUNT - be patient ]
[💲|🌿] ANSI log file built; inspect it by running: [ less -RS output/logs/log-build-7c70cb75-34bc-4c8f-8c7d-69066fb9d14c.log.ans ]
[💲|🌱] SHARE_LOG=yes, uploading log [ uploading logs ]
[💲|🌿] Log uploaded, share URL: [ <!DOCTYPE html> <html lang=en> <head> <meta charset=utf-8> <title>Error</title> </head> <body> <pre>Cannot POST /log</pre> </body> </html> ]

 

I believe this is related: https://github.com/armbian/build/issues/5330#issuecomment-2210559531

 

I tried following the steps outlined, with the following results:

 

$ sudo update-binfmts --enable qemu-arm
update-binfmts: warning: qemu-arm not in database of installed binary formats.
update-binfmts: exiting due to previous errors
$ arch-test
amd64
i386
win32
win64
x32

 

Relevant portion(s) of log:

 

# Armbian ANSI build logs for 7c70cb75-34bc-4c8f-8c7d-69066fb9d14c - use "less -SR" to view
# Armbian build at Tue Dec 31 15:31:16 EST 2024 on DESKTOP-IVI63TV
------------------------------------------------------------------------------------------------------------
# Repeat build: ./compile.sh build BOARD=orangepizero3 BRANCH=edge BUILD_DESKTOP=no BUILD_MINIMAL=no KERNEL_CONFIGURE=yes RELEASE=bookworm SHARE_LOG=yes
# ARGs: 'PREFER_DOCKER=no' 'ARMBIAN_RELAUNCHED=yes' 'SET_OWNER_TO_UID=1000' 'SHARE_LOG=yes' 'build'
------------------------------------------------------------------------------------------------------------
# GIT revision
   commit bab9b3fbe383a2a2b1224d2bd4ca4d26142ed020 (HEAD -> main, origin/main, origin/HEAD)
   Author: pykpkg47 <118465017+pykpkg47@users.noreply.github.com>

       rock-3a:add u-boot image for sata boot
------------------------------------------------------------------------------------------------------------
# GIT status
   On branch main
   Your branch is up to date with 'origin/main'.

   Changes not staged for commit:
     (use "git add <file>..." to update what will be committed)
     (use "git restore <file>..." to discard changes in working directory)
        modified:   config/kernel/linux-sunxi64-edge.config

   no changes added to commit (use "git add" and/or "git commit -a")
------------------------------------------------------------------------------------------------------------
### config_early_init.log
--> (0) INFO: Starting single build process [ no BOARD set ]
--> (0) INFO: Checking [ basic host setup ]
--> (0) INFO: Build host OS release [ noble ]
--> (0) INFO: Build host architecture [ amd64 ]
--> (0) INFO: Detected WSL2 - experimental support [ Windows Subsystem for Linux 2 ]
--> (5) INFO: Generating list of all available boards [ might take a while ]
--> (6) ERROR: Error 3 occurred in main shell [ at /home/eric/build/lib/functions/configuration/menu.sh:38
       dialog_if_terminal_set_vars() --> lib/functions/configuration/menu.sh:38
      interactive_config_ask_board_list() --> lib/functions/configuration/interactive.sh:149
      config_possibly_interactive_kernel_board() --> lib/functions/main/config-interactive.sh:16
       prep_conf_main_build_single() --> lib/functions/main/config-prepare.sh:21
            cli_standard_build_run() --> lib/functions/cli/cli-build.sh:22
           armbian_cli_run_command() --> lib/functions/cli/utils-cli.sh:136
                    cli_entrypoint() --> lib/functions/cli/entrypoint.sh:176
                              main() --> compile.sh:50
    ]
--> (8) INFO: Generating list of all available boards [ might take a while ]
------------------------------------------------------------------------------------------------------------
### config_source_board_file.log
--> (19) INFO: Sourcing board configuration [ /home/eric/build/config/boards/orangepizero3.csc ]
--> (19) INFO: Enabling extension [ uwe5622-allwinner ]
--> (19) CHANGE-TRACKING: change-tracking: after sourcing board file config/boards/orangepizero3.csc [ BOARDFAMILY='sun50iw9' ]
--> (19) CHANGE-TRACKING: change-tracking: after sourcing board file config/boards/orangepizero3.csc [ BOOTCONFIG='orangepi_zero3_defconfig' ]
--> (19) CHANGE-TRACKING: change-tracking: after defaulting LINUXFAMILY to BOARDFAMILY [ LINUXFAMILY='sun50iw9' ]
------------------------------------------------------------------------------------------------------------
     
     ...
     ...
     ...
     
--> (31) COMMAND: update-binfmts --enable qemu-arm
   update-binfmts: warning: qemu-arm not in database of installed binary formats.
   update-binfmts: exiting due to previous errors
   -->--> command failed with error code 2 after 0 seconds
--> (31) WARNING: stacktrace for failed command [ exit code 2:/usr/bin/env bash -e -o pipefail -c update-binfmts --enable qemu-arm
           run_host_command_logged() --> lib/functions/logging/runners.sh:193
       prepare_host_noninteractive() --> lib/functions/host/prepare-host.sh:179
                   do_with_logging() --> lib/functions/logging/section-logging.sh:81
                      prepare_host() --> lib/functions/host/prepare-host.sh:17
                 prepare_host_init() --> lib/functions/main/start-end.sh:64
          main_default_start_build() --> lib/functions/main/start-end.sh:17
             do_with_default_build() --> lib/functions/main/default-build.sh:41
            cli_standard_build_run() --> lib/functions/cli/cli-build.sh:25
           armbian_cli_run_command() --> lib/functions/cli/utils-cli.sh:136
                    cli_entrypoint() --> lib/functions/cli/entrypoint.sh:176
                              main() --> compile.sh:50 ]
--> (31) ERROR: Failed to update binfmts [ update-binfmts --enable qemu-arm ]

 

<
Posted
8 hours ago, Eric Johnson said:

and it simply won't work.


We mainly use Ubuntu Jammy / noble, native or virtualized. All those variants are automatically tested all the time, unlike Windows WSL. I don't know what it the status, but people reported some problems recently. VirtualBox (or similar) and Ubuntu Jammy / Noble is the safest way.

Team behind is not professional, so I can't say when this will be fixed. But we are working on.

Posted

I made progress with Debian. I now have permission issues,  I think.  It got right up to the point of writing the image,  and failed.  I'm going to ditch WSL and install something... Debian, probably,  alongside Windows and just do it that way.  I don't like Virtualbox. I'd rather dual boot.... I do have another laptop running Ubuntu, but it's only a dual core - it would probably take days to compile.  

Posted

I'd think WSL is Microsoft's version of Virtualbox, so if you have Ubuntu or Debian running in it, it is Linux, which is a reason it is surprising it didn't work 😛

 

When I tried building Armbian in a systemd-nspawn container running Ubuntu Jammy.

it has issues with loop devices and I worked around them as discussed in this thread.

Missing the loop devices will cause writing the image to fail and abort at the last stage.

I don't think the loop devices problem is identical, but that the problems may be similar.

Fixing the loop devices issue may require editing the build scripts in particular the image creation parts, I did that once and managed a successful build.

However, in a subsequent update, a git merge 'messed up' my changes and I'd need to figure out how I did it again which I had forgotten.

 

 

Posted
11 часов назад, Eric Johnson сказал:

I made progress with Debian. I now have permission issues,  I think.  It got right up to the point of writing the image,  and failed.  I'm going to ditch WSL and install something... Debian, probably,  alongside Windows and just do it that way.  I don't like Virtualbox. I'd rather dual boot.... I do have another laptop running Ubuntu, but it's only a dual core - it would probably take days to compile.

 

My x86_64 work machine has openSUSE OS installed.
I use QEMU KVM and Virtualbox Manager.
I'm just installing an ubuntu server from the official website in this VM.
The disk size for a VM is 55-60 GB.
And already in this ubuntu VM, I'm cloning the armbian repository.
In case of a VM malfunction, it is easy to restore it from a snapshot.

  • Solution
Posted

Apparently, Linux hates my laptop (the one I use regularly), because it didn't want to build even running natively. So, I used my other crappy laptop, and have a successful build after 4 hours running on Ubuntu 24.04 natively on a dual-core 1.6ghz. Bit faster than I anticipated, really.

 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines