]> 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 e266e41d558bd51afb0b97d04d56c969012eb30f..61c541ce3894a7b4b6c558ab77578af34c3ff3b7 100644 (file)
@@ -4,8 +4,8 @@
 ###############################################################################
 
 name       = kernel
-version    = 3.1.5
-release    = 4
+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
 
@@ -36,17 +36,20 @@ build
 
        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
                xmlto
-               xz-lzma-compat
+
+               /sbin/depmod
        end
 
        tools_cpupower_requires
@@ -61,6 +64,9 @@ 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 legacy kernel for the
@@ -81,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
@@ -115,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}
@@ -123,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 \
@@ -138,6 +174,8 @@ build
                touch .scmversion
 
                mkdir -pv configs
+
+               cd %{DIR_SOURCE}
                configure_kernel() {
                        local flavour=${1}
                        local suffix
@@ -145,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
@@ -182,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}
@@ -276,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
@@ -292,7 +331,7 @@ build
                rm -rfv %{BUILDROOT}/lib/firmware
 
                # Install tools.
-               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
 
@@ -317,9 +356,7 @@ packages
                summary = The Linux kernel %{kernel_release}.
 
                prerequires
-                       dracut
-                       grubby
-                       module-init-tools
+                       /sbin/depmod
                end
 
                provides
@@ -327,7 +364,8 @@ packages
                end
 
                requires
-                       %{prerequires}
+                       dracut
+                       grubby
                        linux-firmware
                end
 
@@ -340,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
@@ -353,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
@@ -428,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}