Ugrading kernel

Hi all.

I'm currently in the process of trying to upgrade my kernel.

I've never done this before so i'm using one of the web's HOWTOs. Everything goes perfectly up until i try this line (when Installing the compiled kernel)

cp arch/i386/boot/bzImage /boot/bzImage-2.4.25

I get:

cp: cannot stat `arch/i386/boot/bzImage': No such file or directory

i did "make bzImage" and that seemed to go ok but this file is not there

I'm very new to Linux so i apologise in advance for asking any stupid questions...

Dist - Debian

Old Kernel  - 2.2.0
Upgrading to - 2.4.25


Who is Participating?
Hem... Just tried and compiling this kernel for you.
I had no problem (grabbed a stock kernel from

The thing is that I'd like to know where you got yours.
My version of process.c does not have the above code which tries to do things on segments.

The error you're seeing is not surprising if the release_segments function is redefined in your process.c.

See the following (from processor.h) :

/* Copy and release all segment info associated with a VM
 * Unusable due to lack of error handling, use {init_new,destroy}_context
 * instead.
static inline void copy_segments(struct task_struct *p, struct mm_struct * mm) {
static inline void release_segments(struct mm_struct * mm) { }

This means that your kernel is either not a stock kernel, or has a weird patch.

Your process.c is not in sync with your processor.h.

Your processor.h should include the proper modifications for this (including the required structures).

I suggest you grab another fresh copy of the kernel, or check patches that you might have applied.
cjmosAuthor Commented:
The last 3 lines of output before 'make bzImage' finishes is

 make[1]: *** [process.o] Error 1
make[1]: Leaving directory `/home/chris/Desktop/src/linux-2.4.25/arch/i386/kernel'
make: *** [_dir_arch/i386/kernel] Error 2

Does anyone know what Error 2 is? Or how i might find out?

I'm getting all frustrated now.. I might cry.
The file is not there because the kernel did not build successfully.

More lines will be needed to understand what goes wrong (like the 20 last lines of your build process).
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

cjmosAuthor Commented:
I have put the entire outputs for make dep, make clean and make bzImage up at

I quite urgently need to get this sorted so i'm upping the points

I think I know what this is about :

cd /usr/src

rm linux
or, if it's not a symbolic link :
mv linux linux.old

ln -s /home/chris/Desktop/src/linux-2.4.25 linux

cd /home/chris/Desktop/src/linux-2.4.25
cp .config /tmp
make mrproper
cp /tmp/.config .
make depend
make bzImage

It should work much better.
cjmosAuthor Commented:

There is no file or directory named Linux in /usr/src so i get:

rm: cannot remove `linux': No such file or directory

There's a directory called rpm that contains directories (BUILD  RPMS  SOURCES  SPECS  SRPMS)

/usr/src/rpm/RPMS contains emtpy dirs (athlon      i386  i486  i586  i686      noarch) and all others are empty.

Shall i try deleting this (rpm) dir?
cjmosAuthor Commented:
there is a linux dir in /usr/include
cjmosAuthor Commented:
i tried make mrproper

but now when i do make depend i get:

make[1]: Entering directory `/home/chris/Desktop/src/linux-2.4.25/arch/i386/boot'
make[1]: Nothing to be done for `dep'.
make[1]: Leaving directory `/home/chris/Desktop/src/linux-2.4.25/arch/i386/boot'
rm -f .depend .hdepend
make _sfdep_kernel _sfdep_drivers _sfdep_mm _sfdep_fs _sfdep_net _sfdep_ipc _sfdep_lib _sfdep_crypto _sfdep_arch/i386/kernel _sfdep_arch/i386/mm _sfdep_arch/i386/lib _FASTDEP_ALL_SUB_DIRS="kernel drivers mm fs net ipc lib crypto arch/i386/kernel arch/i386/mm arch/i386/lib"
make[1]: Entering directory `/home/chris/Desktop/src/linux-2.4.25'
make -C kernel fastdep
make[2]: Entering directory `/home/chris/Desktop/src/linux-2.4.25/kernel'
make[2]: *** No rule to make target `/home/chris/Desktop/src/linux-2.4.25/include/linux/autoconf.h', needed by `/home/chris/Desktop/src/linux-2.4.25/include/linux/modules/signal.ver'.  Stop.
make[2]: Leaving directory `/home/chris/Desktop/src/linux-2.4.25/kernel'
make[1]: *** [_sfdep_kernel] Error 2
make[1]: Leaving directory `/home/chris/Desktop/src/linux-2.4.25'
make: *** [dep-files] Error 2
No. Don't delete anything. Just don't remove what is not there.

But all the other commands need to be done.

Have you done a make mrproper without backup-ing your .config first ?
Or have you not added back your .config to your source dir before make depend ?

Without it, you have to remake your kernel config (make config or make menuconfig or make xconfig).

Argl. Forgot something. If you have not lost your config (that is you followed my comment), you should do a :

make oldconfig

before the make depend.

cjmosAuthor Commented:
thanks for this Alf666.

Iv'e done all of the above but unfortunetly i am still getting the sam error at the end od make bzImage

The last load of lines are now:

make[1]: Entering directory `/home/chris/Desktop/src/linux-2.4.25/crypto'
make all_targets
make[2]: Entering directory `/home/chris/Desktop/src/linux-2.4.25/crypto'
rm -f crypto.o
ar rcs crypto.o
make[2]: Leaving directory `/home/chris/Desktop/src/linux-2.4.25/crypto'
make[1]: Leaving directory `/home/chris/Desktop/src/linux-2.4.25/crypto'
make CFLAGS="-D__KERNEL__ -I/home/chris/Desktop/src/linux-2.4.25/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i686 -malign-functions=4 " -C  arch/i386/kernel
make[1]: Entering directory `/home/chris/Desktop/src/linux-2.4.25/arch/i386/kernel'
gcc -D__KERNEL__ -I/home/chris/Desktop/src/linux-2.4.25/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i686 -malign-functions=4   -nostdinc -iwithprefix include -DKBUILD_BASENAME=process  -c -o process.o process.c
process.c:482: redefinition of `release_segments'
/home/chris/Desktop/src/linux-2.4.25/include/asm/processor.h:434: `release_segments' previously defined here
process.c: In function `release_segments':
process.c:483: structure has no member named `segments'
process.c:489: structure has no member named `segments'
process.c: In function `release_thread':
process.c:548: structure has no member named `segments'
process.c: At top level:
process.c:566: redefinition of `copy_segments'
/home/chris/Desktop/src/linux-2.4.25/include/asm/processor.h:433: `copy_segments' previously defined here
process.c: In function `copy_segments':
process.c:572: structure has no member named `segments'
process.c:582: structure has no member named `segments'
process.c:583: structure has no member named `cpuvalid'
make[1]: *** [process.o] Error 1
make[1]: Leaving directory `/home/chris/Desktop/src/linux-2.4.25/arch/i386/kernel'
make: *** [_dir_arch/i386/kernel] Error 2

I followed all of your instructions word for word, twice just to make sure :)

cjmosAuthor Commented:
i downloaded a stock 2.4.1 kernel and pacthed it with patch-2.4.25 and patch-2.4.25-rc4-final.

I didn't know what the latter "patch-2.4.25-rc4-final" was but patched it anyway. I'm beginning to suspect that this is the source of my problems. I really should do more research on these things.

Anyway, i've just downloaded a stock 2.6.2 kernel so i'll let you know how that goes.

Just download a stock 2.4.25 directly. It will work much better.
cjmosAuthor Commented:
Ok, all done, the kernel is loaded and works. problem now is that my network no longer works (i've had to boot into the old kernel to get here).

if i do lsmod, there are no modules loaded...

Sorry to drag this question out but what have i done wrong?
Did you do :

make modules
make modules_install
depmod -a (after reboot if it's not done automatically)
or depmod -a -b /lib/modules/2.4.25

If you don't "make" them, you can't "insmod" them :-)

cjmosAuthor Commented:
I did make modules and make modules_install

There is a directory /lib/modules/2.4.9 (i ended up installing 2.4.9 rather than 2.4.25). it contains:

build        modules.generic_string  modules.parportmap  modules.usbmap
kernel       modules.ieee1394map     modules.pcimap      pcmcia
modules.dep  modules.isapnpmap       modules.pnpbiosmap

I don't know what to do with any of this.

depmod -a doesn't kick back any erorrs but no modules are loaded either.. and still no network.

I know i should probably give up and boot up windows but the problem is i can't use that either :-)

cjmosAuthor Commented:

make modules and make modules_install only take about 6 seconds each... is that normal?
Yes. If you did not request any module in your make config.

How did you build the kernel config ?

What ethernet card are you using ?

Did you enable drivers for your ethernet card in your config ?
cjmosAuthor Commented:
I made the config with make xconfig.

I'm using a RealTek 100mbit - driver RT-8139

I think I enabled them... best check really hadn't I.
You's better configure these drivers as modules.

That's what your "old" system's config expects.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.