Archive for the ‘Computers’ category

Minimal OpenSolaris 2009.06

October 6th, 2009

os_fan_button_white_lrg_rndAfter toying around with OpenSolaris for a couple of months, I started wondering what it would take to slim down the default installation to something more appropriate for a server — You know, no X, GNOME, or any of the other good stuff. Some searching on Google lead me to some instructions for a minimal install of OpenSolaris 2008.11. Instead of starting out with a Live CD, I did a normal installation, booted in to that, and then followed these steps below (note: make sure to perform these tasks as either root or super-user).

Create new zfs volume and mount it in /a:

This will be the new root volume once we’re done installing our packages.

zfs create rpool/ROOT/opensolaris-minimal
zfs set mountpoint=legacy rpool/ROOT/opensolaris-minimal
zfs set canmount=noauto rpool/ROOT/opensolaris-minimal

mkdir /a
mount -F zfs rpool/ROOT/opensolaris-minimal

Create the install image:

export PKG_IMAGE=/a
pkg image-create -F -a opensolaris.org=http://pkg.opensolaris.org $PKG_IMAGE
pkg refresh

Once that’s setup, I use the same methodology from the guy mentioned in the above link:

Contents of pkg.txt:

SUNWcsd
SUNWcs
SUNWzone
SUNWcsl
SUNWlibsasl
SUNWlibms
SUNWpr
SUNWlxml
SUNWzlib
SUNWtls
SUNWopenssl
SUNWpool
SUNWzfs
SUNWsmapi
SUNWtecla
SUNWckr
SUNWpicl
SUNWmd
SUNWinstall-libs
SUNWwbsup
SUNWgccruntime
SUNWcar
SUNWcakr
SUNWusbs
SUNWusb
SUNWaudd
SUNWkvm
SUNWos86r
SUNWrmodr
SUNWpsdcr
SUNWpsdir
SUNWcnetr
SUNWesu
SUNWkey
SUNWnfsckr
SUNWnfsc
SUNWgss
SUNWgssc
SUNWbip
SUNWbash
SUNWloc
SUNWsshcu
SUNWsshd
SUNWssh
SUNWtoo
SUNWzfskr
SUNWipf
SUNWrtls
SUNWipkg
SUNWpython-pyopenssl
SUNWpython-cherrypy
SUNWadmr
SUNWadmap
SUNWadmlib-sysid
SUNWPython
SUNWbzip
SUNWxwrtl
SUNWTk
SUNWTcl
SUNWlexpt
SUNWperl584core
SUNWinstall-libs
SUNWbeadm
SUNWvim
SUNWscreen

Package installation:

for pkg in `cat pkg.txt`; do pkg install $pkg; done

And now for some initial configurations:

# seed the initial smf repository
cp $PKG_IMAGE/lib/svc/seed/global.db $PKG_IMAGE/etc/svc/repository.db
chmod 0600 $PKG_IMAGE/etc/svc/repository.db
chown root:sys $PKG_IMAGE/etc/svc/repository.db

# setup smf profiles
ln -s ns_files.xml $PKG_IMAGE/var/svc/profile/name_service.xml
ln -s generic_limited_net.xml $PKG_IMAGE/var/svc/profile/generic.xml
ln -s inetd_generic.xml $PKG_IMAGE/var/svc/profile/inetd_services.xml
ln -s platform_none.xml $PKG_IMAGE/var/svc/profile/platform.xml

# mark the new system image as uninstalled
sysidconfig -b $PKG_IMAGE -a /lib/svc/method/sshd
touch $PKG_IMAGE/etc/.UNCONFIGURED

# copy over the vfstab
cp -p /etc/vfstab $PKG_IMAGE/etc/vfstab

# copy over the current passwd, group, shadow, and user_attr to the new image
cp -p /etc/passwd $PKG_IMAGE/etc/passwd
cp -p /etc/shadow $PKG_IMAGE/etc/shadow
cp -p /etc/user_attr $PKG_IMAGE/etc/user_attr
cp -p /etc/group $PKG_IMAGE/etc/group

# copy of my existing host sshd keys
cp -p /etc/ssh/*key* $PKG_IMAGE/etc/ssh

# configure /dev in the new image
devfsadm -r $PKG_IMAGE
ln -s ../devices/pseudo/sysmsg@0:msglog $PKG_IMAGE/dev/msglog

# copy the grub files
rsync -avr --progress /boot/grub $PKG_IMAGE/boot/

# update the boot archive in the new image
bootadm update-archive -R $PKG_IMAGE

# update to the latest version of grub (this command generated
# some errors which i ignored).
$PKG_IMAGE/boot/solaris/bin/update_grub -R $PKG_IMAGE

# change our active boot environment
beadm activate opensolaris-minimal

Once that’s completed, I’ll also modify grub’s menu.lst file to disable the graphical boot sequences, here’s what the finished file will look like (/rpool/boot/grub/menu.lst):

#splashimage /boot/grub/splash.xpm.gz
#background 215ECA
timeout 30
default 0
#---------- ADDED BY BOOTADM - DO NOT EDIT ----------
#splashimage /boot/solaris.xpm
#foreground d25f00
#background 115d93
#---------------------END BOOTADM--------------------
title opensolaris-minimal
bootfs rpool/ROOT/opensolaris-minimal
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS
module$ /platform/i86pc/$ISADIR/boot_archive
#============ End of LIBBE entry =============

After that, I’ll umount the volume (/a) and reboot the system. Once as soon as I know that everything installed properly, I’ll use the beadm command to destroy the old boot environment, leaving me with a minimal(ish) install of OpenSolaris!

Relearning an Old Language

November 5th, 2008

The past couple of days at work have been a humilitating experience for me. Why? Because I’m trying to re-learn Visual C++ for an internal project. I haven’t touched this language since I was in high school (which is over ten years now). To make matters worse, what I’m trying to accomplish isn’t really even a simple task for that language; I’m converting an open source application into a COM object.

I have definietly come to respect those developers who can program in this language. It’s definitely very powerful being able to directly affect a system using the standard MFC classes and API calls at the native code level.

Downtime

October 30th, 2008

This past weekend, I was finally able to sit down and have on of those do-nothing-weekends. Besides doing a lot of the usual chores associated with owning a home, I was also able to finally sit down and get familiar with OpenSolaris. For those of you who aren’t in the IT industry, it’s a UNIX operating system (one of the originals actually), that is starting to revamp itself by incorporating a lot of powerful yet simple technologies like ZFS and Project Indiana (lead by the same guy who started the Debian Linux distribution).

So far, I’m really impressed with the snapshot capabilities of the ZFS file system; it’s allowed me to roll back to a previous state whenever I screw something up. I wish I had that back in the 90’s when I was learning Linux! Hopefully, I’ll be able to migrate to that, and use it full time as my desktop operating system, but I need to accomplish a few things before that can happen. Most of my daily applications work, and I’m in the process of compiling mono and getting mp3 and ipod support working. Who knows, maybe I’ll actually be able to contribute to an open source project for once!