DevHeads.net

Multi-arch support in Mock

Hi,
I just pushed into updates-testing new release of Mock (1.4.11). It has nice new feature:

$ sudo dnf install qemu-user-static # weak dependency
$ mock -r fedora-28-ppc64le --forcearch ppc64le shell

This will give you Fedora shell on different architecture. Emulated by QEMU. And of course you can build packages for
the different architectures this way.
You can do this for any architecture: aarch64, armhfp, ppc64, ppc64le, s390x.

People are asking me how much slower it is. Here are some data:

$ time mock -r fedora-28-x86_64 /tmp/tito/mock-1.4.11-1.fc28.src.rpm
real 0m56,341s
user 0m46,238s
sys 0m6,027s

$ time mock -r fedora-28-ppc64le --forcearch=ppc64le /tmp/tito/mock-1.4.11-1.fc28.src.rpm
real 11m9,576s
user 10m40,182s
sys 0m29,916s

$ time mock -r fedora-28-x86_64 --shell 'echo Ahoy'
real 0m1,199s
user 0m0,759s
sys 0m0,253s

$ time mock -r fedora-28-ppc64le --forcearch=ppc64le --shell 'echo Ahoy'
real 0m1,726s
user 0m1,228s
sys 0m0,319s

For full release notes see:
<a href="https://github.com/rpm-software-management/mock/wiki/Release-Notes-1.4.11" title="https://github.com/rpm-software-management/mock/wiki/Release-Notes-1.4.11">https://github.com/rpm-software-management/mock/wiki/Release-Notes-1.4.11</a>

Miroslav

Comments

Re: Multi-arch support in Mock

By Alexander Ploumistos at 06/15/2018 - 02:40

Hi Miroslav,

I'm having trouble with the i386 arch on x86_64. I've tested it on
actual hardware and in a VM and in both cases I get

ERROR: Could not find useradd in chroot, maybe the install failed?

I've tried building the kernel with
mock -r fedora-29-i386 --forcearch=i386 kernel-4.18.0-0.rc0.git9.1.fc29.src.rpm
and just initializing the chroot with
mock -r fedora-29-i386 --forcearch=i386 init

Could this be a configuration issue or some other error on my part?

Re: Multi-arch support in Mock

By =?ISO-8859-2?Q?... at 06/15/2018 - 04:16

Dne 15.6.2018 v 08:40 Alexander Ploumistos napsal(a):
I have seen this error when there was old root cache (created prior rename of unprivileged user in buildroot).
Try `-r fedora-29-i386 --scrub=all`. If this is the case, it should resolve your issue.

Miroslav

Re: Multi-arch support in Mock

By Alexander Ploumistos at 06/15/2018 - 07:33

Thank you both,
mock -r fedora-29-i386 --arch=i386 kernel-4.18.0-0.rc0.git9.1.fc29.src.rpm
ran just fine.
On the other hand, retrying after a "--scrub=all" with
mock -r fedora-29-i386 --forcearch=i386 init
gave the same error.

Re: Multi-arch support in Mock

By Alexander Ploumistos at 06/15/2018 - 07:48

By the way, our 32-bit configurations have always been i386 instead of i686?

Re: Multi-arch support in Mock

By Richard Shaw at 06/15/2018 - 08:18

On Fri, Jun 15, 2018 at 6:49 AM Alexander Ploumistos <

They are i686, the chroots are named that for historical reasons.

Thanks,
Richard

Re: Multi-arch support in Mock

By =?ISO-8859-2?Q?... at 06/15/2018 - 04:16

Dne 15.6.2018 v 08:40 Alexander Ploumistos napsal(a):
I have seen this error when there was old root cache (created prior rename of unprivileged user in buildroot).
Try `-r fedora-29-i386 --scrub=all`. If this is the case, it should resolve your issue.

Miroslav

Re: Multi-arch support in Mock

By Tom Hughes at 06/15/2018 - 03:23

Well you've always been able to do i386 on x86_64 - there's no need
to use --forcearch for that.

Tom

Re: Multi-arch support in Mock

By Charalampos Str... at 06/13/2018 - 05:46

This is really awesome! Finally an easy way to test issues on alternative arch's. Thanks for that!

Re: Multi-arch support in Mock

By Petr Sabata at 06/14/2018 - 06:18

On Wed, Jun 13, 2018 at 05:46:59AM -0400, Charalampos Stratakis wrote:
+1

Now let's include it in local MBS builds :)

P