Add Atom cpu to p4-clockmod.
[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
591d0154
AF
27PATCHLEVEL = .42
28VER = 2.6.27.42
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
f5b23e51 38PAK_VER = 7
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 \
e69f1bf2 57 reiser4-for-2.6.27.19.patch.bz2 \
f5b23e51 58 linux-$(VER)-suse_xen_patches-1.tar.bz2
e69f1bf2 59
64cf4991 60$(DL_FILE) = $(URL_IPFIRE)/$(DL_FILE)
d1fd2b03 61netfilter-layer7-v2.21.tar.gz = $(URL_IPFIRE)/netfilter-layer7-v2.21.tar.gz
4ce37908 62patch-2.6.16-nath323-1.3.bz2 = $(URL_IPFIRE)/patch-2.6.16-nath323-1.3.bz2
9c534116 63squashfs3.4.tar.gz = $(URL_IPFIRE)/squashfs3.4.tar.gz
a3b414d3 64reiser4-for-2.6.27.19.patch.bz2 = $(URL_IPFIRE)/reiser4-for-2.6.27.19.patch.bz2
e2b8b617 65linux-$(VER)-suse_xen_patches-1.tar.bz2 = $(URL_IPFIRE)/linux-$(VER)-suse_xen_patches-1.tar.bz2
e69f1bf2 66
4ce37908 67
591d0154 68$(DL_FILE)_MD5 = a33e6b22d70dd010525fc43cdda36792
d1fd2b03 69netfilter-layer7-v2.21.tar.gz_MD5 = 838422e7d9a06b42e682e9064e5210b5
3185932e 70patch-2.6.16-nath323-1.3.bz2_MD5 = f926409ff703a307baf54b57ab75d138
9c534116 71squashfs3.4.tar.gz_MD5 = 2a4d2995ad5aa6840c95a95ffa6b1da6
a3b414d3 72reiser4-for-2.6.27.19.patch.bz2_MD5 = 22988387f64f299489b90b484b2642cc
f5b23e51 73linux-$(VER)-suse_xen_patches-1.tar.bz2_MD5 = ddbde50f3bc303d947531402017a3055
df5e82b3
MT
74
75install : $(TARGET)
76
77check : $(patsubst %,$(DIR_CHK)/%,$(objects))
78
79download :$(patsubst %,$(DIR_DL)/%,$(objects))
80
81md5 : $(subst %,%_MD5,$(objects))
82
f418a984
AF
83dist:
84 @$(PAK)
df5e82b3
MT
85###############################################################################
86# Downloading, checking, md5sum
87###############################################################################
88
89$(patsubst %,$(DIR_CHK)/%,$(objects)) :
90 @$(CHECK)
91
92$(patsubst %,$(DIR_DL)/%,$(objects)) :
93 @$(LOAD)
94
95$(subst %,%_MD5,$(objects)) :
96 @$(MD5)
97
98###############################################################################
99# Installation Details
100###############################################################################
101
102$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
103 @$(PREBUILD)
e69f1bf2 104 @rm -rf $(DIR_APP) $(DIR_SRC)/linux $(DIR_SRC)/linux-*-suse_xen_patches $(DIR_SRC)/xen-* && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
8eec2184 105 ln -s linux-$(VER) /usr/src/linux
3a1019f6 106
3c4d4ed0
AF
107ifeq "$(XEN)" "1"
108 # Apply Xen patches (provided by SuSE)
f5b23e51
AF
109 cd $(DIR_SRC) && tar jxf $(DIR_DL)/linux-$(VER)-suse_xen_patches-1.tar.bz2
110 cp -f $(DIR_SRC)/src/patches/suse_xen_series.conf $(DIR_SRC)/linux-$(VER)-suse_xen_patches/series.conf
e69f1bf2
AF
111 cd $(DIR_SRC)/linux-$(VER)-suse_xen_patches && \
112 for x in $$( ./guards $$( ./arch-symbols) < ./series.conf); do \
f5b23e51 113 echo "*********** [Patch: $$x]"; \
3c4d4ed0
AF
114 patch -d $(DIR_APP) -p1 < $$x || break; \
115 done
e69f1bf2 116 rm -rf $(DIR_SRC)/linux-*-suse_xen_patches
3c4d4ed0
AF
117
118 # Linux Intermediate Queueing Device
119 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/imq-skbuff.patch
120 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.27.21-imq-test3-xen.patch
121else
bd9921dd 122 # Linux Intermediate Queueing Device
3a65a332 123 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.27.21-imq-test3.patch
3c4d4ed0 124endif
bd9921dd 125
708a5196
AF
126 # Add Vodafone K3565-Z USB ID's to option driver
127 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.27.25-option_add_vf-k3565-z_usbids.patch
128
625b94f4
AF
129 # Add Alix to Led Driver
130 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.24-leds-alix.patch
131
179d4328
AF
132 # Patch to fix Intel e100 wake on lan
133 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.27.39_e100-wakeonlan-fix.patch
134
3c4d4ed0
AF
135 # Not report deprecated syscall 1.23 (for kudzu)
136 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.25.18-not_report_sysctl_1.23.patch
137ifeq "$(XEN)" ""
44254afd 138 # Reiser4
3c4d4ed0
AF
139 -cd $(DIR_APP) && bzip2 -d -c $(DIR_DL)/reiser4-for-2.6.27.19.patch.bz2 | patch -Np1
140
141 # SquashFS (already in Suse Patchset)
3185932e 142 cd $(DIR_SRC) && rm -rf squashfs*
9c534116 143 cd $(DIR_SRC) && tar xfz $(DIR_DL)/squashfs3.4.tar.gz
a3b414d3 144 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/squashfs3.4/kernel-patches/linux-2.6.27-rc4/squashfs3.4-patch
3c4d4ed0 145endif
a3b414d3 146
4f1b7a27 147 # ipp2p 0.8.2-pomng
a3b414d3 148 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.27.19-ipp2p-0.8.2-pomng.patch
4f1b7a27 149
cfa7d74f
CS
150 # Intel Atom Coretemp Patch
151 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.27-atom-coretemp.patch
9237fb85
AF
152 # Intel Atom P4-clockmod Patch
153 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.27-atom-clockmod.patch
154
3a1019f6 155 # Layer7-patch
d1fd2b03
AF
156 cd $(DIR_SRC) && rm -rf $(DIR_SRC)/netfilter-layer7-v2.21
157 cd $(DIR_SRC) && tar xzf $(DIR_DL)/netfilter-layer7-v2.21.tar.gz
158 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/netfilter-layer7-v2.21/kernel-2.6.25-2.6.28-layer7-2.21.patch
df5e82b3 159
df5e82b3
MT
160 # Cleanup kernel source
161 cd $(DIR_APP) && make mrproper
3a1019f6 162
2b2e03ed 163 cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE)-$(VERSUFIX) $(DIR_APP)/.config
bd9921dd 164 cd $(DIR_APP) && make CC="$(KGCC)" oldconfig
df5e82b3 165 cd $(DIR_APP) && make CC="$(KGCC)" clean
2b2e03ed 166 cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(PATCHLEVEL)-$(VERSUFIX)/' Makefile
3a1019f6 167
3c4d4ed0
AF
168ifeq "$(XEN)" "1"
169 cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" vmlinuz
170 cd $(DIR_APP) && cp -v arch/i386/boot/vmlinuz /boot/vmlinuz-$(VER)-$(VERSUFIX)
171else
872e5216 172 cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage
2b2e03ed 173 cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER)-$(VERSUFIX)
3c4d4ed0 174endif
2b2e03ed
AF
175 cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-$(VERSUFIX)
176 cd $(DIR_APP) && cp -v .config /boot/config-$(VER)-$(VERSUFIX)
177 ln -sf vmlinuz-$(VER)-$(VERSUFIX) /boot/vmlinuz-$(VERSUFIX)
178 ln -sf System.map-$(VER)-$(VERSUFIX) /boot/System.map-$(VERSUFIX)
376e42ce
MT
179 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules
180 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install
a3b414d3 181 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) firmware_install
376e42ce 182
3c4d4ed0 183ifeq "$(XEN)" ""
bd9921dd 184 # Only do this once on the non-XEN pass
81e974f3 185 cd $(DIR_APP) && install -m 755 usr/gen_init_cpio /sbin/
3c4d4ed0 186endif
ee78a5ef 187
bd9921dd 188 # Rename ide-cd module to match with old kernel
2b2e03ed
AF
189 mv /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/ide/ide-cd_mod.ko \
190 /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/ide/ide-cd.ko
bd9921dd
MT
191
192 # Remove mISDN modules
2b2e03ed
AF
193 rm -rvf /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/isdn/mISDN
194 rm -rvf /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/isdn/hardware/mISDN
d644d86f
AF
195
196 @rm -rf $(DIR_SRC)/patch-o-matic* $(DIR_SRC)/iptables* $(DIR_SRC)/squashfs* $(DIR_SRC)/netfilter-layer7-*
df5e82b3 197 @$(POSTBUILD)