This is a discussion on Newbie and Kernel within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> On 2004-10-05, Bill Holt <bill@itsound.demon.co.uk> wrote: > I'm trying to work way beyond my knowledge or ability, so please ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| On 2004-10-05, Bill Holt <bill@itsound.demon.co.uk> wrote: > I'm trying to work way beyond my knowledge or ability, so please be > gentle. > > Have installed Slackware 10 with 2.4.26 and want to try building and > perhaps installing a different kernel with the eventual aim of making a > Disk-On-Chip work. My first attempt has (as expected) failed. > > In the Slackware book, Chap 4, I have reached > > # make mrproper Here's a tidbit for you. IIRC, mrproper is a European version of clean. Consider the consumer detergent "Mr. Clean": I'm told that in Europe, the gentleman with bald head and bulging biceps is called "Mr. Proper". > What does this actually do? I read that it brings the kernel source into > its base state, but don't know what this means. Base state here means just that: no application specific material. That means no object code and no configuration files. 'make clean' gets rid of object code, but retains configuration files. > From KDE, I've tried to find a file called mrproper, but nothing comes > up. If you look in the Makefiles, it is a function that can be called by the automake utility, so is not a file in its own right. Type this: grep -n mrproper /usr/src/linux/Makefile What this does is use the old UNIX utility 'grep' (global regular expression print) with the -n option (add line numbers) to find all instances of "mrproper" in that file. Then, type: cat -n /usr/src/linux/Makefile Look up each of the 'grep' references to see what the Makefile has 'automake' do when 'make' is used with the 'mrproper' option. Having done this, you will discover that you have just acquired a very potent learning tool: grep. Read the 'man' file about 'grep' and learn all the ways it can serve you... <grin> > In the initial installation, I said 'Install All'. *nix is case sensitive. Watch the upper case letter usage... > Before this, I am told to go to /usr/src/linux ..... Is this correct > or should I start in /usr/src/linux-2.4.26 ? What kernel do you intend to build? I'm running 2.6.7 at the moment and it's quite nice. It does some things differently from the way the 2.4 kernels function, though. Does have some new functionality you might want to explore. In general, if you want to rebuild your kernel as it, all you need is a new configuration file, which you should keep separate for insurance. Find the current configuration file at /usr/src/linux/.config (note that this is a 'dot' file). If you reconfigure your kernel, the new configuration will appear here. Incidentally, the default configuration can be found at /usr/src/linux/arch/i385/defconfig. This is *not* the old config file, it is the original one, which IIRC will stay with the kernel even when 'make mrproper' is invoked. You can keep configuration files in /boot. You will find a copy of the current one there. When you rebuild the kernel, move that one to config.old or the like and you'll always have a reference. Then to see what has been changed, type: diff config config.old. On the other hand, if you want to build a new kernel, like 2.6.x, download it and put it in /usr/src in its own directory, named "linux-2.6.x". You'll need to be root to build there, of course, but the kernel source will be in it's proper place in your file system. Read the upper case files (README and INSTALL), and follow the directions. Probably the most important thing you can do when building new kernels is to spend the time to understand kernel configuration. Read the help files. When in doubt, at least include as a module: inserting a module is far easier than recompiling the kernel! Well, that's probably the second most important thing to do. Actually, the most important thing is to make sure you can boot to the working kernel. In other words, do *not* simply install the new kernel and let it go at that. Make sure that 'make install' will move the current files to *.old or something like. Better is to do it oneself, I think! Then: make *sure* you add a stanza for the new kernel in your boot loader! A stanza for both kernels should be there and should show up as options at boot time! For grub, edit /boot/grub/menu.lst. For lilo, do the equivalent, but make sure to rerun 'lilo' so that it will take effect. That way, if the new build does weird things, just reboot to the old one. Enjoy! -- Email is wtallman at olypen dot com |
| |||
| Bill Holt wrote: > The Slackware.com 'book' says to: > > # make mrproper > # make config > # make dep > # make clean > > and then compile In theory, these instructions will work, but will require you to: 1. Rebuild your entire kernel configuration from scratch 2. Use a text-based interaction to include or disclude each and every kernel configuration option > so I now need to understand about what exactly these commands are > blowing away. "make clean" blows away stale object files from a previous compile. These are sort of temporary files that are later used to build the actual working kernel. "make mrproper" blows away your kernel configuration. "make config" creates your kernel configuration (arduously) "make dep" builds module dependencies based on your kernel configuration. It is necessary for a 2.4 series kernel, but not for a 2.6 series kernel. > Are log files produced by these operations? If so where? None that I know of. Imagine this: you want to take a standard Slackware kernel and add just one thing to it ... say, SMP support. After installing the kernel source for the first time, you skip "make mrproper" because there is no kernel configuration to blow away. Then you copy the config file for Slackware's bare.i kernel into the kernel source tree (to /usr/src/linux/.config). Now you have a default configuration ready to go. If you ran "make mrproper" now, the configuration you copied into the kernel source tree would be wiped out! Instead of "make config", you use "make menuconfig", which, being menu driven, allows you to skip right to the one extra option you need. After enabling the option for SMP, you exit menuconfig, and move on to "make dep" if you have a 2.4 kernel, or right to "make bzImage" if you have a 2.6 kernel, skipping "make clean" because there are no stale object files in a brand new kernel source tree. The next time you go to add something, you will probably want to skip "make mrproper" again, so you don't blow away your previous configuration work. However, you may want to run "make clean" this time before running "make bzImage", to ensure that the kernel build is internally consistent. Jeffrey |
| ||||
| "Bill Holt" typed: > Ayaz Ahmed Khan writes >> >> There's a nice kernel HOWTO in /usr/doc/Linux-HOWTOs called >> Kernel-HOWTO, >> >> /usr/doc/Linux-HOWTOs/Kernel-HOWTO >> >> which I read and followed carefully, and successfully recompiled a >> kernel on my desktop machine for the first time two-to-three days >> ago. You might want to have a look at it. > > Hmm... I find KernelAnalysis-HOWTO there but not the one you mention. > Again a search finds nothing of that name on the machine. I have the following `Kernel*' HOWTOs on my Slackware-9.1 system: $ ls -l /usr/doc/Linux-HOWTOs/Kernel* -rw-r--r-- 1 root root 166451 Aug 19 2003 /usr/doc/Linux-HOWTOs/Kernel-HOWTO -rw-r--r-- 1 root root 112317 Mar 28 2003 /usr/doc/Linux-HOWTOs/KernelAnalysis-HOWTO -rw-r--r-- 1 root root 41716 May 22 2000 /usr/doc/Linux-HOWTOs/Kerneld > I am looking at the Kernel Rebuild HOWTO on > > http://www.digitalhermit.com/linux/K...ild-HOWTO.html > > in conjunction with the Slackware docs that I've found You can find `Kernel-HOWTO' by searching for ``The Linux Kernel HOWTO'' by Al Dev (Alavoor Vasudevan) at <http://www.linuxdoc.org>. -- Ayaz Ahmed Khan, <http://fast-ce.org/linux> "This is Linux Country. On a quiet night, you can hear NT reboot." |