<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 8, 2022 at 7:52 AM Michael Ellerman <<a href="mailto:mpe@ellerman.id.au">mpe@ellerman.id.au</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Donald Zickus <<a href="mailto:dzickus@redhat.com" target="_blank">dzickus@redhat.com</a>> writes:<br>
> Hi Michael,<br>
><br>
> I am working on two packaging issues with Fedora and CKI that I am hoping<br>
> you can give me some guidance on.<br>
><br>
> 1 - Fedora has always packaged an eu-strip'd vmlinux file for powerpc.  The<br>
> other arches we support used native compressed images.  I was looking into<br>
> using powerpc's zImage (pseries) binary to remove the powerpc workarounds<br>
> in our rpm spec file.<br>
<br>
What's the motivation for using the zImage?<br>
<br>
My naive hope was that as more advanced boot loaders become the norm we<br>
could eventually get rid of the zImage.<br>
<br>
It's generally a pain to work with, and a bit crufty, it also doesn't<br>
get as much testing as booting the vmlinux, so I'd be a little wary of<br>
switching to it.<br></blockquote><div><br></div><div>My motivation really is to remove some of manual stripping out of our specfile and use something more community builtin and address my second issue. <br></div><div><br></div><div>If zImage isn't the right path to pursue, that is fine by me.  Perhaps I just want vmlinux.stripped.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
There's also multiple zImages (and others), although admittedly for the<br>
platforms that Fedora supports the zImage.pseries should work (I think).<br>
<br>
> However, the rpmbuild fails because it can't find a build-id with<br>
> eu-readelf -n zImage.  Sure enough the build-id is found in vmlinux and<br>
> vmlinux.stripped but disappears with vmlinux.stripped.gz.<br>
<br>
Looks like other arches use objcopy rather than strip, maybe that's it?<br>
<br>
> I had hoped<br>
> arch/powerpc/boot/addnote would stick it back in but it doesn't (I am<br>
> ignorant of how addnote works).<br>
<br>
addnote adds some notes that firmware needs to read, it doesn't do<br>
anything else, though maybe it could.<br>
<br>
> eu-readelf -n  data<br>
> vmlinux:<br>
><br>
> Displaying notes found in: .notes<br>
>   Owner                Data size        Description<br>
>   GNU                  0x00000014       NT_GNU_BUILD_ID (unique build ID<br>
> bitstring)<br>
>     Build ID: b4c026d72ead7b4316a221cddb7f2b10d75fb313<br>
>   Linux                0x00000004       func<br>
>    description data: 00 00 00 00<br>
>   Linux                0x00000001       OPEN<br>
>    description data: 00<br>
>   PowerPC              0x00000004       NT_VERSION (version)<br>
>    description data: 01 00 00 00<br>
><br>
> zImage:<br>
><br>
> Displaying notes found at file offset 0x00000158 with length 0x0000002c:<br>
>   Owner                Data size        Description<br>
>   PowerPC              0x00000018       Unknown note type: (0x00001275)<br>
>    description data: ff ff ff ff 02 00 00 00 ff ff ff ff ff ff ff ff ff ff<br>
> ff ff 00 00 40 00<br>
><br>
> Displaying notes found at file offset 0x00000184 with length 0x00000044:<br>
>   Owner                Data size        Description<br>
>   IBM,RPA-Client-[...] 0x00000020       Unknown note type: (0x12759999)<br>
>    description data: 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 28 00 00<br>
> 00 01 ff ff ff ff 00 00 00 00 00 00 00 01<br>
><br>
> Is this something that can be addressed?  Or should I/we expect the<br>
> build-id to never make it into the zImage and just continue with our<br>
> current vmlinux process?<br>
<br>
Maybe :)<br>
<br>
Is it correct for the build-id to be copied into the zImage anyway? It's<br>
a different binary so shouldn't it have a different build-id?<br>
<br>
If you have a zImage and a vmlinux with the same build-id isn't that<br>
going to confuse debugging tools?<br></blockquote><div><br></div><div>My understanding is the debug tools use vmlinux anyway (at least for Fedora) which is stored in our -debuginfo package.  While the booted image (compressed) is stored in the traditional kernel rpm.  My understanding is the build is the same whether compressed or not so having a similar build-id made sense.  But I am a little ignorant here.</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> 2 - CKI builds kernels using 'make targz-pkg'.  The arches we support<br>
> (x86_64, s390, aarch64) provide compressed binaries to package using<br>
> KBUILD_IMAGE or a specific entry in scripts/package/buildtar.  As a result,<br>
> because powerpc doesn't have a KBUILD_IMAGE variable defined, the script<br>
> builds vmlinx and cp's that to vmlinux-kbuild.  The problem with powerpc is<br>
> that vmlinux for us is huge ( >256MB) and cp'ing that to vmlinux-kbuild<br>
> occupies > 512MB of /boot and our distro runs out of disk space on that<br>
> partition.<br>
<br>
Is that just because it has debug info built in? I thought the distro<br>
solution for that was doing split debug info?<br></blockquote><div><br></div><div>Yes, our rpm specfile stores vmlinux in -debuginfo and strips vmlinux to store in the normal kernel rpm.</div><div><br></div><div>But our kernel CI service, CKI uses the upstream's 'make targz-pkg' for easier consumption by the upstream community that may not use rpms.  That Makefile target doesn't have any stripping.  I was hoping to add that.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> I was hoping to add a patch to arch/powerpc/Makefile that defines<br>
> KBUILD_IMAGE:=$(boot)/zImage (mimicing arch/s390), which I believe would<br>
> solve our problem.  However, that circles back to our first problem above.<br>
><br>
> Thoughts?  Help?<br></blockquote><div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Happy to try and help, though see my concerns at the top about using zImage.<br></blockquote><div><br></div><div>If zImage isn't the right approach, would you be open to adding a variable in arch/powerpc/Makefile</div><div><br></div><div>KBUILD_IMAGE:= $(obj)/vmlinux.strip</div><div><br></div><div>though I think that file is created and removed while building the zImage.</div><div><br></div><div><br></div><div>It is a small tweak, but one I was trying to avoid hacking into our source code.</div><div><br></div><div>Cheers,</div><div>Don</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
cheers<br>
<br>
</blockquote></div></div>