1#!/usr/bin/env bash 2# shellcheck disable=SC2086 3 4# kmodtool - Helper script for building kernel module RPMs 5# Copyright (c) 2003-2012 Ville Skyttä <ville.skytta@iki.fi>, 6# Thorsten Leemhuis <fedora@leemhuis.info> 7# Nicolas Chauvet <kwizart@gmail.com> 8# 9# Permission is hereby granted, free of charge, to any person obtaining 10# a copy of this software and associated documentation files (the 11# "Software"), to deal in the Software without restriction, including 12# without limitation the rights to use, copy, modify, merge, publish, 13# distribute, sublicense, and/or sell copies of the Software, and to 14# permit persons to whom the Software is furnished to do so, subject to 15# the following conditions: 16# 17# The above copyright notice and this permission notice shall be 18# included in all copies or substantial portions of the Software. 19# 20# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 28shopt -s extglob 29 30myprog="kmodtool-${repo}" 31myver="0.12.1" 32 33kmodname= 34build_kernels="current" 35kernels_known_variants= 36kernel_versions= 37kernel_versions_to_build_for= 38prefix= 39filterfile= 40target= 41buildroot= 42dashvariant= 43 44error_out() 45{ 46 local errorlevel=${1} 47 shift 48 echo "Error: $*" >&2 49 # the next line is not multi-line safe -- not needed *yet* 50 echo "%global kmodtool_check echo \"kmodtool error: $*\"; exit ${errorlevel};" 51 exit "${errorlevel}" 52} 53 54print_rpmtemplate_header() 55{ 56 echo 57 echo "%global kmodinstdir_prefix ${prefix}/lib/modules/" 58 echo "%global kmodinstdir_postfix /extra/${kmodname}/" 59 echo "%global kernel_versions ${kernel_versions}" 60 echo 61} 62 63print_akmodtemplate () 64{ 65 echo 66 cat <<EOF 67 68%global akmod_install mkdir -p \$RPM_BUILD_ROOT/%{_usrsrc}/akmods/; \\\ 69LANG=C rpmbuild --define "_sourcedir %{_sourcedir}" \\\ 70--define "_srcrpmdir \$RPM_BUILD_ROOT/%{_usrsrc}/akmods/" \\\ 71-bs --nodeps %{_specdir}/%{name}.spec ; \\\ 72ln -s \$(ls \$RPM_BUILD_ROOT/%{_usrsrc}/akmods/) \$RPM_BUILD_ROOT/%{_usrsrc}/akmods/${kmodname}-kmod.latest 73 74%package -n akmod-${kmodname} 75Summary: Akmod package for ${kmodname} kernel module(s) 76Group: System Environment/Kernel 77Requires: kmodtool 78Requires: akmods 79%{?AkmodsBuildRequires:Requires: %{AkmodsBuildRequires}} 80# same requires and provides as a kmods package would have 81Requires: ${kmodname}-kmod-common >= %{?epoch:%{epoch}:}%{version} 82Provides: ${kmodname}-kmod = %{?epoch:%{epoch}:}%{version}-%{release} 83EOF 84 85 if [ -n "${obsolete_name}" ]; then 86 echo "Provides: akmod-${obsolete_name} = ${obsolete_version}" 87 echo "Obsoletes: akmod-${obsolete_name} < ${obsolete_version}" 88 fi 89 90 cat <<EOF 91 92%description -n akmod-${kmodname} 93This package provides the akmod package for the ${kmodname} kernel modules. 94 95%posttrans -n akmod-${kmodname} 96nohup ${prefix}/sbin/akmods --from-akmod-posttrans --akmod ${kmodname} &> /dev/null & 97 98%files -n akmod-${kmodname} 99%defattr(-,root,root,-) 100%{_usrsrc}/akmods/* 101 102EOF 103} 104 105print_akmodmeta () 106{ 107 cat <<EOF 108%package -n kmod-${kmodname} 109Summary: Metapackage which tracks in ${kmodname} kernel module for newest kernel${dashvariant} 110Group: System Environment/Kernel 111 112Provides: ${kmodname}-kmod = %{?epoch:%{epoch}:}%{version}-%{release} 113Provides: kmod-${kmodname}-xen = %{?epoch:%{epoch}:}%{version}-%{release} 114Provides: kmod-${kmodname}-smp = %{?epoch:%{epoch}:}%{version}-%{release} 115Provides: kmod-${kmodname}-PAE = %{?epoch:%{epoch}:}%{version}-%{release} 116Requires: akmod-${kmodname} = %{?epoch:%{epoch}:}%{version}-%{release} 117EOF 118 119 if [ -n "${obsolete_name}" ]; then 120 echo "Provides: kmod-${obsolete_name} = ${obsolete_version}" 121 echo "Obsoletes: kmod-${obsolete_name} < ${obsolete_version}" 122 fi 123cat <<EOF 124 125%description -n kmod-${kmodname}${dashvariant} 126This is a meta-package without payload which sole purpose is to require the 127${kmodname} kernel module(s) for the newest kernel${dashvariant}, 128to make sure you get it together with a new kernel. 129 130%files -n kmod-${kmodname}${dashvariant} 131%defattr(644,root,root,755) 132EOF 133} 134 135print_rpmtemplate_per_kmodpkg () 136{ 137 if [ "${1}" = "--custom" ]; then 138 shift 139 local customkernel=true 140 elif [ "${1}" = "--redhat" ]; then 141 # this is needed for akmods 142 shift 143 local redhatkernel=true 144 fi 145 146 local kernel_uname_r=${1} 147 local kernel_variant="${2:+-${2}}" 148 149 # Detect depmod install location 150 local depmod_path=/sbin/depmod 151 if [ ! -f "${depmod_path}" ]; then 152 depmod_path=/usr/sbin/depmod 153 fi 154 155 # first part 156 cat <<EOF 157%package -n kmod-${kmodname}-${kernel_uname_r} 158Summary: ${kmodname} kernel module(s) for ${kernel_uname_r} 159Group: System Environment/Kernel 160Provides: kernel-modules-for-kernel = ${kernel_uname_r} 161Provides: kmod-${kmodname}-uname-r = ${kernel_uname_r} 162Provides: ${kmodname}-kmod = %{?epoch:%{epoch}:}%{version}-%{release} 163Requires: ${kmodname}-kmod-common >= %{?epoch:%{epoch}:}%{version} 164 165%if 0%{?rhel} == 6 || 0%{?centos} == 6 166Requires(post): module-init-tools 167Requires(postun): module-init-tools 168%else 169Requires(post): kmod 170Requires(postun): kmod 171%endif 172EOF 173 174 if [ -n "${obsolete_name}" ]; then 175 echo "Provides: kmod-${obsolete_name}-${kernel_uname_r} = ${obsolete_version}" 176 echo "Obsoletes: kmod-${obsolete_name}-${kernel_uname_r} < ${obsolete_version}" 177 fi 178 179 # second part 180 if [ -z "${customkernel}" ]; then 181 cat <<EOF 182Requires: kernel-uname-r = ${kernel_uname_r} 183BuildRequires: kernel-devel-uname-r = ${kernel_uname_r} 184%{?KmodsRequires:Requires: %{KmodsRequires}-uname-r = ${kernel_uname_r}} 185%{?KmodsRequires:BuildRequires: %{KmodsRequires}-uname-r = ${kernel_uname_r}} 186%post -n kmod-${kmodname}-${kernel_uname_r} 187if [ -f "/boot/System.map-${kernel_uname_r}" ]; then 188 ${prefix}${depmod_path} -aeF /boot/System.map-${kernel_uname_r} ${kernel_uname_r} > /dev/null || : 189elif [ -f "/lib/modules/${kernel_uname_r}/System.map" ]; then 190 ${prefix}${depmod_path} -aeF /lib/modules/${kernel_uname_r}/System.map ${kernel_uname_r} > /dev/null || : 191else 192 ${prefix}${depmod_path} -ae ${kernel_uname_r} &> /dev/null || : 193fi 194%postun -n kmod-${kmodname}-${kernel_uname_r} 195if [ -f "/boot/System.map-${kernel_uname_r}" ]; then 196 ${prefix}${depmod_path} -aF /boot/System.map-${kernel_uname_r} ${kernel_uname_r} &> /dev/null || : 197elif [ -f "/lib/modules/${kernel_uname_r}/System.map" ]; then 198 ${prefix}${depmod_path} -aF /lib/modules/${kernel_uname_r}/System.map ${kernel_uname_r} &> /dev/null || : 199else 200 ${prefix}${depmod_path} -a ${kernel_uname_r} &> /dev/null || : 201fi 202 203EOF 204 else 205 cat <<EOF 206%post -n kmod-${kmodname}-${kernel_uname_r} 207[ "\$(uname -r)" = "${kernel_uname_r}" ] && ${prefix}${depmod_path} -a > /dev/null || : 208%postun -n kmod-${kmodname}-${kernel_uname_r} 209[ "\$(uname -r)" = "${kernel_uname_r}" ] && ${prefix}${depmod_path} -a > /dev/null || : 210 211EOF 212 fi 213 214 # third part 215 cat <<EOF 216%description -n kmod-${kmodname}-${kernel_uname_r} 217This package provides the ${kmodname} kernel modules built for the Linux 218kernel ${kernel_uname_r} for the %{_target_cpu} family of processors. 219%files -n kmod-${kmodname}-${kernel_uname_r} 220%defattr(644,root,root,755) 221%dir $prefix/lib/modules/${kernel_uname_r}/extra 222${prefix}/lib/modules/${kernel_uname_r}/extra/${kmodname}/ 223 224 225EOF 226} 227 228print_rpmtemplate_kmoddevelpkg () 229{ 230 if [ "${1}" = "--custom" ]; then 231 shift 232 local customkernel=true 233 elif [ "${1}" = "--redhat" ]; then 234 shift 235 local redhatkernel=true 236 fi 237 238 local kernel_uname_r=${1} 239 240 cat <<EOF 241%package -n kmod-${kmodname}-devel 242Summary: ${kmodname} kernel module(s) devel common 243Group: System Environment/Kernel 244Provides: ${kmodname}-devel-kmod = %{?epoch:%{epoch}:}%{version}-%{release} 245EOF 246 247 if [ -z "${customkernel}" ] && [ -z "${redhatkernel}" ]; then 248 echo "Requires: kmod-${kmodname}-devel-${kernel_uname_r} >= %{?epoch:%{epoch}:}%{version}-%{release}" 249 fi 250 251 if [ -n "${obsolete_name}" ]; then 252 echo "Provides: kmod-${obsolete_name}-devel = ${obsolete_version}" 253 echo "Obsoletes: kmod-${obsolete_name}-devel < ${obsolete_version}" 254 fi 255 256 cat <<EOF 257%description -n kmod-${kmodname}-devel 258This package provides the common header files to build kernel modules 259which depend on the ${kmodname} kernel module. It may optionally require 260the ${kmodname}-devel-<kernel> objects for the newest kernel. 261 262%files -n kmod-${kmodname}-devel 263%defattr(644,root,root,755) 264%{_usrsrc}/${kmodname}-%{version} 265EOF 266 if [ -n "${obsolete_name}" ]; then 267 echo "%{_usrsrc}/${obsolete_name}-%{version}" 268 fi 269 270 for kernel in ${1}; do 271 local kernel_uname_r=${kernel} 272 echo "%exclude %{_usrsrc}/${kmodname}-%{version}/${kernel_uname_r}" 273 if [ -n "${obsolete_name}" ]; then 274 echo "%exclude %{_usrsrc}/${obsolete_name}-%{version}/${kernel_uname_r}" 275 fi 276 done 277 278 echo 279 echo 280} 281 282print_rpmtemplate_per_kmoddevelpkg () 283{ 284 if [ "${1}" = "--custom" ]; then 285 shift 286 local customkernel=true 287 elif [ "${1}" = "--redhat" ]; then 288 # this is needed for akmods 289 shift 290 local redhatkernel=true 291 fi 292 293 local kernel_uname_r=${1} 294 local kernel_variant="${2:+-${2}}" 295 296 # first part 297 cat <<EOF 298%package -n kmod-${kmodname}-devel-${kernel_uname_r} 299Summary: ${kmodname} kernel module(s) devel for ${kernel_uname_r} 300Group: System Environment/Kernel 301Provides: kernel-objects-for-kernel = ${kernel_uname_r} 302Provides: ${kmodname}-devel-kmod = %{?epoch:%{epoch}:}%{version}-%{release} 303Provides: kmod-${kmodname}-devel-uname-r = ${kernel_uname_r} 304EOF 305 306 if [ -n "${obsolete_name}" ]; then 307 echo "Provides: kmod-${obsolete_name}-devel-${kernel_uname_r} = ${obsolete_version}" 308 echo "Obsoletes: kmod-${obsolete_name}-devel-${kernel_uname_r} < ${obsolete_version}" 309 fi 310 311 # second part 312 if [ -z "${customkernel}" ]; then 313 cat <<EOF 314Requires: kernel-devel-uname-r = ${kernel_uname_r} 315BuildRequires: kernel-devel-uname-r = ${kernel_uname_r} 316%{?KmodsDevelRequires:Requires: %{KmodsDevelRequires}-uname-r = ${kernel_uname_r}} 317%{?KmodsDevelRequires:BuildRequires: %{KmodsDevelRequires}-uname-r = ${kernel_uname_r}} 318EOF 319 fi 320 321 # third part 322 cat <<EOF 323%description -n kmod-${kmodname}-devel-${kernel_uname_r} 324This package provides objects and symbols required to build kernel modules 325which depend on the ${kmodname} kernel modules built for the Linux 326kernel ${kernel_uname_r} for the %{_target_cpu} family of processors. 327%files -n kmod-${kmodname}-devel-${kernel_uname_r} 328%defattr(644,root,root,755) 329%{_usrsrc}/${kmodname}-%{version}/${kernel_uname_r} 330EOF 331 if [ -n "${obsolete_name}" ]; then 332 echo "%{_usrsrc}/${obsolete_name}-%{version}/${kernel_uname_r}" 333 fi 334} 335 336print_rpmtemplate_kmodmetapkg () 337{ 338 local kernel_uname_r=${1} 339 local kernel_variant="${2:+-${2}}" 340 341 cat <<EOF 342%package -n kmod-${kmodname}${kernel_variant} 343Summary: Metapackage which tracks in ${kmodname} kernel module for newest kernel${kernel_variant} 344Group: System Environment/Kernel 345 346Provides: ${kmodname}-kmod = %{?epoch:%{epoch}:}%{version}-%{release} 347Requires: kmod-${kmodname}-${kernel_uname_r} >= %{?epoch:%{epoch}:}%{version}-%{release} 348%{?KmodsMetaRequires:Requires: %{?KmodsMetaRequires}} 349EOF 350 351 if [ -n "${obsolete_name}" ]; then 352 echo "Provides: kmod-${obsolete_name}${kernel_variant} = ${obsolete_version}" 353 echo "Obsoletes: kmod-${obsolete_name}${kernel_variant} < ${obsolete_version}" 354 fi 355 356 cat <<EOF 357 358%description -n kmod-${kmodname}${kernel_variant} 359This is a meta-package without payload which sole purpose is to require the 360${kmodname} kernel module(s) for the newest kernel${kernel_variant}. 361to make sure you get it together with a new kernel. 362 363%files -n kmod-${kmodname}${kernel_variant} 364%defattr(644,root,root,755) 365 366 367EOF 368} 369 370print_customrpmtemplate () 371{ 372 for kernel in ${1} 373 do 374 if [ -e "${buildroot}/usr/src/kernels/${kernel}" ] ; then 375 # this looks like a Fedora/RH kernel -- print a normal template (which includes the proper BR) and be happy :) 376 kernel_versions="${kernel_versions}${kernel}___${buildroot}%{_usrsrc}/kernels/${kernel} " 377 378 # parse kernel versions string and print template 379 local kernel_verrelarch=${kernel%%${kernels_known_variants}} 380 print_rpmtemplate_per_kmodpkg --redhat ${kernel} ${kernel##${kernel_verrelarch}} 381 382 # create development package 383 if [ -n "${devel}" ]; then 384 # create devel package including common headers 385 print_rpmtemplate_kmoddevelpkg --redhat ${kernel} ${kernel##${kernel_verrelarch}} 386 387 # create devel package 388 print_rpmtemplate_per_kmoddevelpkg --redhat ${kernel} ${kernel##${kernel_verrelarch}} 389 fi 390 elif [ -e "${prefix}/lib/modules/${kernel}/build/Makefile" ]; then 391 # likely a user-build-kernel with available buildfiles 392 # fixme: we should check if uname from Makefile is the same as ${kernel} 393 394 kernel_versions="${kernel_versions}${kernel}___${prefix}/lib/modules/${kernel}/build/ " 395 print_rpmtemplate_per_kmodpkg --custom "${kernel}" 396 397 # create development package 398 if [ -n "${devel}" ]; then 399 # create devel package including common headers 400 print_rpmtemplate_kmoddevelpkg --custom "${kernel}" 401 402 # create devel package 403 print_rpmtemplate_per_kmoddevelpkg --custom "${kernel}" 404 fi 405 else 406 error_out 2 "Don't know how to handle ${kernel} -- ${prefix}/lib/modules/${kernel}/build/Makefile not found" 407 fi 408 done 409 410 # well, it's no header anymore, but who cares ;-) 411 print_rpmtemplate_header 412} 413 414 415print_rpmtemplate () 416{ 417 # create kernel_versions var 418 for kernel_version in ${kernel_versions_to_build_for} 419 do 420 kernel_versions="${kernel_versions}${kernel_version}___%{_usrsrc}/kernels/${kernel_version} " 421 done 422 423 # and print it and some other required stuff as macro 424 print_rpmtemplate_header 425 426 # now print the packages 427 for kernel in ${kernel_versions_to_build_for} ; do 428 429 local kernel_verrelarch=${kernel%%${kernels_known_variants}} 430 431 # create metapackage 432 print_rpmtemplate_kmodmetapkg "${kernel}" "${kernel##${kernel_verrelarch}}" 433 434 # create package 435 print_rpmtemplate_per_kmodpkg "${kernel}" "${kernel##${kernel_verrelarch}}" 436 437 if [ -n "${devel}" ]; then 438 # create devel package including common headers 439 print_rpmtemplate_kmoddevelpkg "${kernel}" "${kernel##${kernel_verrelarch}}" 440 441 # create devel package 442 print_rpmtemplate_per_kmoddevelpkg "${kernel}" "${kernel##${kernel_verrelarch}}" 443 fi 444 done 445} 446 447myprog_help () 448{ 449 echo "Usage: ${0##*/} [OPTIONS]" 450 echo 451 echo "Creates a template to be used during kmod building" 452 echo 453 echo "Available options:" 454 echo " --filterfile <file> -- filter the results with grep --file <file>" 455 echo " --for-kernels <list> -- created templates only for these kernels" 456 echo " --kmodname <file> -- name of the kmod (required)" 457 echo " --devel -- make kmod-devel package" 458 echo " --noakmod -- no akmod package" 459 echo " --repo <name> -- use buildsys-build-<name>-kerneldevpkgs" 460 echo " --target <arch> -- target-arch (required)" 461 echo " --buildroot <dir> -- Build root (place to look for build files)" 462} 463 464while [ -n "${1}" ] ; do 465 case "${1}" in 466 --filterfile) 467 shift 468 if [ -z "${1}" ] ; then 469 error_out 2 "Please provide path to a filter-file together with --filterfile" >&2 470 elif [ ! -e "${1}" ]; then 471 error_out 2 "Filterfile ${1} not found" >&2 472 fi 473 filterfile="${1}" 474 shift 475 ;; 476 --kmodname) 477 shift 478 if [ -z "${1}" ] ; then 479 error_out 2 "Please provide the name of the kmod together with --kmodname" >&2 480 fi 481 # strip pending -kmod 482 kmodname="${1%%-kmod}" 483 shift 484 ;; 485 --devel) 486 shift 487 devel="true" 488 ;; 489 --prefix) 490 shift 491 if [ -z "${1}" ] ; then 492 error_out 2 "Please provide a prefix with --prefix" >&2 493 fi 494 prefix="${1}" 495 shift 496 ;; 497 --repo) 498 shift 499 if [ -z "${1}" ] ; then 500 error_out 2 "Please provide the name of the repo together with --repo" >&2 501 fi 502 repo=${1} 503 shift 504 ;; 505 --for-kernels) 506 shift 507 if [ -z "${1}" ] ; then 508 error_out 2 "Please provide the name of the kmod together with --kmodname" >&2 509 fi 510 for_kernels="${1}" 511 shift 512 ;; 513 --noakmod) 514 shift 515 noakmod="true" 516 ;; 517 --obsolete-name) 518 shift 519 if [ -z "${1}" ] ; then 520 error_out 2 "Please provide the name of the kmod to obsolete together with --obsolete-name" >&2 521 fi 522 obsolete_name="${1}" 523 shift 524 ;; 525 --obsolete-version) 526 shift 527 if [ -z "${1}" ] ; then 528 error_out 2 "Please provide the version of the kmod to obsolete together with --obsolete-version" >&2 529 fi 530 obsolete_version="${1}" 531 shift 532 ;; 533 --target) 534 shift 535 target="${1}" 536 shift 537 ;; 538 --akmod) 539 shift 540 build_kernels="akmod" 541 ;; 542 --newest) 543 shift 544 build_kernels="newest" 545 ;; 546 --current) 547 shift 548 build_kernels="current" 549 ;; 550 --buildroot) 551 shift 552 buildroot="${1}" 553 shift 554 ;; 555 --help) 556 myprog_help 557 exit 0 558 ;; 559 --version) 560 echo "${myprog} ${myver}" 561 exit 0 562 ;; 563 *) 564 echo "Error: Unknown option '${1}'." >&2 565 usage >&2 566 exit 2 567 ;; 568 esac 569done 570 571if [ -e ./kmodtool-kernel-variants ]; then 572 kernels_known_variants="$(cat ./kmodtool-kernel-variants)" 573elif [ -e /usr/share/kmodtool/kernel-variants ] ; then 574 kernels_known_variants="$(cat /usr/share/kmodtool/kernel-variants)" 575else 576 kernels_known_variants="@(smp?(-debug)|PAE?(-debug)|debug|kdump|xen|kirkwood|highbank|imx|omap|tegra)" 577fi 578 579# general sanity checks 580if [ -z "${target}" ]; then 581 error_out 2 "please pass target arch with --target" 582elif [ -z "${kmodname}" ]; then 583 error_out 2 "please pass kmodname with --kmodname" 584elif [ -z "${kernels_known_variants}" ] ; then 585 error_out 2 "could not determine known variants" 586elif { [ -n "${obsolete_name}" ] && [ -z "${obsolete_version}" ]; } || { [ -z "${obsolete_name}" ] && [ -n "${obsolete_version}" ]; } ; then 587 error_out 2 "you need to provide both --obsolete-name and --obsolete-version" 588fi 589 590# go 591if [ -n "${for_kernels}" ]; then 592 # this is easy: 593 print_customrpmtemplate "${for_kernels}" 594elif [ "${build_kernels}" = "akmod" ]; then 595 # do only a akmod package 596 print_akmodtemplate 597 print_akmodmeta 598else 599 # seems we are on out own to decide for which kernels to build 600 601 # we need more sanity checks in this case 602 if [ -z "${repo}" ]; then 603 error_out 2 "please provide repo name with --repo" 604 elif ! command -v "buildsys-build-${repo}-kerneldevpkgs" > /dev/null 2>&1; then 605 error_out 2 "buildsys-build-${repo}-kerneldevpkgs not found" 606 fi 607 608 # call buildsys-build-${repo}-kerneldevpkgs to get the list of kernels 609 cmdoptions="--target ${target}" 610 611 # filterfile to filter list of kernels? 612 if [ -n "${filterfile}" ] ; then 613 cmdoptions="${cmdoptions} --filterfile ${filterfile}" 614 fi 615 616 kernel_versions_to_build_for=$(buildsys-build-${repo}-kerneldevpkgs "--${build_kernels}" ${cmdoptions}) 617 returncode=$? 618 if [ "$returncode" -ne 0 ]; then 619 620 error_out 2 "buildsys-build-${repo}-kerneldevpkgs failed: ${kernel_versions_to_build_for}" 621 fi 622 623 if [ "${build_kernels}" = "current" ] && [ -z "${noakmod}" ]; then 624 print_akmodtemplate 625 fi 626 627 print_rpmtemplate 628fi 629