2017年8月26日土曜日

Illumos build方法

2019/09/21 修正

illumosのカーネルビルド方法は
https://illumos.org/docs/developers/build/
に書かれている

開発環境は、
OpenindianaまたはOmniOS
がよい


以下 Openindianaの場合
Openindianaのインストールは、
https://www.openindiana.org/download/
USB版をダウンロードしliveUSBを作成する。
virtualBoxではDVD版をダウンロードする
Liveは、GUI
Text Installは、server用

インストール方法は、
http://docs.openindiana.org/handbook/getting-started/#installing-openindiana
に書かれている。
liveUSBの作り方
Linux/OS Xの場合は、
# dd bs=4M if=./image.usb of=/dev/sdX status=progress && sync
sdXは適切な値に変更する。


システムが起動したら

まずはシステムを最新にする。
sudo pkg update

開発環境のインストール
sudo pkg install build-essential \
    runtime/python-35 \
    developer/gcc-7
このコマンドでgit gccなどがインストールされる

ソースコードを取得する。
ディレクトリcodeを作成する。(code以外の名前でもよい)
(codeの場所はどこでも良い。通常のユーザー特権で作成する。)
$cd code
$git clone https://github.com/illumos/illumos-gate.git

クローズドバイナリーの取得は、openindiana,omniOSでは不要
illumosは、まだ一部クローズドバイナリーがあるが、あたらいopenindiana,omniOSでは
/opt/onbld/closedにインストールされている。


illumos.shをコピーし修正する。
$cd ~/code/illumos-gate
$cp usr/src/tools/env/illumos.sh .
$vi illumos.sh       # or your favourite editor instead of @vi@


最終行に下記を追加する。
#
# Set a package version number which is greater than the current OpenIndiana
# build number.  Note that ONNV_BUILDNUM is ignored if PKGVERS_BRANCH is set:
#
export PKGVERS_BRANCH=9999.99.0.0

#
# Set to current version of Perl shipped with OpenIndiana:
#
export PERL_VERSION="5.22"
export PERL_PKGVERS="-522"

#
# If you are building on the latest OpenIndiana (2017-03-07 and later), use
# OpenJDK 8:
#
export BLD_JAVA_8=

#
# IPS packages published at 2019-08-08 and later ship only Python 3.5 modules,
# so you have to use this Python version to build illumos tools
# if your pkg:/package/pkg version is 0.5.11-2019.0.0.5521 or later.
#
export BUILDPY2TOOLS="#"
 
#
# Use the copy of the closed binaries that comes with the "build-essential"
# package:
#
export ON_CLOSED_BINS="/opt/onbld/closed"




ビルドの実行
$cd ~/code/illumos-gate
$time ksh93 usr/src/tools/scripts/nightly.sh illumos.sh

ログの参照
$tail -f ~/code/illumos-gate/log/nightly.log

追加ビルドは、-i オプションを付ける
$cd /code/illumos-gate
$time ksh93 usr/src/tools/scripts/nightly.sh -i illumos.sh


インストール方法
beadmを使用して、BEを作成しインストールする。



0 件のコメント:

コメントを投稿