LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Full RAM memory Slackware 12.1. (https://www.linuxquestions.org/questions/slackware-14/full-ram-memory-slackware-12-1-a-647970/)

glore2002 06-09-2008 05:27 AM

Full RAM memory Slackware 12.1.
 
Hello!

How can I make Slackware 12.1 recognize (and make use of) my 4Gb of RAM memory? If I run vmstat, it seems to recognize only 3Gb.

Thanks in advance,
Glore2002.-

scoban 06-09-2008 06:17 AM

Recompile kernel with 64gb ram support

lucazorzi 06-09-2008 06:18 AM

I'm afraid you'll have to recompile your kernel with the HIGHMEM64G option enabled.

Woodsman 06-09-2008 01:20 PM

Recently I had to do this.

There are three memory usage options when compiling the kernel:

CONFIG_NOHIGHMEM
CONFIG_HIGHMEM4G
CONFIG_HIGHMEM64G


The first option limits using up to 1GB. The second option limits using up to but not including 4GB. That is, a 4GB box will only use 3GB or so. The last option will recognize 4GB or more. The BIOS might recognize 4GB at boot, but without recompiling, the Linux kernel will not.

glore2002 06-09-2008 09:22 PM

Recompile? Is that easy or risky?
 
Hello back and thanks for your answers.
So, in order to recompile kernel, What steps should I follow? Will that mean losing some or all of my insalled programs?
If Slackwar recognizes my full 4Gb, Will that be an advantage or not?

If I run free -m at command line now, I get this:

total used free shared buffers cached
Mem: 3285 606 2678 0 61 370
-/+ buffers/cache: 173 3111
Swap: 0 0 0


I have 4Gb of RAM installed.

Thanks again,

Glore2002.-

T3slider 06-09-2008 10:07 PM

See here for a great kernel compiling guide.
Quote:

Originally Posted by glore2002
Will that mean losing some or all of my insalled programs?

No, you won't lose any of your programs or files. You won't have to reinstall anything, either.
Quote:

Originally Posted by glore2002
If Slackwar recognizes my full 4Gb, Will that be an advantage or not?

More RAM is always a good thing, so yes, I would definitely say that this is worth it. If you don't want to learn too much about kernel compiling you can just use the .config file for the generic-smp kernel as a base and just change the one option mentioned above (the .config file for the generic-smp kernel is located in /boot/config-generic-smp-2.6.24.5-smp in Slackware 12.1 -- you should copy it to the kernel source directory and rename it to .config to use it as a base).

onebuck 06-09-2008 10:14 PM

Hi,

'Linux Kernel in a Nutshell' is a must read! And a great desktop reference.

This link and others are available from 'Slackware-Links'. More than just Slackware« links!

glore2002 06-10-2008 05:17 AM

Quote:

Originally Posted by T3slider (Post 3179907)
See here for a great kernel compiling guide.

No, you won't lose any of your programs or files. You won't have to reinstall anything, either.

More RAM is always a good thing, so yes, I would definitely say that this is worth it. If you don't want to learn too much about kernel compiling you can just use the .config file for the generic-smp kernel as a base and just change the one option mentioned above (the .config file for the generic-smp kernel is located in /boot/config-generic-smp-2.6.24.5-smp in Slackware 12.1 -- you should copy it to the kernel source directory and rename it to .config to use it as a base).


This looks nice T3slider!

(at least, it looks easier!). Would it have the same effect as re-compiling kernel? This is how my /boot/config-generic-smp-2.6.24.5-smp looks like now:
:
:
# CONFIG_NOHIGHMEM is not set
CONFIG_HIGHMEM4G=y
# CONFIG_HIGHMEM64G is not set
CONFIG_PAGE_OFFSET=0xC0000000
CONFIG_HIGHMEM=y
:
:

So, What should I do? (detailed explanation will be appreciated!).
Thanks again!
Glore2002.-

glore2002 06-10-2008 05:26 AM

Something else...
 
By the way, next time I install Slackware from scratch ┐Where and when during installation should I tell Slackware my amount of RAM to set everything correctly?

Thank you!

Glore2002.-

shadowsnipes 06-10-2008 11:43 AM

Quote:

Originally Posted by glore2002 (Post 3180158)
By the way, next time I install Slackware from scratch ┐Where and when during installation should I tell Slackware my amount of RAM to set everything correctly?

Thank you!

Glore2002.-

Since the kernel images are prebuilt I don't think there is any way currently that you can specify that you need high mem support. So, you might have to rebuild your kernel every time.

It's a nice problem to have, having more memory than what your system to knows what to do with. Thankfully it is easily fixable as mentioned previously.

Edit:
Quote:

Originally Posted by glore2002 (Post 3180152)
This looks nice T3slider!

(at least, it looks easier!). Would it have the same effect as re-compiling kernel? This is how my /boot/config-generic-smp-2.6.24.5-smp looks like now:
:
:
# CONFIG_NOHIGHMEM is not set
CONFIG_HIGHMEM4G=y
# CONFIG_HIGHMEM64G is not set
CONFIG_PAGE_OFFSET=0xC0000000
CONFIG_HIGHMEM=y
:
:

So, What should I do? (detailed explanation will be appreciated!).
Thanks again!
Glore2002.-

Use the guides that you were told about. After you have copied over the generic config file to the linux src directory you
make menuconfig
Go to
"Processor Type and Features" -> "High Memory Support" and select 64GB.
Exit and then make, and do the rest of the steps in the guide.

GrapefruiTgirl 06-10-2008 11:57 AM

Quote:

Originally Posted by glore2002 (Post 3180152)
This looks nice T3slider!

(at least, it looks easier!). Would it have the same effect as re-compiling kernel? This is how my /boot/config-generic-smp-2.6.24.5-smp looks like now:
:
:
# CONFIG_NOHIGHMEM is not set
CONFIG_HIGHMEM4G=y
# CONFIG_HIGHMEM64G is not set
CONFIG_PAGE_OFFSET=0xC0000000
CONFIG_HIGHMEM=y
:
:

So, What should I do? (detailed explanation will be appreciated!).
Thanks again!
Glore2002.-

No, this does not have the same effect as recompiling the kernel; the suggestion made here is simply intended to save you the (small) task of going through the configuration menu to set the changes to the kernel configuration.

You still need to recompile the kernel to incorporate the edit you made to the .config file.

After editing the .config file to activate the HIGHMEM64 option, you will need to move/copy/save this .config file into your kernel source folder, then execute:
Code:

make clean
make
make modules_install

That will build the new kernel and install the modules. You must then copy the new kernel image to your /boot folder, and configure & run LILO to tell the bootloader the name/location of the new image you just made.

As well as reading the man page for `lilo` the links provided by other users above should give you all the info you need about building a new kernel.

If you proceed and get stuck or lost, tell us what you have done so far and we will guide you further.

SVA

EDIT - this assumed you ARE using the LILO bootloader. If you are using something else, then the LILO instruction I gave will not apply, but something else will.

glore2002 06-10-2008 07:05 PM

Hard to decide Isn't it?
 
Thanks for such a valuable information.

For me, it's hard to decide what to do:

On one side, by rebuilding the Kernel, I would gain full access to my 4Gb. But (on the other side), by reading the guide I also see that some packages may need to be re-compiled (alsa?) to match the new kernel (I don't clearly understand this point).

The guide is really good but, as a newbie, I think I need to have all the detailed and exact steps I should follow in order to access 4Gb without losing any of my packages and lilo. This to make sure I don't make mistakes because of misunderstanding the guide.

What I find really hard to believe is that one is not able to install Slackware from scratch enabling HIGHMEM64G.

Well, I'll keep on reading. As always, your help is very welcome.


Thank you!
Glore2002.-

GrapefruiTgirl 06-10-2008 07:25 PM

No problem! Your patience and willingness to read are commendable, and the right way to go about things. Rather than simply doing stuff without knowing why it is how it is, you will hopefully *understand* what it is you are doing.

The way it is now, without the 64G option, your kernel uses the top 1/4 of your memory to map the lower 3/4 of the memory. So, it isn't technically "missing", but rather the kernel has access to it and you don't.

Chances are VERY HIGH (ridiculously high) that you will not lose (or need to recompile) any packages by rebuilding your kernel, especially if you are rebuilding the exact same version of the kernel. In fact, the only way you would lose packages is... Well, I don't really know :p but I suppose it is possible somehow.. Anything's possible. :D

As far as enabling the 64G option while installing, the installation process would need to compile the kernel on the fly, during installation. Slackware does not do this, but instead provides some compiled kernels which are intended to suit the majority of general needs. An example of a Linux that DOES (or CAN) compile a kernel on the fly, is Gentoo; Gentoo is compiled from scratch AND installed during installation. As you might guess, a distro that compiles EVERYTHING from scratch as it installs takes a longer time to install, AND needs more user input to do it.

Best of success with the reading. You will get there!

Sasha

glore2002 06-10-2008 09:15 PM

Let's see if I can do it. Now it became a challenge!
 
OK. Let's see if I can do it myself:

Please, help me, writing down the needed steps. I will add questions when in doubt.

Question #0: Should I always be root? (During the whole process that follows I mean). My answer would be YES.

a) I edit my /boot/config-generic-smp-2.6.24.5-smp and change:

CONFIG_X86_CPUID=m

# CONFIG_NOHIGHMEM is not set

CONFIG_HIGHMEM4G=y

# CONFIG_HIGHMEM64G is not set

CONFIG_PAGE_OFFSET=0xC0000000

CONFIG_HIGHMEM=y


To make it look as
:

CONFIG_X86_CPUID=m

# CONFIG_NOHIGHMEM is not set

#CONFIG_HIGHMEM4G=y

CONFIG_HIGHMEM64G=y
(****)

CONFIG_PAGE_OFFSET=0xC0000000

CONFIG_HIGHMEM=y


Is this OK?

b) I should copy this newly /boot/config-generic-smp-2.6.24.5-smp to where the Kernel source resides (and change its name to .config). Question #1: Do I have to copy it to /usr/src/linux or to /usr/src/linux-2.6.24.5 ? I don't have to download any kernel source because I need to re-build the same Kernel I am using right now. Is that ok?

c) Here is where I get lost. What follows? :confused:

Yes, I know, I didn't get too far but at least I am trying to make some little steps. :-)

Thanks again!

Glore2002.-

Petri Kaukasoina 06-11-2008 10:08 AM

Quote:

Originally Posted by glore2002 (Post 3180942)
I edit my /boot/config-generic-smp-2.6.24.5-smp and change:

On top of that file: "Automatically generated make config: don't edit".
Just copy that to your kernel source directory as .config and use, for example, make menuconfig, instead.

glore2002 06-11-2008 11:55 AM

OK. Let's see what's next.
 
So, let's see if I have it until now.

a) I should copy /boot/config-generic-smp-2.6.24.5-smp to /usr/src/linux with no changes (I don't have to edit it).

b)I should run make menuconfig. There I choose to enable 64Gb support.

c) What should I do now? (is it to type make clean, make and make modules_install?) as GrapefruiTgirl suggested?

d) ?


Thanks!

wadsworth 06-11-2008 02:31 PM

Here are the steps that I use;
copy (or untar) the kernel source somewhere under your home folder
(you can compile a kernel as root, but I choose not to.)
"cd" into the top of the source tree,
make mrproper
(like "make clean" but more aggressive, and will delete the .config file, if present)
cp /boot/config-generic-smp-2.6.24.5-smp ./.config
make menuconfig
set the "Local version" to "-custom" (for example) to keep your new modules from
clobbering any modules from another kernel.
make any other desired changes to the .config
make
(you need to be root for these next steps)
make modules_install
cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.24.5-custom
cp System.map /boot/System.map-2.6.24.5-custom
cp .config /boot/config-2.6.24.5-custom

now run the mkinitrd command (if you need one).
Place a stanza for your new kernel in /etc/lilo.conf
and run /sbin/lilo.

If all went well, you can reboot into your new kernel.
Any third party kernel modules you have will now need rebuilding.

The only module included in Slackware that will need to be rebuilt
is "svgalib_helper" (at least this is the only one I'm aware of)
and you most likely will never need it.
I ran my custom kernel for almost a year before I realized it was missing. :)

You can now run "make clean" on the kernel tree to save some disk space,
(don't run "make clean" if you're going to be building any kernel modules
you'll likely have to run "make" again in order to build them.)
but don't delete or move it. Any modules you build in the future will
need it, and they'll know where to look for it even if its under your
/home directory.

I also highly recommend the book linked to by onebuck in post #7

shadowsnipes 06-12-2008 01:28 AM

To add to what wadsworth posted,

Keep in mind that the kernel source for Slackware has a small patch. So, a vanilla 2.6.24.5 kernel source is not quite the same. Newer 2.6.24 kernels include the security fix this patch has, but they might also have other features as well.

It's also fine to compile your kernel as root if you want to. This is what official SlackBuilds do. There are ways to compile as a normal user while still having the source under /usr by the way. There is some info about this in the kernel docs.

For your situation I recommend copying the Slackware kernel source to a different directory under /usr/src such as
Code:

cp -a /usr/src/linux-2.6.24.5 /usr/src/linux-2.6.24.5-custom
and working with that.

See /boot/README.initrd for some documentation on your initrd. There is also a thread active here about switching from the huge to generic kernel that would probably be of use.

When you edit your lilo.conf leave the old Slackware entry. Just copy it and modify it for your new boot entry. Leaving the original boot entry gives you more than one kernel you can boot from in case you have a problem with your new one.

I recommend you create a rc.modules file for your new kernel (eg. /etc/rc.d/rc.modules-2.6.24.5-custom). When your system boots it will look for a file in this order
/etc/rc.d/rc.modules.local
/etc/rc.d/rc.modules-$(uname -r)
/etc/rc.d/rc.modules (symlink)
/etc/rc.d/rc.modules
Most people don't use rc.modules.local unless they want it called regardless of what kernel they boot.
You can just copy your current rc.modules file to your new one and modify it as needed. If you are not missing any modules after you boot you probably don't need to modify it.

By the way, in case anyone is curious, the SlackBuild for compiling the kernel is at slackware-12.1/kernels/compile_kern.sh. There are other slackBuilds for setting up the kernel packages in the src directory.

reikyv 06-12-2008 03:20 AM

Hi,

Following various comments here, I am able to re-compile my kernel to support 4GB of RAM in my laptop now:

Code:

root@example:~# free -m
            total      used      free    shared    buffers    cached
Mem:          4040        542      3498          0        18        259
-/+ buffers/cache:        264      3776
Swap:          980          0        980

Thanks!

glore2002 06-12-2008 05:16 AM

thanks for your help!
 
Thanks to all of you for your valuable help.

REIKYV, since you've just compiled your kernel to recognize 4Gb RAM, Could you please write down the steps you exactly made to do it? This to see if they match the ones I think.

Thank you very much!
Glore200.-

reikyv 06-12-2008 06:22 AM

Quote:

Originally Posted by glore2002 (Post 3182363)
Thanks to all of you for your valuable help.

REIKYV, since you've just compiled your kernel to recognize 4Gb RAM, Could you please write down the steps you exactly made to do it? This to see if they match the ones I think.

Thank you very much!
Glore200.-

Hi Glore200,

First, I am using existing kernel source, i.e. /usr/src/linux-2.6.24.5.
So my steps here:

Code:

# cd /usr/src/linux
# cp /boot/config /usr/src/linux/.config

--> edit .config set CONFIG_HIGHMEM64G=y

# make mrproper
# make menuconfig
# make
# make modules_install
# cp arch/i386/boot/bzImage /boot/vmlinuz-custom-2.6.24.5-smp
# cp System.map /boot/System.map-custom-2.6.24.5-smp
# cp .config /boot/config-custom-2.6.24.5-smp
# cd /boot
# rm System.map
# ln -s /boot/System.map-custom-2.6.24.5-smp System.map
# mkinitrd -c -k 2.6.24.5-smp -m ext3

--> edit /etc/lilo.conf to include your new kernel (add to the bottom there, and don't erase the current one as you still be able to boot into it if any bad thing happens)

image = /boot/vmlinuz-custom-2.6.24.5-smp
  root = /dev/sda3
  initrd = /boot/initrd.gz
  label = 2_6_24_5_smp
  read-only

# lilo
# reboot

Okay, that's all what I did.
Cheers!

shadowsnipes 06-12-2008 11:08 AM

Quote:

Originally Posted by reikyv (Post 3182400)
Hi Glore200,

First, I am using existing kernel source, i.e. /usr/src/linux-2.6.24.5.
So my steps here:

Code:

# cd /usr/src/linux
# cp /boot/config /usr/src/linux/.config

--> edit .config set CONFIG_HIGHMEM64G=y

# make mrproper
# make menuconfig
# make
# make modules_install
# cp arch/i386/boot/bzImage /boot/vmlinuz-custom-2.6.24.5-smp
# cp System.map /boot/System.map-custom-2.6.24.5-smp
# cp .config /boot/config-custom-2.6.24.5-smp
# cd /boot
# rm System.map
# ln -s /boot/System.map-custom-2.6.24.5-smp System.map
# mkinitrd -c -k 2.6.24.5-smp -m ext3

--> edit /etc/lilo.conf to include your new kernel (add to the bottom there, and don't erase the current one as you still be able to boot into it if any bad thing happens)

image = /boot/vmlinuz-custom-2.6.24.5-smp
  root = /dev/sda3
  initrd = /boot/initrd.gz
  label = 2_6_24_5_smp
  read-only

# lilo
# reboot

Okay, that's all what I did.
Cheers!

Unfortunately, without appending the local version (look for the option in menuconfig) you clobber your old modules. Perhaps with this one max memory change they won't change anyways. I am not sure about this. But if this were the case then you wouldn't even need to install the modules again. In that case you could do a make bzImage instead of make and not do the make modules_install.

Also, it is not required to change the symlinks under /boot (System.map, config, vmlinuz). What matters is that lilo can find the files it points to.

glore2002 06-12-2008 11:39 AM

Thank you!!!!
 
I will try this as soon as I get home tonight and will tell you what happened. :D

Thanks friends.

shadowsnipes 06-12-2008 11:40 AM

As Pat says, "Have fun!"

glore2002 06-12-2008 05:36 PM

Quote:

Originally Posted by shadowsnipes (Post 3182608)
Unfortunately, without appending the local version (look for the option in menuconfig) you clobber your old modules. Perhaps with this one max memory change they won't change anyways. I am not sure about this. But if this were the case then you wouldn't even need to install the modules again. In that case you could do a make bzImage instead of make and not do the make modules_install.

Also, it is not required to change the symlinks under /boot (System.map, config, vmlinuz). What matters is that lilo can find the files it points to.

Hello Shadowsnipes and thanks for your advice. Could you please modify the code Reikyv wrote to match what you suggest? I will wait for your answer before starting to rebuild the Kernel.

Thanks and more thanks!
Glore2002.-

reikyv 06-12-2008 09:05 PM

Quote:

Originally Posted by shadowsnipes (Post 3182608)
Unfortunately, without appending the local version (look for the option in menuconfig) you clobber your old modules. Perhaps with this one max memory change they won't change anyways. I am not sure about this. But if this were the case then you wouldn't even need to install the modules again. In that case you could do a make bzImage instead of make and not do the make modules_install.

Also, it is not required to change the symlinks under /boot (System.map, config, vmlinuz). What matters is that lilo can find the files it points to.

Oh shit.

Although I don't really get what you meant, but it sounds bad, am I already corrupted my previous modules?

And you suggest to do a "make bzImage" again?

Thanks.

onebuck 06-12-2008 10:42 PM

Hi,

I like to modify the '/usr/src/linux/Makefile' variable 'EXTRAVERSION = ToSomeUniqueValue'. That way you won't have a problem with other areas of concern. Your compile session will be unique as to the 'EXTRAVERSION = ' setting.

T3slider 06-13-2008 12:00 AM

reikyv, your sequence of events suggests that you accidentally compiled using a stock kernel configuration and not the configuration matching Slackware's default kernel. `make mrproper` actually deletes the .config file in that directory, so you would be starting from scratch. Unless you accidentally posted your sequence out of order, you're lucky that your kernel worked -- but I would suggest recompiling to get the original Slackware configuration with only the one option changed. Your sequence should have run `make mrproper` BEFORE copying the .config file to the source directory, OR running `make clean` instead of `make mrproper`, since `make clean` does not delete the .config file (but does basically the same thing as `make mrproper` otherwise).

If you want to restore your modules to their previous state (because you probably overwrote the original modules), you could delete the /lib/modules/2.6.24.5-smp directory and issue `upgradepkg --reinstall /path/to/kernel-modules-smp-2.6.24.5_smp-i686-2.tgz`, where /path/to/kernel-modules-smp-2.6.24.5_smp-i686-2.tgz is the location of the kernel-modules-smp-2.6.24.5_smp-i686-2.tgz package (which is located on the install media or available at your favourite mirror in the a/ series). Normally I would not suggest deleting the /lib/modules/2.6.24.5-smp directory entirely before issuing the upgradepkg command, but since `depmod -a` (run by the doinst.sh install script when you install the package) detects all of the modules in that directory, any extra modules will also be added -- which would not restore your system to its original state.

T3slider 06-13-2008 12:19 AM

Here is the complete method of rebuilding the kernel just to enable this one feature. It's the easiest way (though not my favourite way -- I personally build kernels in my home directory, but this will do if you don't want to do that. It's also the most straightforward).
Code:

# cp -a /usr/src/linux-2.6.24.5 /usr/src/linux-2.6.24.5-custom
# cd
# wget http://slackware.osuosl.org/slackware-12.1/source/k/linux-2.6.24.5-CVE-2008-1375-patch/linux-2.6.24.5.dnotify.diff.gz
# gunzip linux-2.6.24.5.dnotify.diff.gz
# cd /usr/src/linux-2.6.24.5-custom
# make mrproper
# cp /boot/config-generic-smp-2.6.24.5-smp ./.config
# patch -p0 < ~/linux-2.6.24.5.dnotify.diff
# make menuconfig

Now, in the menuconfig interface, go to "Processor Type and Features" -> "High Memory Support" and select 64GB. This is more desirable than manually editing the .config file -- sometimes that can have strange effects. In this case it would probably be safe as well, but it's not good practice and using `make menuconfig` to change it is better anyway. While you're in the menuconfig interface, you should also change the LOCALVERSION option to "custom" (without the quotes). I can't tell you off-hand where the LOCALVERSION option is located, but it shouldn't be hard to locate (you can search for it if you want). This will prevent overwriting the /lib/modules/2.6.24.5-smp directory. If you wanted, you could also edit the Makefile and change the EXTRAVERSION option INSTEAD of setting the LOCALVERSION option in menuconfig, but either should be fine.
Code:

# make bzImage modules
# make modules_install
# cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.24.5-custom
# cp System.map /boot/System.map-2.6.24.5-custom
# cp .config /boot/config-2.6.24.5-custom
# ln -sf /boot/System.map-2.6.24.5-custom /boot/System.map
# vi /etc/lilo.conf

Now edit your lilo.conf file (you can use pico or nano or another editor if you don't like vi) and add the following stanza (to get it to boot by default, make sure it is the first stanza of its kind. You could also use the "default=" option if you don't want to add it to the beginning of the kernel stanzas but still want it to be the default):
Code:

image = /boot/vmlinuz-2.6.24.5-custom
  initrd = /boot/initrd.gz
  root = /dev/sda1
  label = Custom
  read-only  # Partitions should be mounted read-only for checking

Make sure you change /dev/sda1 to point to the root partition of your hard drive (check the existing stanzas to see what that is). Now you must create an initrd (initial ramdisk), since the generic kernel requires it. You should read the /boot/README.initrd file to see what command you should use. I personally just type `mkinitrd -c -k 2.6.24.5-smp -m reiserfs` since I use reiserfs, but a GREAT script that usually outputs the correct mkinitrd command is located here. Run the appropriate mkinitrd command and it will generate a /boot/initrd.gz file (and a /boot/initrd-tree directory).
Code:

# /sbin/lilo -v
Now reboot into your new kernel and everything should hopefully work. It should be noted that copying the .config file to /boot isn't necessary (it's just convenient -- however, even if you don't copy it, `zcat /proc/config.gz` will output the .config file to standard output, since that capability is enabled by default in the Slackware kernel). Linking System.map might not be required (I'm not sure), but it's best to link it anyway. I don't know the naming convention that the kernel uses to find the System.map file (or if it searches the file's headers or something), but most people incorrectly think that the System.map file isn't that important. You will probably never need it -- but if you experience a kernel oops (ie a bug in the kernel), your errors will be incorrect without the proper System.map file. It's easier just to link the file. ;) It should also be noted that `make bzImage modules` can safely be replaced with the simple `make` -- but both are fine and I'm grown attached to the former.

shadowsnipes 06-13-2008 01:15 AM

T3sliders post is mostly fine.

You don't need to download and use the patch or "make clean" or "make mrproper" if you use the original Slackware kernel sources.

As I said previously the original Slackware kernel sources have already been patched and cleaned.

You only need to patch your sources if using a vanilla kernel, and you only need to clean them if you already mucked around with them.

If you did mess with the original sources (instead of working with a copy) you can reinstall the kernel-source package and then make a new copy.

Don't forget to mkinitrd (I think this was missing in T3sliders post).

I think you should be able to figure it out from here, glore2002, without me recopying all of these directions. Don't be afraid to break something or you will never move forward. Even if your new kernel flops you still have the old one as a standby.

T3slider 06-13-2008 01:48 AM

As a side note, if you want to get really technical, you don't even need to rebuild the modules as far as I know, since you're only changing one option which doesn't affect any modules (as far as I know --but I could be wrong). You could probably get away with a simple
Code:

# cp /usr/src/linux-2.6.24.5 /usr/src/linux-2.6.24.5-custom
# cd /usr/src/linux-2.6.24.5-custom
# make menuconfig

Change the relevant options in menuconfig
Code:

# make bzImage
# cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.24.5-custom
# cp System.map /boot/System.map-2.6.24.5-custom
# cp .config /boot/config-2.6.24.5-custom
# ln -sf /boot/System.map-2.6.24.5-custom /boot/System.map
# vi /etc/lilo.conf

etc. etc.

However, if you want to be sure, you should just build the whole thing, as explained previously.
Quote:

Originally Posted by shadowsnipes
You only need to patch your sources if using a vanilla kernel, and you only need to clean them if you already mucked around with them.

Very true -- I guess I just like working from a vanilla setup to avoid conflicts when `make`ing something that has residual files lying around from the original `make`. However, that shouldn't be a problem here, so you likely can skip the `make mrproper` step and the patching step. As a side note, my original patching lines were stupid anyway -- it can be accomplished better with `zcat linux-2.6.24.5.dnotify.diff.gz | patch -p0`. Simpler and using less space. The linux-2.6.24.5.dnotify.diff.gz file is also already present in /usr/src/linux-2.6.24.5, so it would already be present in /usr/src/linux-2.6.24.5-custom. That section would be better represented by the following, assuming you still want to start from scratch (which most likely is not necessary in this instance, as shadowsnipes pointed out):
Code:

# cp -a /usr/src/linux-2.6.24.5 /usr/src/linux-2.6.24.5-custom
# cd /usr/src/linux-2.6.24.5-custom
# make mrproper
# cp /boot/config-generic-smp-2.6.24.5-smp ./.config
# zcat linux-2.6.24.5.dnotify.diff.gz | patch -p0
# make menuconfig


Daedra 06-13-2008 05:38 AM

I'm confused, I thought that 4gb of memory was not possible with a 32bit operating system, only with a 64bit OS?

storkus 06-13-2008 06:56 AM

Go 64 bit
 
I just skimmed this while looking for something else and thought I should
mention it in case no one else did: have you considered going 64 bit?
While Slackware itself doesn't yet, its clones do: I'm using SlamD64 (.com)
very happily; it's also the only one that has 32 bit compatibility
libraries. In your particular case, going 64 bit means you'll have direct
(without PAE aka paging) access to all the memory in your system no matter
how big you get it (at least for the next dozen years or so, LOL!). Other
than the occasional non-FOSS package that's 32 bit only like Flash or
most games, the transition has been very smooth for me and my system runs
noticeably faster, particularly in the I/O department. YMMV, of course.

Mike

glore2002 06-13-2008 05:14 PM

This is not a piece of cake!
 
Hello back!

Well, I was going to re-build my kernel following reikyv steps. Then, when I've got home, I entered the forum and saw Shadowsnipes reply. Then, I stopped. Now, I am getting a bit confused and I am not sure what to do. For instance, I don't know if I have to rebuild my kernel or if it is preferable to download a new kernel and update the one I have installed.

That's why I will really appreciate if someone could write all the needed steps in order (as Reikyv did) to rebuild my Kernel enabling 64Gb support without losing what I have installed and being able to boot my O.S.

Your replies and suggestions are very important to me and I really appreciate that because you are the ones that know a lot about Slackware but if I can see all the instructions together, it would be much clarifying to me. Maybe you can modify and or optimize Reikyv set of instructions.

At the same time and following your advices, I am starting to read Slackware Linux Essentials, Slackware Linux Basics and also The article from http://slackwiki.org/Kerne26Compilation. They are great sources of information tools.

But, and I don't want to bother with this, a refined list of needed steps will be very useful not just for me (it course it will) but for many other Slackware users who are starting to understand how Slacware and Linux work.

Sorry for such a long Thread. It wasn't what I meant when starting it. Believe me. I thought it was easier but now I wont stop until I reach my goal :-)

Thank you friends! :cool:

Glore2002.-

shadowsnipes 06-13-2008 05:39 PM

As I said previously T3sliders directions (1st set) are mostly fine. Basically I am just recopying most of that.

As root
Code:

cp -a /usr/src/linux-2.6.24.5 /usr/src/linux-2.6.24.5-custom
cd /usr/src/linux-2.6.24.5-custom
cp /boot/config-generic-smp-2.6.24.5-smp ./.config
make menuconfig

"General Setup" -> "Local version - append to kernel release"
Enter -custom

"Processor Type and Features" -> "High Memory Support" and select 64GB.

Exit and Save
Code:

make
make modules_install
cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.24.5-custom
cp System.map /boot/System.map-2.6.24.5-custom
cp .config /boot/config-2.6.24.5-custom

Quote:

Originally Posted by T3slider
Now edit your lilo.conf file (you can use pico or nano or another editor if you don't like vi) and add the following stanza (to get it to boot by default, make sure it is the first stanza of its kind. You could also use the "default=" option if you don't want to add it to the beginning of the kernel stanzas but still want it to be the default):

Code:

image = /boot/vmlinuz-2.6.24.5-custom
  initrd = /boot/initrd.gz
  root = /dev/sda1
  label = Custom
  read-only  # Partitions should be mounted read-only for checking

Make sure you change /dev/sda1 to point to the root partition of your hard drive (check the existing stanzas to see what that is). Now you must create an initrd (initial ramdisk), since the generic kernel requires it. You should read the /boot/README.initrd file to see what command you should use. I personally just type `mkinitrd -c -k 2.6.24.5-smp -m reiserfs` since I use reiserfs, but a GREAT script that usually outputs the correct mkinitrd command is located here. Run the appropriate mkinitrd command and it will generate a /boot/initrd.gz file (and a /boot/initrd-tree directory).

Code:

/sbin/lilo -v

If LILO gives you any ERRORS (not warnings) don't reboot until they are resolved. If you have to temporarily comment out the new stuff. Alternatively you could create a backup of lilo.conf before you edit it.

After everything is all good you can optionally
Code:

cd /usr/src/linux-2.6.24.5-custom
make clean


T3slider 06-13-2008 05:43 PM

The thing is, it IS pretty easy and I think my reply is fairly detailed. If you omit a few steps, as shadowsnipes explained, it will also work. We really can't spell it out any clearer. Following my steps makes it impossible to destroy your current kernel and modules, so you have nothing to lose. If you follow my steps but omit a few steps, as explained by shadowsnipes, you still have nothing to lose since your original kernel sources and modules will still be intact. If you follow my second, shorter set of instructions without building the modules, you still have nothing to lose -- though I can't 100% guarantee that it'll work.

Just try it out. If it doesn't work, reboot back into your old kernel and try again.

shadowsnipes 06-13-2008 05:58 PM

Just be sure to tell us what you actually did especially if you run into problems.

onebuck 06-13-2008 06:45 PM

Hi,

I would like to add 'Linux Kernel in a Nutshell' as a must read.

This link and others are available from 'Slackware-Links'. More than just Slackware« links!

glore2002 06-13-2008 10:33 PM

Quote:

Originally Posted by shadowsnipes (Post 3184123)
Just be sure to tell us what you actually did especially if you run into problems.

Hello! Thanks for all the help and especially for the steps you've added.

Well, I followed these steps one by one. The mkinitrd I've got after using the script you told me and the one I used was:

mkinitrd -c -k 2.6.24.5-smp -f ext3 -r /dev/sda3 -m mbcache:jbd:ext3 -o /boot/initrd.gz (by the way, should it be -smp or -custom?)

When rebooting, I chose option Custom at the Slackware menu. The system started to boot and then it stopped showing the following messages:
----------------------------------------------------------------
No kernel modules found for linux 2.6.24.5-custom
mount: mounting /dev/sda3 on /mnt failed: No such device
ERROR: No sbin/init found on rootdev (or not mounted). Trouble ahead.
You can try to fix it. Type 'exit' when things are done
/bin/sh: can't access tty; job control turned off.

---------------------------------------------------------------

Here it is part of my lilo.conf just to verify that I've added things correctly:

---------------------------------------------
# Windows bootable partition config begins
other = /dev/sda1
label = Windows
table = /dev/sda
# Windows bootable partition config ends

# Custom bootable partition config begins
image = /boot/vmlinuz-2.6.24.5-custom
initrd = /boot/initrd.gz
root = /dev/sda3
label = Custom
read-only # Partitions should be mounted read-only for checking
# Custom bootable partition config ends


# Linux bootable partition config begins
image = /boot/vmlinuz
root = /dev/sda3
label = Linux
read-only
# Linux bootable partition config ends
----------------------------------------------

Please, let me know if you need any other kind of information to guide me.

Thanks my friends!

T3slider 06-13-2008 10:59 PM

Quote:

Originally Posted by glore2002
mkinitrd -c -k 2.6.24.5-smp -f ext3 -r /dev/sda3 -m mbcache:jbd:ext3 -o /boot/initrd.gz (by the way, should it be -smp or -custom?)

It should be -custom if you set the LOCALVERSION variable to custom. To check the EXACT entry, you should check the name of the newly created directory in /lib/modules. It should be /lib/modules/2.6.24.5-custom. That command is trying to figure out the correct mkinitrd command for the current running kernel. I think you can specify which kernel to test to give you the correct command, but since the kernels are almost identical you could probably get away with the following mkinitrd command:
Code:

mkinitrd -c -k 2.6.24.5-custom -f ext3 -r /dev/sda3 -m mbcache:jbd:ext3 -o /boot/initrd.gz
It is possible that you also have to specify the dash (-) to get /lib/modules/2.6.24.5-custom, so it might be /lib/modules/2.6.24.5custom (I'm not sure). If that is the case, then you should use the following line:
Code:

mkinitrd -c -k 2.6.24.5custom -f ext3 -r /dev/sda3 -m mbcache:jbd:ext3 -o /boot/initrd.gz
I should also note that you should copy /etc/rc.d/rc.modules-2.6.24.5-smp to /etc/rc.d/rc.modules-2.6.24.5-custom (or omit the dash if it is incorrect).

Looking through the default Slackware configuration, it does indeed look like the dash (-) is needed in LOCALVERSION to get the ideal syntax. You may be able to omit it as described above though. If not, you could recompile with the LOCALVERSION set to "-custom".

shadowsnipes 06-13-2008 11:30 PM

In my directions I had said to use -custom, so the '-' would be included. So, T3slider's first mkinitrd command should work.

I know I had mentioned creating/editing /etc/rc.d/rc.modules-2.6.24.5-custom earlier, but I forgot to mention it in my last set of directions. Thanks for mentioning this T3slider.

glore2002 06-14-2008 07:39 AM

Quote:

Originally Posted by T3slider (Post 3184267)
It should be -custom if you set the LOCALVERSION variable to custom. To check the EXACT entry, you should check the name of the newly created directory in /lib/modules. It should be /lib/modules/2.6.24.5-custom. That command is trying to figure out the correct mkinitrd command for the current running kernel. I think you can specify which kernel to test to give you the correct command, but since the kernels are almost identical you could probably get away with the following mkinitrd command:
Code:

mkinitrd -c -k 2.6.24.5-custom -f ext3 -r /dev/sda3 -m mbcache:jbd:ext3 -o /boot/initrd.gz
It is possible that you also have to specify the dash (-) to get /lib/modules/2.6.24.5-custom, so it might be /lib/modules/2.6.24.5custom (I'm not sure). If that is the case, then you should use the following line:
Code:

mkinitrd -c -k 2.6.24.5custom -f ext3 -r /dev/sda3 -m mbcache:jbd:ext3 -o /boot/initrd.gz
I should also note that you should copy /etc/rc.d/rc.modules-2.6.24.5-smp to /etc/rc.d/rc.modules-2.6.24.5-custom (or omit the dash if it is incorrect).

Looking through the default Slackware configuration, it does indeed look like the dash (-) is needed in LOCALVERSION to get the ideal syntax. You may be able to omit it as described above though. If not, you could recompile with the LOCALVERSION set to "-custom".

Here I am again! By checking into my /lib/modules directory, I see that the name is 2.6.24.5-custom (with the dash). So, based on shadowsnipes set of instructions What should I change and where? (could you please quote that for me?)

I've just tried with (dash included):

mkinitrd -c -k 2.6.24.5-custom -f ext3 -r /dev/sda3 -m mbcache:jbd:ext3 -o /boot/initrd.gz

and then copying:

cp /etc/rc.d/rc.modules-2.6.24.5-smp /etc/rc.d/rc.modules-2.6.24.5-custom

without recompiling. Just wrote the two set of instructions above and restart the computer. The same error messages appear when rebooting.

So, I am sure I am doing something wrong.

Thank you!

reikyv 06-14-2008 09:07 AM

Hi Glore2002,

Actually it is really not that difficult to re-compile your kernel. At least I've tried many times these two days, from the slackware kernel to those vanilla kernel (just pay attention to those instruction you received here, and Alien's wiki page, the steps are actually not much different... and also read those documentations come with your slackware distribution, I am pretty shame that this is my first time that I really study all those documentations, lol).

And I just re-built my laptop to have fully encrypted file system now (although it takes me more than 12 hours to dump my harddisk with /dev/random file ;-p)

Anyway it is awesome now. I pretty enjoying breaking thing. Good luck.

shadowsnipes 06-14-2008 10:45 AM

Quote:

Originally Posted by glore2002 (Post 3184511)
I've just tried with (dash included):

Code:

mkinitrd -c -k 2.6.24.5-custom -f ext3 -r /dev/sda3 -m mbcache:jbd:ext3 -o /boot/initrd.gz
and then copying:

Code:

cp /etc/rc.d/rc.modules-2.6.24.5-smp /etc/rc.d/rc.modules-2.6.24.5-custom
without recompiling. Just wrote the two set of instructions above and restart the computer. The same error messages appear when rebooting.

So, I am sure I am doing something wrong.

Thank you!

As far as I can tell it should be working. Perhaps try running lilo again. This shouldn't matter since your initrd.gz is still in the same location.

Also, make sure rc.modules-2.6.24.5-custom is executable.
Code:

chmod +x /etc/rc.d/rc.modules-2.6.24.5-custom
This shouldn't make a difference as far as getting your root partition to mount, however.

Based on your errors, it is as if either the initrd is not working or you need more/different modules in it.

You are using ext3 for your root file system, right? If not, that is your problem.

Also, verify that
Code:

/lib/modules/2.6.24.5-custom/kernel/fs/ext3/ext3.ko
exists.

Other than that I don't know, as of right now, what needs to be done. Based upon the commands you have run it should be working (assuming your root fs is ext3).

glore2002 06-14-2008 03:34 PM

Almost, almost. We are almost getting it!
 
Well, after checking what Shadowsnipes suggested, I reboot and the same ERROR message appeared. Then (as he also said), I re-run lilo and restart. This was a big change. The booting process didn't show up the message. I was expecting X to start (with a smile on my face)...But it stopped don't letting me press any key. So, I've restarted the computer and change /etc/inittab to boot into command prompt (3) instead of directly into X (4). Then I restarted.

When the system booted up and at the command prompt $ I typed startx and the following error message showed up (I will write down the most important lines):

-------------------------------------------------------------
:
:
Using config file: "/var/log/Xorg.0.log"
Using config file: "/etc/X11/xorg.conf"
Module "ramdac" already built in

FATAL: Module nvidia not found
Nvidia(0): Failed to load Nvidia kernel module!
Nvidia(0) ***Aborting***

Scree(s) found but none have a usable configuration

FATAL server error: no screens found
giving up

:
:
-------------------------------------------------------------

I think we are almost there friends! Just one more help, pleeeeaaaasssseeee :)

Thanks!!!

T3slider 06-14-2008 05:39 PM

You have to rebuild the nvidia module if you compile a kernel. I would suggest using the SlackBuild at slackbuilds.org (if you are already using it, you should probably revert to the old X drivers before recompiling the nVidia module using nvidia-switch).

glore2002 06-14-2008 06:59 PM

Yes, yes yes!!!!!!
 
$>free -m
total used free shared buffers cached
Mem: 4051 283 3768 0 17 163
-/+ buffers/cache: 103 3948
Swap: 0 0 0

Yes! Thanks friends!!! I am running now Slackware 12.1 recognizing my 4Gb RAM.

The last thing I've done is to download the NVIDIA drivers:

wget http://us.download.nvidia.com/XFree8...43.05-pkg1.run

Give it executable permissions:

chmod 777 NVIDIA-Linux-x86-96.43.05-pkg1.run

Installing drivers:

sh NVIDIA-Linux-x86-96.43.05-pkg1.run

I didn't let the installer create a new xorg.conf since I already had one working fine.

Now, my system boots fine. I have to test it but I am sure it works OK (well. It's too soon to say so but I am an optimist :-)

T3Slider
, I've just read your recommendation about installing nvidia driver from slackbuilds.org. You think I should do that or is it the same? You've also mentioned about reverting to the old X drivers. How should I do that?

One more question (Will it be the last one? :-) :

After testing the new kernel compilation. If I see everything works fine How can I get rid of the old kernel files? Would you recommend that to me?

Do these instructions do what I want? (I took this from one of Shadowsnipes previous replies):
cd /usr/src/linux-2.6.24.5-custom
make clean

Thanks to you all! I am very sorry because of the time you spent helping me. I really appreciate what you did and I've learnt a lot from you.

T3slider 06-14-2008 08:03 PM

Quote:

Originally Posted by glore2002
T3Slider, I've just read your recommendation about installing nvidia driver from slackbuilds.org. You think I should do that or is it the same? You've also mentioned about reverting to the old X drivers. How should I do that?

If you've already installed the nVidia drivers the normal way, then don't worry about it. I would normally recommend the SlackBuilds, but it's not worth the effort if you've already let the nVidia installer do its thing.
Quote:

Originally Posted by glore2002
After testing the new kernel compilation. If I see everything works fine How can I get rid of the old kernel files? Would you recommend that to me?

I would recommend leaving the old kernel files alone. They were the default included in Slackware, and there's no harm keeping them around (and if anything goes wrong, you can always revert back to using them).
Quote:

Originally Posted by glore2002
Do these instructions do what I want? (I took this from one of Shadowsnipes previous replies):
cd /usr/src/linux-2.6.24.5-custom
make clean

That would probably be a bad thing. That would clean up your current kernel source directory. Some applications (mostly those that inject out of tree modules into your system) may need the kernel sources to compile. You should leave them alone. If you REALLY get strapped for hard drive space, you may be able to delete the /usr/src/linux-2.6.24.5/ directory (or uninstall the kernel-source-2.6.24.5_smp-noarch-2.tgz package), but I would not recommend it under normal circumstances.

glore2002 06-14-2008 08:35 PM

OK. Solved!
 
OK T3slider, I'll leave everything the way it is. It will be safer, you're right.

The only thing I will do is comment those lines in lilo since I don't need them anymore (but this is just a detail). Thank you! :)

Thanks to all of you who help during this thread.

Glore2002.-

GrapefruiTgirl 06-14-2008 11:18 PM

Gotta like it, seeing someone stick with it till the happy ending; congrats Glore ;)

Sasha

PS -
Quote:

Originally Posted by Glore2000
Thanks to you all! I am very sorry because of the time you spent helping me. I really appreciate what you did and I've learnt a lot from you.

That's what the forum is all about!


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