packages/build: build_enable_qemu_binfmt(): don't install packages on unwrapped systems
This commit is contained in:
parent
6b4bb27609
commit
91041ab06d
1 changed files with 7 additions and 7 deletions
|
@ -8,7 +8,7 @@ from copy import deepcopy
|
||||||
from urllib.error import HTTPError
|
from urllib.error import HTTPError
|
||||||
from typing import Iterable, Iterator, Optional
|
from typing import Iterable, Iterator, Optional
|
||||||
|
|
||||||
from binfmt import register as binfmt_register, QEMU_ARCHES
|
from binfmt import register as binfmt_register
|
||||||
from constants import REPOSITORIES, CROSSDIRECT_PKGS, QEMU_BINFMT_PKGS, GCC_HOSTSPECS, ARCHES, Arch, CHROOT_PATHS, MAKEPKG_CMD
|
from constants import REPOSITORIES, CROSSDIRECT_PKGS, QEMU_BINFMT_PKGS, GCC_HOSTSPECS, ARCHES, Arch, CHROOT_PATHS, MAKEPKG_CMD
|
||||||
from config import config
|
from config import config
|
||||||
from exec.cmd import run_cmd, run_root_cmd
|
from exec.cmd import run_cmd, run_root_cmd
|
||||||
|
@ -16,7 +16,7 @@ from exec.file import makedir, remove_file, symlink
|
||||||
from chroot.build import get_build_chroot, BuildChroot
|
from chroot.build import get_build_chroot, BuildChroot
|
||||||
from distro.distro import get_kupfer_https, get_kupfer_local
|
from distro.distro import get_kupfer_https, get_kupfer_local
|
||||||
from distro.package import RemotePackage
|
from distro.package import RemotePackage
|
||||||
from wrapper import check_programs_wrap, wrap_if_foreign_arch
|
from wrapper import check_programs_wrap, is_wrapped
|
||||||
|
|
||||||
from .pkgbuild import discover_pkgbuilds, filter_pkgbuilds, Pkgbuild
|
from .pkgbuild import discover_pkgbuilds, filter_pkgbuilds, Pkgbuild
|
||||||
|
|
||||||
|
@ -381,7 +381,6 @@ def setup_build_chroot(
|
||||||
) -> BuildChroot:
|
) -> BuildChroot:
|
||||||
assert config.runtime.arch
|
assert config.runtime.arch
|
||||||
if arch != config.runtime.arch:
|
if arch != config.runtime.arch:
|
||||||
wrap_if_foreign_arch(arch)
|
|
||||||
build_enable_qemu_binfmt(arch)
|
build_enable_qemu_binfmt(arch)
|
||||||
init_prebuilts(arch)
|
init_prebuilts(arch)
|
||||||
chroot = get_build_chroot(arch, add_kupfer_repos=add_kupfer_repos)
|
chroot = get_build_chroot(arch, add_kupfer_repos=add_kupfer_repos)
|
||||||
|
@ -683,7 +682,7 @@ def build_enable_qemu_binfmt(arch: Arch, repo: Optional[dict[str, Pkgbuild]] = N
|
||||||
assert native
|
assert native
|
||||||
if arch == native:
|
if arch == native:
|
||||||
return
|
return
|
||||||
check_programs_wrap([f'qemu-{QEMU_ARCHES[arch]}-static', 'pacman', 'makepkg'])
|
check_programs_wrap(['pacman', 'makepkg', 'pacstrap'])
|
||||||
# build qemu-user, binfmt, crossdirect
|
# build qemu-user, binfmt, crossdirect
|
||||||
build_packages_by_paths(
|
build_packages_by_paths(
|
||||||
CROSSDIRECT_PKGS,
|
CROSSDIRECT_PKGS,
|
||||||
|
@ -694,9 +693,10 @@ def build_enable_qemu_binfmt(arch: Arch, repo: Optional[dict[str, Pkgbuild]] = N
|
||||||
enable_crossdirect=False,
|
enable_crossdirect=False,
|
||||||
enable_ccache=False,
|
enable_ccache=False,
|
||||||
)
|
)
|
||||||
crossrepo = get_kupfer_local(native, in_chroot=False, scan=True).repos['cross'].packages
|
if is_wrapped():
|
||||||
pkgfiles = [os.path.join(crossrepo[pkg].resolved_url.split('file://')[1]) for pkg in QEMU_BINFMT_PKGS] # type: ignore
|
crossrepo = get_kupfer_local(native, in_chroot=False, scan=True).repos['cross'].packages
|
||||||
run_root_cmd(['pacman', '-U', '--noconfirm', '--needed'] + pkgfiles)
|
pkgfiles = [os.path.join(crossrepo[pkg].resolved_url.split('file://')[1]) for pkg in QEMU_BINFMT_PKGS] # type: ignore
|
||||||
|
run_root_cmd(['pacman', '-U', '--noconfirm', '--needed'] + pkgfiles)
|
||||||
if arch != native:
|
if arch != native:
|
||||||
binfmt_register(arch)
|
binfmt_register(arch)
|
||||||
_qemu_enabled[arch] = True
|
_qemu_enabled[arch] = True
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue