1 ###############################################################################
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007, 2008, 2009 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 ###############################################################################
25 include $(PKGROOT)/Include
31 PKG_MAINTAINER = Michael Tremer <michael.tremer@ipfire.org>
32 PKG_GROUP = System/Kernels
33 PKG_URL = http://www.kernel.org/
35 PKG_SUMMARY = The Linux kernel.
37 PKG_BUILD_DEPS+= module-init-tools ncurses-devel perl
38 PKG_DEPS += linux-firmware
39 PKG_DEPS-kernel= dracut
41 define PKG_DESCRIPTION
42 The kernel package contains the Linux kernel (vmlinuz), the core of any \
43 Linux operating system. The kernel handles the basic functions \
44 of the operating system: memory allocation, process allocation, device \
45 input and output, etc.
51 LOCALVERSION = -$(DISTRO_SNAME)$(PKG_REL)
52 FULLVER = $(PKG_VER)$(LOCALVERSION)
54 PKG_TARBALL = $(THISAPP).tar.bz2
56 PKG_PACKAGES += kernel-headers
58 PKG_SUMMARY-kernel-headers = Header files if the kernel release $(FULLVER).
59 PKG_DESCRIPTION-kernel-headers = $(PKG_SUMMARY-kernel-headers)
60 PKG_FILES-kernel-headers = /usr/include
62 define STAGE_PREPARE_CMDS
63 cd $(DIR_APP) && echo "$(LOCALVERSION)" > localversion-$(DISTRO_SNAME)
64 rm -f $(DIR_APP)/localversion-grsec
66 cd $(DIR_APP) && sed -e "s/^HOSTCFLAGS.*=.*/& -fPIC/g" -i Makefile
68 #cd $(DIR_APP) && echo "source \"crypto/ocf/Kconfig\"" >> crypto/Kconfig
70 cd $(DIR_APP) && cp -vf $(DIR_SOURCE)/$(DISTRO_SNAME)_logo.ppm \
71 drivers/video/logo/logo_linux_clut224.ppm
73 cd $(DIR_APP) && make mrproper
75 # Install configuration file
76 cp -f $(DIR_SOURCE)/config $(DIR_APP)/.config
80 cd $(DIR_APP) && yes "" | make oldconfig
83 cd $(DIR_APP) && make ARCH=x86 headers_check
85 cd $(DIR_APP) && make CC="gcc -nopie" $(PARALLELISMFLAGS)
89 cd $(DIR_APP) && make modules_install INSTALL_MOD_PATH=$(BUILDROOT)
91 -mkdir -pv $(BUILDROOT)/boot
92 cd $(DIR_APP) && cp -v arch/x86/boot/bzImage $(BUILDROOT)/boot/vmlinuz-$(FULLVER)
93 cd $(DIR_APP) && cp -v System.map $(BUILDROOT)/boot/System.map-$(FULLVER)
95 -mkdir -pv $(BUILDROOT)/lib/modules/$(FULLVER)/extra
97 rm -vf $(BUILDROOT)/lib/modules/$(FULLVER)/{build,source}
99 # Install the header files
100 cd $(DIR_APP) && make ARCH=x86 INSTALL_HDR_PATH=dest headers_install
101 -mkdir -pv $(BUILDROOT)/usr/include
102 cd $(DIR_APP) && find dest/include \( -name .install -o -name ..install.cmd \) -delete
103 cd $(DIR_APP) && cp -rv dest/include/* $(BUILDROOT)/usr/include
105 # Glibc provides these headers
106 rm -rfv $(BUILDROOT)/usr/include/scsi \
107 $(BUILDROOT)/usr/include/asm*/atomic.h \
108 $(BUILDROOT)/usr/include/asm*/io.h \
109 $(BUILDROOT)/usr/include/asm*/irq.h