LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 05-20-2008, 04:06 AM   #1
tramni1980
Member
 
Registered: Jul 2006
Location: Tübingen, Germany
Distribution: Slackware64-13.37
Posts: 737

Rep: Reputation: 37
What exactly do "make oldconfig && make prepare" when issued in the kernel sources?


Hello!
I am running Slackware 12.1 with kernel generic-smp-2.6.24.5-smp. Recently I tried to compile a webcam module and following the instructions I went into /usr/src/linux-2.6.24.5 and as root I issued the following two commands in succession:

make oldconfig
make prepare

Gnashley (a guy from the forum) said that this has made no harm, but I would like to know what modifications they have done to the stock 12.1 system. I can see that the folders /usr/src/linux-2.6.24.5/include/ and /usr/src/linux-2.6.24.5/.tmp-version/ and the files /usr/src/linux-2.6.24.5/.missing-syscalls.d and /usr/src/linux-2.6.24.5/.config have been modified as a result from the above two commands. Have other files in the system also been affected? Does this somehow affect the functionality of the system? Most of all I am interested whether it affects software that I compile. I could have installed afresh to make sure that everything is ok, but I think it is more valuable to learn something new than to just reinstall. I would be thankful if you also direct me to some relevant literature.

Regards,
Martin
 
Old 05-20-2008, 06:12 AM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
The "make oldconfig" part will create a .config file based on how your running kernel is configured. You will be prompted for any new items when you are compiling newer kernel source. This allows you only change items you are interested in, such as the webcam module and not have to go through everything in the xconfig step.

I had to read the Make file to find out about "make prepare". It runs in stages and seems to deal with either the output being in a separate directory or preparing for a particular architecture.
 
Old 05-20-2008, 10:07 AM   #3
tramni1980
Member
 
Registered: Jul 2006
Location: Tübingen, Germany
Distribution: Slackware64-13.37
Posts: 737

Original Poster
Rep: Reputation: 37
Thank you for your reply.
My basic interest is whether it makes actual changes to the stock 12.1 system and whether it affects somehow the packages I compile.
 
Old 05-20-2008, 10:41 AM   #4
Maligree
Member
 
Registered: Mar 2008
Distribution: Gentoo, CentOS, Fedora, Arch
Posts: 231
Blog Entries: 1

Rep: Reputation: 42
Out of curiosity: any idea how it determines the current kernel's .config? Via /proc/config.gz? Since that's an optional feature make oldconfig would only work if it was compiled into the already running kernel. Or is there a different way?
 
Old 05-20-2008, 04:12 PM   #5
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,276

Rep: Reputation: 686Reputation: 686Reputation: 686Reputation: 686Reputation: 686Reputation: 686
`make oldconfig` reads the .config file in the current directory and prompts you about any new changes to the kernel (ie if you want to add some of the new features). I'm not sure if it checks the contents of the running kernel or not -- but you could always use `zcat /proc/config.gz > .config` followed by `make oldconfig` if you wanted to do that (though you obviously shouldn't do that in this case...). I generally don't mess with the default kernel -- or even the /usr/src directory -- at all, and instead build kernels in a directory on my /home partition. That way there's no worry. I realize you didn't try to build a new kernel (unless you're leaving out some information), but something obviously messed with your kernel sources.
 
Old 05-21-2008, 01:31 AM   #6
tramni1980
Member
 
Registered: Jul 2006
Location: Tübingen, Germany
Distribution: Slackware64-13.37
Posts: 737

Original Poster
Rep: Reputation: 37
Quote:
Originally Posted by T3slider View Post
I realize you didn't try to build a new kernel (unless you're leaving out some information), but something obviously messed with your kernel sources.
No nothing in my system seems screwed now, everything seems to be ok. I just want to learn what chnges to the 12.1 system I actually did issuing those two commands in the kernel sources and whether those changes (if any) affect the software I compile.
 
Old 05-21-2008, 02:18 AM   #7
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,768

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
The commands simply prepare the sources for compilation. If the sources have never been configured before, a default configuration is used -I'm not sure where it is in the current sources. If you run 'make menuconfig' in a 'virgin' source tree, these default valuse are used to start with. If you copy an existing '.config' file into the source tree, then the values contained there will be used as a starting point. Running 'make oldconfig' uses these values and only asks you questions if the sources contain new options which were not available in the sources where the .condig file was generated.

When you try to compile sources other than the kernel, they sometimes need for the kernel sources to have been configured -this is because when you configure the kernel sources certain files are generated which indicate which version the kernel sources are. You do not need to have compiled the kernel sources for this to work -only to have configured them, and it does not matter whether the configuration is the same as what you would use if you were to compile the kernel.

I can't give you a complete list if all files created when you run the commands -you'd need to study the Makefile to see what happens or copy the virgin sources and then run the commands in one of the copies and then use 'diff' to see exactly which miles are created/modified. The commands are completely harmless and can be reversed by running other commands. The Makefile rules 'clean', 'distclean', 'mrproper' are the most common ones for removing configuration files -each of them does different things. Only by careful study of the Makefile rules or using diff can you easily determine the exact changes which occur when using each rule.
 
Old 05-21-2008, 06:36 PM   #8
ludist
Member
 
Registered: Nov 2005
Location: Greece
Distribution: Slackware
Posts: 129

Rep: Reputation: 16
Quote:
Originally Posted by tramni1980 View Post
Most of all I am interested whether it affects software that I compile.
Don't worry, no changes that affect the system was made.

For psychological reasons, you can restore in "proper" status with
Code:
make mrproper
 
Old 05-21-2008, 07:05 PM   #9
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,276

Rep: Reputation: 686Reputation: 686Reputation: 686Reputation: 686Reputation: 686Reputation: 686
Quote:
Originally Posted by ludist
For psychological reasons, you can restore in "proper" status with
Code:
make mrproper
It should be noted that `make mrproper` cleans the source directory and deletes the .config file -- it's probably not the best idea to do this with working kernel sources. If you *do* do this, then you'll make to run `make oldconfig` and `make prepare` again, or else some apps won't compile, as gnashley explained.
 
Old 05-21-2008, 07:44 PM   #10
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 227Reputation: 227Reputation: 227
FYI - after looking at the Makefile - make oldconfig appears to look at the standard config for each kernel version in /usr/src/linux/include/config/auto.conf and query the kernel compiler (user) as to what he wants to select for any kernel options that are not available in the /usr/src/linux/.config file.

In other words what additional options are available from the current .config in the source tree. This obviously is a shortcut when compiling a new kernel against an existing config as only new options will be queried.

A lot of postings seem to be asking about compiling custom kernels under Slackware but seriously, given that I run Slackware on many varying machines, I find the generic kernel (OK with the attendant initrd) perfectly adequate.

Given modern hardware and modern kernel advances I feel there is not much to be gained by a custom kernel compilation.

To the uninitiated, the beauty of the generic kernel/initial ram disk boot up is supposedly only the modules required are loaded by the kernel.

Admittedly sometimes this can go wrong but in general once initial FS modules are loaded and inittab is read all is well !
 
Old 05-21-2008, 08:04 PM   #11
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,276

Rep: Reputation: 686Reputation: 686Reputation: 686Reputation: 686Reputation: 686Reputation: 686
Quote:
Originally Posted by bgeddy
A lot of postings seem to be asking about compiling custom kernels under Slackware but seriously, given that I run Slackware on many varying machines, I find the generic kernel (OK with the attendant initrd) perfectly adequate.

Given modern hardware and modern kernel advances I feel there is not much to be gained by a custom kernel compilation.

To the uninitiated, the beauty of the generic kernel/initial ram disk boot up is supposedly only the modules required are loaded by the kernel.
I agree with you for the most part (and I have no problems using the generic kernel), but there are instances in which compiling a custom kernel is beneficial. For example, drivers for wireless network cards are constantly being included and upgraded in new kernel versions, so some laptop (or wireless desktop) users may need to compile a new kernel (though some can get away with using ndiswrapper). Similarly, since ALSA support is included directly in the kernel, some people may wish to upgrade the kernel if they can't get their sound card to work (though compiling ALSA manually is also a possibility). Some people also like to take advantage of new features in the kernel.

In general I agree with you, but I don't think it's accurate to say that NO ONE should ever need to compile a kernel, especially since there are fairly long wait periods between Slackware releases and a lot may have changed in the kernel to better support your hardware.

On another note, the OP of this thread did NOT compile a new kernel -- so this discussion is a little off-topic.

Last edited by T3slider; 05-21-2008 at 08:07 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"make oldconfig" doesn't work! pwabrahams Linux - Kernel 5 04-24-2008 09:08 PM
Does "make oldconfig" work when downgrading? kaz2100 Linux - General 3 10-10-2006 07:58 PM
change kernel configurations when use "make oldconfig" Gijet Red Hat 4 10-09-2006 07:23 PM
"make oldconfig" not working r00k2oo4 Linux - Newbie 3 10-26-2004 01:43 PM
Where can I find the "make" & "cc" packages?? sayeed_ather Mandriva 2 04-28-2004 02:02 AM


All times are GMT -5. The time now is 05:38 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration