Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

Table of Contents

Prepare Build Environment

...

To build dilos-illumos on DilOS you should follow the steps below.

title
Info

NOTE:

You need to upgrade DilOS. This step is required only once and should be made only in the global zone before preparing the build environment. You need to have 'sudo' permissions for your build user for DEB packages generation process. Please update the /etc/sudoers file with the correct info. Instructions are based on updates and sources tree tag with update from 'dilos-unstable'. Add the repository below to the top of the /etc/apt/sources.list file:

deb http://apt.dilos.org/dilos dilos2-unstable main

and issue the following commands:

sudo apt-get update && sudo

dilos

os-upgrade

You will be upgraded to new BE. Please reboot after successful upgrade.

It is not recommended to build DilOS in the global zone. It is suggested creating new zone for the building process. As an example refer to the following links for more details about zone and network configuration:

...

It is recommended to have at least 2G of RAM and 2G of swap. To update swap size, use the steps below in a global zone, don't forget to reboot to enable swap:

Add swap:
Code Block
languagebash
titleAdd swap:
$ sudo zfs set volsize=2g rpool/swap
$ sudo reboot

You can change the swap size on the fly. To do it do:codetitle

change the swap size on the fly
Code Block
$ /usr/sbin/swap -lh
swapfile             dev    swaplo   blocks     free
/dev/zvol/dsk/rpool/swap 129,3        4K    2,00G    2,00G
$ sudo swap -d /dev/zvol/dsk/rpool/swap
$ sudo zfs set volsize=4g rpool/swap
$ sudo swap -a /dev/zvol/dsk/rpool/swap
$ /usr/sbin/swap -lh
swapfile             dev    swaplo   blocks     free
/dev/zvol/dsk/rpool/swap 129,3        4K    4,00G    4,00G

All the commands below are executed in newly created zone (not global). The build process should be run in the newly created zone from the user with the sudo permissions (not root). Please note that the ). So, now while you are in the global zone check the id of yournonrootuser (like you did it for admin user when creating DPKG zone before).

Obtain non-root user id
Code Block
$ id yournonrootuser

uid=1000(admin) gid=10(staff) groups=10(staff)

All the commands below should be executed in the newly created zone (not global) - login to the zone with root account.

Info

Note : The NOPASSWD option should be added to

...

your build user in the /etc/sudoers file.

Create a build user:
Code Block
language
titleUpdate permission for build user:
bash
# useradd -u uidfromglobalzone -g staff -d /export/home/yournonrootuser -s /bin/bash yournonrootuser
# passwd yournonrootuser
# echo "yournonrootuser ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/yournonrootuser
# /system/bin/usermod -P 'Primary Administrator' yournonrootuser

After this you can re-login to the zone under this build user account and continue to do the following steps.

Install packages:
Code Block
languagebash
titleInstall packages:
$ sudo apt-get install git ca-certificates
$ sudo update-ca-certificates -d # need it for first time

Prepare dilos-userland-gate clone: 

Info
title

INFO

For clone dilos-illumos you have to create account on BitBucket and send it by BitBucket mail form to account 'dilos' - I'll add you to repo

Code Block
$ git clone -b int2dilos2 https://bitbucket.org/dilos/dilos-illumos.git my-dilos-illumos
Install build dependencies:
Code Block
languagebash
titleInstall build dependencies:
$ cd <mymy-dilos-illumos>illumos
$ tools/bld_pkgs.sh
Download and unpack closed binaries
Code Block
title
languagebashDownload and unpack closed binaries
$ cd my-dilos-illumos
$ sudo apt-get install wget
$ wget -c \
  https://download.joyent.com/pub/build/illumos/on-closed-bins.i386.tar.bz2 \
  https://download.joyent.com/pub/build/illumos/on-closed-bins-nd.i386.tar.bz2
$ tar xjvpf on-closed-bins.i386.tar.bz2
$ tar xjvpf on-closed-bins-nd.i386.tar.bz2

Prepare illumos.sh

...

Copy original illumos.sh:
Code Block
languagebash
$ cp usr/src/tools/env/illumos.sh .

The settings we are going to focus on for now are the following:

  • CODEMGR_WS - This should be the root of the directory with the code. If you followed the previous example, it will be /<your directory>/my-dilos-illumos.

  • STAFFER - Change this to the name of the non-privileged user you use on the system.

  • VERSION - Set this to illumos-gate or whatever version string you want for the build.

  • CLONE_

    WS 

    WS - is the workspace nightly should do a bringover from. You can update it to:

     export

     export CLONE_WS='https://bitbucket.org/dilos/dilos-illumos-gate'. This variable need for 'webrev' tool.

  • ON_CLOSED_BINS - tools folder. You should set it to the folder name, where your tar files have been unpacked to on the previous step. Here it would be export ON_CLOSED_BINS="/<your directory>/my-dilos-illumos/closed".

For GCC build only you have to add to your illumos.sh:

...

These variables are needed for the verstion version identification and the DEB packages tools:

Code Block
languagebash
export GATE='2.0.2.40-dbg'							# it is variable will be updated on loading kernel screen.
export BLD_REVISION=$(git log -1 --pretty=format:%h)
export DEB_VERSION="2.0.2.40-1"					# DEB packages version, must be incremented for correct upgrade
export DEB_MAINTAINER="Igor Kozhukhov <ikozhukhov@gmail.com>"	# you can use your name here
export DPKG_BUILD_FLAGS="-b -d -uc"				# flags for dpkg-buildpackage. You can provide your flags.
Note
title

Note:

Version

in

DEB_VERSION

must

be

higher

then

current

installed

version

of

package

'libc-dev'

Check

your

version

of

libc

using

:

dpkg

-l

|

grep

libc

Example:

If

you

have

installed

libc-2.0.2.7

for

your

build

you

can

use: 

DEB_VERSION="2.0.2.7-2"

or

DEB_VERSION="2.0.2.8"

or

another

higher

version

Prepare build tools:
Code Block
languagebash
titlePrepare build tools:
$ ln -s usr/src/tools/scripts/bldenv .
$ ksh93 bldenv -d illumos.sh -c "cd usr/src && dmake setup"	# -d - if you use DEBUG build. You have to remove it for non-DEBUG build
# on SPARC:
$ sudo rm -rf /opt/onbld && sudo cp -ax usr/src/tools/proto/root_sparc-nd/opt/onbld /opt/
# Or on Intel:
$ sudo rm -rf /opt/onbld && sudo cp -ax usr/src/tools/proto/root_i386-nd/opt/onbld /opt/

Start Build

title
Info

INFO

Will be better to start build process on 'screen' terminal. You can install it by command: (

$ sudo apt-get install screen)

If you modified profile to "Primary administrator" by usermod, you need to relogin re-login to the build zone (or via ssh)

...

Code Block
languagebash
$ cat /etc/apt/sources.list
# Main repository sources
deb [trusted=yes] file:///export/home/admin/my-dilos-illumos/packages/i386/apt unstable main
deb http://apt.dilos.org/dilos dilos-testing main contrib non-free

Issue an "apt-get update" command to check get new deb packets information. Check that there are no issues with new repo. Note that it is ok OK to get the warning message below:

...

Code Block
languagebash
$ sudo os-upgrade
...
upgrade done

Updating bootarchive ...
Activating 'dilos_<version>' ...

Now you can reboot to new 'dilos_<version>'.

Update Using onu-deb ( unsupported, but can be updated by others and contributed )

Note that in this case the developer-build-onbld-deb packet should be installed on system:

Code Block
languagebash
$ sudo apt-get install developer-build-onbld-deb # if you want to use onu-deb

Install new DEB packages to newBE by using onu-deb:

Code Block
languagebash
$ /opt/onbld/bin/onu-deb -t nightly-`date +%Y-%m-%d` -d $PWD/packages/i386/apt

...