Talkback for article: 252, July2002

Compile your own Linux kernel

Back to: http://cgi.linuxfocus.org/English/July2002/article252.shtml

From: Philip de Groot (original author) <philipg(at)authors.linuxfocus.org> [ date: 2002-07-04 ]
Hello, Any remark, comment, additional information, and so on is welcome, so please let me know if you have something to mention. If I can collect enough issues, I might consider writing a follow-up paper on this subject. And to be honest: this should't be to hard for a delicate subject like compiling a Linux kernel! Is it? Regards, Philip de Groot
From: guido socher [ date: 2002-07-17 ]
The easiset way to just try a newly compiled kernel is actually
to copy it raw to a 1.44 MB diskette with the command

dd if=/usr/src/linux/arch/i386/boot/bzImage of=/dev/fd0

After that install the modules and just boot. If the
Kernel has a problem remove the floppy and reboot again. Now
you are back to your old system.

From: Brad Metziner [ date: 2002-08-08 ]
Overall, a very well written article. I've used it to compile my first kernel. Thanks!
From: Irwin Hutchinson <ihutch(at)operamail.com> [ date: 2002-08-22 ]
I tried this using an xterm window in KDE and got an error message shortly after starting. I do not have the error message to hand but it mentioned that it could not find "buttons", It also mentioned something about access to 0.0 or something like that.
My question is, should you try this in text mode. I have a pentium2 running Suse 8.
From: Anonymous User [ date: 2002-08-23 ]
Hello Irwin,

Those are very vague error messages! No, it can be done in KDE (or a console if you like to). The error message about 'buttons' is vey weird: it has nothing to do with compiling a kernel. I guess that you have not installed the Tk/Tck utilities that are required to get 'xconfig' properly running. Have you (re)installed in lx_suse kernel using YaST2 and are all dependencies OK? Giving some more information is necessary to give you some more information!

Regards, Philip
From: Irwin Hutchinson <ihutch(at)operamail.com> [ date: 2002-08-24 ]
Thanks Anonymous User.
I have the Tk/Tck installed. Are there extra utilities I need? Below is the complete output from my attempt to compile the kernel.

linux:/usr/src/linux-2.4.18cam # make xconfig
rm -f include/asm
( cd include ; ln -sf asm-i386 asm)
make -C scripts kconfig.tk
make[1]: Entering directory `/usr/src/linux-2.4.18cam/scripts'
gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -c -o tkparse.o tkparse.c
gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -c -o tkcond.o tkcond.c
gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -c -o tkgen.o tkgen.c
gcc -o tkparse tkparse.o tkcond.o tkgen.o
cat header.tk >> ./kconfig.tk
./tkparse < ../arch/i386/config.in >> kconfig.tk
echo "set defaults \"arch/i386/defconfig\"" >> kconfig.tk
echo "set ARCH \"i386\"" >> kconfig.tk
cat tail.tk >> kconfig.tk
chmod 755 kconfig.tk
make[1]: Leaving directory `/usr/src/linux-2.4.18cam/scripts'
wish -f scripts/kconfig.tk
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

Application initialization failed: couldn't connect to display ":0.0"
Error in startup script: invalid command name "button"
while executing
"button .ref"
(file "scripts/kconfig.tk" line 51)
make: *** [xconfig] Error 1

Irin Hutchinson
From: Philip de Groot (original author) <philipg(at)authors.linuxfocus.org> [ date: 2002-08-25 ]
Hello Irin,

I think that I found the problem. You did not log in as root in xwindows (at the graphical login prompt), did you? I guess that you did a 'su' and started 'make xconfig'. However, 'su' does not know how to handle graphical events (it is simply not supported). A work around is to use 'ssh', e.g. using the command: 'ssh -X -l root localhost'. The option '-X' tells 'ssh' to enable graphical events from your 'root' account, so a window with the 'xconfig' configuration can be opened.

I hope that this will solve your problem. Success, Philip de Groot
From: guido [ date: 2002-08-25 ]
Hello Philip and Irwin,
I am following your discussion about the "make xconifg".

The solution is probably very simple. Xwindows does not allow
just anybody to draw graphics on your screen.
(see http://linuxfocus.org/English/January2002/article222.shtml )

To enable that you do:
enable xhost access:
xhost +
become root:
su -
run xconfig:
cd /usr/src/linux
make xconfig

If it still does not work try:
DISPLAY=127.0.0.1:0.0
export DISPLAY
make xconfig

Regards
Guido

From: Irwin Hutchinson <ihutch(at)operamail.com> [ date: 2002-08-26 ]
Thanks Philip and Guido, I logged on as root and all went well.
I have one further question though before I do a kernel compile for real. (I have been practicing on an old machine for saftey, so far.)
My question is, If I am just re-compiling my old kernel, which is all I really need to do as I am just trying to get my Dimage 5 camera to download pictures, can I accept the settings that are already on the xconfig screens, apart, of course, from ones I need to change to get my camera working?
Thanks again
Irwin
From: Philip de Groot (original author) <philipg(at)authors.linuxfocus.org> [ date: 2002-08-27 ]
Hello Irwin,

In the kernel source directory of SuSe is already a '.config' file available. The settings are such that it most of the times can be used without a problem, but it can't hurt to check and consider al settings carefully (and perhaps to experiment a little bit with it). My experience is that, usually, to many options that are not in use are turned on. As pointed out in my article abd in top of this talkback page, it is possible to test a new kernel without removing the original one! So you can perform tests without any risk!

Success, Philip
From: Xianghao <happyhao(at)sohu.com> [ date: 2002-09-02 ]
Thank you very much!
From: Robert Jing <jingyinan(at)sina.com> [ date: 2002-09-04 ]
Thanks Philip, this article is extremely useful. Following this article, I successfully upgraded my RedHat Linux's 2.4.18 kernel to 2.5.33 this morning. However, some words I have to say about the development kernel, they are terrible for linux newbies like me, the compilation process failed at least 5 times. I have to modify my configuration each time it failed. For my computer, I cannot to set NTFS and APM as modules, neither can I use Framebuffer for my SiS 630 chipsets. Anyway I finally made it, thank you for your help.

There is another problem hanging around my mind, I can't set vga=773 or xxx on my grub.conf for my new 2.5.33 kernel. The screen just totally blacked out if use vga=xxx. However, this configuration works fine for my original RedHat 2.4.18-3 kernel, and on the top of this starting page, I can even see the RedHat banner. Do you know what shall I do to adjust my console screen resolution?

Btw, I find many other files that comes with RedHat 7.3's /boot directory.
They are module-info-2.4.18-2, config-2.4.18-3, message, message.ja, chain.b,boot.b,kernel.h. Can you tell what they are used for and how I can generate them for my 2.5.33 kernel? Thank you so much.
From: Philip de Groot (original author) <philipg(at)authors.linuxfocus.org> [ date: 2002-09-11 ]
Hello Robert, The 2.5.x kernel series is highly experimental! This is the reason why not all configuration options can work properly together and e.g. NTFS is not avalable as a module! Concerning the VGA-options, it is just possible that, internally, things have changed and that grub is not capable to handle that; try to stick on the safe 2.4.x. kernel-series. Most distributions cannot handle the 2.5.x kernels properly!!! Sticking on the stable series will prevent quite a lot of problems. Note that many options that are available in the experimental kernel will never make it to the stable-series (and there is good reason for that)! I do not know the meaning of all the files in your /boot-directory, but for some I do. 'config-2.4.18-3' is the '.config' file that is supplied by redhat for your standard 2.4.18-kernel. For 'module-info-2.4.18-2' something similar is going on, but I do not know precisely how to interpret this file. 'message' can be somethings as a picture that is displayer by grub during boot (i am not sure about that!) and the other files are probably also related somehow with grub, I suspect. Just take a look and find out for yourself! Regards, Philip
From: Irwin Hutchinson <ihutch(at)operamail.com> [ date: 2002-10-25 ]
Hi Philip,
I am still trying to compile a kernel for use of my Dimage 5 camera. I have not
done anything for a couple of months as I was hit by a car while out cycling and
have been in hospital with a broken hip.
I am now using Suse 8.1 and used the kernel source from the disks which I
renamed linux-2.4.19-cam. I followed all the directions and all seemed to go
well until I went to start the new kernel. I clicked on linuxcam, which was what
I had put in Lilo for the name of the new kernel and it went fine for a bit,
exept that it ran in a "DOS" like type not the usual Suse type. Then it stopped
with a kernel panic. The last 3 lines were as follows:-
NET4: Unix domain sockets 1.0/smp for linux NET4.0
ds: no socket drivers loaded!
kernel panic: vfs: unable to mount root fs on 03:08 .
What have I done wrong?
Please help.
Irwin Hutchinson
From: Philip de Groot (original author) <philipg(at)authors.linuxfocus.org> [ date: 2002-10-31 ]
Hello Irwin,

I hope your hip is better now. Unfortunately, these things do happen... About your problem: the linux kernel cannot determine your root-partition. Probably, you did not compile-in support for ext2 (or whatever filesystem you have on your /-partition) solid in the kernel (and NOT as module). That linux boots in a DOS-like shell is normal. After proper booting of the kernel, the graphical environment is executed automatically.

Regards, Philip
From: jill <jill(at)xteamlinux.com.cn> [ date: 2002-11-11 ]
I can compile kernel, but when diskless system start, it always report "can't open /dev/fb0", it seems that the kernel do not support framebuffer, how can i get a kernel which supports framebuffer.
From: Philip de Groot (original author) <philipg(at)authors.linuxfocus.org> [ date: 2002-11-12 ]
Hello Jill, Support from the framebuffer is experimental and can be found in the section 'console drivers' from the main configuration window. Note that you need to enable 'Code maturity level options' (first section in the main configuration window) in order to select this experimental code. Success, Philip
From: Subhasish Ghosh <subhasish(at)mail.ru> [ date: 2002-11-19 ]
An excellent article overall. Thanks for the good work.
From: jcnet <wusheets(at)sina.com> [ date: 2002-11-22 ]
Thanks Philip, I have a question. I used blackbox on mandrake9 and logged on ar root,but when "make xconfig" I got a error as below:
[root@jcnet linux-2.4.19]# make xconfig
rm -f include/asm
( cd include ; ln -sf asm-i386 asm)
make -C scripts kconfig.tk
make[1]: Entering directory `/usr/src/kernels/linux-2.4.19/scripts'
gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -c -o tkparse.o tkparse.cgcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -c -o tkcond.o tkcond.c
gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -c -o tkgen.o tkgen.c
gcc -o tkparse tkparse.o tkcond.o tkgen.o
cat header.tk >> ./kconfig.tk
./tkparse < ../arch/i386/config.in >> kconfig.tk
echo "set defaults \"arch/i386/defconfig\"" >> kconfig.tk
echo "set ARCH \"i386\"" >> kconfig.tk
cat tail.tk >> kconfig.tk
chmod 755 kconfig.tk
make[1]: Leaving directory `/usr/src/kernels/linux-2.4.19/scripts'
wish -f scripts/kconfig.tk
?make: *** [xconfig] Error 1

And I have installed Tk/Tck already.

From: Philip de Groot (original author) <philipg(at)authors.linuxfocus.org> [ date: 2002-11-25 ]
Hello, you do not only need Tk, but also Tcl (I guess). Install Tcl and try if it works... Regards, Philip
From: Tu Ha <nwbie2000(at)yahoo.com> [ date: 2002-11-26 ]
please help me.
I have recompiled the kernel 2.4.18-3, but not succeeded.
first, I tried "make menuconfig" to create .config . I did not modify any thing in this menu.
next, I tried "make dep"
end then, "make bzImage". Every thing was ok.
then, I copyed the file bzImage to /boot
finally, I edited /etc/lilo.conf and run "lilo"
when I reboot the host and choose my new kernel, I receive error messages and stuck forever.
.....
kmod: failed to exec /sbin/modprobe -s -k block-major-8, errno = 2
VFS: Cannot open root device "802" or 08:02
Please append a correct "root=" boot option
Kernel panic: VFS: Unable to mount root fs on 08:02

how come? How can I correct this error?
thanks in advance.
From: Philip de Groot (original author) <philipg(at)authors.linuxfocus.org> [ date: 2002-11-27 ]
Hello, just running menuconfig to obtain a .config file, thus WITHOUT specifying settings that are specific for your machine, won't work. Your configuration is guessed by some prior settings in menuconfig and definitely not good! Use 'make xconfig' as I have told you in my paper and make the good selections. Off course, you're root filesystem should be compiled-in solid in the kernel (which is the reason for the errors you present here)! Regards, Philip
From: jcnet <wusheets(at)sina.com> [ date: 2002-12-02 ]
hi,Philip.
I installed Tcl and try "make xconfig" again, and got the error message as before.
From: Philip de Groot (original author) <philipg(at)authors.linuxfocus.org> [ date: 2002-12-05 ]
Hello, something is definetely wrong with your Tcl installation. Perhaps this FAQ can help you: http://www.neosoft.com/tcl/tclhtml/tclFAQ/part1/faq.html If not, you can try the text oriented kernel-configuration program with 'make menuconfig'. It is the same as 'make xconfig', but far less user friendly... Good Luck, Philip
From: Abu <abu_a_m(at)yahoo.com> [ date: 2004-02-09 ]
Hi,

I have not yet completely gone through your article. But I am faced with problem. My system config is as follows.
AMD Duron 1.2 GHz,256 MB DDR SD RAM, nForce MB with integrated audio and graphics. I am running RedHat Linux 9.0 (Kernel 2.4.x). I was not able to use my motorola sm56 internal modem. So I recompiled my kernel with ppp support and now I could use my modem. But I can't get my soundcard working. It worked before the recompile. Now when I run alsamixer it says it can't find the default device and snd_ctl_open failed message is displayed. Can you send me some info on this
Abu
From: danny <stateboi(at)yahoo.com> [ date: 2004-03-06 ]
when I run loadlin bzimage, the system restarts... do you have any idea why?
From: A query <sunilks(at)iitg.ernet.in> [ date: 2004-06-22 ]
I had tried to install a patch and recompile the kernel.
But when I reboot I get the following error message and it gets stuck
ds:no socket drivers loaded
vfs:Cannot open root device "LABEL=/" on 00:00
Please append a "root=" option
Kernal panic:VFS:Unable to mount root fs on 00:00

My grub.conf file :
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,0)
# kernel /boot/vmlinuz-version ro root=/dev/hda1
# initrd /boot/initrd-version.img
#boot=/dev/hda
default=1
timeout=10
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title Fedora Core (2.4.22MobileIPV6)
root (hd0,0)
kernel /boot/vmlinuz-2.4.22MobileIPV6 ro root=LABEL=/ rhgb
initrd /boot/initrd-2.4.22MobileIPV6.img
title Fedora Core (2.4.22-1.2115.nptl)
root (hd0,0)
kernel /boot/vmlinuz-2.4.22-1.2115.nptl ro root=LABEL=/ rhgb
initrd /boot/initrd-2.4.22-1.2115.nptl.img
title DOS
rootnoverify (hd0,2)
chainloader +1

From: Ketty <kettysalinasa(at)yahoo.com> [ date: 2004-10-01 ]
Hi, Congratulations. It's extraordinary . I am from Peru and then I don't speak english very well but i want to say CONGRATULATIONS Y MANY THANKS.
can you give me idea for my thesis at university? i am a student of systems ingeneer and linux is new here so i like to learn Linux.
Thank you again.


From: Peter Hamers <hamers.p(at)home.nl> [ date: 2004-10-20 ]
When I start make xconfig I get this message.
Unable to find the QT installation. Please make sure that the
* QT development package is correctly installed and the QTDIR
* environment variable is set to the correct location.
Sorry to bother you with this but I.m new to linux.
System is fedora core 2 whats wrong here?
thks in advance for helping.
From: Maxei <maxei_95()yahoo.ca> [ date: 2005-01-10 ]
I want to install linux on an old PC (Intel 486SX without math coprocessor) but all distros cannot be installed in it, because they have been compiled without math emulator support. How can I compile the kernel with specifications for this old PC but using a modern computer (which runs Mandrake 10.1 on AMD AThlon 1.4)? Which are the sequence of events to do and where I should save the compiled kernel WITHOUT spoiling my setings? Finally, how can I transplant the compiled kernel if the old computer has only Windows 3.11 installed (and DOS)? Is that possible? I want to know if I can rescue that old hardware and to test what lot of Linux freaks repeat like parrots: 'Linux supports old stuff'. Really? Please show me if that is possible these days (C'mon the old guys used to do that back in 1990s dont they?)
From: dupeng <dupeng144(at)163.com> [ date: 2006-04-07 ]
I am a china,I very Linux.I have some question.---thanks

From: ted <titantxg(at)163.c0m> [ date: 2006-10-07 ]
I transfer linux-2.6.18 on an ARM board, and compiling is ok, but has a boot error "Id "1" respawning too fast: disabled for 5 minutes" at the last step. I think this error is related to the kernel config, but never find the reason.Thanks for your help!

32 talkbacks in English
Other talkbacks:   Francais




Due to the increased amount of web spam we have deciced to removed the talkback posting possibility. You can read old talkbacks but you can no longer post new ones.

Back to http://cgi.linuxfocus.org/English/July2002/article252.shtml

Please contact webmaster(at)linuxfocus.org if you have any questions with regards to this talkback

lftalkback version 3.10