X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=kernel%2Fkernel.nm;h=5ff9ba3955c4b3eeec39e01f20370e9f57f15089;hb=c1ee9eb8538197f4b4fcb053104bcecaa5080ab4;hp=0413759bdc62da7f166647a16a203ac5048a3c51;hpb=6312c4bdc743410840da0d48d24383cb1fdd3890;p=ipfire-3.x.git diff --git a/kernel/kernel.nm b/kernel/kernel.nm index 0413759bd..5ff9ba395 100644 --- a/kernel/kernel.nm +++ b/kernel/kernel.nm @@ -4,8 +4,8 @@ ############################################################################### name = kernel -version = 3.1.5 -release = 3 +version = 3.5.3 +release = 0.1 thisapp = linux-%{version} maintainer = Michael Tremer @@ -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,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 @@ -79,20 +87,28 @@ build 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 + kernel_image = arch/%{kernel_arch}/boot/zImage # ARM does not support cpupower. build_cpupower = 0 @@ -108,9 +124,14 @@ build 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 + + # Build ARM omap kernel. + if "%{build_kernel_omap}" == "1" + kernels += omap end # Add tools' build requirements if build is requested. @@ -121,6 +142,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 +166,8 @@ build touch .scmversion mkdir -pv configs + + cd %{DIR_SOURCE} configure_kernel() { local flavour=${1} local suffix @@ -143,13 +175,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 +207,15 @@ 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} + 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 +224,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= \ KERNELRELEASE=${fullversion} modules_install # Install vdso. @@ -214,45 +243,45 @@ build # 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 -vf %{BUILDROOT}/usr/lib/modules/${fullversion}/{build,source} + mkdir -pv %{BUILDROOT}/usr/lib/modules/${fullversion}/build + ln -svf build %{BUILDROOT}/usr/lib/modules/${fullversion}/source # Create dirs for extra modules. - mkdir -pv %{BUILDROOT}/lib/modules/${fullversion}/extra + mkdir -pv %{BUILDROOT}/usr/lib/modules/${fullversion}/extra cp -v --parents $(find -type f -name "Makefile*" -o -name "Kconfig*") \ - %{BUILDROOT}/lib/modules/${fullversion}/build + %{BUILDROOT}/usr/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} + %{BUILDROOT}/usr/lib/modules/${fullversion}/build + rm -vrf %{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 -v .config %{BUILDROOT}/usr/lib/modules/${fullversion}/build + cp -va 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 + %{BUILDROOT}/usr/lib/modules/${fullversion}/build + cp -va 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 -v %{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 \ + mv -v %{BUILDROOT}/usr/lib/modules/${fullversion}/build \ %{BUILDROOT}/usr/src/kernels/${fullversion} - ln -svf ../../../usr/src/kernels/${fullversion} \ - %{BUILDROOT}/lib/modules/${fullversion}/build + ln -svf ../../../src/kernels/${fullversion} \ + %{BUILDROOT}/usr/lib/modules/${fullversion}/build find %{BUILDROOT}/usr/src/kernels -name ".*.cmd" -exec rm -f {} \; } @@ -274,6 +303,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,10 +323,9 @@ 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 @@ -316,9 +348,7 @@ packages summary = The Linux kernel %{kernel_release}. prerequires - dracut - grubby - module-init-tools + /sbin/depmod end provides @@ -326,7 +356,8 @@ packages end requires - %{prerequires} + dracut + grubby linux-firmware end @@ -335,12 +366,12 @@ packages /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 +383,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 +411,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 @@ -418,19 +449,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 +501,8 @@ packages files / !/boot - !/lib/modules !/usr/include + !/usr/lib/modules !/usr/src !/usr/src/debug !/usr/lib/debug