Fix oinkmaster patch.
[people/pmueller/ipfire-2.x.git] / lfs / linux
CommitLineData
df5e82b3 1###############################################################################
df5e82b3 2# #
70df8302
MT
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 #
df5e82b3 7# it under the terms of the GNU General Public License as published by #
70df8302 8# the Free Software Foundation, either version 3 of the License, or #
df5e82b3
MT
9# (at your option) any later version. #
10# #
70df8302 11# This program is distributed in the hope that it will be useful, #
df5e82b3
MT
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 #
70df8302 17# along with this program. If not, see <http://www.gnu.org/licenses/>. #
df5e82b3 18# #
df5e82b3
MT
19###############################################################################
20
21###############################################################################
22# Definitions
23###############################################################################
24
25include Config
26
b3cede08
AF
27PATCHLEVEL = .39
28VER = 2.6.27.39
df5e82b3
MT
29
30THISAPP = linux-$(VER)
376e42ce 31DL_FILE = $(THISAPP).tar.bz2
a2cb3a33 32DL_FROM = $(URL_IPFIRE)
df5e82b3
MT
33DIR_APP = $(DIR_SRC)/$(THISAPP)
34CFLAGS =
35CXXFLAGS =
36
acdf0e61 37PROG = linux-xen
b3cede08 38PAK_VER = 6
acdf0e61 39DEPS = ""
bd9921dd
MT
40
41# Normal build or XEN build.
df5e82b3 42#
3c4d4ed0
AF
43ifeq "$(XEN)" "1"
44 VERSUFIX=ipfire-xen
45else
46 VERSUFIX=ipfire
47endif
2b2e03ed 48TARGET = $(DIR_INFO)/linux-$(VER)-$(VERSUFIX)
6230f0da 49
df5e82b3
MT
50###############################################################################
51# Top-level Rules
52###############################################################################
53objects =$(DL_FILE) \
9c534116 54 squashfs3.4.tar.gz \
d1fd2b03 55 netfilter-layer7-v2.21.tar.gz \
f418a984 56 patch-2.6.16-nath323-1.3.bz2 \
a3b414d3 57 reiser4-for-2.6.27.19.patch.bz2
38f05351 58
64cf4991 59$(DL_FILE) = $(URL_IPFIRE)/$(DL_FILE)
d1fd2b03 60netfilter-layer7-v2.21.tar.gz = $(URL_IPFIRE)/netfilter-layer7-v2.21.tar.gz
4ce37908 61patch-2.6.16-nath323-1.3.bz2 = $(URL_IPFIRE)/patch-2.6.16-nath323-1.3.bz2
9c534116 62squashfs3.4.tar.gz = $(URL_IPFIRE)/squashfs3.4.tar.gz
a3b414d3 63reiser4-for-2.6.27.19.patch.bz2 = $(URL_IPFIRE)/reiser4-for-2.6.27.19.patch.bz2
4ce37908 64
b3cede08 65$(DL_FILE)_MD5 = a1f935b170d9b63c0771a579b46c1123
d1fd2b03 66netfilter-layer7-v2.21.tar.gz_MD5 = 838422e7d9a06b42e682e9064e5210b5
3185932e 67patch-2.6.16-nath323-1.3.bz2_MD5 = f926409ff703a307baf54b57ab75d138
9c534116 68squashfs3.4.tar.gz_MD5 = 2a4d2995ad5aa6840c95a95ffa6b1da6
a3b414d3 69reiser4-for-2.6.27.19.patch.bz2_MD5 = 22988387f64f299489b90b484b2642cc
df5e82b3
MT
70
71install : $(TARGET)
72
73check : $(patsubst %,$(DIR_CHK)/%,$(objects))
74
75download :$(patsubst %,$(DIR_DL)/%,$(objects))
76
77md5 : $(subst %,%_MD5,$(objects))
78
f418a984
AF
79dist:
80 @$(PAK)
df5e82b3
MT
81###############################################################################
82# Downloading, checking, md5sum
83###############################################################################
84
85$(patsubst %,$(DIR_CHK)/%,$(objects)) :
86 @$(CHECK)
87
88$(patsubst %,$(DIR_DL)/%,$(objects)) :
89 @$(LOAD)
90
91$(subst %,%_MD5,$(objects)) :
92 @$(MD5)
93
94###############################################################################
95# Installation Details
96###############################################################################
97
98$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
99 @$(PREBUILD)
f418a984 100 @rm -rf $(DIR_APP) $(DIR_SRC)/linux $(DIR_SRC)/xen-* && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
8eec2184 101 ln -s linux-$(VER) /usr/src/linux
3a1019f6 102
3c4d4ed0
AF
103ifeq "$(XEN)" "1"
104 # Apply Xen patches (provided by SuSE)
105 cd $(DIR_SRC)/src/patches/suse-$(VER) && \
106 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 \
107 patch -d $(DIR_APP) -p1 < $$x || break; \
108 done
109
110 # Linux Intermediate Queueing Device
111 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/imq-skbuff.patch
112 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.27.21-imq-test3-xen.patch
113else
bd9921dd 114 # Linux Intermediate Queueing Device
3a65a332 115 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.27.21-imq-test3.patch
3c4d4ed0 116endif
bd9921dd 117
708a5196
AF
118 # Add Vodafone K3565-Z USB ID's to option driver
119 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.27.25-option_add_vf-k3565-z_usbids.patch
120
625b94f4
AF
121 # Add Alix to Led Driver
122 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.24-leds-alix.patch
123
179d4328
AF
124 # Patch to fix Intel e100 wake on lan
125 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.27.39_e100-wakeonlan-fix.patch
126
3c4d4ed0
AF
127 # Not report deprecated syscall 1.23 (for kudzu)
128 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.25.18-not_report_sysctl_1.23.patch
129ifeq "$(XEN)" ""
44254afd 130 # Reiser4
3c4d4ed0
AF
131 -cd $(DIR_APP) && bzip2 -d -c $(DIR_DL)/reiser4-for-2.6.27.19.patch.bz2 | patch -Np1
132
133 # SquashFS (already in Suse Patchset)
3185932e 134 cd $(DIR_SRC) && rm -rf squashfs*
9c534116 135 cd $(DIR_SRC) && tar xfz $(DIR_DL)/squashfs3.4.tar.gz
a3b414d3 136 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/squashfs3.4/kernel-patches/linux-2.6.27-rc4/squashfs3.4-patch
3c4d4ed0 137endif
a3b414d3 138
4f1b7a27 139 # ipp2p 0.8.2-pomng
a3b414d3 140 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.27.19-ipp2p-0.8.2-pomng.patch
4f1b7a27 141
3a1019f6 142 # Layer7-patch
d1fd2b03
AF
143 cd $(DIR_SRC) && rm -rf $(DIR_SRC)/netfilter-layer7-v2.21
144 cd $(DIR_SRC) && tar xzf $(DIR_DL)/netfilter-layer7-v2.21.tar.gz
145 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/netfilter-layer7-v2.21/kernel-2.6.25-2.6.28-layer7-2.21.patch
df5e82b3 146
df5e82b3
MT
147 # Cleanup kernel source
148 cd $(DIR_APP) && make mrproper
3a1019f6 149
2b2e03ed 150 cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE)-$(VERSUFIX) $(DIR_APP)/.config
bd9921dd 151 cd $(DIR_APP) && make CC="$(KGCC)" oldconfig
df5e82b3 152 cd $(DIR_APP) && make CC="$(KGCC)" clean
2b2e03ed 153 cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(PATCHLEVEL)-$(VERSUFIX)/' Makefile
3a1019f6 154
3c4d4ed0
AF
155ifeq "$(XEN)" "1"
156 cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" vmlinuz
157 cd $(DIR_APP) && cp -v arch/i386/boot/vmlinuz /boot/vmlinuz-$(VER)-$(VERSUFIX)
158else
872e5216 159 cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage
2b2e03ed 160 cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER)-$(VERSUFIX)
3c4d4ed0 161endif
2b2e03ed
AF
162 cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-$(VERSUFIX)
163 cd $(DIR_APP) && cp -v .config /boot/config-$(VER)-$(VERSUFIX)
164 ln -sf vmlinuz-$(VER)-$(VERSUFIX) /boot/vmlinuz-$(VERSUFIX)
165 ln -sf System.map-$(VER)-$(VERSUFIX) /boot/System.map-$(VERSUFIX)
376e42ce
MT
166 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules
167 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install
a3b414d3 168 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) firmware_install
376e42ce 169
3c4d4ed0 170ifeq "$(XEN)" ""
bd9921dd 171 # Only do this once on the non-XEN pass
81e974f3 172 cd $(DIR_APP) && install -m 755 usr/gen_init_cpio /sbin/
3c4d4ed0 173endif
ee78a5ef 174
bd9921dd 175 # Rename ide-cd module to match with old kernel
2b2e03ed
AF
176 mv /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/ide/ide-cd_mod.ko \
177 /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/ide/ide-cd.ko
bd9921dd
MT
178
179 # Remove mISDN modules
2b2e03ed
AF
180 rm -rvf /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/isdn/mISDN
181 rm -rvf /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/isdn/hardware/mISDN
d644d86f
AF
182
183 @rm -rf $(DIR_SRC)/patch-o-matic* $(DIR_SRC)/iptables* $(DIR_SRC)/squashfs* $(DIR_SRC)/netfilter-layer7-*
df5e82b3 184 @$(POSTBUILD)