Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
A question about using kconfig on Gentoo / Linux
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
wolly01
n00b
n00b


Joined: 22 Jul 2017
Posts: 28

PostPosted: Mon Feb 12, 2024 1:59 pm    Post subject: A question about using kconfig on Gentoo / Linux Reply with quote

Apologies if this is the wrong sub-forum - not sure whether to post this particular question here or in the General Chat. I have a question about the tooling around kconfig.

Contex
I'm in the process of learning Ocaml which has gotten me onto the topic of research on setting up make-files and build-systems for the projects I am working on. I realised that for one such project it would be really helpful for me to have a menu config option like make menuconfig. So a little googling later and finding this post I discover that Kconfig is a language built out of the tooling used for the menuconfig when building the kernel and if I learn said language then all I need is a Kconfig client / interpreter to run any config files I make.

Great! so off I go googling and looking into what utilities I can emerge on Gentoo the only thing I can find that seems to be in the correct ballpark is kde-frameworks/kconfig . Problem is - I'm just looking for a command line app and this thing is pulling in kde frameworks and X11 libs. In an Ideal world I'm looking for something smaller. Thing is - I know that my (every?) Gentoo system has a kconfig client because of make menuconfig, and I think I have found it (but I'm not sure and I can't seem to find good documentation at any rate). This leads me to my main question:

Question
Is /usr/src/linux/scripts/kconfig/mconf a general kconfig interpreter to which I can use to run on my own kconfig files? Is there anything to stop me from just adding that program to my shell and just using it as is? If so is there a manual for its usage anywhere?

Best Wishes,
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 3833
Location: Bavaria

PostPosted: Mon Feb 12, 2024 3:14 pm    Post subject: Reply with quote

I dont know any (other) interpreters for Kconfig, but you are not alone with your idea of using it. In this article the author writes: "Interpreter (mconf, gconf, qconf, others) reads this file, current config (if it exists), and shows the menu":
https://habr.com/en/articles/515398/
but a short look into /usr/src/linux/scripts/kconfig/mconf.c shows me hardcoded messages like this:
Quote:
(Press <ESC><ESC> to continue kernel configuration.)

So, I am unsure if it is wise to use it ... :?

Do you know these links ?
https://sse.uni-hildesheim.de/media/fb4/informatik/AG_SSE/PDFs/publications/El-SharkawyKrafczykSchmid15.pdf
https://www.kernel.org/doc/html/next/kbuild/kconfig-language.html
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
wjb
Guru
Guru


Joined: 10 Jul 2005
Posts: 588
Location: Fife, Scotland

PostPosted: Mon Feb 12, 2024 3:45 pm    Post subject: Reply with quote

There's dev-python/kconfiglib, which has a single file "kconfiglib.py" implementation plus additional scripts for common tasks. It only depends on python & has a curses-based menuconfig.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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