1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
9 thisapp = linux-%{version}
11 maintainer = Michael Tremer <michael.tremer@ipfire.org>
12 groups = System/Kernels
13 url = http://www.kernel.org/
15 summary = The Linux kernel.
18 The kernel package contains the Linux kernel (vmlinuz), the core of any \
19 Linux operating system. The kernel handles the basic functions \
20 of the operating system: memory allocation, process allocation, device \
21 input and output, etc.
24 # Version helper variables.
25 localversion = -%{DISTRO_SNAME}%{release}
26 fullver = %{version}%{localversion}
28 sources = %{thisapp}.tar.gz
38 echo "%{localversion}" > localversion-%{DISTRO_SNAME}
39 rm -f %{DIR_APP}/localversion-grsec
41 sed -e "s/^HOSTCFLAGS.*=.*/& -fPIC/g" -i Makefile
43 cp -vf %{DIR_SOURCE}/%{DISTRO_SNAME}_logo.ppm \
44 drivers/video/logo/logo_linux_clut224.ppm
48 # Install configuration file
49 cp -f %{DIR_SOURCE}/config %{DIR_APP}/.config
53 yes "" | make oldconfig
56 make ARCH=x86 headers_check
58 make CC="gcc -nopie" %{PARALLELISMFLAGS}
62 make modules_install INSTALL_MOD_PATH=%{BUILDROOT}
64 mkdir -pv %{BUILDROOT}/boot
65 cp -v arch/x86/boot/bzImage %{BUILDROOT}/boot/vmlinuz-%{fullver}
66 cp -v System.map %{BUILDROOT}/boot/System.map-%{fullver}
68 mkdir -pv %{BUILDROOT}/lib/modules/%{fullver}/extra
70 rm -vf %{BUILDROOT}/lib/modules/%{fullver}/{build,source}
72 # Install the header files
73 make ARCH=x86 INSTALL_HDR_PATH=dest headers_install
74 mkdir -pv %{BUILDROOT}/usr/include
75 find dest/include \( -name .install -o -name ..install.cmd \) -delete
76 cp -rv dest/include/* %{BUILDROOT}/usr/include
78 # Glibc provides these headers
79 rm -rfv %{BUILDROOT}/usr/include/scsi \
80 %{BUILDROOT}/usr/include/asm*/atomic.h \
81 %{BUILDROOT}/usr/include/asm*/io.h \
82 %{BUILDROOT}/usr/include/asm*/irq.h
84 # Create an empty settings file for dracut
85 mkdir -vp %{BUILDROOT}/etc/ld.so.conf.d/
86 echo "# Placeholder file, no vDSO hwcap entries used in this kernel." \
87 > %{BUILDROOT}/etc/ld.so.conf.d/kernel-%{fullver}.conf
89 # Remove all firmware files which are distributed by linux-firmware
90 rm -rfv %{BUILDROOT}/lib/firmware
102 package kernel-headers
103 summary = Header files of the kernel release %{fullver}.
104 desciption = %{summary}