LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (http://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   cannot compile kernel (http://www.linuxquestions.org/questions/linux-kernel-70/cannot-compile-kernel-752732/)

smeezekitty 09-04-2009 03:12 PM

cannot compile kernel
 
when compiling the kernel i hit the problem:
BFD: .tmp_vmlinux1: invalid string offset 14510904 >= 933047
for section '.strtab'
sevrel times in a row
followed by make: *** [.tmp_kallsyms1.S] - Error 139

Drakeo 09-05-2009 11:08 AM

how about letting people know the OS and the kernel. but other wise compiling the kernel is well defined in the read me file of every kernel .

smeezekitty 09-05-2009 01:16 PM

the os is DAMN SMALL LINUX
the gcc version is 3.??? (i dont exactly know)
the kernel version is 2.6
i configed it with the old question system
and typed make
i have 400 mb ram avil

Drakeo 09-06-2009 09:32 AM

open a terminal and type uname - a and post it. then type gcc -v and post it . Then let me know if you did a full install of DSL. if not do not even want to go there. so you did a full install and you want to compile the kernel.
Quote:


- If you install the full sources, put the kernel tarball in a
directory where you have permissions (eg. your home directory) and
unpack it:

gzip -cd linux-2.6.XX.tar.gz | tar xvf -

or
bzip2 -dc linux-2.6.XX.tar.bz2 | tar xvf -


Replace "XX" with the version number of the latest kernel.

Do NOT use the /usr/src/linux area! This area has a (usually
incomplete) set of kernel headers that are used by the library header
files. They should match the library, and not get messed up by
whatever the kernel-du-jour happens to be.

- You can also upgrade between 2.6.xx releases by patching. Patches are
distributed in the traditional gzip and the newer bzip2 format. To
install by patching, get all the newer patch files, enter the
top level directory of the kernel source (linux-2.6.xx) and execute:

gzip -cd ../patch-2.6.xx.gz | patch -p1

or
bzip2 -dc ../patch-2.6.xx.bz2 | patch -p1

(repeat xx for all versions bigger than the version of your current
source tree, _in_order_) and you should be ok. You may want to remove
the backup files (xxx~ or xxx.orig), and make sure that there are no
failed patches (xxx# or xxx.rej). If there are, either you or me has
made a mistake.

Unlike patches for the 2.6.x kernels, patches for the 2.6.x.y kernels
(also known as the -stable kernels) are not incremental but instead apply
directly to the base 2.6.x kernel. Please read
Documentation/applying-patches.txt for more information.

Alternatively, the script patch-kernel can be used to automate this
process. It determines the current kernel version and applies any
patches found.

linux/scripts/patch-kernel linux

The first argument in the command above is the location of the
kernel source. Patches are applied from the current directory, but
an alternative directory can be specified as the second argument.

- If you are upgrading between releases using the stable series patches
(for example, patch-2.6.xx.y), note that these "dot-releases" are
not incremental and must be applied to the 2.6.xx base tree. For
example, if your base kernel is 2.6.12 and you want to apply the
2.6.12.3 patch, you do not and indeed must not first apply the
2.6.12.1 and 2.6.12.2 patches. Similarly, if you are running kernel
version 2.6.12.2 and want to jump to 2.6.12.3, you must first
reverse the 2.6.12.2 patch (that is, patch -R) _before_ applying
the 2.6.12.3 patch.
You can read more on this in Documentation/applying-patches.txt

- Make sure you have no stale .o files and dependencies lying around:

cd linux
make mrproper

You should now have the sources correctly installed.

SOFTWARE REQUIREMENTS

Compiling and running the 2.6.xx kernels requires up-to-date
versions of various software packages. Consult
Documentation/Changes for the minimum version numbers required
and how to get updates for these packages. Beware that using
excessively old versions of these packages can cause indirect
errors that are very difficult to track down, so don't assume that
you can just update packages when obvious problems arise during
build or operation.

BUILD directory for the kernel:

When compiling the kernel all output files will per default be
stored together with the kernel source code.
Using the option "make O=output/dir" allow you to specify an alternate
place for the output files (including .config).
Example:
kernel source code: /usr/src/linux-2.6.N
build directory: /home/name/build/kernel

To configure and build the kernel use:
cd /usr/src/linux-2.6.N
make O=/home/name/build/kernel menuconfig
make O=/home/name/build/kernel
sudo make O=/home/name/build/kernel modules_install install

Please note: If the 'O=output/dir' option is used then it must be
used for all invocations of make.

CONFIGURING the kernel:

Do not skip this step even if you are only upgrading one minor
version. New configuration options are added in each release, and
odd problems will turn up if the configuration files are not set up
as expected. If you want to carry your existing configuration to a
new version with minimal work, use "make oldconfig", which will
only ask you for the answers to new questions.

- Alternate configuration commands are:
"make config" Plain text interface.
"make menuconfig" Text based color menus, radiolists & dialogs.
"make xconfig" X windows (Qt) based configuration tool.
"make gconfig" X windows (Gtk) based configuration tool.
"make oldconfig" Default all questions based on the contents of
your existing ./.config file and asking about
new config symbols.
"make silentoldconfig"
Like above, but avoids cluttering the screen
with questions already answered.
"make defconfig" Create a ./.config file by using the default
symbol values from arch/$ARCH/defconfig.
"make allyesconfig"
Create a ./.config file by setting symbol
values to 'y' as much as possible.
"make allmodconfig"
Create a ./.config file by setting symbol
values to 'm' as much as possible.
"make allnoconfig" Create a ./.config file by setting symbol
values to 'n' as much as possible.
"make randconfig" Create a ./.config file by setting symbol
values to random values.

You can find more information on using the Linux kernel config tools
in Documentation/kbuild/kconfig.txt.

NOTES on "make config":
- having unnecessary drivers will make the kernel bigger, and can
under some circumstances lead to problems: probing for a
nonexistent controller card may confuse your other controllers
- compiling the kernel with "Processor type" set higher than 386
will result in a kernel that does NOT work on a 386. The
kernel will detect this on bootup, and give up.
- A kernel with math-emulation compiled in will still use the
coprocessor if one is present: the math emulation will just
never get used in that case. The kernel will be slightly larger,
but will work on different machines regardless of whether they
have a math coprocessor or not.
- the "kernel hacking" configuration details usually result in a
bigger or slower kernel (or both), and can even make the kernel
less stable by configuring some routines to actively try to
break bad code to find kernel problems (kmalloc()). Thus you
should probably answer 'n' to the questions for
"development", "experimental", or "debugging" features.

COMPILING the kernel:

- Make sure you have at least gcc 3.2 available.
For more information, refer to Documentation/Changes.

Please note that you can still run a.out user programs with this kernel.

- Do a "make" to create a compressed kernel image. It is also
possible to do "make install" if you have lilo installed to suit the
kernel makefiles, but you may want to check your particular lilo setup first.

To do the actual install you have to be root, but none of the normal
build should require that. Don't take the name of root in vain.

- If you configured any of the parts of the kernel as `modules', you
will also have to do "make modules_install".
If using lilo run /sbin/lilo if running grub edit the /boot/grub/menu.1st to point to you knew kernel.

smeezekitty 09-06-2009 03:07 PM

root@box:~# uname -a
Linux box 2.4.26 #1 SMP Sa Apr 17 19:33:42 CEST 2004 i686 GNU/Linux
root@box:~# gcc -v
Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.4/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux
Thread model: posix
gcc version 3.3.4 (Debian 1:3.3.4-7)
yes i am using a full install
Quote:

If using lilo run /sbin/lilo if running grub edit the /boot/grub/menu.1st to point to you knew kernel.
whats the boot loader have anything to do with it

smeezekitty 09-07-2009 01:46 AM

the response time on the kernel section is terriable!

Drakeo 09-08-2009 08:52 AM

using a full install dsl is a debian distro here is the correct way to build a debian kernel.
Quote:

the response time on the kernel section is terriable!
as soon as your free question came in I answered it with a free answer. in my free time We have no room for this type of nonsense in LQ. feel free to go to debian forum if you feel there free service is better.
read this and you will be ahead of the crowd try this
apt-get update

Then we install all needed packages like this:

apt-get install kernel-package libncurses5-dev fakeroot wget bzip2 build-essential udev
now use a fresh kernel from kernel org or debian, now build kernel make mrproper make clean. Make config, make then make modules_install and make install

smeezekitty 09-08-2009 07:47 PM

Quote:

Originally Posted by smeezekitty (Post 3672574)
the response time on the kernel section is terriable!

didnt mean it
i was just frustrated

smeezekitty 09-08-2009 10:50 PM

also
it says something about warning: section mismatch on vmlinuz(x?).o
soon before the erreos

Drakeo 09-09-2009 12:55 AM

Been where you are before. And it took me a week to figure out what header files were.
you need a full kernel source to compile a kernel not some headers symlink to your /lib/moduels/uname -r /kernel/build files. I about went crazy learning how to compile a 2.2.11 kernel a long time ago. if you are using gcc 4.2 there has been some issues this was fixed with 4.3.3
please make sure you install the stuff I said before so you will be able to compile.kernel.

smeezekitty 09-09-2009 02:34 AM

i didnt create any symlink
i just downloaded the source from kernel.org (LOL)
and did a make config
and did a make
sorry i am a linux newbie
and i am typeing this on windows because i have trouble browsing the web with linux (almost got hang of it)

smeezekitty 09-09-2009 02:41 AM

here the exact warning:
WARNING: modpost: Found 1 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y
also i followed your instructions
it said udev package not found
it also said some packages not installed
then i did another make
and the errors are still there

Drakeo 09-11-2009 10:16 PM

please read the kernel source read me file.

extract the source. then make clean then make mrproper
now copy the /boot/config file to
/usr/src/"linux-your version" now rename it .config >>> .<<<<<
see the period before config (.config)


Now open a Console (terminal) and now assume root cd /usr/src/"linux-your version"
now type make oldconfig" Default all questions based on the contents of
your existing ./.config file and asking about
new config symbols.
Quote:

you may be asked to load some newer stuff in the newer kernel version use the default if not sure.
After that type make and sit back awhile on slow machines it may be hours.

Now type make modules_install then type make install.
if using grub update your /boot/grub/menu.1st to load your new kernel. If using lilo you must run /sbin/lilo

smeezekitty 09-12-2009 12:30 AM

never mind i solved it
i built the kernel relocatable
and that caused the errors
now that its built
how can i install a boot loader
on a floppy disk(ette)
to boot the kernel on the hdd
because i dont want to replace the kernel
i just want tot test it

syg00 09-12-2009 12:41 AM

Quote:

Originally Posted by smeezekitty (Post 3672080)
whats the boot loader have anything to do with it

Doesn't pay to be too rash does it ???.
Drakeo has shown commendable patience in helping you so far.
There is no need to replace anything - merely add another stanza to your boot-loader config file, and choose which kernel to boot.


All times are GMT -5. The time now is 03:02 AM.