###############################################################################
name = kernel
-version = 3.1.5
-release = 3
+version = 3.6.6
+release = 1
thisapp = linux-%{version}
maintainer = Michael Tremer <michael.tremer@ipfire.org>
summary = The Linux kernel.
description
- The kernel package contains the Linux kernel (vmlinuz), the core of any \
- Linux operating system. The kernel handles the basic functions \
- of the operating system: memory allocation, process allocation, device \
+ The kernel package contains the Linux kernel (vmlinuz), the core of any
+ Linux operating system. The kernel handles the basic functions
+ of the operating system: memory allocation, process allocation, device
input and output, etc.
end
export ICECC=no
requires
+ asciidoc
+ binutils >= 2.23.51.0.3-3
binutils-devel
+ bison
elfutils-devel
+ flex
gcc-plugin-devel
gettext
- module-init-tools
ncurses-devel
net-tools
+ newt-devel
+ pciutils-devel
perl
python-devel
- xz-lzma-compat
+ slang-devel
+ xmlto
+
+ /sbin/depmod
end
- tools_cpupower_requires
- newt-devel
- pciutils-devel
- slang-devel
+ # i686 needs librmi for cpupower.
+ if "%{DISTRO_ARCH}" == "i686"
+ requires += liblrmi-devel
end
# A list of kernels to build.
kernels =
- # Should we build cpupower?
- build_cpupower = 1
+ # Arguments that are passed to the kernel build command.
+ kernel_build_flags =
kernel_target = bzImage
if "%{DISTRO_ARCH}" == "i686"
end
if "%{DISTRO_ARCH}" == "armv5tel"
- # Build versatile kernel.
- build_kernel_versatile = 1
+ # ERROR Currently all kernel images are disabled, because they
+ # won't build with the grsecurity patch.
+
+ # Build a kernel for Marvell Kirkwood-based devices.
+ build_kernel_kirkwood = 1
kernel_arch = arm
kernel_image = arch/%{kernel_arch}/boot/zImage
- # ARM does not support cpupower.
- build_cpupower = 0
+ # http://lists.infradead.org/pipermail/linux-arm-kernel/2012-March/091404.html
+ kernel_build_flags = KALLSYMS_EXTRA_PASS=1
end
if "%{DISTRO_ARCH}" == "armv7hl"
- # Currently build no kernel images.
+ # Build a kernel for TI OMAP SoCs.
+ build_kernel_omap = 1
kernel_arch = arm
-
- # ARM does not support cpupower.
- build_cpupower = 0
+ kernel_image = arch/%{kernel_arch}/boot/zImage
end
# Build default kernel.
kernels += legacy
end
- # Build ARM versatile kernel.
- if "%{build_kernel_versatile}" == "1"
- kernels += versatile
+ # Build ARM kirkwood kernel.
+ if "%{build_kernel_kirkwood}" == "1"
+ kernels += kirkwood
end
- # Add tools' build requirements if build is requested.
- if "%{build_cpupower}" == "1"
- requires += %{tools_cpupower_requires}
+ # Build ARM omap kernel.
+ if "%{build_kernel_omap}" == "1"
+ kernels += omap
end
prepare_cmds
rm -f %{DIR_APP}/localversion-grsec
+ # Remove -Werror flag to fix ARMv5 build.
+ sed -e "s/-Werror//g" -i grsecurity/Makefile
+
+ # Disable the colorize plugin.
+ # It's generally very nice but it clutters our
+ # logfiles.
+ sed -e "/^COLORIZE_PLUGIN_CFLAGS/d" \
+ -i Makefile
+
sed -e "s/^HOSTCFLAGS.*=.*/& -fPIC/g" -i Makefile
cp -vf %{DIR_SOURCE}/%{DISTRO_SNAME}_logo.ppm \
touch .scmversion
mkdir -pv configs
+
+ cd %{DIR_SOURCE}
configure_kernel() {
local flavour=${1}
local suffix
suffix="-${flavour}"
fi
- # This is the place, where the configuration files
- # should be dynamically generated.
- # For now, we just copy pregenerated ones.
- cp %{DIR_SOURCE}/config.%{arch}${suffix} .config
-
- make ARCH=%{kernel_arch} oldnoconfig
- mv .config configs/config.${flavour}
+ scripts/configure --kernel-dir=%{DIR_APP} \
+ merge %{DISTRO_ARCH} ${flavour} %{DIR_APP}/configs/config.${flavour}
}
# Generate configuration files for all kernels we are going to
# Install configuration file.
cp configs/config.${flavour} .config
+ cat .config
# Run the build.
make ARCH=%{kernel_arch} oldnoconfig >/dev/null
- make ARCH=%{kernel_arch} CC="gcc -fno-PIE" %{kernel_target} modules %{PARALLELISMFLAGS}
+ make ARCH=%{kernel_arch} CC="gcc -fno-PIE" %{kernel_target} modules \
+ %{kernel_build_flags} %{PARALLELISMFLAGS}
# Install the results.
- mkdir -pv %{BUILDROOT}/boot %{BUILDROOT}/lib/modules/${fullversion}
+ mkdir -pv %{BUILDROOT}/boot %{BUILDROOT}/usr/lib/modules/${fullversion}
install -m 755 %{kernel_image} %{BUILDROOT}/boot/vmlinuz-${fullversion}
install -m 644 .config %{BUILDROOT}/boot/config-${fullversion}
install -m 644 System.map %{BUILDROOT}/boot/System.map-${fullversion}
dd if=/dev/zero of=%{BUILDROOT}/boot/initramfs-${fullversion}.img bs=1M count=20
# Install modules.
- make ARCH=%{kernel_arch} INSTALL_MOD_PATH=%{BUILDROOT} mod-fw= \
+ make ARCH=%{kernel_arch} INSTALL_MOD_PATH=%{BUILDROOT}/usr mod-fw= \
KERNELRELEASE=${fullversion} modules_install
# Install vdso.
esac
# Create an empty settings file for dracut
- mkdir -pv %{BUILDROOT}/etc/ld.so.conf.d
+ mkdir -p %{BUILDROOT}/etc/ld.so.conf.d
echo "# Placeholder file, no vDSO hwcap entries used in this kernel." \
> %{BUILDROOT}/etc/ld.so.conf.d/kernel-${fullversion}.conf
# And now the scary looking part.
#
# Recreate source and build links.
- rm -vf %{BUILDROOT}/lib/modules/${fullversion}/{build,source}
- mkdir -pv %{BUILDROOT}/lib/modules/${fullversion}/build
- ln -svf build %{BUILDROOT}/lib/modules/${fullversion}/source
+ rm -f %{BUILDROOT}/usr/lib/modules/${fullversion}/{build,source}
+ mkdir -p %{BUILDROOT}/usr/lib/modules/${fullversion}/build
+ ln -sf build %{BUILDROOT}/usr/lib/modules/${fullversion}/source
# Create dirs for extra modules.
- mkdir -pv %{BUILDROOT}/lib/modules/${fullversion}/extra
+ mkdir -p %{BUILDROOT}/usr/lib/modules/${fullversion}/extra
- cp -v --parents $(find -type f -name "Makefile*" -o -name "Kconfig*") \
- %{BUILDROOT}/lib/modules/${fullversion}/build
- cp -v Module.symvers System.map \
- %{BUILDROOT}/lib/modules/${fullversion}/build
- rm -vrf %{BUILDROOT}/lib/modules/${fullversion}/build/{Documentation,scripts,include}
+ cp --parents $(find -type f -name "Makefile*" -o -name "Kconfig*") \
+ %{BUILDROOT}/usr/lib/modules/${fullversion}/build
+ cp Module.symvers System.map \
+ %{BUILDROOT}/usr/lib/modules/${fullversion}/build
+ rm -rf %{BUILDROOT}/usr/lib/modules/${fullversion}/build/{Documentation,scripts,include}
- cp -v .config %{BUILDROOT}/lib/modules/${fullversion}/build
- cp -va scripts %{BUILDROOT}/lib/modules/${fullversion}/build
- find %{BUILDROOT}/lib/modules/${fullversion}/build/scripts -name "*.o" \
+ cp .config %{BUILDROOT}/usr/lib/modules/${fullversion}/build
+ cp -a scripts %{BUILDROOT}/usr/lib/modules/${fullversion}/build
+ find %{BUILDROOT}/usr/lib/modules/${fullversion}/build/scripts -name "*.o" \
-exec rm -vf {} \;
- cp -va --parents arch/%{kernel_arch}/include \
- %{BUILDROOT}/lib/modules/${fullversion}/build
- cp -va include %{BUILDROOT}/lib/modules/${fullversion}/build/include
+ cp -a --parents arch/%{kernel_arch}/include \
+ %{BUILDROOT}/usr/lib/modules/${fullversion}/build
+ cp -a include %{BUILDROOT}/usr/lib/modules/${fullversion}/build/include
# Make sure we can build external modules.
- touch -r %{BUILDROOT}/lib/modules/${fullversion}/build/Makefile \
- %{BUILDROOT}/lib/modules/${fullversion}/build/include/linux/version.h
- touch -r %{BUILDROOT}/lib/modules/${fullversion}/build/.config \
- %{BUILDROOT}/lib/modules/${fullversion}/build/autoconf.h
- cp -v %{BUILDROOT}/lib/modules/${fullversion}/build/.config \
- %{BUILDROOT}/lib/modules/${fullversion}/build/include/config/auto.conf
-
- find %{BUILDROOT}/lib/modules/${fullversion} -name "*.ko" -type f | \
+ touch -r %{BUILDROOT}/usr/lib/modules/${fullversion}/build/Makefile \
+ %{BUILDROOT}/usr/lib/modules/${fullversion}/build/include/linux/version.h
+ touch -r %{BUILDROOT}/usr/lib/modules/${fullversion}/build/.config \
+ %{BUILDROOT}/usr/lib/modules/${fullversion}/build/autoconf.h
+ cp %{BUILDROOT}/usr/lib/modules/${fullversion}/build/.config \
+ %{BUILDROOT}/usr/lib/modules/${fullversion}/build/include/config/auto.conf
+
+ find %{BUILDROOT}/usr/lib/modules/${fullversion} -name "*.ko" -type f | \
xargs chmod u+x
# Move all development files to /usr/src.
- mkdir -pv %{BUILDROOT}/usr/src/kernels
- mv -v %{BUILDROOT}/lib/modules/${fullversion}/build \
+ mkdir -p %{BUILDROOT}/usr/src/kernels
+ mv %{BUILDROOT}/usr/lib/modules/${fullversion}/build \
%{BUILDROOT}/usr/src/kernels/${fullversion}
- ln -svf ../../../usr/src/kernels/${fullversion} \
- %{BUILDROOT}/lib/modules/${fullversion}/build
+ ln -sf ../../../src/kernels/${fullversion} \
+ %{BUILDROOT}/usr/lib/modules/${fullversion}/build
find %{BUILDROOT}/usr/src/kernels -name ".*.cmd" -exec rm -f {} \;
}
# Build tools.
# cpupower
- if [ "%{build_cpupower}" = "1" ]; then
- chmod +x tools/power/cpupower/utils/version-gen.sh
- make -C tools/power/cpupower CPUFREQ_BENCH=false %{PARALLELISMFLAGS}
-
- cd tools/power/cpupower/debug/i386
- make %{PARALLELISMFLAGS} centrino-decode powernow-k8-decode
- cd -
+ chmod +x tools/power/cpupower/utils/version-gen.sh
+ make -C tools/power/cpupower CPUFREQ_BENCH=false %{PARALLELISMFLAGS}
+
+ if [ "%{DISTRO_ARCH}" = "x86_64" ]; then
+ pushd tools/power/cpupower/debug/x86_64
+ make %{MAKETUNING}
+ popd
+ elif [ "%{DISTRO_ARCH}" = "i686" ]; then
+ pushd tools/power/cpupower/debug/i386
+ make %{MAKETUNING}
+ popd
fi
end
install
+ # When no kernels are configured, we create a default config
+ # which enables us to install at least the header files.
+ [ -n "%{kernels}" ] || make ARCH=%{kernel_arch} defconfig
+
# Install the header files
make ARCH=%{kernel_arch} INSTALL_HDR_PATH=dest headers_install
mkdir -pv %{BUILDROOT}/usr/include
rm -rfv %{BUILDROOT}/lib/firmware
# Install tools.
- # XXX Man pages cannot be created because they need asciidoc.
- make -C tools/perf DESTDIR=%{BUILDROOT} \
+ make -C tools/perf DESTDIR=%{BUILDROOT} WERROR=0 \
HAVE_CPLUS_DEMANGLE=1 prefix=/usr perfexecdir=lib/perf-core \
- install #install-man
+ install install-man install-python_ext
# cpupower
- if [ "%{build_cpupower}" = "1" ]; then
- make -C tools/power/cpupower DESTDIR=%{BUILDROOT} libdir=%{libdir} \
- mandir=%{mandir} CPUFREQ_BENCH=false install
- cd tools/power/cpupower/debug/i386
- install -m 755 centrino-decode %{BUILDROOT}/usr/bin/centrino-decode
- install -m 755 powernow-k8-decode %{BUILDROOT}/usr/bin/powernow-k8-decode
- cd -
- chmod 0755 %{BUILDROOT}%{libdir}/libcpupower.so*
+ make -C tools/power/cpupower DESTDIR=%{BUILDROOT} libdir=%{libdir} \
+ mandir=%{mandir} CPUFREQ_BENCH=false install
+
+ if [ "%{DISTRO_ARCH}" = "x86_64" ]; then
+ pushd tools/power/cpupower/debug/x86_64
+ install -m 755 centrino-decode \
+ %{BUILDROOT}/usr/bin/centrino-decode
+ install -m 755 powernow-k8-decode \
+ %{BUILDROOT}/usr/bin/powernow-k8-decode
+ popd
+ elif [ "%{DISTRO_ARCH}" = "i686" ]; then
+ pushd tools/power/cpupower/debug/i386
+ install -m 755 centrino-decode \
+ %{BUILDROOT}/usr/bin/centrino-decode
+ install -m 755 powernow-k8-decode \
+ %{BUILDROOT}/usr/bin/powernow-k8-decode
+ popd
fi
+
+ chmod 0755 %{BUILDROOT}%{libdir}/libcpupower.so*
end
end
summary = The Linux kernel %{kernel_release}.
prerequires
- dracut
- grubby
- module-init-tools
+ /sbin/depmod
end
provides
end
requires
- %{prerequires}
+ dracut
+ grubby
linux-firmware
end
/boot/vmlinuz-%{kernel_release}
/boot/initramfs-%{kernel_release}.img
/etc/ld.so.conf.d/kernel-%{kernel_release}.conf
- /lib/modules/%{kernel_release}
+ /usr/lib/modules/%{kernel_release}
end
_posttrans
- /sbin/new-kernel-pkg --package %{kernel_name} --mkinitrd --dracut --depmod --update %{kernel_release} || exit $?
- /sbin/new-kernel-pkg --package %{kernel_name} --rpmposttrans %{kernel_release} || exit $?
+ /sbin/new-kernel-pkg --package %{kernel_name} --mkinitrd --dracut --depmod --update %{kernel_release}
+ /sbin/new-kernel-pkg --package %{kernel_name} --rpmposttrans %{kernel_release}
end
script posttransin
end
script postin
- /sbin/new-kernel-pkg --package kernel%{?-v:-%{-v*}} --install %{KVERREL}%{?-v:.%{-v*}}
+ /sbin/new-kernel-pkg --package %{kernel_name} --install %{kernel_release}
end
script postup
end
files
- /lib/modules/%{kernel_release}/build
- /lib/modules/%{kernel_release}/source
+ /usr/lib/modules/%{kernel_release}/build
+ /usr/lib/modules/%{kernel_release}/source
/usr/src/kernels/%{kernel_release}
end
end
end
end
- if "%{build_kernel_versatile}" == "1"
- package kernel-versatile
+ if "%{build_kernel_kirkwood}" == "1"
+ package kernel-kirkwood
+ template KERNEL
+
+ kernel_name = kernel-kirkwood
+ kernel_release = %{fullver}.kirkwood
+ end
+
+ package kernel-kirkwood-devel
+ template KERNELDEVEL
+
+ kernel_name = kernel-kirkwood
+ kernel_release = %{fullver}.kirkwood
+ end
+ end
+
+ if "%{build_kernel_omap}" == "1"
+ package kernel-omap
template KERNEL
- kernel_name = kernel-versatile
- kernel_release = %{fullver}.versatile
+ kernel_name = kernel-omap
+ kernel_release = %{fullver}.omap
end
- package kernel-versatile-devel
- kernel KERNELDEVEL
+ package kernel-omap-devel
+ template KERNELDEVEL
- kernel_name = kernel-versatile
- kernel_release = %{fullver}.versatile
+ kernel_name = kernel-omap
+ kernel_release = %{fullver}.omap
end
end
files
/
!/boot
- !/lib/modules
!/usr/include
+ !/usr/lib/modules
!/usr/src
!/usr/src/debug
!/usr/lib/debug