<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>ByteLabs: OpenSolaris Tips and Tricks</title>
    <link>http://blog.solaris.bytelabs.org/articles/2007/02/12/opensolaris-tips-and-tricks</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>additions to a vast pool of entropy by Igor and Ines</description>
    <item>
      <title>OpenSolaris Tips and Tricks</title>
      <description>&lt;p style="float:left"&gt;&lt;a href="http://www.opensolaris.org"&gt;&lt;img src="http://www.opensolaris.org/os/community/marketing/metrics/opensolaris_logo_rgb.jpg" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;OpenSolaris is SUNs attempt to pretend they are open source. This page
should be a place holder for information concerning things like 
installation, administration and other peculiar things.&lt;/p&gt;


	&lt;p&gt;Some useful documentation can be found at the &lt;span class="caps"&gt;SUN&lt;/span&gt; Solaris website:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;[Developer] &lt;a href="http://www.opensolaris.org/os/community/on/devref_toc/"&gt;http://www.opensolaris.org/os/community/on/devref_toc/&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;[Community Tools] &lt;a href="http://opensolaris.org/os/community/tools/"&gt;http://opensolaris.org/os/community/tools/&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;[OpenSolaris] &lt;a href="http://www.opensolaris.org/os/community/documentation/"&gt;http://www.opensolaris.org/os/community/documentation/&lt;/a&gt; &lt;/li&gt;
		&lt;li&gt;[SUN] &lt;a href="http://docs.sun.com/app/docs/coll/47.16"&gt;http://docs.sun.com/app/docs/coll/47.16&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;h3&gt;Setup&lt;/h3&gt;


	&lt;h4&gt;System Setup&lt;/h4&gt;


	&lt;p&gt;One can use the Solaris Management Console for system setup:&lt;/p&gt;


&lt;code&gt;
    /usr/sadm/bin/smc &amp;#38;
&lt;/code&gt;

	&lt;p&gt;&lt;span class="caps"&gt;LDAP&lt;/span&gt; Setup Client setup is described here:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;[LDAP Client] &lt;a href="http://docsun.cites.uiuc.edu/sun_docs/C/solaris_9/SUNWaadm/SYSADV5/p61.html"&gt;http://docsun.cites.uiuc.edu/sun_docs/C/solaris_9/SUNWaadm/SYSADV5/p61.html&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;h4&gt;Zone Setup&lt;/h4&gt;


	&lt;ul&gt;
	&lt;li&gt;[Zones] &lt;a href="http://opensolaris.org/os/community/zones/"&gt;http://opensolaris.org/os/community/zones/&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;[Zone Examples] &lt;a href="http://users.tpg.com.au/adsln4yb/zones.html"&gt;http://users.tpg.com.au/adsln4yb/zones.html&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;h4&gt;Network Setup&lt;/h4&gt;


	&lt;p&gt;Useful documentation can be found at:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;[Network Setup] &lt;a href="http://solaris-x86.org/documents/tutorials/network.mhtml"&gt;http://solaris-x86.org/documents/tutorials/network.mhtml&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;In order to get a network interface configured for &lt;strong&gt;dhcp&lt;/strong&gt; do the following:&lt;/p&gt;


&lt;code&gt;
    touch /etc/hostname.{interfacename}
    touch /etc/dhcp.{interfacename}
    ifconfig {interfacename} dhcp start
    ifconfig {interfacename} dhcp status
&lt;/code&gt;

	&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; When setting up a server and name resolution does not work even though &lt;code&gt;/etc/resolv.conf&lt;/code&gt; has been created correctly, try to do the following:&lt;/p&gt;


&lt;code&gt;
    cp /etc/nsswitch.dns /etc/nsswitch.conf
&lt;/code&gt;

	&lt;p&gt;This must be done in order for the system to use &lt;span class="caps"&gt;DNS&lt;/span&gt; servers.&lt;/p&gt;


	&lt;h3&gt;Software Package Management&lt;/h3&gt;


	&lt;p&gt;Software packages for OpenSolaris can be administered with the Product Registry &lt;span class="caps"&gt;GUI&lt;/span&gt;:&lt;/p&gt;


&lt;code&gt;
    prodreg
&lt;/code&gt;

	&lt;ul&gt;
	&lt;li&gt;[Prodreg Guide] &lt;a href="http://docs.sun.com/app/docs/doc/817-1985/6mhm8o5v5?a=view"&gt;http://docs.sun.com/app/docs/doc/817-1985/6mhm8o5v5?a=view&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;The &lt;strong&gt;prodreg&lt;/strong&gt; utility really sucks and there is a better way to 
install 3rd party software packages, namely with &lt;strong&gt;pkgadd&lt;/strong&gt;:&lt;/p&gt;


&lt;code&gt; 
    pkgadd -d /cdrom/cdrom0/Solaris_11/Product SUNWbash 
&lt;/code&gt;

	&lt;p&gt;The previous command would add &lt;strong&gt;bash&lt;/strong&gt; the bash package to the system.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;[Pkadd Guide] &lt;a href="http://docs.sun.com/app/docs/doc/817-1985/6mhm8o601?a=view"&gt;http://docs.sun.com/app/docs/doc/817-1985/6mhm8o601?a=view&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


Installation of &lt;span class="caps"&gt;SVN&lt;/span&gt; is described here, but it does not support &lt;span class="caps"&gt;SSL&lt;/span&gt; so install &lt;span class="caps"&gt;SVN&lt;/span&gt; through pkg-get (see next subsection):
	&lt;ul&gt;
	&lt;li&gt;[SVN] &lt;a href="http://www.opensolaris.org/os/community/tools/scm/svn_help/"&gt;http://www.opensolaris.org/os/community/tools/scm/svn_help/&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;h4&gt;Proper Package Management for OpenSolaris&lt;/h4&gt;


	&lt;p&gt;OpenSolaris base installation sucks! Since we want more cool software to run and a nice package management front end, &lt;strong&gt;pkg-get&lt;/strong&gt; should be installed:&lt;/p&gt;


&lt;code&gt;
    /usr/sfw/bin/wget http://www.blastwave.org/pkg_get.pkg
    pkgadd -d pkg_get.pkg all
&lt;/code&gt;

	&lt;p&gt;More information can be found at:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;[Package Management] &lt;a href="http://www.blastwave.org/howto.html"&gt;http://www.blastwave.org/howto.html&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;&lt;strong&gt;sudo&lt;/strong&gt;, &lt;strong&gt;vim&lt;/strong&gt; and &lt;strong&gt;subversion&lt;/strong&gt; with &lt;span class="caps"&gt;SSL&lt;/span&gt; support are easily installed through &lt;strong&gt;pkg-get&lt;/strong&gt;.&lt;/p&gt;


	&lt;h3&gt;Zone Manipulation&lt;/h3&gt;


	&lt;p&gt;The zone manipulation commands are quite similar to the ones used for &lt;span class="caps"&gt;XEN&lt;/span&gt;:&lt;/p&gt;


&lt;code&gt;
    zoneadm list -cv             # list all zones and their status
    zoneadm -z vfm boot          # boot vfm zone
    zlogin -C vfm                # login to vfm zone over the console
&lt;/code&gt;

	&lt;h3&gt;Perl and &lt;span class="caps"&gt;CPAN&lt;/span&gt; Workarounds&lt;/h3&gt;


	&lt;p&gt;The &lt;span class="caps"&gt;CPAN&lt;/span&gt; version distributed with OpenSolaris is terribly broken! The following checklist should help to configure &lt;span class="caps"&gt;CPAN&lt;/span&gt;:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Make sure &lt;span class="caps"&gt;GNU&lt;/span&gt; make is used and can be executed as a root user. I just symlinked gmake into a directory which is in everyones path:&lt;/li&gt;
	&lt;/ul&gt;


&lt;code&gt;
    ln -s /usr/sfw/bin/gmake /usr/bin/make
&lt;/code&gt;

	&lt;ul&gt;
	&lt;li&gt;If you haven&amp;#8217;t already done this during the openRTSP compile procedure do the following:&lt;/li&gt;
	&lt;/ul&gt;


&lt;code&gt;
    sudo ln -sf /usr/sfw/bin/gcc /usr/ucb/cc        # this is a bug workaround for OpenSolaris
&lt;/code&gt;

	&lt;ul&gt;
	&lt;li&gt;Do &lt;span class="caps"&gt;NOT&lt;/span&gt; upgrade &lt;span class="caps"&gt;CPAN&lt;/span&gt; through the &lt;span class="caps"&gt;CPAN&lt;/span&gt; shell! You have to do it manually! Thus download the cpan module from cpan.org, and execute the following commands:&lt;/li&gt;
	&lt;/ul&gt;


&lt;code&gt;
    perl Makefile.PL
    make
    make test
    sudo make install
&lt;/code&gt;

	&lt;ul&gt;
	&lt;li&gt;Change CC (C-Compiler) parameters which &lt;span class="caps"&gt;CPAN&lt;/span&gt; and Perl uses since they have options for the &lt;span class="caps"&gt;SUN C&lt;/span&gt;-Compiler which are not known to gcc:&lt;/li&gt;
	&lt;/ul&gt;


&lt;code&gt;
    sudo vim /usr/perl5/5.8.4/lib/i86pc-solaris-64int/Config.pm
    ....
     - change cccdlflags from '-KPIC' to '-fPIC'
     - change optimize from '-x03 -xspace -xildoff' to '-O3'
    ....
&lt;/code&gt;

	&lt;ul&gt;
	&lt;li&gt;Now you can start &lt;span class="caps"&gt;CPAN&lt;/span&gt; and install modules:&lt;/li&gt;
	&lt;/ul&gt;


&lt;code&gt;
    sudo perl -MCPAN -e shell
&lt;/code&gt;

	&lt;h3&gt; OpenRTSP&lt;/h3&gt;


	&lt;p&gt;In order to compile OpenRTSP for OpenSolaris do the following:&lt;/p&gt;


&lt;code&gt;
    genMakefiles solaris
    sudo ln -sf /usr/sfw/bin/gcc /usr/ucb/cc        # this is a bug workaround for OpenSolaris
&lt;/code&gt;

	&lt;h3&gt;Parallels and Qemu Installation&lt;/h3&gt;


	&lt;p&gt;In order to install OpenSolaris in these virtual machines, it is
necessary disable dma for cdrom atapi devices. For more information
check this link &lt;a href="http://www.inf.furb.br/~javito/?p=39"&gt;http://www.inf.furb.br/~javito/?p=39&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Mon, 12 Feb 2007 23:03:34 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:ac3ea876f9b2ef0a35d5e08a3736f863</guid>
      <author>igor</author>
      <link>http://blog.solaris.bytelabs.org/articles/2007/02/12/opensolaris-tips-and-tricks</link>
      <category>Hacking and Computers</category>
    </item>
  </channel>
</rss>
