recompile a kernel How to

Hello,

I have a asus M51 Se that not work with 4GB of memory ram, due to a bug of bios. Only work with one slot of 2GB. I find this link https://bugs.launchpad.net/ubuntu/+source/linux/+bug/316079 that help to solve my problem. But for that I have to change a file.

My question is I need to recompile the kernel that I have? if yes, how can i make that without installing other kernel.

Regards

On 02/03/2011 08:06 PM, geniusr wrote:
>
> Hello,
>
> I have a asus M51 Se that not work with 4GB of memory ram, due to a bug
> of bios. Only work with one slot of 2GB. I find this link
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/316079 that help to
> solve my problem. But for that I have to change a file.
>
> My question is I need to recompile the kernel that I have? if yes, how
> can i make that without installing other kernel.

Yes, you will need to recompile the kernel. You do that by installing the kernel
source package using YaST => Software Management. Under the view tab, select
patterns and check the “Linux Kernel Development”, and “C/C++ Development” options.

Once you have downloaded the above, open a terminal and change directory (cd
command) to /usr/src. In that directory, you will find a directory named
“linux-2.6.XXXXX”, where the XXXXX matches the output of the ‘uname -r’ command.

When the kernel source is copied to your system, it is owned by root. Unless we
change that, you have to build the kernel as root - that is not recommended. To
fix this, use the command 'sudo chown -R <name>:users linux-2.6.XXXXX, where
<name> is replaced by your user name.

Now do the following:


cd linux-2.6.XXXXX
zcat /proc/config.gz > .config
echo "-asus" > localversion-asus
<edit the file to include the patch -- use the second form in the link you posted.>
make -j2
sudo make modules_install install

If you have more than 1 CPU, increase the -j2 in the make statement to 1 more
than the jumber of cores. That step will take a long time. Once these steps are
completed, your new kernel will be in the GRUB menu with the “asus” id.

It appears that although the fix has been known since 2009, no one ever
submitted it to the kernel. I suggest that you file a bug report with
bugzilla.kernel.org on the problem. If the second form of the patch works, post
it with the bug (giving proper acknowledgment to the person that posted it.) and
say that this fixes your system. Perhaps that way, the fix will be added to the
kernel and backported to older stable kernels.

Ok, I will do that. BUt i have other question. This process will make two Kernel in grub, it is right? If yes how can I delete the older kernel? because I have a lack of space in my disk. there be some instruction that can remove temporary files? or remove the older kernel?

Regards
Luís

On 02/04/2011 11:36 AM, geniusr wrote:
>
> Ok, I will do that. BUt i have other question. This process will make
> two Kernel in grub, it is right? If yes how can I delete the older
> kernel? because I have a lack of space in my disk. there be some
> instruction that can remove temporary files? or remove the older
> kernel?

If you skip the step that echos to localversion-asus, then your generated kernel
will overwrite the downloaded one. There are two problems with that: (1) if
something goes wrong, your computer will not boot, and (2) as soon as openSUSE
updates the kernel, your fix is gone.

There are several ways to remove old kernels, but if you are that short on disk
space, you probably wont have room for the kernel sources. On my 64-bit system,
the kernel source and the resulting binaries are a little over 3 GB. A kernel is
about 4 MB, initrd is 10 MB, and the modules are about 5 MB.