[OmniOS-discuss] Customising a kayak build image.

Andy omnios at citrus-it.net
Fri May 3 05:29:53 EDT 2013


I saw a question in the mailing list archives from last month on how to
customise a kayak build image - it was before I joined the list  so I can't
reply to that thread, but this is how I have customised the current stable
image for us. Hope it's useful to somebody:

#!/bin/sh

# This script takes an OmniOS ZFS install image and creates a Citrus IT
# image from it. It:
#	Updates the image with latest packages from the repository;
#	Installs additional OmniOS packages;
#	Adds the Citrus repository to the package framework;
#	Installs Citrus packages;
# The resulting image is created in the current directory and called
# omnios-citrus.zfs.bz2

image="${1}"
img=rpool/img

if [ -n "$image" ]; then
	if [ ! -r "$image" ]; then
		echo "Cannot open image '$image'"
		exit 1
	fi
	echo "Destroying old image filesystem..."
	zfs destroy -r $img
	bzip2 -dc $image | pv -B 128m | zfs recv $img || exit 1
	shift
elif ! zfs list $img > /dev/null 2>&1; then
	echo "No existing image."
	exit 1
fi

zfs destroy $img at kayak

# Install additional packages

echo "+ Installing additional packages..."

pkg -R /$img install \
	developer/gcc46 \
	developer/object-file \
	developer/linker \
	developer/library/lint \
	developer/build/gnu-make \
	system/header \
	system/library/math/header-math \
	pciutils \
	rsync \
	compress/xz \
	driver/ipmi \
	system/management/ipmitool \
	system/library/pcap \
	developer/parser/bison  \


echo "+ Updating build..."

# Update build
pkg -R /$img update

echo "+ Installing Citrus IT Packages..."

pkg -R /$img set-publisher -g https://ips.citrus-it.net/ citrus

# Install Citrus Packages

pkg -R /$img install \
	citrus/postinstall \
	developer/versioning/svn \
	citrus/smtp/sendmail \
	system/library/bdb  \
	system/utility/cmake \
	... elided ...


# Install newer BNX driver
cp /kernel/drv/amd64/bnx /$img/kernel/drv/amd64/bnx

# Create new image

zfs snapshot $img at kayak || exit 1

zfs send $img at kayak | bzip2 -9c | pv -B 128m > omnios-citrus.zfs.bz2




-- 
Citrus IT Limited | +44 (0)870 199 8000 | enquiries at citrus-it.co.uk
Rock House Farm | Green Moor | Wortley | Sheffield | S35 7DQ
Registered in England and Wales | Company number 4899123



More information about the OmniOS-discuss mailing list