Click to See Complete Forum and Search --> : How to compile a Kernel? Total n00b...
raid517
01-06-2003, 12:43 AM
Hi well fro reading around I managed to gather all of the commands I need to build a new kernel in a single place. Its pretty much all just cut and paste, so it went more or less without a hitch...
bash# make xconfig
bash# make dep
bash# make clean
bash# make bzImage
bash# make modules
bash# make modules_install
bash# make install
bash# gedit /etc/lilo.conf
bash# lilo
But Im stuck on the last two parts I don't know how to edit lilo to make the new kernel I created bootable. I am a complete n00b at all this so I still find some of the language very confusing.....
I need to know what I should write (in plain English) to edit my lilo.conf file - as I'm completely clueless about what this next step entails.
Anyway here is the list of contents of my /boot directory after all processes are complete:
[root@localhost boot]# dir
boot.2100
config
config-2.4.19
config-2.4.19-16mdk
config-2.4.19-16mdksmp
grub
initrd-2.4.19-16mdk.img
initrd-2.4.19-16mdksmp.img
initrd-2.4.19.img
initrd.img
initrd-smp.img
kernel.h
kernel.h-2.4.19-16mdksmp
map
message
message-graphic
message-text
System.map
System.map-2.4.19
System.map-2.4.19-16mdk
System.map-2.4.19-16mdksmpuk.klt
vmlinuz
vmlinuz-2.4.19
vmlinuz-2.4.19-16mdk
vmlinuz-2.4.19-16mdksmp
vmlinuz.old
vmlinuz-smp
[root@localhost boot]#
And here is the present layout of my lilo.conf file. What I need to know in as clear and simple language as possible what it is I have to do, or write next... I do understand how to run the lilo command - its just lilo - so I shouldn't imagine I will get many problems after this...
boot=/dev/hde
map=/boot/map
default=linux-smp
keytable=/boot/uk.klt
prompt
nowarn
timeout=100
message=/boot/message
menu-scheme=wb:bw:wb:bw
ignore-table
disk=/dev/hde bios=0x80
image=/boot/vmlinuz
label=linux
root=/dev/hdf1
initrd=/boot/initrd.img
append="devfs=mount hda=ide-scsi hdc=ide-scsi quiet"
vga=788
read-only
image=/boot/vmlinuz
label=linux-nonfb
root=/dev/hdf1
initrd=/boot/initrd.img
append="devfs=mount hda=ide-scsi hdc=ide-scsi"
read-only
image=/boot/vmlinuz-smp
label=linux-smp
root=/dev/hdf1
initrd=/boot/initrd-smp.img
append="devfs=mount hda=ide-scsi hdc=ide-scsi"
read-only
image=/boot/vmlinuz
label=failsafe
root=/dev/hdf1
initrd=/boot/initrd.img
append="devfs=nomount hda=ide-scsi hdc=ide-scsi failsafe"
read-only
other=/dev/hde1
label=NT
table=/dev/hde
other=/dev/fd0
label=floppy
unsafe
image=/boot/vmlinuz-2.4.19
label=2419
root=/dev/hdf1
read-only
optional
vga=788
append=" devfs=mount hda=ide-scsi hdc=ide-scsi"
initrd=/boot/initrd-2.4.19.img
Any suggestions anyone can offer are very welcome. Please remember though that I have never done anything like this before, so if you can avoid using confusing terms or technical jargon I would be extremely grateful... :)
Q
rid3r
01-06-2003, 12:56 AM
which distro are you using :)
# ls -l /boot
-- see what your vmlinuz points to
compare to what your /usr/src/linux[-2.4]/Makefile says.
# cd /usr/src/linux[-2.4]
# cat Makefile
look for:
$EXTRAVERSION = [what_you_compiled]
# ls /lib/modules --- modules 2.4.18-[?] and 2.4.18[what_you_compiled]
raid517
01-06-2003, 01:17 AM
Originally posted by rid3r
which distro are you using :)
# ls -l /boot
-- see what your vmlinuz points to
Mmm already I'm getting lost a bit in the lingo... vmlinuz #ls -l/boot. What is that? As for what linux version I'm running it is Mandrake 9.0 - but I downloaded the kernel from the official kernel home page.
All the information I have on my present configuration and lilo are listed above. All I need to know is what in plain simple non-technical English terms I should write to make my kernel bootable?
It seems to be a shame to have got this far and be stuck on these last relatively small final two steps...
Q
rid3r
01-06-2003, 01:23 AM
:) ls -l (list longformated)
after make install command as a rule /boot/vmlinuz -> (points to) the new kernel image
raid517
01-06-2003, 01:48 AM
Well looking at the lilo.conf file I posted above its:
image=/boot/vmlinuz-2.4.19
label=2419
root=/dev/hdf1
read-only
optional
vga=788
append=" devfs=mount hda=ide-scsi hdc=ide-scsi"
initrd=/boot/initrd-2.4.19.img
Is this what you mean?
Q :)
rid3r
01-06-2003, 02:08 AM
you compiled a 2.4.19 kernel, than at the end you issued a ]make install command, what it does is, it changes the symbolic link in the /boot directory vmlinuz -> your_old_kernel to vmlinuz -> you_compiled_kernel , the problem is that your lilo.conf still holds the image=/boot/vmlinuz entries.
That's why I asked you to check with ls -l /boot what that vmlinuz points to now. It is important. If it points to your 2.4.19 kernel you'll have to replace the image=/boot/vmlinuz entries in lilo.conf with your old kernel images.
raid517
01-06-2003, 02:18 AM
And how would I do that? Considering that what you just said more or less went over my head too?
'you'll have to replace the image=/boot/vmlinuz entries in lilo.conf with your old kernel images.'
I'll have to do what with what? How in practical (simple language) terms do I achieve this?
Q
rid3r
01-06-2003, 02:48 AM
$ su
$ ls -l /boot
you did not answer the question, what do you see, does it look like this:
boot.2100
config
config-2.4.19
config-2.4.19-16mdk
config-2.4.19-16mdksmp
grub
----------------------------
initrd-2.4.19-16mdk.img
initrd-2.4.19-16mdksmp.img
initrd-2.4.19.img
initrd.img
initrd-smp.img
^--------------------------init images------+
kernel.h
kernel.h-2.4.19-16mdksmp
map
message
message-graphic
message-text
System.map -> System.map-2.4.19
System.map-2.4.19
System.map-2.4.19-16mdk
System.map-2.4.19-16mdksmpuk.klt
---------------------------------+
vmlinuz -> vmlinuz-2.4.19
vmlinuz-2.4.19
vmlinuz-2.4.19-16mdk
vmlinuz-2.4.19-16mdksmp
vmlinuz.old
vmlinuz-smp
^-----------------------------your kernels---+
================================================
either:
# vi /etc/lilo.conf
or if you are not familiar with vi
# kwrite /etc/lilo.conf
boot=/dev/hde
map=/boot/map
default=linux-smp
keytable=/boot/uk.klt
prompt
nowarn
timeout=100
message=/boot/message
menu-scheme=wb:bw:wb:bw
ignore-table
disk=/dev/hde bios=0x80
image=/boot/vmlinuz-2.4.16mdk
label=linux
root=/dev/hdf1
initrd=/boot/initrd-2.4.16mdk.img
append="devfs=mount hda=ide-scsi hdc=ide-scsi quiet"
vga=788
read-only
image=/boot/vmlinuz.old
label=linux-nonfb
root=/dev/hdf1
initrd=/boot/initrd.img
append="devfs=mount hda=ide-scsi hdc=ide-scsi"
read-only
image=/boot/vmlinuz-smp
label=linux-smp
root=/dev/hdf1
initrd=/boot/initrd-smp.img
append="devfs=mount hda=ide-scsi hdc=ide-scsi"
read-only
image=/boot/vmlinuz alterenatively you can write: image=/boot/vmlinuz-2.4.19
label=2419
root=/dev/hdf1
initrd=/boot/initrd-2.4.19.img
append="devfs=nomount hda=ide-scsi hdc=ide-scsi"
read-only
other=/dev/hde1
label=NT
table=/dev/hde
other=/dev/fd0
label=floppy
unsafe
raid517
01-06-2003, 02:57 AM
This is a copy and paste of how it looks...
[q@localhost q]$ su
Password:
[root@localhost q]# ls -l /boot
total 6224
-rw-r--r-- 1 root root 512 Jan 4 00:22 boot.2100
lrwxrwxrwx 1 root root 22 Jan 6 05:42 config -> config-2.4.19-16mdksmp
-rw-r--r-- 1 root root 26681 Jan 6 06:52 config-2.4.19
-rw-r--r-- 1 root root 44145 Sep 20 17:52 config-2.4.19-16mdk
-rw-r--r-- 1 root root 44125 Sep 20 15:49 config-2.4.19-16mdksmp
drwxr-xr-x 2 root root 4096 Jan 4 00:22 grub/
-rw-r--r-- 1 root root 125021 Jan 4 00:22 initrd-2.4.19-16mdk.img
-rw-r--r-- 1 root root 128094 Jan 4 00:22 initrd-2.4.19-16mdksmp.img
-rw-r--r-- 1 root root 21759 Jan 6 06:52 initrd-2.4.19.img
lrwxrwxrwx 1 root root 17 Jan 6 06:52 initrd.img -> initrd-2.4.19.img
lrwxr-xr-x 1 root root 26 Jan 4 00:22 initrd-smp.img -> initrd-2.4.19-16mdksmp.img
lrwxrwxrwx 1 root root 30 Jan 6 05:43 kernel.h -> /boot/kernel.h-2.4.19-16mdksmp
-rw-r--r-- 1 root root 441 Jan 4 00:24 kernel.h-2.4.19-16mdksmp
-rw------- 1 root root 263168 Jan 6 06:52 map
lrwxr-xr-x 1 root root 15 Jan 4 00:22 message -> message-graphic
-rw-r--r-- 1 root root 147089 Jan 4 00:22 message-graphic
-rw-r--r-- 1 root root 130 Jan 4 00:22 message-text
lrwxrwxrwx 1 root root 26 Jan 4 00:24 System.map -> System.map-2.4.19-16mdksmp
-rw-r--r-- 1 root root 736323 Jan 6 06:52 System.map-2.4.19
-rw-r--r-- 1 root root 490852 Sep 20 17:52 System.map-2.4.19-16mdk
-rw-r--r-- 1 root root 508012 Sep 20 15:49 System.map-2.4.19-16mdksmp
-rw-r--r-- 1 root root 256 Jan 4 00:22 uk.klt
lrwxrwxrwx 1 root root 14 Jan 6 06:52 vmlinuz -> vmlinuz-2.4.19
-rw-r--r-- 1 root root 1913202 Jan 6 06:52 vmlinuz-2.4.19
-rw-r--r-- 1 root root 880346 Sep 20 17:52 vmlinuz-2.4.19-16mdk
-rw-r--r-- 1 root root 956832 Sep 20 15:49 vmlinuz-2.4.19-16mdksmp
lrwxrwxrwx 1 root root 20 Jan 6 00:00 vmlinuz.old -> vmlinuz-2.4.19-16mdk
lrwxr-xr-x 1 root root 23 Jan 4 00:22 vmlinuz-smp -> vmlinuz-2.4.19-16mdksmp
[root@localhost q]#
How should it look? :confused:
Q
raid517
01-06-2003, 03:00 AM
Well that didn't come out right, it looks the same as yours on the command promt... :)
Q
rid3r
01-06-2003, 03:15 AM
vmlinuz -> vmlinuz-2.4.19 -as I said, points to your new kernel,
but the System.map -> (points to) System.map-2.4.19-16mdksmp, just to avoid the mess, you should delete the System.map symbolic link like this:
# su
# rm -f /boot/System.map
then create it again but linked to your new kernel's System.map-2.4.19 like this:
# ln -s /boot/System.map /boot/System.map-2.4.19
----------
unless, damn it, I am not sure, on my machine I did it but I also made my new kernel the default one in lilo.conf:
##right at the beginning, the "Global Section"##
boot=/dev/hde
map=/boot/map
default=2.4.19 ###just to be on the safe side
keytable=/boot/uk.klt
prompt
nowarn
timeout=100
message=/boot/message
menu-scheme=wb:bw:wb:bw ###hellofascheme
ignore-table
disk=/dev/hde bios=0x80
rid3r
01-06-2003, 06:37 AM
you're welcome.
raid517
01-06-2003, 02:48 PM
Lol I didn't get round to the thanks part yet... :) I had to go out and just got your reply... But thanks anyway... :)
I got the new kernel bootable, but I still have problems, specifically with several modules failing to load during boot time properly...
They move too quickly for me to see... Is there any such thing as a log file that is made during boot time that will help me identify the failing modules?
Also there seems to be several hacks/features present in the Madrake 9.0 kernel that are not present in the kernel from the official kernel home page... Among the things I have been able to identify is SoundBlaster Audigy support - and a whole range of GR security options... I am sure there are probably more, which may be the source of several of the faulting modules I see during boot time...
There is something called vitual IP server, or similar that is failing too but I can't seem to find that in the set up file to see whether I should enable or disable it.
These are at least two of the failing modules (out of about 8) I see during boot time...
But until I can look at some sort of log of the modules being loaded at boot time and what happend to them when they tried to load I will find it very difficult to trouble shoot.
One obvious answer is to build the kernel from official Mandrake source, which might solve some (though not all) problems.. But this is rather restrictive should one wish to try new kernel versions with better support for various features...
Also I am having problems connecting to the internet with my new kernel version, (generic Rockwell 56k modem, it dials then quits when attempting to connect to the server) so I wondered if there was a way to look at the networking set up of my old Mandrake Kernel that works and make the corresponding adjustments...
Once more thank you for your help, I didn't want to make it seem like I was ignoring you. It is often several hours between the times when I look at my computer - so any lapse was unintentional... :)
With kind regards,
Q
raid517
01-06-2003, 04:35 PM
Could someone please look at this list of failing modules and advise me on how they might be resolved? I have no idea what (most) of them are.
Q
rid3r
01-06-2003, 05:19 PM
it's possibly because you did not include kernel support for some modules.
my advice is, boot in your old kernel, It's still working, right, no errors?
Than try to compile 2.4.19 again, but this time:
$ su -- you know this
# ls /usr/src -- see what you have, it should be your old kernel, the 2.4.19 kernel an a symlink to one of them
# ls -l /usr/src --- will show you what the symlink (symbolic link, or shortcut) points to, that's how it looks on my system:
# ls -l /usr/src
total 12
lrwxrwxrwx 1 root root 19 Jan 6 10:50 linux -> linux-2.4.19
drwxr-xr-x 17 root root 4096 Jan 6 11:40 linux-2.4.19
drwxr-xr-x 14 root root 4096 Jan 6 10:50 linux-2.4.18-3
drwxr-xr-x 7 root root 4096 Jan 4 08:50 redhat
--- it should point to your new kernel (linux-2.4.19)
if not, remove the symlink linux:
# rm /usr/src/linux
than create a new one:
# ln -s /usr/src/linux-2.4.19 /usr/src/linux
after that:
# cd /usr/src/linux --- enter that directory
# make mrproper --- cleans up (removes binaries e.t.c)
# make oldconfig --- recreates your working configuration (use this, it's good)
# make xconfig --- change your configuration if needed, press "Save and Exit"
# vi Makefile --- editing Makefile:
<Insert> -- press it to be able to edit
find the
$EXTRAVERSION = , live it empty, this will overwrite your vmlinuz-2.4.19
<Escape>
:w -- to write and save
:q -- to quit vi editor
# make dep
# make bzImage
# make modules
# make modules_install
# make install
to verify if everything is in its place:
# ls -l /boot
# ls /lib/modules
# cat /etc/lilo.conf
-------------------
this should replace your vmlinuz-2.4.19 with a working one
raid517
01-08-2003, 01:16 AM
Well thanks I would do this, but the compile process keeps complaining about missing files from the mandrake source and never completes... Why would it report missing files? When I look in the indicated directories the files are indeed missing, so I guess the question is, why would mandrake leave certain files out of the source?
But thanks for the advice in the mean time... :)
Q
raid517
01-09-2003, 02:33 AM
Ok my brain wasn't in gear when read those instructions. Sorry, I tried again and it works like a treat... I think what i tried to do was build a configuration file from scratch, but that command to rebuild my current configuration saved the day. I then knew what Mandrake would normally attempt to install and went with that. All I changed were the ACPI options. I can't get my head round that Vim editor though, every time I press something I just get a message 'recording' and nothing happens... Couldn't I just use a conventional text editor like Gedit or KEdit? Would that work?
Also whatever I did before I did do something right, as I got some screaming hardisk performance . (I have 2 60 GB internal IBM deskstar hardrives, connected to a promise Utra TX2 Raid card - though I'm not using raid) But with my recent recompile I have gone back to the old style sucky HDD performance levels I had before. What options should I enable to improve my hardisk performance?
Regards,
Q