Magellan Linux

Contents of /smage/trunk/include/kernel-split.sminc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5112 - (show annotations) (download)
Tue Sep 24 08:56:37 2013 UTC (11 years, 1 month ago) by niro
File size: 3148 byte(s)
-include kernel-split from upstream
1 # kernel global smage functions
2 # $Id$
3
4 # all variables and dependencies of kernel.sminc are required!
5 #
6 # ${BRANCH} is a as always a must and ${KERNEL_TYPE} is set in split defines
7 #
8 # additional variables
9 # ${KERNEL_IMAGE_DEPEND}: optional, override default kernel-image dependencies
10 # ${KERNEL_SOURCES_DEPEND}: optional, override default kernel-sources dependencies
11 #
12 # ${KERNEL_IMAGE_PROVIDE}: optional, override default kernel image provides
13 # ${KERNEL_SOURCES_PROVIDE}: optional, override default kernel-sources provides
14 #
15
16 sminclude kernel
17
18 SPLIT_PACKAGES="kernel-${BRANCH} kernel-sources-${BRANCH}"
19
20 # kernel.sminc opts this out for sources, split-build needs this one always
21 : ${SDEPEND=">= sys-dev/bc-1.06"}
22
23 # define split_info functions
24 eval "split_info_kernel-${BRANCH}()
25 {
26 DESCRIPTION=\"Kernel image of the '${PVER}-${BRANCH}-${PBUILD}${KERNEL_ARCH_EXTENSION}' kernel branch.\"
27
28 if [[ -n \${KERNEL_IMAGE_DEPEND} ]]
29 then
30 DEPEND=\"${KERNEL_IMAGE_DEPEND}\"
31 else
32 DEPEND=\">= virtual/module-tools
33 >= sys-fs/udev-115
34 >= virtual/initramfs-tools
35 >= virtual/initscripts\"
36 fi
37
38 if [[ ! -z ${LINUX_FIRMWARE} ]] && [[ ${LINUX_FIRMWARE} != internal ]]
39 then
40 DEPEND=\"\${DEPEND}
41 >= sys-kernel/linux-firmware-${LINUX_FIRMWARE}\"
42 fi
43
44 if [[ -n \${KERNEL_IMAGE_PROVIDE} ]]
45 then
46 PROVIDE=\"${KERNEL_IMAGE_PROVIDE}\"
47 else
48 PROVIDE=\"virtual/kernel\"
49 fi
50
51 SPECIAL_FUNCTIONS=\"\${SPECIAL_FUNCTIONS} kernel_image_preinstall kernel_image_preremove kernel_image_postinstall\"
52 }"
53
54 eval "split_info_kernel-sources-${BRANCH}()
55 {
56 DESCRIPTION=\"Kernel sources of the '${PVER}-${BRANCH}-${PBUILD}${KERNEL_ARCH_EXTENSION}' kernel branch.\"
57
58 if [[ -n \${KERNEL_SOURCES_DEPEND} ]]
59 then
60 DEPEND=\"${KERNEL_SOURCES_DEPEND}\"
61 else
62 DEPEND=\"\"
63 fi
64
65 if [[ -n \${KERNEL_SOURCES_PROVIDE} ]]
66 then
67 PROVIDE=\"${KERNEL_SOURCES_PROVIDE}\"
68 else
69 PROVIDE=\"virtual/kernel-sources\"
70 fi
71
72 SPECIAL_FUNCTIONS=\"\${SPECIAL_FUNCTIONS} kernel_sources_postinstall\"
73 }"
74
75 kernel_split_src_prepare()
76 {
77 local _old_SRCDIR="${SRCDIR}"
78 KERNEL_TYPE="image" SRCDIR=${_old_SRCDIR}-image kernel_src_prepare || die
79 KERNEL_TYPE="sources" SRCDIR=${_old_SRCDIR} kernel_src_prepare || die
80 }
81
82 kernel_split_src_compile()
83 {
84 local _old_SRCDIR="${SRCDIR}"
85 KERNEL_TYPE="image" SRCDIR=${_old_SRCDIR}-image kernel_src_compile || die
86 KERNEL_TYPE="sources" SRCDIR=${_old_SRCDIR} kernel_src_compile || die
87 }
88
89 eval "kernel_split_src_install_kernel-${BRANCH}()
90 {
91 local _old_SRCDIR="${SRCDIR}"
92 KERNEL_TYPE=\"image\" SRCDIR=\${_old_SRCDIR}-image kernel_image_src_install || die
93 }"
94
95 eval "kernel_split_src_install_kernel-sources-${BRANCH}()
96 {
97 local _old_SRCDIR="${SRCDIR}"
98 KERNEL_TYPE=\"sources\" SRCDIR=\${_old_SRCDIR} kernel_sources_src_install || die
99 }"
100
101 eval "preinstall_kernel-${BRANCH}()
102 {
103 kernel_image_preinstall
104 }"
105
106 eval "preremove_kernel-${BRANCH}()
107 {
108 kernel_image_preremove
109 }"
110
111 eval "postinstall_kernel-${BRANCH}()
112 {
113 kernel_image_postinstall
114 }"
115
116 eval "postinstall_kernel-sources-${BRANCH}()
117 {
118 kernel_sources_postinstall
119 }"
120
121 export_inherits kernel_split src_prepare src_compile src_install_kernel-${BRANCH} src_install_kernel-sources-${BRANCH}