[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 317
  • Last Modified:

Compile a new kernel

I tried to compile a new kernel. (2.1.96)
First I unpacked the file so I got a directory /usr/src/linux
Then
1.cd /usr/src/linux
2 make mrproper
3. make dep
4. Make clean
5. make zImage

When It compiels I get this:

make[2]: Entering directory `/usr/src/linux/kernel'
gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -D__SMP__ -pipe -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=586 -D__SMP__   -c -o kmod.o kmod.c
kmod.c: In function `kmod_init':
kmod.c:116: parse error before character 0240
make[2]: *** [kmod.o] Error 1
make[2]: Leaving directory `/usr/src/linux/kernel'
make[1]: *** [first_rule] Error 2
make[1]: Leaving directory `/usr/src/linux/kernel'
make: *** [linuxsubdirs] Error 2    

What shall I do???

(I won't accept a ansver like use the latest stable kernel 2.0.33. I like to try this one.
0
hulken
Asked:
hulken
  • 16
  • 13
1 Solution
 
ahoffmannCommented:
you have a invalid character (octal 240) in the file, check if you can remove it.
I don't know how to make it visible in vi, but try od -c to find
the position in the line.
0
 
hulkenAuthor Commented:
Hmmm.. how can it be so??? Al I've done is to download the source.
0
 
ahoffmannCommented:
dozent of reasons (corrupted file, corrupted gzip or tar, bad disk, etc. etc.)
extract just this file again from the sources to see if its in the source distribution.
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
hulkenAuthor Commented:
Thanks but I still can't compile the kernel. It works fine when I don't enable soundsuport.

But if I try to compile sound I get:

t/net.a drivers/cdrom/cdrom.a drivers/sound/sound.a drivers/pci/pci.a drivers/pnp/pnp.a \
        /usr/src/linux/arch/i386/lib/lib.a /usr/src/linux/lib/lib.a /usr/src/linux/arch/i386/lib/lib.a \
        -o vmlinux
drivers/sound/sound.a(cs4232.o): In function `probe_cs4232':
cs4232.o(.text+0xb2): undefined reference to `ad1848_detect'
cs4232.o(.text+0x20a): undefined reference to `ad1848_detect'
drivers/sound/sound.a(cs4232.o): In function `attach_cs4232':
cs4232.o(.text+0x268): undefined reference to `ad1848_init'
cs4232.o(.text+0x282): undefined reference to `ad1848_control'
cs4232.o(.text+0x28e): undefined reference to `ad1848_control'
cs4232.o(.text+0x29a): undefined reference to `ad1848_control'
drivers/sound/sound.a(cs4232.o): In function `unload_cs4232':
cs4232.o(.text+0x2c7): undefined reference to `ad1848_unload'
make: *** [vmlinux] Error 1  

I followed the same procedure as before. make menuconfig; make ep; make clean; make zImage
0
 
hulkenAuthor Commented:
This is weard. Now I cant read youre answere here...
It says:
Error - cannot open answer 10047952-5
Error - cannot open answer 10047952-6

BTW:
I tried with the kernel 2.1.97 and have the same problem.
If someone eles like to try I can send my .config...
0
 
ahoffmannCommented:
you need in /usr/src/linux/.config

CONFIG_AD1848=y

Add it manually if make menuconfig did not provide it, then
use make config  to update generated header files.
0
 
hulkenAuthor Commented:
Where in .config do I add this??
0
 
hulkenAuthor Commented:
I tried to add this row in .config. And made a make config.
I still get:
        /usr/src/linux-2.1.97/arch/i386/lib/lib.a /usr/src/linux-2.1.97/lib/lib.a /usr/src/linux-2.1.97/arch/i386/lib/lib.a \
        -o vmlinux
drivers/sound/sound.a(cs4232.o): In function `probe_cs4232':
cs4232.o(.text+0xb2): undefined reference to `ad1848_detect'
cs4232.o(.text+0x20a): undefined reference to `ad1848_detect'
drivers/sound/sound.a(cs4232.o): In function `attach_cs4232':
cs4232.o(.text+0x268): undefined reference to `ad1848_init'
cs4232.o(.text+0x282): undefined reference to `ad1848_control'
cs4232.o(.text+0x28e): undefined reference to `ad1848_control'
cs4232.o(.text+0x29a): undefined reference to `ad1848_control'
drivers/sound/sound.a(cs4232.o): In function `unload_cs4232':
cs4232.o(.text+0x2c7): undefined reference to `ad1848_unload'
make: *** [vmlinux] Error 1  
0
 
ahoffmannCommented:
did you make a  make clean  after  make config?

If so, you have to look into the sources what's going wrong.
You know you have beta sources, so they may have some bugs.
Check in cs4232.c how and when ad1848_* will be called, probably
you need more defines in .config.
0
 
hulkenAuthor Commented:
Yes I did a make clean
 (Se the top of this page)
But I'm not a programmer som hod do I know what to change?
0
 
ahoffmannCommented:
do you realy want to use a soundcard with CS4232 chip?

Please first change
      CONFIG_CS4232=y
to
      # CONFIG_CS4232=y

and recompile (make config; make dep; make clean; make zImage)

Check if this compiles, then we'll look deeper into this one.
0
 
hulkenAuthor Commented:
There is a cs4232 chip on my card and it works fine with 2.0.X kernels.
(The only choise that works for me.
0
 
hulkenAuthor Commented:
One more comment.
If I compile the sond as module the compiling proces doesn't give any errors. But after doing a rm -rf /lib/modules/2.1.97
make modules; make modules_install, depmod -a; reboot.
I get unresolved symboles in sound.0 and cs4232.o.
0
 
ahoffmannCommented:
did you run   make mkscript  in  src/linux/drivers/sound  before
calling  make config?

If so, please send
      src/include/linux/autoconf.h
      src/driver/sound/Config.in
to  hoagascht@gmx.net
0
 
ahoffmannCommented:
Compiling as module is nearly the same as compiling as library.
It won't help either. You first must fix the missing #defines
(see last comment)
0
 
hulkenAuthor Commented:
I get this:


[hulken@svullo sound]# pwd
/usr/src/linux/drivers/sound
[hulken@svullo sound]# make mkscript
make: *** No rule to make target `mkscript'.  Stop.
[hulken@svullo sound]#      

So you mean that I shall do:

1. make mrproper

2. cd /usr/src/linux/sound

3. make mkscript

4. make config

5. make dep
6 ......
0
 
ahoffmannCommented:
> make: *** No rule to make target `mkscript'.  Stop.

Ups, something changed from 2.0.x to 2.1.x :-|

Please look at /usr/src/linux/drivers/sound/Config.in
if there are some advices (my one told me to call  make mkscript)
You should find something about  CONFIG_CS4232

1. .. 6.  is ok.
0
 
hulkenAuthor Commented:
Is this something about the make mkscript ??


SURPRISE SURPRISE!!!

The device file creation script that used to be here earlier is
obviously not here any more.

Why?

Because you do not need it. All Linux distributions have the
device files properly created (yes they are) so you should not
try to run any scripts which create them.  
0
 
hulkenAuthor Commented:
This is the pat about CS4232 in Config.in ..

dep_tristate 'Support for Crystal CS4232 based (PnP) cards' CONFIG_CS4232 $CONFIG_SOUND
if [ "$CONFIG_CS4232" = "y" ]; then
    hex 'CS4232 audio I/O base 530, 604, E80 or F40' CONFIG_CS4232_BASE 530
    int 'CS4232 audio IRQ 5, 7, 9, 11, 12 or 15' CONFIG_CS4232_IRQ 11
    int 'CS4232 audio DMA 0, 1 or 3' CONFIG_CS4232_DMA 0
    int 'CS4232 second (duplex) DMA 0, 1 or 3' CONFIG_CS4232_DMA2 3
    hex 'CS4232 MIDI I/O base 330, 370, 3B0 or 3F0' CONFIG_CS4232_MPU_BASE 330
    int 'CS4232 MIDI IRQ 5, 7, 9, 11, 12 or 15' CONFIG_CS4232_MPU_IRQ 9
fi

0
 
ahoffmannCommented:
What do you mean at your last comment
?-)

mkscript is a target in the Makefile, it has nothing to do with
devices (/dev, mkdev, mknod).
Your compiling problems also have nothing to do with devices.
0
 
hulkenAuthor Commented:
Forget this comment....
0
 
hulkenAuthor Commented:
Adjusted points to 250
0
 
ahoffmannCommented:
Hey, you writing comments faster than I could read 'em ;-)

So, according to your sound/Config.in you should get at least
one question about  CONFIG_CS4232  while doing  make config
True?

You also should have  sound/local.h  which has a couple of
    #define CS4232_.....
lines, and
    #define CONFIG_CS4232
0
 
hulkenAuthor Commented:
Yes I have to ansver one question about cs4232
I ansverd it the same way as I ansverd it when I compiled my 2.0.33 kernel. My 2.0.33 kernel compiled fine....

 I dont have a sounds/local.h but a sound/local.h.master
0
 
ahoffmannCommented:
Could you please do a  make config  in  sound.

Then in /usr/src/linux
      make clean
      make dep
      make zImage
0
 
hulkenAuthor Commented:
Alredy tried it:
make: *** No rule to make target `config'.  Stop.
0
 
ahoffmannCommented:
Sorry, actually I don't have 2.1.x sources.
But I'll try to help you anyway.
Please send sound/Makefile to hoagascht@gmx.net .
0
 
ahoffmannCommented:
All the problems with undefined references are only there if you
try to compile the sound things as module?

Feel free to ask more questions.
0
 
hulkenAuthor Commented:
No, I get those when I tries to compile it into the kernel to...
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 16
  • 13
Tackle projects and never again get stuck behind a technical roadblock.
Join Now