LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-27-2020, 06:07 AM   #1
Teso
Member
 
Registered: Apr 2019
Posts: 63

Rep: Reputation: Disabled
Angry Error compiling Linux-kernel - "make: *** No rule to make target. Stop."


After Ubuntu 19.10 carried an update/upgrade, the Linux-kernel was updated to version "linux-5.3.0-xx-generic". I uninstalled it with the command:
Code:
apt remove --purge *5.3.0-xx* && apt autoremove && apt autoclean
I have uninstalled kernels this way many times and never had a problem, everything worked fine.
Now when I try to compile a kernel, I get this error message:
Code:
root@linux:/usr/src# make O-/build/linux-kernel/linux-5.7.10-test/ makemenuconfig
make: *** No rule to make target 'O-/build/linux-kernel/linux-5.7.10-test/'.  Stop.
Apparently files that were needed for compilation were deleted.
I'm not sure how to fix it...

--EDIT--

Before anyone asks this question...
Yes, i installed the necessary dependencies.
Quote:
Originally Posted by ~/linux-5.7.10/Documentation/process/changes.rst
.
GNU C..................4.6..............gcc --version
GNU make...............3.81.............make --version
binutils...............2.23.............ld -v
flex...................2.5.35...........flex --version
bison..................2.0..............bison --version
util-linux.............2.10o............fdformat --version
kmod...................13...............depmod -V
e2fsprogs..............1.41.4...........e2fsck -V
jfsutils...............1.1.3............fsck.jfs -V
reiserfsprogs..........3.6.3............reiserfsck -V
xfsprogs...............2.6.0............xfs_db -V
squashfs-tools.........4.0..............mksquashfs -version
btrfs-progs............0.18.............btrfsck
pcmciautils............004..............pccardctl -V
quota-tools............3.09.............quota -V
PPP....................2.4.0............pppd --version
nfs-utils..............1.0.5............showmount --version
procps.................3.2.0............ps --version
oprofile...............0.9..............oprofiled --version
udev...................081..............udevd --version
grub...................0.93.............grub --version.||.grub-install.--version
mcelog.................0.6..............mcelog --version
iptables...............1.4.2............iptables -V
openssl & libcrypto....1.0.0............openssl.version
bc.....................1.06.95..........bc.--version
Sphinx\ [#f1]_.........1.3..............sphinx-build --version

Last edited by Teso; 07-27-2020 at 06:26 AM.
 
Old 07-27-2020, 06:32 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
root@linux:/usr/src# make O-/build/linux-kernel/linux-5.7.10-test/ makemenuconfig
make: *** No rule to make target 'O-/build/linux-kernel/linux-5.7.10-test/'. Stop.
You should go into the directory you extracted the kernel sources (I guess it's /build/linux-kernel/linux-5.7.10-test) and run make from there, e.g:
Code:
cd /build/linux-kernel/linux-5.7.10-test
make menuconfig
 
Old 07-27-2020, 07:35 AM   #3
Teso
Member
 
Registered: Apr 2019
Posts: 63

Original Poster
Rep: Reputation: Disabled
I installed the dependencies one more time and now "make menuconfig" works.
make menuconfig works in the "/build/linux-kernel/linux-5.7.10-test" directory, but the output douse not work. i have to "cd" in to "/usr/src/linux-5.7.10-test" the output directory is in "/build/linux-kernel/linux-5.7.10-test" that`s what the README says:

Quote:
Originally Posted by /build/linux-kernel/linux-5.7.10-test/Documentation/admin-guide/README.rst

Installing the kernel source
----------------------------

- If you install the full sources, put the kernel tarball in a
directory where you have permissions (e.g. your home directory) and
unpack it::

xz -cd linux-5.x.tar.xz | tar xvf -

Replace "X" with the version number of the latest kernel.

Do NOT use the /usr/src/linux area! This area has a (usually
incomplete) set of kernel headers that are used by the library header
files. They should match the library, and not get messed up by
whatever the kernel-du-jour happens to be.
Quote:
Originally Posted by /build/linux-kernel/linux-5.7.10-test/Documentation/admin-guide/README.rst
Build directory for the kernel
------------------------------

When compiling the kernel, all output files will per default be
stored together with the kernel source code.
Using the option ``make O=output/dir`` allows you to specify an alternate
place for the output files (including .config).
Example::

kernel source code: /usr/src/linux-5.x
build directory: /home/name/build/kernel

To configure and build the kernel, use::

cd /usr/src/linux-5.x
make O=/home/name/build/kernel menuconfig
make O=/home/name/build/kernel
sudo make O=/home/name/build/kernel modules_install install

Please note: If the ``O=output/dir`` option is used, then it must be
used for all invocations of make.
Am I doing something wrong?
OK, let`s do it step by step:
First i navigate in to my build directory "cd /build/linux-kernel"
Then i extract the tar-ball "xz -cd /root/Downloads/linux-5.7.10.tar.xz | tar xvf -"
Now the output directory is in "/build/linux-kernel/linux-5.7.10-test"
Make a new directory "mkdir /usr/src/linux-5.7.10-test"
I chance in to the directory "cd /usr/src/linux-5.7.10-test"
And run the command "make O=/build/linux-kernel/linux-5.7.10-test menuconfig"
Code:
root@linux:/usr/src/linux-5.7.10-test# make O=/build/linux-kernel/linux-5.7.10-test/ menuconfig
make: getcwd: No such file or directory
make: *** No rule to make target 'menuconfig'.  Stop.
 
Old 07-27-2020, 09:03 AM   #4
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,570
Blog Entries: 19

Rep: Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451
You're making it unnecessarily complicated. I'm not surprised things go wrong.

The simplest way to build a kernel is this:

1)Unpack the tarball in your home directory (or wherever else you usually do this kind of work). Don't use a system directory.

2) cd into the new toplevel directory. Do not create any others.

3) Copy over your existing kernel configuration file as .config.

4) Type "make menuconfig"

5) Browse the menu and make any changes you want. Look especially at anything labelled NEW.

6) Exit and type "make"

7) When the build is finished, copy the new bzImage from arch/x86/boot to your boot directory, giving it a suitably informative name. Copy also the system map and the .config file. Then use "make modules_install" to install the corresponding modules.

8) Update GRUB.

Last edited by hazel; 07-27-2020 at 09:05 AM.
 
Old 07-27-2020, 12:38 PM   #5
Teso
Member
 
Registered: Apr 2019
Posts: 63

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hazel View Post
You're making it unnecessarily complicated.
I Thanks, I know how to compile a kernel.
This time I want to do it as described in the README.rst file.
I'm just trying to follow the installation instructions in the: ~/Documentation/admin-guide/README.rst
But for some reason it doesn't work.
Quote:
Originally Posted by README
--------------------------------------
Installing the kernel source
--------------------------------------

- If you install the full sources, put the kernel tarball in a
directory where you have permissions (e.g. your home directory) and
unpack it::

xz -cd linux-5.x.tar.xz | tar xvf -

Replace "X" with the version number of the latest kernel.

Do NOT use the /usr/src/linux area! This area has a (usually
incomplete) set of kernel headers that are used by the library header
files. They should match the library, and not get messed up by
whatever the kernel-du-jour happens to be.



--------------------------------------
Build directory for the kernel
--------------------------------------

When compiling the kernel, all output files will per default be
stored together with the kernel source code.
Using the option ``make O=output/dir`` allows you to specify an alternate
place for the output files (including .config).
Example::

kernel source code: /usr/src/linux-5.x
build directory: /home/name/build/kernel

To configure and build the kernel, use::

cd /usr/src/linux-5.x
make O=/home/name/build/kernel menuconfig
make O=/home/name/build/kernel
sudo make O=/home/name/build/kernel modules_install install

Please note: If the ``O=output/dir`` option is used, then it must be
used for all invocations of make.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
error """make:*** no rule to make target 'modules'.stop'"" SI1 Linux - Newbie 1 11-01-2017 11:57 PM
get this error when runnign make ***** "no rule to make target 'config'. stop" procfs Linux - General 4 05-12-2013 10:25 AM
iptables: rule with RETURN target just after a rule with ACCEPT target Nerox Linux - Networking 6 09-04-2011 03:33 PM
Error: "make: *** No rule to make target `folder'. Stop." shri19 Linux - Kernel 2 05-27-2009 08:08 AM
Error "make: *** No rule to make target `install'. Stop." help Ohmn Mandriva 8 07-02-2004 07:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration