Click to See Complete Forum and Search --> : compiling modules
av8or
07-16-2001, 09:14 AM
Ok, I'm trying to get iptables compiled into my kernel. I'm running RH7.1. I went to the /usr/src/linux-2.4.2 directory and ran make xconfig. I selected the options that I wanted and then clicked on "save and quit." I found a book on RH7 and it said that the most common way to compile the modules into the kernel was to enter the following at the CLI: make dep clean zlilo modules modules_install. I did this and it ran through the make dep clean process but failed when it got to the zlilo part. I assume that RH7.1 does not use zlilo any longer. What steps do I need to take after doing the "make dep clean"? Is there another program that RH7.1 uses in place of zlilo? After I ran the "make dep clean" process, I looked in the ../linux-2.4.2 directory and noticed a file called install.sh. I tried to execute the script but it said "Access denied". I opened the script and looked at it and it appears that there are some command line option that need to be passed to it and I have no idea what tho pass. Any help is much appreciated.
PLBlaze
07-16-2001, 11:24 AM
Zlilo is the older format that used gzip to compress the kernel...as the sources grew so did the kernel when compiling and there was need for another format thus bzImage was born :D which uses bzip2 compression.If you notice just by the end of compilation some kernels are anywhere from 3.5 to over 5mb in size and bzImage can compress them into less than 1mb or just a bit over (depends on options one chooses).So to answer your question use bzImage instead of zimage and you'll be fine.Happy compiling :) .
[ 16 July 2001: Message edited by: Diffie ]
av8or
07-16-2001, 11:34 AM
Ok,
So what command line options would I use with bzImage? I assume that bzImage will create a compressed file that is the Kernel? Then I would add a section in lilo.conf to point to the new kernel image? Is that correct? If so what command line options would I use with bzImage...
bdg1983
07-16-2001, 07:14 PM
Just 'make bzImage' as far as I know.
I assume that bzImage will create a compressed file that is the Kernel? Then I would add a section in lilo.conf to point to the new kernel image? Is that correct?
Yes, yes and yes.
Remember to copy the System.map file too...
Also, if you have the drive space, skip the 'clean' step. It will save the headers so that only what is changed will be compiled the next time. Obviously, this will decrease the compile time.
[ 16 July 2001: Message edited by: Pras ]
av8or
07-16-2001, 11:05 PM
Ok guys,
Here's what I did:
1. Fresh install w/o firewall so ipchains wouldn't be installed
2. ran make xconfig
3. chose netfilter along with a few other options so I could do NAT
4. saved and quit xconfig
5. ran make dep
6. ran make bzImage
7. waited for 30-40 minutes
8. copied bzImage from the /usr/src/linux-2.4.2/arch/i386/boot directory to /boot/vmlinuz-fw (fw for fire-wall)...
9. edited lilo.conf to include a section pointing to the new kernel. labeled it linux-fw
10. copied System.map from /usr/src/linux-2.4.2 to /boot
11. reran lilo
12. rebooted and chose linux-fw
This was the result:
Loading linux-fw
Uncompressing Linux... Ok, booting the kernel.
Nothing else.
What do I do now?
[ 16 July 2001: Message edited by: av8or ]
I found after doing the xconfig selection and saving it that running:
make dep clean bzImage bzlilo
... worked for me. the bzlilo bit will place the kernel in / as "vmlinuz", then update and run the "lilo" command. You should be able to copy the System.map file to /boot and reboot...
If that goes according to plan, then go back to /usr/src/linux/2.4.2/ and run:
make modules modules_install to get the modules installed into /lib/modules/2.4.2/, you should be able to load modules from there...
Hope that helps... I am no expert at this... just been trying to do it with my 2.4.5 kernel. :)
Cya round
Jinx
FroggySwamp
07-17-2001, 01:34 AM
Hey,
Just out of curiosity, shouldn't you also do a make modules, and a make modules_install as well? On Redhat 7.1, I do the following for a fresh or updated Kernel Config.
make menuconfig
configure the kernel
save
make dep
make bzImage
make modules
make modules_install
Then, I copy the new bzImage to /boot, renaming it to vmlinuz_whateverthenameis.
Copy System.map
Edit Lilo.conf and make the necessary modifications.
run lilo
Reboot.
Works like a champ.
;)
av8or
07-17-2001, 08:55 AM
Hey Froggy,
I tried it that way once. When I rebooted everything seemed to be fine, but when I ran lsmod there were no modules loaded. Do you copy the System.map file from the /usr/src/linux-2.4.2 directory? Also, is make menuconfig a better option than make xconfig? I'll try it one more time and see what happens.......
av8or
07-17-2001, 09:25 AM
BTW, Does anybody know where the netfilter.kernelnotes.org site went to? I've been trying it for days and keep getting the server not found message....
bdg1983
07-17-2001, 09:56 AM
Here are some notes I typed up for myself.
cp linux-2.4.5.tar.gz /usr/src
rm linux
tar xvzf linux-2.4.5.tar.gz
mv linux linux-2.4.5
ln -s linux-2.4.5 linux
cd linux
make mrproper
make menuconfig or make xconfig or make config
make dep
make clean
make bzImage
make modules
mv /lib/modules/2.2.14 /lib/modules/2.2.14.old # Whatever old version is
make modules_install
depmod -a
mv /boot/System.map /boot/System.map.old
mv /boot/bzImage /boot/bzImage.old
cp /usr/src/linux/System.map /boot
cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz.modular.2.4.5
edit /etc/lilo.conf
Make additions and whatever necessary changes
Rerun lilo
Reboot
av8or
07-17-2001, 02:06 PM
Ok,
I'm just about ready to give up!!! I followed mdwatts checklist. Everything went peachy. I edited my lilo.conf file and this is what is has in it:
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
message=/boot/message
linear
default=linux
image=/boot/vmlinuz-2.4.2-2
label=linux
read-only
root=/dev/hda6
image=/boot/vmlinuz-fw
label=linux-fw
read-only
root=/dev/hda6
I reran lilo and rebooted and got the same results as before. I just don't understand what I could be doing wrong. Should I just punt and go home? Oh yeah, this has happened on two different machines. I can boot using the old kernel, but when I do an lsmod it show that no modules are loaded!!! This is really getting frustrating.
[ 17 July 2001: Message edited by: av8or ]
:confused: :mad: :eek:
[ 17 July 2001: Message edited by: av8or ]
bdg1983
07-17-2001, 05:04 PM
I know how you feel. I did a lot of research before compiling my first kernel of which I finally had time to try today thanks to a week of vacation. Trying the 2.4.6 and all seems to go well until I reboot, select the new kernel (using Grub) and then I just get a blank screen.
And this was after researching at a Caldera specific site where the procedures should have worked.
The only thing I can think of for mine, is the need for a new initrd in /boot since I've installed the new OpenLinux Workstation 3.1 using ReiserFS as a module (it was suggested and the original install does have it as a module).
Not a nice b'day present.
av8or
07-17-2001, 05:19 PM
Well,
Happy b-day md!! If it is your b-day.... I think I may have figured out what the problem is. I'm gonna try it out tonight at home. I was reading on this page http://www.ibiblio.org/pub/Linux/docs/HOWTO/Kernel-HOWTO and it said that in xconfig or menuconfig you need to select the proper processor architecture along with a few other things. I assumed that these things would be set by default since that's what was running in the original kernel, but I guess not. I ran make xconfig from a machine here at work that is running an AMD-k6-233 processor and the default option in xconfig was a P-III processor. I'm thinking that may be what is/was the problem. I'm gonna try it out tonight and see what happens. I love linux, but sometimes I really hate linux..... :rolleyes:
Let me know if ya solve that module problem too... I got the same problem. :(
lsmod and nothing... modconf... nothing. :(
Gonna run a recompile tonight aswell and see how things turn out, will let ya know if I can get my modules working... sounds like a common problem... anyone know of a common fix? (Have replaced the System.map file).
Cya round
Jinx
bdg1983
07-17-2001, 08:19 PM
It is and I thank-you.
I love linux, but sometimes I really hate linux
Anything worthwhile takes time to learn. It's a great os though you have to want to learn it. No use trying Linux just because someone else suggested it or you've heard good thing about it. It takes dedication and commitment.
Yes, try changing the processor type and hopefully that will help.
av8or
07-18-2001, 09:02 AM
Hey Guys!!!!
The recompiling with proper processor support worked!! I recompiled and the machine actually booted with the new kernel. I was SO stoked last night when it work. I finally got it to work at about 8:30 so I took the rest of the night off. I've been stressing way to much over that.
After I successfully booted with the new kernel, I did make modules and make modules_install. I rebooted and did an lsmod and nothing. I assume that's because the modules that were there before were compiled as modules before and now they're either compiled into the kernel or not at all. Before there were things like modules for the sound card(which I don't need if the machine is a firewall) and I noticed one named ne2k-pci. That one has to be the NIC module, because I found it in the Networking components section and compiled it into the kernel and my NIC still works. Before, after I compiled the wrong processor support into the kernel and then ran make modules modules_install and then booted with my original kernel, the NIC no longer worked. I'm just happy, that with all you guys help I finally figured out what I was doing wrong.
Well I'm at work now, so I'd better go do some "real" work.... :D
Thanks Guys!!!
av8or
07-18-2001, 09:06 AM
Oh yeah md,
I do use linux because it is so versatile and I REALLY want to learn to use it and want to KNOW linux. I've been tinkering with it off and on since 5.2 was the lates version. I've just been a M$ user for many many years. I'm ready for someone to do to M$ what M$ did to IBM. I just get frustrated sometimes.
bdg1983
07-18-2001, 10:03 AM
Glad to hear you got it working. Good job. Ready to help me with mine???
So many things to learn about Linux and sometimes just not enough time.
If you have time, could you post the exact steps you used for a successful compile or email me if it's easier?
I tried mine yesterday and upon reboot, all I got was a blank screen. The old still works fine. Could be I compiled reiserfs as a module and haven't created a new initrd.gz for the new kernel. Nice to have a week vacation so I can spend time on it though.
av8or
07-18-2001, 10:20 AM
Sure,
I have to do a kernel recompile on another machine this morning/afternoon. I'll write the steps down and post them here.
av8or
07-18-2001, 02:06 PM
Ok md,
I think these are all the steps that I took. Hope it helps.
How I re/configured my kernel.
1. I did a fresh install of RedHat Linux 7.1 without firewall support.
During the install you have the option of configuring a firewall or selecting
"No Firewall". I selected no firewall because that installs ipchains and I
don't want ipchains installed.
2. Next I ran "make mrproper" from the /usr/src/linux-2.4.2 directory.
3. Then I ran "make xconfig"
4. I chose the options that I wanted.
This is an exerpt from http://www.ibiblio.org/pub/Linux/docs/HOWTO/Kernel-HOWTO
Within 'make xconfig' you MUST do these to avoid problems -
· Select proper CPU type - Pentium 3, AMD K6, Cyrix, Pentium 4, Intel
386, DEC Alpha, PowerPC otherwise kernel will not boot!!
· Select SMP support - whether single CPU or multiple CPUs
· Filesystems - Select Windows95 Vfat, MSDOS, NTFS as part of kernel
and not as loadable modules.
· Enable the Loadable kernel modules support! With this option you
can load/unload the device drivers dynamically on running linux
system on the fly. See these man pages
I think that selecting the proper CPU type and disabling SMP support(this is
enabled by default) is the most important.
5. I then selected the options that I wanted from the Networking Options menu.
6. Next I entered the Netfilter Config menu from the Networking Options menu and
chose the options that I wanted. I pretty much enabled everything because I want
to be able to use all the options available. I'd rather have kernel that was just under 1
MB than have to do another recompile.... ;-)
7. Once I had chosen all the options that I wanted I clicked "Save and Quit."
8. I ran "make dep"
9. Ran "make clean"
10. Ran "make bzImage"
11. Waited patiently for 30 minutes.
12. Copied the bzImage file from /usr/src/linux-2.4.2/arch/i386/boot to /boot/vmlinuz-fw
13. Renamed /boot/System.map to System.map.old (This is a sym link file pointing to System.map.2.4.2-2
or something similar.)
14. Copied Systme.map from /usr/src/linux-2.4.2 to /boot
15. Edited lilo.conf to include the new kernel I labeled it linux-fw.
16. Reran lilo
17. Rebooted and selected the new kernel -- linux-fw.
18. Closed my eyes and prayed.
19. Opened my eyes and did a little dance when I saw it was actually booting!!!!
20. Danced a little more dancing when it booted successfully.
21. Renamed the /lib/modules/2.4.2-2 directory to /lib/modules/2.4.2-2.old
22. Ran "make modules" from the /usr/src/linux-2.4.2 directory
23. Ran "make modules_install" from the /usr/src/linux-2.4.2 directory
24. Made linux-fw the default selection in lilo.conf
25. Reran lilo and rebooted.
26. All seems to be good.