LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-11-2008, 10:55 AM   #16
glore2002
Member
 
Registered: Mar 2007
Location: Buenos Aires, Argentina.
Distribution: Lubuntu 17.10 x64
Posts: 510

Original Poster
Rep: Reputation: 33
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!
 
Old 06-11-2008, 01:31 PM   #17
wadsworth
Member
 
Registered: Aug 2007
Distribution: Slackware64 13.37
Posts: 215

Rep: Reputation: 65
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

Last edited by wadsworth; 05-08-2009 at 08:00 PM.
 
Old 06-12-2008, 12:28 AM   #18
shadowsnipes
Senior Member
 
Registered: Sep 2005
Distribution: Slackware
Posts: 1,443

Rep: Reputation: 73
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.
 
Old 06-12-2008, 02:20 AM   #19
reikyv
Member
 
Registered: Oct 2007
Location: Malaysia
Distribution: Slackware
Posts: 80

Rep: Reputation: 15
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!
 
Old 06-12-2008, 04:16 AM   #20
glore2002
Member
 
Registered: Mar 2007
Location: Buenos Aires, Argentina.
Distribution: Lubuntu 17.10 x64
Posts: 510

Original Poster
Rep: Reputation: 33
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.-
 
Old 06-12-2008, 05:22 AM   #21
reikyv
Member
 
Registered: Oct 2007
Location: Malaysia
Distribution: Slackware
Posts: 80

Rep: Reputation: 15
Quote:
Originally Posted by glore2002 View Post
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!
 
Old 06-12-2008, 10:08 AM   #22
shadowsnipes
Senior Member
 
Registered: Sep 2005
Distribution: Slackware
Posts: 1,443

Rep: Reputation: 73
Quote:
Originally Posted by reikyv View Post
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.
 
Old 06-12-2008, 10:39 AM   #23
glore2002
Member
 
Registered: Mar 2007
Location: Buenos Aires, Argentina.
Distribution: Lubuntu 17.10 x64
Posts: 510

Original Poster
Rep: Reputation: 33
Thank you!!!!

I will try this as soon as I get home tonight and will tell you what happened.

Thanks friends.
 
Old 06-12-2008, 10:40 AM   #24
shadowsnipes
Senior Member
 
Registered: Sep 2005
Distribution: Slackware
Posts: 1,443

Rep: Reputation: 73
As Pat says, "Have fun!"
 
Old 06-12-2008, 04:36 PM   #25
glore2002
Member
 
Registered: Mar 2007
Location: Buenos Aires, Argentina.
Distribution: Lubuntu 17.10 x64
Posts: 510

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by shadowsnipes View Post
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.-
 
Old 06-12-2008, 08:05 PM   #26
reikyv
Member
 
Registered: Oct 2007
Location: Malaysia
Distribution: Slackware
Posts: 80

Rep: Reputation: 15
Quote:
Originally Posted by shadowsnipes View Post
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.
 
Old 06-12-2008, 09:42 PM   #27
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
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.
 
Old 06-12-2008, 11:00 PM   #28
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
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.
 
Old 06-12-2008, 11:19 PM   #29
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
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.

Last edited by T3slider; 06-12-2008 at 11:40 PM.
 
Old 06-13-2008, 12:15 AM   #30
shadowsnipes
Senior Member
 
Registered: Sep 2005
Distribution: Slackware
Posts: 1,443

Rep: Reputation: 73
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.
 
  


Reply

Tags
can, data, get, help, how, installing, ubuntu



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
AS 2.1 Not showing full ram rashid68 Linux - Server 4 07-13-2007 03:24 PM
RAM becomes full izvrashenj Debian 5 07-20-2006 11:57 AM
Top not reporting full ram satinet Linux - Hardware 5 02-05-2006 03:28 PM
Slackware Linux RAM/Memory Issues Darvocet Slackware 6 05-25-2005 03:16 PM
RAM seems very full? ginda Linux - Newbie 12 03-07-2005 10:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration