]>
Commit | Line | Data |
---|---|---|
df5e82b3 | 1 | ############################################################################### |
df5e82b3 | 2 | # # |
70df8302 | 3 | # IPFire.org - A linux based firewall # |
8dd0254f | 4 | # Copyright (C) 2007, 2008, 2009 Michael Tremer & Christian Schmidt # |
70df8302 MT |
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 | ||
25 | include Config | |
26 | ||
be472d5a | 27 | PKG_NAME = linux |
8e726dd0 | 28 | VER = 2.6.27.10 |
8dd0254f | 29 | PKG_VER = 0 |
df5e82b3 | 30 | |
be472d5a | 31 | THISAPP = $(PKG_NAME)-$(VER) |
376e42ce | 32 | DL_FILE = $(THISAPP).tar.bz2 |
df5e82b3 | 33 | DIR_APP = $(DIR_SRC)/$(THISAPP) |
df5e82b3 | 34 | |
6679675b | 35 | OBJECT = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP) |
df5e82b3 | 36 | |
8dd0254f MT |
37 | MAINTAINER = |
38 | GROUP = System/Base | |
39 | EXTRA = no | |
40 | DEBUG = no | |
41 | DEPS = | |
42 | ||
43 | URL = http://www.kernel.org/ | |
44 | LICENSE = GPLv2 | |
45 | SHORT_DESC = The Linux kernel. | |
46 | ||
47 | define LONG_DESC | |
48 | The kernel package contains the Linux kernel (vmlinuz), the core of any \ | |
49 | Linux operating system. The kernel handles the basic functions \ | |
50 | of the operating system: memory allocation, process allocation, device \ | |
51 | input and output, etc. | |
52 | endef | |
53 | ||
54 | CFLAGS = | |
55 | CXXFLAGS = | |
56 | ||
0f6feafb MT |
57 | LOCALVERSION = -ipfire1 |
58 | FULLVER = $(VER)$(LOCALVERSION) | |
f76aefec | 59 | |
d0570720 | 60 | # Patches |
8e726dd0 | 61 | GRSEC_PATCH = grsecurity-2.1.12-$(VER)-200812271347.patch |
7926c6aa | 62 | OCF_PATCH = ocf-linux-26-20080917.patch |
0e7afdd4 | 63 | REISER4_PATCH = reiser4-for-$(VER).patch |
b3d326d9 | 64 | SQUASHFS_PATCH = $(THISAPP)-squashfs3.4-1.patch |
047fa6a6 | 65 | H12Y_PATCH = linux-h12y-mmio-quirks.patch |
d0570720 | 66 | |
df5e82b3 MT |
67 | ############################################################################### |
68 | # Top-level Rules | |
69 | ############################################################################### | |
246556fe | 70 | |
d0570720 | 71 | objects = $(DL_FILE) \ |
7926c6aa | 72 | $(OCF_PATCH) \ |
d0570720 | 73 | $(REISER4_PATCH) \ |
1f14c4ed | 74 | $(SQUASHFS_PATCH) \ |
047fa6a6 AF |
75 | $(GRSEC_PATCH) \ |
76 | $(H12Y_PATCH) | |
df5e82b3 | 77 | |
8dd0254f MT |
78 | download: $(objects) |
79 | ||
80 | info: | |
81 | $(DO_PKG_INFO) | |
82 | ||
83 | install: $(OBJECT) | |
df5e82b3 | 84 | |
8dd0254f MT |
85 | package: |
86 | @$(DO_PACKAGE) | |
df5e82b3 | 87 | |
8dd0254f | 88 | $(objects): |
df5e82b3 MT |
89 | @$(LOAD) |
90 | ||
df5e82b3 MT |
91 | ############################################################################### |
92 | # Installation Details | |
93 | ############################################################################### | |
94 | ||
8dd0254f | 95 | $(OBJECT): $(objects) |
df5e82b3 | 96 | @$(PREBUILD) |
8dd0254f | 97 | @rm -rf $(DIR_APP) && cd $(DIR_SRC) && $(EXTRACTOR) $(DIR_DL)/$(DL_FILE) |
0f6feafb MT |
98 | |
99 | cd $(DIR_APP) && echo "$(LOCALVERSION)" > localversion-ipfire | |
100 | ||
7926c6aa MT |
101 | ### OCF |
102 | # | |
103 | cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(OCF_PATCH) | |
104 | cd $(DIR_APP) && echo "source \"crypto/ocf/Kconfig\"" >> crypto/Kconfig | |
105 | ||
cc0b96e4 MT |
106 | ### Reiser4 |
107 | # | |
647e0c20 | 108 | cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(REISER4_PATCH) |
6109b32c MT |
109 | |
110 | ### Squashfs | |
111 | # | |
a6314d89 | 112 | cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(SQUASHFS_PATCH) |
0f6feafb | 113 | |
0f6feafb | 114 | ### GrSecurity |
cc0b96e4 | 115 | # |
c15bede2 MT |
116 | cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(GRSEC_PATCH) |
117 | rm -f $(DIR_APP)/localversion-grsec | |
89069053 | 118 | |
047fa6a6 AF |
119 | ### H12Y mmio patch for H12Y Laptops |
120 | # | |
121 | cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(H12Y_PATCH) | |
122 | ||
be472d5a | 123 | ifeq "$(STAGE)" "toolchain" |
acef7362 | 124 | install -dv $(TOOLS_DIR)/include |
df5e82b3 | 125 | cd $(DIR_APP) && make mrproper |
43ed0676 MT |
126 | cd $(DIR_APP) && make ARCH=x86 headers_check |
127 | cd $(DIR_APP) && make ARCH=x86 INSTALL_HDR_PATH=dest headers_install | |
be472d5a | 128 | cd $(DIR_APP) && cp -rv dest/include/* $(TOOLS_DIR)/include |
df5e82b3 | 129 | endif |
376e42ce | 130 | |
3888140c | 131 | ifeq "$(STAGE)" "base" |
3888140c | 132 | cd $(DIR_APP) && make mrproper |
43ed0676 MT |
133 | cd $(DIR_APP) && make ARCH=x86 headers_check |
134 | cd $(DIR_APP) && make ARCH=x86 INSTALL_HDR_PATH=dest headers_install | |
3888140c MT |
135 | cd $(DIR_APP) && cp -rv dest/include/* /usr/include |
136 | endif | |
137 | ||
f76aefec | 138 | ifeq "$(STAGE)" "ipfire" |
f76aefec | 139 | cd $(DIR_APP) && make mrproper |
acef7362 | 140 | |
bf1d84c5 MT |
141 | # Select right optimization for the linux kernel. |
142 | if [ "$(TARGET)" == "i486" ]; then \ | |
3ef1baa7 | 143 | sed -e "s/^CONFIG_M686=y/# CONFIG_686 is not set/" \ |
bf1d84c5 | 144 | -e "s/^# CONFIG_M486 is not set/CONFIG_M486=y/" \ |
3ef1baa7 | 145 | < $(DIR_CONF)/kernel/kernel.config > $(DIR_APP)/.config; \ |
bf1d84c5 | 146 | elif [ "$(TARGET)" == "i586" ]; then \ |
3ef1baa7 | 147 | sed -e "s/^CONFIG_M686=y/# CONFIG_686 is not set/" \ |
aec3578e | 148 | -e "s/^# CONFIG_M586TSC is not set/CONFIG_M586TSC=y/" \ |
3ef1baa7 | 149 | < $(DIR_CONF)/kernel/kernel.config > $(DIR_APP)/.config; \ |
bf1d84c5 | 150 | elif [ "$(TARGET)" == "via-c7" ]; then \ |
3ef1baa7 MT |
151 | sed -e "s/^CONFIG_M686=y/# CONFIG_686 is not set/" \ |
152 | -e "s/^# CONFIG_MVIAC7 is not set/CONFIG_MVIAC7=y/" \ | |
153 | < $(DIR_CONF)/kernel/kernel.config > $(DIR_APP)/.config; \ | |
bf1d84c5 | 154 | elif [ "$(TARGET)" == "via-c3" ]; then \ |
3ef1baa7 MT |
155 | sed -e "s/^CONFIG_M686=y/# CONFIG_686 is not set/" \ |
156 | -e "s/^# CONFIG_MVIAC3_2 is not set/CONFIG_MVIAC3_2=y/" \ | |
157 | < $(DIR_CONF)/kernel/kernel.config > $(DIR_APP)/.config; \ | |
158 | else \ | |
159 | cp -f $(DIR_CONF)/kernel/kernel.config $(DIR_APP)/.config; \ | |
160 | fi | |
0f6feafb | 161 | |
2c3434ba MT |
162 | # Fixed CFLAGS when using distcc |
163 | cd $(DIR_APP) && sed -e "s/-D__KERNEL__/& -fno-PIE/" -i Makefile | |
164 | ||
df0abf46 | 165 | cd $(DIR_APP) && yes "" | make oldconfig |
f76aefec | 166 | |
663dc97b | 167 | cd $(DIR_APP) && CC="gcc -U_FORTIFY_SOURCE" make $(PARALLELISMFLAGS) |
f76aefec MT |
168 | cd $(DIR_APP) && make modules_install |
169 | ||
f4c383dc | 170 | cd $(DIR_APP) && cp -v arch/x86/boot/bzImage /boot/$(SNAME)kernel-$(FULLVER) |
f76aefec MT |
171 | cd $(DIR_APP) && cp -v System.map /boot/System.map-$(FULLVER) |
172 | ||
f4c383dc | 173 | ln -svf $(SNAME)kernel-$(FULLVER) /boot/$(SNAME)kernel |
f76aefec | 174 | ln -svf System.map-$(FULLVER) /boot/System.map |
f4c383dc MT |
175 | |
176 | # keep the source code in $(DIR_SRC)/$(PKG_NAME)-$(FULLVER) | |
177 | cp -fal $(DIR_APP) $(DIR_SRC)/$(PKG_NAME)-$(FULLVER) | |
178 | ||
c6e83644 | 179 | rm -vf /lib/modules/$(KVER)/{build,source} |
6109b32c MT |
180 | ln -svf $(DIR_SRC)/$(PKG_NAME)-$(FULLVER) /lib/modules/$(KVER)/build |
181 | ln -svf $(DIR_SRC)/$(PKG_NAME)-$(FULLVER) /lib/modules/$(KVER)/source | |
f4c383dc | 182 | -mkdir -pv /lib/modules/$(KVER)/extra |
f76aefec MT |
183 | endif |
184 | ||
be472d5a | 185 | @rm -rf $(DIR_APP) |
df5e82b3 | 186 | @$(POSTBUILD) |