...
...
Table of Contents |
---|
Prepare Build Environment
...
To build dilos-illumos on DilOS you should follow the steps below.
Info | |
---|---|
title | 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:
and issue the following commands:
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 | ||||
---|---|---|---|---|
| ||||
$ $ sudo zfs set volsize=2g rpool/swap $ sudo reboot |
You can change the swap size on the fly. To do it do:
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=2g4g rpool/swap $ sudo reboot |
...
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 |
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 | ||
---|---|---|
| ||
| ||
| ||
# 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 | ||||
---|---|---|---|---|
| ||||
$ sudo apt-get install git ca-certificates
$ sudo update-ca-certificates -d # need it for first time
|
Prepare dilos-userland-gate clone:
Info |
---|
INFOFor 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 | ||||
---|---|---|---|---|
| ||||
$ cd <mymy-dilos-illumos>illumos $ tools/bld_pkgs.sh |
Download and unpack closed binaries
Code Block | ||||
---|---|---|---|---|
| ||||
$ 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 | ||
---|---|---|
| ||
$ 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_
WSWS - is the workspace nightly should do a bringover from. You can update it to:
exportexport 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 | ||
---|---|---|
| ||
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 |
---|
Note:Version in DEB_VERSION must be higher then current installed version of package 'libc-dev' Check your version of libc using :
Example: If you have installed libc-2.0.2.7 for your build you can use:
or
or another higher version |
Prepare build tools:
Code Block | ||||
---|---|---|---|---|
| ||||
$ 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
Info | |
---|---|
title | INFOWill be better to start build process on 'screen' terminal. You can install it by command: (
If you modified profile to "Primary administrator" by |
...
Code Block | ||
---|---|---|
| ||
$ 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 | ||
---|---|---|
| ||
$ 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 | ||
---|---|---|
| ||
$ 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 | ||
---|---|---|
| ||
$ /opt/onbld/bin/onu-deb -t nightly-`date +%Y-%m-%d` -d $PWD/packages/i386/apt |
...