Error Failed To Compile The Modules_install Target
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up When compiling a custom kernel modules_install results in an error up vote 0 down vote favorite I am trying to install a custom kernel and all goes fine except when i run make modules_install it results in the following: ln: target ‘/lib/modules/4.2.0-rc4/source’ is not a directory Makefile:1120: recipe for target '_modinst_' failed make: *** [_modinst_] Error 1 I looked up line number 1120 in Makefile and it contained this: _modinst_: @rm -rf $(MODLIB)/kernel @rm -f $(MODLIB)/source @mkdir -p $(MODLIB)/kernel I googled a lot and all i found was it occurred (mostly what i found) due to an extra space in the EXTRAVERSION variable in the Makefile but there is no space in my Makefile. Can anyone point me in the right direction? Edit : I followed the suggestions in comments below and did ls -al /lib/modules/4.2.0-rc4/. There is no source file or source directory present and running modules_install with the make --trace produces this: Makefile:1120: target '_modinst_' does not exist rm -rf /lib/modules/4.2.0-rc4/kernel rm -f /lib/modules/4.2.0-rc4/source mkdir -p /lib/modules/4.2.0-rc4/kernel ln -s `cd . && /bin/pwd` /lib/modules/4.2.0-rc4/source ln: target ‘/lib/modules/4.2.0-rc4/source’ is not a directory Makefile:1120: recipe for target '_modinst_' failed make: *** [_modinst_] Error 1 linux makefile linux-kernel share|improve this question edited Aug 5 '15 at 15:30 asked Aug 5 '15 at 8:39 Abhinav Jain 1438 Have you tried it with sudo? Like sudo make modules_install? –Sam Protsenko Aug 5 '15 at 10:19 I don't see any way that this rule can generate this error. It doesn't invoke ln at all, and the only reference to .../source is in the rm -f command which doesn't expect source to be a directory. –MadScientist Aug 5 '15 at 13:14 Yes i run it with sudo because it requires those permissions.My bad for not mentioning before that "sudo make modules_install" resulted in this error. –Abhinav Jain Aug 5 '15 at 13:30 @MadScientist I did all this a while ago on my system and it all went good without any problems but now this error.I am just clueless because I did not made any kind of change
of Manjaro, it compiles fine, but when I use the openRC version, it fails. The following is the error output: ==> Entering fakeroot environment... ==> Starting package_linux45()... /bin/sh: -c: line 0: syntax error near unexpected token `(' /bin/sh: -c: line 0: `rm -rf /home/alex/Projects/Kernel Build/packages-core/linux45 (copy 1)/pkg/linux45/lib/modules/4.5.6-1-MANJARO/kernel' Makefile:1130: recipe for target '_modinst_' failed make: *** [_modinst_] Error 1 ==> ERROR: A http://stackoverflow.com/questions/31827465/when-compiling-a-custom-kernel-modules-install-results-in-an-error failure occurred in package_linux45(). Aborting... It fails at this line specifically:make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}" modules_install Any ideas? I got the files from manjaro-core after it was updated two days ago. (I've tagged this with openRC becuase I'm having the problem on this install and not my other one.) FadeMind https://forum.manjaro.org/t/kernel-compilation-failed-solved/3257 2016-06-05 17:10:45 UTC #2 attach sources (PKGBUILD) - paste it on pastebin.com OrangeGull 2016-06-05 17:27:43 UTC #3 http://pastebin.com/MRLZ43uA You will notice lines like echo '1', etc., this is how I tracked down where the issue was. FadeMind 2016-06-05 17:34:12 UTC #4 source=(#"https://www.kernel.org/pub/linux/kernel/v4.x/linux-${_basekernel}.tar.xz" Del this line, array cannot begin with # OrangeGull 2016-06-05 17:59:24 UTC #5 No dice, note output is the same: ==> Entering fakeroot environment... 5 ==> Starting package_linux45()... 1 1.1 1.2 /bin/sh: -c: line 0: syntax error near unexpected token `(' /bin/sh: -c: line 0: `rm -rf /home/alex/Projects/Kernel Build/packages-core/linux45 (copy 1)/pkg/linux45/lib/modules/4.5.6-1-MANJARO/kernel' Makefile:1130: recipe for target '_modinst_' failed make: *** [_modinst_] Error 1 ==> ERROR: A failure occurred in package_linux45(). Aborting... [alex@manjaro linux45 (copy 1)]$ I changed the PKGBUILD to: source=(https://github.com/torvalds/linux/archive/v${_basekernel}.tar.gz "http://www.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.xz" # the main kernel config files... I don't get past line 186. philm 2016-06-05 18:06:17 UTC #6 FadeMind
2 posts by alexbain » Sun Jul 08, 2012 6:51 pm This is my first attempt at compiling the rPi kernel and I'm having some troubles with https://www.raspberrypi.org/forums/viewtopic.php?t=10642&p=131220 the very last step in this guide:"Transferring The Image To The Raspberry Pi" http://elinux.org/RPi_Kernel_CompilationI've moved the linux directory to my rPi and ran the "sudo make modules_install" command but it's failing here: ... INSTALL sound/usb/misc/snd-ua101.ko INSTALL sound/usb/snd-usb-audio.ko INSTALL sound/usb/snd-usbmidi-lib.ko IHEX2FW firmware/emi26/loader.fw/home/pi/rpi-linux/firmware/ihex2fw: 1: /home/pi/rpi-linux/firmware/ihex2fw: Syntax error: "(" unexpectedmake[1]: *** [firmware/emi26/loader.fw] Error 2make: *** [_modinst_post] Error 2I searched these forums and was unable to find anyone error failed encountering this error before. Any advice or reading I can do to figure out how to get past it?Thanks! Posts: 6Joined: Sun Jul 08, 2012 6:47 pm by Mast » Mon Jul 23, 2012 1:39 pm I have the same problem. I'm guessing that you, like me, tried cross-compiling on a non-ARM system, then tried to do "make install_modules" on the Pi. The error failed to problem revealed itself when I used "file" on ihex2fw:Code: Select all$ file linux/firmware/ihex2fw
firmware/ihex2fw: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x349dc8ea67bf39b51e69e7b9c5fd1c04ead55190, not stripped
We're trying to execute a x64 binary on an ARM system. I presume ihex2fw, a utility needed only during installation, is compiled during building on the host machine (an x64 Ubuntu VM). But why isn't it compiled to the target, i.e. ARM? The new kernel seems to be running fine, even without the modules, just some functions are missing (like ppp support).What I tried was, I simply recompiled it on the pi:Code: Select all$ cd linux/firmware
$ rm ihex2fw
$ gcc ihex2fw.c -o ihex2fw And, to my complete amazement, it worked, modules_install goes through without complaint and the output of "lsmod" looks normal again after reboot.Now, I know this totally isn't the proper way to go about solving this. Something else must have gone wrong while building the kernel and I would really appreciate if anyone could shed some light on this. Posts: 5Joined: Thu Jul 19, 2012 7:03 pm Post a reply