Stephen Quintero wrote:
> I am removing 300+ packages to make a small install.  It is used to 
> instantiate a utility appliance which performs operations over UFS volumes 
> (and ZFS pools soon...), so it requires very limited functionality.
> 
> I've got "pkg uninstall" working and have whittled the install down to 984MB. 
>  We'll see if it works...


With the pkg stuff. I can get to ~ 525M with about
200M of that being the two boot_archives.


: alpha[1]#; dd if=/dev/zero of=./disk.img bs=1024k count=750
650+0 records in
650+0 records out
: alpha[1]#; lofiadm -a `pwd`/disk.img
/dev/lofi/1
: alpha[1]#; newfs /dev/lofi/1
newfs: construct a new file system /dev/rlofi/1: (y/n)? y
/dev/rlofi/1:   1330800 sectors in 2218 cylinders of 1 tracks, 600 sectors
        649.8MB in 139 cyl groups (16 c/g, 4.69MB/g, 2240 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
  32, 9632, 19232, 28832, 38432, 48032, 57632, 67232, 76832, 86432,
  1238432, 1248032, 1257632, 1267232, 1276832, 1286432, 1296032, 1305632,
  1315232, 1324832
: alpha[1]#; mount /dev/lofi/1 /mnt
: alpha[1]#; /tank/ws/embedded/pkg.sh
: alpha[1]#; umount /mnt
: alpha[1]#; lofiadm -d /dev/lofi/1
: alpha[1]#; xm new -f os.py



MRJ



where os.py is
--
name = "opensolaris"
vcpus = 1
memory = "1024"
extra = "-k"
root = "/dev/dsk/c0d0s0"
disk = ['file:/tank/guests/embedded/disk.img,0,w']
vif = ['']
on_shutdown = "destroy"
on_reboot = "restart"
on_crash = "destroy"


and pkg.sh is
--
#!/bin/ksh

ROOTDIR=/mnt

BASE="
        SUNWcsd
        SUNWcs
        SUNWcar
        SUNWcarx
        SUNWcakr
        SUNWcakrx
        SUNWos86r
        SUNWkvm
        SUNWrmodr
        SUNWpsdcr
        SUNWpsdir
        SUNWcnetr
        SUNWesu
        SUNWkey
        SUNWuprl
        SUNWkrb
        SUNWbip
        SUNWzfskr
        SUNWbash
        SUNWipf
        SUNWbash
        SUNWfmd
        SUNWgrub
        SUNWtoo
        SUNWbind
        SUNWrcmdc
        SUNWperl584core
"

# packaging system
PKG="
        SUNWPython
        SUNWPython-extra
        SUNWipkg
"

# needed for sys-unconfig, etc.
SYSID="
        SUNWadmap
        SUNWadmlib-sysid
        SUNWadmr
"

SSH="
        SUNWsshcu
        SUNWsshd
        SUNWssh
"

NFSCLIENT="
        SUNWnfsckr
        SUNWnfsc
"

NFSSERVER="
        SUNWnfsskr
        SUNWnfss
"

NIS="
        SUNWnis
"
AUTOFS="
        SUNWatfs
"

MDB="
        SUNWmdb
"

DOM0="
        SUNWvirtinst
        SUNWurlgrabber
        SUNWlibvirt
        SUNWxvmhvm
        SUNWxvmdom
        SUNWxvm
        SUNWgnutls
        SUNWlibsdl
        FSWxwpft
        FSWxwrtl
"

# dom0 devices
DEVS="
        SUNWbge
        SUNWnge
        SUNWrge
        SUNWxge
        SUNWintgige
        SUNWahci
        SUNWmv88sx
        SUNWnvsata
        SUNWsi3124
"

# create the packaging db
/usr/bin/pkg image-create -F -a opensolaris.org=http://pkg.opensolaris.org 
$ROOTDIR

cd $ROOTDIR
echo "adding packages to `pwd`"
for pkg in $BASE $PKG $SYSID $SSH $MDB $NFSCLIENT $AUTOFS $NIS; do
        /usr/bin/pkg install $pkg
done

# dom0 support
#for pkg in $DOM0 $DEVS; do
#       /usr/bin/pkg install $pkg
#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/
ln -s generic_limited_net.xml generic.xml
ln -s ns_files.xml name_service.xml

# 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

# remove some Indiana iso specific stuff
cat $ROOTDIR/etc/passwd | sed '/^jack/d' > $ROOTDIR/etc/passwd.new;mv -f 
$ROOTDIR/etc/passwd.new $ROOTDIR/etc/passwd
cat $ROOTDIR/etc/shadow | sed '/^jack/d' > $ROOTDIR/etc/shadow.new;mv -f 
$ROOTDIR/etc/shadow.new $ROOTDIR/etc/shadow
cat $ROOTDIR/etc/user_attr | sed 's/^root::::type=role;/root::::/g' > 
$ROOTDIR/etc/user_attr.new;mv -f $ROOTDIR/etc/user_attr.new 
$ROOTDIR/etc/user_attr

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

_______________________________________________
xen-discuss mailing list
[email protected]

Reply via email to