Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Can't run make menuconfig. Do I upgrade the kernel?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
mojosam
n00b
n00b


Joined: 21 Jul 2019
Posts: 70
Location: USA

PostPosted: Sun Sep 01, 2019 1:16 am    Post subject: [SOLVED] Can't run make menuconfig. Do I upgrade the kernel? Reply with quote

My problem is similar to this one. The Pastebins have expired, so I'm not sure.

I did this:

Code:
# cd /usr/src/linux
# make menuconfig
make: *** No rule to make target 'menuconfig'. Stop.

Apparently the necessary file got deleted by depclean.

So I figured I would just boot up the Minimal Install CD and run it from in there. I might have outsmarted myself, though. My copy was a month old, so I downloaded the latest version and ran that.

When I got to the part of the install that has me run make menuconfig, I once again got:

Code:
make: *** No rule to make target 'menuconfig'. Stop.

Investigating, this is what I figured out.
    • My original installation is sitting in /usr/src/linux-4.19.57-gentoo
    • This new journey through the new Install CD put stuff into /usr/src/linux-4.19.66-gentoo
    • The /usr/src/linux symbolic link is still pointing to /usr/src/linux-4.19.57-gentoo

All I want to do is run make menuconfig with the lowest chance of messing up my system. What is my best course of action?

    • Should I copy the Makefile from 4.19.66 to 4.19.57?
    • Should I copy my .config file from 4.19.57 to 4.19.66 then change the symbolic link to 4.19.66?
    • Should I do a formal kernel upgrade?
    • Have I misdiagnosed my problem, and I should do something else?


Last edited by mojosam on Mon Sep 02, 2019 1:15 am; edited 1 time in total
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Sun Sep 01, 2019 2:29 am    Post subject: Reply with quote

You have a full copy of kernel sources under 4.19.66? Then do the upgrade. That's the easiest way. Nothing you do in kernel sources directory affects your running system, until you actually install the new kernel and reboot.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
hedmo
Veteran
Veteran


Joined: 29 Aug 2009
Posts: 1334
Location: sweden

PostPosted: Sun Sep 01, 2019 5:10 am    Post subject: Re: Can't run make menuconfig. Do I upgrade the kernel? Reply with quote

mojosam wrote:

• Should I copy my .config file from 4.19.57 to 4.19.66 then change the symbolic link to 4.19.66?
• Should I do a formal kernel upgrade?
• Have I misdiagnosed my problem, and I should do something else?[/list]


mojosam if you are missing your .config in the new kernel.... do not just copy your old one to the new.it is a bad thing.if there is new FEATURES in
the new kernel you wont know of you just copy the old one .follow the :

kernel upgrade
and use:
Code:

make oldconfig


to update your new kernel from the old one.

regards hedmo
Back to top
View user's profile Send private message
luna80
Veteran
Veteran


Joined: 01 Feb 2004
Posts: 1560
Location: switzerland

PostPosted: Sun Sep 01, 2019 6:29 am    Post subject: Reply with quote

did you read this gentoo wiki page? https://wiki.gentoo.org/wiki/Kernel/Upgrade

it's very usefulll
_________________
*** !f j00 c4n r34D tH15 tH3N j00 n33D t0 l0g Off ***
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54794
Location: 56N 3W

PostPosted: Sun Sep 01, 2019 8:52 am    Post subject: Reply with quote

mojosam,

If you did a world update, you may have got a new kernel.
The recommended --depclean would then have removed all the files provided by the kernel tarball from the old kernel.
Your old .config will still be there but the Makefile will be gone, hence
Code:
make: *** No rule to make target 'menuconfig'. Stop.   

Its a design feature.

The --exclude option to emereg can be useful for preventing things like this.
You can either update the kernel or emerge the old kernel again.

You can do something similar with gcc too. That's scary but harmless.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Sun Sep 01, 2019 12:57 pm    Post subject: Reply with quote

Use -a option with depclean, this allows you to review the list of packages to be removed before committing.

Code:
emerge -ac


-a is short for --ask, -c is --depclean.

Then, following NeddySeagoon advice if you want to keep your old kernel sources, you can do

Code:
emerge -ac --exclude gentoo-sources

_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
axl
Veteran
Veteran


Joined: 11 Oct 2002
Posts: 1146
Location: Romania

PostPosted: Sun Sep 01, 2019 1:08 pm    Post subject: Reply with quote

Could it be possible that he doesn't have USE=symlink and although the new kernel has Makefile maybe /usr/src/linux doesn't point to the actual new kernel, but to the old version that was depcleaned?
Back to top
View user's profile Send private message
mojosam
n00b
n00b


Joined: 21 Jul 2019
Posts: 70
Location: USA

PostPosted: Sun Sep 01, 2019 6:26 pm    Post subject: Reply with quote

A lot of helpful people chiming in! Remember that I did not set out originally to upgrade the kernel. I got into this bind because depclean apparently wiped out the files I needed to reconfigure the kernel I had. I didn't understand the ramifications of using it. That tool is too powerful in the hands of a neophyte! Then I compounded the problem by using a later Minimal Install CD and ended up with the two kernels.

Taking Jaglover's advice, I decided to upgrade the kernel. I followed the Kernel Upgrade directions.

To do the build, that article directed me to the Kernel Configuration article. That had me do make, make modules_install, and make install. All of that proceeded without incident.

Here's where it gets confusing. It isn't clear when, if ever, I am supposed to leave the Kernel Configuration page and return to the Kernel Upgrade page. So staying with the Kernel Configuration page, I next come to the Bootloader section, which sends me off to the GRUB2 page. I assume that I need to jump directly to the Installing a New Kernel section.

That has me do this:

Code:
grub-mkconfig -o /boot/grub/grub.cfg

That fails with:

Code:
/usr/sbin/grub-mkconfig: line 243: /boot/grub/grub.cfg.new: No such file or directory

The instructions have a note above that command that says:

Quote:
Make sure the /boot partition is mounted for this step.

OK. Maybe I need to do that first!

Code:
# mount /boot
mount: /boot: special device boot does not exist.

I stupidly assumed that the system would know where that was. Apparently not.

On my system, sda1 is the BIOS boot partition (2 MB). Am I correct in assuming that this is not the partition I'm interested in? (But isn't that where GRUB does its grubbing?)

sda2 is labeled as "Boot" (128 MB). I'm guessing that's what I want. So would I now do:

Code:
mount /dev/sda2 /boot

And why wouldn't that be already mounted?
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Sun Sep 01, 2019 6:36 pm    Post subject: Reply with quote

Code:
man fstab

This will tell you the purpose of fields in /etc/fstab. By default automounting is disabled for /boot. Since 'mount /boot' failed for you I'd say your fstab is not set up properly at all. Did you edit it? It comes with placeholders which are not functional without your input.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
mojosam
n00b
n00b


Joined: 21 Jul 2019
Posts: 70
Location: USA

PostPosted: Sun Sep 01, 2019 8:54 pm    Post subject: Reply with quote

Quote:
Since 'mount /boot' failed for you I'd say your fstab is not set up properly at all. Did you edit it?

I haven't touched it since I set up the system a few weeks ago. Everything was fine. This is what it currently looks like:

Code:
# <fs>    <mountpoint>   <type>   <opts>            <dump/pass>
boot      /boot          ext4     defaults,noatime  0 2
swap      none           swap     sw                0 0
rootfs    /              ext4     noatime           0 1

That looks like the way I set it up originally.

Something somehow got confused somewhere. Should I reboot? Or is there something I can do to troubleshoot or fix whatever caused the mount /boot to fail?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54794
Location: 56N 3W

PostPosted: Sun Sep 01, 2019 9:02 pm    Post subject: Reply with quote

mojosam,

The first column should be the /dev entries that hold the filesystems that get attached at <mountpoint>
boot, swap and rootfs are all incorrect.

The lazy form of mount, like
Code:
mount /boot
causes /etc/fstab to be consulted for the missing information.
The full form,
Code:
mount /dev/sda2 /boot
assumes you want read/write and guesses the filesystem type.
You can give other options to mount if you want to.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
mojosam
n00b
n00b


Joined: 21 Jul 2019
Posts: 70
Location: USA

PostPosted: Sun Sep 01, 2019 10:38 pm    Post subject: Reply with quote

I fixed my fstab. This is how it looks now:

Code:
# <fs>         <mountpoint>   <type>   <opts>            <dump/pass>
/dev/sda2      /boot          ext4     defaults,noatime  0 2
/dev/sda3      none           swap     sw                0 0
/dev/sda4      /              ext4     noatime           0 1


I got through the last couple of steps, rebooted, and I'm now in the new kernel.

The only problem is GRUB doesn't give me a choice of the two kernels. One entry says "Gentoo GNU/Linux". The other entry is advanced options. Isn't it supposed to now list 4.19.57 and 4.19.66?
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Sun Sep 01, 2019 11:37 pm    Post subject: Reply with quote

mojosam,

I do not use Grub myself, for me it looks too complicated for such a simple job as loading the kernel. But I believe there is a configuration file somewhere in /etc you are supposed to edit to make Grub2 work the way you want. Or you can write the grub.conf (or is it grub.cnf) file which is in /boot by hand, it can be very simple, just a few lines will do, there is an example somewhere in Gentoo Wiki.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
wpkzz
Tux's lil' helper
Tux's lil' helper


Joined: 28 Feb 2013
Posts: 80

PostPosted: Sun Sep 01, 2019 11:57 pm    Post subject: Reply with quote

mojosam:

That is the "new" (for some years now) standard in Grub2 and Gentoo. It only list per default the newer kernel. If you select the "advanced" options, there should be the other kernels listed.
Back to top
View user's profile Send private message
mojosam
n00b
n00b


Joined: 21 Jul 2019
Posts: 70
Location: USA

PostPosted: Mon Sep 02, 2019 1:14 am    Post subject: Reply with quote

Quote:
I do not use Grub myself, for me it looks too complicated for such a simple job as loading the kernel.

No kidding! I thought it would be fun to re-emerge grub. That took a long time! I can't imagine why that needs to be so complicated. Maybe when I know this stuff better, I'll switch to a lean and mean bootloader.

Quote:
If you select the "advanced" options, there should be the other kernels listed.

Oh. Now you tell me! Well anyway, everything (in this thread) is working now. Thank you to all of the folks who chimed in. Gentoo is a bottomless pit, isn't it? You'll never learn it all.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Mon Sep 02, 2019 1:54 am    Post subject: Reply with quote

I let my UEFI firmware to boot my kernel, no extra bootloader, no middleman.
Code:
# efibootmgr
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0000
Boot0000* Gentoo Backup
Boot0001* UEFI OS

Boot0001 was created automatically, I added Boot0000, it is my backup kernel. Since the names of my kernels never change there is never need to update boot entries.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Mon Sep 02, 2019 2:42 am    Post subject: Reply with quote

mojosam wrote:
No kidding! I thought it would be fun to re-emerge grub. That took a long time! I can't imagine why that needs to be so complicated.

GRUB2 is an entire OS unto itself, complete with graphics mode drivers, filesystem/RAID/CDROM drivers, decompression libraries, a command line with editing support, and basic scripting. It's an order of magnitude more code than the UEFI bootloader on most systems, and far more than something like LILO (which fits into the MBR).
Back to top
View user's profile Send private message
mojosam
n00b
n00b


Joined: 21 Jul 2019
Posts: 70
Location: USA

PostPosted: Mon Sep 02, 2019 3:23 am    Post subject: Reply with quote

Quote:
GRUB2 is an entire OS unto itself


My computer uses BIOS. Should I switch to LILO? I followed the installation instructions in the Handbook. I think it suggested GRUB2.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Mon Sep 02, 2019 4:09 am    Post subject: Reply with quote

It is up to you, I have several computers with Lilo. It has one drawback, it does not load kernels by name, thus I cannot upgrade by replacing the kernel image with new upgraded one. You may try Syslinux.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
cboldt
Veteran
Veteran


Joined: 24 Aug 2005
Posts: 1046

PostPosted: Mon Sep 02, 2019 11:20 am    Post subject: Reply with quote

What do you mean by "not loading kernels by name?" I have used lilo only for a long time, upgrade kernel on some machines a few times a year, and change both the kernel filename (it includes the linux kernel version) and the nickname as it appears on the boot menu at bootup.

/etc/lilo.conf has multiple "image,label" entries.

Code:

[intro stuff omitted]

image=/boot/kernel-4.19.66-gentoo
  label=Gentoo
  [stuff omitted]

#image=/boot/kernel-4.19.57-gentoo
#  label=4.19.57
# [stuff omitted - before commented out, this entry was to boot from known working kernel until 4.19.66 was proved]

image=/public/syscd-5.3.2/rescue64
  label=SysRescCd-5.3.2
  [stuff omitted]

other=/dev/sda1
  label=Windows-7
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Mon Sep 02, 2019 12:33 pm    Post subject: Reply with quote

mojosam wrote:
My computer uses BIOS. Should I switch to LILO? I followed the installation instructions in the Handbook. I think it suggested GRUB2.
Grub legacy is still around and has an easy to edit menu. I still use on BIOS systems. I have no need for the complexity of Grub2. It;s true that bug fixes are no longer available, but I've never had a bug. All it does it boot a kernel (or a partition as a chainloader). On one partition I have Ubuntu installed with it's version of grub2 in the partition. I just edited the grub legacy menu with nano to create the Title "Ubuntu" on a boot selection that chainloads the partition. So grub legacy boots grub2 that boots Ubuntu. (Ubuntu really sucks too.) The portage attic should have an ebuild. If not, I can pastebin one. On UEFI systems I boot reFind which is in the current tree. If you google for reFind and tony0945 you can find my posts that describe how to do it. My first install followed the wiki that left several things out. Like you have to boot from a UEFI CD or USB stick.
https://github.com/jezze/grub-legacy

LILO has to be reinstalled every time you change the kernel. Grub legacy only needs the menu edited with nano.
SYSLINUX has a menu that I believe is editable but I've never used it.

IMHO Grub2 is a prime example of software bloat and mission creep. The developers would have done better to develop a suite of applications that interacted and complemented each other rather than evolve the Grand Reunifed Bootloader into a monolithic mess reminiscent of Windoze and a Linux system that shall not be mentioned.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54794
Location: 56N 3W

PostPosted: Mon Sep 02, 2019 12:41 pm    Post subject: Reply with quote

cboldt,

That magic happens when you run /sbin/lilo
At boot time, lilo reads a block list to load whatever occupies those blocks, into RAM.

All other bootloaders I know of navigate the filesystem to load the kernel by file name.
If you want to test, delete an old kernel from the filesystem.

Reboot and select the kernel you just deleted. It will load from the now free space ... unless its an SSD.
This continues to work until the free space is reused, then anything can happen, except booting.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Mon Sep 02, 2019 3:58 pm    Post subject: Reply with quote

cboldt,

with other bootloaders I can boot the kernel from /usr/src/linux/arch/x86_64/boot/ without needing to update anything, just set the /usr/src/linux symlink, build kernel and reboot. This won't work with Lilo.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
cboldt
Veteran
Veteran


Joined: 24 Aug 2005
Posts: 1046

PostPosted: Mon Sep 02, 2019 8:57 pm    Post subject: Reply with quote

Thanks guys, now I understand what you meant.

I've burned myself on lilo a few times, years ago, and learned the hard way that even replacing a same name kernel needs to be followed by running the lilo command ;-) I think that's what also got me to keeping the old kernel around until the new one was proved.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum