forked from pool/kernel-source
This commit is contained in:
committed by
Git OBS Bridge
parent
7ca723c9ca
commit
c0fcf0b3ed
@@ -49,7 +49,7 @@
|
||||
%define rpm_install_dir %buildroot%obj_install_dir
|
||||
%define kernel_build_dir %my_builddir/linux-obj
|
||||
|
||||
%(chmod +x %_sourcedir/{arch-symbols,find-provides,guards,config-subst,check-for-config-changes,check-supported-list,built-in-where,modversions,symsets.pl})
|
||||
%(chmod +x %_sourcedir/{arch-symbols,find-provides,guards,config-subst,check-for-config-changes,check-supported-list,built-in-where,modversions,symsets.pl,split-modules})
|
||||
|
||||
%define arch_symbols %(%_sourcedir/arch-symbols %_target_cpu)
|
||||
%define symbols %(set -- %name kernel-%build_flavor $(case %build_flavor in (rt|rt_*) echo RT ;; esac) $([ -e %_sourcedir/extra-symbols ] && cat %_sourcedir/extra-symbols) ; echo $*)
|
||||
@@ -154,6 +154,7 @@ Source44: find-provides
|
||||
Source45: module-renames
|
||||
Source46: modversions
|
||||
Source47: symsets.pl
|
||||
Source48: split-modules
|
||||
Source100: config.tar.bz2
|
||||
Source101: patches.arch.tar.bz2
|
||||
Source102: patches.drivers.tar.bz2
|
||||
@@ -188,20 +189,23 @@ NoSource: 111
|
||||
NoSource: 120
|
||||
|
||||
# The following KMPs have been integrated into the kernel package.
|
||||
# sles10 / 10.3
|
||||
Obsoletes: iwlwifi-kmp
|
||||
Obsoletes: ipw3945-kmp
|
||||
# sles10 / 11.0
|
||||
Obsoletes: uvcvideo-kmp
|
||||
# 10.3
|
||||
Obsoletes: adm8211-kmp
|
||||
Obsoletes: rt2x00-kmp
|
||||
Obsoletes: rfswitch-kmp
|
||||
Obsoletes: uvcvideo-kmp
|
||||
# 11.0
|
||||
Obsoletes: atl2-kmp
|
||||
Obsoletes: wlan-ng-kmp
|
||||
Obsoletes: et131x-kmp
|
||||
Obsoletes: ivtv-kmp
|
||||
Obsoletes: at76_usb-kmp
|
||||
Obsoletes: pcc-acpi-kmp
|
||||
Obsoletes: uvcvideo-kmp
|
||||
Obsoletes: ralink-rt2860-kmp
|
||||
Obsoletes: btusb-kmp
|
||||
|
||||
# Build with bash instead of sh as the shell: this turns on bash
|
||||
# extensions like <(...).
|
||||
@@ -237,21 +241,15 @@ echo "Symbol(s):" %symbols
|
||||
mkdir -p %kernel_build_dir
|
||||
|
||||
supported_conf() {
|
||||
%_sourcedir/guards %symbols $* < %_sourcedir/supported.conf | sort -u
|
||||
%_sourcedir/guards %symbols $* < %_sourcedir/supported.conf | \
|
||||
sed 's,.*/,,; s,\.ko$,,' | sort -u
|
||||
}
|
||||
|
||||
# Generate the list of modules to be marked as supported
|
||||
{ supported_conf base
|
||||
for how in external; do
|
||||
comm -2 -3 <(supported_conf base $how) <(supported_conf base) \
|
||||
| sed -e 's:$: '"$how"':'
|
||||
done
|
||||
} | sed -e 's,.*/,,' -e 's,\.ko$,,' > %kernel_build_dir/Module.supported
|
||||
|
||||
# Create grep pattern file for the modules to end up in the base package
|
||||
comm -2 -3 <(supported_conf base) <(supported_conf) \
|
||||
| sed -e 's:.*/::' -e 's:^:\\/:' -e 's:$:\.ko$:' \
|
||||
> %my_builddir/grep-for-base-modules
|
||||
supported_conf --default=0 external | sed 's/$/ external/'
|
||||
} > %kernel_build_dir/Module.supported
|
||||
supported_conf --default=0 base >%kernel_build_dir/Module.base
|
||||
|
||||
cd linux-%srcversion
|
||||
|
||||
@@ -371,7 +369,7 @@ add_vmlinux()
|
||||
--strip-debug \
|
||||
%buildroot/$vmlinux || :
|
||||
mkdir -p %buildroot/usr/src/debug
|
||||
LANG=C sort -z -u vmlinux.sourcefiles | grep -z -v "<built-in>" \
|
||||
LANG=C sort -z -u vmlinux.sourcefiles | grep -Ezv "<(built-in|stdin)>" \
|
||||
| ( cd %_builddir && cpio -pd0m %buildroot/usr/src/debug )
|
||||
find %buildroot/usr/src/debug -type d -print0 | xargs -0 -r chmod 0755
|
||||
find %buildroot/usr/src/debug -type f -print0 | xargs -0 -r chmod 0644
|
||||
@@ -548,58 +546,14 @@ if [ %CONFIG_MODULES = y ]; then
|
||||
fi
|
||||
|
||||
%if %split_packages
|
||||
# Generate the lists of supported and unsupported modules.
|
||||
( cd %buildroot
|
||||
: > %my_builddir/supported-modules
|
||||
: > %my_builddir/unsupported-modules
|
||||
for module in $(find lib/modules/%kernelrelease-%build_flavor -type f -name '*.ko'); do
|
||||
case "$(/sbin/modinfo -F supported $module)" in
|
||||
(yes|external)
|
||||
modname=$(basename $module .ko)
|
||||
deps=$(/sbin/modinfo -F depends $module|tr ',' ' ')
|
||||
echo "$modname: $deps" >> %my_builddir/Makefile.supported
|
||||
echo "/$module" >> %my_builddir/supported-modules
|
||||
;;
|
||||
(*)
|
||||
echo "/$module" >> %my_builddir/unsupported-modules
|
||||
;;
|
||||
esac
|
||||
done
|
||||
)
|
||||
%_sourcedir/split-modules -d %buildroot \
|
||||
%if ! %supported_modules_check
|
||||
-i \
|
||||
%endif
|
||||
-o %my_builddir \
|
||||
-b %kernel_build_dir/Module.base \
|
||||
-s %kernel_build_dir/Module.supported
|
||||
|
||||
add_dependent_modules() {
|
||||
local modules_dep=$1
|
||||
|
||||
xargs -r make -rRs -f <(echo -e '%:\n\t@echo $@' ; cat $modules_dep)
|
||||
}
|
||||
|
||||
modules_dep=%buildroot/lib/modules/%kernelrelease-%build_flavor/modules.dep
|
||||
|
||||
# Make sure that no supported modules depend on any unsupported modules.
|
||||
dependent_unsupported_modules=$(
|
||||
OUT=$(mktemp)
|
||||
sed -e 's/:.*//g' < %my_builddir/Makefile.supported | \
|
||||
xargs -r make -rRsk -f %my_builddir/Makefile.supported > $OUT
|
||||
sed -ne '/No rule/s/^.*No rule to make target//p' < $OUT | tr -d "\`'"
|
||||
)
|
||||
if [ -n "$dependent_unsupported_modules" ]; then
|
||||
echo "The following unsupported modules are used by supported modules:"
|
||||
echo "$dependent_unsupported_modules"
|
||||
echo "Please fix supported.conf."
|
||||
if [ ! -e %_sourcedir/IGNORE-UNSUPPORTED-DEPS ]; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Compute the list of base modules: modules that core modules depend on
|
||||
# implicitly are also core modules.
|
||||
grep -f %my_builddir/grep-for-base-modules %my_builddir/supported-modules \
|
||||
| add_dependent_modules $modules_dep > %my_builddir/base-modules
|
||||
|
||||
# All supported modules which are not core modules belong in %name.
|
||||
comm -3 <(sort %my_builddir/supported-modules) \
|
||||
<(sort %my_builddir/base-modules) \
|
||||
> %my_builddir/main-modules
|
||||
%else
|
||||
( cd %buildroot
|
||||
find lib/modules/%kernelrelease-%build_flavor -type f -name '*.ko' -printf '/%%p\n'
|
||||
@@ -607,8 +561,7 @@ if [ %CONFIG_MODULES = y ]; then
|
||||
%endif
|
||||
|
||||
# check for kabi changes
|
||||
KABI=0
|
||||
if [ -n "$reference" ]; then
|
||||
if [ -z "fixme-broken" ]; then
|
||||
%_sourcedir/symsets.pl --check-kabi \
|
||||
$reference \
|
||||
--symvers=Module.symvers.split \
|
||||
@@ -618,9 +571,9 @@ if [ %CONFIG_MODULES = y ]; then
|
||||
--commonsyms=%my_builddir/kabi/commonsyms \
|
||||
--usedsyms=%my_builddir/kabi/usedsyms \
|
||||
--severities=%my_builddir/kabi/severities \
|
||||
--max-badness=%tolerate_kabi_changes || KABI=$?
|
||||
--max-badness=%tolerate_kabi_changes
|
||||
fi
|
||||
if [ $KABI -ne 0 ]; then
|
||||
if [ $? -ne 0 ]; then
|
||||
if [ ! -e %my_builddir/kabi/%cpu_arch/ignore-%build_flavor -a \
|
||||
! -e %_sourcedir/IGNORE-KABI-BADNESS ]; then
|
||||
echo "Create a file IGNORE-KABI-BADNESS in the kernel-source" \
|
||||
@@ -628,9 +581,6 @@ if [ %CONFIG_MODULES = y ]; then
|
||||
"higher than allowed for an official kernel."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Indicate the ABI badness in build result emails.
|
||||
echo "KABI BADNESS $KABI" > %_rpmdir/%_arch/mbuild_subject.tag
|
||||
fi
|
||||
|
||||
# Set up some module aliases
|
||||
@@ -651,28 +601,28 @@ if [ %CONFIG_MODULES = y ]; then
|
||||
# Replace the absolute with a relative path
|
||||
sed -i "s,%build_src_dir,../../../linux-%kernelrelease%variant,g" \
|
||||
%rpm_install_dir/%cpu_arch_flavor/Makefile
|
||||
link=%rpm_install_dir/%cpu_arch_flavor/include2/asm
|
||||
target=$(readlink "$link")
|
||||
target=${target#%build_src_dir}
|
||||
rm "$link"
|
||||
ln -s ../../../../linux-%kernelrelease%variant/"$target" "$link"
|
||||
fi
|
||||
|
||||
add_dirs_to_filelist() {
|
||||
local filelist
|
||||
|
||||
filelist=$(cat "$@")
|
||||
echo "$filelist"
|
||||
|
||||
# Below, we do this:
|
||||
# - remove filelist macros
|
||||
# - remove last pathname component
|
||||
# - generate all parents and make the list unique
|
||||
# - skip directories owned be other packages
|
||||
# - add the %dir prefix (double-escaped for find and rpm)
|
||||
|
||||
echo "$filelist" \
|
||||
| sed -re 's:%%%%[a-z]+(\([^)]+\))? ?::g' \
|
||||
| sed -re 's:/[^/]+$::' \
|
||||
| sed -nre ':a; p; s:/[^/]+$::; ta' \
|
||||
| sort -u \
|
||||
| sed -r -e '\:^(|/boot|/etc|/lib(/modules|/firmware)?|/usr(/src)?)$:d' \
|
||||
| sed -e 's:^:%%%%dir :'
|
||||
sed -rn '
|
||||
# print file name
|
||||
p
|
||||
# remove filelist macros
|
||||
s:%%%%[a-z]+(\([^)]+\))? ?::g
|
||||
# add %%%%dir prefix
|
||||
s:^:%%%%dir :
|
||||
# print all parents
|
||||
:a
|
||||
# skip directories owned by other packages
|
||||
s:^%%%%dir (/boot|/etc|/lib/(modules|firmware)|/usr/src)/[^/]+$::
|
||||
s:/[^/]+$::p
|
||||
ta
|
||||
' "$@" | sort -u
|
||||
}
|
||||
|
||||
# Collect the file lists.
|
||||
|
||||
Reference in New Issue
Block a user