pmb/chroot/binfmt: don't register arch if OS does it automatically (MR 2088)

It seems like the gitlab runners will now automatically register archs
when binfmt is mounted (I'm not completely sure, it's really
hard/annoying to confirm using gitlab CI jobs and no direct access to
the runner)

In any case, checking if it's already registered fixes a problem where
CI fails with "File exists" when it tries to register the arch.
This commit is contained in:
Clayton Craft 2021-07-28 14:30:00 -07:00
parent f3b6534b69
commit 8447629f3c
No known key found for this signature in database
GPG Key ID: 7A3461CA187CEA54
1 changed files with 6 additions and 0 deletions

View File

@ -22,6 +22,12 @@ def register(args, arch):
return
pmb.helpers.other.check_binfmt_misc(args)
pmb.chroot.apk.install(args, ["qemu-" + arch_qemu])
# Don't continue if the actions from check_binfmt_misc caused the OS to
# automatically register the target arch
if is_registered(arch_qemu):
return
info = pmb.parse.binfmt_info(args, arch_qemu)
# Build registration string