« Return to Thread: Patches

Re: Re: Patches

by Jim Beard-3 :: Rate this Message:

Reply to Author | View in Thread

Miark wrote:

> On Sat, 13 Jun 2009 15:48:26 +0300, Thomas wrote:
>
>> Miark skrev:
>>> Does anybody here know I might implement an ALSA patch in
>>> 2009.1 that was already created for me?
>>>
>> Install kernel source, apply the patch, build the kernel,
>> install it & reboot...
>>
>> What kind of patch is it ? from where ?
>> Isn't alsa working for you in 2009.1 ?
>>
>> If so, open a bugreport, attach the patch, and add me in cc of
>> the bug...
>
> Hi Thomas,
>
> It's an ALSA patch that I got from Clemens Ladisch, an ALSA
> developer.
>
> There's nothing wrong with my ALSA--the problem is with a XLR-
> to-USB adapter that allows you to record with a phantom-powered
> studio microphone. It has a screwy USB descriptor that causes
> recording apps to record stereo data during a mono recording.
> Windows seems to disregard the descriptor so the device works
> there, but ALSA obeys it strictly so recordings in Audacity,
> etc. don't turn out correctly.
>
> So anyway, after applying the patch, I run into trouble. I was
> told to go into the linux directory, then...
>
>   # make mrproper
>   # make
>   # make modules_install
>
> But I get different errors, depending on where I cd. If I cd
> into "linux", then make spits out this error:
>
>   *** You have not yet configured your kernel!
>   *** (missing kernel .config file)
>   ***
>   *** Please run some configurator (e.g. "make oldconfig" or
>   *** "make menuconfig" or "make xconfig").
>   ***
>   make[2]: *** [silentoldconfig] Error 1
>   make[1]: *** [silentoldconfig] Error 2
>   make: *** No rule to make target `include/config/auto.conf',
>              needed by `include/config/kernel.release'.  Stop.
>
> But I'm running linux-2.6.29.3-desktop, so if cd into
> /usr/scr/linux-2.6.29.3-desktop-1mnb instead, then make gives me
> different errors:
>
>   make[2]: Nothing to be done for `silentoldconfig'.
>   make[1]: *** No rule to make target `init/main.o', needed by
>      `init/built-in.o'.  Stop.
>   make: *** [init] Error 2
>
> So, first, I'm not sure which directory I should be in when I do
> the make stuff; and second, I'm not sure how to deal with their
> respective errors.

Mark,

It would halp to know EXACTLy how you installed the patch
provided to you.  But, perhaps a bit of explanation will get you
going.

After installing the source for your kernel (use uname -a and
rpm -qa |grep versionfromuname to get the kernel and package
name) you should have something in /usr/src like the following.

/usr/src/2.6.29.4-tmb-desktop-4mdv
/usr/src/linux-2.6.29.3-desktop-1mnb

These are actually devel packages rather than the full source so
be sure you have full source code for the running kernel and
identify the directory holding it.  There may be a symbolic link
/usr/src/linux pointing to one of the kernel source packages.  If
it does not point to the directory for the running kernel, remove
it.  You can create a new one that points to the correct
directory, but make will continue onward and find what it wants
if symbolic link linux is not there, so it really is not needed.

cd into the directory for the source code for the kernel you are
running.  ls -l /boot/config* should show you a config file for
each kernel installed. The filenames should look something like this.

/boot/config-2.6.29->
              config-2.6.29.4-tmb-desktop-4mdv.1-server-4mnb
   //boot/config-2.6.29.2-tmb-desktop-3mdv
/boot/config-2.6.29.3-server-1mnb

Use mv .config .origconfig to move the existing .config file out
of the way, for safe-keeping. Then cp -p /boot/config .config
to copy the configuration for your running kernel in.

At this point, I think you need to take a look at the top few
lines of both .config and .oldconfig.  You are creating a new
kernel, and need the .config to have the name from .origconfig.

At this point, you should apply the patch to the source code in
and below the directory you are in.  This should modify or
replace files in the source code.

Then,
make mrproper /*  This cleans out any stale rubbish  */
make          /*  This should make the kernel you want  */
make install  /*   This should install the kernel     */

The make install has to be done as root.  I recommend using
chown -R /usr/src/kernelsource useryou:
to make useryou  the owner of the kernel source code.  Then
you can compile as useryou, and only do the final install as root.

Perhaps it's obvious, but you will have to have the requisite
comppiler and development tools installed (make, etc).

If you have nvidia or other proprietary graphic card drivers,
reboot to the new kernel should trigger dkms (if installed, it
usually is by default) to install any required proprietary
drivers.  Should that not work, you may need to install them
manually for the new custom kernel.

Good luck!

Cheers!

jim b.





--
UNIX is not user unfriendly; it merely
      expects users to be computer-friendly.

 « Return to Thread: Patches