Yocto - COMPATIBLE_{MACHINE,HOST}

markyang92·2021년 8월 30일
0

yocto

목록 보기
29/53
post-thumbnail

Compatibility

  • recipe는 현재 설정된 MACHINE과 Compatible한지 고려해야한다.
  • 아래 변수는 현재 MACHINE 이나 HOST의 호환가능을 명시한다.
    • ${COMPATIBLE_MACHINE}
    • ${COMPATIBLE_HOST}

$COMPATIBLE_MACHINE

  • recipe에 지정하는 VARIABLE
  • 레시피가 지원하는 MACHINE list
  • 기본 값="(^$)"
    • empty string임 (다된다)
  • 이 변수를 사용해 레시피가 호환되지 않는 MACHINE에 대해 빌드되는 경우 멈출 수 있다.

recipe에서 지정 예

  1. myhello srcs

  1. myhello_0.8.bb

  1. ${TOPDIR}/conf/local.conf
  • MACHINE = "qemuarm" 되어 있음

  1. ★★COMPATIBLE_MACHINE 지정★★ -> myhello_0.8.bb 레시피
  • COMPATIBLE_MACHINE="qemux86|qemux86-64" 추가

  1. bitbake build
  • MACHINE="qemuarm" (${TOPDIR}/conf/local.conf) 일 때,
    myhello_0.8.bbCOMPATIBLE_MACHINE="qemux86|qemux86-64"로 지정했더니,
    $TMPDIR/work/arm-*/myhello0.8 버전빌드되지 않았음
    이전 버전 중 사용가능한 latest 버전 myhello_0.7.bb를 build함

COMPATIBLE_MACHINE Table

COMPATIBLE_MACHINEDescription
COMPATIBLE_MACHINE="(-)"Disallow ALL
COMPATIBLE_MACHINE="qemux86 | qemux86-64"Allow x86, x86-64 Machine(Architecture)
COMPATIBLE_MACHINE_x86="(.*)"Allow x86 Machine(Architecture)
COMPATIBLE_MACHINE_x86-64="(.*)"Allow x86-64 Machine(Architecture)
COMPATIBLE_MACHINE_armv6="(.*)"Allow armv6 Machine(Architecture)
COMPATIBLE_MACHINE_armv7a="(.*)"Allow armv7a Machine(Architecture)
COMPATIBLE_MACHINE_armv4="(!.*armv4).*"Disallow armv4 Machine(Architecuture)

  1. COMPATIBLE_MACHINE="(-)" : Disallow All MACHINE
  • 레시피에 아래와 같이 명시
  • 허용되는 레시피가 없는경우, bitbake 에러

  1. To enable specific architectures and disallow all others
# recipe
COMPATIBLE_MACHINE="(-)"
COMPATIBLE_MACHINE_x86="(.*)"
COMPATIBLE_MACHINE_x86-64="(.*)"
COMPATIBLE_MACHINE_armv6="(.*)"
COMPATIBLE_MACHINE_armv7a="(.*)"

  1. Allow all architectures but turn off specific ones (a sort of INCOMPATIBLE_MACHINE)
COMPATIBLE_MACHINE_armv4 = "(!.*armv4).*"
COMPATIBLE_MACHINE_armv5 = "(!.*armv5).*"
COMPATIBLE_MACHINE_mips64 = "(!.*mips64).*"

  1. To enable 'qemuarm' architecture and disallow all others
COMPATIBLE_MACHINE="(-)"
COMPATIBLE_MACHINE_qemuarm="(.*)"
  • local.conf에 MACHINE = "qemuarm" 인 경우만 bitbake build 된다.

$COMPATIBLE_HOST

  • 허용하는 HOST를 recipe에 명시
  • bitbake에서 HOST
HOSTTOOLS="      [ ar as awk basename bash bzip2 cat chgrp chmod chown chrpath cmp comm cp cpio     cpp cut date dd diff diffstat dirname du echo egrep env expand expr false     fgrep file find flock g++ gawk gcc getconf getopt git grep gunzip gzip     head hostname iconv id install ld ldd ln ls make md5sum mkdir mknod     mktemp mv nm objcopy objdump od patch perl pr printf pwd     python3 ranlib readelf readlink realpath rm rmdir rpcgen sed seq sh     sha1sum sha224sum sha256sum sha384sum sha512sum     sleep sort split stat strings strip tail tar tee test touch tr true uname     uniq wc wget which xargs  "
HOSTTOOLS_DIR="/home/dhyang/poky/build/tmp/hosttools"
HOSTTOOLS_NONFATAL=" aws gcc-ar gpg ld.bfd ld.gold nc pigz sftp socat ssh sudo join nl size yes zcat bzr scp git-lfs"
HOST_ARCH="arm"
HOST_AS_ARCH=""
HOST_CC_ARCH=" -march=armv7ve -mthumb -mfpu=neon -mfloat-abi=hard -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security"
HOST_EXEEXT=""
HOST_LD_ARCH=""
HOST_OS="linux-gnueabi"
HOST_PREFIX="arm-poky-linux-gnueabi-"
HOST_SYS="arm-poky-linux-gnueabi"
HOST_USER_GID="1000"
HOST_USER_UID="1000"
HOST_VENDOR="-poky"

  1. local.confMACHINE="qemuarm"일 때, COMPATIBLE_HOST="qemuarm" 으로 하면?
    1-1. local.conf

    1-2. myhello recipe

    1-3. Error occurred!
profile
pllpokko@alumni.kaist.ac.kr

0개의 댓글