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