1 ###############################################################################
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007 Michael Tremer & Christian Schmidt #
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. #
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. #
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/>. #
19 ###############################################################################
21 ###############################################################################
23 ###############################################################################
30 THISAPP = $(PKG_NAME)-$(VER)
31 DL_FILE = $(THISAPP).tar.bz2
32 DIR_APP = $(DIR_SRC)/$(THISAPP)
36 OBJECT = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
38 LOCALVERSION = -ipfire1
39 FULLVER = $(VER)$(LOCALVERSION)
42 FRANDOM_PATCH = linux-2.6.25-frandom-1.patch
43 GRSEC_PATCH = grsecurity-2.1.12-$(VER)-200808171148.patch
44 OCF_PATCH = ocf-linux-26-20080917.patch
45 REISER4_PATCH = reiser4-for-$(VER).patch
46 SQUASHFS_PATCH = $(THISAPP)-squashfs3.4-1.patch
48 ###############################################################################
50 ###############################################################################
52 objects = $(DL_FILE) \
58 #objects += $(GRSEC_PATCH)
62 #objects += $(FRANDOM_PATCH)
72 ###############################################################################
73 # Installation Details
74 ###############################################################################
78 @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
80 cd $(DIR_APP) && echo "$(LOCALVERSION)" > localversion-ipfire
85 #cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(FRANDOM_PATCH)
90 cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(OCF_PATCH)
91 cd $(DIR_APP) && echo "source \"crypto/ocf/Kconfig\"" >> crypto/Kconfig
95 cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(REISER4_PATCH)
99 cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(SQUASHFS_PATCH)
104 #cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(GRSEC_PATCH)
105 #rm -f $(DIR_APP)/localversion-grsec
108 ifeq "$(STAGE)" "toolchain"
109 install -dv $(TOOLS_DIR)/include
110 cd $(DIR_APP) && make mrproper
111 cd $(DIR_APP) && make ARCH=x86 headers_check
112 cd $(DIR_APP) && make ARCH=x86 INSTALL_HDR_PATH=dest headers_install
113 cd $(DIR_APP) && cp -rv dest/include/* $(TOOLS_DIR)/include
116 ifeq "$(STAGE)" "base"
117 cd $(DIR_APP) && make mrproper
118 cd $(DIR_APP) && make ARCH=x86 headers_check
119 cd $(DIR_APP) && make ARCH=x86 INSTALL_HDR_PATH=dest headers_install
120 cd $(DIR_APP) && cp -rv dest/include/* /usr/include
123 ifeq "$(STAGE)" "ipfire"
124 cd $(DIR_APP) && make mrproper
126 if [ "$(IFS_ARCH)" == "i586" ]; then \
127 sed -e "s/^CONFIG_M686=y/# CONFIG_686 is not set/" \
128 -e "s/^# CONFIG_MPENTIUMIII is not set/CONFIG_MPENTIUMII=y/" \
129 < $(DIR_CONF)/kernel/kernel.config > $(DIR_APP)/.config; \
130 elif [ "$(IFS_ARCH)" == "i486" ]; then \
131 sed -e "s/^CONFIG_M686=y/# CONFIG_686 is not set/" \
132 -e "s/^# CONFIG_M486 is not set/CONFIG_M486=y/" \
133 < $(DIR_CONF)/kernel/kernel.config > $(DIR_APP)/.config; \
134 elif [ "$(IFS_ARCH)" == "via-c7" ]; then \
135 sed -e "s/^CONFIG_M686=y/# CONFIG_686 is not set/" \
136 -e "s/^# CONFIG_MVIAC7 is not set/CONFIG_MVIAC7=y/" \
137 < $(DIR_CONF)/kernel/kernel.config > $(DIR_APP)/.config; \
138 elif [ "$(IFS_ARCH)" == "via-c3" ]; then \
139 sed -e "s/^CONFIG_M686=y/# CONFIG_686 is not set/" \
140 -e "s/^# CONFIG_MVIAC3_2 is not set/CONFIG_MVIAC3_2=y/" \
141 < $(DIR_CONF)/kernel/kernel.config > $(DIR_APP)/.config; \
143 cp -f $(DIR_CONF)/kernel/kernel.config $(DIR_APP)/.config; \
146 # Fixed CFLAGS when using distcc
147 cd $(DIR_APP) && sed -e "s/-D__KERNEL__/& -fno-PIE/" -i Makefile
149 cd $(DIR_APP) && yes "" | make oldconfig
151 cd $(DIR_APP) && make $(PARALLELISMFLAGS)
152 cd $(DIR_APP) && make modules_install
154 cd $(DIR_APP) && cp -v arch/x86/boot/bzImage /boot/$(SNAME)kernel-$(FULLVER)
155 cd $(DIR_APP) && cp -v System.map /boot/System.map-$(FULLVER)
157 ln -svf $(SNAME)kernel-$(FULLVER) /boot/$(SNAME)kernel
158 ln -svf System.map-$(FULLVER) /boot/System.map
160 # keep the source code in $(DIR_SRC)/$(PKG_NAME)-$(FULLVER)
161 cp -fal $(DIR_APP) $(DIR_SRC)/$(PKG_NAME)-$(FULLVER)
163 rm -vf /lib/modules/$(KVER)/{build,source}
164 ln -svf $(DIR_SRC)/$(PKG_NAME)-$(FULLVER) /lib/modules/$(KVER)/build
165 ln -svf $(DIR_SRC)/$(PKG_NAME)-$(FULLVER) /lib/modules/$(KVER)/source
166 -mkdir -pv /lib/modules/$(KVER)/extra