0
votes

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

1
Show the code that's failing. If you aren't interested in the Makefile syntax, then a programming Q&A is not the right place to get help.Ben Voigt
See the Makefile code github.com/torvalds/linux/blob/master/Makefile I have only modify the EXTRAVERSION fielduser1960200
And what, exactly, have you changed EXTRAVERSION to? Did the build fail before you changed it?Ben Voigt
Changed to "EXTRAVERSION = -myName". Before my build works. Then i will pull the latest changes(git pull) and rebuild again.But failed the builduser1960200
Its worked after remove the Makefile and download a new one then compile and build it.user1960200

1 Answers

0
votes

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

  1. Made sure that there are no spaces at the end of version lines in Makefile

  2. Did "make kernelversion" and made sure that it is devoid of any space character

  3. Did a

     echo -n `make kernelversion`| wc
    

and reconfirmed above point by comparing wc output and the count of characters from previous step