Xen kernel fixes.
[people/teissler/ipfire-2.x.git] / lfs / linux-xen
CommitLineData
09d7a82c
BS
1###############################################################################
2# #
3# IPFire.org - A linux based firewall #
4# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
5# #
6# This program is free software: you can redistribute it and/or modify #
7# it under the terms of the GNU General Public License as published by #
8# the Free Software Foundation, either version 3 of the License, or #
9# (at your option) any later version. #
10# #
11# This program is distributed in the hope that it will be useful, #
12# but WITHOUT ANY WARRANTY; without even the implied warranty of #
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14# GNU General Public License for more details. #
15# #
16# You should have received a copy of the GNU General Public License #
17# along with this program. If not, see <http://www.gnu.org/licenses/>. #
18# #
19###############################################################################
20
21###############################################################################
22# Definitions
23###############################################################################
24
25include Config
26
27PATCHLEVEL = .25
28VER = 2.6.27.25
29
30THISAPP = linux-$(VER)
31DL_FILE = $(THISAPP).tar.bz2
32DL_FROM = $(URL_IPFIRE)
33DIR_APP = $(DIR_SRC)/$(THISAPP)
34CFLAGS =
35CXXFLAGS =
36
37PROG = linux-xen
38PAK_VER = 4
39DEPS = ""
40
41# Normal build or XEN build.
42#
43VERSUFIX=ipfire-xen
44TARGET = $(DIR_INFO)/linux-$(VER)-$(VERSUFIX)
45
46###############################################################################
47# Top-level Rules
48###############################################################################
49objects =$(DL_FILE) \
50 squashfs3.4.tar.gz \
51 netfilter-layer7-v2.21.tar.gz \
52 patch-2.6.16-nath323-1.3.bz2 \
53 reiser4-for-2.6.27.19.patch.bz2
54
55$(DL_FILE) = $(URL_IPFIRE)/$(DL_FILE)
56netfilter-layer7-v2.21.tar.gz = $(URL_IPFIRE)/netfilter-layer7-v2.21.tar.gz
57patch-2.6.16-nath323-1.3.bz2 = $(URL_IPFIRE)/patch-2.6.16-nath323-1.3.bz2
58squashfs3.4.tar.gz = $(URL_IPFIRE)/squashfs3.4.tar.gz
59reiser4-for-2.6.27.19.patch.bz2 = $(URL_IPFIRE)/reiser4-for-2.6.27.19.patch.bz2
60
61$(DL_FILE)_MD5 = 5d6dcff157f30d742c9ee28ad4589779
62netfilter-layer7-v2.21.tar.gz_MD5 = 838422e7d9a06b42e682e9064e5210b5
63patch-2.6.16-nath323-1.3.bz2_MD5 = f926409ff703a307baf54b57ab75d138
64squashfs3.4.tar.gz_MD5 = 2a4d2995ad5aa6840c95a95ffa6b1da6
65reiser4-for-2.6.27.19.patch.bz2_MD5 = 22988387f64f299489b90b484b2642cc
66
67install : $(TARGET)
68
69check : $(patsubst %,$(DIR_CHK)/%,$(objects))
70
71download :$(patsubst %,$(DIR_DL)/%,$(objects))
72
73md5 : $(subst %,%_MD5,$(objects))
74
75dist:
76 @$(PAK)
77###############################################################################
78# Downloading, checking, md5sum
79###############################################################################
80
81$(patsubst %,$(DIR_CHK)/%,$(objects)) :
82 @$(CHECK)
83
84$(patsubst %,$(DIR_DL)/%,$(objects)) :
85 @$(LOAD)
86
87$(subst %,%_MD5,$(objects)) :
88 @$(MD5)
89
90###############################################################################
91# Installation Details
92###############################################################################
93
94$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
95 @$(PREBUILD)
96 @rm -rf $(DIR_APP) $(DIR_SRC)/linux $(DIR_SRC)/xen-* && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
97 ln -s linux-$(VER) /usr/src/linux
98
99 # Apply Xen patches (provided by SuSE)
100 cd $(DIR_SRC)/src/patches/suse-$(VER) && \
101 for x in $$( $(DIR_SRC)/src/patches/suse-$(VER)/guards $$( $(DIR_SRC)/src/patches/suse-$(VER)/arch-symbols) < $(DIR_SRC)/src/patches/suse-$(VER)/series.conf); do \
102 patch -d $(DIR_APP) -p1 < $$x || break; \
103 done
104
105 # Linux Intermediate Queueing Device
106 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/imq-skbuff.patch
107 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.27.21-imq-test3-xen.patch
108
109 # Not report deprecated syscall 1.23 (for kudzu)
110 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.25.18-not_report_sysctl_1.23.patch
111
112 # ipp2p 0.8.2-pomng
113 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.27.19-ipp2p-0.8.2-pomng.patch
114
115 # Layer7-patch
116 cd $(DIR_SRC) && rm -rf $(DIR_SRC)/netfilter-layer7-v2.21
117 cd $(DIR_SRC) && tar xzf $(DIR_DL)/netfilter-layer7-v2.21.tar.gz
118 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/netfilter-layer7-v2.21/kernel-2.6.25-2.6.28-layer7-2.21.patch
119
120 # Cleanup kernel source
121 cd $(DIR_APP) && make mrproper
122
123 cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE)-$(VERSUFIX) $(DIR_APP)/.config
124 cd $(DIR_APP) && make CC="$(KGCC)" oldconfig
125 cd $(DIR_APP) && make CC="$(KGCC)" clean
126 cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(PATCHLEVEL)-$(VERSUFIX)/' Makefile
127
128
129 cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" && make modules_install
130 cd $(DIR_APP) && cp -v arch/i386/boot/vmlinuz /boot/vmlinuz-$(VER)-$(VERSUFIX)
131
132 cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-$(VERSUFIX)
133 cd $(DIR_APP) && cp -v .config /boot/config-$(VER)-$(VERSUFIX)
134 ln -sf vmlinuz-$(VER)-$(VERSUFIX) /boot/vmlinuz-$(VERSUFIX)
135 ln -sf System.map-$(VER)-$(VERSUFIX) /boot/System.map-$(VERSUFIX)
136 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules
137 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install
138 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) firmware_install
139
140 # Rename ide-cd module to match with old kernel
141 mv /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/ide/ide-cd_mod.ko \
142 /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/ide/ide-cd.ko
143
144 # Remove mISDN modules
145 rm -rvf /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/isdn/mISDN
146 rm -rvf /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/isdn/hardware/mISDN
147
148 @rm -rf $(DIR_SRC)/patch-o-matic* $(DIR_SRC)/iptables* $(DIR_SRC)/squashfs* $(DIR_SRC)/netfilter-layer7-*
149 @$(POSTBUILD)
150