1
0
forked from pool/kernel-source
OBS User unknown
2009-07-09 02:41:55 +00:00
committed by Git OBS Bridge
parent 41724cba2e
commit 01c540322a
35 changed files with 3413 additions and 344544 deletions

View File

@@ -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,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})
%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 $*)
@@ -208,7 +208,7 @@ Obsoletes: ralink-rt2860-kmp
%define _buildshell /bin/bash
# Provide the exported symbols as "ksym(symbol) = hash"
%define __find_provides %my_builddir/find-provides %name
%define __find_provides %_sourcedir/find-provides %name
# Will modules not listed in supported.conf abort the kernel build (0/1)?
%define supported_modules_check 0
@@ -255,22 +255,15 @@ comm -2 -3 <(supported_conf base) <(supported_conf) \
cd linux-%srcversion
# Apply the patches needed for this architecture.
%if ! %build_vanilla
for patch in $(%_sourcedir/guards %symbols < %_sourcedir/series.conf); do
if ! patch -s -F0 -E -p1 --no-backup-if-mismatch -i ../$patch; then
echo "*** Patch $patch failed ***"
exit 1
fi
done
%else
for patch in $(%_sourcedir/guards %symbols < %_sourcedir/series.conf | egrep 'kernel\.org|rpmify'); do
if ! patch -s -F0 -E -p1 --no-backup-if-mismatch -i ../$patch; then
echo "*** Patch $patch failed ***"
exit 1
fi
done
# Apply patches
echo "trap 'echo \"*** patch \$_ failed ***\"' ERR" >../apply-patches.sh
%_sourcedir/guards %symbols <%_sourcedir/series.conf | \
%if %build_vanilla
egrep '^patches\.(kernel\.org|rpmify)/' | \
%endif
sed 's:^:patch -s -F0 -E -p1 --no-backup-if-mismatch -i ../:' \
>>../apply-patches.sh
bash -ex ../apply-patches.sh
cd %kernel_build_dir
@@ -286,11 +279,6 @@ cat ../config/%cpu_arch_flavor \
%endif
> .config
sed 's:^sourcedir=.*:sourcedir="%_sourcedir":;
s:^builddir=.*:builddir="%my_builddir":' \
%_sourcedir/find-provides >%my_builddir/find-provides
chmod +x %my_builddir/find-provides
MAKE_ARGS="$MAKE_ARGS -C %build_src_dir O=$PWD"
if test -e %_sourcedir/TOLERATE-UNKNOWN-NEW-CONFIG-OPTIONS; then
yes '' | make oldconfig $MAKE_ARGS
@@ -301,11 +289,6 @@ else
rm .config.orig
fi
# create *.symref files in the tree
if [ -e ../kabi/%cpu_arch/symtypes-%build_flavor ]; then
%_sourcedir/modversions --unpack . <../kabi/%cpu_arch/symtypes-%build_flavor
fi
make prepare $MAKE_ARGS
make scripts $MAKE_ARGS
krel=$(make -s kernelrelease $MAKE_ARGS)
@@ -341,6 +324,12 @@ EOF
%build
cd %kernel_build_dir
source .kernel-binary.spec.buildenv
# create *.symref files in the tree
if test -e %my_builddir/kabi/%cpu_arch/symtypes-%build_flavor; then
%_sourcedir/modversions --unpack . < $_
fi
%if %CONFIG_KMSG_IDS == "y"
chmod +x scripts/kmsg-doc
make %{?jobs:-j%jobs} all $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y D=2
@@ -498,11 +487,7 @@ if [ %CONFIG_MODULES = y ]; then
ln -s %build_flavor %buildroot/usr/src/linux-obj/%cpu_arch_flavor
# Figure out where the symbols that vmlinux exports are defined.
# (We need this information below as well as in find-provides; we "annotate"
# the original Module.symvers here to make sure that we are consistent in
# both places.)
%_sourcedir/built-in-where < Module.symvers > Module.symvers.split
mv Module.symvers.split Module.symvers
gzip -c9 < Module.symvers > %buildroot/boot/symvers-%kernelrelease-%build_flavor.gz
@@ -626,7 +611,7 @@ if [ %CONFIG_MODULES = y ]; then
if [ -n "$reference" ]; then
%_sourcedir/symsets.pl --check-kabi \
$reference \
--symvers=Module.symvers \
--symvers=Module.symvers.split \
--modules=%my_builddir/base-modules-br \
--modules=%my_builddir/main-modules-br \
--modules=%my_builddir/unsupported-modules-br \
@@ -693,7 +678,7 @@ add_dirs_to_filelist() {
# Collect the file lists.
shopt -s nullglob
> %my_builddir/kernel-devel.files
for file in %buildroot/boot/sym* ; do
for file in %buildroot/boot/vmlinux-*.gz %buildroot/boot/symtypes* ; do
f=${file##%buildroot}
echo "$f" >> %my_builddir/kernel-devel.files
done
@@ -712,10 +697,9 @@ done
if [ %CONFIG_MODULES = y ]; then
find lib/modules/%kernelrelease-%build_flavor \
-type d -o \
\( -path '*/modules.*' ! -path '*/modules.order' \) \
-printf '%%%%%%%%ghost /%%p\n' -o \
-name '*.ko' -prune -o \
-printf '/%%p\n'
\( -path '*/modules.*' ! -path '*/modules.order' \
! -path '*/modules.builtin' \) -printf '%%%%%%%%ghost /%%p\n' \
-o -name '*.ko' -prune -o -printf '/%%p\n'
cat %my_builddir/base-modules
echo '%%%%config /etc/modprobe.d/50-module-renames.conf'
fi
@@ -757,6 +741,7 @@ Group: System/Kernel
Url: http://www.kernel.org/
AutoReqProv: on
Provides: %name-base_%_target_cpu = %version-%release
Provides: kernel-base = %version-%source_rel
Requires(pre): coreutils awk
Requires(post): module-init-tools
Requires(post): perl-Bootloader
@@ -789,6 +774,7 @@ Group: System/Kernel
Url: http://www.kernel.org/
AutoReqProv: on
Provides: %name-extra_%_target_cpu = %version-%release
Provides: kernel-extra = %version-%source_rel
Requires: %{name}_%_target_cpu = %version-%release
Requires(pre): coreutils awk
Requires(post): module-init-tools