]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blame - lfs/linux
Removed old ide stack. Now we use libata.
[people/ms/ipfire-3.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
be472d5a 27PKG_NAME = linux
0f6feafb 28VER = 2.6.25.6
df5e82b3 29
be472d5a 30THISAPP = $(PKG_NAME)-$(VER)
376e42ce 31DL_FILE = $(THISAPP).tar.bz2
df5e82b3
MT
32DIR_APP = $(DIR_SRC)/$(THISAPP)
33CFLAGS =
34CXXFLAGS =
35
3888140c 36TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
df5e82b3 37
0f6feafb
MT
38LOCALVERSION = -ipfire1
39FULLVER = $(VER)$(LOCALVERSION)
f76aefec 40
df5e82b3
MT
41###############################################################################
42# Top-level Rules
43###############################################################################
246556fe 44
0f6feafb
MT
45objects = $(DL_FILE) reiser4-for-2.6.25.patch
46
47ifeq "$(PAX)" "1"
48 objects += grsecurity-2.1.12-$(VER)-200806092111.patch
49endif
50
51ifeq "$(SSP)" "1"
52 objects += linux-2.6.25-frandom-1.patch
53endif
df5e82b3 54
df5e82b3
MT
55install : $(TARGET)
56
87703b91 57download : $(objects)
df5e82b3 58
87703b91 59$(objects) :
df5e82b3
MT
60 @$(LOAD)
61
df5e82b3
MT
62###############################################################################
63# Installation Details
64###############################################################################
65
4b804071 66$(TARGET) :
df5e82b3 67 @$(PREBUILD)
f76aefec 68 @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
0f6feafb
MT
69
70 cd $(DIR_APP) && echo "$(LOCALVERSION)" > localversion-ipfire
71
72ifeq "$(SSP)" "1"
73 ### frandom
74 #
75 cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/linux-2.6.25-frandom-1.patch
76endif
77
cc0b96e4
MT
78 ### Reiser4
79 #
0f6feafb
MT
80 cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/reiser4-for-2.6.25.patch
81
82ifeq "$(PAX)" "1"
83 ### GrSecurity
cc0b96e4 84 #
0f6feafb
MT
85 cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/grsecurity-2.1.12-$(VER)-200806092111.patch
86 rm -f $(DIR_APP)/localversion-grsec
87endif
89069053 88
be472d5a 89ifeq "$(STAGE)" "toolchain"
acef7362 90 install -dv $(TOOLS_DIR)/include
df5e82b3 91 cd $(DIR_APP) && make mrproper
43ed0676
MT
92 cd $(DIR_APP) && make ARCH=x86 headers_check
93 cd $(DIR_APP) && make ARCH=x86 INSTALL_HDR_PATH=dest headers_install
be472d5a 94 cd $(DIR_APP) && cp -rv dest/include/* $(TOOLS_DIR)/include
df5e82b3 95endif
376e42ce 96
3888140c 97ifeq "$(STAGE)" "base"
3888140c 98 cd $(DIR_APP) && make mrproper
43ed0676
MT
99 cd $(DIR_APP) && make ARCH=x86 headers_check
100 cd $(DIR_APP) && make ARCH=x86 INSTALL_HDR_PATH=dest headers_install
3888140c
MT
101 cd $(DIR_APP) && cp -rv dest/include/* /usr/include
102endif
103
f76aefec 104ifeq "$(STAGE)" "ipfire"
f76aefec 105
f76aefec 106 cd $(DIR_APP) && make mrproper
acef7362 107
8b78946b 108 -[ "$(IFS_ARCH)" == "i586" ] && \
acef7362
MT
109 sed -e "s/^CONFIG_M686=y/# CONFIG_686 is not set/" \
110 -e "s/^# CONFIG_MPENTIUMIII is not set/CONFIG_MPENTIUMII=y/" \
111 < $(DIR_CONF)/kernel/kernel.config > $(DIR_APP)/.config
112
8b78946b 113 -[ "$(IFS_ARCH)" == "i486" ] && \
acef7362
MT
114 sed -e "s/^CONFIG_M686=y/# CONFIG_686 is not set/" \
115 -e "s/^# CONFIG_M486 is not set/CONFIG_M486=y/" \
116 < $(DIR_CONF)/kernel/kernel.config > $(DIR_APP)/.config
117
8b78946b 118 -[ "$(IFS_ARCH)" == "via-c7" ] && \
acef7362
MT
119 sed -e "s/^CONFIG_M686=y/# CONFIG_686 is not set/" \
120 -e "s/^# CONFIG_MVIAC7 is not set/CONFIG_MVIAC7=y/" \
121 < $(DIR_CONF)/kernel/kernel.config > $(DIR_APP)/.config
122
8b78946b 123 -[ "$(IFS_ARCH)" == "via-c3" ] && \
acef7362
MT
124 sed -e "s/^CONFIG_M686=y/# CONFIG_686 is not set/" \
125 -e "s/^# CONFIG_MVIAC3_2 is not set/CONFIG_MVIAC3_2=y/" \
126 < $(DIR_CONF)/kernel/kernel.config > $(DIR_APP)/.config
127
8b78946b 128 # if no $(IFS_ARCH) matches use the default i686 configuration
acef7362 129 [ ! -e "$(DIR_APP)/.config" ] && cp -f $(DIR_CONF)/kernel/kernel.config \
df0abf46 130 $(DIR_APP)/.config
0f6feafb 131
df0abf46
MT
132 cd $(DIR_APP) && yes "" | make oldconfig
133
134 # keep the source code in $(DIR_SRC)/$(PKG_NAME)-$(FULLVER)
0f6feafb 135 cp -fal $(DIR_APP) $(DIR_SRC)/$(PKG_NAME)-$(FULLVER)
f76aefec 136
3d84c75d 137 cd $(DIR_APP) && make $(PARALLELISMFLAGS)
f76aefec
MT
138 cd $(DIR_APP) && make modules_install
139
cc0b96e4 140 cd $(DIR_APP) && cp -v arch/x86/boot/bzImage /boot/ipfirekernel-$(FULLVER)
f76aefec
MT
141 cd $(DIR_APP) && cp -v System.map /boot/System.map-$(FULLVER)
142
143 ln -svf ipfirekernel-$(FULLVER) /boot/ipfirekernel
144 ln -svf System.map-$(FULLVER) /boot/System.map
f76aefec
MT
145endif
146
65e73e5b 147ifeq "$(STAGE)" "installer"
0ef6f206 148 -mkdir -pv $(UCLIBC_SYSROOT_DIR)/usr/include
10f9531b 149 cd $(DIR_APP) && make mrproper
43ed0676
MT
150 cd $(DIR_APP) && make ARCH=x86 headers_check
151 cd $(DIR_APP) && make ARCH=x86 INSTALL_HDR_PATH=dest headers_install
0ef6f206 152 cd $(DIR_APP) && cp -rv dest/include/* $(UCLIBC_SYSROOT_DIR)/usr/include
a7e9dd11
MT
153
154 -mkdir -p $(INSTALLER_DIR)/lib/modules/$(KVER)
155 cp -avf /lib/modules/$(KVER)/kernel $(INSTALLER_DIR)/lib/modules/$(KVER)/
156
157 cd $(INSTALLER_DIR)/lib/modules/$(KVER)/kernel && \
158 rm -rf \
159 arch \
160 crypto \
161 drivers/{crypto,hwmon,i2c,leds,media,parport,power,rtc,w1} \
162 drivers/net/ppp* \
163 fs/{cifs,configfs,fuse,lockd,nfs*,ntfs,smbfs} \
164 net \
165 sound
166
167 depmod -a -b $(INSTALLER_DIR) $(KVER)
10f9531b
MT
168endif
169
be472d5a 170 @rm -rf $(DIR_APP)
df5e82b3 171 @$(POSTBUILD)