]> git.ipfire.org Git - ipfire-3.x.git/blob - pkgs/kernel/kernel.nm
kernel: More options that have to be set to use systemd.
[ipfire-3.x.git] / pkgs / kernel / kernel.nm
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
25 include $(PKGROOT)/Include
26
27 PKG_NAME = linux
28 PKG_VER = 2.6.37.2
29 PKG_REL = 6
30
31 PKG_MAINTAINER = Michael Tremer <michael.tremer@ipfire.org>
32 PKG_GROUPS = System/Kernels
33 PKG_URL = http://www.kernel.org/
34 PKG_LICENSE = GPLv2
35 PKG_SUMMARY = The Linux kernel.
36
37 PKG_BUILD_DEPS+= module-init-tools ncurses-devel perl
38 PKG_DEPS-kernel= dracut linux-firmware
39
40 define PKG_DESCRIPTION
41 The kernel package contains the Linux kernel (vmlinuz), the core of any \
42 Linux operating system. The kernel handles the basic functions \
43 of the operating system: memory allocation, process allocation, device \
44 input and output, etc.
45 endef
46
47 CFLAGS =
48 CXXFLAGS =
49
50 LOCALVERSION = -$(DISTRO_SNAME)$(PKG_REL)
51 FULLVER = $(PKG_VER)$(LOCALVERSION)
52
53 PKG_TARBALL = $(THISAPP).tar.bz2
54
55 PKG_PACKAGES += kernel-headers
56
57 PKG_SUMMARY-kernel-headers = Header files if the kernel release $(FULLVER).
58 PKG_DESCRIPTION-kernel-headers = $(PKG_SUMMARY-kernel-headers)
59 PKG_FILES-kernel-headers = /usr/include
60
61 define STAGE_PREPARE_CMDS
62 cd $(DIR_APP) && echo "$(LOCALVERSION)" > localversion-$(DISTRO_SNAME)
63 rm -f $(DIR_APP)/localversion-grsec
64
65 cd $(DIR_APP) && sed -e "s/^HOSTCFLAGS.*=.*/& -fPIC/g" -i Makefile
66
67 #cd $(DIR_APP) && echo "source \"crypto/ocf/Kconfig\"" >> crypto/Kconfig
68
69 cd $(DIR_APP) && cp -vf $(DIR_SOURCE)/$(DISTRO_SNAME)_logo.ppm \
70 drivers/video/logo/logo_linux_clut224.ppm
71
72 cd $(DIR_APP) && make mrproper
73
74 # Install configuration file
75 cp -f $(DIR_SOURCE)/config $(DIR_APP)/.config
76 endef
77
78 define STAGE_BUILD
79 cd $(DIR_APP) && yes "" | make oldconfig
80
81 # Check headers
82 cd $(DIR_APP) && make ARCH=x86 headers_check
83
84 cd $(DIR_APP) && make CC="gcc -nopie" $(PARALLELISMFLAGS)
85 endef
86
87 define STAGE_INSTALL
88 cd $(DIR_APP) && make modules_install INSTALL_MOD_PATH=$(BUILDROOT)
89
90 -mkdir -pv $(BUILDROOT)/boot
91 cd $(DIR_APP) && cp -v arch/x86/boot/bzImage $(BUILDROOT)/boot/vmlinuz-$(FULLVER)
92 cd $(DIR_APP) && cp -v System.map $(BUILDROOT)/boot/System.map-$(FULLVER)
93
94 -mkdir -pv $(BUILDROOT)/lib/modules/$(FULLVER)/extra
95
96 rm -vf $(BUILDROOT)/lib/modules/$(FULLVER)/{build,source}
97
98 # Install the header files
99 cd $(DIR_APP) && make ARCH=x86 INSTALL_HDR_PATH=dest headers_install
100 -mkdir -pv $(BUILDROOT)/usr/include
101 cd $(DIR_APP) && find dest/include \( -name .install -o -name ..install.cmd \) -delete
102 cd $(DIR_APP) && cp -rv dest/include/* $(BUILDROOT)/usr/include
103
104 # Glibc provides these headers
105 rm -rfv $(BUILDROOT)/usr/include/scsi \
106 $(BUILDROOT)/usr/include/asm*/atomic.h \
107 $(BUILDROOT)/usr/include/asm*/io.h \
108 $(BUILDROOT)/usr/include/asm*/irq.h
109 endef