binfmt: pass through chroot properly
This commit is contained in:
parent
3c9b96f03f
commit
0d866c6287
1 changed files with 3 additions and 3 deletions
|
@ -81,10 +81,10 @@ def register(arch: Arch, chroot: Optional[Chroot] = None):
|
||||||
register_path = binfmt_path + '/register'
|
register_path = binfmt_path + '/register'
|
||||||
is_arch_known(arch, True, 'register')
|
is_arch_known(arch, True, 'register')
|
||||||
qemu_arch = QEMU_ARCHES[arch]
|
qemu_arch = QEMU_ARCHES[arch]
|
||||||
if binfmt_is_registered(arch):
|
if binfmt_is_registered(arch, chroot=chroot):
|
||||||
return
|
return
|
||||||
|
|
||||||
lines = binfmt_info()
|
lines = binfmt_info(chroot=chroot)
|
||||||
|
|
||||||
_runcmd = run_root_cmd
|
_runcmd = run_root_cmd
|
||||||
if chroot:
|
if chroot:
|
||||||
|
@ -102,7 +102,7 @@ def register(arch: Arch, chroot: Optional[Chroot] = None):
|
||||||
# Register in binfmt_misc
|
# Register in binfmt_misc
|
||||||
logging.info(f"Registering qemu binfmt ({arch})")
|
logging.info(f"Registering qemu binfmt ({arch})")
|
||||||
_runcmd(f'echo "{code}" > "{register_path}" 2>/dev/null') # use path without chroot path prefix
|
_runcmd(f'echo "{code}" > "{register_path}" 2>/dev/null') # use path without chroot path prefix
|
||||||
if not binfmt_is_registered(arch):
|
if not binfmt_is_registered(arch, chroot=chroot):
|
||||||
logging.debug(f'binfmt line: {code}')
|
logging.debug(f'binfmt line: {code}')
|
||||||
raise Exception(f'Failed to register qemu-user for {arch} with binfmt_misc, {binfmt_path}/{info["name"]} not found')
|
raise Exception(f'Failed to register qemu-user for {arch} with binfmt_misc, {binfmt_path}/{info["name"]} not found')
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue