Stuart Luppescu
2007-Apr-18 17:22 UTC
[Bridge] i need some help with compiling bridge module
On ?, 2004-03-01 at 10:31, Software-team wrote:> I am trying to improve bridge module towards 802.1w (RSTP) but I am new to kernel and modules programming. I dont want to compile the whole modules every time I make some changes. Could you give me some clues how to set up environment to compile only selected module (bridge 802.1d) for a given kernel version, written in Makefile like: > VERSION = 2 > PATCHLEVEL = 4 > SUBLEVEL = 20 > EXTRAVERSION =-8 etc. > How to make a Makefile so the bridge module could be compiled separately for that kernel (or another)? > Thanks for any specyfic help.It's pretty easy. do make menuconfig, and under Networking Options put 'M' where it says 802.1d Ethernet Bridging. Save your config, and then do make dep && make bzImage modules modules_install Move the /usr/src/linux/arch/i386/boot/bzImage to somewhere in /boot (renaming it if you like), make the appropriate modification to lilo.conf (and then rerun lilo) or change /boot/grub/grub.conf and reboot. When it starts up again, just modprobe bridge. I also found that I had to do make mrproper before I could get the bridge module to load. In this case, make sure you save your .config file to somewhere else first, or you'll lose it. HTH. -- Stuart Luppescu -=- s-luppescu .at. uchicago.edu University of Chicago -=- CCSR ???????? -=- Kernel 2.6.3-gentoo-r1 Bilbo's First Law: You cannot count friends that are all packed up in barrels. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.linux-foundation.org/pipermail/bridge/attachments/20040301/72f4696e/attachment-0002.pgp
Abhijit Kumbhare
2007-Apr-18 17:22 UTC
[Bridge] Re: i need some help with compiling bridge module
Skipped content of type multipart/alternative-------------- next part -------------- # -*-makefile-*- # # This file is part of the sample code for the book "Linux Device Drivers", # second edition. It is meant to be generic and is designed to be recycled # by other drivers. The comments should be clear enough. # It partly comes from Linux Makefile, and needs GNU make. <rubini@linux.it> # TOPDIR is declared by the Makefile including this file. ifndef TOPDIR TOPDIR = . endif # KERNELDIR can be speficied on the command line or environment ifndef KERNELDIR KERNELDIR = /usr/src/linux-2.4 endif # The headers are taken from the kernel INCLUDEDIR = $(KERNELDIR)/include # We need the configuration file, for CONFIG_SMP and possibly other stuff # (especiall for RISC platforms, where CFLAGS depends on the exact # processor being used). ifeq ($(KERNELDIR)/.config,$(wildcard $(KERNELDIR))/.config) include $(KERNELDIR)/.config else MESSAGE := $(shell echo "WARNING: no .config file in $(KERNELDIR)") endif # ARCH can be speficed on the comdline or env. too, and defaults to this arch # Unfortunately, we can't easily extract if from kernel configuration # (well, we could look athe asm- symlink... don't know if worth the effort) ifndef ARCH ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ -e s/arm.*/arm/ -e s/sa110/arm/) endif # This is useful if cross-compiling. Taken from kernel Makefile (CC changed) AS =$(CROSS_COMPILE)as LD =$(CROSS_COMPILE)ld CC =$(CROSS_COMPILE)gcc CPP =$(CC) -E AR =$(CROSS_COMPILE)ar NM =$(CROSS_COMPILE)nm STRIP =$(CROSS_COMPILE)strip OBJCOPY =$(CROSS_COMPILE)objcopy OBJDUMP =$(CROSS_COMPILE)objdump # The platform-specific Makefiles include portability nightmares. # Some platforms, though, don't have one, so check for existence first ARCHMAKEFILE = $(TOPDIR)/Makefile.$(ARCH) ifeq ($(ARCHMAKEFILE),$(wildcard $(ARCHMAKEFILE))) include $(ARCHMAKEFILE) endif # CFLAGS: all assignments to CFLAGS are inclremental, so you can specify # the initial flags on the command line or environment, if needed. CFLAGS += -Wall -D__KERNEL__ -DMODULE -I$(INCLUDEDIR) ifdef CONFIG_SMP CFLAGS += -D__SMP__ -DSMP endif # Prepend modversions.h if we're running with versioning. ifdef CONFIG_MODVERSIONS CFLAGS += -DMODVERSIONS -include $(KERNELDIR)/include/linux/modversions.h endif #Install dir VERSIONFILE = $(INCLUDEDIR)/linux/version.h VERSION = $(shell awk -F\" '/REL/ {print $$2}' $(VERSIONFILE)) INSTALLDIR = /lib/modules/$(VERSION)/misc -------------- next part -------------- A non-text attachment was scrubbed... Name: Makefile Type: application/x-java-applet Size: 592 bytes Desc: not available Url : http://lists.linux-foundation.org/pipermail/bridge/attachments/20040301/f6070a26/Makefile-0002.bin
Software-team
2007-Apr-18 17:22 UTC
[Bridge] i need some help with compiling bridge module
I am trying to improve bridge module towards 802.1w (RSTP) but I am new to kernel and modules programming. I dont want to compile the whole modules every time I make some changes. Could you give me some clues how to set up environment to compile only selected module (bridge 802.1d) for a given kernel version, written in Makefile like: VERSION = 2 PATCHLEVEL = 4 SUBLEVEL = 20 EXTRAVERSION =-8 etc. How to make a Makefile so the bridge module could be compiled separately for that kernel (or another)? Thanks for any specyfic help. Software Team
Software Team
2007-Apr-18 17:22 UTC
[Bridge] i need some help with compiling bridge module
On ?, 2004-03-01 at 10:31, Software-team wrote: > I am trying to improve bridge module towards 802.1w (RSTP) but I am new to kernel and modules programming. I dont want to compile the whole modules every time I make some changes. Could you give me some clues how to set up environment to compile only selected module (bridge 802.1d) for a given kernel version, written in Makefile like: > VERSION = 2 > PATCHLEVEL = 4 > SUBLEVEL = 20 > EXTRAVERSION =-8 etc. > How to make a Makefile so the bridge module could be compiled separately for that kernel (or another)? > Thanks for any specyfic help. It's pretty easy. do make menuconfig, and under Networking Options put 'M' where it says 802.1d Ethernet Bridging. Save your config, and then do make dep && make bzImage modules modules_install Move the /usr/src/linux/arch/i386/boot/bzImage to somewhere in /boot (renaming it if you like), make the appropriate modification to lilo.conf (and then rerun lilo) or change /boot/grub/grub.conf and reboot. When it starts up again, just modprobe bridge. I also found that I had to do make mrproper before I could get the bridge module to load. In this case, make sure you save your .config file to somewhere else first, or you'll lose it. HTH. ----------------------------------------------- Yes, What you wrote is sure both right, and simple. But it takes a lot of time. But that is not what I want. I want to compile a bridge module separately, like you compile some modules that come you add later to your kernel (like i did for example with a NTFS module, which I downloaded and compilet separately from my kernel 2.4.20-8). I would like to do the same with Bridge module. I want to make some changes and compile it with kernel headers from my kernel. But I dont want to compile the whole kernel (ang go through that process you described) every time I make some minor changes to the module which uses the same kernel header files. There should be some way to do it, I sure. But I dont know how:( I can bet this, because nobody would write kernel if he should compile it every time one makes some change. This would take ages to finish the project. Still hoping for an answer. Software Team