Thu Oct 24 13:37:32 2019 UTC

"build-collection" command setup

Introduction

[Important] [Important] [Important] [Important] It's highly recommended to know NuTyX very well to succeed with this tutorial.
All the manipulations MUST BE done in the same SINGLE terminal. Do no use more then one terminal.

Each step

We will:

  1. get the tools
  2. put the user folders in place
  3. get all the recepts
  4. put the script folders in place
  5. get the binaries from the remote server
  6. set up the configuration files
  7. Launch the script

Setting up the tools (packages to install)

We assume that your NuTyX is clean from any devel package. We start to install all the utilities:

get rsync git

Configuration of the project (32 or 64 bits architecture)

The first variables we need to define are the project to use and the architecture definition (32 or 64 bits):

ARCH=`uname -m`
PROJECT=packages-$ARCH

Version to use

NuTyX packages are in 2 versions available. Once you decide on which version you want to work, make a copy/paste of the variables in the right colomn.

List of available versions, copy/paste the correct variables depending on your choice:
fixed
VERSION=fixed
rolling
VERSION=rolling

Available projets

Choose the collection and the project you're going to work with. Once you made your choice, copy/paste defined variables in the right colomn.

Available collections list per project, copy/paste the variables depending your choice:
base
COLLECTION=base
RSYNC=(base)
cli
COLLECTION=cli
RSYNC=(base cli)
gui
PROJECT=COLLECTION=gui
RSYNC=(base cli gui)
cli-extra
COLLECTION=cli-extra
RSYNC=(base cli)
gui-extra
COLLECTION=gui-extra
RSYNC=(base cli gui)
desktops
COLLECTION=desktops
RSYNC=(base cli gui desktops)

The git user folder in place

A build bot requires a lot of space.

At least 10 Gb of space is perfect.

All the folders needed are in:

/srv/www/
and
/home/$USER/git/$VERSION

All the receipts will be in our personnal folder.

We can now create the user git folder with our own account:

mkdir -pv /home/$USER/git/$VERSION
mkdir: created directory '/home/me/git'
mkdir: created directory '/home/me/git/rolling'

Get all the ports of the "$COLLECTION" from git location

We will synchronise the status of all the ports of the $COLLECTION for the compilation:

git clone -b $VERSION https://github.com/NuTyX/$PROJECT.git ~/git/$VERSION/$PROJECT

We now create all the folders needed for the script:

sudo mkdir -pv \
/srv/www/{logs/$ARCH/$VERSION,$ARCH/$VERSION/$COLLECTION,sources}

Get all the binaries define in the $RSYNC variable from the remote server

This command might take some time if your connection is not very fast.

[Note] You need to type this command every time you want to resync your local copy with the remote server.
for i in ${RSYNC[@]}
do
  sudo rsync -av --delete rsync://downloads.nutyx.org/nutyx/$ARCH/$VERSION/$i/ \
  /srv/www/$ARCH/$VERSION/$i/
done

The /etc/fstab configuration file

We need to adjust 1 existing file

sudo echo "
#    PROJECT $PROJECT
##   COLLECTION $COLLECTION
###  VERSION $VERSION
#### GIT
/home/$USER/git/$VERSION/$PROJECT \
/$VERSION/$COLLECTION/root/$PROJECT none noauto,bind" \
| sudo tee --append /etc/fstab

Finalisation and step to reproduce

You're now ready to work with the compilation script. The command below needs to be reproduce in three cases:

  • The first time.
  • When you did something wrong with your chroot and then with your own binaries.
  • When you want to come back on the official binaries from the server.
for i in ${RSYNC[@]}
do
  sudo rsync -av --delete rsync://downloads.nutyx.org/nutyx/$ARCH/$VERSION/$i/ \
  /srv/www/$ARCH/$VERSION/$i/
done

Let's go

If you have done all the steps correctly, you should be able to start the compilation of all the ports of the project $PROJECT.

build-collection /$VERSION/$COLLECTION -c
CHROOT: <your collection>
COLLECTION: <your collection>
VERSION: <your version>
The command: KERNEL=NONE LFS=/<your version>/<your collection> DEPOT=/DEPOT install-nutyx
DEVEL: cards.devel &&
cd /root/<your collection> &&
bash scripts/<your collection> -a &&
bash scripts/<your collection>-extra -a  OK ? (y)
y