|Linux| How to build library in chromium OS ?

Official document:
https://chromium.googlesource.com/chromiumos/docs/+/master/developer_guide.md

Fetch code from Google
$ repo init -u https://chromium.googlesource.com/chromiumos/manifest.git –repo-url https://chromium.googlesource.com/external/repo.git -b stable

  1. If you want to clone single library, using
    $ repo sync “src/third_party/libqmi”

    If you want to fetch all libraries, using
    $ repo sync -c
  2. Enter the root of sdk
    $ cd chromite/bin
  3. Enable virtual machine environment
    $ ./cros_sdk

    /***
    cros_sdk:make_chroot: All set up. To enter the chroot, run:
    $ cros_sdk –enter

    CAUTION: Do NOT rm -rf the chroot directory; if there are stale bind
    mounts you may end up deleting your source tree too. To unmount and
    delete the chroot cleanly, use:
    $ cros_sdk –delete
    ***/
  4. Configure cross compiler toolchain
    $ setup_board –board=arm64-generic

    if you want to build kernel, set your password.
    // ./set_shared_user_password.sh

    Check libraries
    // cros_workon –board=arm64-generic –all list
  5. Fetch toolchain
    ./build_packages –board=arm64-generic

    Some configurations.
    // update_chroot –toolchain_boards arm64-generic –usepkg
    //loman add –workon chromiumos/third_party/libqmi
    //cros_workon –board=arm64-generic start libqmi
    //cros_workon_make –board=arm64-generic libqmi

  6. Start to build pre-build libraries and your target.
    // https://chromium.googlesource.com/chromiumos/docs/+/master/portage/ebuild_faq.md#How-does-the-cross-compiling-setup-work

    $ emerge-arm64-generic libqmi