Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cant compile my 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
Cayman_1945
n00b
n00b


Joined: 02 Dec 2023
Posts: 3

PostPosted: Mon Dec 04, 2023 6:22 pm    Post subject: Cant compile my kernel Reply with quote

I tried making my kernel lighter by unmarking some things i didnt need using
Code:
make makeconfig
but after running it it shows these error:
Code:
"No rule to make target 'arch/x86/entry/syscalls/syscall_32.tbl', needed by 'arch/x86/include/generated/uapi/asm/unistd_32.h'.  Stop.
make: *** [arch/x86/Makefile:242: archheaders] Error 2"


im new to gentoo and i dont really now how to fix that please help me and thanks for you time! 8O
Back to top
View user's profile Send private message
psycho
Guru
Guru


Joined: 22 Jun 2007
Posts: 553
Location: New Zealand

PostPosted: Thu Dec 07, 2023 2:15 am    Post subject: Reply with quote

Hi Cayman.

Welcome to Gentoo. If you're following the handbook (so you meant "make menuconfig" rather than "make makeconfig"), everything should at least build successfully, even if you've disabled some functionality that you actually need. I'm not sure but it looks like you might have forgotten to configure before attempting make, or perhaps have the wrong kernel headers installed or something. Which kernel are you building? Are you following the handbook...

https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Kernel

...to the letter, or have you done something differently? What's the output of...
Code:
eselect kernel list
..?

The file that's actually being edited by kernel configuration tools like menuconfig is .config (/usr/src/linux/.config). As a "dotted" file it's hidden (it won't show up in ls /usr/src/linux, unless you ls -a) but it's there. It can be a good idea to keep backups of working kernel configs: everything else can simply be wiped and reinstalled, but that one little file can contain many hours of careful kernel pruning/tuning, so that's a file to look after (you'll often see configs backed up in boot directories with names like config-6.1.65 or whatever).

Kernel customisation can go disastrously wrong when you're not sure what you're doing (it's possible to, for example, accidentally remove something that the kernel needs to read anything off your primary disk, making the system unbootable), so it's a good idea to start with a working .config, make a few edits, then build and test your new kernel before editing it any further. This is time-consuming but it can actually save you a lot of time troubleshooting. Otherwise, if you're wading through the options for hours changing things all over the place, it can be very difficult to figure out what you did that broke things. If you're using make menuconfig I recommend going through from top to bottom systematically, configuring one small section at a time. Once you get familiar with it (and with the options your own systems require), you can potentially blast through the whole menu in one sitting, but when you're starting out it pays to be careful, testing your changes a bit at a time (so that it's easy to reverse any stuff-ups) rather than editing the whole .config at once.

I'm not exactly sure what's going on with your error there so can't provide you with a specific fix for it: if nobody else can either, you may have to start over, wiping and reinstalling your kernel source. If you do that, make a backup of your .config first, in case the customisations you made were fine, and it's just something wrong with your build system (e.g. you forgot to point /usr/src/linux to the right directory, or are using the wrong headers or something... they need to match the major version of your kernel source).
Back to top
View user's profile Send private message
e8root
Tux's lil' helper
Tux's lil' helper


Joined: 09 Feb 2024
Posts: 94

PostPosted: Wed Feb 14, 2024 6:45 pm    Post subject: Reply with quote

This error seems to be the error which happens when you try to manually make kernel installed by sys-kernel/gentoo-kernel because I just had this same error when trying that. I then specifically tested it on latest and greatest version 6.7.4 of both sys-kernel/gentoo-sources and sys-kernel/gentoo-kernel to be sure that is the case and it seems to be the case - you cannot use make to build kernels in /usr/src/ ending with -gentoo-dist

Funnily enough I googled this issue before figuring it out myself and it seems very common mistake/misunderstanding with lots and lots of topics about it. I am baffled why this isn't common Gentoo knowledge... maybe this info it should be included in to gentoo installation handbook? Just stating you should use sys-kernel/gentoo-sources doesn't mean it implies one cannot or should not use files left by sys-kernel/gentoo-kernel left in /usr/src/ and in fact it makes perfect sense to assume this should be doable.

Anyways, my understanding is that kernel built with Gentoo from sys-kernel/gentoo-kernel is quite heavily modified version of the kernel and it is built using compiler configured in /etc/portage/make.conf and generally configured USE flags and the patches include support for -march=native and maybe -O3 (though this I am not sure and I need to check logs) so its somewhat different beast than building with make.
_________________
Unix Wars - Episode V: AT&T Strikes Back
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5665
Location: Bavaria

PostPosted: Wed Feb 14, 2024 7:00 pm    Post subject: Reply with quote

Cayman_1945

I like it when people want to configure their own (lighter) kernel ... but its not that easy as you think. You should allow yourself plenty of time (not minutes, but hours or even a few days). In addition to everything @psycho has already said, I can only give you the link to my article: https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Manual_kernel_configuration ;-)
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
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