1
0
forked from pool/kernel-source

Accepting request 30627 from Kernel:HEAD

Copy from Kernel:HEAD/kernel-source based on submit request 30627 from user jeff_mahoney

OBS-URL: https://build.opensuse.org/request/show/30627
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kernel-source?expand=0&rev=83
This commit is contained in:
OBS User autobuild
2010-01-29 13:27:16 +00:00
committed by Git OBS Bridge
parent 3dcdbea9a1
commit 038f7eb26e
48 changed files with 29993 additions and 1805 deletions

View File

@@ -92,8 +92,10 @@ Requires(post): mkinitrd
BuildRequires: python
%endif
%ifarch s390 s390x
%if %build_vanilla
BuildRequires: dwarfextract
%endif
%endif
%if %build_xen
%ifarch %ix86
%if %build_flavor != "ec2"
@@ -204,7 +206,7 @@ Obsoletes: ocfs2-kmp-%build_flavor
Obsoletes: quickcam-kmp-%build_flavor < 0.6.7
# Provide the exported symbols as "ksym(symbol) = hash"
%define __find_provides %_sourcedir/find-provides %name
%define __find_provides %_sourcedir/find-provides %my_builddir %name
# Will modules not listed in supported.conf abort the kernel build (0/1)?
%define supported_modules_check 0
@@ -358,39 +360,44 @@ mkdir -p %buildroot/boot
# (Could strip out non-public symbols.)
cp -p System.map %buildroot/boot/System.map-%kernelrelease-%build_flavor
%define extract_vmlinux_debuginfo 0
%if 0%{?__debug_package:1}
%ifnarch ppc ppc64
%define extract_vmlinux_debuginfo 1
%endif
%endif
add_vmlinux()
{
local vmlinux=boot/vmlinux-%kernelrelease-%build_flavor
%if %extract_vmlinux_debuginfo
local vmlinux_debug=usr/lib/debug/$vmlinux.debug
mkdir -p $(dirname %buildroot/$vmlinux_debug)
cp vmlinux %buildroot/$vmlinux
/usr/lib/rpm/debugedit -b $RPM_BUILD_DIR -d /usr/src/debug \
-l vmlinux.sourcefiles %buildroot/$vmlinux
# FIXME: create and package build-id symlinks
objcopy --only-keep-debug \
%buildroot/$vmlinux \
%buildroot/$vmlinux_debug || :
objcopy --add-gnu-debuglink=%buildroot/$vmlinux_debug \
--strip-debug \
%buildroot/$vmlinux || :
mkdir -p %buildroot/usr/src/debug
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
echo -e "%%defattr(-, root, root)\\n/$vmlinux_debug" >%my_builddir/vmlinux.debug.files
%else
local vmlinux=boot/vmlinux-%kernelrelease-%build_flavor compressed=false
if test $1 == "--compressed"; then
compressed=true
fi
cp vmlinux %buildroot/$vmlinux
>%my_builddir/vmlinux.debug.files
%if 0%{?__debug_package:1}
if $compressed; then
local vmlinux_debug=usr/lib/debug/$vmlinux.debug
mkdir -p $(dirname %buildroot/$vmlinux_debug)
/usr/lib/rpm/debugedit -b $RPM_BUILD_DIR -d /usr/src/debug \
-l vmlinux.sourcefiles %buildroot/$vmlinux
# FIXME: create and package build-id symlinks
objcopy --only-keep-debug \
%buildroot/$vmlinux \
%buildroot/$vmlinux_debug || :
objcopy --add-gnu-debuglink=%buildroot/$vmlinux_debug \
--strip-debug \
%buildroot/$vmlinux || :
mkdir -p %buildroot/usr/src/debug
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
echo -e "%%defattr(-, root, root)\\n/$vmlinux_debug" >%my_builddir/vmlinux.debug.files
else
# make vmlinux executable so that find-debuginfo.sh picks it up
# (TODO: fix find-debuginfo.sh instead)
chmod +x %buildroot/$vmlinux
# exctact the provided symbols before they are stripped away
echo %buildroot/$vmlinux | /usr/lib/rpm/find-provides.ksyms %name > \
%my_builddir/$(basename $vmlinux).provides
fi
%endif
if [ "$1" = --compressed ]; then
if $compressed; then
gzip -9 %buildroot/$vmlinux
chmod a-x %buildroot/$vmlinux.gz
fi
@@ -398,7 +405,6 @@ add_vmlinux()
%if %build_kdump
add_vmlinux
chmod 644 %buildroot/boot/vmlinux-%kernelrelease-%build_flavor
image=vmlinux
%else
@@ -420,7 +426,6 @@ add_vmlinux()
%endif
%ifarch ppc ppc64
add_vmlinux
chmod 644 %buildroot/boot/vmlinux-%kernelrelease-%build_flavor
image=vmlinux
%endif
%ifarch ia64
@@ -433,7 +438,9 @@ add_vmlinux()
add_vmlinux --compressed
cp -p arch/s390/boot/image %buildroot/boot/image-%kernelrelease-%build_flavor
image=image
if [ -x "$(which dwarfextract 2>/dev/null)" ] ; then
if test -e arch/s390/boot/kerntypes.o; then
cp -p arch/s390/boot/kerntypes.o %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor
elif test -x "$(which dwarfextract 2>/dev/null)"; then
dwarfextract vmlinux %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor || echo "dwarfextract failed ($?)"
fi
%if %CONFIG_KMSG_IDS == "y"
@@ -441,9 +448,6 @@ add_vmlinux()
find man -name '*.9' -exec install -m 644 -D '{}' %buildroot/usr/share/man/man9/ ';'
%endif
%endif
if [ -e init/kerntypes.o ]; then
cp init/kerntypes.o %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor
fi
# end of build_kdump
%endif
@@ -506,8 +510,10 @@ if [ %CONFIG_MODULES = y ]; then
fi
%ifarch s390 s390x
if [ -x "$(which dwarfextract 2>/dev/null)" -a \
-f %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor ] ; then
if test -e arch/s390/boot/kerntypes.o; then
:
elif test -x "$(which dwarfextract 2>/dev/null)" -a \
-f %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor; then
find %buildroot -name "*.ko" > kofiles.list
dwarfextract %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor -C kofiles.list || echo "dwarfextract failed ($?)"
fi
@@ -596,11 +602,6 @@ 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() {
@@ -608,13 +609,13 @@ add_dirs_to_filelist() {
# print file name
p
# remove filelist macros
s:%%%%[a-z]+(\([^)]+\))? ?::g
# add %%%%dir prefix
s:^:%%%%dir :
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:^%%dir (/boot|/etc|/lib/(modules|firmware)|/usr/src)/[^/]+$::
s:/[^/]+$::p
ta
' "$@" | sort -u
@@ -631,19 +632,21 @@ done
{ cd %buildroot
find boot \
\( -type l -o -name 'initrd-*' \) -printf '%%%%%%%%ghost /%%p\n' -o \
\( -type l -o -name 'initrd-*' \) -printf '%%%%ghost /%%p\n' -o \
-type f -name 'vmlinux-*.provides' -prune -o \
-type f -name 'vmlinux-*' -printf '%%%%attr(0644, root, root) /%%p\n' -o \
-type f -printf '/%%p\n'
# Add the auto-generated (by mkdumprd) kdump initrd to %ghost so that
# the file gets removed when uninstalling the kernel.
echo '%%%%ghost /boot/initrd-%kernelrelease-kdump'
echo '%%ghost /boot/initrd-%kernelrelease-kdump'
touch $RPM_BUILD_ROOT/boot/initrd-%kernelrelease-kdump
if [ %CONFIG_MODULES = y ]; then
find lib/modules/%kernelrelease-%build_flavor \
-type d -o \
\( -path '*/modules.*' ! -path '*/modules.order' \
! -path '*/modules.builtin' \) -printf '%%%%%%%%ghost /%%p\n' \
! -path '*/modules.builtin' \) -printf '%%%%ghost /%%p\n' \
-o -name '*.ko' -prune -o -printf '/%%p\n'
cat %my_builddir/base-modules
fi
@@ -652,7 +655,7 @@ done
-type d -o \
-printf '/%%p\n'
if [ -e .%_docdir/%name ]; then
echo "%%%%doc %_docdir/%name"
echo "%%doc %_docdir/%name"
fi
} | sort -u >%my_builddir/tmp
cat %my_builddir/tmp %my_builddir/kernel-devel.files | sort | uniq -u | \
@@ -813,8 +816,6 @@ Debug information for package %name-devel
%source_timestamp
%if %extract_vmlinux_debuginfo
%files devel-debuginfo -f vmlinux.debug.files
%endif
%changelog