]> git.ipfire.org Git - ipfire-3.x.git/blame - pkgs/kernel/kernel.nm
kernel: Update to 2.6.39.
[ipfire-3.x.git] / pkgs / kernel / kernel.nm
CommitLineData
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 25include $(PKGROOT)/Include
166a6c21
MT
26
27PKG_NAME = linux
66a7e928
MT
28PKG_VER = 2.6.39
29PKG_REL = 1
166a6c21
MT
30
31PKG_MAINTAINER = Michael Tremer <michael.tremer@ipfire.org>
bb7d617c 32PKG_GROUPS = System/Kernels
166a6c21
MT
33PKG_URL = http://www.kernel.org/
34PKG_LICENSE = GPLv2
35PKG_SUMMARY = The Linux kernel.
36
fcfc0d1d 37PKG_BUILD_DEPS+= module-init-tools ncurses-devel perl
56fd809a 38PKG_DEPS-kernel= dracut linux-firmware
f81ab173 39
166a6c21
MT
40define 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.
45endef
46
166a6c21
MT
47CFLAGS =
48CXXFLAGS =
49
ac944179 50LOCALVERSION = -$(DISTRO_SNAME)$(PKG_REL)
58c5fc13 51FULLVER = $(PKG_VER)$(LOCALVERSION)
166a6c21 52
17c0ee8a 53PKG_TARBALL = $(THISAPP).tar.bz2
166a6c21 54
9d1ca333
MT
55PKG_PACKAGES += kernel-headers
56
57PKG_SUMMARY-kernel-headers = Header files if the kernel release $(FULLVER).
58PKG_DESCRIPTION-kernel-headers = $(PKG_SUMMARY-kernel-headers)
59PKG_FILES-kernel-headers = /usr/include
166a6c21 60
17c0ee8a 61define STAGE_PREPARE_CMDS
ac944179 62 cd $(DIR_APP) && echo "$(LOCALVERSION)" > localversion-$(DISTRO_SNAME)
166a6c21
MT
63 rm -f $(DIR_APP)/localversion-grsec
64
166a6c21
MT
65 cd $(DIR_APP) && sed -e "s/^HOSTCFLAGS.*=.*/& -fPIC/g" -i Makefile
66
17c0ee8a
MT
67 cd $(DIR_APP) && cp -vf $(DIR_SOURCE)/$(DISTRO_SNAME)_logo.ppm \
68 drivers/video/logo/logo_linux_clut224.ppm
166a6c21
MT
69
70 cd $(DIR_APP) && make mrproper
71
66678ff4
MT
72 # Install configuration file
73 cp -f $(DIR_SOURCE)/config $(DIR_APP)/.config
74endef
166a6c21 75
66678ff4 76define STAGE_BUILD
166a6c21 77 cd $(DIR_APP) && yes "" | make oldconfig
9d1ca333
MT
78
79 # Check headers
80 cd $(DIR_APP) && make ARCH=x86 headers_check
81
166a6c21 82 cd $(DIR_APP) && make CC="gcc -nopie" $(PARALLELISMFLAGS)
17c0ee8a 83endef
166a6c21 84
17c0ee8a 85define STAGE_INSTALL
990e0b86 86 cd $(DIR_APP) && make modules_install INSTALL_MOD_PATH=$(BUILDROOT)
166a6c21 87
990e0b86 88 -mkdir -pv $(BUILDROOT)/boot
8431831e 89 cd $(DIR_APP) && cp -v arch/x86/boot/bzImage $(BUILDROOT)/boot/vmlinuz-$(FULLVER)
990e0b86 90 cd $(DIR_APP) && cp -v System.map $(BUILDROOT)/boot/System.map-$(FULLVER)
166a6c21 91
98814918
MT
92 -mkdir -pv $(BUILDROOT)/lib/modules/$(FULLVER)/extra
93
94 rm -vf $(BUILDROOT)/lib/modules/$(FULLVER)/{build,source}
9d1ca333
MT
95
96 # Install the header files
97 cd $(DIR_APP) && make ARCH=x86 INSTALL_HDR_PATH=dest headers_install
98 -mkdir -pv $(BUILDROOT)/usr/include
99 cd $(DIR_APP) && find dest/include \( -name .install -o -name ..install.cmd \) -delete
100 cd $(DIR_APP) && cp -rv dest/include/* $(BUILDROOT)/usr/include
101
102 # Glibc provides these headers
103 rm -rfv $(BUILDROOT)/usr/include/scsi \
104 $(BUILDROOT)/usr/include/asm*/atomic.h \
105 $(BUILDROOT)/usr/include/asm*/io.h \
106 $(BUILDROOT)/usr/include/asm*/irq.h
5ae13864
SS
107
108 # Create an empty settings file for dracut
109 mkdir -vp $(BUILDROOT)/etc/ld.so.conf.d/
110 echo "# Placeholder file, no vDSO hwcap entries used in this kernel." \
111 > $(BUILDROOT)/etc/ld.so.conf.d/kernel-$(FULLVER).conf
17c0ee8a 112endef