1

I am trying to compile linux kernel 6.1 on Debian 12.

I have installed the build environment:

apt-get install build-essential bc libncurses-dev libssl-dev libelf-dev bison flex

Now when I run make menuconfig, I get this output ant then it hangs forever:

  ~/linux-6.1.44: make menuconfig
  HOSTCC  scripts/basic/fixdep
  UPD     scripts/kconfig/mconf-cfg
  HOSTCC  scripts/kconfig/mconf.o
  HOSTCC  scripts/kconfig/lxdialog/checklist.o
  HOSTCC  scripts/kconfig/lxdialog/inputbox.o
  HOSTCC  scripts/kconfig/lxdialog/menubox.o
  HOSTCC  scripts/kconfig/lxdialog/textbox.o
  HOSTCC  scripts/kconfig/lxdialog/util.o
  HOSTCC  scripts/kconfig/lxdialog/yesno.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  LEX     scripts/kconfig/lexer.lex.c
  YACC    scripts/kconfig/parser.tab.[ch]
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/menu.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/util.o
  HOSTLD  scripts/kconfig/mconf

I have ncurses installed:

# dpkg -l | grep ncurses
libncurses-dev
libncurses6
libncursesw6
ncurses-base
ncurses-bin          

am I still missing some component of the build system ?

UPDATE

ps shows these processes:

6322 root       S+    0.0  0.0 pts/0    03:59         /usr/bin/make menuconfig
6416 root       S+    0.0  0.0 pts/0    03:59           /usr/bin/make -f ./scripts/Makefile.build obj=scrip
6593 root       S+    0.2  0.0 pts/0    03:59             scripts/kconfig/mconf Kconfig

when I kill scripts/kconfig/mconf Kconfig, the make menuconfig process terminates with folloing errors:

make[1]: *** [scripts/kconfig/Makefile:48: menuconfig] Error 1
make: *** [Makefile:704: menuconfig] Error 2

before I killed it, I attached to the scripts/kconfig/mconf Kconfig, process with strace, and I see thousands of these POLLIN Timeout messages:

poll([{fd=0, events=POLLIN}], 1, 0)     = 0 (Timeout)

full strace output here: https://ctxt.io/2/AABQcjjOFw

12
  • 1
    Start by looking at the children of your make command (pstree) to see if maybe one of its children are stuck. Run strace on your make command or on its child to see where it's hang.
    – aviro
    Aug 14, 2023 at 17:10
  • @aviro - thank you, please see my update Aug 19, 2023 at 2:09
  • BTW Firing make menuconfig does not trigger the compilation of the kernel. Only the launch of some GUI. What happens if you launch other ncurses programs (vi, top…)
    – MC68020
    Aug 19, 2023 at 6:10
  • Additionally you know that killing a ncurses process is not recommended since the process will not issue the appropriate commands needed to restore your terminal to its standard discipline.
    – MC68020
    Aug 19, 2023 at 6:15
  • 1
    @MC68020 - all other ncurses programs work fine (mc, top). And I don't have X installed, this is remote server, and I am connecting via ssh Aug 19, 2023 at 6:49

1 Answer 1

-1

I am trying to compile linux kernel

Possibly.

I run make menuconfig

OK but this will in no way build a linux kernel.
This command will only help you to build the .config text file in a more user-friendly way. If you actually want to build the linux kernel, simply fire make in the kernel source base directory.

Therfore, the easiest (an possibly more secure) way to achieve your goal is certainly to :

  • 1 download the kernel source tree on some local machine (whatever system physically connected to whatever authentic tty)

  • 2 Build the kernel .config file under this system using whatever GUI of your choice (make menuconfig or make xconfig)

  • 3 Log on the remote system via ssh,

  • 4 Copy your newly designed .config to the remote's system kernel source directory

  • 5 Change to that directory then fire : make !

2
  • I am trying to build a kernel. The process has several steps. I am stuck at step 1 (make menuconfig). My question is why make menucionfig hangs. Saying: "just do it on another machine then", is like saying, well then don't compile kernel, use the distribution kernel instead. problem solved. And, secondly, my local machine does not have development environment. Aug 20, 2023 at 2:30
  • 1
    @400theCat : If you caredully re-read my answer… you do not need any dev.env. on your local machine since you'll buil on the remote. Please… realize that make menuconfig won't achieve anything else than whatever text editor would achieve.
    – MC68020
    Aug 20, 2023 at 18:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .