packages and image: wrap more upfront on missing binaries
This commit is contained in:
parent
cdc803031e
commit
5cb747aa26
2 changed files with 6 additions and 5 deletions
4
image.py
4
image.py
|
@ -18,7 +18,7 @@ from exec.file import root_write_file, root_makedir, makedir
|
|||
from packages import build_enable_qemu_binfmt, build_packages_by_paths
|
||||
from packages.device import get_profile_device
|
||||
from ssh import copy_ssh_keys
|
||||
from wrapper import wrap_if_foreign_arch
|
||||
from wrapper import check_programs_wrap, wrap_if_foreign_arch
|
||||
|
||||
# image files need to be slightly smaller than partitions to fit
|
||||
IMG_FILE_ROOT_DEFAULT_SIZE = "1800M"
|
||||
|
@ -389,7 +389,7 @@ def cmd_build(profile_name: str = None,
|
|||
Unless overriden, required packages will be built or preferably downloaded from HTTPS repos.
|
||||
"""
|
||||
arch = get_profile_device(profile_name).arch
|
||||
wrap_if_foreign_arch(arch)
|
||||
check_programs_wrap(['makepkg', 'pacman', 'pacstrap'])
|
||||
profile: Profile = config.get_profile(profile_name)
|
||||
device, flavour = get_device_and_flavour(profile_name)
|
||||
size_extra_mb: int = int(profile["size_extra_mb"])
|
||||
|
|
|
@ -11,7 +11,7 @@ from urllib.request import urlopen
|
|||
from shutil import copyfileobj
|
||||
from typing import Iterable, Iterator, Optional
|
||||
|
||||
from binfmt import register as binfmt_register
|
||||
from binfmt import register as binfmt_register, QEMU_ARCHES
|
||||
from constants import REPOSITORIES, CROSSDIRECT_PKGS, QEMU_BINFMT_PKGS, GCC_HOSTSPECS, ARCHES, Arch, CHROOT_PATHS, MAKEPKG_CMD
|
||||
from config import config
|
||||
from exec.cmd import run_cmd, run_root_cmd
|
||||
|
@ -591,6 +591,7 @@ def build_packages(
|
|||
enable_ccache: bool = True,
|
||||
clean_chroot: bool = False,
|
||||
):
|
||||
check_programs_wrap(['makepkg', 'pacman', 'pacstrap'])
|
||||
init_prebuilts(arch)
|
||||
build_levels = get_unbuilt_package_levels(
|
||||
packages,
|
||||
|
@ -636,6 +637,7 @@ def build_packages_by_paths(
|
|||
if isinstance(paths, str):
|
||||
paths = [paths]
|
||||
|
||||
check_programs_wrap(['makepkg', 'pacman', 'pacstrap'])
|
||||
assert config.runtime.arch
|
||||
for _arch in set([arch, config.runtime.arch]):
|
||||
init_prebuilts(_arch)
|
||||
|
@ -667,7 +669,7 @@ def build_enable_qemu_binfmt(arch: Arch, repo: Optional[dict[str, Pkgbuild]] = N
|
|||
assert native
|
||||
if arch == native:
|
||||
return
|
||||
wrap_if_foreign_arch(arch)
|
||||
check_programs_wrap([f'qemu-{QEMU_ARCHES[arch]}-static', 'pacman', 'makepkg'])
|
||||
# build qemu-user, binfmt, crossdirect
|
||||
build_packages_by_paths(
|
||||
CROSSDIRECT_PKGS,
|
||||
|
@ -725,7 +727,6 @@ def build(
|
|||
rebuild_dependants: bool = False,
|
||||
try_download: bool = False,
|
||||
):
|
||||
# TODO: arch = config.get_profile()...
|
||||
arch = arch or get_profile_device(hint_or_set_arch=True).arch
|
||||
|
||||
if arch not in ARCHES:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue