Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Linux 2.6.20 is FINAL!!!

Here you can discuss every aspect of Debian. Note: not for support requests!
Message
Author
olshevch
Posts: 33
Joined: 2006-12-21 12:14
Location: Espoo, Finland

#31 Post by olshevch »

thamarok wrote:As far as I know, menuconfig doesn't "update" your config file.. Am I wrong here?
I am not sure...
But there are some things that menuconfig can do:
1) Loading a config file
2) Displaying all available options
3) Saving the config

As it loads, I expect it to set appropriate loaded options to correct state as it is in the loaded config. It did not complain while loading old config.

As it displays, I explect it to show all possible options for the kernel version, including ones missing from loaded config. I saw these new options in menu.

As it saves, I expect it to save all options that I have seen in menu in config. Is it not so?

thamarok

#32 Post by thamarok »

Yeah.. then why are some people talking here about something that menuconfig would download a new config from the net? That's just impossible.

Lavene
Site admin
Site admin
Posts: 4958
Joined: 2006-01-04 04:26
Location: Oslo, Norway

#33 Post by Lavene »

thamarok wrote:Yeah.. then why are some people talking here about something that menuconfig would download a new config from the net? That's just impossible.
That make no sense at all (to me at least)... where have you heard that?

Tina

thamarok

#34 Post by thamarok »

@Tina: Page 2 of this topic:
lmo wrote:
Did you really think that a 2.6.18 kernel config would work on 2.6.20? There are so many differencies between those kernels, so I'm not surprised that you get a lot of errors...
I ran 'make menuconfig' so that kernel.org would upgrade my .config for me. I really believe that they know what they are doing.
From what I understand, lmo is saying that he ran menuconfig to upgrade the config from the internet :?

Lavene
Site admin
Site admin
Posts: 4958
Joined: 2006-01-04 04:26
Location: Oslo, Norway

#35 Post by Lavene »

thamarok wrote:From what I understand, lmo is saying that he ran menuconfig to upgrade the config from the internet :?
Ok, thanks.
No that's not right...

Tina

User avatar
AgenT
Posts: 477
Joined: 2007-01-21 01:25

#36 Post by AgenT »

It is true that you can "upgrade" your kernel without having to redo the whole config. It is false that this is done via the internet.

To reuse your old .config, you simply need to copy it over and then run make oldconfig.

This is not recommended for most kernel upgrades. It should be okay when the kernel version number has not changed, but the kernel has only been patched with security patches. For example, for a 2.20.0 to 2.20.1 upgrade, a fresh .config is recommended, for a 2.20.0 to 2.20.0-2 upgrade, oldconfig should be enough.

I hope this clears up the confusion.

Example upgrade:

Code: Select all

# cd /usr/src/newkernel
# cp ../oldkernel/.config .
# make oldconfig

jjmac
Posts: 384
Joined: 2005-12-28 23:34
Location: Australia

kernel configuration

#37 Post by jjmac »

AgenT

>>
To reuse your old .config, you simply need to copy it over and then run make oldconfig.

This is not recommended for most kernel upgrades. It should be okay when the kernel version number has not changed, but the kernel has only been patched with security patches. For example, for a 2.20.0 to 2.20.1 upgrade, a fresh .config is recommended, for a 2.20.0 to 2.20.0-2 upgrade, oldconfig should be enough.
>>

No, the above is completely mistaken ... You are mistaken on what 'oldconfig' does and on how the existing .config file is used. And the referance to a fresh config is confused.



The configuration for a kernel is scatered around the directory stucture in files called 'kconfig'.

When you run make menuconfig or gconfig or xconfig these files will be collated and merged together.

Then a file found in

/usr/src/linux/arch/$ARCH

called 'defconfig' whiich contains the option defaults that are demed most suitable for your architecture are applied.

It will then look for a dot file called '.config' located in the top level source directory and over-ride the default options it has already applied, with those found within .config

If an option in the existing .config has been removed from the current option set, then it will be ignored. If an option in the current set isn't represented in the existing .config then the current default will remain.

The difference in the various configuration targets for 'make' is in the way this is all presented to you.

The oldconfig target, is badly named in my opinion. What it will do is just present any 'new options found'. It will assume that your quite happy with the existing configuration state it describes and are only interested in new option.

A very handy way to just find what and how many new options there are. Or if it is a configuration being made after a smallish patch has been applied, then you may only have one or two associated options you want to set. So 'oldconfig' will take you directly to them.

You are advised that after having run 'oldconfig' you back up the file and then run one of the graphical targets like 'gconfig' or 'xconfig'. These will give you a tree view structured lay out that you can traverse and 'explore' the option set with. In a comfortable fashion.


Starting off with a .config file that reflects the existing kernel being used is advisable. That is, if you have just fetched the sorces for your installed kernel so that you can do a manual compile/tune to suit your particular box. That can be found in the /proc directory if one dosen't already exist.

As for imo's mention of

>>
I ran 'make menuconfig' so that kernel.org would upgrade my .config for me. I really believe that they know what they are doing.
>>

I think thats just a quirk of expression more than anything else.

Also, the defaults are there just to cover the broader general set and shouldn't be thought of as absolutes.

Tuneing for your particular cpu, environment is a good idea in my opinion.

A person just needs to familiarise themselves with the configuration process an just gradually build their configuration set into something most suitable to their own needs, and then back the file up.

And of course, there is no point in changing options if the option isn't understood, so often it will be best to retain the default.

Starting off from scratch with each kernel update is just crazy.



jm

luckykar
Posts: 11
Joined: 2007-02-20 00:35
Location: Australia

#38 Post by luckykar »

I seem to be a bit lost i have just started playing with kernels, i have complied a 2.6.20.3 vanilla kernel from the stable tree at kernel org.

Now i copied the .config file from a previous kernel 2.6.20-1 and pasted it in the 2.6.20.3 sources directory then i just used the command make-kpkg --initrd --append-to-version=-whatever kernel_image kernel_headers and made the deb files.

Now i have installed this on my etch install and it works fine but have i done it right was i supposed to use make oldconfig or make menuconfig or make xconfig , all i want to know is would the kernel just use my .config file that i pasted into the source or would it just use the default options from the vanilla kernel.

Thanks

jjmac
Posts: 384
Joined: 2005-12-28 23:34
Location: Australia

kernel configuration

#39 Post by jjmac »

luckykar,

The above does actually explain it.

Each kernel source package will have maintainer provided 'fragments' of the over all set of configuration parameters that pertain to that source file collection. Along with any associated doc/help information.

The only 'options' that are available for that source file collection are what constitutes those fragments.

The different 'configuration' types ...
gconfig, xconfig, menuconfig, oldconfig etc are mearly Makefile targets that present those options in a variety of ways.

First they need to be collected and sorted.

Then a set of 'defaults' are applied to them. This involves such things as whether they will be flagged as modules or builtins, or if they are to be left unset. Possibly due to them representing some experimental facility, or something not commonly used.

These defaults are sourced from a file called 'defconfig' and will depend on the architecture that the kernel is being compiled on.

If you look in the directory ...

.../arch/$ARCH for your platefom you will find those files ...

defconfig <----- the defaults used.
kconfig <-------- an option fragment.

Once that collation process has been performed, make will look for an existing configuration file '.confg', resulting from a previous configuration run, in the top level of the source tree.

If found, it will use the settings there to over-ride any of the settings that the defaults may be set to.

The idea is to save your time. You may have the cpu type set specifically to suite your box and the default may involve a different setting. So why always have to reset it for each configuration run.

The closer the source version is to that used to generate the previous .config file, the less will be the over all difference in the set of options.

If that separation becomes to great, such as a .config from a kernel 2.0.x build being used as the over-ride for a 2.6.x build, make will likely spit a message informing you that it is to old and is going to be ignored.

oldconfig target:
-----------------------

curses based display.
will use a term window to only present option that are new. Those that aren't already set in a pre-existing .config file.

It presumes that you don't want to change any existing option settings, and only wish to look at whats new.

Handy to see just how many new options there are, and what they are. Or to just access a single option that may be provided by a small patch you just supplied.

It also assumes you really know your options as once set, oldconfig will just 'woosh' through a second run.

gconfig | xconfig | menuconfig:
-------------------------------------------

Presents all the available options, after the over-rides have been applied in a convieniant 'tree view' display.

The idea being that you can explore that tree view, its' various branches and consider the various choices.

You can save at any time, you can re-run as much as you want, you can reload another .config you may have saved at any time to reset the over all set.

Very handy by itself or after having run 'oldconfig'.

Very handy in terms of becoming familiar with the over all option set, and maybe setting things differently from time to time. Such as, building a second kernel of the same version but possible with some extra debug facilities built in.

gconfig uses a gtk based gui.
xconfig uses a Qt based gui.
menuconfig uses a term window.

What you did was to use a .config that was very close to the new version source that you were working with so there would be very little if any difference between the over all set of options. And as such would likely present no problems.

And 'kpkg' would have just run with the defaults and the existing over-ride.

It is a very 'slackish' way to do it, and would likely mean you would miss out on using any real enhancements that a later kernel might provide. Such as that between a 2.6.18 and a 2.6.20.

Also, a distros default kernel will usually incorporate a patch set, and will also tend to try and cover as much as possible with regard to 'driver' inclusions.

The beauty of 'rolling your own' is that you can tune things down to suite your hw setup. But you could also miss out on facilities provided by any patches that may be missing. So, look into what kind of patches that the distro provides.

With deb thats easy enough as they will be found in the '.diff.gz' file associated with the kernels source file set for a particular release (woody, sarge, etch/testing). Even if the kernel version is behind the current one, it will commonly have facilities back ported that the maintainer deems appropriate/usefull/stable.

>>
have i done it right ...
>>

You haven't done it wrong as such, but a bit lazily. If you want to compile kernels i would advise familiarising yourself with manual builds.

>>
was i supposed to use make oldconfig or make menuconfig or make xconfig
>>

Hopefully that is explained. They may work together, or separately.


>>
.config file that i pasted into the source or would it just use the default options from the vanilla kernel.
>>

As above, it will be used as an over-ride. The defaults with out a fairly recent .config can be a bit general. Such as being configured for a 'PentiumII, smp' while you may have a 64bit AMD uniprocessor :wink:


If you type ...

]$ make help

you will get some other brief info, and look in to the versioning fields at the top of your Makefile.

A ]$ make mrproper

will delete, amongst others, all files that start with a 'dot' too.



jm

luckykar
Posts: 11
Joined: 2007-02-20 00:35
Location: Australia

#40 Post by luckykar »

Hi Jim thanks very much for your detailed reply , i now see what is going on were before i was a little in the dark but this is a really fascinating aspect of linux and i am like a kid with a new toy. I will start to build a manual kernel from scratch as you suggest , i did try this first and they all failed 5 times but that was the learning curve i guess. I have been doing lots of reading on the subject and its all starting to sink in "i hope" , thanks again for your reply.

Debian Rocks

Cheers

jjmac
Posts: 384
Joined: 2005-12-28 23:34
Location: Australia

kernel compiles

#41 Post by jjmac »

luckykar wrote:
>>
this is a really fascinating aspect of linux ...
>>

Yes it is :), and not as difficult as a lot of people think either. But certainly not a trivial exercise. As with most things, it's just a matter of becoming familiar with, and there is only one way to do that.

If i may suggest, try and get a source set for the distro version your using first as a jump off point. if you haven't already. But it sounds as though you probably have.

That would likely be a deb package in this case. All the relevant patches will be in the .diff.gz file found on

ftp.debian.org/pool

but the souces will be vanilla, so it doesn't really matter were they are sourced.

Due to the size, a good trick is to get a complete vanilla package off something like a magazine dvd, then just incrementally upgrade it with vanilla patches. Makes life for 'dialup' people like me much easier.

Also, it can be informative to look around some of the maintainer mailing lists too.

I would recommend Con Kolivas there for one,

http://bhhdoa.org.au/pipermail/ck

for the mailing list and other info,

http://www.kernel.org/pub/linux/kernel/people/ck

for the 'ck' patch set.

Curiously, once people start to use the 'ck' patches, which also include stable elements from 'mm' and 'ac' etc, they never seem look back. And i'm not actually surprised in that :).

The focus there being on increased desktop responsiveness via the ck schedular (staircase).

Aside from debs packaging structure and 'make install', all a person needs to do really is to make sure the 'module versioning' options are set, and the 'EXTRAVERSION' field in the Makefile is customised and they can have many different kernels available, all built from the same source version set.

All thats required is for

.../arch/i386/boot/bzImage

and

.../System.map

suffixed with that versioning string and copied directly over to the partition/directory that hangs off /boot

Then an appropriate entry made in their boot loaders' config file. And there ready for use.

In my current case that works out as,

bzImage-2.6.19-ck2-1
System.map-2.6.19-ck2-1

the dash one, '-1' i added to distinguish it from ... say, '-2'

There will be a /lib/modules/2.6.19-ck-1 directory as well of course.

Too many people seem to allow the auto install facilities take over imo, either wiping out, or leaving unavailable good prior builds, including the distros original.

In any case, good luck with all that.


jm

luckykar
Posts: 11
Joined: 2007-02-20 00:35
Location: Australia

#42 Post by luckykar »

Hey thanks again Jim for your reply and those links , i will be having a good look around and reading the links you provided. I have been looking through the kernel and compiled a very fast 2.6.20 kernel from http://kernel-archive.buildserver.net/debian-kernel/ trunk main . I downloaded the source and built it and it is running very nice.

Thanks Again

Post Reply