How to make local build DU4 on VM environment

Actions

  1. Create and update the new VM

  2. Prepare environment for creating new zones

  3. Prepare script to get dependencies for components

  4. Create a zone for local repository

  5. Add packages and source files to the local repository

  1. Create the new zone for components building

  2. Build components

1. Create and update the new VM

To create the new VM in vSphere SPB-LABS execute please steps 1-5 from this instruction.

2. Login with root account and prepare environment for zones creation

  1. Create the mountpoint for zones mounting:

root@dilos:~# zfs create -o mountpoint=/zones rpool/zones root@dilos:~# mkdir /export/builds

Update the /etc/apt/sources.list file:

cat > /etc/apt/sources.list <<EOT deb http://10.20.50.188/dilos4 du4-unstable main contrib non-free deb http://10.20.50.188/dilos dg2-unstable main contrib non-free deb-src http://10.20.50.188/dilos4 du4-unstable main contrib non-free EOT apt-get update

2. Add the admin user:

root@dilos:~# useradd -m -g staff admin root@dilos:~# passwd admin Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully root@dilos:~# echo "admin ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers.d/admin

3. Execute Instruction for NET configuration till the step of zone01 creation.

4. To automate zone creation you can copy this script to create_zone.sh file or execute the following command:

Make it executable:

 

Now you will be able to run it with the format of ./create_zone.sh <zone-name> <zone-ip-domain> <zone-ip-node> , for example!:

./create_zone.sh zone02 192.168.0 3

3. Prepare script to get dependencies for components.

Create a folder for the local repository and enter it:

To make the following script workable you have to create the list_component file with a content from here.

Create here a script to obtain dependencies and repository creation. To do this copy please this script to the file, let say, make_repo.sh or execute the following command:

Make this file executable:

If you have to get the error log then put the log name to the string LOG_FILE="" , for example:

4. Create a zone for the local repository

Create the new zone and enter it:

All the following commands are executed in the zonerepo.

Install packets required for working in the zone:

Create a folder for repository configuration files:

and create the repository configuration:

5. Add packages and source files to the local repository

Creating of the local repository can take a long time. So, you can run it with the screen utility.

If you are connected by SSH and would like to turn off SSH session or even temporary turn off your computer, then you have enter the following command for tests running:

Then you can in any time press Ctrl-A d and after that close your SSH session.

When you would like to get back, login again to SSH please and enter the command:

6. Create the new zone for components building

Create the new zone and enter it:

All the following commands are executed in the zonebld.

Prepare the zone for components building. To do this please copy this script to, let say, the prepare.sh file or execute the following command:

Make it executable and run:

7. Build components

Copy this script to, for example, thebuild_all.sh file or execute the following command:

If you’d like stop process on the first error, put 1 the STOP_ON_ERROR variable STOP_ON_ERROR=1. In other case it will build all components one-by-one regardless of errors. And in every component folder theberror.log file will be created, where build errors will be stored.

Make it executable and run:

The building process can take a long time. So, you can run it with the screen utility.

If you are connected by SSH and would like to turn off SSH session or even temporary turn off your computer, then you have enter the following command for tests running:

Then you can in any time press Ctrl-A d and after that close your SSH session.

When you would like to get back, login again to SSH please and enter the command:

If you run all components building, then you can check what components were failed with the following commands:

After the build you an check the components installation by creating the new zone.