编译Magenta

    xiaoxiao2026-03-02  7

    参考文档地址

    https://github.com/fuchsia-mirror/magenta/blob/master/docs/getting_started.md

    编译环境选择Ubuntu14.04

    sudo apt-get update

    sudo apt-get upgrade

    安装必要的工具

    sudo apt-get install texinfo libglib2.0-dev autoconf libtool libsdl-dev build-essential

    sudo apt-get install git

    建立一个代码的根目录使用$SRC代指

    进入$SRC目录

    下载代码

    git clone https://fuchsia.googlesource.com/magenta

    或者git clone https://github.com/fuchsia-mirror/magenta.git

    进入magenta目录

    执行脚本./scripts/download-toolchain下载google编好的工具链

    下载需要保持网络畅通

    Downloading https://fuchsia-build.storage.googleapis.com/magenta/toolchain/arm-eabi/Linux-x86_64/5547f5aaa23715f81e0d27d49cb56d03957695fc % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 41.6M 100 41.6M 0 0 240k 0 0:02:57 0:02:57 --:--:-- 324k Unpacking /home/jiang/fuchsia/magenta/prebuilt/downloads/arm-eabi-Linux-x86_64.tar.bz2 Downloading https://fuchsia-build.storage.googleapis.com/magenta/toolchain/x86_64-elf/Linux-x86_64/5547f5aaa23715f81e0d27d49cb56d03957695fc % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 39.0M 100 39.0M 0 0 169k 0 0:03:56 0:03:56 --:--:-- 176k Unpacking /home/jiang/fuchsia/magenta/prebuilt/downloads/x86_64-elf-Linux-x86_64.tar.bz2 Downloading https://fuchsia-build.storage.googleapis.com/magenta/toolchain/aarch64-elf/Linux-x86_64/5547f5aaa23715f81e0d27d49cb56d03957695fc % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 36.8M 100 36.8M 0 0 279k 0 0:02:14 0:02:14 --:--:-- 372k Unpacking /home/jiang/fuchsia/magenta/prebuilt/downloads/aarch64-elf-Linux-x86_64.tar.bz2

    看下脚本的说明

    # This script is expected to be executed by Jiri as a runhook, or by individual # developers who want to grab the latest prebuilts. It takes no arguments, will # download the latest version of the Magenta toolchain, install it in the # prebuilt/downloads directory, and update prebuilt/config.mk with the toolchain # prefix (so you shouldn't have to set PATH or anything yourself). 工具链安装在prebuild/downloads/目录下面

    并且会配置在prebuilt/config.mk中

    在magenta目录下执行make命令

    编译的目标文件和镜像在build-magenta-pc-x86-64目录下

    ~/fuchsia/magenta/build-magenta-pc-x86-64$ ls app bootfs.img config-buildid.h config-kernel.h dev lib magenta.elf platform rodso-stamp target top ulib arch bootfs.manifest config-global.h config-user.h kernel magenta.bin magenta.elf-gdb.py rodso.ld system tools uapp utest

    转载请注明原文地址: https://ju.6miu.com/read-1307549.html
    最新回复(0)