When I'm trying to run riscv emulator asm tests I faced with below error:
./emulator-DefaultCPPConfig +dramsim +max-cycles=100000000 +verbose +loadmem=output/rv64ui-p-amoand_d.hex none 2> output/rv64ui-p-amoand_d.out && [ $PIPESTATUS -eq 0 ]
/bin/sh: 1: [: -eq: unexpected operator
make: *** [output/rv64ui-p-amoand_d.out] Error 2
I followed your instruction in your git. It can build emulator without any error, but problem happens when it's trying to run tests.
I added bash behind of the command in the makefile and the first error solved but when I did that I got a new error:
bash ./emulator-DefaultCPPConfig +dramsim +max-cycles=100000000 +verbose +loadmem=output/rv64ui-p-amoswap_d.hex none 2> output/rv64ui-p-amoswap_d.out && [ $PIPESTATUS -eq 0 ]
make: *** [output/rv64ui-p-amoswap_d.out] Error 126
The problem is from Shell variable, I just needed to add following line to Makefile:
SHELL=/bin/bash
It would solve the problem.
Related
I am trying to compile a software environment in Cygwin using make -j command and this error always shows up.
!error Hello World>
/bin/sh: -c: line 0: syntax error near unexpected token 'newline'
make: ***[makefile:404: ] Error 1
I have been trying to further understand the Sitara Am335x PRUs and I tried to follow the TI labs on how to get started with Programmable real-time units on the BeagleBone Black and but I encountred this problem that I couldn't overcome;
sudo -i
cp /home/debian/pru_blinky.out /lib/firmware/pru_blinky
cd /sys/class/remoteproc/remoteproc1
echo 'pru_blinky' > firmware
but when I type echo 'start' > state I get the following error
this is the return of man echo
NAME
echo - display a line of text
SYNOPSIS
echo [SHORT-OPTION]... [STRING]...
echo LONG-OPTION
DESCRIPTION
Echo the STRING(s) to standard output.
-n do not output the trailing newline
-e enable interpretation of backslash escapes
-E disable interpretation of backslash escapes (default)
--help display this help and exit
--version
output version information and exit
-bash: echo: write error: Invalid argument
I tried to to specify the directory and file with command: echo 'pru_blinky/pru_blinky.out' > firmware but still problem not solved
can anyone explain to me what am i doing wrong here
I am trying to build an image "core-image-apd-level" but while running the command "bitbake core-image-apd-level", I am getting the mentioned error.
This is the complete log file data:
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 4
| : && /bin/mkdir -p doc && { PATH='/home/manoj/apd-source/build/tmp/work/x86_64-linux/automake-native/1.15-r0/build/t/wrap:'$PATH && export PATH; } && /usr/bin/perl ../automake-1.15/doc/help2man --output=doc/automake-1.15.1 automake-1.15
| help2man: can't get `--help' info from automake-1.15
| Try `--no-discard-stderr' if option outputs to stderr
| Makefile:3687: recipe for target 'doc/automake-1.15.1' failed
| make: *** [doc/automake-1.15.1] Error 255
| WARNING: exit code 1 from a shell command.
| ERROR: oe_runmake failed
| ERROR: Function failed: do_compile (log file is located at /home/manoj/apd-source/build/tmp/work/x86_64-linux/automake-native/1.15-r0/temp/log.do_compile.26476)
ERROR: Task 552 (virtual:native:/home/manoj/apd-source/poky/meta/recipes-devtools/automake/automake_1.15.bb, do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 98 tasks of which 93 didn't need to be rerun and 1 failed.
Waiting for 0 running tasks to finish:
Summary: 1 task failed:
virtual:native:/home/manoj/apd-source/poky/meta/recipes-devtools/automake/automake_1.15.bb, do_compile
Summary: There was 1 WARNING message shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
How do I get past this error?
I have found 2 solutions when the issue occurs, you can either:
1.downgrade perl or upgrade automake
or
2.modify make file
while I chose later one for automake is less likey changed,
and less impact, comparing to perl for me.
Hope it helps.
I am trying to check if a program is installed on a linux system by comparing command output with an expected output. I expect the program not to be present and so if program is abc then I should see:
bash: abc: command not found
But instead I am getting this output:
Shell for this session: bash
./checkprogs.sh: line 17: [: too many arguments
addgroup feature enabled test 1
./checkprogs.sh: line 15: tftp: command not found
./checkprogs.sh: line 17: [: too many arguments
tftp feature enabled test 2
2 tests performed
Here is the bash code:
ourshell="/bin/bash"
ourshell=${ourshell#*bin/}
echo "Shell for this session: $ourshell"
counter=1
# list of programs we want to test if available
progs='addgroup tftp'
for prog in $progs
do
expected="$ourshell: $prog: command not found"
#echo "$expected"
progoutput=$($prog -h)
#echo "prog output is: $progoutput"
if [ $expected != $progoutput ]
then
echo "test failed"
fi
echo "$prog feature enabled test $counter"
((counter++))
done
((counter--))
echo "$counter tests performed"
How can I fix this?
On the system I am working on, the shell is bash and addgroup is present but tftp is not.
Please note that I am on an embedded platform and "expect" is not installed. Assume minimal linux installation.
EDIT:
had to add space after [ and before ] - but even after fixing that still doesn't work as expected.
EDIT:
sorry I am new to bash scripting...
If I quote the strings inside [ ] and add 2>&1 to progoutput then code looks like this:
progoutput=$($prog -h 2>&1) # line 15
if [ "$expected" != "$progoutput" ] # line 17
and just so anyone can try this:
progs='ls invalidxxx' # line 9
then output is:
Shell for this session: bash
test failed
ls feature enabled test 1
test failed
invalidxxx feature enabled test 2
2 tests performed
actual method of string comparison
if [ "$expected" != "$progoutput" ]
or
if [[ $expected != $progoutput ]]
I have installed tpm emulator successfully. I get this error
* Starting Trusted Computing daemon tcsd /etc/init.d/trousers: 32: [: /dev/tpm: unexpected operator [fail]
invoke-rc.d: initscript trousers, action "start" failed.
dpkg: error processing trousers (--configure):
subprocess installed post-installation script returned error exit status 2
E: Sub-process /usr/bin/dpkg returned an error code (1)
when executing
sudo apt-get install tpm-tools libtspi-dev
The answer to that particular error message is a broken line in the given script /etc/init.d/trousers.
The offending line 32:
31:
32: if [ ! -e /dev/tpm* ]
33: then
gets expanded to:
if [ ! -e /dev/tpm /dev/tpm0 ]
Which provokes an error. Changing that line to something like:
31:
32: if [ ! -e /dev/tpm ] && [ ! -e /dev/tpm0 ]
33: then
should at least make the script work.