]>
Commit | Line | Data |
---|---|---|
166a6c21 MT |
1 | ############################################################################### |
2 | # # | |
3 | # IPFire.org - A linux based firewall # | |
4 | # Copyright (C) 2007, 2008, 2009 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 | ||
a7c97434 | 25 | include $(PKGROOT)/Include |
166a6c21 MT |
26 | |
27 | PKG_NAME = linux | |
28 | PKG_VER = 2.6.31.1 | |
29 | PKG_REL = 0 | |
30 | ||
31 | PKG_MAINTAINER = Michael Tremer <michael.tremer@ipfire.org> | |
32 | PKG_GROUP = System/Kernels | |
33 | PKG_URL = http://www.kernel.org/ | |
34 | PKG_LICENSE = GPLv2 | |
35 | PKG_SUMMARY = The Linux kernel. | |
36 | ||
37 | define PKG_DESCRIPTION | |
38 | The kernel package contains the Linux kernel (vmlinuz), the core of any \ | |
39 | Linux operating system. The kernel handles the basic functions \ | |
40 | of the operating system: memory allocation, process allocation, device \ | |
41 | input and output, etc. | |
42 | endef | |
43 | ||
166a6c21 MT |
44 | CFLAGS = |
45 | CXXFLAGS = | |
46 | ||
58c5fc13 MT |
47 | LOCALVERSION = -ipfire1 |
48 | FULLVER = $(PKG_VER)$(LOCALVERSION) | |
166a6c21 | 49 | |
17c0ee8a | 50 | PKG_TARBALL = $(THISAPP).tar.bz2 |
166a6c21 | 51 | |
166a6c21 MT |
52 | ############################################################################### |
53 | # Installation Details | |
54 | ############################################################################### | |
55 | ||
17c0ee8a | 56 | define STAGE_PREPARE_CMDS |
166a6c21 | 57 | cd $(DIR_APP) && echo "$(LOCALVERSION)" > localversion-ipfire |
166a6c21 MT |
58 | rm -f $(DIR_APP)/localversion-grsec |
59 | ||
166a6c21 MT |
60 | cd $(DIR_APP) && sed -e "s/^HOSTCFLAGS.*=.*/& -fPIC/g" -i Makefile |
61 | ||
17c0ee8a MT |
62 | #cd $(DIR_APP) && echo "source \"crypto/ocf/Kconfig\"" >> crypto/Kconfig |
63 | ||
64 | cd $(DIR_APP) && cp -vf $(DIR_SOURCE)/$(DISTRO_SNAME)_logo.ppm \ | |
65 | drivers/video/logo/logo_linux_clut224.ppm | |
66 | endef | |
166a6c21 | 67 | |
17c0ee8a | 68 | define STAGE_BUILD |
166a6c21 MT |
69 | cd $(DIR_APP) && make mrproper |
70 | ||
71 | # Select right optimization for the linux kernel. | |
72 | if [ "$(TARGET)" == "i486" ]; then \ | |
73 | sed -e "s/^CONFIG_M686=y/# CONFIG_686 is not set/" \ | |
74 | -e "s/^# CONFIG_M486 is not set/CONFIG_M486=y/" \ | |
17c0ee8a | 75 | < $(DIR_SOURCE)/config > $(DIR_APP)/.config; \ |
166a6c21 MT |
76 | elif [ "$(TARGET)" == "i586" ]; then \ |
77 | sed -e "s/^CONFIG_M686=y/# CONFIG_686 is not set/" \ | |
78 | -e "s/^# CONFIG_M586TSC is not set/CONFIG_M586TSC=y/" \ | |
17c0ee8a | 79 | < $(DIR_SOURCE)/config > $(DIR_APP)/.config; \ |
166a6c21 MT |
80 | elif [ "$(TARGET)" == "via-c7" ]; then \ |
81 | sed -e "s/^CONFIG_M686=y/# CONFIG_686 is not set/" \ | |
82 | -e "s/^# CONFIG_MVIAC7 is not set/CONFIG_MVIAC7=y/" \ | |
17c0ee8a | 83 | < $(DIR_SOURCE)/config > $(DIR_APP)/.config; \ |
166a6c21 MT |
84 | elif [ "$(TARGET)" == "via-c3" ]; then \ |
85 | sed -e "s/^CONFIG_M686=y/# CONFIG_686 is not set/" \ | |
86 | -e "s/^# CONFIG_MVIAC3_2 is not set/CONFIG_MVIAC3_2=y/" \ | |
17c0ee8a | 87 | < $(DIR_SOURCE)/config > $(DIR_APP)/.config; \ |
166a6c21 | 88 | else \ |
17c0ee8a | 89 | cp -f $(DIR_SOURCE)/config $(DIR_APP)/.config; \ |
166a6c21 MT |
90 | fi |
91 | ||
92 | cd $(DIR_APP) && yes "" | make oldconfig | |
166a6c21 MT |
93 | |
94 | cd $(DIR_APP) && make CC="gcc -nopie" $(PARALLELISMFLAGS) | |
17c0ee8a | 95 | endef |
166a6c21 | 96 | |
17c0ee8a | 97 | define STAGE_INSTALL |
990e0b86 | 98 | cd $(DIR_APP) && make modules_install INSTALL_MOD_PATH=$(BUILDROOT) |
166a6c21 | 99 | |
990e0b86 MT |
100 | -mkdir -pv $(BUILDROOT)/boot |
101 | cd $(DIR_APP) && cp -v arch/x86/boot/bzImage $(BUILDROOT)/boot/$(DISTRO_SNAME)kernel-$(FULLVER) | |
102 | cd $(DIR_APP) && cp -v System.map $(BUILDROOT)/boot/System.map-$(FULLVER) | |
103 | ||
104 | ln -svf $(SNAME)kernel-$(FULLVER) $(BUILDROOT)/boot/$(DISTRO_SNAME)kernel | |
105 | ln -svf System.map-$(FULLVER) $(BUILDROOT)/boot/System.map | |
166a6c21 | 106 | |
990e0b86 | 107 | -mkdir -pv $(BUILDROOT)/lib/modules/$(KVER)/extra |
17c0ee8a | 108 | endef |