diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2022-09-11 19:26:07 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-09-24 17:44:55 +0100 |
commit | 6bb49fe02f0feae0895c0abb0a78c0e18de9f16d (patch) | |
tree | 58ec1d9d90e158eb0bc2db2c1a836dab68aa11f4 /documentation/dev-manual/common-tasks.rst | |
parent | 4be1b2462146bf6c5c01f46dfaea460ef6bf71e8 (diff) | |
download | poky-6bb49fe02f0feae0895c0abb0a78c0e18de9f16d.tar.gz |
common-tasks.rst: describe the layer setup tooling
(From yocto-docs rev: 2b56daf38ea9049e6d98be338b95a191360c3b32)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/dev-manual/common-tasks.rst')
-rw-r--r-- | documentation/dev-manual/common-tasks.rst | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/documentation/dev-manual/common-tasks.rst b/documentation/dev-manual/common-tasks.rst index 55c6f412bc..ddf0fd5cdd 100644 --- a/documentation/dev-manual/common-tasks.rst +++ b/documentation/dev-manual/common-tasks.rst | |||
@@ -847,6 +847,62 @@ enables the build system to locate the layer during the build. | |||
847 | During a build, the OpenEmbedded build system looks in the layers | 847 | During a build, the OpenEmbedded build system looks in the layers |
848 | from the top of the list down to the bottom in that order. | 848 | from the top of the list down to the bottom in that order. |
849 | 849 | ||
850 | Saving and restoring the layers setup | ||
851 | ------------------------------------- | ||
852 | |||
853 | Once you have a working build with the correct set of layers, it is beneficial | ||
854 | to capture the layer setup --- what they are, which repositories they come from | ||
855 | and which SCM revisions they're at --- into a configuration file, so that this | ||
856 | setup can be easily replicated later, perhaps on a different machine. Here's | ||
857 | how to do this:: | ||
858 | |||
859 | $ bitbake-layers create-layers-setup /srv/work/alex/meta-alex/ | ||
860 | NOTE: Starting bitbake server... | ||
861 | NOTE: Created /srv/work/alex/meta-alex/setup-layers.json | ||
862 | NOTE: Created /srv/work/alex/meta-alex/setup-layers | ||
863 | |||
864 | The tool needs a single argument which tells where to place the output, consisting | ||
865 | of a json formatted layer configuration, and a ``setup-layers`` script that can use that configuration | ||
866 | to restore the layers in a different location, or on a different host machine. The argument | ||
867 | can point to a custom layer (which is then deemed a "bootstrap" layer that needs to be | ||
868 | checked out first), or into a completely independent location. | ||
869 | |||
870 | The replication of the layers is performed by running the ``setup-layers`` script provided | ||
871 | above: | ||
872 | |||
873 | 1. Clone the bootstrap layer or some other repository to obtain | ||
874 | the json config and the setup script that can use it. | ||
875 | |||
876 | 2. Run the script directly with no options:: | ||
877 | |||
878 | alex@Zen2:/srv/work/alex/my-build$ meta-alex/setup-layers | ||
879 | Note: not checking out source meta-alex, use --force-bootstraplayer-checkout to override. | ||
880 | |||
881 | Setting up source meta-intel, revision 15.0-hardknott-3.3-310-g0a96edae, branch master | ||
882 | Running 'git init -q /srv/work/alex/my-build/meta-intel' | ||
883 | Running 'git remote remove origin > /dev/null 2>&1; git remote add origin git://git.yoctoproject.org/meta-intel' in /srv/work/alex/my-build/meta-intel | ||
884 | Running 'git fetch -q origin || true' in /srv/work/alex/my-build/meta-intel | ||
885 | Running 'git checkout -q 0a96edae609a3f48befac36af82cf1eed6786b4a' in /srv/work/alex/my-build/meta-intel | ||
886 | |||
887 | Setting up source poky, revision 4.1_M1-372-g55483d28f2, branch akanavin/setup-layers | ||
888 | Running 'git init -q /srv/work/alex/my-build/poky' | ||
889 | Running 'git remote remove origin > /dev/null 2>&1; git remote add origin git://git.yoctoproject.org/poky' in /srv/work/alex/my-build/poky | ||
890 | Running 'git fetch -q origin || true' in /srv/work/alex/my-build/poky | ||
891 | Running 'git remote remove poky-contrib > /dev/null 2>&1; git remote add poky-contrib ssh://git@push.yoctoproject.org/poky-contrib' in /srv/work/alex/my-build/poky | ||
892 | Running 'git fetch -q poky-contrib || true' in /srv/work/alex/my-build/poky | ||
893 | Running 'git checkout -q 11db0390b02acac1324e0f827beb0e2e3d0d1d63' in /srv/work/alex/my-build/poky | ||
894 | |||
895 | .. note:: | ||
896 | This will work to update an existing checkout as well. | ||
897 | |||
898 | .. note:: | ||
899 | The script is self-sufficient and requires only python3 | ||
900 | and git on the build machine. | ||
901 | |||
902 | .. note:: | ||
903 | Both the ``create-layers-setup`` and the ``setup-layers`` provided several additional options | ||
904 | that customize their behavior - you are welcome to study them via ``--help`` command line parameter. | ||
905 | |||
850 | Customizing Images | 906 | Customizing Images |
851 | ================== | 907 | ================== |
852 | 908 | ||