Lines Matching +full:build +full:- +full:release
4 # kmodtool - Helper script for building kernel module RPMs
5 # Copyright (c) 2003-2012 Ville Skyttä <ville.skytta@iki.fi>,
28 shopt -s extglob
30 myprog="kmodtool-${repo}"
49 # the next line is not multi-line safe -- not needed *yet*
68 %global akmod_install mkdir -p \$RPM_BUILD_ROOT/%{_usrsrc}/akmods/; \\\
69 LANG=C rpmbuild --define "_sourcedir %{_sourcedir}" \\\
70 --define "_srcrpmdir \$RPM_BUILD_ROOT/%{_usrsrc}/akmods/" \\\
71 -bs --nodeps %{_specdir}/%{name}.spec ; \\\
72 ln -s \$(ls \$RPM_BUILD_ROOT/%{_usrsrc}/akmods/) \$RPM_BUILD_ROOT/%{_usrsrc}/akmods/${kmodname}-kmo…
74 %package -n akmod-${kmodname}
81 Requires: ${kmodname}-kmod-common >= %{?epoch:%{epoch}:}%{version}
82 Provides: ${kmodname}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
87 %description -n akmod-${kmodname}
90 %posttrans -n akmod-${kmodname}
91 nohup ${prefix}/sbin/akmods --from-akmod-posttrans --akmod ${kmodname} &> /dev/null &
93 %files -n akmod-${kmodname}
94 %defattr(-,root,root,-)
103 %package -n kmod-${kmodname}
107 Provides: ${kmodname}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
108 Provides: kmod-${kmodname}-xen = %{?epoch:%{epoch}:}%{version}-%{release}
109 Provides: kmod-${kmodname}-smp = %{?epoch:%{epoch}:}%{version}-%{release}
110 Provides: kmod-${kmodname}-PAE = %{?epoch:%{epoch}:}%{version}-%{release}
111 Requires: akmod-${kmodname} = %{?epoch:%{epoch}:}%{version}-%{release}
116 %description -n kmod-${kmodname}${dashvariant}
117 This is a meta-package without payload which sole purpose is to require the
121 %files -n kmod-${kmodname}${dashvariant}
128 if [[ "${1}" = "--custom" ]]; then
131 elif [[ "${1}" = "--redhat" ]]; then
138 local kernel_variant="${2:+-${2}}"
142 if [[ ! -f "${depmod_path}" ]]; then
148 %package -n kmod-${kmodname}-${kernel_uname_r}
151 Provides: kernel-modules-for-kernel = ${kernel_uname_r}
152 Provides: kmod-${kmodname}-uname-r = ${kernel_uname_r}
153 Provides: ${kmodname}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
154 Requires: ${kmodname}-kmod-common >= %{?epoch:%{epoch}:}%{version}
157 Requires(post): module-init-tools
158 Requires(postun): module-init-tools
166 if [[ -z "${customkernel}" ]]; then
168 Requires: kernel-uname-r = ${kernel_uname_r}
169 BuildRequires: kernel-devel-uname-r = ${kernel_uname_r}
170 %{?KmodsRequires:Requires: %{KmodsRequires}-uname-r = ${kernel_uname_r}}
171 %{?KmodsRequires:BuildRequires: %{KmodsRequires}-uname-r = ${kernel_uname_r}}
172 %post -n kmod-${kmodname}-${kernel_uname_r}
173 if [[ -f "/boot/System.map-${kernel_uname_r}" ]]; then
174 ${prefix}${depmod_path} -aeF /boot/System.map-${kernel_uname_r} ${kernel_uname_r} > /dev/null || :
175 elif [[ -f "/lib/modules/${kernel_uname_r}/System.map" ]]; then
176 …${prefix}${depmod_path} -aeF /lib/modules/${kernel_uname_r}/System.map ${kernel_uname_r} > /dev/nu…
178 ${prefix}${depmod_path} -ae ${kernel_uname_r} &> /dev/null || :
180 %postun -n kmod-${kmodname}-${kernel_uname_r}
181 if [[ -f "/boot/System.map-${kernel_uname_r}" ]]; then
182 ${prefix}${depmod_path} -aF /boot/System.map-${kernel_uname_r} ${kernel_uname_r} &> /dev/null || :
183 elif [[ -f "/lib/modules/${kernel_uname_r}/System.map" ]]; then
184 …${prefix}${depmod_path} -aF /lib/modules/${kernel_uname_r}/System.map ${kernel_uname_r} &> /dev/nu…
186 ${prefix}${depmod_path} -a ${kernel_uname_r} &> /dev/null || :
192 %post -n kmod-${kmodname}-${kernel_uname_r}
193 [ "\$(uname -r)" = "${kernel_uname_r}" ] && ${prefix}${depmod_path} -a > /dev/null || :
194 %postun -n kmod-${kmodname}-${kernel_uname_r}
195 [ "\$(uname -r)" = "${kernel_uname_r}" ] && ${prefix}${depmod_path} -a > /dev/null || :
202 %description -n kmod-${kmodname}-${kernel_uname_r}
205 %files -n kmod-${kmodname}-${kernel_uname_r}
216 if [[ "${1}" = "--custom" ]]; then
219 elif [[ "${1}" = "--redhat" ]]; then
227 %package -n kmod-${kmodname}-devel
230 Provides: ${kmodname}-devel-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
233 if [[ -z "${customkernel}" ]] && [[ -z "${redhatkernel}" ]]; then
234 …echo "Requires: kmod-${kmodname}-devel-${kernel_uname_r} >= %{?epoch:%{epoch}:}%{version}-%…
238 %description -n kmod-${kmodname}-devel
239 This package provides the common header files to build kernel modules
241 the ${kmodname}-devel-<kernel> objects for the newest kernel.
243 %files -n kmod-${kmodname}-devel
245 %{_usrsrc}/${kmodname}-%{version}
250 echo "%exclude %{_usrsrc}/${kmodname}-%{version}/${kernel_uname_r}"
259 if [[ "${1}" = "--custom" ]]; then
262 elif [[ "${1}" = "--redhat" ]]; then
269 local kernel_variant="${2:+-${2}}"
273 %package -n kmod-${kmodname}-devel-${kernel_uname_r}
276 Provides: kernel-objects-for-kernel = ${kernel_uname_r}
277 Provides: ${kmodname}-devel-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
278 Provides: kmod-${kmodname}-devel-uname-r = ${kernel_uname_r}
282 if [[ -z "${customkernel}" ]]; then
284 Requires: kernel-devel-uname-r = ${kernel_uname_r}
285 BuildRequires: kernel-devel-uname-r = ${kernel_uname_r}
286 %{?KmodsDevelRequires:Requires: %{KmodsDevelRequires}-uname-r = ${kernel_uname_r}}
287 %{?KmodsDevelRequires:BuildRequires: %{KmodsDevelRequires}-uname-r = ${kernel_uname_r}}
293 %description -n kmod-${kmodname}-devel-${kernel_uname_r}
294 This package provides objects and symbols required to build kernel modules
297 %files -n kmod-${kmodname}-devel-${kernel_uname_r}
299 %{_usrsrc}/${kmodname}-%{version}/${kernel_uname_r}
306 local kernel_variant="${2:+-${2}}"
309 %package -n kmod-${kmodname}${kernel_variant}
313 Provides: ${kmodname}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
314 Requires: kmod-${kmodname}-${kernel_uname_r} >= %{?epoch:%{epoch}:}%{version}-%{release}
320 %description -n kmod-${kmodname}${kernel_variant}
321 This is a meta-package without payload which sole purpose is to require the
325 %files -n kmod-${kmodname}${kernel_variant}
336 if [[ -e "${prefix}/lib/modules/${kernel}/build/Makefile" ]]; then
337 # likely a user-build-kernel with available buildfiles
340 kernel_versions="${kernel_versions}${kernel}___${prefix}/lib/modules/${kernel}/build/ "
341 print_rpmtemplate_per_kmodpkg --custom "${kernel}"
344 if [[ -n "${devel}" ]]; then
346 print_rpmtemplate_kmoddevelpkg --custom "${kernel}"
349 print_rpmtemplate_per_kmoddevelpkg --custom "${kernel}"
351 elif [[ -e "${buildroot}/usr/src/kernels/${kernel}" ]]; then
352 …# this looks like a Fedora/RH kernel -- print a normal template (which includes the proper BR) and…
357 print_rpmtemplate_per_kmodpkg --redhat ${kernel} ${kernel##${kernel_verrelarch}}
360 if [[ -n "${devel}" ]]; then
362 print_rpmtemplate_kmoddevelpkg --redhat ${kernel} ${kernel##${kernel_verrelarch}}
365 print_rpmtemplate_per_kmoddevelpkg --redhat ${kernel} ${kernel##${kernel_verrelarch}}
368 …error_out 2 "Don't know how to handle ${kernel} -- ${prefix}/lib/modules/${kernel}/build/Makefile …
372 # well, it's no header anymore, but who cares ;-)
399 if [[ -n "${devel}" ]]; then
416 echo " --filterfile <file> -- filter the results with grep --file <file>"
417 echo " --for-kernels <list> -- created templates only for these kernels"
418 echo " --kmodname <file> -- name of the kmod (required)"
419 echo " --devel -- make kmod-devel package"
420 echo " --noakmod -- no akmod package"
421 echo " --repo <name> -- use buildsys-build-<name>-kerneldevpkgs"
422 echo " --target <arch> -- target-arch (required)"
423 echo " --buildroot <dir> -- Build root (place to look for build files)"
426 while [[ -n "${1}" ]] ; do
428 --filterfile)
430 if [[ -z "${1}" ]] ; then
431 error_out 2 "Please provide path to a filter-file together with --filterfile" >&2
432 elif [[ ! -e "${1}" ]]; then
438 --kmodname)
440 if [[ -z "${1}" ]] ; then
441 error_out 2 "Please provide the name of the kmod together with --kmodname" >&2
443 # strip pending -kmod
444 kmodname="${1%%-kmod}"
447 --devel)
451 --prefix)
453 if [[ -z "${1}" ]] ; then
454 error_out 2 "Please provide a prefix with --prefix" >&2
459 --repo)
461 if [[ -z "${1}" ]] ; then
462 error_out 2 "Please provide the name of the repo together with --repo" >&2
467 --for-kernels)
469 if [[ -z "${1}" ]] ; then
470 error_out 2 "Please provide the name of the kmod together with --kmodname" >&2
475 --noakmod)
479 --target)
484 --akmod)
488 --newest)
492 --current)
496 --buildroot)
501 --help)
505 --version)
517 if [[ -e ./kmodtool-kernel-variants ]]; then
518 kernels_known_variants="$(cat ./kmodtool-kernel-variants)"
519 elif [[ -e /usr/share/kmodtool/kernel-variants ]] ; then
520 kernels_known_variants="$(cat /usr/share/kmodtool/kernel-variants)"
522 …kernels_known_variants="@(smp?(-debug)|PAE?(-debug)|debug|kdump|xen|kirkwood|highbank|imx|omap|teg…
526 if [[ -z "${target}" ]]; then
527 error_out 2 "please pass target arch with --target"
528 elif [[ -z "${kmodname}" ]]; then
529 error_out 2 "please pass kmodname with --kmodname"
530 elif [[ -z "${kernels_known_variants}" ]] ; then
535 if [[ -n "${for_kernels}" ]]; then
543 # seems we are on out own to decide for which kernels to build
546 if [[ -z "${repo}" ]]; then
547 error_out 2 "please provide repo name with --repo"
548 elif ! command -v "buildsys-build-${repo}-kerneldevpkgs" > /dev/null 2>&1; then
549 error_out 2 "buildsys-build-${repo}-kerneldevpkgs not found"
552 # call buildsys-build-${repo}-kerneldevpkgs to get the list of kernels
553 cmdoptions="--target ${target}"
556 if [[ -n "${filterfile}" ]] ; then
557 cmdoptions="${cmdoptions} --filterfile ${filterfile}"
560 …kernel_versions_to_build_for=$(buildsys-build-${repo}-kerneldevpkgs "--${build_kernels}" ${cmdopti…
561 error_out 2 "buildsys-build-${repo}-kerneldevpkgs failed: ${kernel_versions_to_build_for}"
563 if [[ "${build_kernels}" = "current" ]] && [[ -z "${noakmod}" ]]; then