Solved

Ugrading kernel

Posted on 2004-03-29
20
787 Views
Last Modified: 2013-12-15
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

Thanks




0
Comment
Question by:cjmos
  • 11
  • 9
20 Comments
 
LVL 3

Author Comment

by:cjmos
ID: 10710334
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.
0
 
LVL 9

Expert Comment

by:Alf666
ID: 10712387
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).
0
 
LVL 3

Author Comment

by:cjmos
ID: 10714594
I have put the entire outputs for make dep, make clean and make bzImage up at

http://82.0.153.232/logs.html

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

Cheers.
0
 
LVL 9

Expert Comment

by:Alf666
ID: 10714746
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.
0
 
LVL 3

Author Comment

by:cjmos
ID: 10714937

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?
0
 
LVL 3

Author Comment

by:cjmos
ID: 10715008
there is a linux dir in /usr/include
0
 
LVL 3

Author Comment

by:cjmos
ID: 10715080
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
0
 
LVL 9

Expert Comment

by:Alf666
ID: 10715352
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).

0
 
LVL 9

Expert Comment

by:Alf666
ID: 10715460
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.

0
 
LVL 3

Author Comment

by:cjmos
ID: 10716143
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 :)

0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 9

Accepted Solution

by:
Alf666 earned 500 total points
ID: 10716501
Hem... Just tried and compiling this kernel for you.
I had no problem (grabbed a stock kernel from ftp.kernel.org).

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.
0
 
LVL 3

Author Comment

by:cjmos
ID: 10717679
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.

Cheers
0
 
LVL 9

Expert Comment

by:Alf666
ID: 10717986
Just download a stock 2.4.25 directly. It will work much better.
0
 
LVL 3

Author Comment

by:cjmos
ID: 10719138
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?
0
 
LVL 9

Expert Comment

by:Alf666
ID: 10719184
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 :-)

0
 
LVL 3

Author Comment

by:cjmos
ID: 10719623
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 :-)



 
0
 
LVL 3

Author Comment

by:cjmos
ID: 10719753
Incidentlally,

make modules and make modules_install only take about 6 seconds each... is that normal?
0
 
LVL 9

Expert Comment

by:Alf666
ID: 10722320
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 ?
0
 
LVL 3

Author Comment

by:cjmos
ID: 10723224
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.
0
 
LVL 9

Expert Comment

by:Alf666
ID: 10723966
You's better configure these drivers as modules.

That's what your "old" system's config expects.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now