LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   make config problem (https://www.linuxquestions.org/questions/linux-from-scratch-13/make-config-problem-4175513715/)

Bharat mistry 08-06-2014 08:45 AM

make config problem
 
hello,
I downloaded source code of linux kernel and past it into usr/src directory. then i want to compile source code then terminal gives me error that "NO rule to make target". so what i have to do....

gengisdave 08-06-2014 09:31 AM

first, you have to configure the kernel: 'make config' (terminal version), 'make menuconfig' (ncurses version) or 'make xconfig' (windowed version) is the first step to do

but, if your you've never done it, you'd better start with an existent kernel config; your distro may ship this in the kernel package, usually a file named config or similar in the /boot directory, just copy it in the kernel source directory and rename it in .config (the prefix dot is essential)

Bharat mistry 08-06-2014 10:17 AM

sorry sir , i didn't get you, but i tried make menuconfig, make oldconfig and all command but everytime i'm facing same error.

gengisdave 08-06-2014 10:34 AM

did you extracted the kernel? 'tar xf name_of_the_file'

Bharat mistry 08-06-2014 01:03 PM

Yes sir, i extracted source code and put that into usr/src and change terminal on usr/src/"extracted linux src code directory" but still i am getting error that "No rule to make target menu config". please help me...Error is :

root@bharat-Inspiron-N5110:/usr/src/linux-kernel 3.14# make menuconfig
Makefile:331: warning: overriding commands for target `/usr/src/linux-kernel'
Makefile:117: warning: ignoring old commands for target `/usr/src/linux-kernel'
Makefile:332: /usr/src/linux-kernel: No such file or directory
Makefile:332: 3.14/scripts/Kbuild.include: No such file or directory
Makefile:504: /usr/src/linux-kernel: No such file or directory
Makefile:504: 3.14/arch/x86/Makefile: No such file or directory
make: *** No rule to make target `3.14/arch/x86/Makefile'. Stop.
root@bharat-Inspiron-N5110:/usr/src/linux-kernel 3.14#

gengisdave 08-06-2014 04:41 PM

change the dir name from 'linux-kernel 3.14' to linux-kernel-3.14', spaces are not good in linux

ReaperX7 08-06-2014 06:38 PM

If this is your first kernel to build I recommend doing the following:

Code:

make defconfig
This will create a general system architecture config for the kernel, but it's still fairly basic.

Code:

make menuconfig
This will open the ncurses configuration screen. Use this and follow the LFS kernel building hints to add any appropriate modules and embedded drivers to the system. I recommend you enable file systems as internally compiled rather than as modules.

If all else fails, you can import another distributions config file and try it. We recommend the Slackware Huge kernel as a good place to start.

Bharat mistry 08-07-2014 11:52 AM

yes i got it. Thanks a lot sir....

pan64 08-07-2014 11:57 AM

hey guy, you must not use user root to make a new kernel, but a normal user. Also do not put the kernel sources directly into /usr!
So do it as yourself. unpack it into your home, or into a subdir in your home (or into /tmp, or whatever, but not into the living system). And then comes make defconfig, make menuconfig or whatever you want (to config). You only need to do the last steps as root (make install and similar tasks)

Bharat mistry 08-07-2014 01:16 PM

Ok thanks....


All times are GMT -5. The time now is 10:15 AM.