please choosego to mobile | Continue to access the PC version
View: 6911|Reply: 7

Linux compilation problem for orange pi 3.

[Copy link]

1

threads

2

posts

21

credits

Novice

Rank: 1

credits
21
Published in 2019-3-8 10:52:30 | Show all floors |Read mode
Hello,

I want to build orange pi 3 images
when i compile in the order of "orange pi 3 user manual_v1.0.pdf"
building of u-boot, kernel  is OK,
but when i execute "build release image" menu, error occurred.
The error message is as follows.

I: Extracting mount...
I: Extracting util-linux...
I: Extracting liblzma5...
I: Extracting zlib1g...
Copy qemu emulator binary to rootfs.....
Copy debian-archive-keyring.....
Start debootstrap second stage.....
chroot: failed to run command ‘mount’: Exec format error
chroot: failed to run command ‘mount’: Exec format error
chroot: failed to run command ‘/debootstrap/debootstrap’: Exec format error

How can I solve this problem?

0

threads

12

posts

54

credits

Registered member

Rank: 2

credits
54
Published in 2019-3-18 06:25:26 | Show all floors
yes, you are right https://github.com/armbian/build is much better experience. compilet orange pi 3 image without any problems from first run in vagrant

4

threads

96

posts

931

credits

Senior member

Rank: 4

credits
931
Published in 2019-3-8 19:45:39 | Show all floors
Under which operating system are you trying to build an image?

1

threads

2

posts

21

credits

Novice

Rank: 1

credits
21
 Author| Published in 2019-3-11 09:26:11 | Show all floors
thanks for your reply.

my linux version is below.

daniel@ubuntu:~/orangepi3$ uname -a
Linux ubuntu 4.15.0-46-generic #49-Ubuntu SMP Wed Feb 6 09:33:07 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

daniel@ubuntu:~/orangepi3$ lsb_release -a
No LSB modules are available.
Distributor ID:        Ubuntu
Description:        Ubuntu 18.04.2 LTS
Release:        18.04
Codename:        bionic
daniel@ubuntu:~/orangepi3$

0

threads

12

posts

54

credits

Registered member

Rank: 2

credits
54
Published in 2019-3-15 02:48:47 | Show all floors
problem is that script is trying to change root (chroot) to different architecture. you are using x86 and it cannot execute arm binaries but this build script also does not work on arm. i guess using qemu to run arm code and running arm chroot binary would solve this

9

threads

634

posts

4398

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
4398
Published in 2019-3-15 15:07:05 | Show all floors
aivaras replied at 2019-3-14 19:48
problem is that script is trying to change root (chroot) to different architecture. you are using x8 ...

This script prepares everything.

0

threads

12

posts

54

credits

Registered member

Rank: 2

credits
54
Published in 2019-3-16 02:42:32 | Show all floors
Edited by aivaras at 2019-3-16 06:03
igorpec replied at 2019-3-15 15:07
This script prepares everything.

commentig bellow code lines which were took from https://github.com/orangepi-xunl ... ter/rootfs_build.sh


it uses chroot binary from x86 platform to execute mount which is aarm64.

example from compilation script
chroot: failed to run command ‘mount’: Exec format error
chroot: failed to run command ‘mount’: Exec format error
chroot: failed to run command ‘/debootstrap/debootstrap’: Exec format error
user@debian:~/OrangePiH6_Linux4.9$ uname -a
Linux debian 4.9.0-8-amd64 #1 SMP Debian 4.9.144-3 (2019-02-02) x86_64 GNU/Linux




do_chroot() {
                                
        cmd="$@"
               
               
        chroot "$DEST" mount -t proc proc /proc || true
               
               
        chroot "$DEST" mount -t sysfs sys /sys || true
               
               
        chroot "$DEST" $cmd
               
               
        chroot "$DEST" umount /sys
               
               
        chroot "$DEST" umount /proc
               
               
}
case $DISTRO in
                                
        arch)
               
               
                ROOTFS="http://archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz"
               
               
                ;;
               
               
        xenial)
               
               
                ROOTFS="http://cdimage.ubuntu.com/ubuntu-base/xenial/daily/current/xenial-base-arm64.tar.gz"
               
               
                ;;
               
               
        sid|jessie)
               
               
                ROOTFS="${DISTRO}-base-arm64.tar.gz"
               
               
                METHOD="debootstrap"
               
               
                ;;
               
               
        *)
               
               
                echo "Unknown distribution: $DISTRO"
               
               
                exit 1
               
               
                ;;

9

threads

634

posts

4398

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
4398
Published in 2019-3-17 17:19:25 | Show all floors
Edited by igorpec at 2019-3-17 10:20

Sorry, I mixed up the script. This https://github.com/armbian/build prepares everything. For Xunlong SDK I have no idea if it works but I guess it is also designed to run on Intel platform (cross compilation).
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list