Merge "Modified the steps for the build guide"

This commit is contained in:
Zuul 2020-05-14 00:36:38 +00:00 committed by Gerrit Code Review
commit 8bfe26449b

View File

@ -3,7 +3,7 @@ StarlingX Build Guide
===================== =====================
This section describes the steps for building an ISO image from a StarlingX This section describes the steps for building an ISO image from a StarlingX
release. R3.0 and earlier release.
.. contents:: .. contents::
:local: :local:
@ -121,17 +121,6 @@ Then upload your public key to your GitHub and Gerrit account profiles:
* `Upload to Gerrit <https://review.opendev.org/#/settings/ssh-keys>`__ * `Upload to Gerrit <https://review.opendev.org/#/settings/ssh-keys>`__
****************************
Create a workspace directory
****************************
Create a *starlingx* workspace directory on your system. Best practices dictate
creating the workspace directory in your $HOME directory:
::
mkdir -p $HOME/starlingx/
********************* *********************
Install tools project Install tools project
********************* *********************
@ -166,8 +155,9 @@ You can customize values for the StarlingX base Docker image using a
text-based configuration file named ``localrc``: text-based configuration file named ``localrc``:
* ``HOST_PREFIX`` points to the directory that hosts the 'designer' * ``HOST_PREFIX`` points to the directory that hosts the 'designer'
subdirectory for source code, the 'loadbuild' subdirectory for subdirectory for source code, the 'loadbuild' subdirectory for the build
the build environment, generated RPMs, and the ISO image. environment, generated RPMs, and the ISO image. Best practices dictate
creating the workspace directory in your $HOME directory.
* ``HOST_MIRROR_DIR`` points to the directory that hosts the CentOS mirror * ``HOST_MIRROR_DIR`` points to the directory that hosts the CentOS mirror
repository. repository.
@ -175,17 +165,16 @@ text-based configuration file named ``localrc``:
localrc configuration file localrc configuration file
^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
Create your ``localrc`` configuration file. Make sure PROJECT and LAYER should Create your ``localrc`` configuration file. Make sure to set the project and
be set to compiler/distro/flock. For example: the user name. For example:
:: ::
# tbuilder localrc # tbuilder localrc
MYUNAME=<your user name> MYUNAME=<your user name>
PROJECT=<layer> PROJECT=<project name>
HOST_PREFIX=$HOME/starlingx/workspace HOST_PREFIX=$HOME/starlingx/workspace
HOST_MIRROR_DIR=$HOME/starlingx/mirror HOST_MIRROR_DIR=$HOME/starlingx/mirror
LAYER=<layer>
*************************** ***************************
Build the base Docker image Build the base Docker image
@ -219,138 +208,16 @@ The creation of the StarlingX ISO relies on a repository of RPM binaries,
RPM sources, and tar compressed files. This section describes how to build RPM sources, and tar compressed files. This section describes how to build
this CentOS mirror repository. this CentOS mirror repository.
*******************************
Run repository Docker container
*******************************
Run the following commands under a terminal identified as "**One**":
#. Navigate to the *$HOME/tools/centos-mirror-tool* project
directory:
::
cd $HOME/tools/centos-mirror-tools/
#. Launch the Docker container using the previously created base Docker image
*<repository>:<tag>*. As /localdisk is defined as the workdir of the
container, you should use the same folder name to define the volume.
The container starts to run and populate 'logs' and 'output' folders in
this directory. The container runs from the same directory in which the
scripts are stored.
::
docker run -it --volume $(pwd):/localdisk local/$USER-stx-builder:7.4 bash
*****************
Download packages
*****************
#. Inside the Docker container, enter the following commands to download
the required packages to populate the CentOS mirror repository:
::
cd localdisk && bash download_mirror.sh
#. Monitor the download of packages until it is complete. When the download
is complete, the following message appears:
::
totally 17 files are downloaded!
step #3: done successfully
IMPORTANT: The following 3 files are just bootstrap versions. Based on them, the workable images
for StarlingX could be generated by running "update-pxe-network-installer" command after "build-iso"
- out/stx-r1/CentOS/pike/Binary/LiveOS/squashfs.img
- out/stx-r1/CentOS/pike/Binary/images/pxeboot/initrd.img
- out/stx-r1/CentOS/pike/Binary/images/pxeboot/vmlinuz
***************
Verify packages
***************
#. Verify no missing or failed packages exist:
::
cat logs/*_missing_*.log
cat logs/*_failmoved_*.log
#. In case missing or failed packages do exist, which is usually caused by
network instability (or timeout), you need to download the packages
manually.
Doing so assures you get all RPMs listed in
*rpms_3rdparties.lst*/*rpms_centos.lst*/*rpms_centos3rdparties.lst*.
******************
Packages structure
******************
The following is a general overview of the packages structure resulting
from downloading the packages:
::
/home/<user>/tools/centos-mirror-tools/output
└── stx-r1
└── CentOS
└── pike
├── Binary
│   ├── EFI
│   ├── images
│   ├── isolinux
│   ├── LiveOS
│   ├── noarch
│   └── x86_64
├── downloads
│   ├── integrity
│   └── puppet
└── Source
*******************************
Create CentOS mirror repository
*******************************
Outside your Repository Docker container, in another terminal identified
as "**Two**", run the following commands:
#. From terminal identified as "**Two**", create a *mirror/CentOS*
directory under your *starlingx* workspace directory:
::
mkdir -p $HOME/starlingx/mirror/CentOS/
#. Copy the built CentOS mirror repository built under
*$HOME/tools/centos-mirror-tool* to the *$HOME/starlingx/mirror/*
workspace directory:
::
cp -r $HOME/tools/centos-mirror-tools/output/stx-r1/ $HOME/starlingx/mirror/CentOS/
-------------------------
Create StarlingX packages
-------------------------
***************************** *****************************
Run building Docker container Run building Docker container
***************************** *****************************
#. From the terminal identified as "**Two**", create the workspace folder: #. Navigate to the *$HOME/tools/* project
directory:
:: ::
mkdir -p $HOME/starlingx/workspace cd $HOME/tools/
#. Navigate to the *$HOME/tools* project directory:
::
cd $HOME/tools
#. Verify environment variables: #. Verify environment variables:
@ -364,7 +231,7 @@ Run building Docker container
bash tb.sh run bash tb.sh run
#. Execute the buiding Docker container: #. Execute the building Docker container:
:: ::
@ -374,8 +241,7 @@ Run building Docker container
Download source code repositories Download source code repositories
********************************* *********************************
#. From the terminal identified as "**Two**", which is now inside the #. Inside the building Docker container, start the internal environment:
building Docker container, start the internal environment:
:: ::
@ -405,6 +271,117 @@ Download source code repositories
repo sync -j`nproc` repo sync -j`nproc`
*****************
Download packages
*****************
#. Inside the Docker container, enter the following commands to download
the required packages to populate the CentOS mirror repository:
::
cd $MY_REPO_ROOT_DIR/stx-tools/centos-mirror-tools && bash download_mirror.sh
#. Monitor the download of packages until it is complete. When the download
is complete, the following message appears:
::
step #5: done successfully
sudo rm -rf /tmp/stx_mirror_vyPozw
IMPORTANT: The following 3 files are just bootstrap versions. Based on them, the workable images
for StarlingX could be generated by running "update-pxe-network-installer" command after "build-iso"
- ./output/stx-r1/CentOS/pike/Binary/LiveOS/squashfs.img
- ./output/stx-r1/CentOS/pike/Binary/images/pxeboot/initrd.img
- ./output/stx-r1/CentOS/pike/Binary/images/pxeboot/vmlinuz totally 17 files are downloaded!
***************
Verify packages
***************
#. Verify no missing or failed packages exist:
::
cat logs/*_missing_*.log
cat logs/*_failmoved_*.log
#. In case missing or failed packages do exist, which is usually caused by
network instability (or timeout), you need to download the packages
manually.
Doing so assures you get all RPMs listed in
*rpms_3rdparties.lst*/*rpms_centos.lst*/*rpms_centos3rdparties.lst*.
******************
Packages structure
******************
The following is a general overview of the packages structure resulting from
downloading the packages:
::
/localdisk/designer/<user>/<project>/stx-tools/centos-mirror-tools/output
└── stx-r1
└── CentOS
└── pike
├── Binary
│   ├── EFI
│   │   └── BOOT
│   │   └── fonts
│   ├── images
│   │   └── pxeboot
│   ├── isolinux
│   ├── LiveOS
│   ├── noarch
│   └── x86_64
├── downloads
│   ├── integrity
│   │   ├── evm
│   │   └── ima
│   └── puppet
│   └── packstack
│   └── puppet
│   └── modules
├── layer_build_info
├── layer_image_inc
├── layer_pkg_lists
├── layer_wheels_inc
└── Source
*******************************
Copy CentOS mirror repository
*******************************
Exit from the building Docker container. Run the following commands:
#. Navigate to CentOS mirror directory *mirror/CentOS* under your *starlingx*
workspace directory:
::
cd $HOME/starlingx/mirror/CentOS/
#. Copy the built CentOS mirror repository *$HOME/starlingx/mirror/*
workspace directory:
::
cp -r $HOME/starlingx/workspace/localdisk/designer/<user>/<project>/stx-tools/centos-mirror-tools/output/stx-r1 .
-------------------------
Create StarlingX packages
-------------------------
#. Login to the container using the command below:
::
cd $HOME/tools/
./tb.sh exec
#. Create a tarballs repository: #. Create a tarballs repository:
:: ::
@ -420,7 +397,7 @@ Download source code repositories
Outside the container Outside the container
#. From another terminal identified as "**Three**", create mirror binaries: #. Exit from the container. On the host machine, create mirror binaries:
:: ::
@ -433,8 +410,12 @@ Download source code repositories
Build packages Build packages
************** **************
#. Go back to the terminal identified as "**Two**", which is the building #. Enter the StarlingX container using below command:
Docker container.
::
cd $HOME/tools/
./tb.sh exec
#. **Temporal!** Build-Pkgs Errors. Be prepared to have some missing / #. **Temporal!** Build-Pkgs Errors. Be prepared to have some missing /
corrupted rpm and tarball packages generated during corrupted rpm and tarball packages generated during
@ -446,7 +427,8 @@ Build packages
:: ::
generate-cgcs-centos-repo.sh /import/mirrors/CentOS/stx-r1/CentOS/pike/ cd $MY_REPO_ROOT_DIR/stx-tools/toCOPY
bash generate-cgcs-centos-repo.sh /import/mirrors/CentOS/stx-r1/CentOS/pike/
#. Build the packages: #. Build the packages: