Fuchsia 系统基础构建

/ 默认分类 / 没有评论 / 728浏览

设置FX

	source scripts/fx-env.sh

//命令脚本详情

	# In your fuchsia checkout:
	$ cd fuchsia
	# Add a configuration to your shell to include fx-env.sh
	$ echo "source "$PWD/scripts/fx-env.sh"" >> "$HOME/.$(basename 	"$SHELL")rc"
	# If you would like additional convenience tools from the Fuchsia scripts, also
	# optionally run the following:
	$ echo "fx-update-path" >> "$HOME/.$(basename "$SHELL")rc"
	# Restart your shell
	$ exec "$SHELL"

日常开发常用工具指令

	fx set 配置构建
	fx build 执行构建
	fx flash; --- fx mkzedboot 闪现目标;或准备一个zedboot USB密钥
	fx serve 服务建设
	fx update 更新目标
	fx test 执行测试
	fx shell 连接到目标外壳
	和其他许多小任务
	fx syslog 从低级和高级程序捕获所有日志
	fx log仅捕获称为“ klog”的低级日志流
	复制文件:
	fx cp提供一个基本的包装scp,类似于fx shell包装ssh。
	# copy ./book.txt from the host, to /tmp/book.txt on the target
	$ fx cp book.txt /tmp/book.txt
	# copy /tmp/poem.txt on the target to poem.txt on the host
	$ fx cp --to-host /tmp/poem.txt poem.txt

获取支持的板子

	fx list-boards 列出可用的板子

在Android模拟器上运行fuchsia图形界面系统

linkx 关键步骤:

执行一下命令

	git fetch "https://fuchsia.googlesource.com/fuchsia" refs/changes/50/251950/12 && git cherry-pick FETCH_HEAD

	git fetch "https://fuchsia.googlesource.com/fuchsia" refs/changes/68/253068/37 && git cherry-pick FETCH_HEAD

	git fetch "https://fuchsia.googlesource.com/fuchsia" refs/changes/77/255277/30 && git cherry-pick FETCH_HEAD

	git fetch "https://fuchsia.googlesource.com/fuchsia" refs/changes/88/275588/10 && git cherry-pick FETCH_HEAD

如果一切都很好地融合在一起,那么您就可以继续下一步了 为了使其正常工作,我们需要克隆一小部分AOSP,因此运行:

	git clone https://android.googlesource.com/device/generic/goldfish-opengl third_party/aosp/device/generic/goldfish-opengl
	cd third_party/aosp/device/generic/goldfish-opengl/
	git checkout --track remotes/origin/emu-29.0-release
	cd ../../../../..

开始构建:

	fx set workstation.x64
	fx build

运行到Android 模拟器中 这需要添加模拟器支持

	echo 'Vulkan = on' >> ~/.android/advancedFeatures.ini
	echo 'GLDirectMem = on' >> ~/.android/advancedFeatures.ini

运行图形界面 fx aemu

故障排除 如果出现黑屏,而不是正常运行的模拟器,请确保以下内容:

Vulkan已正确设置并启用 如果使用NVIDIA GPU,请尝试切换到390驱动程序 如果您在构建时遇到错误,而该错误与我们克隆的goldfish-opengl存储库中的文件中缺少换行符有关,请在该存储库文件的第-Wno-newline-eof84至85行之间添加内容BUILD.gn,以使生成的cflags_cc定义如下所示:

			  cflags_cc = [
  				 "-Wno-unused-function",
  				 "-Wno-unused-variable",
    			"-Wno-missing-field-initializers",
   				 "-Wno-newline-eof",
  				]

然后再次开始构建过程