Modified the steps for the build guide
1.Changes were made keeping in mind to make use of automation in the script tb.sh. 2.The changes made is easily be applied for layered build. 3.Removed layer env variable in localrc file as this guide is about monolithic build. 4.Added new folder structure for centOS mirror output folder 5.New changes doesn't require to maintain three terminals. Story: 2007580 Task: 39500 Change-Id: I76b915951cb6676da806ea0165d0ff51a1069209 Signed-off-by: Poornima <poornima.y.n@intel.com>
This commit is contained in:
parent
e426b7b316
commit
65f8a0abd1
@ -3,7 +3,7 @@ StarlingX Build Guide
|
||||
=====================
|
||||
|
||||
This section describes the steps for building an ISO image from a StarlingX
|
||||
release.
|
||||
R3.0 and earlier release.
|
||||
|
||||
.. contents::
|
||||
: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>`__
|
||||
|
||||
****************************
|
||||
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
|
||||
*********************
|
||||
@ -166,8 +155,9 @@ You can customize values for the StarlingX base Docker image using a
|
||||
text-based configuration file named ``localrc``:
|
||||
|
||||
* ``HOST_PREFIX`` points to the directory that hosts the 'designer'
|
||||
subdirectory for source code, the 'loadbuild' subdirectory for
|
||||
the build environment, generated RPMs, and the ISO image.
|
||||
subdirectory for source code, the 'loadbuild' subdirectory for the build
|
||||
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
|
||||
repository.
|
||||
|
||||
@ -175,17 +165,16 @@ text-based configuration file named ``localrc``:
|
||||
localrc configuration file
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Create your ``localrc`` configuration file. Make sure PROJECT and LAYER should
|
||||
be set to compiler/distro/flock. For example:
|
||||
Create your ``localrc`` configuration file. Make sure to set the project and
|
||||
the user name. For example:
|
||||
|
||||
::
|
||||
|
||||
# tbuilder localrc
|
||||
MYUNAME=<your user name>
|
||||
PROJECT=<layer>
|
||||
PROJECT=<project name>
|
||||
HOST_PREFIX=$HOME/starlingx/workspace
|
||||
HOST_MIRROR_DIR=$HOME/starlingx/mirror
|
||||
LAYER=<layer>
|
||||
|
||||
***************************
|
||||
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
|
||||
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
|
||||
*****************************
|
||||
|
||||
#. From the terminal identified as "**Two**", create the workspace folder:
|
||||
#. Navigate to the *$HOME/tools/* project
|
||||
directory:
|
||||
|
||||
::
|
||||
|
||||
mkdir -p $HOME/starlingx/workspace
|
||||
|
||||
#. Navigate to the *$HOME/tools* project directory:
|
||||
|
||||
::
|
||||
|
||||
cd $HOME/tools
|
||||
cd $HOME/tools/
|
||||
|
||||
#. Verify environment variables:
|
||||
|
||||
@ -364,7 +231,7 @@ Run building Docker container
|
||||
|
||||
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
|
||||
*********************************
|
||||
|
||||
#. From the terminal identified as "**Two**", which is now inside the
|
||||
building Docker container, start the internal environment:
|
||||
#. Inside the building Docker container, start the internal environment:
|
||||
|
||||
::
|
||||
|
||||
@ -405,6 +271,117 @@ Download source code repositories
|
||||
|
||||
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:
|
||||
|
||||
::
|
||||
@ -420,7 +397,7 @@ Download source code repositories
|
||||
|
||||
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
|
||||
**************
|
||||
|
||||
#. Go back to the terminal identified as "**Two**", which is the building
|
||||
Docker container.
|
||||
#. Enter the StarlingX container using below command:
|
||||
|
||||
::
|
||||
|
||||
cd $HOME/tools/
|
||||
./tb.sh exec
|
||||
|
||||
#. **Temporal!** Build-Pkgs Errors. Be prepared to have some missing /
|
||||
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:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user