Message ID | d8337e11-0727-a5cb-d3db-1cd6b5ad9190@gmail.com |
---|---|
State | New |
Headers | show |
Series | rpmbuild doesn't work on the target system out of the box with standard macros in the specfile | expand |
On 14 Jul 2023, at 13:53, Zoltan Boszormenyi via lists.openembedded.org <zboszor=gmail.com@lists.openembedded.org> wrote: > It would be nice if Yocto's rpm recipe added the possible > buildarchtranslate lines for BSP target archs automatically. As you’re in the perfect position to test this, would you be willing to come up with a patch? It might be as simple as only changing the macro files in native builds, so the target rpm has conventional macros. Then again I don’t know much about RPM so may be wrong! A test case that does a simple build using rpm would be a good step too. Cheers, Ross
2023. 07. 14. 15:23 keltezéssel, Ross Burton írta: > On 14 Jul 2023, at 13:53, Zoltan Boszormenyi via lists.openembedded.org <zboszor=gmail.com@lists.openembedded.org> wrote: >> It would be nice if Yocto's rpm recipe added the possible >> buildarchtranslate lines for BSP target archs automatically. > As you’re in the perfect position to test this, would you be willing to come up with a patch? I am trying to. Currently I am stuck with making this work for Yocto 3.4. Later I may be able to come up with something that works for Yocto master. > It might be as simple as only changing the macro files in native builds, so the target rpm has conventional macros. Then again I don’t know much about RPM so may be wrong! rpmrc and the platform specific macros file need changing. rpm --eval '%{_arch}' also not correct. strace shows that it looks at the contents of /etc/rpm/platform and then wants to read /usr/lib/rpm/platform/<platform>/macros which doesn't exist for e.g. platform=genericx86-64 or other BSPs. Also, I am not using multiarch so the default /usr/lib/rpm/platform/x86_64-linux/macros is not correct as it tells rpmbuild to use /usr/lib64 as opposed to use /usr/lib. Not sure what to do with a multiarch Yocto build. > A test case that does a simple build using rpm would be a good step too. > > Cheers, > Ross
2023. 07. 14. 15:48 keltezéssel, Zoltan Boszormenyi via lists.openembedded.org írta: > 2023. 07. 14. 15:23 keltezéssel, Ross Burton írta: >> On 14 Jul 2023, at 13:53, Zoltan Boszormenyi via lists.openembedded.org >> <zboszor=gmail.com@lists.openembedded.org> wrote: >>> It would be nice if Yocto's rpm recipe added the possible >>> buildarchtranslate lines for BSP target archs automatically. >> As you’re in the perfect position to test this, would you be willing to come up with a >> patch? > > I am trying to. > Currently I am stuck with making this work for Yocto 3.4. > Later I may be able to come up with something that works for Yocto master. > >> It might be as simple as only changing the macro files in native builds, so the target >> rpm has conventional macros. Then again I don’t know much about RPM so may be wrong! > > rpmrc and the platform specific macros file need changing. It seems only the latter needs to be changed. In case of MACHINE=genericx86-64, RPM packages with .genericx86_64.rpm suffix will be generated this way. I just sent the patch against the rpm recipe. Please review and comment. I hope I got it right for architectures I don't usually build for. > > rpm --eval '%{_arch}' also not correct. strace shows that > it looks at the contents of /etc/rpm/platform and then > wants to read /usr/lib/rpm/platform/<platform>/macros > which doesn't exist for e.g. platform=genericx86-64 or > other BSPs. > > Also, I am not using multiarch so the default > /usr/lib/rpm/platform/x86_64-linux/macros is not correct > as it tells rpmbuild to use /usr/lib64 as opposed to use /usr/lib. > > Not sure what to do with a multiarch Yocto build. > >> A test case that does a simple build using rpm would be a good step too. >> >> Cheers, >> Ross > > > -=-=-=-=-=-=-=-=-=-=-=- > Links: You receive all messages sent to this group. > View/Reply Online (#184265): https://lists.openembedded.org/g/openembedded-core/message/184265 > Mute This Topic: https://lists.openembedded.org/mt/100140377/3617728 > Group Owner: openembedded-core+owner@lists.openembedded.org > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [zboszor@gmail.com] > -=-=-=-=-=-=-=-=-=-=-=- >
--- /usr/lib/rpm/rpmrc.old 2023-05-18 12:28:44.000000000 +0000 +++ /usr/lib/rpm/rpmrc 2023-07-14 12:34:59.840691763 +0000 @@ -380,6 +380,8 @@ buildarchtranslate: x86_64: x86_64 buildarchtranslate: amd64: x86_64 buildarchtranslate: ia32e: x86_64 +buildarchtranslate: genericx86_64: x86_64 +buildarchtranslate: core2_64: x86_64 buildarchtranslate: sh3: sh3 buildarchtranslate: sh4: sh4