Child pages
  • Building O.I. by sb
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 81 Current »

Using TWW sb tool to build OpenIndiana OS 

WHAT: This page document the process to build OpenIndiana OS using a tool called "sb".

WHY:  TBC.

WHERE: tww.uk.openindiana.org

HOW: See "Procedure to setup TWW tool-sets on O.I-148."

TWW tool-sets  overview 

/opt/TWWfsw/bin/sb is part of TWW Inc's GNU licensed tool-sets.

  • /opt/TWWfsw/bin/sb : sb is a python script to automate the software building process.
  • /opt/TWWfsw/bin/pb : pb is a python wrapper script to act as proxy to different package manager to create native package formats for RPM,SVR4,SD-UX and others.
  • /opt/TWWfsw/bin/pkg-info,pkg-inst,pkg-rm : pkg-info, pkg-inst and pkg-rm are python wrapper script provide a layer of abstraction in terms of query package information, package installation and package removal.

pb and pkg-* tools are not subject of this page. We are going to only describe sb for building O.I. OS(software).

sb aim for high degree of automation in the domain of software building. In short, it is a DSL(Domain Specific Language) to describe and repeat software building process as much as possible by program(sb). Don't worry, it still can not replace software packager's job. But it surely can increase software building quality and speed.  

O.I. is still branded and keeping itself very close to Solaris-2.11 and TWW tool-sets for Solaris 2.10 works on Solaris 2.11 x86 and Sparc CPUs.

Procedure to setup TWW tool-sets on O.I-148.

  1. Lets use tww.uk.openindiana.org as example host.
    1. Setup tww-init directory and machine info.
      tjyang@tww.uk.openindiana.org:~$ mkdir tww-init;cd tww-init
      tjyang@tww.uk.openindiana.org:~/tww-init$ pwd
      /export/home/tjyang/tww-init
      tjyang@tww.uk.openindiana.org:~/tww-init$ uname -a
      SunOS tww.uk.openindiana.org 5.11 oi_147 i86pc i386 i86pc
      tjyang@tww.uk.openindiana.org:~/tww-init$ grep tjyang /etc/user_attr
      tjyang::::type=normal;profiles=Primary Administrator
      tjyang@tww.uk.openindiana.org:~/tww-init$
      
  2. Install a few tools by  "pfexec pkg install lftp git gnu-make wget rsync zip developer/object-file header-math imake makedepend"
  3. Use lftp to grab pkgutils-1.6.4.pkgadd.tar and others for i386-pc-solaris2.10 OS platform.
    tjyang@tww.uk.openindiana.org:~/tww-init$ lftp ftp://support.thewrittenword.com/dists/9.0/support/i386-pc-solaris2.10
    cd ok, cwd=/dists/9.0/support/i386-pc-solaris2.10
    lftp support.thewrittenword.com:/dists/9.0/support/i386-pc-solaris2.10>mget \
    pkgutils-1.6.4.pkgadd.tar \
    sbutils-1.3.0-2.pkgadd.pkg-inst \
    pbutils-1.1.22-1.pkgadd.pkg-inst \
    rpm-4.2-6.pkgadd.pkg-inst
    lftp support.thewrittenword.com:/dists/9.0/support/i386-pc-solaris2.10>
    
  4. untar pkgutils and use pkgadd to install TWW* SVR4 packages. Answer yes to all the questions.
    tjyang@tww.uk.openindiana.org:~/tww-init$ ls -lrt
    total 142449
    -rw-r--r--   1 tjyang   tjyang   24161554 Mar 18  2010 sbutils-1.3.0-2.pkgadd.pkg-inst
    drwxr-xr-x   4 tjyang   tjyang         7 Feb 18 21:47 TWWpkgutils16u
    drwxr-xr-x   3 tjyang   tjyang         5 Feb 18 21:47 TWWpkgutils16c
    drwxr-xr-x   3 tjyang   tjyang         6 Feb 18 21:47 TWWpkgutils16m
    -rw-r--r--   1 tjyang   tjyang   30825984 Feb 18 21:47 pkgutils-1.6.4.pkgadd.tar
    -rw-r--r--   1 tjyang   tjyang   10723264 Feb 18 23:38 pbutils-1.1.22-1.pkgadd.pkg-inst
    -rw-r--r--   1 tjyang   tjyang   7251511 Feb 18 23:38 pbutils-1.1.22-1.rpm.pkg-inst
    tjyang@tww.uk.openindiana.org:~/tww-init$ for i in TWW*; do pfexec pkgadd -d . $i; done
    
    
  5. Install sbutils,pbutils and (optional) rpm package manager for Solaris x86.
     tjyang@tww.uk.openindiana.org:~/tww-init$pfexec /opt/TWWfsw/bin/pkg-inst \
    sbutils-1.3.0-2.pkgadd.pkg-inst \
    pbutils-1.1.22-1.pkgadd.pkg-inst \
    rpm-4.2-6.pkgadd.pkg-inst
    
  6. Make sure /opt/SUNWspro/bin is in PATH of /opt/TWWfsw/sbutils13/etc/sbutils.conf since TWW packages use OS vendor supported compiler by default.
    <snipped>
    environment {
      PATH = "/opt/TWWfsw/sbutils13/lib/aux/bash/bin:\
    /opt/SUNWspro/bin:
    /opt/TWWfsw/sbutils13/lib/aux/bzip2/bin:\
    <snipped>
    
  7. Quick check of installed tool-sets
    tjyang@tww.uk.openindiana.org:~/tww-init$ sb --version;pb --version;pkg-inst --version
    1.3.0
    1.1.21
    1.6.4
    tjyang@tww.uk.openindiana.org:~/tww-init$
    
  8. Read http://en.wikibooks.org/wiki/CPAM_with_TWW/User_Guide to get the big picture.
  9. RTFM of TWW tool-sets.
    man sb
    man 4 depot-db.xml
    man 4 sb-db.xml
    man 4 sbutils.conf
    
    

Use sb to create your first hello-world  package source

 mkdir -p hello-2.7/src
 cd hello-2.7/src/
 wget http://ftp.gnu.org/gnu/hello/hello-2.7.tar.gz

Using sb with GNU Makefile to build all O.I. consolidations.

Run "/opt/TWWfsw/bin/sb -m"  with a wrong module name "test" to list out available consolidations.

oi@openindiana:~/oi$ sb -m test oi.xml
OpenIndiana-148
  error: while the program was found in the repository, no modules
  error: matching any requested were found. the modules I know about
  error: are: caiman, default, distro, g11n, gnome, illumos, ips,
  error: osnet, setup, sfw, sic_team, tww, vpanels, x.
oi@openindiana:~/oi$

Before and After Digitization

English Instruction to build consolidations

Digitized the instruction into The Written Words(XML) that a program(sb) can repeat

Setup the build Environment

To be published.

Creating the O.I. distro

      <module name="distro">
      <install-name>distro</install-name>
      <script-header>
<![CDATA[
SLIMCD="/usr/share/distro_const/slim_cd"
DISTRO_NAME="OpenIndiana_Live_X86_TJYANG"
]]>
      </script-header>
      <configure>
<![CDATA[
case "${SB_SYSTYPE}" in
i?86*-solaris*)
if [ ! -x /usr/bin/distro_const ] ; then
pfexec pkg install install/distribution-constructor
fi;;
esac
]]>
      </configure>
      <build>
<![CDATA[
pfexec cp ${SLIMCD}/slim_cd_x86.xml  ${SLIMCD}/tjyang_slim_cd_x86.xml
pfexec perl -pi -e "s!OpenIndiana_Live_X86!${DISTRO_NAME}!"  ${SLIMCD}/tjyang_slim_cd_x86.xml
pfexec rm -f  /rpool/dc/media/${DISTRO_NAME}.*
time pfexec distro_const build ${SLIMCD}/tjyang_slim_cd_x86.xml
]]>      </build>
      <install>
<![CDATA[
scp /rpool/dc/media/${DISTRO_NAME}.* tjyang@192.168.1.2:/tmp
]]>
      </install>
    </module>
 

Filler

Filler

References:

  1. http://www.illumos.org/projects/cpamtww
  2. http://en.wikibooks.org/wiki/CPAM_with_TWW
  • No labels