Latest linux kernel installation issue(rm: invalid option -- '0') - linux

I have clone the latest linux source from git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
And compile this kernel using (make O=/usr/local/kernel).
But when i install the kernel the following error getting,
# make O=/usr/local/kernel modules_install install
make[1]: Entering directory `/usr/local/kernel'
rm: invalid option -- '0'
Try 'rm --help' for more information.
make[1]: *** [_modinst_] Error 1
make: *** [sub-make] Error 2

I faced the same issue today (24/1/20) and after a bit of searching, I decided to remove the # in front of each line in modinst target in Makefile. The problem was immediately visible to me. If you add space in extra version, the space will appear in your folder name. So, if you write extra version as
EXTRAVERSION= -test[un-noticed-space-here]
Your module folder name will also have that space. To avoid it, I tried the following
Made sure that there are no spaces at the end of version lines in Makefile
Did "make kernelversion" and made sure that it is devoid of any space character
Did a
echo -n `make kernelversion`| wc
and reconfirmed above point by comparing wc output and the count of characters from previous step

Related

Blank file after make in vim

When I run :make in vim, and if I have an error in my one and only cpp file (main.cpp) vim shows me the errors and when I press enter it opens a file named
^[[H^[[Jmain.cpp
instead of
main.cpp
And I have to manually reopen my file. Any idea how to tell vim to open the right file?
I'm running
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Apr 20 2016 11:17:28)
MacOS X (unix) version
Included patches: 1-1655 Compiled by Homebrew
Error output:
main.cpp:40:2: error: unknown type name 'obvious'
obvious error
^
main.cpp:40:15: error: expected ';' at end of declaration
obvious error
^
;
2 errors generated.
rm: main: No such file or directory
make: *** [all] Error 1
Press ENTER or type command to continue
vim errorformat (as reported by :echo &errorformat)
%*[^"]"%f"%*\D%l: %m,"%f"%*\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%-GIn file included from %f:%l:%c:,%-GIn file included from %f:%l:%c\,,%-GIn file included from %f:%l:%c,%-GIn file included from %f:%l,%-G%*[ ]from %f:%l:%c,%-G%*[ ]from %f:%l:,%-G%*[ ]from %f:%l\,,%-G%*[ ]from %f:%l,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,"%f"\, line %l%*\D%c%*[^ ] %m,%D%*\a[%*\d]:Entering directory %*[`']%f',
%X%*\a[%*\d]: Leaving directory %*[`']%f',%D%*\a: Entering directory %*[`']%f',%X%*\a: Leaving directory %*[`']%f',%DMaking %*\a in %f,%f|%l| %m
Makefile looked something like this:
all:
clear && g++ main.cpp -o main
And the clear seems to be throwing it off. Workaround is to remove the clear or add an echo after
all:
g++ main.cpp -o main
all2:
clear && echo "" && g++ main.cpp -o main

byacc %defines syntax error when compiling with make command

I am trying to run Ymer tool in windows 10 platform. I have installed g++, gcc, yacc via cygwin. After configure command, When I am running make command to compile the application, it generates following error.
PS C:\ymer> make
/bin/sh ./ylwrap src/grammar.yy y.tab.c src/grammar.cc y.tab.h echo src/grammar.cc | sed -e s/cc$/hh/ -e s/cpp$/hpp/ -e s/cxx$/hxx/ -e s/c++$/h++/ -e s/c$/h/ y.output src/grammar.output -- byacc -d
byacc: e - line 514 of "/cygdrive/c/ymer/src/grammar.yy", syntax error
%defines
^
Makefile:2467: recipe for target 'src/grammar.cc' failed
make: *** [src/grammar.cc] Error 1
It seems the grammar.yy file causes the problem. Anyone knows how to solve this problem. BTW I am not familiar neither with yacc nor make files. I am just very new to cygwin as well.
Thank you,
The %defines declaration is bison-specific (not part of standard yacc). The file grammar.yy contains some bison features which byacc implements, but this is not one of those. (From the description in the manual page, it seems that this is equivalent to the standard command-line option -d, making it less than useful).

Linux: no such file or directory

I am new in Linux, can anyone tell me which directory the computer search for "ansinist.h"? Below is the syntax:
USER#USER-PC /cygdrive/f/Dataset_extract/500ppi-Legacy/SRC/BIN/TXT2NIST
$ make -f makefile.mak
gcc -ansi -O2 -I/include -L/lib -c txt2nist.c
txt2nist.c:15:22: fatal error: ansinist.h: No such file or directory
#include <ansinist.h>
^
compilation terminated.
makefile.mak:53: recipe for target 'txt2nist.o' failed
make: *** [txt2nist.o] Error 1
This answer could help you. In general case, be sure that you have installed the libraries that you're going to use in your project.
To find the file ansinist.h
sudo find / -name ansinist.h
And please paste your output here but you should be sure you installed all the required libraries first..
1)if your header file is in current directory then use #include "ansinist.h"
because this syntax search directly into current directory.
2)if your header file is in /usr/include/ then #include< ansinist.h>
because this syntax first search into /usr/include/ then current directory.
3)also you can use #include < /path/ansinist.h>
where path=path where is header file.
4)if above things will not work then please give value of #echo $PATH for next i can help you.

Make mistaking a path, failing with "No rule to make target"

I'm trying to build trace-cmd.git from source; the worst is, I had already built this once on this same machine, succesfully; however didn't keep any notes, and cannot tell what could have happened in the meantime.
So now I'm trying to rebuild, and I get the dreaded:
trace-cmd$ make
make: *** No rule to make target `/media/disk/trace-cmd/event-parse.c', needed by `event-parse.o'. Stop.
Ok, let's see what the debug says:
trace-cmd$ make -d
...
Successfully remade target file `trace_python_dir'.
Pruning file `tc_version.h'.
Considering target file `libparsevent.a'.
Considering target file `event-parse.o'.
Pruning file `/media/disk/src/trace-cmd/event-parse.c'. ## THIS EXISTS!
Pruning file `.event-parse.d'.
Considering target file `/media/disk/trace-cmd/event-parse.c'. ## THIS DOESN'T???
File `/media/disk/trace-cmd/event-parse.c' does not exist.
...
Trying pattern rule with stem `event-parse.w'.
Trying implicit prerequisite `/media/disk/trace-cmd/SCCS/s.event-parse.w'.
Trying pattern rule with stem `event-parse'.
Rejecting impossible implicit prerequisite `/media/disk/trace-cmd/event-parse.w'.
No implicit rule found for `/media/disk/trace-cmd/event-parse.c'.
Finished prerequisites of target file `/media/disk/trace-cmd/event-parse.c'.
Must remake target `/media/disk/trace-cmd/event-parse.c'.
make: *** No rule to make target `/media/disk/trace-cmd/event-parse.c', needed by `event-parse.o'. Stop.
OK, what is going on? Of course the actual file exists:
trace-cmd$ ls -la /media/disk/src/trace-cmd/event-parse.c
-rw-r--r-- 1 user user 121563 2013-03-20 19:03 /media/disk/src/trace-cmd/event-parse.c
... but this is /media/disk/src/trace-cmd/event-parse.c!! And:
make already found it once;
yet make decided to, for some reason, drop the /src/ from the path,
... and that file obviously doesn't exist:
trace-cmd$ ls /media/disk/trace-cmd/event-parse.c
ls: cannot access /media/disk/trace-cmd/event-parse.c: No such file or directory
Can someone explain me, for what possible reason could make decide to drop a part of the path, such that it cannot find a file, that it originally had a correct reference to?
Got it - thought I'd focus on that .event-parse.d file:
trace-cmd$ head -n 4 .event-parse.d
event-parse.o: /media/disk/trace-cmd/event-parse.c \
/usr/include/stdio.h /usr/include/features.h /usr/include/bits/predefs.h \
/usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \
/usr/include/gnu/stubs.h /usr/include/gnu/stubs-32.h \
... and indeed, that is the wrong path there... What happens if I delete this .d file?
trace-cmd$ rm .event-parse.d
trace-cmd$ make
COMPILE FPIC event-parse.o
make: *** No rule to make target `/media/disk/trace-cmd/trace-seq.c', needed by `trace-seq.o'. Stop.
Oh, my. There must be more of them:
trace-cmd$ ls .*.d
.event-parse.d .plugin_kmem.d .trace-filter.d .trace-options.d .trace-seq.d
.kbuffer-parse.d .plugin_kvm.d .trace-ftrace.d .trace-output.d .trace-split.d
.kernel-shark.d .plugin_mac80211.d .trace-graph.d .trace-plot-cpu.d .trace-stack.d
...
... and indeed, there are; apparently cached files from previous compilation, where indeed I compiled in another directory. And if I delete them all:
trace-cmd$ rm .*.d
trace-cmd$ make
...
gcc --shared event-parse.o trace-seq.o parse-filter.o parse-utils.o trace-util.o trace-input.o trace-ftrace.o trace-output.o trace-recorder.o trace-restore.o trace-usage.o trace-blk-hack.o kbuffer-parse.o ctracecmd_wrap.o -o ctracecmd.so
Note: to build the gui, type "make gui"
to build man pages, type "make doc"
Well, that seemingly worked; I'm back to being happy again :)
Cheers!

Error running make: missing separator (did you mean TAB instead of 8 spaces?)

I'm trying to get PHP phar command line tool installed on my Debian VM, how here described:
(1) download the php-src, I assume it's in /tmp/php/src
(2) make the dir /tmp/phar
(3) Save this as /tmp/php-src/ext/phar/Makefile.
(4) cd /tmp/php-src/ext/phar
(5) run sudo make
Now after step 5 I get an error:
:/tmp/php-src/ext/phar# make
Makefile:11: *** missing separator (did you mean TAB instead of 8 spaces?). Stop.
As I know, there can be two possible causes for this error message:
Tabs in the make file. I've tested the file with od -t c Makefile. The file contains no tabs (\t).
It could be a bug of make v3.81 and need a patch or an upgrade to (yet instable: "Warning: This package is from the experimental distribution.") v3.82. I've downloaded and istalled (dpkg -i make_3.82-1_amd64.deb) it, but the error is still occuring.
What causes the error? How can it be avoided?
Thx
(Answered in a comment: See Question with no answers, but issue solved in the comments (or extended in chat))
#Beta wrote:
The line should begin with a tab, not a bunch of spaces.
The OP wrote:
I've replaced all 8-spaces sequences with tabs and can execute the make script now.
I used:
cat Makefile|sed "s/ /\t/" > Makefile

Resources