yoctopetalinux

How to setup a machine as a mirror server for Yocto when fetching packages?


When building a project with Petalinux (a type of Yocto), it needs Internet for fetching packages from server (git serve or others).

My working machine does not have permission for accessing Internet (just only have LAN), so I have a plan to set up a machine in this LAN that can access to Internet to become a mirror server for Yocto.

Does anyone have any idea for setting up a server like this? Please help.


Solution

  • You can check the following pages to setup a source mirror:

    Basically, you launch a build on source mirror machine with those options:

     SOURCE_MIRROR_URL ?= "file:///source_mirror/sources/"
     INHERIT += "own-mirrors" 
     BB_GENERATE_MIRROR_TARBALLS = "1" 
    

    You can only fetch source with following command: bitbake -c target runall="fetch". Then you launch an ftp server that serves ./source_mirror/sources/ folder on http://example.com/my-source-mirror.

    Then on offline machine, you set

     INHERIT += "own-mirrors"
     SOURCE_MIRROR_URL = "http://example.com/my-source-mirror"
     BB_NO_NETWORK = "1" # or BB_FETCH_PREMIRRORONLY = "1"
    

    If you have access to a proxy you can check those: