[PATCH 3/4] add with_firmware option to play nice with F11 kernel-firmware rpms

Martin Dengler martin at martindengler.com
Mon Jun 29 23:43:02 EDT 2009


---
 olpc/SPECS/olpc-2.6.spec |   37 +++++++++++++++++++++++++++++++++++--
 1 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/olpc/SPECS/olpc-2.6.spec b/olpc/SPECS/olpc-2.6.spec
index d04f4ae..64d9d68 100644
--- a/olpc/SPECS/olpc-2.6.spec
+++ b/olpc/SPECS/olpc-2.6.spec
@@ -15,6 +15,8 @@ Summary: The Linux kernel (the core of the Linux operating system)
 %define buildkdump 0
 %define buildheaders 1
 %define _enable_debug_packages 0
+# kernel-firmware
+%define with_firmware  %{?_with_firmware:  1} %{?!_with_firmware:  0}
 
 # Versions of various parts
 
@@ -54,6 +56,7 @@ Summary: The Linux kernel (the core of the Linux operating system)
 %define buildxen 0
 %define buildkdump 0
 %define all_arch_configs $RPM_SOURCE_DIR/kernel-olpc-custom.config
+%define with_firmware 1
 %endif
 # Don't build 586 kernels for RHEL builds.
 %if 0%{?rhel}
@@ -73,6 +76,7 @@ Summary: The Linux kernel (the core of the Linux operating system)
 %define buildup 0
 %define buildheaders 0
 %define all_arch_configs $RPM_SOURCE_DIR/kernel-%{kversion}-*.config
+%define with_firmware 0
 %endif
 
 # kdump only builds on i686, x86_64, ppc64 ...
@@ -215,7 +219,7 @@ Summary: The Linux kernel (the core of the Linux operating system)
 # Packages that need to be installed before the kernel is, because the %post
 # scripts use them.
 #
-%define kernel_prereq  fileutils, module-init-tools, initscripts >= 8.11.1-1
+%define kernel_prereq  fileutils, module-init-tools, initscripts >= 8.11.1-1, kernel-firmware >= %{rpmversion}-%{pkg_release}
 
 Name: kernel
 Group: System Environment/Kernel
@@ -323,6 +327,21 @@ header files define structures and constants that are needed for
 building most standard programs and are also needed for rebuilding the
 glibc package.
 
+
+%package firmware
+Summary: Firmware files used by the Linux kernel
+Group: Development/System
+# This is... complicated.
+# Look at the WHENCE file.
+License: GPL+ and GPLv2+ and MIT and Redistributable, no modification permitted
+%if "x%{?variant}" != "x"
+Provides: kernel-firmware = %{rpmversion}-%{pkg_release}
+%endif
+%description firmware
+Kernel-firmware includes firmware files required for some devices to
+operate.
+
+
 %prep
 #if a rhel kernel, apply the rhel config options
 %if 0%{?rhel}
@@ -518,7 +537,9 @@ Config=kernel-olpc-custom.config
     fi
 
     mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer
-    make -s ARCH=$Arch INSTALL_MOD_PATH=$RPM_BUILD_ROOT modules_install KERNELRELEASE=$KernelVer
+    # Override $(mod-fw) because we don't want it to install any firmware
+    # We'll do that ourselves with 'make firmware_install'
+    make -s ARCH=$Arch INSTALL_MOD_PATH=$RPM_BUILD_ROOT modules_install KERNELRELEASE=$KernelVer mod-fw=
 
     # And save the headers/makefiles etc for building modules against
     #
@@ -805,6 +826,11 @@ rm -f $RPM_BUILD_ROOT/usr/include/asm*/atomic.h
 rm -f $RPM_BUILD_ROOT/usr/include/asm*/io.h
 rm -f $RPM_BUILD_ROOT/usr/include/asm*/irq.h
 %endif
+
+%if %{with_firmware}
+make INSTALL_FW_PATH=$RPM_BUILD_ROOT/lib/firmware firmware_install
+%endif
+
 ###
 ### clean
 ###
@@ -887,6 +913,13 @@ fi
 /usr/include/*
 %endif
 
+%if %{with_firmware}
+%files firmware
+%defattr(-,root,root)
+/lib/firmware/*
+%doc linux-%{kversion}.%{_target_cpu}/firmware/WHENCE
+%endif
+
 # only some architecture builds need kernel-doc
 
 %if %{builddoc}
-- 
1.6.0.6




More information about the Devel mailing list