X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=kernel%2Fkernel.nm;h=5a1099bdb943929b14ee1caa3244a71781b2b5aa;hb=34b59fe263523d7c8a5a5300c8bef36f68de927d;hp=0413759bdc62da7f166647a16a203ac5048a3c51;hpb=e164322be304b35bef89b5cf4f9211b52d1fed51;p=people%2Fms%2Fipfire-3.x.git diff --git a/kernel/kernel.nm b/kernel/kernel.nm index 0413759bd..5a1099bdb 100644 --- a/kernel/kernel.nm +++ b/kernel/kernel.nm @@ -4,20 +4,20 @@ ############################################################################### name = kernel -version = 3.1.5 -release = 3 +version = 3.8.6 +release = 2 thisapp = linux-%{version} -maintainer = Michael Tremer +maintainer = Arne Fitzenreiter groups = System/Kernels url = http://www.kernel.org/ license = GPLv2 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 @@ -34,68 +34,89 @@ build # are not available on the remote compilers, we need to disable it here. export ICECC=no + kernel_logo = /usr/share/pixmaps/kernel-logo.ppm + requires + asciidoc + audit-devel + binutils >= 2.23.51.0.3-3 binutils-devel + bison elfutils-devel + flex gcc-plugin-devel gettext - module-init-tools + libunwind-devel ncurses-devel net-tools + newt-devel + pciutils-devel perl python-devel - xz-lzma-compat + slang-devel + xmlto + + /sbin/depmod + %{kernel_logo} 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 + kernel_image = arch/%{kernel_arch}/boot/%{kernel_target} + if "%{DISTRO_ARCH}" == "i686" # Build a default and legacy kernel for the # i686 architecture. build_kernel_default = 1 build_kernel_legacy = 1 - kernel_arch = x86 - kernel_image = arch/%{kernel_arch}/boot/bzImage - + kernel_arch = x86 end if "%{DISTRO_ARCH}" == "x86_64" build_kernel_default = 1 - kernel_arch = x86 - kernel_image = arch/%{kernel_arch}/boot/bzImage + kernel_arch = x86 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. - kernel_arch = arm - kernel_image = arch/%{kernel_arch}/boot/zImage + # Build a kernel for Marvell Kirkwood-based devices. + build_kernel_kirkwood = 1 - # ARM does not support cpupower. - build_cpupower = 0 + kernel_arch = arm + kernel_target = zImage + + # 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 Samsung's Exynos SoCs. + build_kernel_exynos = 1 + + # Build a kernel for TI OMAP SoCs. + build_kernel_omap = 1 - kernel_arch = arm + kernel_arch = arm + kernel_target = uImage + end - # ARM does not support cpupower. - build_cpupower = 0 + # mkimage is a requirement to build uImage images. + if "%{kernel_target}" == "uImage" + requires += u-boot-tools end # Build default kernel. @@ -103,27 +124,41 @@ build kernels += default end + # Build exynos kernel. + if "%{build_kernel_exynos}" == "1" + kernels += exynos + end + # Build legacy kernel. if "%{build_kernel_legacy}" == "1" 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 \ + cp -vf %{kernel_logo} \ drivers/video/logo/logo_linux_clut224.ppm # Get rid of unwanted files resulting from patch fuzz. @@ -136,6 +171,8 @@ build touch .scmversion mkdir -pv configs + + cd %{DIR_SOURCE} configure_kernel() { local flavour=${1} local suffix @@ -143,13 +180,8 @@ build 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 @@ -180,13 +212,30 @@ build # 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} + + # Compile Flattened Device Tree database + case "${DISTRO_ARCH}" in + arm*) + make ARCH=%{kernel_arch} dtbs + + mkdir -pv %{BUILDROOT}/boot/dtb-${fullversion} + for file in arch/arm/boot/dts/*.dtb; do + [ -e "${file}" ] || continue + + install -m 644 ${file} %{BUILDROOT}/boot/dtb-${fullversion} || exit 1 + rm -f ${file} + done + ;; + esac # 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} @@ -195,7 +244,7 @@ build 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= V=1 \ KERNELRELEASE=${fullversion} modules_install # Install vdso. @@ -207,52 +256,56 @@ build 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 + + # Fix permissions. + find %{BUILDROOT}/usr/src/kernels -name "modules.order" \ + -exec chmod 644 {} \; find %{BUILDROOT}/usr/src/kernels -name ".*.cmd" -exec rm -f {} \; } @@ -263,17 +316,25 @@ build # 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 @@ -290,21 +351,31 @@ build 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 @@ -316,9 +387,7 @@ packages summary = The Linux kernel %{kernel_release}. prerequires - dracut - grubby - module-init-tools + /sbin/depmod end provides @@ -326,21 +395,23 @@ packages end requires - %{prerequires} + dracut + grubby linux-firmware end files /boot/System.map-%{kernel_release} + /boot/dtb-%{kernel_release} /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 @@ -352,7 +423,7 @@ packages 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 @@ -380,8 +451,8 @@ packages 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 @@ -402,6 +473,22 @@ packages end end + if "%{build_kernel_exynos}" == "1" + package kernel-exynos + template KERNEL + + kernel_name = kernel-exynos + kernel_release = %{fullver}.exynos + end + + package kernel-exynos-devel + template KERNELDEVEL + + kernel_name = kernel-exynos + kernel_release = %{fullver}.exynos + end + end + if "%{build_kernel_legacy}" == "1" package kernel-legacy template KERNEL @@ -418,19 +505,35 @@ packages end end - if "%{build_kernel_versatile}" == "1" - package kernel-versatile + if "%{build_kernel_kirkwood}" == "1" + package kernel-kirkwood template KERNEL - kernel_name = kernel-versatile - kernel_release = %{fullver}.versatile + kernel_name = kernel-kirkwood + kernel_release = %{fullver}.kirkwood end - package kernel-versatile-devel - kernel KERNELDEVEL + 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-omap + kernel_release = %{fullver}.omap + end + + package kernel-omap-devel + template KERNELDEVEL - kernel_name = kernel-versatile - kernel_release = %{fullver}.versatile + kernel_name = kernel-omap + kernel_release = %{fullver}.omap end end @@ -454,8 +557,8 @@ packages files / !/boot - !/lib/modules !/usr/include + !/usr/lib/modules !/usr/src !/usr/src/debug !/usr/lib/debug