LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   How to patch linux-2.6.27.31 kernel source to no-smp in Slackware 12.2? (http://www.linuxquestions.org/questions/slackware-14/how-to-patch-linux-2-6-27-31-kernel-source-to-no-smp-in-slackware-12-2-a-758899/)

solarfields 10-01-2009 04:58 AM

[SOLVED] How to patch linux-2.6.27.31 kernel source to no-smp in Slackware 12.2?
 
Hi to all!
I am using slackware 12.2, all kept up-tp-date with slackpkg upgrade-all. I am using vmlinuz-generic-2.6.27.31 (no-SMP!) and all works well. However, I do have the following problem:

the linux-2.6.27.7-smp-to-nosmp.diff.gz patch found in /extra/linux-2.6.27.7-nosmp-sdk/ no longer works and I cannot switch the kernel source from SMP to non-SMP, since the version is no longer 2.6.27.7, but 2.6.27.31.

I was not able to find such a patch for 2.6.27.31. Can somebody suggest a solution?

I do need the kernel source in order to install ndiswrapper and fglrx. Using the SMP kernel is not an option, since my CPU heats as if it was constantly running at 100% (and it is not -- i checked with top). Reverting back to 2.6.27.7 is also not an option since something gets messed and I cannot mount my mobile phone as a regular USB storage device.

regards

---EDIT---

After some googling, i solved the problem. I am posting it here, hoping it may be useful. This is what I did:

just in case, because i had numerous unsuccessful attempts to configure properly the kernel source, i started with:

cd /usr/src/linux-2.6.27.31
make clean
make mrproper

---

then I did:

cd /lib/modules/2.6.27.31
ln -s /usr/src/linux-2.6.27.31 build
cd /usr/src/linux-2.6.27.31
make mrproper
cp /boot/config-generic-2.6.27.31 /usr/src/linux-2.6.27.31/.config
make oldconfig
make prepare
make scripts

REBOOT!

# ./ati-driver-installer-8-12-x86.x86_64.run

works :)

gegechris99 10-01-2009 08:07 AM

Hello,

---- EDIT ------
sorry my suggestion doesn't work as you already mentioned the patch doesn't work.
---- EDIT ------


According the README file in the extra/linux-2.6.27-7-nosmp-sdk directory:

Quote:

To switch your unmodified Slackware kernel sources from SMP to non-SMP,
run the following script in this directory:
./patch-to-non-smp.sh
So you need to apply that script to the 2.6.27.31-smp kernel source and hope it works.

hotchili 10-01-2009 07:22 PM

Hello,

I haven't tested this, but if you look at the patch with zcat, it only changes some options in the
kernel config. So I would install the smp kernel source as normal, then go to /usr/src/linux-x.y.z
run make menuconfig, switch off smp... Maybe that is already enough for your driver(s) to build.

shadowsnipes 10-10-2009 09:28 PM

For some reason when I switched to the newer kernel my laptop no longer completely halts on its own. I use APM by appending acpi=off to the kernel options. While my laptop (TP 600E) supports ACPI, APM works much better. [EDIT]Forgot to add "modprobe apm" to the new rc.modules file ;)[/EDIT]

I was surprised that an update was not included for the smp-to-nosmp patch, but that is not the cause of my computer no longer halting without hitting the power button.

mudangel 10-10-2009 10:44 PM

Quote:

Originally Posted by solarfields (Post 3703153)
cd /lib/modules/2.6.27.31
ln -s /usr/src/linux-2.6.27.31 build
cd /usr/src/linux-2.6.27.31
make mrproper
cp /boot/config-generic-2.6.27.31 /usr/src/linux-2.6.27.31/.config
make oldconfig
make prepare
make scripts

I've never seen that set/sequence of commands(mainly referring to the link in modules and "make scripts") to build a kernel- where is it from?
Why would you need a patch to unset SMP when configuring a kernel?

jedi_sith_fears 10-11-2009 12:07 AM

Why dont you just use the huge.s (non-smp) kernel from the stock and copy its configuration as you need.

If you use gconfig/xconfig to configure the kernel, you can just disable the SMP support there.

The question is SMP kernels behave pretty much good on non-SMP system. SO why whould you be needing it?

Ilgar 10-11-2009 04:33 AM

Can't you just do make menuconfig and turn the SMP option off? I think there's only one option to change in that menu, to go from SMP to non-SMP.

solarfields 10-11-2009 08:48 AM

/*
I've never seen that set/sequence of commands(mainly referring to the link in modules and "make scripts") to build a kernel- where is it from?
*/

it is from here: http://blogs.koolwal.net/2009/07/05/...e-compilation/

without make scripts, ndiswrapper didnt build

/*
Why would you need a patch to unset SMP when configuring a kernel?
*/

i need the kernel source in order to install ndiswrapper and fglrx and it should match the vmlinuz-generic-2.6.27.31 that i am using (no-smp)

/*
Why dont you just use the huge.s (non-smp) kernel from the stock and copy its configuration as you need.
*/

dont know, just copied the configuration file of the generic kernel

/*
The question is SMP kernels behave pretty much good on non-SMP system. SO why whould you be needing it?
*/

as i mentioned in my original post, due to some reason the SMP kernel makes my CPU heat all the time as if it were running constantly on 100%. I checked with top and the % usage appeared normal. However the heat (i am using a laptop) bothered me and the noise of the fan was driving me nuts

/*
Can't you just do make menuconfig and turn the SMP option off?
*/

what's the point of doing this by hand, if i use the .config of the generic no-smp kernel?

jedi_sith_fears 10-11-2009 09:36 AM

Quote:

Originally Posted by solarfields (Post 3715351)
/*

/*
Why dont you just use the huge.s (non-smp) kernel from the stock and copy its configuration as you need.
*/

dont know, just copied the configuration file of the generic kernel

/*
The question is SMP kernels behave pretty much good on non-SMP system. SO why whould you be needing it?
*/

as i mentioned in my original post, due to some reason the SMP kernel makes my CPU heat all the time as if it were running constantly on 100%. I checked with top and the % usage appeared normal. However the heat (i am using a laptop) bothered me and the noise of the fan was driving me nuts

/*
Can't you just do make menuconfig and turn the SMP option off?
*/

what's the point of doing this by hand, if i use the .config of the generic no-smp kernel?

If you use the generic kernel, you need to make initrd.gz to boot.

If you use the 32-bit Slack13, you can find both the huge.s(non-SMP) & hugesmp.s kernels there.

Try to take the config and turn on cpu clock management and set it to "ondemand". This will make your machine run cooler.

By the way, what notebook are you using?

solarfields 10-11-2009 10:14 AM

i am using slack 12.2, not 13

however when i tried slack 13, i got the same problem with the heat but this time with _both_ SMP and NOSMP kernels. the cpu clock management is automatically set to ONDEMAND by slack 13

my laptop is this one: http://support.packardbell.com/se/it...4M02568&t=1409

mudangel 10-11-2009 11:44 AM

Quote:

Originally Posted by solarfields (Post 3715351)
/*
I've never seen that set/sequence of commands(mainly referring to the link in modules and "make scripts") to build a kernel- where is it from?
*/

it is from here: http://blogs.koolwal.net/2009/07/05/...e-compilation/

without make scripts, ndiswrapper didnt build

Oh, I see...I(for some reason) didn't realise you were building a module, not the kernel. Good link, too.


Quote:

Originally Posted by solarfields (Post 3715351)
/*
Why would you need a patch to unset SMP when configuring a kernel?
*/

i need the kernel source in order to install ndiswrapper and fglrx and it should match the vmlinuz-generic-2.6.27.31 that i am using (no-smp)

The thing that's still confusing me- kernel source isn't specifically SMP/non-SMP... that's all up to your .config, so why not just copy the running kernel's config to the source directory, then do the steps you mentioned earlier?
I just don't see any need for a patch to change a config item- is there an argument in favor of that, instead of "make <menu/x/g>config"?

jedi_sith_fears 10-11-2009 12:27 PM

Quote:

Originally Posted by mudangel (Post 3715492)
Oh, I see...I(for some reason) didn't realise you were building a module, not the kernel. Good link, too.




The thing that's still confusing me- kernel source isn't specifically SMP/non-SMP... that's all up to your .config, so why not just copy the running kernel's config to the source directory, then do the steps you mentioned earlier?
I just don't see any need for a patch to change a config item- is there an argument in favor of that, instead of "make <menu/x/g>config"?

I think what he wants to say that he need a patch for ndiswrapper to use and compile in non-SMP kernel.

solarfields 10-11-2009 12:49 PM

/*
why not just copy the running kernel's config to the source directory, then do the steps you mentioned earlier?
*/

i copied the generic config, etc, now everything is fine (as i wrote when i edited the original post)...
simply, before (when the kernel was 2.6.27.7, not 2.6.27.31), all i needed to do was to apply the patch mentioned above to the kernel source and then i had no problems to compile ndiswrapper and install ati's proprietary driver

i did not need a patch for ndiswrapper, i needed it for the kernel source (as i wrote above)

anyways, seems i am repeating myself :)

but if anyone has any idea of why my CPU behaves so strange when using the SMP kernel (and even the non-smp kernel in slack 13) -- please let me know

jedi_sith_fears 10-11-2009 01:26 PM

I have no idea why your CPU acting so weird. But another things I will suggest that you should give a try to latest 2.6.31.3 kernel. 2.6.30+ seems to fix many hardware issues.

shadowsnipes 10-11-2009 09:43 PM

The patch does not change just the .config file, but several other files. These sources have to be configured using the correct .config file. You can't just uncheck smp either. You need to remove the local "-smp" version appended. Many other options change when smp is turned off, and in the end a lot of changes are made. Look at the nosmp patch in the Slackware tree to see what I mean.


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