]> git.ipfire.org Git - people/arne_f/ipfire-3.x.git/blob - kernel/kernel.nm
kernel: Create an initramfs image after installation.
[people/arne_f/ipfire-3.x.git] / kernel / kernel.nm
1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
5
6 name = kernel
7 version = 3.0.4
8 release = 4
9 thisapp = linux-%{version}
10
11 maintainer = Michael Tremer <michael.tremer@ipfire.org>
12 groups = System/Kernels
13 url = http://www.kernel.org/
14 license = GPLv2
15 summary = The Linux kernel.
16
17 description
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.
22 end
23
24 # Version helper variables.
25 localversion = -%{release}.%{DISTRO_DISTTAG}.%{DISTRO_ARCH}
26 fullver = %{version}%{localversion}
27
28 sources = %{thisapp}.tar.gz
29
30 build
31 requires
32 module-init-tools
33 ncurses-devel
34 perl
35 end
36
37 prepare_cmds
38 echo "%{localversion}" > localversion-%{DISTRO_SNAME}
39 rm -f %{DIR_APP}/localversion-grsec
40
41 sed -e "s/^HOSTCFLAGS.*=.*/& -fPIC/g" -i Makefile
42
43 cp -vf %{DIR_SOURCE}/%{DISTRO_SNAME}_logo.ppm \
44 drivers/video/logo/logo_linux_clut224.ppm
45
46 make mrproper
47
48 # Install configuration file
49 cp -f %{DIR_SOURCE}/config %{DIR_APP}/.config
50 end
51
52 build
53 yes "" | make oldconfig
54
55 # Check headers
56 make ARCH=x86 headers_check
57
58 make CC="gcc -nopie" %{PARALLELISMFLAGS}
59 end
60
61 install
62 make modules_install INSTALL_MOD_PATH=%{BUILDROOT}
63
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}
67
68 mkdir -pv %{BUILDROOT}/lib/modules/%{fullver}/extra
69
70 rm -vf %{BUILDROOT}/lib/modules/%{fullver}/{build,source}
71
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
77
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
83
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
88
89 # Remove all firmware files which are distributed by linux-firmware
90 rm -rfv %{BUILDROOT}/lib/firmware
91 end
92 end
93
94 packages
95 package kernel
96 requires
97 dracut
98 linux-firmware
99 end
100
101 script posttransin
102 dracut /boot/initramfs-%{fullver}.img %{fullver}
103 end
104
105 script preun
106 rm -f /boot/initramfs-%{fullver}.img
107 end
108 end
109
110 package kernel-headers
111 summary = Header files of the kernel release %{fullver}.
112 desciption = %{summary}
113
114 files
115 /usr/include
116 end
117 end
118
119 end