]> git.ipfire.org Git - ipfire-3.x.git/blobdiff - kernel/kernel.nm
kernel: Update to 3.5.1.
[ipfire-3.x.git] / kernel / kernel.nm
index 1d4b09afcbb0315e18abbf3c4b7fb71656c3207b..61c541ce3894a7b4b6c558ab77578af34c3ff3b7 100644 (file)
@@ -4,8 +4,8 @@
 ###############################################################################
 
 name       = kernel
-version    = 3.1.5
-release    = 1
+version    = 3.5.1
+release    = 0.2
 thisapp    = linux-%{version}
 
 maintainer = Michael Tremer <michael.tremer@ipfire.org>
@@ -15,9 +15,9 @@ 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
 
@@ -35,16 +35,21 @@ build
        export ICECC=no
 
        requires
+               asciidoc
+               binutils >= 2.22.52.0.3-2
                binutils-devel
+               bison
                elfutils-devel
+               flex
                gcc-plugin-devel
                gettext
-               module-init-tools
                ncurses-devel
                net-tools
                perl
                python-devel
-               xz-lzma-compat
+               xmlto
+
+               /sbin/depmod
        end
 
        tools_cpupower_requires
@@ -59,12 +64,15 @@ build
        # 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"
-               # Build a default and PAE-enabled kernel for the
+               # Build a default and legacy kernel for the
                # i686 architecture.
                build_kernel_default = 1
-               build_kernel_pae = 1
+               build_kernel_legacy = 1
 
                kernel_arch  = x86
                kernel_image = arch/%{kernel_arch}/boot/bzImage
@@ -79,20 +87,31 @@ build
        end
 
        if "%{DISTRO_ARCH}" == "armv5tel"
+               # ERROR Currently all kernel images are disabled, because they
+               # won't build with the grsecurity patch.
+
                # Build versatile kernel.
                build_kernel_versatile = 1
 
+               # 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
+               kernel_image = arch/%{kernel_arch}/boot/zImage
 
                # ARM does not support cpupower.
                build_cpupower = 0
@@ -103,9 +122,9 @@ build
                kernels += default
        end
 
-       # Build PAE-enabled kernel.
-       if "%{build_kernel_pae}" == "1"
-               kernels += PAE
+       # Build legacy kernel.
+       if "%{build_kernel_legacy}" == "1"
+               kernels += legacy
        end
 
        # Build ARM versatile kernel.
@@ -113,6 +132,16 @@ build
                kernels += versatile
        end
 
+       # Build ARM kirkwood kernel.
+       if "%{build_kernel_kirkwood}" == "1"
+               kernels += kirkwood
+       end
+
+       # Build ARM omap kernel.
+       if "%{build_kernel_omap}" == "1"
+               kernels += omap
+       end
+
        # Add tools' build requirements if build is requested.
        if "%{build_cpupower}" == "1"
                requires += %{tools_cpupower_requires}
@@ -121,6 +150,15 @@ build
        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 \
@@ -136,6 +174,8 @@ build
                touch .scmversion
 
                mkdir -pv configs
+
+               cd %{DIR_SOURCE}
                configure_kernel() {
                        local flavour=${1}
                        local suffix
@@ -143,13 +183,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,10 +215,12 @@ 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}
 
                        # Install the results.
                        mkdir -pv %{BUILDROOT}/boot %{BUILDROOT}/lib/modules/${fullversion}
@@ -274,6 +311,10 @@ build
        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,20 +331,19 @@ 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
 
                # cpupower
                if [ "%{build_cpupower}" = "1" ]; then
-                       make -C tools/power/cpupower DESTDIR=%{BUILDROOT} libdir=/usr/lib \
-                               mandir=/usr/share/man CPUFREQ_BENCH=false install
+                       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}/usr/lib/libcpupower.so*
+                       chmod 0755 %{BUILDROOT}%{libdir}/libcpupower.so*
                fi
        end
 end
@@ -315,10 +355,17 @@ packages
 
                summary = The Linux kernel %{kernel_release}.
 
-               prerequires = dracut grubby module-init-tools
-               provides = kernel=%{kernel_release}
+               prerequires
+                       /sbin/depmod
+               end
+
+               provides
+                       kernel=%{kernel_release}
+               end
+
                requires
-                       %{prerequires}
+                       dracut
+                       grubby
                        linux-firmware
                end
 
@@ -331,8 +378,8 @@ packages
                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
@@ -344,7 +391,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
@@ -394,19 +441,19 @@ packages
                end
        end
 
-       if "%{build_kernel_pae}" == "1"
-               package kernel-PAE
+       if "%{build_kernel_legacy}" == "1"
+               package kernel-legacy
                        template KERNEL
 
-                       kernel_name = kernel-PAE
-                       kernel_release = %{fullver}.PAE
+                       kernel_name = kernel-legacy
+                       kernel_release = %{fullver}.legacy
                end
 
-               package kernel-PAE-devel
+               package kernel-legacy-devel
                        template KERNELDEVEL
 
-                       kernel_name = kernel-PAE
-                       kernel_release = %{fullver}.PAE
+                       kernel_name = kernel-legacy
+                       kernel_release = %{fullver}.legacy
                end
        end
 
@@ -419,13 +466,45 @@ packages
                end
 
                package kernel-versatile-devel
-                       kernel KERNELDEVEL
+                       template KERNELDEVEL
 
                        kernel_name = kernel-versatile
                        kernel_release = %{fullver}.versatile
                end
        end
 
+       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-omap
+                       kernel_release = %{fullver}.omap
+               end
+
+               package kernel-omap-devel
+                       template KERNELDEVEL
+
+                       kernel_name = kernel-omap
+                       kernel_release = %{fullver}.omap
+               end
+       end
+
        package kernel-headers
                summary = Header files of the kernel release %{fullver}.
                desciption = %{summary}