Kernel - make menuconfig error

Working with a Headless Raspberry PI 4 with an Ubuntu Server 18.04.4 LTS.. I am trying to configure the source kernel. I have installed libncurses-dev, kernel-package, qt4-dev-tools.

When I run 'make menuconfig' in the directory /linux-5.7, it shows:

 LEX scripts/kconfig/lexer.lex.c
/bin/sh: 1: flex: not found
scripts/Makefile.host:9: recipe for target 'scripts/kconfig/lexer.lex.c' failed
make[1]: *** [scripts/kconfig/lexer.lex.c] Error 127
Makefile:588: recipe for target 'menuconfig' failed
make: *** [menuconfig] Error 2

Lost on what to do, everything I have read hasn't helped so far. My goal is to start programming device drivers, and to do so I need a configured and built kernel source tree on disk.

0

3 Answers

In the Ubuntu's Build Your Own Kernel guide it is stated that you have to install following programs :

sudo apt-get install libncurses-dev flex bison openssl libssl-dev dkms libelf-dev libudev-dev libpci-dev libiberty-dev autoconf

to be able to compile the kernel from source successfully.

flex is not installed. Install it by

sudo apt install flex

I'm not sure this will be helpful, but when making kernel modules you can receive this same error if the makefile in use uses the keyword SUBDIRS= which was eliminated after version 5.3 of the kernel. Instances of SUBDIRS= need to be replaced by M=

Again, this is for building modules and drivers, but I would be surprised if building the kernel did not require similar references depending on the tools being used.

0

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like