Build external modules for XEN-Kernel
authorArne Fitzenreiter <arne_f@ipfire.org>
Tue, 21 Apr 2009 10:18:30 +0000 (12:18 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Tue, 21 Apr 2009 10:18:30 +0000 (12:18 +0200)
12 files changed:
config/kernel/kernel.config.i586-ipfire [moved from config/kernel/kernel.config.i586 with 100% similarity]
config/kernel/kernel.config.i586-ipfire-xen [moved from config/kernel/kernel.config.i586-xen with 100% similarity]
lfs/alsa
lfs/atl2
lfs/compat-wireless
lfs/kqemu
lfs/linux
lfs/mISDN
lfs/madwifi
lfs/openswan
lfs/v4l-dvb
make.sh

index 79b3269..56419a8 100644 (file)
--- a/lfs/alsa
+++ b/lfs/alsa
 
 include Config
 
+ifeq "$(XEN)" "1"
+       VERSUFIX=ipfire-xen
+else
+       VERSUFIX=ipfire
+endif
+
 VER        = 1.0.19
 
 THISAPP    = alsa-lib-$(VER)
 DL_FILE    = $(THISAPP).tar.bz2
 DL_FROM    = $(URL_IPFIRE)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
-ifeq "$(KMOD)" "1"
-ifeq "$(SMP)" "1"
-TARGET     = $(DIR_INFO)/$(THISAPP)-kmod-smp
-else
-TARGET     = $(DIR_INFO)/$(THISAPP)-kmod-$(KVER)
-endif
-else
-TARGET     = $(DIR_INFO)/$(THISAPP)
-endif
 PROG       = alsa
 PAK_VER    = 5
 
 DEPS       = ""
 
+ifeq "$(KMOD)" "1"
+       TARGET     = $(DIR_INFO)/$(THISAPP)-kmod-$(KVER)-$(VERSUFIX)
+else
+       TARGET     = $(DIR_INFO)/$(THISAPP)
+endif
+
 ###############################################################################
 # Top-level Rules
 ###############################################################################
index 8200bef..3d35ec3 100644 (file)
--- a/lfs/atl2
+++ b/lfs/atl2
 
 include Config
 
+ifeq "$(XEN)" "1"
+       VERSUFIX = ipfire-xen
+else
+       VERSUFIX = ipfire
+endif
+
 VER        = 2.0.5
 
 THISAPP    = atl2-$(VER)
 DL_FILE    = $(THISAPP).tar.bz2
 DL_FROM    = $(URL_IPFIRE)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
-ifeq "$(SMP)" "1"
-       TARGET     = $(DIR_INFO)/$(THISAPP)-smp
-else
-       TARGET     = $(DIR_INFO)/$(THISAPP)-kmod-$(KVER)
-endif
-
+TARGET     = $(DIR_INFO)/$(THISAPP)-kmod-$(KVER)-$(VERSUFIX)
 
 ###############################################################################
 # Top-level Rules
@@ -79,12 +80,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
        @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
        cd $(DIR_APP) && patch -p1 < $(DIR_SRC)/src/patches/atl2_add_tx_bytes_statistic.patch 
-ifeq "$(SMP)" "1"
-       cd $(DIR_APP) && make -C /lib/modules/$(KVER)-ipfire-smp/build/ SUBDIRS=$(DIR_APP) modules
-       cd $(DIR_APP) && install -m 644 atl2.ko /lib/modules/$(KVER)-ipfire-smp/kernel/drivers/net 
-else
-       cd $(DIR_APP) && make -C /lib/modules/$(KVER)-ipfire/build/ SUBDIRS=$(DIR_APP) modules
-       cd $(DIR_APP) && install -m 644 atl2.ko /lib/modules/$(KVER)-ipfire/kernel/drivers/net 
-endif
+       cd $(DIR_APP) && make -C /lib/modules/$(KVER)-$(VERSUFIX)/build/ SUBDIRS=$(DIR_APP) modules
+       cd $(DIR_APP) && install -m 644 atl2.ko /lib/modules/$(KVER)-$(VERSUFIX)/kernel/drivers/net 
        @rm -rf $(DIR_APP)
        @$(POSTBUILD)
index bc3dd64..24bc444 100644 (file)
 
 include Config
 
+ifeq "$(XEN)" "1"
+       VERSUFIX=ipfire-xen
+else
+       VERSUFIX=ipfire
+endif
+
 VER        = 2009-03-30
 
 THISAPP    = compat-wireless-$(VER)
 DL_FILE    = $(THISAPP).tar.bz2
 DL_FROM    = $(URL_IPFIRE)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
-ifeq "$(SMP)" ""
-  TARGET     = $(DIR_INFO)/$(THISAPP)-kmod-$(KVER)
-else
-  TARGET     = $(DIR_INFO)/$(THISAPP)-smp
-endif
+TARGET     = $(DIR_INFO)/$(THISAPP)-kmod-$(KVER)-$(VERSUFIX)
 
 ###############################################################################
 # Top-level Rules
@@ -78,9 +80,9 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
 #      Apply some wlan-card patches
        cd $(DIR_APP) && cat $(DIR_SRC)/src/patches/compat-wireless_*.patch | patch -Np1
 
-       cd $(DIR_APP) && sed -i -e "s|uname -r|echo $(KVER)-ipfire|g" Makefile
-       cd $(DIR_APP) && sed -i -e "s|/sbin/modprobe|echo|g" Makefile
+#      Build only the modules
        cd $(DIR_APP) && sed -i -e "s|install: uninstall modules|install: modules|g" Makefile
        cd $(DIR_APP) && sed -i -e "s|\t@# All the scripts|\nende:|g" Makefile
-       cd $(DIR_APP) && make KMODDIR=kernel install
+
+       cd $(DIR_APP) && make KLIB=/lib/modules/$(KVER)-$(VERSUFIX) KMODDIR=kernel install
        @$(POSTBUILD)
index 8699ac9..3c37000 100644 (file)
--- a/lfs/kqemu
+++ b/lfs/kqemu
 
 include Config
 
+ifeq "$(SMP)" "1"
+       VERSUFIX=ipfire-xen
+else
+       VERSUFIX=ipfire
+endif
+
 VER        = 1.4.0pre1
 
 THISAPP    = kqemu-$(VER)
 DL_FILE    = $(THISAPP).tar.gz
 DL_FROM    = $(URL_IPFIRE)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
-ifeq "$(SMP)" "1"
-       TARGET     = $(DIR_INFO)/$(THISAPP)-smp
-else
-       TARGET     = $(DIR_INFO)/$(THISAPP)-kmod-$(KVER)
-endif
-
+TARGET     = $(DIR_INFO)/$(THISAPP)-kmod-$(KVER)-$(VERSUFIX)
 
 ###############################################################################
 # Top-level Rules
@@ -80,18 +81,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
        cd $(DIR_APP) && ./configure --prefix=/usr --kernel-path=/usr/src/linux
        cd $(DIR_APP) && make $(MAKETUNING)
-               
-ifeq "$(SMP)" "1"
-#      cd $(DIR_APP) && ./configure --prefix=/usr --kernel-path=/lib/modules/$(KVER)-ipfire-smp/build/
-#      cd $(DIR_APP) && make $(MAKETUNING)
-       -mkdir -p /lib/modules/$(KVER)-ipfire-smp/misc/
-       cd $(DIR_APP) && install -m 644 kqemu.ko /lib/modules/$(KVER)-ipfire-smp/misc/
-else
-#      cd $(DIR_APP) && ./configure --prefix=/usr --kernel-path=/lib/modules/$(KVER)-ipfire/build/
-#      cd $(DIR_APP) && make $(MAKETUNING)
-       -mkdir -p /lib/modules/$(KVER)-ipfire/misc/
-       cd $(DIR_APP) && install -m 644 kqemu.ko /lib/modules/$(KVER)-ipfire/misc/
-endif
-       
+       -mkdir -p /lib/modules/$(KVER)-$(VERSUFIX)/misc/
+       cd $(DIR_APP) && install -m 644 kqemu.ko /lib/modules/$(KVER)-$(VERSUFIX)/misc/
        @rm -rf $(DIR_APP)
        @$(POSTBUILD)
index 20a4137..a028d3d 100644 (file)
--- a/lfs/linux
+++ b/lfs/linux
@@ -41,10 +41,11 @@ endif
 # Normal build or XEN build.
 #
 ifeq "$(XEN)" "1"
-       TARGET = $(DIR_INFO)/linux-$(VER)-xen
+       VERSUFIX=ipfire-xen
 else
-       TARGET = $(DIR_INFO)/linux-$(VER)
+       VERSUFIX=ipfire
 endif
+TARGET = $(DIR_INFO)/linux-$(VER)-$(VERSUFIX)
 
 ###############################################################################
 # Top-level Rules
@@ -207,59 +208,40 @@ endif
        # Cleanup kernel source
        cd $(DIR_APP) && make mrproper
 
-ifeq "$(XEN)" "1"
-       cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE)-xen $(DIR_APP)/.config
-else
-       cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE) $(DIR_APP)/.config
+       cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE)-$(VERSUFIX) $(DIR_APP)/.config
        cd $(DIR_APP) && make CC="$(KGCC)" oldconfig
-endif
-
        cd $(DIR_APP) && make CC="$(KGCC)" clean
+       cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(PATCHLEVEL)-$(VERSUFIX)/' Makefile
 
 ifeq "$(XEN)" "1"
-       cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(PATCHLEVEL)-ipfire-xen/' Makefile
        cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)"
-       cd $(DIR_APP) && cp -v vmlinux /boot/vmlinuz-$(VER)-ipfire-xen
-       cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-ipfire-xen
-       ln -sf vmlinuz-$(VER)-ipfire-xen /boot/vmlinuz-ipfire-xen
-       cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules
-       cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install
-       cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) firmware_install
+       cd $(DIR_APP) && cp -v vmlinux /boot/vmlinuz-$(VER)-$(VERSUFIX)
+       cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-$(VERSUFIX)
+       ln -sf vmlinuz-$(VER)--$(VERSUFIX) /boot/vmlinuz-$(VERSUFIX)
 else
-       cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(PATCHLEVEL)-ipfire/' Makefile
        cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage
-       cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER)-ipfire
-       cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-ipfire
-       cd $(DIR_APP) && cp -v .config /boot/config-$(VER)-ipfire
-       ln -sf vmlinuz-$(VER)-ipfire /boot/vmlinuz-ipfire
-       ln -sf System.map-$(VER)-ipfire /boot/System.map-ipfire
+       cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER)-$(VERSUFIX)
+       cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-$(VERSUFIX)
+       cd $(DIR_APP) && cp -v .config /boot/config-$(VER)-$(VERSUFIX)
+       ln -sf vmlinuz-$(VER)-$(VERSUFIX) /boot/vmlinuz-$(VERSUFIX)
+       ln -sf System.map-$(VER)-$(VERSUFIX) /boot/System.map-$(VERSUFIX)
+endif
        cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules
        cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install
        cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) firmware_install
-endif
 
 ifeq "$(XEN)" ""
        # Only do this once on the non-XEN pass
        cd $(DIR_APP) && install -m 755 usr/gen_init_cpio /sbin/
 endif 
 
-ifeq "$(XEN)" "1"
        # Rename ide-cd module to match with old kernel
-       mv /lib/modules/$(VER)-ipfire-xen/kernel/drivers/ide/ide-cd_mod.ko \
-           /lib/modules/$(VER)-ipfire-xen/kernel/drivers/ide/ide-cd.ko
+       mv /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/ide/ide-cd_mod.ko \
+          /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/ide/ide-cd.ko
 
        # Remove mISDN modules
-       rm -rvf /lib/modules/$(VER)-ipfire-xen/kernel/drivers/isdn/mISDN
-       rm -rvf /lib/modules/$(VER)-ipfire-xen/kernel/drivers/isdn/hardware/mISDN
-else
-       # Rename ide-cd module to match with old kernel
-       mv /lib/modules/$(VER)-ipfire/kernel/drivers/ide/ide-cd_mod.ko \
-           /lib/modules/$(VER)-ipfire/kernel/drivers/ide/ide-cd.ko
-
-       # Remove mISDN modules
-       rm -rvf /lib/modules/$(VER)-ipfire/kernel/drivers/isdn/mISDN
-       rm -rvf /lib/modules/$(VER)-ipfire/kernel/drivers/isdn/hardware/mISDN
-endif
+       rm -rvf /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/isdn/mISDN
+       rm -rvf /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/isdn/hardware/mISDN
 
        @rm -rf $(DIR_SRC)/patch-o-matic* $(DIR_SRC)/iptables* $(DIR_SRC)/squashfs* $(DIR_SRC)/netfilter-layer7-*
        @$(POSTBUILD)
index 077ac03..0a35dda 100644 (file)
--- a/lfs/mISDN
+++ b/lfs/mISDN
 
 include Config
 
+ifeq "$(XEN)" "1"
+       VERSUFIX=ipfire-xen
+else
+       VERSUFIX=ipfire
+endif
+
 VER        = 9bf7deaa4b8829ab8fbccb34529a17aab2ddea93
 
 THISAPP    = mISDN.git-$(VER)
 DL_FILE    = $(THISAPP).tar.gz
 DL_FROM    = $(URL_IPFIRE)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
-TARGET     = $(DIR_INFO)/$(THISAPP)
+TARGET     = $(DIR_INFO)/$(THISAPP)-kmod-$(KVER)-$(VERSUFIX)
 
 ###############################################################################
 # Top-level Rules
@@ -70,9 +76,10 @@ $(subst %,%_MD5,$(objects)) :
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
        @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
-       cd $(DIR_SRC)/mISDN.git && KVERS=$(KVER)-ipfire make force
-       cd $(DIR_SRC)/mISDN.git && KVERS=$(KVER)-ipfire make $(MAKETUNING)
-       cd $(DIR_SRC)/mISDN.git && KVERS=$(KVER)-ipfire make install DEPMOD="depmod $(KVER)-ipfire"
-       mv /lib/modules/$(KVER)-ipfire/extra /lib/modules/$(KVER)-ipfire/mISDN
+       cd $(DIR_SRC)/mISDN.git && KVERS=$(KVER)-$(VERSUFIX) make force
+       cd $(DIR_SRC)/mISDN.git && KVERS=$(KVER)-$(VERSUFIX) make $(MAKETUNING)
+       cd $(DIR_SRC)/mISDN.git && KVERS=$(KVER)-$(VERSUFIX) \
+               INSTALL_PREFIX=/lib/modules/$(KVER)-$(VERSUFIX)/mISDN \
+               make modules-install
        @rm -rf $(DIR_SRC)/mISDN*
        @$(POSTBUILD)
index e6e7104..6d657cc 100644 (file)
 
 include Config
 
+ifeq "$(XEN)" "1"
+       VERSUFIX=ipfire-xen
+else
+       VERSUFIX=ipfire
+endif
+
 VER        = hal-testing-r4003-20090416
 
 THISAPP    = madwifi-$(VER)
 DL_FILE    = $(THISAPP).tar.gz
 DL_FROM    = $(URL_IPFIRE)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
-ifeq "$(SMP)" ""
-  TARGET     = $(DIR_INFO)/$(THISAPP)-kmod-$(KVER)
-else
-  TARGET     = $(DIR_INFO)/$(THISAPP)-smp
-endif
+TARGET     = $(DIR_INFO)/$(THISAPP)-kmod-$(KVER)-$(VERSUFIX)
 
 ###############################################################################
 # Top-level Rules
@@ -77,15 +79,14 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        cd $(DIR_APP) && make $(MAKETUNING) KERNELPATH=/usr/src/linux
        cd $(DIR_APP) && make KERNELPATH=/usr/src/linux BINDIR=/usr/bin \
                                MANDIR=/usr/man install
-ifeq "$(SMP)" ""
-       cp $(DIR_SRC)/config/madwifi/madwifi.conf /etc/
-       ln -s $(DIR_APP) $(DIR_SRC)/madwifi 
-endif
+       cp -f $(DIR_SRC)/config/madwifi/madwifi.conf /etc/
+       ln -sf $(DIR_APP) $(DIR_SRC)/madwifi 
+
        # Set Countrycode to germany because some cards
        # are not detected without cc
        echo options ath_pci countrycode=276 > /etc/modprobe.d/madwifi
 
        # create madwifi symlink for hostapd build
-       cd $(DIR_SRC) && ln -s $(THISAPP) madwifi
+       cd $(DIR_SRC) && ln -sf $(THISAPP) madwifi
 
        @$(POSTBUILD)
index 29cc418..5b28a84 100644 (file)
 
 include Config
 
+ifeq "$(XEM)" "1"
+       VERSUFIX=ipfire-xen
+else
+       VERSUFIX=ipfire
+endif
+
 VER        = 2.6.21
 
 THISAPP    = openswan-$(VER)
 DL_FILE    = $(THISAPP).tar.gz
 DL_FROM    = $(URL_IPFIRE)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
+
 ifeq "$(KMOD)" "1"
-ifeq "$(SMP)" "1"
-TARGET     = $(DIR_INFO)/$(THISAPP)-kmod-smp
-else
-TARGET     = $(DIR_INFO)/$(THISAPP)-kmod-$KVER
-endif
+       TARGET = $(DIR_INFO)/$(THISAPP)-kmod-$(KVER)-$(VERSUFIX)
 else
-TARGET     = $(DIR_INFO)/$(THISAPP)
+       TARGET = $(DIR_INFO)/$(THISAPP)
 endif
 
 ###############################################################################
index 94f19fd..12915aa 100644 (file)
 
 include Config
 
+ifeq "$(XEN)" "1"
+       VERSUFIX=ipfire-xen
+else
+       VERSUFIX=ipfire
+endif
+
 VER        = 4cd17f5a20cc
 
 THISAPP    = v4l-dvb-$(VER)
@@ -31,12 +37,7 @@ DL_FILE    = $(THISAPP).tar.bz2
 DL_FROM    = $(URL_IPFIRE)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
 PAK_VER    = 2
-ifeq "$(SMP)" "1"
-       TARGET     = $(DIR_INFO)/$(THISAPP)-smp
-else
-       TARGET     = $(DIR_INFO)/$(THISAPP)-kmod-$(KVER)
-endif
-
+TARGET     = $(DIR_INFO)/$(THISAPP)-kmod-$(KVER)-$(VERSUFIX)
 
 ###############################################################################
 # Top-level Rules
@@ -79,13 +80,9 @@ $(subst %,%_MD5,$(objects)) :
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
        @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
-ifeq "$(SMP)" "1"
-       cd $(DIR_APP) && make release VER=$(KVER)-ipfire-smp
-else
-       cd $(DIR_APP) && make release VER=$(KVER)-ipfire
-endif
+       cd $(DIR_APP) && make release VER=$(KVER)-$(VERSUFIX)
        cd $(DIR_APP) && make $(MAKETUNING) all
        cd $(DIR_APP) && make install
-       -ln -s $(DIR_APP)/ /usr/src/v4l-dvb
+       ln -sf $(DIR_APP)/ /usr/src/v4l-dvb
 #      @rm -rf $(DIR_APP)
        @$(POSTBUILD)
diff --git a/make.sh b/make.sh
index b15bf80..a913a3b 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -337,6 +337,16 @@ buildipfire() {
   ipfiremake rp-pppoe
   ipfiremake pptp
   ipfiremake unzip
+  ipfiremake which
+  ipfiremake linux                     XEN=1
+  ipfiremake atl2                      XEN=1
+  ipfiremake kqemu                     XEN=1
+  ipfiremake v4l-dvb                   XEN=1
+  ipfiremake madwifi                   XEN=1
+#  ipfiremake alsa                     XEN=1 KMOD=1
+  ipfiremake openswan                  XEN=1 KMOD=1
+  ipfiremake mISDN                     XEN=1
+  ipfiremake compat-wireless           XEN=1
   ipfiremake linux
   ipfiremake atl2
   ipfiremake kqemu
@@ -345,9 +355,7 @@ buildipfire() {
   ipfiremake alsa                      KMOD=1
   ipfiremake openswan                  KMOD=1
   ipfiremake mISDN
-  ipfiremake which
   ipfiremake compat-wireless
-  ipfiremake linux                     XEN=1
   ipfiremake pkg-config
   ipfiremake linux-atm
   ipfiremake cpio
@@ -598,7 +606,7 @@ buildipfire() {
   ipfiremake perl-gettext
   ipfiremake vdradmin
   ipfiremake x11libs
-  ipfiremake xen
+#  ipfiremake xen
   ipfiremake miau
   ipfiremake net-snmp
   ipfiremake perl-DBI