下载编译,官网 https://fuchsia.dev
$ curl -s "https://fuchsia.googlesource.com/fuchsia/+/master/scripts/bootstrap?format=TEXT" | base64 --decode | bash
$ export PATH="/home/fuchsia/.jiri_root/bin:$PATH"
$ fx set core.x64 --with //bundles:kitchen_sink
$ fx build
$ fx emu -N
// 模拟器运行起来后,可执行命令:
$ printf "1234" $ pwd $ ps $ date $ ls $ uname $ uname -srm $ locate
https://fuchsia.dev/fuchsia-src/getting_started
$ fx get-device-addr
====
遇到问题五(shasum命令问题):
$ fx qemu -N
"$errmsg" is not exported by the Digest::SHA module
Can't continue after import errors at /usr/local/bin/shasum line 21.
方案参考 https://command-not-found.com/shasum
$ sudo apt-get install libdigest-sha-perl
验证命令方式 $ shasum --help
====
遇到问题四(ubuntu18的KVM权限问题):
$ fx qemu -N
qemu-system-x86_64: failed to initialize KVM: Permission denied
方案参考 https://stackoverflow.com/questions/59131434/unable-to-start-fuchsia-on-emulator
$ sudo chmod 777 /dev/kvm
====
遇到问题三(运行虚拟机):
$ fx qemu
ERROR: Could not extend fvm, unable to stat fvm image
问题解决(原因是非英文系统会遇到):
方案参考 https://github.com/assusdan/fuchsia-patches 或 https://forum.fuchsia-china.com/t/fuchsia/754
用文本编辑器打开~/fuchsia/tools/devshell/lib/fvm.sh,将
stat_output=$(stat "${stat_flags[@]}" "${fvmraw}") 改为
stat_output=$(LC_ALL=C stat "${stat_flags[@]}" "${fvmraw}")
这是似乎是因为系统语言导致的相关问题。在
size="${BASH_REMATCH[1]}" 的后面下一行
echo $size
====
遇到问题二(权限问题):
ERROR: 'git clone --no-checkout https://chromium.googlesource.com/catapult /home/fuchsia/third_party/catap