sysroot.eclass

Name

sysroot.eclass -- Common functions for using a different (sys)root

Description

This eclass provides common functions to run executables within a different root or sysroot, with or without emulation by QEMU. Despite the name, these functions can be used in src_* or pkg_* phase functions.

Supported EAPIs

7 8 9

Functions

qemu_arch

Return the QEMU architecture name for the given target or CHOST. This name is used in qemu-user binary filenames, e.g. qemu-ppc64le.

qemu_arch_if_needed

If QEMU is needed to run binaries for the given target or CHOST on the build system, return the QEMU architecture, otherwise return status code 1.

sysroot_make_run_prefixed

Create a wrapper script for directly running executables within a (sys)root without changing the root directory. The path to that script is returned. If no (sys)root has been set, then return status code 1. If the wrapper cannot be created for a permissible reason like QEMU being missing or broken, then return status code 2.

The script explicitly uses QEMU if this is necessary and it is available in this environment. It may otherwise implicitly use a QEMU outside this environment if binfmt_misc has been used with the F flag. It is not feasible to add a conditional dependency on QEMU.

sysroot_run_prefixed

Create a wrapper script with sysroot_make_run_prefixed if necessary, and use it to execute the given command, otherwise just execute the command directly. Return unsuccessfully if the wrapper cannot be created.

sysroot_try_run_prefixed

Create a wrapper script with sysroot_make_run_prefixed if necessary, and use it to execute the given command, otherwise just execute the command directly. Print a warning and return successfully if the wrapper cannot be created.

Authors

James Le Cuirot <chewi@gentoo.org>

Maintainers

cross@gentoo.org

Reporting Bugs

Please report bugs via https://bugs.gentoo.org/