[RFC] Kernel subpackage for zImage wrapper.

David Woodhouse dwmw2 at infradead.org
Mon Dec 3 14:03:03 UTC 2007


In arch/powerpc/boot/ in the kernel, there is wrapper code which lets
you make a combined zImage from fairly much arbitrary kernels and
ramdisks. We use it outside the context of the kernel build, for
building installer images, etc. 

For a while we've had a copy -- in fact, two copies of different
vintages -- of this in the ppc64-utils package. This was about as
sensible as glibc-kernheaders was, and while upstream dicked around with
load addresses and other things to try to make sure it's compatible with
as many machines as possible, we lagged behind. 

Just as we do now for headers, I'd like to spit out a
'kernel-bootwrapper' subpackage when we build the kernel. It depends on
a patch introducing 'make bootloader_install' which has been sent
upstream and will hopefully be accepted; the resulting bootwrapper
package has been confirmed to work for Efika (ppc32), Electra (the new
PA Semi ppc64 machine) and PS3.

Dave, Chuck -- does this look OK?

Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.273
diff -u -p -r1.273 kernel.spec
--- kernel.spec	3 Dec 2007 03:01:18 -0000	1.273
+++ kernel.spec	3 Dec 2007 04:35:36 -0000
@@ -80,6 +80,8 @@ Summary: The Linux kernel (the core of t
 %define with_headers   %{?_without_headers:   0} %{?!_without_headers:   1}
 # kernel-debuginfo
 %define with_debuginfo %{?_without_debuginfo: 0} %{!?_without_debuginfo: 1}
+# kernel-bootwrapper (for creating zImages from kernel + initrd)
+%define with_bootwrapper %{?_without_bootwrapper: 0} %{!?_without_bootwrapper: 1}
 
 # Additional options for user-friendly one-off kernel building:
 #
@@ -261,6 +263,11 @@ Summary: The Linux kernel (the core of t
 %define all_arch_configs kernel-%{version}-*.config
 %endif
 
+# bootwrapper is only on ppc
+%ifnarch ppc
+%define with_bootwrapper 0
+%endif
+
 # sparse blows up on ppc64
 %ifarch ppc64 ppc alpha sparc64
 %define usesparse 0
@@ -678,6 +686,12 @@ header files define structures and const
 building most standard programs and are also needed for rebuilding the
 glibc package.
 
+%package bootwrapper
+Summary: Boot wrapper files for generating combined kernel + initrd images
+Group: Development/System
+%description bootwrapper
+Kernel-bootwrapper contains the wrapper code which makes bootable "zImage"
+files combining both kernel and initial ramdisk.
 
 %package debuginfo-common
 Summary: Kernel source files used by %{name}-debuginfo packages
@@ -1551,6 +1566,10 @@ rm -f $RPM_BUILD_ROOT/usr/include/asm*/i
 rm -f $RPM_BUILD_ROOT/usr/include/asm*/irq.h
 %endif
 
+%if %{with_bootwrapper}
+make DESTDIR=$RPM_BUILD_ROOT bootwrapper_install
+%endif
+
 ###
 ### clean
 ###
@@ -1646,6 +1665,13 @@ fi
 /usr/include/*
 %endif
 
+%if %{with_bootwrapper}
+%files bootwrapper
+%defattr(-,root,root)
+/usr/sbin/*
+%{_libdir}/kernel-wrapper
+%endif
+
 # only some architecture builds need kernel-doc
 %if %{with_doc}
 %files doc

-- 
dwmw2




More information about the Fedora-kernel-list mailing list