LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Where to start with the kernel?? (https://www.linuxquestions.org/questions/linux-newbie-8/where-to-start-with-the-kernel-92672/)

rberry88 09-14-2003 10:04 AM

Where to start with the kernel??
 
I have a fresh install of SuSE 8.2 Personal, mainly because I messed up the compiling of a new kernel on my last installation and figured it was a fun learning experience but want to do it right this time.

Here is what I get when I do uname -a and ls -alc, what would be a good recommendation on how to proceed.

------------------------------
linuxxp:/home/rberry88 # uname -a
Linux linuxxp 2.4.20-4GB-athlon #1 Wed Aug 6 18:27:52 UTC 2003 i686 unknown unknown GNU/Linux
linuxxp:/home/rberry88 # uname -r
2.4.20-4GB-athlon
linuxxp:/home/rberry88 # cd /usr/src
linuxxp:/usr/src # ls
. .. packages
linuxxp:/usr/src # ls -alc
total 0
drwxr-xr-x 3 root root 72 2003-09-14 02:46 .
drwxr-xr-x 12 root root 344 2003-09-14 02:50 ..
drwxr-xr-x 7 root root 168 2003-09-14 02:50 packages
linuxxp:/usr/src #
-------------------------------------------

Any advice??

rberry88
:newbie:

druuna 09-14-2003 10:33 AM

One thing you must do is to make sure that you can always boot the 'previous' kernel in case something goes wrong with the kernel you are working on:

-Making sure you can boot previous, working kernel-

In /boot there should be, among other files, a vmlinuz and a System.map.<number><name>

copy these to vmlinuz.working and System.map.working ('working' is just an example).

If you use grub (suse 8.2 standard) you also need to add this new bootoption in /boot/grub/menu.lst

If you decided to use lilo instead of grub add the extra bootoption in /etc/lilo.conf and run /sbin/lilo to activate.

During reboot there will be an extra option which allows you to boot the 'working' (=previous) kernel.

-New Kernel-

Depending on your own whishes you can do one of the following things:

1) Get a fresh, newer (newest??) kernel from www.kernel.org, untar this in /usr/src

link linux to linux-2.x.y (ln -s linux-2.x.y linux)

You might need to rename /usr/src/linux to /usr/src/linux-2.x.y first.

2) If you like to work on the kernel that Suse provided. Get it of one of the cd's [kernel-source -> The sources of the SuSE kernel] and install it.

Always check the following line in /usr/src/linux/Makefile

export INSTALL_PATH=/boot

If this line is commented out, uncomment it.

If you don't your compiled stuff will be put in / and not in /boot !!

rberry88 09-14-2003 10:38 AM

Thanks for getting me started but I have one question before I get too far. I currently don't have a directory in /usr/src/ named linux, should I make one before do anything or will the kernel automatically make a directory??

rberry88

druuna 09-14-2003 10:49 AM

Nope, you don't. Just untar the kernel in /usr/src. There's going to be a new directory in /usr/src. Rename this to kernel-2.x.y (might already have this name) and link this to linux:

cd /usr/src
ln -s kernel-2.x.y linux

And if you are realy new at this stuff, please read the chapters concerning The Linux Kernel (Suse Linux Admin guide [chapter 11 in 8.1 book]).

Or read the HOWTO:
www.tldp.org/HOWTO/Kernel-HOWTO/

Or the smaller very general 'quick-steps':
http://home.frognet.net/~aalug/docs/kernel_comp/

Or, right here at LinuxQuestions.org:
http://www.linuxquestions.org/questi...355#post379355

rberry88 09-14-2003 11:01 AM

Thanks for the quick reply, I think I have enough info to get my hands dirty.

rberry88

vasudevadas 09-14-2003 11:15 AM

One thing I found that is helpful, before you "make menuconfig", look in /boot for some config files. Copy the one that seems most appropriate into your /usr/src/linux directory as .config:

cp /boot/<config file> /usr/src/linux/.config

and then make whatever changes are necessary in menuconfig. I found this useful because if I started afresh with no .config file then the one I subsequently created with menuconfig usually didn't work.

druuna 09-14-2003 11:24 AM

@vasudevadas

Sorry, but this is not the way to do it. Here's a part from the kernel README:

CONFIGURING the kernel:

- Do a "make config" to configure the basic kernel. "make config" needs
bash to work: it will search for bash in $BASH, /bin/bash and /bin/sh
(in that order), so one of those must be correct for it to work.

Do not skip this step even if you are only upgrading one minor
version. New configuration options are added in each release, and
odd problems will turn up if the configuration files are not set up
as expected. If you want to carry your existing configuration to a
new version with minimal work, use "make oldconfig", which will
only ask you for the answers to new questions.

You do need to copy your old config file (/boot/vmlinux.config or /usr/src/linux-2.x.y/.config) to the new location (/usr/src/linux/.config).

vasudevadas 09-14-2003 11:30 AM

Oh well, it was the way I did it anyway. If you've never compiled a kernel on that machine before then you're not going to have a .config file around to carry over your configuration from - in that case you *are* going to have to specify everything yourself, which is what caused me problems. Taking an existing configuration file means you start with a configuration that works and modify it as you wish. Rberry, if you feel doubts about my advice you'd best ignore what I just said.

By the way, isn't using "make config" a fairly prehistoric way of configuring your kernel? "make menuconfig" (requires ncurses to be installed) gives you a friendlier menu-driven method, there is also "make xconfig" which gives you a gui-driven method.


All times are GMT -5. The time now is 08:26 PM.