From 8447629f3c5cb08808764a38a7a7b619f847b017 Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Wed, 28 Jul 2021 14:30:00 -0700 Subject: [PATCH] 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. --- pmb/chroot/binfmt.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pmb/chroot/binfmt.py b/pmb/chroot/binfmt.py index 22ef804c..c6cd270b 100644 --- a/pmb/chroot/binfmt.py +++ b/pmb/chroot/binfmt.py @@ -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