[Cbe-oss-dev] [RFC] Fixing kernel's "make rpm-pkg" in the PS3

Julio M. Merino Vidal jmerino at ac.upc.edu
Sun May 27 06:49:19 EST 2007


On 26/05/2007, at 18:03, Geoff Levand wrote:

> Julio M. Merino Vidal wrote:
>> Hello,
>>
>> As I outlined in some past post, "make rpm-pkg" is broken in the
>> PS3.  The resulting .rpm package installs the arch/powerpc/boot/
>> zImage file in /boot instead of the vmlinux image, and the former is
>> not meant to be used.
>>
>> I have a patch that resolves the issue by making rpm-pkg install
>> vmlinux instead of zImage.  However, I'm not sure if it is correct
>> (hence not posting yet).
>
> Please post the patch as [RFC] so we have something we can discuss.

If I had done it before, I'd have posted a bogus patch ;-)  At first  
I checked if the kernel was being built for a PS3 and avoided  
installing the zImage in that case.  But then I realized that a  
kernel built with PS3 support does not imply that it is _only_ usable  
in the PS3 (is it?).  I mean, it can be built with support for  
several powerpc-based machines at once so the resulting binary  
package should be functional in all "target" machines.

> As I told you, I tried "make rpm-pkg", but it failed, so seeing your
> patch will help.

Your problem is most likely related to this:

http://bugzilla.kernel.org/show_bug.cgi?id=8275

Looks like nobody has looked at it yet... maybe I should ping LKML as  
mails sent there seem to be more effective...

>
> The questions I have are:
[...]

Thanks for all the answers.

I'm posing the patch I'm using now below.  It changes both 'rpm-pkg'  
and 'targz-pkg' so that they produce consistent packages.  What it  
does is:
- Install a vmlinux-version image in the rpm-pkg case.
- Install a vmlinuz-version image in the targz-pkg case.

Please forgive any line wrappings and whitespace problems that may  
occur now.  If you like the patch, I can resend it later using  
another mailer and with the appropriate sign-off.  But... as this  
affects the whole powerpc port, this list might not be the one to  
talk about it.

diff --git a/scripts/package/buildtar b/scripts/package/buildtar
index aa0ccdb..4692c40 100644
--- a/scripts/package/buildtar
+++ b/scripts/package/buildtar
@@ -79,6 +79,9 @@ case "${ARCH}" in
		[ -f "${objtree}/vmlinux.SYS" ] && cp -v -- "${objtree}/ 
vmlinux.SYS" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}.SYS"
		[ -f "${objtree}/vmlinux.dsk" ] && cp -v -- "${objtree}/ 
vmlinux.dsk" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}.dsk"
		;;
+	powerpc)
+		[ -f "${objtree}/arch/${ARCH}/boot/${KBUILD_IMAGE}" ] && cp -v --  
"${objtree}/arch/${ARCH}/boot/${KBUILD_IMAGE}" "${tmpdir}/boot/ 
vmlinuz-${KERNELRELEASE}"
+		;;
	*)
		[ -f "${KBUILD_IMAGE}" ] && cp -v -- "${KBUILD_IMAGE}" "${tmpdir}/ 
boot/vmlinux-kbuild-${KERNELRELEASE}"
		echo "" >&2
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
index ffd61fe..19b65c6 100755
--- a/scripts/package/mkspec
+++ b/scripts/package/mkspec
@@ -69,6 +69,7 @@ echo 'mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/ 
lib/modules'
echo "%endif"
echo 'INSTALL_MOD_PATH=$RPM_BUILD_ROOT make %{_smp_mflags}  
modules_install'
+echo 'cp vmlinux $RPM_BUILD_ROOT'"/boot/vmlinux-$KERNELRELEASE"
echo "%ifarch ia64"
echo 'cp $KBUILD_IMAGE $RPM_BUILD_ROOT'"/boot/efi/vmlinuz- 
$KERNELRELEASE"
echo 'ln -s '"efi/vmlinuz-$KERNELRELEASE" '$RPM_BUILD_ROOT'"/boot/"

-- 
Julio M. Merino Vidal <jmerino at ac.upc.edu>





More information about the cbe-oss-dev mailing list