Kent Watsen wrote:
> I want to install OpenSolaris-based Dom0 onto a compact flash card and 
> thus need to get the smallest install possible.  [Note: the space for 
> all the DomUs will come from iSCSI mounts and logs will be forwarded to 
> a syslog server]
> 
> I tried "Core System Support"and then added xVM and virt-install, but 
> the dependencies had me installing Java, which itself needed 
> XWindows...next thing I knew I was over 2GB (my target CF size)
> 
> Anybody know what dependencies can be safely ignored - assuming I'm 
> running only console access on Dom0 and all DomUs?


I have been meaning to do a blog entry on how to do
this but haven't found the time yet...

Here's a quick way to build a minimal domU which
can also be used for an embedded dom0.

I have a dom0 which I run off of a ram disk booted
from a USB flash and then can start multiple domUs
using the same ramdisk used to boot dom0.

I'll just cover how to build the domU and then
follow up how to build the ramdisk and put it
on a USB flash in a later e-mail.



Setup your domU disk, newfs it, and mount it.
In this example I'm assuming you mounted it
under /mnt.

: alpha[1]#; dd if=/dev/zero of=./disk.img bs=1024k count=512
: alpha[1]#; lofiadm -a `pwd`/disk.img
: alpha[1]#; newfs /dev/rlofi/1
: alpha[1]#; mount -F ufs /dev/lofi/1 /mnt



then run the script below, unmount/lofiadm -d your
disk, then boot your domU and configure it how you want.
You may want to customize the packages to include any disk
adapter/NIC drivers you need, etc..


I'm using the following py file to boot it.
Make sure you umount /mnt and lofiadm -d
first ;-)


: alpha[1]#; cat embedded-disk.py
name = "embedded-disk"
vcpus = 1
memory = "512"
root = "/dev/dsk/c0d0s0"
disk = ['file:/export/guests/embedded/disk.img,0,w']
vif = ['']



This is a script that I've been hacking on.
suggestions/improvements welcome. :-)

Someday I'd like it to be command line based but
don't have time to do that right now.

You need to modify the ROOTDIR, PROD, and PROD_OVERRIDE
paths below.  Also customize any packages you want/don't
want.

I have a SMF service which I commented in my setup
which brings up DHCP on all NICs reported by dladm.
Probably better if you use NWAM.  But I can send those
out if someone is really interested.



----

: alpha[1]#; cat build-domU.sh
#!/bin/ksh

PKGADD=/usr/sbin/pkgadd
PKGLOG=/tmp/packages.log
PKGADMIN=/tmp/pkgadmin
ROOTDIR=/mnt
PROD=/export/install/i386/nevada/79/Solaris_11/Product
PROD_OVERRIDE=/tank/ws/xvm-remote/packages-nondebug

#
# Minimum list of packages that boots to login prompt on text console.
# Add additional packages to get more functionality (e.g. add SUNWmdbr
# for kernel debugging via kmdb).
#
BASE="
         SUNWcar.i
         SUNWcarx.i
         SUNWcakr.i
         SUNWcakrx.i
         SUNWkvm.i
         SUNWcsr
         SUNWcsd
         SUNWos86r
         SUNWrmodr
         SUNWpsdcr
         SUNWpsdir
         SUNWckr
         SUNWcnetr
         SUNWcsl
         SUNWcsu
         SUNWcslr
         SUNWesu
         SUNWkey
         SUNWlibms
         SUNWlibmsr
         SUNWusb
         SUNWpr
         SUNWtls
         SUNWlibsasl
         SUNWlxml
         SUNWopenssl-libraries
         SUNWusbs
         SUNWmdr
         SUNWmdu
         SUNWtecla
         SUNWzlib
         SUNWuprl
         SUNWsmapi
         SUNWkrbr
         SUNWkrbu
         SUNWgss
         SUNWbipr
         SUNWbip
         SUNWzfskr
         SUNWzfsr
         SUNWzfsu
         SUNWbash
         SUNWipfr
         SUNWipfu
"

SYSID="
         SUNWadmap
         SUNWadmlib-sysid
         SUNWadmr
"

SSH="
         SUNWsshcu
         SUNWsshdr
         SUNWsshdu
         SUNWsshr
         SUNWsshu
"

NFSCLIENT="
         SUNWnfsckr
         SUNWnfscr
         SUNWnfscu
"

NFSSERVER="
         SUNWnfsskr
         SUNWnfssr
         SUNWnfssu
"

NIS="
         SUNWnisr
         SUNWnisu
"
AUTOFS="
         SUNWatfsr
         SUNWatfsu
"

MDB="
         SUNWmdb
         SUNWmdbr
"

DOM0="
         SUNWPython
         SUNWPython-extra
         SUNWvirtinst
         SUNWurlgrabber
         SUNWlibvirt
         SUNWxvmhvm
         SUNWxvmdomr
         SUNWxvmdomu
         SUNWxvmu
         SUNWxvmr
         SUNWgccruntime
         SUNWgnutls
         SUNWlibsdl
         SUNWxwplt
         SUNWxwrtl
"

NICS="
         SUNWbge
         SUNWnge
         SUNWrge
         SUNWxge
         SUNWintgige
"

DISK_HBAS="
         SUNWahci
"

#
# Create a pkg admin file - see man admin(4)
#
sed 's/ask/nocheck/' /var/sadm/install/admin/default > $PKGADMIN

echo "adding packages to $ROOTDIR"

for pkg in $BASE $SYSID $SSH $MDB $NFSCLIENT $AUTOFS $DOM0 $NIS $DISK_HBAS; do
         if [ -d "$PROD_OVERRIDE/$pkg" ]; then
                 $PKGADD -a $PKGADMIN -d $PROD_OVERRIDE -R $ROOTDIR $pkg \
                         > PKGLOG 2>&1
         elif [ -d "$PROD/$pkg" ]; then
                 $PKGADD -a $PKGADMIN -d $PROD -R $ROOTDIR $pkg \
                         > PKGLOG 2>&1
         else
                 echo "  $pkg not found: skipped"
         fi
done

# seed the SMF repository
/usr/bin/cp $ROOTDIR/lib/svc/seed/global.db $ROOTDIR/etc/svc/repository.db
chmod 600 $ROOTDIR/etc/svc/repository.db
cd $ROOTDIR/var/svc/profile/
rm -f generic.xml name_service.xml
ln -s generic_limited_net.xml generic.xml
ln -s ns_files.xml name_service.xml

#
# Setup DHCP on all NICs
#
#cp /tank/ws/embedded/devices-net $ROOTDIR/lib/svc/method/
#cp /tank/ws/embedded/devices-net.xml $ROOTDIR/var/svc/manifest/system/device/

# save away vfstab for domU and ramdisk
/usr/bin/cp $ROOTDIR/etc/vfstab $ROOTDIR/etc/vfstab.disk
/usr/bin/cp $ROOTDIR/etc/vfstab $ROOTDIR/etc/vfstab.ramdisk
echo "/devices/ramdisk:a - / ufs - no nologging" >> $ROOTDIR/etc/vfstab.ramdisk
echo "/dev/dsk/c0d0s0 /dev/rdsk/c0d0s0 / ufs 1 no -" >> $ROOTDIR/etc/vfstab.disk

# build up /dev. This causes some minor problems but will self correct.
# XXX - This would be better if we had a seed tarball.
/usr/sbin/devfsadm -R $ROOTDIR

# make the disk links for domU
cd $ROOTDIR/dev/dsk
rm -f c0d0s0
/usr/bin/ln -s ../../devices/xpvd/[EMAIL PROTECTED]:a c0d0s0
cd $ROOTDIR/dev/rdsk
rm -f c0d0s0
/usr/bin/ln -s ../../devices/xpvd/[EMAIL PROTECTED]:a,raw c0d0s0
/usr/bin/cp $ROOTDIR/etc/vfstab.disk $ROOTDIR/etc/vfstab

# spinkle a little magic sysconfig fairy dust
echo "/lib/svc/method/sshd\n\
/usr/sbin/sysidkbd\n\
/usr/sbin/sysidpm\n\
/lib/svc/method/net-nwam\n\
/usr/lib/cc-ccr/bin/eraseCCRRepository" > $ROOTDIR/etc/.sysidconfig.apps

# setup the image so we need to configure it on first boot
# XXX: if we setup timezone, could we save the reboot??
/usr/sbin/sys-unconfig -R $ROOTDIR

echo "build boot_archive"
/usr/sbin/bootadm update-archive -R $ROOTDIR



_______________________________________________
xen-discuss mailing list
[email protected]

Reply via email to