|
|
|
@ -54,9 +54,9 @@ error_out()
|
|
|
|
|
print_rpmtemplate_header()
|
|
|
|
|
{
|
|
|
|
|
echo
|
|
|
|
|
echo '%global kmodinstdir_prefix '${prefix}/lib/modules/
|
|
|
|
|
echo '%global kmodinstdir_postfix '/extra/${kmodname}/
|
|
|
|
|
echo '%global kernel_versions '${kernel_versions}
|
|
|
|
|
echo "%global kmodinstdir_prefix ${prefix}/lib/modules/"
|
|
|
|
|
echo "%global kmodinstdir_postfix /extra/${kmodname}/"
|
|
|
|
|
echo "%global kernel_versions ${kernel_versions}"
|
|
|
|
|
echo
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -82,7 +82,7 @@ Requires: ${kmodname}-kmod-common >= %{?epoch:%{epoch}:}%{version}
|
|
|
|
|
Provides: ${kmodname}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
if [[ ${obsolete_name} ]]; then
|
|
|
|
|
if [ -n "${obsolete_name}" ]; then
|
|
|
|
|
echo "Provides: akmod-${obsolete_name} = ${obsolete_version}"
|
|
|
|
|
echo "Obsoletes: akmod-${obsolete_name} < ${obsolete_version}"
|
|
|
|
|
fi
|
|
|
|
@ -116,7 +116,7 @@ Provides: kmod-${kmodname}-PAE = %{?epoch:%{epoch}:}%{version}-%{release}
|
|
|
|
|
Requires: akmod-${kmodname} = %{?epoch:%{epoch}:}%{version}-%{release}
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
if [[ ${obsolete_name} ]]; then
|
|
|
|
|
if [ -n "${obsolete_name}" ]; then
|
|
|
|
|
echo "Provides: kmod-${obsolete_name} = ${obsolete_version}"
|
|
|
|
|
echo "Obsoletes: kmod-${obsolete_name} < ${obsolete_version}"
|
|
|
|
|
fi
|
|
|
|
@ -134,10 +134,10 @@ EOF
|
|
|
|
|
|
|
|
|
|
print_rpmtemplate_per_kmodpkg ()
|
|
|
|
|
{
|
|
|
|
|
if [[ "${1}" == "--custom" ]]; then
|
|
|
|
|
if [ "${1}" = "--custom" ]; then
|
|
|
|
|
shift
|
|
|
|
|
local customkernel=true
|
|
|
|
|
elif [[ "${1}" == "--redhat" ]]; then
|
|
|
|
|
elif [ "${1}" = "--redhat" ]; then
|
|
|
|
|
# this is needed for akmods
|
|
|
|
|
shift
|
|
|
|
|
local redhatkernel=true
|
|
|
|
@ -148,7 +148,7 @@ print_rpmtemplate_per_kmodpkg ()
|
|
|
|
|
|
|
|
|
|
# Detect depmod install location
|
|
|
|
|
local depmod_path=/sbin/depmod
|
|
|
|
|
if [ ! -f ${depmod_path} ]; then
|
|
|
|
|
if [ ! -f "${depmod_path}" ]; then
|
|
|
|
|
depmod_path=/usr/sbin/depmod
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
@ -171,30 +171,30 @@ Requires(postun): kmod
|
|
|
|
|
%endif
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
if [[ ${obsolete_name} ]]; then
|
|
|
|
|
if [ -n "${obsolete_name}" ]; then
|
|
|
|
|
echo "Provides: kmod-${obsolete_name}-${kernel_uname_r} = ${obsolete_version}"
|
|
|
|
|
echo "Obsoletes: kmod-${obsolete_name}-${kernel_uname_r} < ${obsolete_version}"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# second part
|
|
|
|
|
if [[ ! "${customkernel}" ]]; then
|
|
|
|
|
if [ -z "${customkernel}" ]; then
|
|
|
|
|
cat <<EOF
|
|
|
|
|
Requires: kernel-uname-r = ${kernel_uname_r}
|
|
|
|
|
BuildRequires: kernel-devel-uname-r = ${kernel_uname_r}
|
|
|
|
|
%{?KmodsRequires:Requires: %{KmodsRequires}-uname-r = ${kernel_uname_r}}
|
|
|
|
|
%{?KmodsRequires:BuildRequires: %{KmodsRequires}-uname-r = ${kernel_uname_r}}
|
|
|
|
|
%post -n kmod-${kmodname}-${kernel_uname_r}
|
|
|
|
|
if [[ -f "/boot/System.map-${kernel_uname_r}" ]]; then
|
|
|
|
|
if [ -f "/boot/System.map-${kernel_uname_r}" ]; then
|
|
|
|
|
${prefix}${depmod_path} -aeF /boot/System.map-${kernel_uname_r} ${kernel_uname_r} > /dev/null || :
|
|
|
|
|
elif [[ -f "/lib/modules/${kernel_uname_r}/System.map" ]]; then
|
|
|
|
|
elif [ -f "/lib/modules/${kernel_uname_r}/System.map" ]; then
|
|
|
|
|
${prefix}${depmod_path} -aeF /lib/modules/${kernel_uname_r}/System.map ${kernel_uname_r} > /dev/null || :
|
|
|
|
|
else
|
|
|
|
|
${prefix}${depmod_path} -ae ${kernel_uname_r} &> /dev/null || :
|
|
|
|
|
fi
|
|
|
|
|
%postun -n kmod-${kmodname}-${kernel_uname_r}
|
|
|
|
|
if [[ -f "/boot/System.map-${kernel_uname_r}" ]]; then
|
|
|
|
|
if [ -f "/boot/System.map-${kernel_uname_r}" ]; then
|
|
|
|
|
${prefix}${depmod_path} -aF /boot/System.map-${kernel_uname_r} ${kernel_uname_r} &> /dev/null || :
|
|
|
|
|
elif [[ -f "/lib/modules/${kernel_uname_r}/System.map" ]]; then
|
|
|
|
|
elif [ -f "/lib/modules/${kernel_uname_r}/System.map" ]; then
|
|
|
|
|
${prefix}${depmod_path} -aF /lib/modules/${kernel_uname_r}/System.map ${kernel_uname_r} &> /dev/null || :
|
|
|
|
|
else
|
|
|
|
|
${prefix}${depmod_path} -a ${kernel_uname_r} &> /dev/null || :
|
|
|
|
@ -204,9 +204,9 @@ EOF
|
|
|
|
|
else
|
|
|
|
|
cat <<EOF
|
|
|
|
|
%post -n kmod-${kmodname}-${kernel_uname_r}
|
|
|
|
|
[[ "\$(uname -r)" == "${kernel_uname_r}" ]] && ${prefix}${depmod_path} -a > /dev/null || :
|
|
|
|
|
[ "\$(uname -r)" = "${kernel_uname_r}" ] && ${prefix}${depmod_path} -a > /dev/null || :
|
|
|
|
|
%postun -n kmod-${kmodname}-${kernel_uname_r}
|
|
|
|
|
[[ "\$(uname -r)" == "${kernel_uname_r}" ]] && ${prefix}${depmod_path} -a > /dev/null || :
|
|
|
|
|
[ "\$(uname -r)" = "${kernel_uname_r}" ] && ${prefix}${depmod_path} -a > /dev/null || :
|
|
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
fi
|
|
|
|
@ -227,10 +227,10 @@ EOF
|
|
|
|
|
|
|
|
|
|
print_rpmtemplate_kmoddevelpkg ()
|
|
|
|
|
{
|
|
|
|
|
if [[ "${1}" == "--custom" ]]; then
|
|
|
|
|
if [ "${1}" = "--custom" ]; then
|
|
|
|
|
shift
|
|
|
|
|
local customkernel=true
|
|
|
|
|
elif [[ "${1}" == "--redhat" ]]; then
|
|
|
|
|
elif [ "${1}" = "--redhat" ]; then
|
|
|
|
|
shift
|
|
|
|
|
local redhatkernel=true
|
|
|
|
|
fi
|
|
|
|
@ -244,11 +244,11 @@ Group: System Environment/Kernel
|
|
|
|
|
Provides: ${kmodname}-devel-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
if [[ ! ${customkernel} ]] && [[ ! ${redhatkernel} ]]; then
|
|
|
|
|
if [ -z "${customkernel}" ] && [ -z "${redhatkernel}" ]; then
|
|
|
|
|
echo "Requires: kmod-${kmodname}-devel-${kernel_uname_r} >= %{?epoch:%{epoch}:}%{version}-%{release}"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [[ ${obsolete_name} ]]; then
|
|
|
|
|
if [ -n "${obsolete_name}" ]; then
|
|
|
|
|
echo "Provides: kmod-${obsolete_name}-devel = ${obsolete_version}"
|
|
|
|
|
echo "Obsoletes: kmod-${obsolete_name}-devel < ${obsolete_version}"
|
|
|
|
|
fi
|
|
|
|
@ -263,14 +263,14 @@ the ${kmodname}-devel-<kernel> objects for the newest kernel.
|
|
|
|
|
%defattr(644,root,root,755)
|
|
|
|
|
%{_usrsrc}/${kmodname}-%{version}
|
|
|
|
|
EOF
|
|
|
|
|
if [[ ${obsolete_name} ]]; then
|
|
|
|
|
if [ -n "${obsolete_name}" ]; then
|
|
|
|
|
echo "%{_usrsrc}/${obsolete_name}-%{version}"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
for kernel in ${1}; do
|
|
|
|
|
local kernel_uname_r=${kernel}
|
|
|
|
|
echo "%exclude %{_usrsrc}/${kmodname}-%{version}/${kernel_uname_r}"
|
|
|
|
|
if [[ ${obsolete_name} ]]; then
|
|
|
|
|
if [ -n "${obsolete_name}" ]; then
|
|
|
|
|
echo "%exclude %{_usrsrc}/${obsolete_name}-%{version}/${kernel_uname_r}"
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
@ -281,10 +281,10 @@ EOF
|
|
|
|
|
|
|
|
|
|
print_rpmtemplate_per_kmoddevelpkg ()
|
|
|
|
|
{
|
|
|
|
|
if [[ "${1}" == "--custom" ]]; then
|
|
|
|
|
if [ "${1}" = "--custom" ]; then
|
|
|
|
|
shift
|
|
|
|
|
local customkernel=true
|
|
|
|
|
elif [[ "${1}" == "--redhat" ]]; then
|
|
|
|
|
elif [ "${1}" = "--redhat" ]; then
|
|
|
|
|
# this is needed for akmods
|
|
|
|
|
shift
|
|
|
|
|
local redhatkernel=true
|
|
|
|
@ -303,13 +303,13 @@ Provides: ${kmodname}-devel-kmod = %{?epoch:%{epoch}:}%{version}-%{relea
|
|
|
|
|
Provides: kmod-${kmodname}-devel-uname-r = ${kernel_uname_r}
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
if [[ ${obsolete_name} ]]; then
|
|
|
|
|
if [ -n "${obsolete_name}" ]; then
|
|
|
|
|
echo "Provides: kmod-${obsolete_name}-devel-${kernel_uname_r} = ${obsolete_version}"
|
|
|
|
|
echo "Obsoletes: kmod-${obsolete_name}-devel-${kernel_uname_r} < ${obsolete_version}"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# second part
|
|
|
|
|
if [[ ! "${customkernel}" ]]; then
|
|
|
|
|
if [ -z "${customkernel}" ]; then
|
|
|
|
|
cat <<EOF
|
|
|
|
|
Requires: kernel-devel-uname-r = ${kernel_uname_r}
|
|
|
|
|
BuildRequires: kernel-devel-uname-r = ${kernel_uname_r}
|
|
|
|
@ -328,7 +328,7 @@ kernel ${kernel_uname_r} for the %{_target_cpu} family of processors.
|
|
|
|
|
%defattr(644,root,root,755)
|
|
|
|
|
%{_usrsrc}/${kmodname}-%{version}/${kernel_uname_r}
|
|
|
|
|
EOF
|
|
|
|
|
if [[ ${obsolete_name} ]]; then
|
|
|
|
|
if [ -n "${obsolete_name}" ]; then
|
|
|
|
|
echo "%{_usrsrc}/${obsolete_name}-%{version}/${kernel_uname_r}"
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
@ -348,7 +348,7 @@ Requires: kmod-${kmodname}-${kernel_uname_r} >= %{?epoch:%{epoch}:}%{vers
|
|
|
|
|
%{?KmodsMetaRequires:Requires: %{?KmodsMetaRequires}}
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
if [[ ${obsolete_name} ]]; then
|
|
|
|
|
if [ -n "${obsolete_name}" ]; then
|
|
|
|
|
echo "Provides: kmod-${obsolete_name}${kernel_variant} = ${obsolete_version}"
|
|
|
|
|
echo "Obsoletes: kmod-${obsolete_name}${kernel_variant} < ${obsolete_version}"
|
|
|
|
|
fi
|
|
|
|
@ -371,7 +371,7 @@ print_customrpmtemplate ()
|
|
|
|
|
{
|
|
|
|
|
for kernel in ${1}
|
|
|
|
|
do
|
|
|
|
|
if [[ -e "${buildroot}/usr/src/kernels/${kernel}" ]] ; then
|
|
|
|
|
if [ -e "${buildroot}/usr/src/kernels/${kernel}" ] ; then
|
|
|
|
|
# this looks like a Fedora/RH kernel -- print a normal template (which includes the proper BR) and be happy :)
|
|
|
|
|
kernel_versions="${kernel_versions}${kernel}___${buildroot}%{_usrsrc}/kernels/${kernel} "
|
|
|
|
|
|
|
|
|
@ -380,14 +380,14 @@ print_customrpmtemplate ()
|
|
|
|
|
print_rpmtemplate_per_kmodpkg --redhat ${kernel} ${kernel##${kernel_verrelarch}}
|
|
|
|
|
|
|
|
|
|
# create development package
|
|
|
|
|
if [[ "${devel}" ]]; then
|
|
|
|
|
if [ -n "${devel}" ]; then
|
|
|
|
|
# create devel package including common headers
|
|
|
|
|
print_rpmtemplate_kmoddevelpkg --redhat ${kernel} ${kernel##${kernel_verrelarch}}
|
|
|
|
|
|
|
|
|
|
# create devel package
|
|
|
|
|
print_rpmtemplate_per_kmoddevelpkg --redhat ${kernel} ${kernel##${kernel_verrelarch}}
|
|
|
|
|
fi
|
|
|
|
|
elif [[ -e ${prefix}/lib/modules/"${kernel}"/build/Makefile ]] ; then
|
|
|
|
|
elif [ -e "${prefix}/lib/modules/${kernel}/build/Makefile" ]; then
|
|
|
|
|
# likely a user-build-kernel with available buildfiles
|
|
|
|
|
# fixme: we should check if uname from Makefile is the same as ${kernel}
|
|
|
|
|
|
|
|
|
@ -395,7 +395,7 @@ print_customrpmtemplate ()
|
|
|
|
|
print_rpmtemplate_per_kmodpkg --custom "${kernel}"
|
|
|
|
|
|
|
|
|
|
# create development package
|
|
|
|
|
if [[ "${devel}" ]]; then
|
|
|
|
|
if [ -n "${devel}" ]; then
|
|
|
|
|
# create devel package including common headers
|
|
|
|
|
print_rpmtemplate_kmoddevelpkg --custom "${kernel}"
|
|
|
|
|
|
|
|
|
@ -429,17 +429,17 @@ print_rpmtemplate ()
|
|
|
|
|
local kernel_verrelarch=${kernel%%${kernels_known_variants}}
|
|
|
|
|
|
|
|
|
|
# create metapackage
|
|
|
|
|
print_rpmtemplate_kmodmetapkg ${kernel} ${kernel##${kernel_verrelarch}}
|
|
|
|
|
print_rpmtemplate_kmodmetapkg "${kernel}" "${kernel##${kernel_verrelarch}}"
|
|
|
|
|
|
|
|
|
|
# create package
|
|
|
|
|
print_rpmtemplate_per_kmodpkg ${kernel} ${kernel##${kernel_verrelarch}}
|
|
|
|
|
print_rpmtemplate_per_kmodpkg "${kernel}" "${kernel##${kernel_verrelarch}}"
|
|
|
|
|
|
|
|
|
|
if [[ "${devel}" ]]; then
|
|
|
|
|
if [ -n "${devel}" ]; then
|
|
|
|
|
# create devel package including common headers
|
|
|
|
|
print_rpmtemplate_kmoddevelpkg ${kernel} ${kernel##${kernel_verrelarch}}
|
|
|
|
|
print_rpmtemplate_kmoddevelpkg "${kernel}" "${kernel##${kernel_verrelarch}}"
|
|
|
|
|
|
|
|
|
|
# create devel package
|
|
|
|
|
print_rpmtemplate_per_kmoddevelpkg ${kernel} ${kernel##${kernel_verrelarch}}
|
|
|
|
|
print_rpmtemplate_per_kmoddevelpkg "${kernel}" "${kernel##${kernel_verrelarch}}"
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
}
|
|
|
|
@ -447,8 +447,10 @@ print_rpmtemplate ()
|
|
|
|
|
myprog_help ()
|
|
|
|
|
{
|
|
|
|
|
echo "Usage: ${0##*/} [OPTIONS]"
|
|
|
|
|
echo $'\n'"Creates a template to be used during kmod building"
|
|
|
|
|
echo $'\n'"Available options:"
|
|
|
|
|
echo
|
|
|
|
|
echo "Creates a template to be used during kmod building"
|
|
|
|
|
echo
|
|
|
|
|
echo "Available options:"
|
|
|
|
|
echo " --filterfile <file> -- filter the results with grep --file <file>"
|
|
|
|
|
echo " --for-kernels <list> -- created templates only for these kernels"
|
|
|
|
|
echo " --kmodname <file> -- name of the kmod (required)"
|
|
|
|
@ -459,13 +461,13 @@ myprog_help ()
|
|
|
|
|
echo " --buildroot <dir> -- Build root (place to look for build files)"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
while [ "${1}" ] ; do
|
|
|
|
|
while [ -n "${1}" ] ; do
|
|
|
|
|
case "${1}" in
|
|
|
|
|
--filterfile)
|
|
|
|
|
shift
|
|
|
|
|
if [[ ! "${1}" ]] ; then
|
|
|
|
|
if [ -z "${1}" ] ; then
|
|
|
|
|
error_out 2 "Please provide path to a filter-file together with --filterfile" >&2
|
|
|
|
|
elif [[ ! -e "${1}" ]]; then
|
|
|
|
|
elif [ ! -e "${1}" ]; then
|
|
|
|
|
error_out 2 "Filterfile ${1} not found" >&2
|
|
|
|
|
fi
|
|
|
|
|
filterfile="${1}"
|
|
|
|
@ -473,7 +475,7 @@ while [ "${1}" ] ; do
|
|
|
|
|
;;
|
|
|
|
|
--kmodname)
|
|
|
|
|
shift
|
|
|
|
|
if [[ ! "${1}" ]] ; then
|
|
|
|
|
if [ -z "${1}" ] ; then
|
|
|
|
|
error_out 2 "Please provide the name of the kmod together with --kmodname" >&2
|
|
|
|
|
fi
|
|
|
|
|
# strip pending -kmod
|
|
|
|
@ -486,7 +488,7 @@ while [ "${1}" ] ; do
|
|
|
|
|
;;
|
|
|
|
|
--prefix)
|
|
|
|
|
shift
|
|
|
|
|
if [[ ! "${1}" ]] ; then
|
|
|
|
|
if [ -z "${1}" ] ; then
|
|
|
|
|
error_out 2 "Please provide a prefix with --prefix" >&2
|
|
|
|
|
fi
|
|
|
|
|
prefix="${1}"
|
|
|
|
@ -494,7 +496,7 @@ while [ "${1}" ] ; do
|
|
|
|
|
;;
|
|
|
|
|
--repo)
|
|
|
|
|
shift
|
|
|
|
|
if [[ ! "${1}" ]] ; then
|
|
|
|
|
if [ -z "${1}" ] ; then
|
|
|
|
|
error_out 2 "Please provide the name of the repo together with --repo" >&2
|
|
|
|
|
fi
|
|
|
|
|
repo=${1}
|
|
|
|
@ -502,7 +504,7 @@ while [ "${1}" ] ; do
|
|
|
|
|
;;
|
|
|
|
|
--for-kernels)
|
|
|
|
|
shift
|
|
|
|
|
if [[ ! "${1}" ]] ; then
|
|
|
|
|
if [ -z "${1}" ] ; then
|
|
|
|
|
error_out 2 "Please provide the name of the kmod together with --kmodname" >&2
|
|
|
|
|
fi
|
|
|
|
|
for_kernels="${1}"
|
|
|
|
@ -514,7 +516,7 @@ while [ "${1}" ] ; do
|
|
|
|
|
;;
|
|
|
|
|
--obsolete-name)
|
|
|
|
|
shift
|
|
|
|
|
if [[ ! "${1}" ]] ; then
|
|
|
|
|
if [ -z "${1}" ] ; then
|
|
|
|
|
error_out 2 "Please provide the name of the kmod to obsolete together with --obsolete-name" >&2
|
|
|
|
|
fi
|
|
|
|
|
obsolete_name="${1}"
|
|
|
|
@ -522,7 +524,7 @@ while [ "${1}" ] ; do
|
|
|
|
|
;;
|
|
|
|
|
--obsolete-version)
|
|
|
|
|
shift
|
|
|
|
|
if [[ ! "${1}" ]] ; then
|
|
|
|
|
if [ -z "${1}" ] ; then
|
|
|
|
|
error_out 2 "Please provide the version of the kmod to obsolete together with --obsolete-version" >&2
|
|
|
|
|
fi
|
|
|
|
|
obsolete_version="${1}"
|
|
|
|
@ -566,30 +568,30 @@ while [ "${1}" ] ; do
|
|
|
|
|
esac
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
if [[ -e ./kmodtool-kernel-variants ]]; then
|
|
|
|
|
if [ -e ./kmodtool-kernel-variants ]; then
|
|
|
|
|
kernels_known_variants="$(cat ./kmodtool-kernel-variants)"
|
|
|
|
|
elif [[ -e /usr/share/kmodtool/kernel-variants ]] ; then
|
|
|
|
|
elif [ -e /usr/share/kmodtool/kernel-variants ] ; then
|
|
|
|
|
kernels_known_variants="$(cat /usr/share/kmodtool/kernel-variants)"
|
|
|
|
|
else
|
|
|
|
|
kernels_known_variants="@(smp?(-debug)|PAE?(-debug)|debug|kdump|xen|kirkwood|highbank|imx|omap|tegra)"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# general sanity checks
|
|
|
|
|
if [[ ! "${target}" ]]; then
|
|
|
|
|
if [ -z "${target}" ]; then
|
|
|
|
|
error_out 2 "please pass target arch with --target"
|
|
|
|
|
elif [[ ! "${kmodname}" ]]; then
|
|
|
|
|
elif [ -z "${kmodname}" ]; then
|
|
|
|
|
error_out 2 "please pass kmodname with --kmodname"
|
|
|
|
|
elif [[ ! "${kernels_known_variants}" ]] ; then
|
|
|
|
|
elif [ -z "${kernels_known_variants}" ] ; then
|
|
|
|
|
error_out 2 "could not determine known variants"
|
|
|
|
|
elif { [[ "${obsolete_name}" ]] && [[ ! "${obsolete_version}" ]]; } || { [[ ! "${obsolete_name}" ]] && [[ "${obsolete_version}" ]]; } ; then
|
|
|
|
|
elif { [ -n "${obsolete_name}" ] && [ -z "${obsolete_version}" ]; } || { [ -z "${obsolete_name}" ] && [ -n "${obsolete_version}" ]; } ; then
|
|
|
|
|
error_out 2 "you need to provide both --obsolete-name and --obsolete-version"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# go
|
|
|
|
|
if [[ "${for_kernels}" ]]; then
|
|
|
|
|
if [ -n "${for_kernels}" ]; then
|
|
|
|
|
# this is easy:
|
|
|
|
|
print_customrpmtemplate "${for_kernels}"
|
|
|
|
|
elif [[ "${build_kernels}" == "akmod" ]]; then
|
|
|
|
|
elif [ "${build_kernels}" = "akmod" ]; then
|
|
|
|
|
# do only a akmod package
|
|
|
|
|
print_akmodtemplate
|
|
|
|
|
print_akmodmeta
|
|
|
|
@ -597,9 +599,9 @@ else
|
|
|
|
|
# seems we are on out own to decide for which kernels to build
|
|
|
|
|
|
|
|
|
|
# we need more sanity checks in this case
|
|
|
|
|
if [[ ! "${repo}" ]]; then
|
|
|
|
|
if [ -z "${repo}" ]; then
|
|
|
|
|
error_out 2 "please provide repo name with --repo"
|
|
|
|
|
elif ! command -v "buildsys-build-${repo}-kerneldevpkgs" &> /dev/null ; then
|
|
|
|
|
elif ! command -v "buildsys-build-${repo}-kerneldevpkgs" > /dev/null 2>&1; then
|
|
|
|
|
error_out 2 "buildsys-build-${repo}-kerneldevpkgs not found"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
@ -607,17 +609,18 @@ else
|
|
|
|
|
cmdoptions="--target ${target}"
|
|
|
|
|
|
|
|
|
|
# filterfile to filter list of kernels?
|
|
|
|
|
if [[ "${filterfile}" ]] ; then
|
|
|
|
|
if [ -n "${filterfile}" ] ; then
|
|
|
|
|
cmdoptions="${cmdoptions} --filterfile ${filterfile}"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
kernel_versions_to_build_for="$(buildsys-build-${repo}-kerneldevpkgs --${build_kernels} ${cmdoptions})"
|
|
|
|
|
kernel_versions_to_build_for=$(buildsys-build-${repo}-kerneldevpkgs "--${build_kernels}" ${cmdoptions})
|
|
|
|
|
returncode=$?
|
|
|
|
|
if (( returncode != 0 )); then
|
|
|
|
|
error_out 2 "buildsys-build-${repo}-kerneldevpkgs failed: $(buildsys-build-${repo}-kerneldevpkgs --${build_kernels} ${cmdoptions})"
|
|
|
|
|
if [ "$returncode" -ne 0 ]; then
|
|
|
|
|
|
|
|
|
|
error_out 2 "buildsys-build-${repo}-kerneldevpkgs failed: ${kernel_versions_to_build_for}"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [[ "${build_kernels}" == "current" ]] && [[ ! "${noakmod}" ]]; then
|
|
|
|
|
if [ "${build_kernels}" = "current" ] && [ -z "${noakmod}" ]; then
|
|
|
|
|
print_akmodtemplate
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|