SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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
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, 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.
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
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.
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.
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?
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.