PetaLinux Offline Compilation (downloads and sstate-cache)

Offline compilation can be enabled by defining local directories for downloads and sstate when configuring a PetaLinux project. It can also be done by configuring PetaLinux installation so that new projects are created with offline compilation enabled by default.

The introduced methodology applies to other architectures as well. The locations of the files may differ depending how you install PetaLinux.

1. downloads

Suppose downloads folder is located in $PETALINUX/downloads.

For Zynq, edit $PETALINUX/etc/template/project/template-zynq/project-spec/configs/config
For ZynqMP, edit $PETALINUX/etc/template/project/template-zynqMP/project-spec/configs/config:

CONFIG_PRE_MIRROR_URL="file://$PETALINUX/downloads"

2. sstate-cache

Suppose sstate folder is located in $PETALINUX/tool/sstate

  • Preferred method

    • For Zynq: edit $PETALINUX/etc/template/project/template-zynq/project-spec/configs/config

      CONFIG_YOCTO_NETWORK_SSTATE_FEEDS_URL="file://$PETALINUX/tool/sstate/arm"
      
    • For ZynqMP: edit $PETALINUX/etc/template/project/template-zynqMP/project-spec/configs/config

      CONFIG_YOCTO_NETWORK_SSTATE_FEEDS_URL="file://$PETALINUX/tool/sstate/aarch64"
      
  • Non-preferred method

    Need to change definition when switching between architectures.

    In $PETALINUX/components/misc/config/Kconfig.part:

    config YOCTO_LOCAL_SSTATE_FEEDS_URL
        string "local sstate feeds url"
    
        # for zynq
        default "$PETALINUX/sstate/arm/"
    
        # for zynqMP
        default "$PETALINUX/sstate/aarch64/"
        ...
    ...
    config YOCTO_BB_NO_NETWORK
        bool "Enable BB NO NETWORK"
        default y
        ...
    

Reference:

  • Xilinx Yocto Builds without an Internet Connection

你可能感兴趣的:(PetaLinux Offline Compilation (downloads and sstate-cache))