LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-10-2017, 02:59 AM   #1
Mr486
Member
 
Registered: Nov 2013
Posts: 41

Rep: Reputation: 0
Adventures in old Kernels


I have started this post to describe some of the findings I made while playing around with building old Kernels....i.e. in the range 2.0.20 -> 2.0.40

This is all on the i386 architecture

The general process is....

keep you .config files somewhere safe.

install kernel source to /usr/src/linux
make sym-links from /usr/include/linux and /usr/include/asm

make distclean
[optional]copy in an existing .config file if desired
make menuconfig
make dep ; make clean
make
make zImage

Last edited by Mr486; 03-18-2017 at 07:36 AM. Reason: added distclean step
 
Old 03-10-2017, 08:26 PM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,640

Rep: Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697
Not that long ago (ok, I am OLD, so for you it might seem long ago) I recall compiling my own 2.2 and 2.4 kernels when those were new. I had somewhat unusual hardware, and wanted better performance, and it worked.

I occasionally use DSL, and it uses as older kernel to fit into a smaller space with pretty good performance. I have not had to compile my own kernel in years. As I recall, the kernel source downloads came with documentation on requirements and steps to succeed.
 
Old 03-13-2017, 08:52 AM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,662
Blog Entries: 4

Rep: Reputation: 3942Reputation: 3942Reputation: 3942Reputation: 3942Reputation: 3942Reputation: 3942Reputation: 3942Reputation: 3942Reputation: 3942Reputation: 3942Reputation: 3942
The only thing that I would add to your procedure is:

(1) Make a duplicate, non-hidden copy of the hidden configuration file, and put it in a protected subdirectory of (say ...) /root. Make this file read-only. Pick a file-name that is distinctive, including date, version-number and so on, 'cuz you're gonna keep this file forever.

(2) Rename the hidden file out of the way. Then, run make distclean, which ordinarily would wipe out that file. Then, rename it back. Now, you can be sure that subsequent make steps will, indeed, recompile everything. (It does not take long ...)

If you are very disciplined to keep every config file ... even those that didn't work as you wanted them to(!) ... and if you also maintain a "Captain's Log, Stardate 1234.5" with that same self-discipline, then you can use diff to identify the complete set of changes between any configuration and any other. You can also revert to any previous configuration with absolute accuracy.

(I also know of some folks, with many different systems to maintain, who copy into a single backup-file per system, but they've set up the directory as a git repo, allowing them to do version control on the configurations. Another very good way to do it.)

Last edited by sundialsvcs; 03-13-2017 at 08:54 AM.
 
1 members found this post helpful.
Old 03-18-2017, 07:04 AM   #4
Mr486
Member
 
Registered: Nov 2013
Posts: 41

Original Poster
Rep: Reputation: 0
yes the point about protecting the config and doing a make distclean is an important one.

Quote:
Originally Posted by sundialsvcs View Post
The only thing that I would add to your procedure is:

...

(2) Rename the hidden file out of the way. Then, run make distclean, which ordinarily would wipe out that file. Then, rename it back. Now, you can be sure that subsequent make steps will, indeed, recompile everything. (It does not take long ...)
 
Old 03-18-2017, 07:33 AM   #5
Mr486
Member
 
Registered: Nov 2013
Posts: 41

Original Poster
Rep: Reputation: 0
vmlinux -> zImage

Something I have tried is the following (for i386 architecture).

Create a vmlinux on one machine and create the zImage wrapper around it using another:

Take your copy of vmlinux(created on machine A) and on machine B, place it in /usr/src/linux as vm_other

On machine B do the following:

in /usr/src/linux/arch/i386/boot/Makefile

Change:
compressed/vmlinux: $(TOPDIR)/vmlinux
@$(MAKE) -C compressed vmlinux


To:
compressed/vmlinux: $(TOPDIR)/vm_other
@$(MAKE) -C compressed vm_other



in /usr/src/linux/arch/i386/boot/compressed/Makefile

Change:
SYSTEM = $(TOPDIR)/vmlinux

To:
SYSTEM = $(TOPDIR)/vm_other


Change:
vmlinux: piggy.o $(OBJECTS)
$(LD) $(ZLINKFLAGS) -o vmlinux $(OBJECTS) piggy.o

To:
vm_other: piggy.o $(OBJECTS)
$(LD) $(ZLINKFLAGS) -o vmlinux $(OBJECTS) piggy.o


go into /usr/src/linux and do make zImage, hey presto..... the zImage will get built using the vm_other

Last edited by Mr486; 03-18-2017 at 07:39 AM. Reason: typo
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adventures in Slackware mlangdn Slackware 3 06-03-2015 07:22 PM
Getting Assertion `kernels [x] == kernels [x]' failed with emulator in Slackware 14 Holering Slackware 1 05-10-2013 03:43 PM
backward compatibility in kernels + custom kernels + more queries mmp_3341 Linux - Kernel 1 04-12-2007 07:28 AM
RH 8 kernels and their relation to 'stock' kernels psweetma Linux - Distributions 1 03-29-2003 10:46 PM
My Linux adventures so far... RedHat123 General 5 07-17-2002 04:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:59 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration