L2 Cache

Behold the power of |!

User Tools

Site Tools


snipets:solaris:build-zone

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

snipets:solaris:build-zone [2014/10/01 02:37]
sjorge [testing the stuff]
snipets:solaris:build-zone [2014/10/09 22:02]
Line 1: Line 1:
-====== Build Zone for illumos-omnios ====== 
-Here are some quick and dirty notes to setup a build zone for illumos-omnios and illumos-gate. At the time of writing I was workin on OmniOS r151012. 
  
-:!: You will need to tweak some things along the way. 
- 
-===== zonecfg ===== 
-<code bash> 
-zonecfg -z leonov 
-# past zonecfg below 
-dladm create-vnic -l trunk0 -v 300 zleonov0 
-zfs create -o quota=80G core/​vms/​zones/​leonov ; chmod 0700 /​vms/​zones/​leonov ; zoneadm -z leonov install 
-</​code>​ 
- 
-I put some cpu capping in place, feel free to leave this out. If you do decide to use this make sure to install service/​resource-cap! 12000 = 12 cores, 1000 = 1 core. 
- 
-<code bash> 
-pkg install service/​resource-cap 
-svcadm enable svc:/​system/​rcap:​default 
-</​code>​ 
- 
-<code plain zonecfg> 
-create -b 
-set zonepath=/​vms/​zones/​leonov 
-set brand=ipkg 
-set autoboot=false 
-set limitpriv=default 
-set ip-type=exclusive 
-add net 
-set physical=zleonov0 
-end 
-add rctl 
-set name=zone.cpu-cap 
-add value (priv=privileged,​limit=1200,​action=deny) 
-end 
-</​code>​ 
- 
-Now configure the zone's network and create a user account. ​ 
- 
-===== packages ===== 
-Pull in all the required packages (thanks danmcd) 
- 
-<code bash> 
-pkg install -v --no-backup-be archiver/​gnu-tar developer/​astdev ​ developer/​build/​autoconf ​ developer/​build/​automake developer/​build/​onbld developer/​gcc44 developer/​gcc44/​libgmp-gcc44 developer/​gcc44/​libmpc-gcc44 developer/​gcc44/​libmpfr-gcc44 developer/​gnu-binutils developer/​lexer/​flex developer/​library/​lint developer/​macro/​cpp developer/​object-file developer/​parser/​bison developer/​sunstudio12.1 developer/​versioning/​git developer/​versioning/​mercurial library/​nspr/​header-nspr library/​perl-5/​xml-parser library/​python-2/​lxml-26 omniti/​developer/​versioning/​subversion omniti/​library/​apr omniti/​library/​apr-util omniti/​library/​uuid omniti/​library/​serf package/​pkg/​zones-proxy print/​lp/​print-client-commands runtime/​perl-64 service/​network/​smtp/​sendmail system/​header system/​install system/​library/​boot-management system/​library/​dbus system/​library/​install system/​library/​math/​header-math system/​library/​mozilla-nss/​header-nss 
-</​code>​ 
- 
-Add a symlink for SUNWspro 
-<code bash> 
-ln -sf /​opt/​sunstudio12.1 /​opt/​SUNWspro 
-</​code>​ 
- 
-Enable sendmail so you get local maildrop 
-<code bash> 
-svcadm enable svc:/​network/​smtp:​sendmail 
-</​code>​ 
-===== illumos-omnios environment ===== 
-:!: don't forget to set the correct the USER in the paths! 
- 
-<file bash /​export/​home/​USER/​illumos-omnios.env>​ 
-#       ​Configuration variables for the runtime environment of the nightly 
-# build script and other tools for construction and packaging of releases. 
-# This script is sourced by '​nightly'​ and '​bldenv'​ to set up the environment 
-# for the build. This example is suitable for building a gate, 
-# which will contain the resulting packages and archives (builds of the gate 
-# are done in children and then the resulting archives, packages, and proto 
-# area are put into the parent for everyone to use). It is based off 
-# the onnv release. It sets NIGHTLY_OPTIONS to make nightly do: 
-#       DEBUG and non-DEBUG builds (-D) 
-#       runs 'make check' (-C) 
-#       runs lint in usr/src (-l plus the LINTDIRS variable) 
-#       sends mail on completion (-m and the MAILTO variable) 
-#       Does NOT bringover (-n) 
-#       ​creates packages for PIT/RE (-p) 
-#       ​checks for changes in ELF runpaths (-r) 
-#       ​checks for changes in unreferenced files (-f) 
-# 
-NIGHTLY_OPTIONS="​-DClmnprf"; ​           export NIGHTLY_OPTIONS 
- 
-# This is a variable for the rest of the script - GATE doesn'​t matter to 
-# nightly itself 
-GATE=illumos-omnios; ​                           export GATE 
- 
-# CODEMGR_WS - where is your workspace at (or what should nightly name it) 
-# there is only one definition here, which assumes all the gate build machines 
-# (sparc and x86) are set up the same. But remember, this is a script, so 
-# you _could_ look at $MACH or `uname -n` and set these variables differently. 
-CODEMGR_WS="/​export/​home/​USER/​build/​$GATE"; ​  ​export CODEMGR_WS 
- 
-# PARENT_WS is used to determine the parent of this workspace. This is 
-# for the options that deal with the parent workspace (such as where the 
-# proto area will go). 
-# 
-# If you use this, it must be local (or nfs): nightly cannot copy 
-# over ssh or http. 
-PARENT_WS="/​export/​home/​USER/​build/​$GATE"; ​           export PARENT_WS 
- 
-# CLONE_WS is the workspace nightly should do a bringover from. 
-#​CLONE_WS="​ssh://​anonhg@onnv.sfbay.sun.com//​export/​onnv-clone";​ export CLONE_WS 
-CLONE_WS=$PARENT_WS; ​   export CLONE_WS 
- 
-# CLOSED_CLONE_WS is the workspace from which nightly will acquire the 
-# usr/closed tree. 
-# CLOSED_CLONE_WS="​${CLONE_WS}/​usr/​closed"​ 
-#export CLOSED_CLONE_WS 
- 
-# ON_CLOSED_BINS -> location of closed binaries. 
-ON_CLOSED_BINS="/​export/​home/​USER/​ws/​closed"; ​   export ON_CLOSED_BINS 
- 
-# The bringover, if any, is done as STAFFER. 
-# Set STAFFER to your own login as gatekeeper or integration engineer. 
-# The point is to use group "​staff"​ and avoid referencing the parent 
-# workspace as root. 
-# Some scripts optionally send mail messages to MAILTO. 
-# 
- 
-STAFFER=USER; ​                        ​export STAFFER 
-MAILTO=$STAFFER; ​                       export MAILTO 
- 
-# The project (see project(4)) under which to run this build. ​ If not 
-# specified, the build is simply run in a new task in the current project. 
-BUILD_PROJECT=; ​                        ​export BUILD_PROJECT 
- 
-# You should not need to change the next four lines 
-LOCKNAME="​`basename $CODEMGR_WS`_nightly.lock";​ export LOCKNAME 
-ATLOG="​$CODEMGR_WS/​log"; ​                       export ATLOG 
-LOGFILE="​$ATLOG/​nightly.log"; ​                  ​export LOGFILE 
-MACH=`uname -p`;                                export MACH 
- 
-# When the -A flag is specified, and ELF_DATA_BASELINE_DIR is defined, 
-# the ELF interface description file resulting from the build is compared 
-# to that from the specified directory. This ensures that our object 
-# versioning evolves in a backward compatible manner. 
-# 
-# You should not need to change this unless you wish to use locally cached 
-# baseline files. If you use this, it must be local (or nfs): nightly cannot 
-# copy over ssh or http. 
-# 
-#​ELF_DATA_BASELINE_DIR="/​ws/​onnv-gate/​usr/​src/​ELF-data-baseline.$MACH";​ export ELF_DATA_BASELINE_DIR 
- 
-# This is usually just needed if the closed tree is missing, or when 
-# building a project gate with the -O (cap oh) flag. 
-#​ON_CRYPTO_BINS="​$PARENT_WS/​packages/​$MACH/​on-crypto.$MACH.tar.bz2"​ 
-#export ON_CRYPTO_BINS 
- 
-# REF_PROTO_LIST - for comparing the list of stuff in your proto area 
-# with. Generally this should be left alone, since you want to see differences 
-# between todays build and yesterdays. 
-# 
-REF_PROTO_LIST=$PARENT_WS/​usr/​src/​proto_list_${MACH};​ export REF_PROTO_LIST 
- 
-# 
-#       build environment variables, including version info for mcs, motd, 
-# motd, uname and boot messages. Mostly you shouldn'​t change this except 
-# when the release slips (nah) or when starting a new release. 
-# 
-ROOT="​$CODEMGR_WS/​proto/​root_${MACH}"; ​ export ROOT 
-SRC="​$CODEMGR_WS/​usr/​src"; ​             export SRC 
-VERSION="​$GATE"; ​                       export VERSION 
- 
-# 
-# the RELEASE and RELEASE_DATE variables are set in Makefile.master;​ 
-# there might be special reasons to override them here, but that 
-# should not be the case in general 
-# 
-# RELEASE="​5.10.1"; ​                    ​export RELEASE 
-# RELEASE_DATE="​October 2007"; ​         export RELEASE_DATE 
- 
-# proto area in parent for optionally depositing a copy of headers and 
-# libraries corresponding to the protolibs target 
-# 
-PARENT_ROOT=$PARENT_WS/​proto/​root_$MACH;​ export PARENT_ROOT 
-PARENT_TOOLS_ROOT=$PARENT_WS/​usr/​src/​tools/​proto/​root_$MACH-nd;​ export PARENT_TOOLS_ROOT 
- 
-# 
-# Package creation variables. ​ You probably shouldn'​t change these, 
-# either. 
-# 
-# PKGARCHIVE determines where repositories will be created. 
-# 
-# PKGPUBLISHER* control the publisher settings for those repositories. 
-# 
-PKGARCHIVE="​${PARENT_WS}/​packages/​${MACH}/​nightly"; ​    ​export PKGARCHIVE 
-PKGPUBLISHER_REDIST="​testing"; ​                    ​export PKGPUBLISHER_REDIST 
-# PKGPUBLISHER_NONREDIST="​on-extra"; ​                   export PKGPUBLISHER_NONREDIST 
- 
- 
-# we want make to do as much as it can, just in case there'​s more than 
-# one problem. This is especially important with the gate, since multiple 
-# unrelated broken things can be integrated. 
-MAKEFLAGS=k; ​   export MAKEFLAGS 
- 
-# Magic variable to prevent the devpro compilers/​teamware from sending 
-# mail back to devpro on every use. 
-UT_NO_USAGE_TRACKING="​1";​ export UT_NO_USAGE_TRACKING 
- 
-# Build tools - don't set these unless you know what you're doing. ​ These 
-# variables allows you to get the compilers and onbld files locally or 
-# through cachefs. ​ Set BUILD_TOOLS to pull everything from one location. 
-# Alternately,​ you can set ONBLD_TOOLS to where you keep the contents of 
-# SUNWonbld and SPRO_ROOT to where you keep the compilers. 
-# 
-BUILD_TOOLS=/​opt; ​                              ​export BUILD_TOOLS 
-ONBLD_TOOLS=/​opt/​onbld; ​                ​export ONBLD_TOOLS 
-SPRO_ROOT=/​opt/​SUNWspro; ​                       export SPRO_ROOT 
- 
-# These two are OmniOS-specific tweaks. 
-export ENABLE_SMB_PRINTING='#'​ 
-GCC_ROOT=/​opt/​gcc-4.4.4/; ​          ​export GCC_ROOT 
- 
-# GCC-only, REQUIRED for OmniOS. 
-__GNUC=""; ​          ​export __GNUC 
-CW_NO_SHADOW=1; ​    ​export CW_NO_SHADOW 
-ONLY_LINT_DEFS=-I${SPRO_ROOT}/​sunstudio12.1/​prod/​include/​lint;​ export ONLY_LINT_DEFS 
- 
-# SET ONNV_BUILDNUM to override the current "​151012"​ of OmniOS. 
-export ONNV_BUILDNUM=151012 
- 
-# This goes along with lint - it is a series of the form "A [y|n]" which 
-# means "go to directory A and run 'make lint'"​ Then mail me (y) the 
-# difference in the lint output. '​y'​ should only be used if the area you're 
-# linting is actually lint clean or you'll get lots of mail. 
-# You shouldn'​t need to change this though. 
-#​LINTDIRS="​$SRC y"; ​    ​export LINTDIRS 
- 
-# 
-# Reference to IA32 IHV workspace, proto area and packages 
-# 
-#​IA32_IHV_WS=/​ws/​${GATE}-ihv; ​                          ​export IA32_IHV_WS 
-#​IA32_IHV_ROOT=$IA32_IHV_WS/​proto/​root_i386; ​           export IA32_IHV_ROOT 
-#​IA32_IHV_PKGS=$IA32_IHV_WS/​packages/​i386/​nightly; ​     export IA32_IHV_PKGS 
- 
-# 
-# Reference to binary-only IA32 IHV packages 
-# 
-#​IA32_IHV_BINARY_PKGS=/​ws/​${GATE}-ihv-bin 
-#export IA32_IHV_BINARY_PKGS 
- 
-# Set this flag to '​n'​ to disable the automatic validation of the dmake 
-# version in use.  The default is to check it. 
-#​CHECK_DMAKE=y 
- 
-# Set this flag to '​n'​ to disable the use of '​checkpaths'​. ​ The default, 
-# if the '​N'​ option is not specified, is to run this test. 
-#​CHECK_PATHS=y 
- 
-# Set this flag to '​y'​ to enable the use of elfsigncmp to validate the 
-# output of elfsign. ​ Doing so requires that '​t'​ be set in NIGHTLY_OPTIONS. 
-# The default is to not verify them. 
-#​VERIFY_ELFSIGN=n 
- 
-# BRINGOVER_FILES is the list of files nightly passes to bringover. 
-# If not set the default is "​usr",​ but it can be used for bringing 
-# over deleted_files or other nifty directories. 
-#​BRINGOVER_FILES="​usr deleted_files"​ 
- 
-# POST_NIGHTLY can be any command to be run at the end of nightly. ​ See 
-# nightly(1) for interactions between environment variables and this command. 
-#​POST_NIGHTLY= 
-</​file>​ 
- 
-===== user profile ===== 
-You probably want to tweak your user profile for whatever shell you are using. 
-I ''​source ~/​illumos-omnios.env''​ inside my .zshrc, I also update my path with ''​ 
-export PATH=$PATH:/​opt/​onbld/​bin:​~/​.bin''​ 
- 
-===== extra helper scripts ===== 
-==== pserv (thanks richlowe) ==== 
- 
-<file bash /​export/​home/​USER/​.bin/​pserv>​ 
- 
-#!/bin/ksh 
- 
-source ~/​illumos-omnios.env 
- 
-REPODIR=nightly-nd 
-PORT=9001 
- 
-while getopts dp: opt; do 
-case $opt in 
-d) REPODIR=nightly;;​ 
-p) PORT=$OPTARG;​ 
-esac 
-done 
- 
-shift $(($OPTIND - 1)) 
-WS=$(cd $1; pwd) 
-/​usr/​lib/​pkg.depotd -d $PARENT_WS/​packages/​$(mach)/​$REPODIR/​repo.redist -p $PORT \ 
-  --readonly --log-access=none 
-</​file>​ 
- 
-===== building using nightly ===== 
-It takes about 2h for me so I run inside a tmux session. 
- 
-<code bash> 
-# build the nightly and nightly-nd repositories (no output! but you should get an e-mail if you set STAFFER) 
-nightly illumos-omnios.env 
-# serv said repositories 
-pserv 
-</​code>​ 
- 
-===== testing the stuff ===== 
-I use a vm that pxe boots with the following kayak config. 
-<code bash kayak_cfg>​ 
-### configuration 
-## rpool 
-BuildRpool c1t0d0 
-SetHostname nightly-testing 
-SetTimezone Europe/​Brussels 
-RootPW '​$5$o.b1VKc/​$GgHl.du5uL6CYm6pRqRR7Lifj92CcBq.qDEAKUXZL21'​ 
-Postboot '/​usr/​sbin/​bootadm set-menu timeout=5'​ 
-## network 
-# dynamic ip address 
-Postboot '/​sbin/​ipadm create-if e1000g0'​ 
-Postboot '/​sbin/​ipadm create-addr -T dhcp e1000g0/​v4'​ 
-# dns 
-EnableDNS example.org 
-SetDNS 10.16.15.1 
-## add publishers 
-## onu testing automation 
-Postboot '/​usr/​gnu/​bin/​sed -i "​s/​PermitRootLogin no/​PermitRootLogin yes/g" /​etc/​ssh/​sshd_config'​ 
-Postboot '/​usr/​bin/​pkg install --no-backup-be pkg:/​developer/​build/​onbld'​ 
-Postboot '/​usr/​sbin/​svcadm disable svc:/​network/​sendmail-client:​default'​ 
-Postboot '/​opt/​onbld/​bin/​onu -v -u http://​leonov.example.org:​9001 -U testing -t omnios-testing'​ 
-Postboot '/​usr/​sbin/​beadm unmount omnios-testing'​ 
-Postboot '/​usr/​sbin/​beadm mount omnios-testing /a' 
-Postboot '/​usr/​gnu/​bin/​rm /​a/​.initialboot'​ 
-Postboot '/​usr/​sbin/​shutdown -i6 -g0 -y' 
-</​code>​ 
- 
-On the initial boot it will install onu and create a new BE populated with the updated packages and reboot. It will then drop you in the new system running a freshly build gate :) 
snipets/solaris/build-zone.txt · Last modified: 2014/10/09 22:02 (external edit)