Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

make oldconfig - how does it work?

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
14 posts • Page 1 of 1
Author
Message
piedar
Tux's lil' helper
Tux's lil' helper
Posts: 82
Joined: Mon Aug 09, 2010 3:05 am

make oldconfig - how does it work?

  • Quote

Post by piedar » Wed Aug 25, 2010 8:37 pm

I'm experiencing some confusion as to how to use make oldconfig on new kernel sources. Should I copy my old .config to the current tree first or does oldconfig make a brand new .config by reading kernel information from somewhere else?

Also, I've read that it is not recommended to use the same .config for different kernel versions, but it is OK to use the same .config for different revisions of the same version. Does this apply to make oldconfig as well?
Top
John R. Graham
Administrator
Administrator
User avatar
Posts: 10898
Joined: Tue Mar 08, 2005 3:39 pm
Location: Somewhere over Winder, Georgia, USA

  • Quote

Post by John R. Graham » Wed Aug 25, 2010 8:45 pm

The source of information is an old kernel .config file. What "make oldconfig" does is to make sure that all configurable items in the new kernel source are represented in the new .config file. It also trims out any lines that may no longer be present.

There is usually acceptable luck in running "make oldconfig" if the old and new kernels are not very far apart.

- John
I can confirm that I have received between 0 and 499 National Security Letters.
Top
Jaglover
Watchman
Watchman
User avatar
Posts: 8291
Joined: Sun May 29, 2005 1:57 am
Location: Saint Amant, Acadiana

  • Quote

Post by Jaglover » Wed Aug 25, 2010 8:46 pm

http://www.gentoo.org/doc/en/kernel-upgrade.xml

make oldconfig has caused lots of headaches, but it's an easy lazy way to upgrade your kernel. It's safe to upgrade to next revision with make oldconfig. Not so safe to upgrade to next version.
My Gentoo installation notes.
Please learn how to denote units correctly!
Top
piedar
Tux's lil' helper
Tux's lil' helper
Posts: 82
Joined: Mon Aug 09, 2010 3:05 am

  • Quote

Post by piedar » Wed Aug 25, 2010 8:53 pm

Hmm. I asked because when I did an oldconfig after having copied in my .config, oldconfig didn't ask me any questions, but when I didn't copy it in, oldconfig asked me questions about new options, which I assume it should do.

EDIT: NVM, I guess it was asking me about the default config. Thanks for your help.
Top
Hu
Administrator
Administrator
Posts: 24403
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Wed Aug 25, 2010 10:11 pm

Contrary to the advice in the document Jaglover linked, you can use make oldconfig to jump major revisions. However, if you do so, you should be aware that there is the potential for it to generate a configuration that is not usable without some hand editing. For example, if the configuration option for the driver for your hard disk controller is moved, oldconfig may generate a configuration that omits the driver entirely. I believe this actually happened to people a few kernels back. In my opinion, it is less work to make oldconfig ; make menuconfig and proofread the results than to try to manually recreate the new configuration each time, even if such manual configuration keeps the old version visible as a reference.
Top
cach0rr0
Bodhisattva
Bodhisattva
User avatar
Posts: 4123
Joined: Thu Nov 13, 2008 11:14 pm
Location: Houston, Republic of Texas

  • Quote

Post by cach0rr0 » Wed Aug 25, 2010 10:21 pm

Hu wrote: In my opinion, it is less work to make oldconfig ; make menuconfig and proofread the results than to try to manually recreate the new configuration each time, even if such manual configuration keeps the old version visible as a reference.
this is my usual route. especially if it's a config I've taken considerable time tweaking and fiddling with.

I normally update symlink, zcat /proc/config.gz > .config, make oldconfig and answer any questions, make menuconfig and make sure at the very least my disk drivers are in place

I've gone from .32=>.33=>.34 without any issues doing this. I did not, however, chance it going from .28=>.31
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Top
krinn
Watchman
Watchman
User avatar
Posts: 7476
Joined: Fri May 02, 2003 6:14 am

  • Quote

Post by krinn » Wed Aug 25, 2010 10:29 pm

and there's another option:

copy your old .config in the new kernel as .config and run make, kernel will stops where it cannot decide how to set an option else it will silently remove bad options and re-set valid ones.

This way old options are set when valid, removed when invalid and ask when new.

So if your driver has been moved/renamed kernel will ask for it because
- old driver isn't valid anymore -> removed
- a newer driver is seen -> ask about it

Once done make menuconfig to re-set ones you miss (can be boring to answer all new options and you might just gave up with accepting kernel default choices)

i can say i never used make oldconfig, but i suppose the "make" with an old .config might just trigger a make oldconfig + make session in one shot as the result looks similar ?
Top
Jaglover
Watchman
Watchman
User avatar
Posts: 8291
Joined: Sun May 29, 2005 1:57 am
Location: Saint Amant, Acadiana

  • Quote

Post by Jaglover » Wed Aug 25, 2010 10:42 pm

Hu wrote:Contrary to the advice in the document Jaglover linked, you can use make oldconfig to jump major revisions. However, if you do so, you should be aware that there is the potential for it to generate a configuration that is not usable without some hand editing. For example, if the configuration option for the driver for your hard disk controller is moved, oldconfig may generate a configuration that omits the driver entirely. I believe this actually happened to people a few kernels back. In my opinion, it is less work to make oldconfig ; make menuconfig and proofread the results than to try to manually recreate the new configuration each time, even if such manual configuration keeps the old version visible as a reference.
The trouble here is not missing an important driver, you will notice that for sure. I used to do oldconfig all the time, and finally it borks your kernel config. You will get weird forced [y] options you do not need, for instance. Some options may go missing and not appear any more.
Finally I decided it is not worth it. I just copy over old .config and run make menuconfig as suggested in Gentoo docs.
Top
Jaglover
Watchman
Watchman
User avatar
Posts: 8291
Joined: Sun May 29, 2005 1:57 am
Location: Saint Amant, Acadiana

  • Quote

Post by Jaglover » Wed Aug 25, 2010 10:49 pm

i can say i never used make oldconfig, but i suppose the "make" with an old .config might just trigger a make oldconfig + make session in one shot as the result looks similar ?
Actually, many years ago I read docs in kernel.org and I remember the warning not to use make oldconfig to jump versions. So I doubt make menuconfig will silently run oldconfig.
Top
krinn
Watchman
Watchman
User avatar
Posts: 7476
Joined: Fri May 02, 2003 6:14 am

  • Quote

Post by krinn » Wed Aug 25, 2010 11:00 pm

Jaglover wrote:So I doubt make menuconfig will silently run oldconfig.
never said that ;)
but "make" will do (well, it was last time i check, and it might not really do a make oldconfig but it look like it)
Top
Hu
Administrator
Administrator
Posts: 24403
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Thu Aug 26, 2010 12:21 am

Jaglover wrote:The trouble here is not missing an important driver, you will notice that for sure.
Yes, eventually. It can be aggravating to leave out a driver that is mandatory for a usable system, but not mandatory for starting (e.g. IPsec if you use an IPsec VPN).
Jaglover wrote:I used to do oldconfig all the time, and finally it borks your kernel config. You will get weird forced [y] options you do not need, for instance. Some options may go missing and not appear any more.
Could you elaborate on any of these problems? When did you abandon use of oldconfig?
Jaglover wrote:Actually, many years ago I read docs in kernel.org and I remember the warning not to use make oldconfig to jump versions. So I doubt make menuconfig will silently run oldconfig.
Like the kernel itself, the configuration system is prone to change over time. A quick search of current kernel sources shows no such warning in Documentation/. If you can find it again, I would be interested to see the full warning.
Top
Jaglover
Watchman
Watchman
User avatar
Posts: 8291
Joined: Sun May 29, 2005 1:57 am
Location: Saint Amant, Acadiana

  • Quote

Post by Jaglover » Thu Aug 26, 2010 2:44 am

Hu,

I have no hard evidence to support what I said. I haven't jumped a version with oldconfig for long time. Troubles I remember are from 2.2 and 2.4 era. It is possible with 2.6 problems are less severe. Although I remember a few years ago when SATA stuff was moved make oldconfig totally failed to produce working kernels.
Anyhow, kernel being the most important part of our GNU/Linux I'd say it deserves good handling. I personally do not regret the time spent with menuconfig.
Can't find the full warning, all I remember is it stated oldconfig target was never intended for moving between versions. Perhaps searching kernel mailing lists would give something.
Top
bus_drivr
n00b
n00b
Posts: 48
Joined: Thu Feb 20, 2003 8:46 pm
Location: Florida

  • Quote

Post by bus_drivr » Thu Aug 26, 2010 10:49 am

you can always 'diff' the resulting file to see what changed. make oldconfig does make changes sometimes so saving a backup of it before make oldconfig and diff the two files to see what changed. Not a great reading format though
Top
tabanus
l33t
l33t
User avatar
Posts: 638
Joined: Fri Jun 11, 2004 4:07 pm
Location: UK

  • Quote

Post by tabanus » Sat Aug 28, 2010 10:58 am

I've used "make oldconfig" to upgrade every kernel from about 2.6.20. Only ever had problems skipping a version (e.g. .20 -> .22). This is my kernel upgrade routine (adapted from a post elsewhere in these forums a long time ago)

Code: Select all

eselect kernel list
eselect kernel set [#]
zcat /proc/config.gz > /usr/src/linux/.config
cd /usr/src/linux
make oldconfig
make menuconfig
make -j3 && make modules_install
mount /boot
mv /boot/bzImage.old /boot/bzImage.old.1
mv /boot/bzImage /boot/bzImage.old
cp arch/x86/boot/bzImage /boot
cp .config /boot/config-2.6.xx-gentoo-rx
umount /boot
module-rebuild rebuild
That way if I was to end up with a borked system, I can easily re-boot back into the old kernel (I have grub offer me which of the 3 kernels I keep in /boot) to sort it. When I have had problems, it's been because of a specific kernel bug rather than anything to do with the upgrade technique. If make oldconfig throws up something I'm really not sure about, I just Google it, before answering the question.

In the old days I used to use a fresh menuconfig each time, and be left with an unusable system because I missed some obscure setting or other.
Things you might say if you never took Physics: "I'm overweight even though I don't overeat." - Neil deGrasse Tyson
Top
Post Reply

14 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic