1
设置
- NATIVELSBSTRING
- ORIGNATIVELSBSTRING
- BB_VERSION
231 if isinstance(e, bb.event.ConfigParsed):
232 ¦ if not d.getVar("NATIVELSBSTRING", False):
233 ¦ ¦ d.setVar("NATIVELSBSTRING", lsb_distro_identifier(d))
234 ¦ d.setVar("ORIGNATIVELSBSTRING", d.getVar("NATIVELSBSTRING", False))
235 ¦ d.setVar('BB_VERSION', bb.__version__)
4420 # $NATIVELSBSTRING [3 operations]
4421 # set /home/zhangsong/work/about_yocto/sources/poky/meta/conf/documentation.conf:295
4422 # [doc] "A string identifying the host distribution."
4423 # set base.bbclass:233 [defaultbase_eventhandler]
4424 # "ubuntu-20.04"
4425 # set uninative.bbclass:135 [enable_uninative]
4426 # "universal"
4427 # pre-expansion value:
4428 # "universal"
4429 NATIVELSBSTRING="universal"
4596 # $ORIGNATIVELSBSTRING
4597 # set base.bbclass:234 [defaultbase_eventhandler]
4598 # "ubuntu-20.04"
4599 ORIGNATIVELSBSTRING="ubuntu-20.04"
2
host tools 处理。
>>121 def setup_hosttools_dir(dest, toolsvar, d, fatal=True):
122 tools = d.getVar(toolsvar).split()
123 origbbenv = d.getVar("BB_ORIGENV", False)
124 path = origbbenv.getVar("PATH")
125 bb.utils.mkdirhier(dest)
126 notfound = []
127 for tool in tools:
128 ¦ desttool = os.path.join(dest, tool)
129 ¦ if not os.path.exists(desttool):
130 ¦ ¦ # clean up dead symlink
131 ¦ ¦ if os.path.islink(desttool):
132 ¦ ¦ ¦ os.unlink(desttool)
133 ¦ ¦ srctool = bb.utils.which(path, tool, executable=True)
134 ¦ ¦ # gcc/g++ may link to ccache on some hosts, e.g.,
135 ¦ ¦ # /usr/local/bin/ccache/gcc -> /usr/bin/ccache, then which(gcc)
136 ¦ ¦ # would return /usr/local/bin/ccache/gcc, but what we need is
137 ¦ ¦ # /usr/bin/gcc, this code can check and fix that.
138 ¦ ¦ if "ccache" in srctool:
>>139 ¦ ¦ ¦ srctool = bb.utils.which(path, tool, executable=True, direction=1)
140 ¦ ¦ if srctool:
141 ¦ ¦ ¦ os.symlink(srctool, desttool)
142 ¦ ¦ else:
143 ¦ ¦ ¦ notfound.append(tool)
144
145 if notfound and fatal:
>>146 ¦ bb.fatal("The following required tools (as specified by HOSTTOOLS) appear to be unavailable in PATH, please install them in order to proceed:\n %s" % " ".join(notfound))
***************************************************************************************
3182 # $HOSTTOOLS [3 operations]
3183 # append /home/zhangsong/work/about_yocto/sources/meta-kylinos-bin/conf/layer.conf:27
3184 # "xz"
3185 # append /home/zhangsong/work/about_yocto/sources/poky/meta/conf/bitbake.conf:496
3186 # " [ 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
3187 # append /home/zhangsong/work/about_yocto/sources/poky/meta/conf/bitbake.conf:499
3188 # "${@'ip ping ps scp ssh stty' if (bb.utils.contains_any('IMAGE_CLASSES', 'testimage testsdk', True, False, d) or any(x in (d.getVar("BBINCLUDED") or "") for x in ["testimage.bbclass", "testsdk.bbclass"]
3189 # pre-expansion value:
3190 # " xz [ 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 gc
3191 HOSTTOOLS=" xz [ 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++ g
3192 #
3193 # $HOSTTOOLS_DIR
3194 # set /home/zhangsong/work/about_yocto/sources/poky/meta/conf/bitbake.conf:483
3195 # "${TMPDIR}/hosttools"
3196 HOSTTOOLS_DIR="/home/zhangsong/work/about_yocto/build_dir/build_kylin/tmp/hosttools"
3197 #
3198 # $HOSTTOOLS_NONFATAL [5 operations]
3199 # append /home/zhangsong/work/about_yocto/sources/poky/meta/conf/bitbake.conf:502
3200 # "aws gcc-ar gpg ld.bfd ld.gold nc pigz sftp socat ssh sudo"
3201 # append /home/zhangsong/work/about_yocto/sources/poky/meta/conf/bitbake.conf:505
3202 # "join nl size yes zcat"
3203 # append /home/zhangsong/work/about_yocto/sources/poky/meta/conf/bitbake.conf:508
3204 # "bzr"
3205 # append /home/zhangsong/work/about_yocto/sources/poky/meta/conf/bitbake.conf:511
3206 # "scp"
3207 # append /home/zhangsong/work/about_yocto/sources/poky/meta/conf/bitbake.conf:514
3208 # "git-lfs"
3209 # pre-expansion value:
3210 # " aws gcc-ar gpg ld.bfd ld.gold nc pigz sftp socat ssh sudo join nl size yes zcat bzr scp git-lfs"
3211 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"
240 if isinstance(e, bb.event.ConfigParsed) or \
>>241 ¦ ¦ (isinstance(e, bb.event.BuildStarted) and not os.path.exists(d.getVar('HOSTTOOLS_DIR'))):
242 ¦ # Works with t setup_hosttools_dir(dest, toolsvar, d, fatal=True) re
243 ¦ setup_hosttools_dir(d.getVar('HOSTTOOLS_DIR'), 'HOSTTOOLS', d)
>>244 ¦ setup_hosttools_dir(d.getVar('HOSTTOOLS_DIR'), 'HOSTTOOLS_NONFATAL', d, fatal=False)