Main Page | Report this Page
Linux Forum Index  »  Linux Setup  »  difficulty recompiling RHEL 4.2 kernel
Page 1 of 2    Goto page 1, 2  Next

difficulty recompiling RHEL 4.2 kernel

Author Message
Dushan Mitrovich
Posted: Thu Jun 01, 2006 10:09 am
Guest
I've installed a version of Red Hat Enterprise Linux 4.2 and now am try-
ing to add filesystem module support for HPFS, so it could read/write
to my OS/2 files. After making the appropriate modyfication to .CONFIG
using MAKE XCONFIG, I issued the commands (using upper case here only
for clarity)

MAKE MRPROPER
MAKE CLEAN
MAKE BZIMAGE

This is where the problem appears, as the last command produces the
message

[/usr/src/kernels/2.6.9-22.0.1.EL-i686]# make bzImage
CHK include/linux/version.h
CHK include/asm-i386/asm_offsets.h
UPD include/asm-i386/asm_offsets.h
/bin/sh: arch/i386/kernel/asm-offsets.s: No such file or directory
mv: cannot stat `include/asm-i386/asm_offsets.h.tmp': No such file or directory
make: *** [include/asm-i386/asm_offsets.h] Error 1

and indeed I can't find a file containing 'offsets' anywhere. I'd ap-
preciate suggestions for what my next steps should be.

Also, I've found on the Internet over half a dozen sets of directions
and HOWTOs on recompiling the kernel, and they all have somewhat diffe-
rent instructions. Maybe some are outdated. What would you recommend
as a good, up-to-date, reliable reference book accessible by a lay user?

Thanks for the help.

- Dushan Mitrovich
 
Nico Kadel-Garcia
Posted: Thu Jun 01, 2006 10:09 am
Guest
Dushan Mitrovich wrote:
Quote:
I've installed a version of Red Hat Enterprise Linux 4.2 and now am
try-
ing to add filesystem module support for HPFS, so it could read/write
to my OS/2 files. After making the appropriate modyfication to
.CONFIG
using MAKE XCONFIG, I issued the commands (using upper case here only
for clarity)

MAKE MRPROPER
MAKE CLEAN
MAKE BZIMAGE

Which kernel, *exactly*? Are you using the latest update, or the release
kernel? And did you edit the Makefile or .config appropriately to give your
kernel its own name?

But "make mrproper" blew away your .config file: it really srubs out
everything. The order should be

make mrproper
cp [oldconfigfile that basically works] .config
# Make sure that Makefile or the .config settings give you a unique
kernel name
make # check for errors
make rpm # build niice RPM to use for kernel management

Quote:
Also, I've found on the Internet over half a dozen sets of directions
and HOWTOs on recompiling the kernel, and they all have somewhat
diffe-
rent instructions. Maybe some are outdated. What would you recommend
as a good, up-to-date, reliable reference book accessible by a lay
user?

Take a very careful look at the kernel SRPM, to see what RedHat has dumped
on top of the kernel installation procedure and notes about special setups
they support.
 
Tauno Voipio
Posted: Thu Jun 01, 2006 10:09 am
Guest
Dushan Mitrovich wrote:
Quote:
I've installed a version of Red Hat Enterprise Linux 4.2 and now am try-
ing to add filesystem module support for HPFS, so it could read/write
to my OS/2 files. After making the appropriate modyfication to .CONFIG
using MAKE XCONFIG, I issued the commands (using upper case here only
for clarity)

MAKE MRPROPER
MAKE CLEAN
MAKE BZIMAGE

Please DO NOT change the case of Linux commands and/or responses!
You may mask the problem you have. Remember that in Unix-like
systems the case of the letters does matter.

make mrproper cleans *everything*, including your configuration.
Run your configuration and compile (without mrproper).

Depending on the kernel version, you may need also

make dep

before making bzImage.

--

Tauno Voipio
tauno voipio (at) iki fi
 
Lenard
Posted: Thu Jun 01, 2006 12:24 pm
Guest
Dushan Mitrovich wrote:

Quote:
I've installed a version of Red Hat Enterprise Linux 4.2 and now am try-
ing to add filesystem module support for HPFS, so it could read/write
to my OS/2 files. After making the appropriate modyfication to .CONFIG
using MAKE XCONFIG, I issued the commands (using upper case here only
for clarity)

MAKE MRPROPER
MAKE CLEAN
MAKE BZIMAGE

This is where the problem appears, as the last command produces the
message

[/usr/src/kernels/2.6.9-22.0.1.EL-i686]# make bzImage
CHK include/linux/version.h
CHK include/asm-i386/asm_offsets.h
UPD include/asm-i386/asm_offsets.h
/bin/sh: arch/i386/kernel/asm-offsets.s: No such file or directory
mv: cannot stat `include/asm-i386/asm_offsets.h.tmp': No such file or
directory make: *** [include/asm-i386/asm_offsets.h] Error 1

and indeed I can't find a file containing 'offsets' anywhere. I'd ap-
preciate suggestions for what my next steps should be.

Also, I've found on the Internet over half a dozen sets of directions
and HOWTOs on recompiling the kernel, and they all have somewhat diffe-
rent instructions. Maybe some are outdated. What would you recommend
as a good, up-to-date, reliable reference book accessible by a lay user?

Thanks for the help.

It sounds like you maybe forgot to "prep" the source before;

After installing the kernel source you need to do;

rpmbuild -bp --target $(uname -m) kernel-2.6.spec

See the "kernel" section in the release-notes;
http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/release-notes/es-x86/



This is a bit different then what you might be used to or have read, please
get used to it;

<apply patches here> ;this is beyond those from "prepping" the kernel source

make mrproper

cp /boot/config-<version#> .config ; a starting point to build your kernel

make menuconfig ; this is where you tweak the kernel for your hardware

make ; takes the place of make bzImage and make modules

make modules_install

make install

Yes, as you already know, you can use 'make xconfig' or 'make gconfig'
in-place of the 'make menuconfig' command.

As Tauno Voipio stated, do not change the case of the linux commands as
Linux is case sensitive.

As Nico Kedel-Garcia suggested instead of the 'make modules_install' and
'make install' commands you can use the 'make rpm' command.


--
"A personal computer is called a personal computer because it's yours,
Anything that runs on that computer, you should have control over."
Andrew Moss, Microsoft's senior director of technical policy, 2005
 
Nico Kadel-Garcia
Posted: Thu Jun 01, 2006 3:01 pm
Guest
Lenard wrote:
Quote:
Dushan Mitrovich wrote:

I've installed a version of Red Hat Enterprise Linux 4.2 and now am
try- ing to add filesystem module support for HPFS, so it could
read/write to my OS/2 files. After making the appropriate
modyfication to .CONFIG using MAKE XCONFIG, I issued the commands
(using upper case here only for clarity)

MAKE MRPROPER
MAKE CLEAN
MAKE BZIMAGE

This is where the problem appears, as the last command produces the
message

[/usr/src/kernels/2.6.9-22.0.1.EL-i686]# make bzImage
CHK include/linux/version.h
CHK include/asm-i386/asm_offsets.h
UPD include/asm-i386/asm_offsets.h
/bin/sh: arch/i386/kernel/asm-offsets.s: No such file or directory
mv: cannot stat `include/asm-i386/asm_offsets.h.tmp': No such file
or directory make: *** [include/asm-i386/asm_offsets.h] Error 1

and indeed I can't find a file containing 'offsets' anywhere. I'd
ap- preciate suggestions for what my next steps should be.

Also, I've found on the Internet over half a dozen sets of directions
and HOWTOs on recompiling the kernel, and they all have somewhat
diffe- rent instructions. Maybe some are outdated. What would you
recommend as a good, up-to-date, reliable reference book accessible
by a lay user?

Thanks for the help.

It sounds like you maybe forgot to "prep" the source before;

After installing the kernel source you need to do;

Hold: what is in /usr/src/kernels is precisely that "prepped" directory,
with the default config files in an appropriate subdirectory.

Quote:
As Nico Kedel-Garcia suggested instead of the 'make modules_install'
and 'make install' commands you can use the 'make rpm' command.

Then use "rpm -i" on the resulting kernel RPM to install it *as well as*
your existing kernel, instead of to replace it. Trust me on this part, you
don't want to do an "rpm -U" or "rpm -F" and replace the existing kernel
until you've had a chance to test it.
 
Dushan Mitrovich
Posted: Fri Jun 02, 2006 12:17 pm
Guest
Tauno Voipio <tauno.voipio@INVALIDiki.fi> wrote:
Quote:
Dushan Mitrovich wrote:
I've installed a version of Red Hat Enterprise Linux 4.2 and now am try-
ing to add filesystem module support for HPFS, so it could read/write
to my OS/2 files. After making the appropriate modyfication to .CONFIG
using MAKE XCONFIG, I issued the commands (using upper case here only
for clarity)

MAKE MRPROPER
MAKE CLEAN
MAKE BZIMAGE

Please DO NOT change the case of Linux commands and/or responses!
You may mask the problem you have. Remember that in Unix-like
systems the case of the letters does matter.

Okay, this makes sense, tho I was just emulating something I found on the
I'net.

Quote:
make mrproper cleans *everything*, including your configuration.
Run your configuration and compile (without mrproper).

Please see my response to Nico Kadel-Garcia in this thread.

Quote:
Depending on the kernel version, you may need also

make dep

before making bzImage.

I did this originally but got a message that this was no longer needed.

- Dushan
 
Dushan Mitrovich
Posted: Fri Jun 02, 2006 1:35 pm
Guest
Lenard <lenard@127.0.0.1> wrote:
Quote:
Dushan Mitrovich wrote:

I've installed a version of Red Hat Enterprise Linux 4.2 and now am try-
ing to add filesystem module support for HPFS, so it could read/write
to my OS/2 files. After making the appropriate modyfication to .CONFIG
using MAKE XCONFIG, I issued the commands (using upper case here only
for clarity)

MAKE MRPROPER
MAKE CLEAN
MAKE BZIMAGE

This is where the problem appears, as the last command produces the
message

[/usr/src/kernels/2.6.9-22.0.1.EL-i686]# make bzImage
CHK include/linux/version.h
CHK include/asm-i386/asm_offsets.h
UPD include/asm-i386/asm_offsets.h
/bin/sh: arch/i386/kernel/asm-offsets.s: No such file or directory
mv: cannot stat `include/asm-i386/asm_offsets.h.tmp': No such file or
directory make: *** [include/asm-i386/asm_offsets.h] Error 1

and indeed I can't find a file containing 'offsets' anywhere. I'd ap-
preciate suggestions for what my next steps should be.

Also, I've found on the Internet over half a dozen sets of directions
and HOWTOs on recompiling the kernel, and they all have somewhat diffe-
rent instructions. Maybe some are outdated. What would you recommend
as a good, up-to-date, reliable reference book accessible by a lay user?

Thanks for the help.

It sounds like you maybe forgot to "prep" the source before;

After installing the kernel source you need to do;

rpmbuild -bp --target $(uname -m) kernel-2.6.spec

See the "kernel" section in the release-notes;
http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/release-notes/es-x86/


This is a bit different then what you might be used to or have read,
please get used to it;

apply patches here> ; this is beyond those from "prepping" the kernel
source

make mrproper

cp /boot/config-<version#> .config ; a starting point to build your kernel

make menuconfig ; this is where you tweak the kernel for your hardware

make ; takes the place of make bzImage and make modules

make modules_install

make install

Yes, as you already know, you can use 'make xconfig' or 'make gconfig'
in-place of the 'make menuconfig' command.

As Tauno Voipio stated, do not change the case of the linux commands as
Linux is case sensitive.

As Nico Kedel-Garcia suggested instead of the 'make modules_install' and
'make install' commands you can use the 'make rpm' command.

Lenard, thanks much for this detailed set of instructions - it's just what
I need. The lack of "prepping" probably explains why even 'make mrproper'
didn't work (see my earlier response to Nico Kadel-Garcia).

Clearly my ignorance is the source of my problems and frustrations. So a
good, up-to-date reference would be invaluable. Right now I've got Bill
McCarty's 'Learning Red Hat Linux', which is quite good tho dated and not
all-inclusive, and Chistopher Negus' 'Red Hat Linux 7.2 Bible', which is
comprehensive, but not to my liking, and dated as well.

- Dushan
 
Dushan Mitrovich
Posted: Fri Jun 02, 2006 1:49 pm
Guest
"Nico Kadel-Garcia" <nkadel@comcast.net> wrote:
Quote:
Lenard wrote:
It sounds like you maybe forgot to "prep" the source before;

After installing the kernel source you need to do;

Hold: what is in /usr/src/kernels is precisely that "prepped" directory,
with the default config files in an appropriate subdirectory.

As Nico Kedel-Garcia suggested instead of the 'make modules_install'
and 'make install' commands you can use the 'make rpm' command.

Then use "rpm -i" on the resulting kernel RPM to install it *as well as*
your existing kernel, instead of to replace it. Trust me on this part,
you don't want to do an "rpm -U" or "rpm -F" and replace the existing
kernel until you've had a chance to test it.

Okay, thanks Nico, I'll make sure I don't replace the working kernel until
after testing the new one. But I wonder whether the new info in my earlier
response to you alters any procedires.

- Dushan
 
Nico Kadel-Garcia
Posted: Fri Jun 02, 2006 5:03 pm
Guest
"Dushan Mitrovich" <anti@spamming.org> wrote in message
news:oCIgE5aAHo9S092yn@spinn.net...
Quote:
Tauno Voipio <tauno.voipio@INVALIDiki.fi> wrote:
Dushan Mitrovich wrote:
I've installed a version of Red Hat Enterprise Linux 4.2 and now am try-
ing to add filesystem module support for HPFS, so it could read/write
to my OS/2 files. After making the appropriate modyfication to .CONFIG
using MAKE XCONFIG, I issued the commands (using upper case here only
for clarity)

MAKE MRPROPER
MAKE CLEAN
MAKE BZIMAGE

Please DO NOT change the case of Linux commands and/or responses!
You may mask the problem you have. Remember that in Unix-like
systems the case of the letters does matter.

Okay, this makes sense, tho I was just emulating something I found on the
I'net.

make mrproper cleans *everything*, including your configuration.
Run your configuration and compile (without mrproper).

Please see my response to Nico Kadel-Garcia in this thread.

OK, so right now you have a mess: let's keep it simple for recovery.

cd [ kernel source tree ]
/bin/rm .config
make oldconfig
make mrproper

Should scrub the local source tree pretty thoroughly.

Quote:
Depending on the kernel version, you may need also

make dep

before making bzImage.

I did this originally but got a message that this was no longer needed.

That's old advice: The Linux kernel build structure has been slowly
evolving, to match that of more sanely configured tools, so that "make" does
what you think it would and "make install" does too. And RedHat has also
patched the source trees a bit to do kernel installation more in keeping
with their tools, to automate the editing of lilo.conf and grub.conf to
include any new kernels installed. It's useful to do.

What I referred to with the "look at the kernel SRPM" was precisely what I
said, such as this one:

http://mirrors.kernel.org/fedora/core/4/SRPMS/kernel-2.6.11-1.1369_FC4.src.rpm

That's what RedHat uses to build their kernel RPM's from: reading the
"kernel.spec" file in it should walk you through some automated kernel
building processes, and how RedHat thinks it should be done.

The bit about using alternative names in .config or in the Makefile is
because it can be set in either place to give your new kernel a unique and
descriptive name, the way RedHat does things. In some other kernel bundles,
you need to (or used to need to) edit it directly in the Makefile or
Makefile.in to get a unique kernel name and avoid a newly configured kernel
having the same name and overwriting your previously built kernel.
 
Nico Kadel-Garcia
Posted: Sat Jun 03, 2006 7:09 am
Guest
Dushan Mitrovich wrote:
Quote:
"Nico Kadel-Garcia" <nkadel@comcast.net> wrote:
Lenard wrote:
It sounds like you maybe forgot to "prep" the source before;

After installing the kernel source you need to do;

Hold: what is in /usr/src/kernels is precisely that "prepped"
directory, with the default config files in an appropriate
subdirectory.

As Nico Kedel-Garcia suggested instead of the 'make modules_install'
and 'make install' commands you can use the 'make rpm' command.

Then use "rpm -i" on the resulting kernel RPM to install it *as well
as* your existing kernel, instead of to replace it. Trust me on
this part, you don't want to do an "rpm -U" or "rpm -F" and replace
the existing kernel until you've had a chance to test it.

Okay, thanks Nico, I'll make sure I don't replace the working kernel
until after testing the new one. But I wonder whether the new info
in my earlier response to you alters any procedires.

- Dushan

Right now, can you use the "make oldconfig" commands, or "cp
/boot/config-[yourkernel] .config; make oldconfig" to get the kernel source
tree straightened out?
 
Nico Kadel-Garcia
Posted: Sat Jun 03, 2006 7:39 am
Guest
Nico Kadel-Garcia wrote:
Quote:
Dushan Mitrovich wrote:
"Nico Kadel-Garcia" <nkadel@comcast.net> wrote:
Lenard wrote:
It sounds like you maybe forgot to "prep" the source before;

After installing the kernel source you need to do;

Hold: what is in /usr/src/kernels is precisely that "prepped"
directory, with the default config files in an appropriate
subdirectory.

As Nico Kedel-Garcia suggested instead of the 'make
modules_install' and 'make install' commands you can use the 'make
rpm' command.

Then use "rpm -i" on the resulting kernel RPM to install it *as well
as* your existing kernel, instead of to replace it. Trust me on
this part, you don't want to do an "rpm -U" or "rpm -F" and replace
the existing kernel until you've had a chance to test it.

Okay, thanks Nico, I'll make sure I don't replace the working kernel
until after testing the new one. But I wonder whether the new info
in my earlier response to you alters any procedires.

- Dushan

Right now, can you use the "make oldconfig" commands, or "cp
/boot/config-[yourkernel] .config; make oldconfig" to get the kernel
source tree straightened out?

Thinking on it, try this;

make oldconfig
make oldproper
cp /boot/config-[whatever] .config # OR cp configs/config-[whatever]
..config
make menuconfig # or make xconfig
make rpm
 
Dushan Mitrovich
Posted: Mon Jun 05, 2006 4:34 pm
Guest
"Nico Kadel-Garcia" <nkadel@comcast.net> wrote:
Quote:
Right now, can you use the "make oldconfig" commands, or "cp
/boot/config-[yourkernel] .config; make oldconfig" to get the kernel
source tree straightened out?

Thinking on it, try this;

make oldconfig
make oldproper
cp /boot/config-[whatever] .config # OR cp configs/config-[whatever]
.config
make menuconfig # or make xconfig
make rpm

Sorry for the delay, I was away for a couple of days.

Nico, I did try this, and had no problem with 'make oldconfig', but 'make
oldproper' gave me:

No rule to make target 'oldproper'. Stop.

From your earlier comments I decided I probably needed to get the 'src'
files, but found on the RedHat site they're about 40 MB in size. With my
slow modem connection I don't undertake such downloads lightly, so I asked
the folks who distribute this os (Scientific Linux) what specific info is
available more readily. They pointed me to an ftp url that I'll go check
out, but haven't yet.

I did look on the Linux hard drive for relevant files, and found something
that at first looked promising: /usr/src/redhat, which had subdirectories
for source, specs, and several others. Unfortunately, they were all left
empty by the install procedure. Strikes me as bizarre.

More after I check out the refs I was given.

- Dushan
 
Nico Kadel-Garcia
Posted: Mon Jun 05, 2006 6:22 pm
Guest
"Dushan Mitrovich" <anti@spamming.org> wrote in message
news:QGLhE5aAHUcV092yn@spinn.net...
Quote:
"Nico Kadel-Garcia" <nkadel@comcast.net> wrote:
Right now, can you use the "make oldconfig" commands, or "cp
/boot/config-[yourkernel] .config; make oldconfig" to get the kernel
source tree straightened out?

Thinking on it, try this;

make oldconfig
make oldproper
cp /boot/config-[whatever] .config # OR cp configs/config-[whatever]
.config
make menuconfig # or make xconfig
make rpm

Sorry for the delay, I was away for a couple of days.

Nico, I did try this, and had no problem with 'make oldconfig', but 'make
oldproper' gave me:

No rule to make target 'oldproper'. Stop.

Gahh. typo on my part, I meant "make mrproper". Try this:

make oldconfig
make mrproper # To clear old cruft
cp /boot/config-[whatever] .config
# OR cp configs/config-[whatever] .config
make menuconfig # or make xconfig
make rpm

Quote:
From your earlier comments I decided I probably needed to get the 'src'
files, but found on the RedHat site they're about 40 MB in size. With my
slow modem connection I don't undertake such downloads lightly, so I asked
the folks who distribute this os (Scientific Linux) what specific info is
available more readily. They pointed me to an ftp url that I'll go check
out, but haven't yet.

The SRPM is very useful to understand how RedHat compiles them. I think it's
handy. Can you walk in with a USB memory stick or a CD and burn it and get
it someplace else? The SRPM's are certainly available at plenty of RedHat
mirror sites.

Quote:
I did look on the Linux hard drive for relevant files, and found something
that at first looked promising: /usr/src/redhat, which had subdirectories
for source, specs, and several others. Unfortunately, they were all left
empty by the install procedure. Strikes me as bizarre.

That's where builds from SRPM's happen by default. If you were building
SRPM's or from SRPM's, those would be handy. But I think the "make rpm"
command will suffice for you.

If you really want to learn about RPM building and management, "Maximum RPM"
is really quite good.
 
ne...
Posted: Tue Jun 06, 2006 6:16 am
Guest
On Tue, 06 Jun 2006 at 00:22 GMT, Nico Kadel-Garcia eloquently wrote:
[...]
Quote:
Gahh. typo on my part, I meant "make mrproper". Try this:

make oldconfig
make mrproper # To clear old cruft
cp /boot/config-[whatever] .config
# OR cp configs/config-[whatever] .config
make menuconfig # or make xconfig
make rpm
Try this instead;


1) cp /boot/config-[whatever] .config
# OR cp configs/config-[whatever] .config

2) make oldconfig
3) make menuconfig
4) make rpm

You need to copy the /boot/config-[whatever] so that you start of with
a working configuration. This assumes that /boot/config-[whatever] is
the configuration of an aktual working kernel. make oldconfig then configures
your to be compiled kernel using the old configuration. This drops all the
options that were in the olde kernel but not in the new kernel. It also
gives the ability to configure new options. make menuconfig gives you
ability to further configure your kernel with a nicer looking interface.

HTH
N.Emile...
--
Registered Linux User # 125653 (http://counter.li.org) | Please remove
Certified: 75% bastard, 42% of which is tard. | '.invalid'
http://www.thespark.com/bastardtest | to reply.
Switch to: http://www.speakeasy.net/refer/190653
 
Dushan Mitrovich
Posted: Tue Jun 06, 2006 11:04 am
Guest
"Nico Kadel-Garcia" <nkadel@comcast.net> wrote:
Quote:
Gahh. typo on my part, I meant "make mrproper". Try this:

make oldconfig
make mrproper # To clear old cruft
cp /boot/config-[whatever] .config
# OR cp configs/config-[whatever] .config
make menuconfig # or make xconfig
make rpm

From your earlier comments I decided I probably needed to get the 'src'
files, but found on the RedHat site they're about 40 MB in size. With my
slow modem connection I don't undertake such downloads lightly, so I asked
the folks who distribute this os (Scientific Linux) what specific info is
available more readily. They pointed me to an ftp url that I'll go check
out, but haven't yet.

The SRPM is very useful to understand how RedHat compiles them. I think
it's handy. Can you walk in with a USB memory stick or a CD and burn it
and get it someplace else? The SRPM's are certainly available at plenty
of RedHat mirror sites.

Okay, I bit the bullet and last night downloaded the whole 44+ MB of the
*.src.rpm file, and now I'm going to dive into it.

Quote:
I did look on the Linux hard drive for relevant files, and found something
that at first looked promising: /usr/src/redhat, which had subdirectories
for source, specs, and several others. Unfortunately, they were all left
empty by the install procedure. Strikes me as bizarre.

That's where builds from SRPM's happen by default. If you were building
SRPM's or from SRPM's, those would be handy. But I think the "make rpm"
command will suffice for you.

If you really want to learn about RPM building and management, "Maximum RPM"
is really quite good.

Nico, thanks for your generous continuing help with this. I hope soon to
have it resolved.

- Dushan
 
 
Page 1 of 2    Goto page 1, 2  Next
All times are GMT - 5 Hours
The time now is Tue Dec 01, 2009 9:59 pm