Today intends to compile support Orange PI Development Board Raspbain Jessie System from GitHub to take the source, download, compile, has been relatively smooth
The result is half-compiled with an error:
206:/bin/sleepfile: Exec format error
Based on the error message, the statement was found as follows:
while kill -0 $12>/dev/nulldo i=$ (((i+ 1)%4 ) "\r$2 ${spin: $i: 1}" Sleep . 1 Done
A simple sleep, how can be malformed? It's okay to do it alone? Continue to look up, found in the Create_image script called the Second-stage, the call statement is as follows:
# ********************************************************************************# If running on ARM (ORANGEPI) with the line without"qemu-arm-static"!!! ****# ********************************************************************************#if! Chroot $odir/bin/bash/second-stage; Thenif!chroot$odir/usr/bin/qemu-arm-static-cpu Cortex-a9/bin/bash/second-stage; Then MV$odir/Install. log. >/dev/NULL 2>&1 Echo "================================================" Echo "ERROR on Second-stage, instalation not finished." Echo "================================================"Exit1fi
The original is called after executing the chroot, which means that the actual call is
~/orangepi/orangepih3/output/linux-jessie/bin/Sleep
But it is specified here to be called with the qemu-arm-static command, how is it wrong? What is the use of this command? The following tests were done:
sudo chroot ~/orangepi/orangepih3/output/linux-Jessie/usr/bin/qemu-arm-static-cpu cortex-a9/bin/ Bash
Smooth call! But under the arm version of Bash, it's still not possible to call/bin/sleep, which is the same hint:
file: Exec format error
The original qemu-arm-static is only valid for the current program, and does not change the System program execution environment, so the arm version of the/bin/sleep as a x86 program has been processed, which is called/bin/ Sleep also needs to use the qemu-arm-static command to invoke, do you need to change the script? That's a lot of change, is there a convenient way?
So Google took the next, in the article:
Emulating ARM on Debian/ubuntu
, a key step is missing:
#This can only is run as root (sudo don't work)sudosuecho' : arm:m::\x7felf\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\ Xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:' >/proc/ sys/fs/binfmt_misc/registerexit
This statement means to register qemu-arm-static as the default interpreter for ARM executables! After performing this step, you do not need to specify qemu-arm-static as the interpreter, directly call the ARM program to execute
Continue with the compilation, success!
Error solving when ARN Linux compiles the system