Unable to install the custom Kernel
commands used
$ make localmodconfig
$ lsmod > /tmp/my-lsmod
$ make LSMOD=/tmp/my-lsmod localmodconfig
$ sudo make -j3 all
$ su -c "make modules_install install"
Comments
-
Please help
0 -
The error message in fact tells you exactly what is wrong. Turn off "CONFIG_x86_X32" in your .config file as your binutils does not support it and you are unlikely to need it. In the config menus, this is under "Binary Emulations" after Bus Options and before Virtualization. I'd recommend you do
grep CONFIG_X86_X32 /boot/config* /boot/config-4.18.0-305.19.1.el8_4.x86_64:# CONFIG_X86_X32 is not set /boot/config-5.14.13:# CONFIG_X86_X32 is not set /boot/config-5.14.14:# CONFIG_X86_X32 is not set /boot/config-5.15.0-rc6:# CONFIG_X86_X32 is not set
on my system. I don't know why localmodconfig gave you this, but the error message is actually rather precise
in this case. Or I am wrong1 -
okay trying
0 -
so need to set the values = 'n' as I am running it in VMWare??0 -
Does vmware support 64-bit kernels? If this is the default localmodconfig, then you night have to install 32-bit binutils
0 -
I had tried it in desktop computer there also it is showing this error
0 -
cloned from this repo
0 -
Okay. Try checking out the latest stable kernel instead from the stable git - and then generate localmodconfig - is your desktop 32-bit?
0 -
okay will try mine desktop is 64-bit
0 -
Unless you are working with embedded hardware, it is extremely unlikely you have 32 bit on either the host or the guest. VMWare does indeed run 64 bit fully (and you can run a 32-bit guest on a 64-bit host) but please do not use 32-bit at all. And you just showed you have the option set to "Y" so mystery solved. Run your favorite configuration program (probably make menuconfig) and just change the option as I explained to you and I hope this goes away. Editing .
config
directly is a bad idea in general but can work. Your use of the environment variable "LSMOD" seems to make no sense to me, your commands are just "make localmodconfig
" and "make
". Unless this variable is part of the course.make localmodconfig
will only work seamlessly when the kernel version you are running is not to distant from the one you are configuring. i.e., you cannot run 4.18 and configure 5.15 with "make localmodconfig
" and expect it to work without a lot of
inspection. You are running a stock ubuntu 5.11, but you are not saying what you are trying to configure.I don't know why ubuntu seems to have this set to "y" and while the kernel seems to work for them, it sounds like the tool chain
is defective as the binutils doesn't support it.Good luck!
0 -
So should I just run these commands??
$ cp /boot/config-$(uname -r) .config
$ make -j4 all
$ sudo su -c "make modules_install install"and if it is successful then update the grub and reboot
0 -
so, in a nutshell the localmodconfig can't be used when the 2-kernel version are very distinct from each other in a sense
0 -
My preferred approach is - cp /boot/config-$(uname -r) .config
0 -
The main problem with doing it this way, is that it may take hours to compile. If you are using a .config from a distribution kernel it will have every network card, every sound card, and enormous amounts of hardware you don't have, compiled as modules. Literally I have seen this take hours to compile when a slimmed down configuration, such as that from localmodconfig, will take 5-20 minutes depending on variables. At a minimum you should go through menuconfig after the copy to eliminate totally irrelevant hardware. Or just keep busy doing something else. Doing it this way has always been an act of desperation for me if you care about how long it takes. Also some distributions do not always keep the config file in /boot and /proc/config.gz may not been there either depending on the kernel configuration itself.
And none of this says why make localmodconfig did not give a working setup, which it should, so there is no guarantee this will work either if your system is missing some ingredient for compilation. Been there, done that.
0 -
So what commands should I use
0 -
make menuconfig -- either turn off the option or use the full config and turn thiings off. Or just hit make and go for a long walk
0 -
I'm not sure if @dipsonu10 fixed this issue, however I just ran into the same problem. My solution was as follows.
I'm going to leave @dipsonu10 with advice on how to ask questions before I start. 'please help' is the laziest approach you can take. Start off by explaining the problem you are having. Tell people what you have tried, what you have looked up and why something didn't work. This makes it easier for people to help you and 99% of the time in doing this you solve your own problem.
I had to google around a bit to find solutions for these problems, this works on my system. It may or may not work on yours.
We start by addressing CONFIG_X86_X32
1)
linux_stable$ ls /boot | grep config
config-4.19.0-18-amd64
config-5.10.0-9-amd642)
linux_stable$ cp /boot/config-5.10.0-9-amd64 .config3)
linux_stable$ grep CONFIG_X86_X32 .config
.config:CONFIG_X86_X32=y
.config:CONFIG_X86_X32_DISABLED=yTake note of the following .config:CONFIG_X86_X32=y
This is our "problem line"To fix this we need to type the following, and read it very carefully otherwise we will be cursed with issues like this for the rest of our lives.
linux_stable$ man sed
linux_stable$ sed -i 's/CONFIG_X86_X32=y/CONFIG_X86_X32=n/g' .config
Now, we will address,
sed: can't read modules.order: No such file or directory
make[1]: *** [Makefile:1304: modinst] Error 2
make: *** [Makefile:327: __build_one_by_one] Error 21)
linux_stable$ grep CONFIG_SYSTEM_TRUSTED_KEYS .config
.config:CONFIG_SYSTEM_TRUSTED_KEYS="debian/certs/debian-uefi-certs.pem"Take note of the following:
.config:CONFIG_SYSTEM_TRUSTED_KEYS="debian/certs/debian-uefi-certs.pem"
This is the problem line.2)
linux_stable$ sed -ri '/CONFIG_SYSTEM_TRUSTED_KEYS/s/=.+/=""/g' .configNow, we just need to follow the instructions.
inux_stable$ make oldconfig
inux_stable$ make -j20 all
inux_stable$ su -c "make modules_install install"
.....3 -
Thanks for the help. A couple of concerns though:
1) editing .config directly is not usually wise as it can cause all kind sof dependency conflicts and in fact your changes can be reversed when you do a make as the kernel build system works very hard to make sure all is consistent and possible
2) make -j 20 is a bad idea unless you have at least 20 cpus/cores. There are long disputes about the best -j value but it is always safe to use something like the number of cpus, which you can get from make -j $(nproc)
2 -
@coop said:
Thanks for the help. A couple of concerns though:1) editing .config directly is not usually wise as it can cause all kind sof dependency conflicts and in fact your changes can be reversed when you do a make as the kernel build system works very hard to make sure all is consistent and possible
2) make -j 20 is a bad idea unless you have at least 20 cpus/cores. There are long disputes about the best -j value but it is always safe to use something like the number of cpus, which you can get from make -j $(nproc)
Thank you for the reply @coop. I have made notes in my personal 'cheat sheets', this will help me in the future.
0 -
Editing config files is something you attempt if you know what you are doing. LFD103 walks you through meuconfig and how to enable config options. Following that could be helpful.
2 -
@ShuahKhanLF said:
Editing config files is something you attempt if you know what you are doing. LFD103 walks you through meuconfig and how to enable config options. Following that could be helpful.Hi @ShuahKhanLF
Noted, I appreciate your feedback.0 -
Thank you @ShuahKhanLF @thescientist @coop
Finally compiled and installed it on my desktop 🎉0 -
used the commands
all under sudo su
cp -v /boot/config-$(uname -r) .config make menuconfig # save it as default make -j4 make modules_install make install update-grub
the only downside was that I compiled the whole kernel ig
0 -
what does these do in '.config'
CONFIG_SYSTEM_TRUSTED_KEYS
CONFIG_SYSTEM_REVOCATION_KEYS0 -
"git grep SYSTEM_TRUSTED_KEYS" is your friend for questions like this one.
0
Categories
- All Categories
- 206 LFX Mentorship
- 206 LFX Mentorship: Linux Kernel
- 733 Linux Foundation IT Professional Programs
- 339 Cloud Engineer IT Professional Program
- 165 Advanced Cloud Engineer IT Professional Program
- 66 DevOps Engineer IT Professional Program
- 132 Cloud Native Developer IT Professional Program
- 119 Express Training Courses
- 119 Express Courses - Discussion Forum
- 5.9K Training Courses
- 40 LFC110 Class Forum - Discontinued
- 66 LFC131 Class Forum
- 39 LFD102 Class Forum
- 219 LFD103 Class Forum
- 17 LFD110 Class Forum
- 32 LFD121 Class Forum
- 17 LFD133 Class Forum
- 6 LFD134 Class Forum
- 17 LFD137 Class Forum
- 70 LFD201 Class Forum
- 3 LFD210 Class Forum
- 2 LFD210-CN Class Forum
- 2 LFD213 Class Forum - Discontinued
- 128 LFD232 Class Forum - Discontinued
- 1 LFD233 Class Forum
- 2 LFD237 Class Forum
- 23 LFD254 Class Forum
- 683 LFD259 Class Forum
- 109 LFD272 Class Forum
- 3 LFD272-JP クラス フォーラム
- 10 LFD273 Class Forum
- 95 LFS101 Class Forum
- LFS111 Class Forum
- 2 LFS112 Class Forum
- 1 LFS116 Class Forum
- 3 LFS118 Class Forum
- 2 LFS142 Class Forum
- 3 LFS144 Class Forum
- 3 LFS145 Class Forum
- 1 LFS146 Class Forum
- 2 LFS147 Class Forum
- 8 LFS151 Class Forum
- 1 LFS157 Class Forum
- 10 LFS158 Class Forum
- 4 LFS162 Class Forum
- 1 LFS166 Class Forum
- 3 LFS167 Class Forum
- 1 LFS170 Class Forum
- 1 LFS171 Class Forum
- 2 LFS178 Class Forum
- 2 LFS180 Class Forum
- 1 LFS182 Class Forum
- 4 LFS183 Class Forum
- 30 LFS200 Class Forum
- 737 LFS201 Class Forum - Discontinued
- 2 LFS201-JP クラス フォーラム
- 17 LFS203 Class Forum
- 111 LFS207 Class Forum
- 1 LFS207-DE-Klassenforum
- LFS207-JP クラス フォーラム
- 301 LFS211 Class Forum
- 55 LFS216 Class Forum
- 49 LFS241 Class Forum
- 43 LFS242 Class Forum
- 37 LFS243 Class Forum
- 13 LFS244 Class Forum
- 1 LFS245 Class Forum
- 45 LFS250 Class Forum
- 1 LFS250-JP クラス フォーラム
- LFS251 Class Forum
- 143 LFS253 Class Forum
- LFS254 Class Forum
- LFS255 Class Forum
- 6 LFS256 Class Forum
- LFS257 Class Forum
- 1.2K LFS258 Class Forum
- 9 LFS258-JP クラス フォーラム
- 114 LFS260 Class Forum
- 152 LFS261 Class Forum
- 41 LFS262 Class Forum
- 82 LFS263 Class Forum - Discontinued
- 15 LFS264 Class Forum - Discontinued
- 11 LFS266 Class Forum - Discontinued
- 23 LFS267 Class Forum
- 18 LFS268 Class Forum
- 29 LFS269 Class Forum
- 199 LFS272 Class Forum
- 1 LFS272-JP クラス フォーラム
- LFS274 Class Forum
- 3 LFS281 Class Forum
- 2 LFW111 Class Forum
- 257 LFW211 Class Forum
- 176 LFW212 Class Forum
- 12 SKF100 Class Forum
- SKF200 Class Forum
- 791 Hardware
- 199 Drivers
- 68 I/O Devices
- 37 Monitors
- 98 Multimedia
- 174 Networking
- 91 Printers & Scanners
- 85 Storage
- 754 Linux Distributions
- 82 Debian
- 67 Fedora
- 16 Linux Mint
- 13 Mageia
- 23 openSUSE
- 147 Red Hat Enterprise
- 31 Slackware
- 13 SUSE Enterprise
- 351 Ubuntu
- 464 Linux System Administration
- 39 Cloud Computing
- 70 Command Line/Scripting
- Github systems admin projects
- 91 Linux Security
- 78 Network Management
- 101 System Management
- 47 Web Management
- 56 Mobile Computing
- 17 Android
- 28 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 365 Off Topic
- 113 Introductions
- 171 Small Talk
- 20 Study Material
- 522 Programming and Development
- 291 Kernel Development
- 213 Software Development
- 1.1K Software
- 212 Applications
- 180 Command Line
- 3 Compiling/Installing
- 405 Games
- 311 Installation
- 79 All In Program
- 79 All In Forum
Upcoming Training
-
August 20, 2018
Kubernetes Administration (LFS458)
-
August 20, 2018
Linux System Administration (LFS301)
-
August 27, 2018
Open Source Virtualization (LFS462)
-
August 27, 2018
Linux Kernel Debugging and Security (LFD440)