LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   RH9 "make modules" won't compile (https://www.linuxquestions.org/questions/linux-software-2/rh9-make-modules-wont-compile-151029/)

tango_echo_xray 02-27-2004 12:14 AM

RH9 "make modules" won't compile
 
I'm running Redhat 9 on a Sony Vaio PCG-C1VPK using the 2.4.20-8 kernel, and I wanted to reconfigure and build a new kernel..
I followed the standard steps, which seemed to compile without a hitch:
make config
make dep
make clean
make bzImage
however, "make modules" and/or "make modules_install" won't compile, and there doesn't seem to be any bzImage in the directory, but rather a "vmlinux"

make modules flipped out a lot, including errors like the following:

make[3]: Entering directory `/usr/src/linux-2.4.20-8/drivers/addon/aep'
gcc -D__KERNEL__ -I/usr/src/linux_alt/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i586 -DMODULE -DMODVERSIONS -include /usr/src/linux_alt/include/linux/modversions.h -nostdinc -iwithprefix include -DKBUILD_BASENAME=paep -c -o paep.o paep.c
In file included from paep.c:67:
/usr/src/linux_alt/include/linux/kernel.h:60: invalid suffix on integer constant
/usr/src/linux_alt/include/linux/kernel.h:60: parse error before numeric constant
/usr/src/linux_alt/include/linux/kernel.h:60: warning: function declaration isn't a prototype
/usr/src/linux_alt/include/linux/kernel.h:61: invalid suffix on integer constant
/usr/src/linux_alt/include/linux/kernel.h:61: parse error before numeric constant
/usr/src/linux_alt/include/linux/kernel.h:62: `panic_R_ver_str' declared as function returning a function
/usr/src/linux_alt/include/linux/kernel.h:62: warning: function declaration isn't a prototype
....

in fact, all the errors that show up seem to originate from paep.c
is it something with redhat's source? should I just grab the kernel source from kernel.org instead?
any ideas?
thanks

jailbait 02-27-2004 11:15 AM

"should I just grab the kernel source from kernel.org instead?"

I have always done my kernel compiles using www.kernel.org. In addition to whatever changes that you want to make you can upgrade to either 2.4.25 or 2.6.3 while you are at it.

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

noeffort 02-29-2004 04:25 AM

(short answer: its not the new kernel/sources... its the config)

Well the paep is a module that is trying to be compiled. More than likely it might be that the hardware does not contain piece that that module is trying to support.

What was your .config like? if you look at the .config you will see a line like this:

CONFIG_CRYPTO_AEP=m

You might want to comment it out, here is my addon section:
#
# Additional device driver support
#
# CONFIG_NET_BROADCOM is not set
# CONFIG_CIPE is not set
# CONFIG_CRYPTO_AEP is not set
# CONFIG_MEGARAC is not set
# CONFIG_FC_QLA2200 is not set
# CONFIG_FC_QLA2300 is not set
# CONFIG_SCSI_ISCSI is not set

For s&g's I looked it up for you - http://www.aepsystems.com/products.htm
They sell an SSL crypto card that you can place in a server to offload the software crypto functions (pretty neat actually =)

I'm going to venture a guess that you don't have that card, eh?

Use make menuconfig to "not set" the addon modules.

Here is a good walk through to produce a "clean" kernel from config

cd /usr/src/linux
make clean

make mrproper (don't quote me but I believe mrproper takes to back to what your original kernel config was - ie, so if you have added like a customization for /dev/agpgart, or a NIC card, etc, this will "re"-break it. So remember that you have done this)

make menuconfig (set up your kernel here in this menu - comment out what you don't need. I have yet to find a use for addons... though I may someday - the beauty of Linux =)
make dep
make bzImage
make modules
make modules_install
cp System.map /boot/System.map
cp arch/i386/boot/bzImage /boot/bzImage

And it may be better to not concatenate the commands, e.g., make ; make install etc etc... cuz its hard then to figure out where the mess up happened... do it sequentially and it is more systematic to find the problem.

Here is another good walkthough I found:

Darin Hi all, I'm new to the forum but having broken a few installs of Slackware, RedHat, SUSE, etc by screwing up kernel rebuilds so I'll throw in my learned the hard way method for rebuilding kernels.

* cd /usr/src/linux
* make mrproper (cleans out old build temp files, may not be needed. also note this deletes any previous .config file, see below)
* can copy previous config from /boot as a base template... cp /boot/config-2.4.xx-new .config
* make menuconfig (or make config or make xconfig)
* pick all the appropriate options, but take note:
-remember which of your system drivers you are adding into the kernel and which ones you are modularizing; A good trick is to open /etc/rc.d/rc.modules in a different terminal window and remark/unremark appropriate modules as you go through the config. ie I modularize my sound card driver so uncomment it in rc.modules but build my scsi driver into the kernel so comment out the line for it in rc.modules.
* make dep
* make clean (can do these together, they are fairly short... root@scoob:/usr/src/linux# make dep ; make clean)
* make bzImage (Usually the longest part of the process)
* make zImage instead of bzImage if you can pull off a small kernel
* make modules
-note: can do any command below except make modules_install in a second terminal while make modules is running
* mv /lib/modules/2.4.xx /lib/modules/2.4.xx-old (this moves the old modules out of the way so make modules_install doesn't overwrite them)
* make modules_install (this basically copies the new modules to /lib/modules/2.4.xx)
* cp arch/i386/boot/zImage /boot/vmlinuz-2.2.xx-new
* edit /etc/lilo.conf (it's a good idea to copy your original image= section and rename it to something like original so you can boot the old kernel)
*mv System.map /boot/System.map-2.4.xx-new
*delete or rename the symbolic link System.map and make a new one ln -s /boot/System.map-2.4.xx-new /boot/System.map
*cp .config /boot/config-2.4.xx-new
*delete or rename the symbolic link config and make a new one ln -s /boot/config-2.4.xx-new /boot/config
* /sbin/lilo
* reboot (no need to do it immediately but the new kernel won't be loaded until you reboot)

This does a few things, first off the System.map from the new build is now in /boot where the kernel can find it rather than the old one. Second, you have a saved copy of your .config as /boot/config-2.4.xx-new and can copy it back as a template if you need to modify your kernel build, see the third step above. By moving the old modules out of the way, you can trim your system by deleting these once you are satisfied with the new kernel.

Things to look out for:
-This isn't the definitive guide to compiling your kernel! Do reference any appropriate man pages, HOWTOs, etc while doing this.
-on Slackware, your network card module may be loaded in /etc/rc.d/rc.netdevice instead of /etc/rc.d/rc.modules
-by moving your old modules out of the way you can hose your system if you forgot an important module like your hard drive driver in the new kernel.
-editing the rc. startup files can really mess up your system if you don't CAREFULLY follow syntax.

I've also had problems where errors fly by on screen during boot and you can't find them in system logs and there is probably a proper way to get the sysytem to log them but a dirty trick that I use is to open up the startup files like rc.M and add some pauses like this:


All times are GMT -5. The time now is 06:12 AM.