Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Genkernel: how to make it more useful (inside)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
discomfitor
l33t
l33t


Joined: 21 Feb 2003
Posts: 927
Location: None

PostPosted: Mon Jan 17, 2005 3:53 pm    Post subject: Genkernel: how to make it more useful (inside) Reply with quote

I've been thinking about it recently, checking the forums here, and the general opinion of genkernel is that it's a waste of time and unless you don't know how to configure your own kernel, you shouldn't use it. Seems like a bit of a waste to just have it sitting out there not being used, doesn't it? Here's some things that I think would make it good enough so that I would actually use it (because it would be faster than configuring a kernel normally!):

1) Add a kind of "shell" interface to it so that when run in this mode it would be able to do a bunch of stuff sequentially.

2) Make it so there's no "generic config" as it uses now. It just wastes my time to have to turn stuff off, and it wastes the kernel neophyte's time waiting for the extra stuff to compile. Instead, you could set up genkernel to be the perfect kernel configuring tool by starting from scratch.

3) The first thing that it does is asks the user if there is a pre-existing config somewhere that it should use. User can type it in (tab completion somehow?) and then it uses that.

4) Next, we to have a bunch of functions in genkernel that would accurately guess the options needed based on the user's hardware and current software. For filesystems it would scan /etc/mtab and learn what the user was currently using. It could scan currently loaded modules and enable all of those (optionally building them into the kernel instead). Through lspci/lsusb it could guess the vast majority of hardware (have a database file somewhere in /usr/share that matches hardware descriptions and the option needed to enable the driver in the kernel; match the strings from lspci/lsusb to that file). Every option that it enables would be outputted ("CONFIG_* enabled - Enabling support for device XXX [OK]") so that the user can see what it's doing.

5) To round it out for power users, the penultimate prompt would be something along the lines of "Anything else you wanna add/remove?". The user could, at this point, type in anything, and it would search through all of the Kconfigs within the kernel tree to match it. For instance, you could type "-4kstacks" and it would return something like "Kernel Hacking->CONFIG_4KSTACKS disabled. Correct?" and the user would have to give a y/n. If it couldn't match the string within one of the CONFIG_* lines, it would search through the bool lines (for 4k stacks it says "Use 4Kb for kernel stacks instead of 8Kb"; the option you see in the graphical config) returning the same thing.

6) Finally, it would ask if the user wanted to run menuconfig/xconfig as a last resort.

With these modifications, I think genkernel would gain a dramatic increase in use. It would be great for adding new hardware because you could tell it to use the old config file, and it would detect your new new hardware and enable it for you! Newbies would get more use out of it, and at the same time they would be learning what all the options are doing. At the very least, it would put Gentoo square at the top of the kernel game. We've already got an incredible selection of kernels at our disposal, so why not have an equally amazing configuration tool for them?

Admittedly this stuff would take a while to program, and the database stuff would probably be a little hard to collect. That's where the forums here come in. If you're interested in this project, you can post here. If you're REALLY interested in this project, you can post some of your lspci stuff and the CONFIG options that you need in the kernel in order to get it working. That would solve the issue of having one person collecting all the information. If you're handy with python/shell scripting/something else, try your hand at this. It would definitely be worth your while.

Just my thoughts. Take them, modify them, or flame me.
_________________
There is no substitute for experience.
Imperfection indicates a lack of effort.
Back to top
View user's profile Send private message
r00tzz
Apprentice
Apprentice


Joined: 09 Apr 2004
Posts: 203
Location: Sao Paulo, Brasil

PostPosted: Mon Jan 17, 2005 8:47 pm    Post subject: Reply with quote

nice post!! I really think genkernel is useful, but with the changes you just sugested it would became far more useful.

As soon as I get home I'll post both lspci and a template of the .config I use.


Last edited by r00tzz on Tue Jan 18, 2005 12:52 pm; edited 1 time in total
Back to top
View user's profile Send private message
thechris
Veteran
Veteran


Joined: 12 Oct 2003
Posts: 1203

PostPosted: Mon Jan 17, 2005 11:21 pm    Post subject: Reply with quote

A much more useful feature:
* add entry to grub.conf, or lilo.conf as needed.

as for genkernel being oversized, yes. its hard to make a kernel work with everything without including support.

i'd say a script for the manual method would be better
_________________
HW problems. It's a VIA thing.
Back to top
View user's profile Send private message
predatorfreak
l33t
l33t


Joined: 13 Jan 2005
Posts: 708
Location: USA, Michigan.

PostPosted: Tue Jan 18, 2005 1:18 am    Post subject: Reply with quote

I agree with you on this, I believe genkernel has along way to go and I ultimately believe that your ideas are dead on and should be put into the design of genkernel.

Edit: One thing I'd also like to see is genkernel using lsusb/lspci to find say a RAID Controller (such as my fasttrack) and Build in all things needed for this Controller.
_________________
System: predatorbox
Distro: Arch Linux x86_64
Current projects: blackhole, convmedia and anything else I cook up.
Back to top
View user's profile Send private message
Teh Penguin D00d
n00b
n00b


Joined: 31 Dec 2004
Posts: 35
Location: Tampa, FL

PostPosted: Wed Jan 19, 2005 2:31 am    Post subject: Re: Genkernel: how to make it more useful (inside) Reply with quote

Darckness wrote:

3) The first thing that it does is asks the user if there is a pre-existing config somewhere that it should use. User can type it in (tab completion somehow?) and then it uses that.


Perhaps a genkernel USE flag. If set, as part of merging a kernel, it reads the current /usr/src/linux symlink, creates a /usr/src/oldlinux symlink, and creates the *proper* new /usr/src/linux symlink. Then, the old config can be fetched from /usr/src/oldlinux. The problem is the poor gnubie getting an original *well done* kernel configuration on their machine...but if they manage to do it once, with some help, then that's all it'd really take...

::puts $0.02 in a jar.::
Back to top
View user's profile Send private message
MrApples
Guru
Guru


Joined: 13 Dec 2002
Posts: 511

PostPosted: Wed Jan 19, 2005 3:47 am    Post subject: Reply with quote

nice post darckness

i feel that genkernel is a really nice thing to have, but i also think it needs to mature a lot more
_________________
http://www.whatsinyourbox.org -- Technology discussion, news, and more.
Back to top
View user's profile Send private message
Xemoka
n00b
n00b


Joined: 08 Jul 2004
Posts: 32
Location: BC, Canada

PostPosted: Wed Jan 19, 2005 6:01 am    Post subject: Reply with quote

I thought about this a while ago, and figured why hadn't it been done already? Wouldn't it had been the next logical step from building the kernel yourself to have a Kernel that has a fairly simple "auto-detect" ?

For the detection, couldn't you take a few things from Knoppix? That cd seems to be able to detect everything pretty well, couldn't you force it to output it's ending .config file? or does it just compile everything in and force moduel load? Perhaps, have the system start up with a ``genkernel" then after the load, present the user with an option (last line of kernel loading display, Enter ``GenKernelConfig" into the root prompt for kernel configuration) and a program, that allows the system to make that generated kernel (and it's configs) static. That might be simpler? no? and would allow the person to say, Yeah that works, before having it go through...
_________________
#gentoo-glbt
Spend a little time and answer a few questions!
Learn how to Properly emerge ~arch
Back to top
View user's profile Send private message
MrApples
Guru
Guru


Joined: 13 Dec 2002
Posts: 511

PostPosted: Wed Jan 19, 2005 6:34 pm    Post subject: Reply with quote

sure livecds do a nice job of autodetecting, but the way that works is with a really bloated kernel, i think what we are talking about is a better means for autodetecting that configures only what the user needs for the kernel
_________________
http://www.whatsinyourbox.org -- Technology discussion, news, and more.
Back to top
View user's profile Send private message
Xemoka
n00b
n00b


Joined: 08 Jul 2004
Posts: 32
Location: BC, Canada

PostPosted: Wed Jan 19, 2005 6:42 pm    Post subject: Reply with quote

MrApples wrote:
sure livecds do a nice job of autodetecting, but the way that works is with a really bloated kernel, i think what we are talking about is a better means for autodetecting that configures only what the user needs for the kernel


Yeah, see that was my question basicly, i wasn't sure if they just used a bloated kernel, or if they actually detected things, since knoppix seems to Label my sound card and video cards properly, i assumed that perhaps they might be detecting my settings, and then loading the right moduels, but I guess not.
_________________
#gentoo-glbt
Spend a little time and answer a few questions!
Learn how to Properly emerge ~arch
Back to top
View user's profile Send private message
djdunn
l33t
l33t


Joined: 26 Dec 2004
Posts: 651
Location: Under the moon and all the stars in the sky.

PostPosted: Wed Jan 19, 2005 6:47 pm    Post subject: Reply with quote

it would be great to even add a find command in menuconfig at least
_________________
Now, with penguins, (cuddly such), "contented" means it has either just gotten laid, or it's stuffed on herring. Take it from me, I'm an expert on penguins, those are really the only two options.

--Linus Torvalds
Back to top
View user's profile Send private message
Teh Penguin D00d
n00b
n00b


Joined: 31 Dec 2004
Posts: 35
Location: Tampa, FL

PostPosted: Wed Jan 19, 2005 8:12 pm    Post subject: Reply with quote

djdunn wrote:
it would be great to even add a find command in menuconfig at least


Press "/".
Back to top
View user's profile Send private message
discomfitor
l33t
l33t


Joined: 21 Feb 2003
Posts: 927
Location: None

PostPosted: Tue Jan 25, 2005 4:40 pm    Post subject: Reply with quote

Nudge.
_________________
There is no substitute for experience.
Imperfection indicates a lack of effort.
Back to top
View user's profile Send private message
abcdefg
Apprentice
Apprentice


Joined: 29 Feb 2004
Posts: 216
Location: The Netherlands

PostPosted: Tue Jan 25, 2005 5:42 pm    Post subject: Reply with quote

Hi,

Some time ago I had another idee to create genkernel, there is a directory with a lot of scripts which can detect something. For instance the script CONFIG_REISERFS_FS would check if there exist a reiserfs partition and if it does than it would print (echo) y and else n. Or for instance the file CONFIG_MPENTIUMIII which would check if the computer is a pentium3, if it is it would print y and if it isn't nothing.
Than there is one main script which execute all those scripts and generates the config file. If for an option isn't a script than it would take the value out the default config file.

This script could be the main script:
Code:
DIR="scripts"
DEFAULT="default_config"
CONFIG="generated_config"

SCRIPT=$(ls $DIR)

if test -e $CONFIG
then
        rm $CONFIG
fi

for X in $SCRIPT
do
        answer=$($DIR/$X)
        if test $answer == y
        then
                echo "$X=y" >> $CONFIG
        elif test $answer == n
        then
                echo "$X=n" >> $CONFIG
        fi
done

for X in $(cat $DEFAULT | egrep -v "^#|^$")
do
        result=y
        for Y in $SCRIPT
        do
                if test $(expr substr $X 1 $(echo $(expr index $X =)-1 | bc)) == $Y
                then
                        result=n
                        break
                fi
        done
        if test $result == y
        then
                echo $X >> $CONFIG
        fi
done


This way it is easy to develop a lot of auto detect scripts.
What do you think of this idee? Or is it just stupid? (I don't know much about kernels...)

edit: uploaded the wrong script :oops:
Back to top
View user's profile Send private message
discomfitor
l33t
l33t


Joined: 21 Feb 2003
Posts: 927
Location: None

PostPosted: Wed Jan 26, 2005 4:48 pm    Post subject: Reply with quote

abcdefg: Looks like a great start.

Keep the thoughts coming people!
_________________
There is no substitute for experience.
Imperfection indicates a lack of effort.
Back to top
View user's profile Send private message
MaxPolun
Tux's lil' helper
Tux's lil' helper


Joined: 28 Dec 2004
Posts: 111

PostPosted: Wed Jan 26, 2005 5:40 pm    Post subject: Reply with quote

This is something I've wanted in any linux distro for a while, but I never thought of using genkernel for it. Tremendous, maybe someone will make it now. :D
_________________
Far from idleness being the root of all evil, it is rather the only true good --soren kierkegaard

The Real OTW: time to do some good
Back to top
View user's profile Send private message
boroshan
l33t
l33t


Joined: 16 Apr 2003
Posts: 730
Location: upside down

PostPosted: Thu Jan 27, 2005 7:57 pm    Post subject: Reply with quote

About point 2: getting rid of the generic set up would save me, and I'm sure many others a lot of time, if we used it, but might there be a case for keeping the generic setting?

One of the few things could persaude me to run a genkernel system would be when I have something new to add to the system. Between udev and the squillions of modules genkernel builds, there's a fair chance that new hardware will just work, rather than having to read up on it, find the right settings, recompile and hope. I'd probably not use it even so, but a good generic kernel has a lot to recommend it sometimes.

As a related issue, people looking to build live cds, or administer networks of machines may well find some use for the generic option.

The other reason, of course, is the newcomers to kernel compilation. Genkernel is a bit of a pain for the old hands to use, but are we really the target audience? I would say the current default genkernel behavior is about right.

Perhaps the solution would be to have two commands (the same code linked to two different file names perhaps) with different behaviour according to which one you invoked

[edited in the interests of coherence ]
_________________
Don't let THEM immanentize the Eschaton!


Last edited by boroshan on Wed Feb 16, 2005 12:16 am; edited 1 time in total
Back to top
View user's profile Send private message
Dr_Barnowl
n00b
n00b


Joined: 05 Feb 2005
Posts: 3

PostPosted: Sat Feb 05, 2005 4:17 pm    Post subject: Kernel /proc/config.gz support Reply with quote

With the 2.6 kernels now supporting a device that lists the booted kernel config, it should be possible for ebuilds to inspect the kernel config while they are starting up :- so you should be able to sweep through your world of dependencies and produce a list of kernel options your system requires, warn about kernel options that are missing or conflicting, and even produce a script to write options to your .config file.

By extension, you could do the same for hardware as well as software ; but this would take a lot more effort as you'd need a database of hardware devices and their required kernel options. An list of autodetected hardware, plus a hierarchical menu like the kernel options menu, which let you pick devices and set the proper kernel options, would be the ideal.

Hell, something that also set devfs devices or udev rules would also be great :)

If this is all too obvious, forgive me, I just spent 3 weeks trying to configure a bt848 TV card and it still won't work. I'm a little sleep deprived.
Back to top
View user's profile Send private message
Jengu
Guru
Guru


Joined: 28 Oct 2004
Posts: 383

PostPosted: Mon Feb 14, 2005 9:57 pm    Post subject: Reply with quote

Wouldn't the easiest way be to use a bloated liveCD kernel, see what modules it loads, and then based on that change the .config?
Back to top
View user's profile Send private message
MaxDamage
l33t
l33t


Joined: 03 Jan 2004
Posts: 650
Location: Oviedo, Spain

PostPosted: Tue Feb 15, 2005 1:15 pm    Post subject: Reply with quote

thechris wrote:
A much more useful feature:
* add entry to grub.conf, or lilo.conf as needed.

as for genkernel being oversized, yes. its hard to make a kernel work with everything without including support.

i'd say a script for the manual method would be better


It does add an entry to Grub/Lilo using the existing entries already. ;)
_________________
La PDA de tungsteno
Back to top
View user's profile Send private message
henri
Apprentice
Apprentice


Joined: 15 Nov 2002
Posts: 182
Location: Germany

PostPosted: Sat Feb 26, 2005 11:12 am    Post subject: Reply with quote

Hi folks,

I think the main idea, to have some investigating scripts to configure the kernel, is very good, but why use this with genkernel?

In my opinion, genkernel's purpose is to make a (CD)installation work without the kernel knowing about the hardware before boot and to recognize the modules to load.

If we want to edit the .config file to fit exactly the hardware on the machine we will run the kernel on, why should we use genkernel? - There's no need for it then imho.
If we only compile the modules we need then or even build them into the kernel then we already know which modules we will use, so why should we use the overhead of genkernel instead just add the required modules to /etc...modules.autoload, add the grub entries and we're rolling?

Ah, but there's one thing I would like to have changed in the default genkernel-config: IP-tables enabled by default!

Yours Henri
Back to top
View user's profile Send private message
boroshan
l33t
l33t


Joined: 16 Apr 2003
Posts: 730
Location: upside down

PostPosted: Sat Feb 26, 2005 2:02 pm    Post subject: Reply with quote

Well... the auto generation of configs can be considered useful, esp. if you're a noob with no idea of what sort of drive controller he's got and no idea how to find out. Genkernel also pakages up some other tricky stuff, notably a initrd for boot time.

But I do like the idea of a mid-level factoring out some of the functionality. Sort of "this is what we think your system is like, what do you want the config script to be called?"
_________________
Don't let THEM immanentize the Eschaton!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat 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