Custom Kernel Compile Error(sed: can’t read modules.order)(Solved)

Abdullah Ibne Hanif Arean
1 min readSep 23, 2022

--

While compiling a new custom kernel(5.19.9) in my Ubuntu 20.04 operating system, after executing the “make menuconfig”, “make”, when I was executing “make module_install” I got an error message like:

sed: can’t read modules.order: No such file or directory make: *** [Makefile:1477: __modinst_pre] Error 2

Despite being a rather regular and well-known error message, it still doesn’t have an appropriate, direct answer. There are some solutions out there that are really difficult and have no effect, but there is one that is reasonably straightforward and easy, and I’m going to share it with you today.

After successfully executing “make menuconfig”, and saving the script as .config, You just to disable two variables in that script, you can do it manually by editing .config file, but doing it using two simple commands is easier and less error-prone. That two commands are:

scripts/config --disable SYSTEM_TRUSTED_KEYS
scripts/config --disable SYSTEM_REVOCATION_KEYS
scripts/config --disable CONFIG_X86_X32
yes "" | make oldconfig

Then while running the “make” command, a line asking for the system key will come, just do nothing and press ENTER.

That’s all; your own Linux kernel will now be built without issue.

--

--

Abdullah Ibne Hanif Arean
Abdullah Ibne Hanif Arean

Written by Abdullah Ibne Hanif Arean

AI Researcher || Versatile Developer || Free Thinker || Motivated Instructor || Restless Learner

No responses yet