<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-29699307</id><updated>2011-08-17T10:07:46.651+07:00</updated><category term='free beer'/><category term='free software'/><category term='microsoft windows'/><category term='pkgbuild'/><category term='Compiz'/><category term='Software Piracy'/><category term='jds'/><category term='Thailand Coup'/><category term='open source'/><category term='open solaris'/><category term='Thailand'/><category term='Gnome'/><category term='opensolaris solaris openoffice'/><category term='Xfce'/><category term='Games Threading'/><title type='text'>Solaris Things</title><subtitle type='html'>OpenSolaris, Thailand, and all that sort of stuff</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>28</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-29699307.post-2782203571183482201</id><published>2009-06-12T03:47:00.002+07:00</published><updated>2009-06-12T03:52:31.495+07:00</updated><title type='text'>Its been worth the wait....</title><content type='html'>&lt;span style="font-family: courier new;"&gt;# bash --version&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(255, 0, 0);"&gt;GNU bash, version 4.0.0(4)-release (&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0); font-family: courier new;"&gt;arm-pc-solaris2.11&lt;/span&gt;&lt;span style="font-family: courier new; color: rgb(255, 0, 0);"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;Copyright (C) 2009 Free Software Foundation, Inc.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;This is free software; you are free to change and redistribute it.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;There is NO WARRANTY, to the extent permitted by law.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Note to self: need to get pkgbuild to cross compile for 'arm'............&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29699307-2782203571183482201?l=solaristhings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/2782203571183482201/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29699307&amp;postID=2782203571183482201' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/2782203571183482201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/2782203571183482201'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/2009/06/its-been-worth-wait.html' title='Its been worth the wait....'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29699307.post-6267300142253218498</id><published>2007-11-10T09:21:00.000+07:00</published><updated>2007-11-10T10:48:39.497+07:00</updated><title type='text'>Whats happening</title><content type='html'>First the bad news - After the OpenSolaris.org developer summit I have not had much time to devote to OpenSolaris :(&lt;br /&gt;&lt;br /&gt;The good news is the reason why this has happened is that I have been getting ready to start work in Scotland as a contractor for &lt;a href="http://www.fidelityinfoservices.com/fnfis/"&gt;Fidelity National Information Services&lt;/a&gt;. Due to NDA's I can not reveal much about the work, but if you look at their website you can see that it involves software for banks. At the moment I am just waiting for some paperwork needed for my visa. Since I am coming from Bangkok I had to do a Tuberculosis test. This involved an X-Ray from a hospital in Bangkok, which the process was relatively simple considering a language barrier. English is not as widely spoken in Thailand as people may think, and my Thai sux. BTW the TB results was negative....&lt;br /&gt;&lt;br /&gt;Over the next year at least, I will do a lot of flying between Glasgow and Bangkok. This will be interesting. Not only a big change in timezone, but a huge change in climate. The temperature in Bangkok is around 32C (max) and 24C (min), while in Glasgow it is warm 12C (max) and 7C (min) and getting colder.&lt;br /&gt;&lt;br /&gt;Being the new kid on the block, I drew the short straw and will be working over Christmas and New Years. My wife is a little upset about this as she wont see me for about 8 weeks. On the plus side is it will be yet another country I will be able to experience Christmas and New Year. Last year I was in &lt;a href="http://www.thailandguidebook.com/provinces/phayao.html"&gt;Phayao&lt;/a&gt;, Thailand. The year before that I was in Kobe and Tokyo, Japan.&lt;br /&gt;&lt;br /&gt;As the software is developed on Windows, I have had to change my laptop back to Windows, with Solaris Express using vmware. It reminds me just how much Windows is a horrible development platform. It really does sux. Luckily it is not what the customer chose to use. I can only say that they have made an excellent choice of both operating system and hardware platform :)&lt;br /&gt;&lt;br /&gt;Another plus is that hopefully I will have time to visit the OpenSolaris user groups within the region. I will try to at least to go to a meeting of the world famous Ireland OpenSolaris User Group. This should be some good &lt;a href="http://www.urbandictionary.com/define.php?term=craic"&gt;craic&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The next post I will try to find a pub with wi-fi, open fire and fine ale.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29699307-6267300142253218498?l=solaristhings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/6267300142253218498/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29699307&amp;postID=6267300142253218498' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/6267300142253218498'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/6267300142253218498'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/2007/11/whats-happening.html' title='Whats happening'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29699307.post-7030556324899403414</id><published>2007-10-27T11:08:00.000+07:00</published><updated>2007-10-27T12:21:53.266+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Thailand'/><category scheme='http://www.blogger.com/atom/ns#' term='Software Piracy'/><title type='text'>Pirate Busters</title><content type='html'>A Bangkok Post story today &lt;a href="http://www.bangkokpost.com/topstories/topstories.php?id=123020"&gt;"Fighting the pirates"&lt;/a&gt; says there was a US-led anti-piracy conference in Bangkok this week. The was 60 police, customs officials and prosecutors from 13 countries attending. I think the key words from this is "US-led", as the US are very keen to pressure countries such as Thailand to clamp down on counterfeit products.&lt;br /&gt;&lt;br /&gt;In the article, A US Cyber spook said "counterfeit products not only hurt the economy, but are also a serious threat to the health and safety of everyone". For Thailand, I can see the safety aspect from what he is saying in relation to fake aircraft parts and pharmaceuticals. As far as the economy side goes I think a broad crackdown on every thing pirated would only be beneficial to the US. I do not think Thailand would be to keen to crack down on it's clothing industry as this would seriously harm the local economy and put many people out of work.&lt;br /&gt;&lt;br /&gt;The current strategy against piracy using IP law enforcement, I feel is currently flawed. It is aimed at keeping retail prices high to possibly maximize profits. The discrepancy here is the difference in price between the real product and the pirated copy. The difference only encourages crime as the customers are looking for value for money. Parts of the software industry has been forced through Open Source to change to charging for services rather the software itself. Companies like Sun actually give their software away. At first this may sound like a dumb idea, how does Sun make money by making something free? There is a method to the madness. Charging $0 for Solaris encourages many more people to deploy it. This gives Sun a great opportunity to sell more hardware and services based around Solaris. Will this work for other industries? In short it depends on product. I feel that companies need to look for new approaches to getting profit from their product to make piracy less attractive. The law enforcement approach is not working. It just changes your customers into criminals.&lt;br /&gt;&lt;br /&gt;Post Note: My favorite gem from the article - "&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:85%;"&gt;the mass production and distribution of counterfeit goods such as optical discs"&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:85%;"&gt;.&lt;/span&gt;&lt;/span&gt; I think the counterfeit goods here is actually the content on the disc rather then the actual disc itself :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29699307-7030556324899403414?l=solaristhings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/7030556324899403414/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29699307&amp;postID=7030556324899403414' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/7030556324899403414'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/7030556324899403414'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/2007/10/pirate-busters.html' title='Pirate Busters'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29699307.post-5534450892486026425</id><published>2007-10-25T12:54:00.000+07:00</published><updated>2007-10-25T14:20:37.471+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><category scheme='http://www.blogger.com/atom/ns#' term='Thailand'/><category scheme='http://www.blogger.com/atom/ns#' term='Software Piracy'/><title type='text'>Pirate cleanup</title><content type='html'>The &lt;a href="http://www.bangkokpost.com/"&gt;Bangkok Post&lt;/a&gt; had an &lt;a href="http://www.bangkokpost.com/241007_Database/24Oct2007_data01.php"&gt;interesting report&lt;/a&gt; about the anti-piracy group the &lt;a href="http://www.bsa.org"&gt;Business Software Alliance&lt;/a&gt; increasing it's presence in Thailand. The first thing I did was to find out who are the BSA. It's members consist of the usual anti-open source (or ones who pay lip service) IT corporations like Adobe, Microsoft, IBM etc. Hardly surprising is that companies which are largely focused producing open source like Sun, Red Hat are not members.&lt;br /&gt;&lt;br /&gt;Ok, I go to the bio's of the BSA management team and find that nobody seems to ever actually written any software! Is the focus of the BSA to promote software at all, or is it just a debt collection agency focused on software.&lt;br /&gt;&lt;br /&gt;Digging through the article they start off with the obvious and say that software piracy is rampant in Thailand. No kid Ted! The Bangkok Post does it's usual bad journalism - &lt;span style="font-style: italic;"&gt;"Various studies have shown a direct correlation between a low piracy rate and the health of a country's IT industry"&lt;/span&gt;. Mr Post, please, please provide a reference of where the study comes from. Without it my bullshit meter goes ballistic.....&lt;br /&gt;&lt;br /&gt;Here we go again - &lt;span style="font-style: italic;"&gt;"Hardee said that if Thailand were to bring down the piracy rate by 10 percentage points over the next four years, this would translate to over 5,000 highly paid IT jobs, 1.9 billion US dollars in GDP growth and over 75 million dollars in extra tax for the government"&lt;/span&gt;.  Right, are  we plucking the numbers out of the air, or is there some sort of logic behind it. My assumption here is the Mr Hardee thinks that people in Thailand can actually afford to pay for the software in the first place. It would be interesting to see how much money from the software sales stays in Thailand, and how much goes overseas.&lt;br /&gt;&lt;br /&gt;Mr Post finally provided a reference - &lt;span style="font-style: italic;"&gt;"According to a survey &lt;span style="font-weight: bold;"&gt;by the Economist Intelligence Unit&lt;/span&gt; on IT competitiveness, Thailand today languishes in 41st place out of 64 countries. Perhaps not too surprisingly, the study showed that we fared worst in terms of our legal environment, lack of R&amp;amp;D and an inadequate IT infrastructure. &lt;/span&gt;The current "lack of R&amp;amp;D" would suggest the likelihood of the "5000 highly paid IT jobs" coming from Thailand would be remote. My hunch is that they only increase in jobs in Thailand would be to translate existing or new products into Thai. Exciting stuff eh!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;"The BSA thinks we have an important role to play in helping the government and industry develop a strong IT sector"&lt;/span&gt;. I maybe a bit harsh here, but  the BSA is really only interested in getting people to pay their members for the use of the software they produce. This statement is just sugar coating. Lets call a spade a spade....&lt;br /&gt;&lt;br /&gt;Don't get me wrong here. I am all for people paying companies like Microsoft for the use of "their" software. If this is their business model then so be it. We just need to produce competitive or better Open Source software to put this old business model out of business. In my opinion the software industry and IT literacy in countries like Thailand depend on it.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;"In the first nine months of this year, the BSA has had 250 leads for corporate piracy submitted to its hotline and five of the informants have been paid a portion of the reward money of 250,000 baht"&lt;/span&gt;. Either the exchange rate is really fluctuating or Thai's are being short changed. The reward money on the US site is $1,000,000 or ~30,000,000 baht. I wonder how much money I would get for giving them address of &lt;a href="http://en.wikipedia.org/wiki/Pantip_Plaza"&gt;Pantip Plaza&lt;/a&gt; over the hotline.&lt;br /&gt;&lt;br /&gt;Hey something we can agree on - &lt;span style="font-style: italic;"&gt;"However, it was the choice of a developer to engage in software development using Open Source tools and to give it away for free, he said. Open Source is based on the principle that developers have that choice to protect their intellectual property and keep that code free."&lt;/span&gt;.&lt;br /&gt;My question is does the BSA  actively promote the use of Open Source software. I doubt it....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29699307-5534450892486026425?l=solaristhings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/5534450892486026425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29699307&amp;postID=5534450892486026425' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/5534450892486026425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/5534450892486026425'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/2007/10/pirate-cleanup.html' title='Pirate cleanup'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29699307.post-1134651840886568915</id><published>2007-04-25T14:52:00.000+07:00</published><updated>2007-04-25T15:51:25.902+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pkgbuild'/><category scheme='http://www.blogger.com/atom/ns#' term='jds'/><category scheme='http://www.blogger.com/atom/ns#' term='Xfce'/><category scheme='http://www.blogger.com/atom/ns#' term='open solaris'/><title type='text'>pkgbuild tips - 1</title><content type='html'>I have been thinking for some time that I should publish some tips for building packages using &lt;a href="http://pkgbuild.sourceforge.net/"&gt;pkgbuild&lt;/a&gt;. If you have created more then one spec file using pkgbuild, then you will know that many things are repeatable. The general process goes like time -&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Create an initial spec file from either a template or a spec file for a similar application.&lt;/li&gt;&lt;li&gt;Try a build.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;You should expect that the above should fail. Check the log file (/tmp/&lt;pkgname&gt;.log) for where it failed.&lt;/pkgname&gt; Fix the problem. Generally a typo or the build needs a patch&lt;/li&gt;&lt;li&gt;Repeat 2-3 until the prep and build works. If it actually installs the packages, then go to 7&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Look in the RPM_BUILD_ROOT directory tree in /var/tmp&lt;username&gt;&lt;pkgname&gt; for what was installed, and adjust the %files section of the spec file to match the installation.&lt;/pkgname&gt;&lt;/username&gt;&lt;/li&gt;&lt;li&gt;Go back and repeat from 2 (Note: you can short-cut this with pkgbuild)&lt;/li&gt;&lt;li&gt;Publish the spec file(s), patches, ChangeLog etc and your done.&lt;/li&gt;&lt;/ol&gt;Todays tip involves adding a patch. I  find that using 2 or 3 windows makes this really easy. The 1st window is where you do the pkgtool/pkgbuild commands and edit your spec files. You use the 2nd window to dig through the build area to find and fix any bugs or problems after a fail build. Have the 3rd window setup so you are in the /tmp directory. Once you have a change to make that requires a patch, just do somthing similar in following in the 3rd window.&lt;br /&gt;&lt;pre&gt;jdsbuild@prae&gt; cd /tmp&lt;br /&gt;jdsbuild@prae&gt; gtar fxj ~/packages/SOURCES/xfwm4-4.4.1.tar.bz2&lt;br /&gt;jdsbuild@prae&gt; mv xfwm4-4.4.1 xfwm4-4.4.1-orig&lt;br /&gt;jdsbuild@prae&gt; gtar fxj ~/packages/SOURCES/xfwm4-4.4.1.tar.bz2&lt;br /&gt;#&lt;br /&gt;# Fix the files which need to be patched.&lt;br /&gt;#&lt;br /&gt;jdsbuild@prae&gt; diff -ur xfwm4-4.4.1-orig xfwm4-4.4.1 &gt; ~/spec-files-xfce/patches/xfwm4-01-fixbadcode.diff&lt;/pre&gt;&lt;br /&gt;At this point add an entry for the patch xfwm4-01-fixbadcode.diff into the spec file and try again.&lt;br /&gt;&lt;br /&gt;If you need to add another patch, just remove the patched directory, and un-tar again.&lt;br /&gt;&lt;br /&gt;Maybe you want to merge a fix into an existing patch. Just patch the directory in /tmp and then make the changes.&lt;br /&gt;&lt;pre&gt;jdsbuild@prae&gt; cd /tmp&lt;br /&gt;jdsbuild@prae&gt; gtar fxj ~/packages/SOURCES/xfwm4-4.4.1.tar.bz2&lt;br /&gt;jdsbuild@prae&gt; mv xfwm4-4.4.1 xfwm4-4.4.1-orig&lt;br /&gt;jdsbuild@prae&gt; gtar fxj ~/packages/SOURCES/xfwm4-4.4.1.tar.bz2&lt;br /&gt;jdsbuild@prae&gt; cd xfwm4-4.4.1&lt;br /&gt;jdsbuild@prae&gt; gpatch -p1 &lt; ~/spec-files-xfce/patches/xfwm4-01-fixbadcode.diff jdsbuild@prae&gt; cd /tmp&lt;br /&gt;#&lt;br /&gt;# Fix the files which need to be patched.&lt;br /&gt;#&lt;br /&gt;jdsbuild@prae&gt; diff -ur xfwm4-4.4.1-orig xfwm4-4.4.1 &gt; ~/spec-files-xfce/patches/xfwm4-01-fixbadcode.diff&lt;/pre&gt;&lt;br /&gt;Using a shell like bash with command line editing, the process can be quite quick and easy.&lt;br /&gt;&lt;br /&gt;Have Fun!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29699307-1134651840886568915?l=solaristhings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/1134651840886568915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29699307&amp;postID=1134651840886568915' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/1134651840886568915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/1134651840886568915'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/2007/04/pkgbuild-tips-1.html' title='pkgbuild tips - 1'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29699307.post-2985045575565847893</id><published>2007-04-24T23:45:00.000+07:00</published><updated>2007-04-25T14:39:06.648+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Gnome'/><category scheme='http://www.blogger.com/atom/ns#' term='Xfce'/><category scheme='http://www.blogger.com/atom/ns#' term='Compiz'/><title type='text'>Sex on the Desktop with Solaris</title><content type='html'>My first draft of this blog went into half a page of crap about how Sun was originally really cool on the desktop, and then decided it would leave it all to Microsoft and Apple. Rather than dragging up the past (and boring you will what you with what you already know), I will focus on the here, now, and future.&lt;br /&gt;&lt;br /&gt;Having been lagging by several years, Solaris Express is now hot on the heals of todays desktop. JDS is currently Gnome 2.16 (2.18.x will be Solaris Express real soon). If you really want the latest and greatest now, you can either download and install the Vermillion developers release or build it directly from the JDS spec files. The latest and greatest Xfce Desktop (4.4.1) like Vermillion can be downloaded and installed (x86 only), or built from the Xfce spec files.&lt;br /&gt;&lt;br /&gt;While JDS and Xfce are now are rather nice now. For the real story on a sexy eye-candy Desktop you can not go past Compiz on Solaris. If you are into shimmering transparent windows etc, and you think that there is not a hope in hell that you can do this on Solaris, then you need to check out &lt;a href="http://blogs.sun.com/erwann/entry/compiz_0_5_0_packages"&gt;Erwann Chénedé's&lt;/a&gt; blog. Also if you also want transparent windows for Xfce. Install  Erwann's Compiz packages and rebuild the Xfce window manager from the spec files. Re-login and turn on the "Compositor" in the Window Teaks settings.&lt;br /&gt;&lt;br /&gt;To top this off, I have recently added the spec files for several really cool 3D Linux Games (more on the way) and wine to the SFE repository. The SFE repository has the spec files for a lot of really cool applications for Open Solaris. Check it out!&lt;br /&gt;&lt;br /&gt;The only thing missing now is the latest KDE....&lt;br /&gt;&lt;br /&gt;Below I have put together hopefully some useful links for a Sexy Desktop Solaris...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Name:&lt;/span&gt; Open Solaris Desktop Community&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Homepage:&lt;/span&gt; &lt;a href="http://www.opensolaris.org/os/community/desktop"&gt;http://www.opensolaris.org/os/community/desktop&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Discussion List:&lt;/span&gt; &lt;a href="http://www.opensolaris.org/os/community/desktop/discussions"&gt;http://www.opensolaris.org/os/community/desktop/discussions&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Name:&lt;/span&gt; JDS&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Full Name:&lt;/span&gt; Java Desktop System&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Description:&lt;/span&gt; Sun's version of the Gnome Desktop&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Project Homepage:&lt;/span&gt; &lt;a href="http://www.opensolaris.org/os/project/jds"&gt;http://www.opensolaris.org/os/project/jds&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Download URL:&lt;/span&gt; &lt;a href="http://dlc.sun.com/osol/jds/downloads/current"&gt;http://dlc.sun.com/osol/jds/downloads/current&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SVN URL:&lt;/span&gt; svn+ssh://anon@svn.opensolaris.org/svn/jds/spec-files/trunk&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Name:&lt;/span&gt; Erwann Chénedé's Weblog&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Description:&lt;/span&gt; Compiz 0.5.0 packages and patches for OpenSolaris x86&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Blog URL:&lt;/span&gt; &lt;a href="http://blogs.sun.com/erwann/entry/compiz_0_5_0_packages"&gt;http://blogs.sun.com/erwann/entry/compiz_0_5_0_packages&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Name:&lt;/span&gt; Open Solaris Xfce Project&lt;br /&gt;&lt;a name="jds-build-sources"&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Description: &lt;/span&gt;Xfce Desktop for Open Solaris&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Project Homepage:&lt;/span&gt; &lt;a href="http://www.opensolaris.org/os/project/xfce"&gt;http://www.opensolaris.org/os/project/xfce&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Download URL: &lt;/span&gt;&lt;a href="http://dlc.sun.com/osol/xfce/downloads/current"&gt;http://dlc.sun.com/osol/xfce/downloads/current&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Parent Project URL 1:&lt;/span&gt; &lt;a href="http://www.xfce.org/"&gt;http://www.xfce.org&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Parent Project URL 2:&lt;/span&gt; &lt;a href="http://goodies.xfce.org/"&gt;http://goodies.xfce.org&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SVN URL 1:&lt;/span&gt;  svn+ssh://anon@svn.opensolaris.org/svn/xfce/spec-files-xfce/trunk&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SVN URL 2:&lt;/span&gt;  svn+ssh://anon@svn.opensolaris.org/svn/xfce/xfce-goodies/trunk&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Name:&lt;/span&gt; Spec Files Extra (SFE)&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Description:&lt;/span&gt; A Repository for pkgbuild spec files (Not only Desktop)&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Project Homepage: &lt;/span&gt;&lt;a href="http://pkgbuild.sourceforge.net/"&gt;http://pkgbuild.sourceforge.net&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SVN URL:&lt;/span&gt; &lt;a href="https://svn.sourceforge.net/svnroot/pkgbuild/spec-files-extra/trunk"&gt;https://svn.sourceforge.net/svnroot/pkgbuild/spec-files-extra/trunk&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Name:&lt;/span&gt; Build Recipes Reference&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Description:&lt;/span&gt; List of build files, scripts and patches for Open Source Software on Solaris&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;URL:&lt;/span&gt; &lt;a href="http://www.genunix.org/wiki/index.php/BuildRecipesReference"&gt;http://www.genunix.org/wiki/index.php/BuildRecipesReference&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29699307-2985045575565847893?l=solaristhings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/2985045575565847893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29699307&amp;postID=2985045575565847893' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/2985045575565847893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/2985045575565847893'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/2007/04/sex-on-desktop-with-solaris.html' title='Sex on the Desktop with Solaris'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29699307.post-1258934734307552437</id><published>2006-11-02T13:09:00.000+07:00</published><updated>2006-11-02T14:03:20.799+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='opensolaris solaris openoffice'/><title type='text'>OpenOffice icon fix for Solaris</title><content type='html'>One thing that has always bugged me when I install Solaris and add OpenOffice.org 2.x, is that the icons for OpenOffice.org never appear next to their menu entries in JDS. I know it is not life threatening, or stops the application for working. It just looks bad!&lt;br /&gt;&lt;br /&gt;A quick and dirty fix to this is to change the "Icon" entry in the relevent .desktop files in /usr/share/applications. For a slightly quicker and cleaner fix I have written a small script which just adds symbolic links to the installed icon files. The script does this by adding the links directly to the OpenOffice.org desktop integration installed package. This ensures that the links are removed when the package is removed.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;# Usage: openoffice-icon-fix&lt;br /&gt;# &lt;br /&gt;# Currently OpenOffice.org for Solaris is delivered with the wrong filenames&lt;br /&gt;# for the icons in the .desktop files. This means the icons will not show&lt;br /&gt;# up in the JDS menus. To work around this, this script adds a link to the&lt;br /&gt;# original file the Solaris package database, which in-turn creates a&lt;br /&gt;# physical link in the filesystem (via installf -f)&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;PKGINST=openofficeorg-desktop-integratn&lt;br /&gt;APPS="writer printeradmin math impress draw calc base"&lt;br /&gt;PIXDIR=/usr/share/pixmaps&lt;br /&gt;OLD=openoffice.org-2.0&lt;br /&gt;NEW=openofficeorg-20&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Check to see if OpenOffice.org is installed.&lt;br /&gt;#&lt;br /&gt;/usr/bin/pkginfo | /usr/bin/grep ${PKGINST} &gt;/dev/null || {&lt;br /&gt;    echo "${PKGINST} is not installed."&lt;br /&gt;    echo "Please install OpenOffice.org 2.x, before running this command"&lt;br /&gt;    exit 1&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Note: The trailing 's' on the end of the installf command is NOT a typo!&lt;br /&gt;#&lt;br /&gt;for i in ${APPS}&lt;br /&gt;do&lt;br /&gt;    /usr/sbin/installf ${PKGINST} ${PIXDIR}/${NEW}-${i}.png=${OLD}-${i}.png s&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;/usr/sbin/installf -f openofficeorg-desktop-integratn&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Good Hunting!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29699307-1258934734307552437?l=solaristhings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/1258934734307552437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29699307&amp;postID=1258934734307552437' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/1258934734307552437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/1258934734307552437'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/2006/11/openoffice-icon-fix-for-solaris.html' title='OpenOffice icon fix for Solaris'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29699307.post-3114777178906357059</id><published>2006-10-21T11:09:00.000+07:00</published><updated>2006-10-21T11:40:33.875+07:00</updated><title type='text'>VOLD is dead. Long live Tamarack</title><content type='html'>After a quick check of the recent &lt;a href="http://dlc.sun.com/osol/on/downloads/current/on-changelog-20061016.html"&gt;ON nevada changelog&lt;/a&gt;, I saw that one of my pet Solaris hates "vold" has been deleted and replaced with "PSARC case 2005/399 : Tamarack: Removable Media Enhancements in Solaris". Sun THANK YOU!!!&lt;br /&gt;&lt;br /&gt;Not only is vold gone, but you get &lt;a href="http://freedesktop.org/wiki/Software/hal"&gt;hal&lt;/a&gt;, and &lt;a href="http://en.wikipedia.org/wiki/Joliet_(file_system)"&gt;joliet extensions&lt;/a&gt; thrown in to the mix. A quick download and bfu of the on-bfu-20061016 archive, and this is what it looks like to mount a DVD backup of my photographs burnt from MS Windows, and a memory stick -&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;root@bangkok&gt; uname -a &lt;br /&gt;SunOS bangkok.priv 5.11 opensol-20061016 i86pc i386 i86pc&lt;br /&gt;root@bangkok&gt; df -h -F hsfs&lt;br /&gt;Filesystem             size   used  avail capacity  Mounted on&lt;br /&gt;/dev/dsk/c1t0d0s2      2.7G   2.7G     0K   100%    /media/Photos10042006&lt;br /&gt;root@bangkok&gt; df -h -F pcfs&lt;br /&gt;Filesystem             size   used  avail capacity  Mounted on&lt;br /&gt;/dev/dsk/c2t0d0p0:1    123M   173K   123M     1%    /media/MEM128&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;As you can see no more /vol, /cdrom, /rmdisk, just the real device name, and the /media mountpoint. Also all the filenames on the DVD are humanly readable.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29699307-3114777178906357059?l=solaristhings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/3114777178906357059/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29699307&amp;postID=3114777178906357059' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/3114777178906357059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/3114777178906357059'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/2006/10/vold-is-dead-long-live-tamarack.html' title='VOLD is dead. Long live Tamarack'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29699307.post-7529213392233194166</id><published>2006-10-07T21:19:00.000+07:00</published><updated>2006-10-07T22:20:20.310+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Games Threading'/><title type='text'>INQ thinks Quad cores too many cores for games.</title><content type='html'>After speaking to "&lt;a href="http://www.theinquirer.net/default.aspx?article=34916"&gt;many developers including some big names&lt;/a&gt;", the Inquirer said that you should forget quad core CPU's for games!&lt;br /&gt;&lt;br /&gt;What a load of rubbish. Plenty of games impress me that who ever built the game is obviously a gifted programmer. The following narrow minded statement, if it did come from real games programmers, does makes me wonder.&lt;br /&gt;&lt;blockquote&gt;You can keep one core busy with the physics and collision detection, second core will have to wait for the score to move on with the Artificial intelligence while the third core could possible calculate the graphic data. In this best case scenario you have to realise that the core number two and three would always have to wait for the core number one to finish its job and pass the job to the cores two and three. In this concept there is absolutely no place for quad core as games are non parallel applications&lt;/blockquote&gt;&lt;br /&gt;Most games I play, I am not the only one playing. If it is not another human or humans, then you play against several computer 'AI' characters. The whole idea the each section of the game is bound to a particular core just stinks of a bad programming model. Maybe they have never heard of threading (or just scared of it). To say that "game are non parallel applications", is just grossly incorrect.&lt;br /&gt;&lt;br /&gt;Lets take an old favorites like Galaga. Very simple... There is my spaceship at the bottom of the screen. It can fire several missiles at about 20 enemy spaceships. Now if you treat my space ship, the missiles, and the enemy space ships as different objects and assign at least one thread to each. You end up with a very parallel application, where the more cores the merrier.&lt;br /&gt;&lt;br /&gt;Is it a case of gaming programmers still using 1980's programming tools/models, or is it just another bad INQ article. I am sure it is the later.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29699307-7529213392233194166?l=solaristhings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/7529213392233194166/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29699307&amp;postID=7529213392233194166' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/7529213392233194166'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/7529213392233194166'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/2006/10/inq-thinks-quad-cores-too-many-cores.html' title='INQ thinks Quad cores too many cores for games.'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29699307.post-3727121987250277827</id><published>2006-09-20T19:32:00.000+07:00</published><updated>2006-09-20T20:08:03.206+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Thailand Coup'/><title type='text'>Its a Coup</title><content type='html'>Last night I have just sat through my first coup. All the action was only 5km's away and it just seemed like another Tuesday night. The first I knew about it was when I tried to access some of the online Thailand newspaper and they responded after a long wait with lots of PHP/MYSQL errors. A quick flick through the television channels were exactly the same. Pre-recorded music and images of the King. &lt;br /&gt;&lt;br /&gt;Luckily, I could still access the CNN and BBC websites to find what was going on. Through the whole thing there was the sound of 'booms' in the distance. Luckily, nobody was shooting at each other, and it was just the usual Bangkok thunderstorm.&lt;br /&gt;&lt;br /&gt;Today, some of the newspapers are saying the coup will not affect tourism. I would not be that optimistic, though if you are comming to Thailand, then still come. It is safe!  Tomorrow, things should be back to normal.&lt;br /&gt;&lt;br /&gt;What lessons could be learnt from this? Maybe the online newspapers need to upgrade some of their hardware. They didn't cope.... I am sure some T2000's would :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29699307-3727121987250277827?l=solaristhings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/3727121987250277827/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29699307&amp;postID=3727121987250277827' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/3727121987250277827'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/3727121987250277827'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/2006/09/its-coup.html' title='Its a Coup'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29699307.post-3217028910977497104</id><published>2006-09-13T10:49:00.000+07:00</published><updated>2006-09-13T11:36:24.251+07:00</updated><title type='text'>Almost.... But no cookie today.</title><content type='html'>Recently one of my girlfriend's friends decided to do a computer course. So now she wants to buy a new computer. Cool lets go shopping. After walking around the many levels of the infamous &lt;a href="http://en.wikipedia.org/wiki/Pantip_Plaza"&gt;Pantip Plaza&lt;/a&gt; in Bangkok, she decided she wanted a HP. Cool!&lt;br /&gt;&lt;br /&gt;My first assumption was that since it is a branded computer, it will come with the usual Microsft Virusware installed. Looking through the documentation though, I find that it only comes with a "Free DOS Operating System". Wow, times have changed.... but DOS just makes it totally useless. &lt;span style="font-style:italic;"&gt;HP, why not at least install a free Linux Distribution&lt;/span&gt;?.&lt;br /&gt;&lt;br /&gt;Rather, than buying Windows, lets look at the options -&lt;br /&gt;&lt;ul&gt;&lt;a href="http://www.opensolaris.org"&gt;Solaris Express&lt;/a&gt; - That would be cool. I have the DVD...&lt;br /&gt;&lt;a href="http://www.ubuntu.com/"&gt;Ubuntu&lt;/a&gt; - Quite nice for beginner. I also have the DVD...&lt;br /&gt;&lt;a href="http://www.opentle.org/"&gt;Linux TLE&lt;/a&gt; - Very good for her since she really only speaks Thai&lt;/ul&gt;&lt;br /&gt;So, I ask the question. "What computer course are you doing?" - Windows..... DOH!!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29699307-3217028910977497104?l=solaristhings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/3217028910977497104/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29699307&amp;postID=3217028910977497104' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/3217028910977497104'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/3217028910977497104'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/2006/09/almost-but-no-cookie-today.html' title='Almost.... But no cookie today.'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29699307.post-2042200910548044650</id><published>2006-09-13T10:10:00.000+07:00</published><updated>2006-09-13T10:33:35.054+07:00</updated><title type='text'>JDS has new fan</title><content type='html'>When a friend came to visit the other day, she asked if she could use my computer for a while. Hmmmm, no problems. This is a Windows only person, and my laptop only has OpenSolaris, no Microsoft Windows. I won't say a word and see what happens. Ok, so I went and watched a Thai soapy on TV (Contains plenty of hate, violence, blood and guts. Absolutely no sex! - strange logic), while she typed away.&lt;br /&gt;&lt;br /&gt;After she had finished she commented "&lt;span style="font-style:italic;"&gt;I really like your computer. It is nice and easy to use&lt;/span&gt;". Wow, It looks like the &lt;a href="http://www.opensolaris.org/os/project/jds"&gt;JDS&lt;/a&gt; team have done a good job.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29699307-2042200910548044650?l=solaristhings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/2042200910548044650/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29699307&amp;postID=2042200910548044650' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/2042200910548044650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/2042200910548044650'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/2006/09/jds-has-new-fan.html' title='JDS has new fan'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29699307.post-3946141410948331316</id><published>2006-09-01T16:04:00.000+07:00</published><updated>2006-09-01T16:57:39.780+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><category scheme='http://www.blogger.com/atom/ns#' term='free beer'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft windows'/><category scheme='http://www.blogger.com/atom/ns#' term='open solaris'/><category scheme='http://www.blogger.com/atom/ns#' term='free software'/><title type='text'>Chinese Pirates</title><content type='html'>According to a report in the &lt;a href="http://www.bangkokpost.com/breaking_news/breakingnews.php?id=112606"&gt;Bangkok Post&lt;/a&gt;, &lt;span style="font-style: italic;"&gt;"Nearly half of all books, films, music CDs and software sold in China are illegally copied"&lt;/span&gt;.  Now I find it very hard to believe that it could be less than 50%. The Chinese are much smarter than that!&lt;br /&gt;&lt;br /&gt;I have always had the view that if the sticker price is much higher than the price to reproduce, than you will always have illegal copies being made. For software, I would love for Microsoft (and others) to find a secure way of protecting their licensing of their software. This would force people to look at the alternative free Open Source software such as &lt;a href="http://www.opensolaris.org"&gt;Solaris&lt;/a&gt;, BSD, Linux and &lt;a href="http://www.openoffice.org"&gt;Open Office&lt;/a&gt;. Companies like Microsoft using the old "high admission fee" model will one day have to change their ways. They maybe able to hold their market share for a little longer in the developed world, but there is a much larger market in the developing world who are much more price sensitive.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29699307-3946141410948331316?l=solaristhings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/3946141410948331316/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29699307&amp;postID=3946141410948331316' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/3946141410948331316'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/3946141410948331316'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/2006/09/chinese-pirates.html' title='Chinese Pirates'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29699307.post-5759719488146521612</id><published>2006-08-30T12:14:00.000+07:00</published><updated>2006-08-30T13:20:43.629+07:00</updated><title type='text'>The missing benchmarks</title><content type='html'>When puchasing computer hardware, unless you get your hands on the equipment before you purchase, you have to rely on past experience, experience of others, or benchmarks, to see if they have enough capacity for your users needs.&lt;br /&gt;&lt;br /&gt;There is a large wealth of information you can use to judge server capacity. There is also plenty of information for storage capacity.  One place that is almost always overlooked is network devices. I have seen many people in the past, blindly using the vendors advertised specifications to determine their needs. The assumption that they have Gig ports on a switch and the vendor claims the backplane is "HUGE", does not mean that you can assume that the actual performance will be "wire" speed.&lt;br /&gt;&lt;br /&gt;If you are in the market for network hardware at the moment, before you go too far you should have a sober look at &lt;a href="http://blogs.sun.com/sbullen/entry/who_buys_cisco_3750_s"&gt;Simon Bullen's blog on Cisco's 3750&lt;/a&gt;. I have always had my doubts about Cisco equipment in the past, and the reasons why people choose it over other vendors. It would be nice if we could have somewhat neutral benchmark standards body like www.spec.org to produce a set of network equipment benchmarks. My searching so far only finds vendors (or their proxies) competitive benchmarking their opposition, and of course whipping their ass. You would not expect less.&lt;br /&gt;&lt;br /&gt;While independent results from people like Simon are fantastic. It would be nice to see network vendors put their crown jewels on the benchmarking chopping block for all to see. The nice thing about this is if they don't post results for certain equipment, they may be selling you a brumby.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29699307-5759719488146521612?l=solaristhings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/5759719488146521612/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29699307&amp;postID=5759719488146521612' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/5759719488146521612'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/5759719488146521612'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/2006/08/missing-benchmarks.html' title='The missing benchmarks'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29699307.post-115579797475558002</id><published>2006-08-17T10:27:00.000+07:00</published><updated>2006-08-17T13:59:34.893+07:00</updated><title type='text'>PR Nightmare</title><content type='html'>Is there a breakout of foot-in-mouth disease at IBM lately, or have do they just have a drug problem? I know the Solar System is currently being redefined, but what planet are they on?&lt;br /&gt;&lt;br /&gt;Their recent comments on Sun open source creditials do make you wonder just what are they thinking. Due to their work on the Linux kernel, Apache, Eclipse etc, IBM have been able to enjoy the admoration of the open source community, while at the same time keeping their products very closed. To now it has been very clever marketing. The problem they have now is that some commentators are starting to see through this, and are asking why IBM does not open source its software and hardware like Sun Microsystems has been doing.&lt;br /&gt;&lt;br /&gt;The obvious reply to this to avoid the focus on IBM's closed products, would have actually been to acknowledge Sun's effort, and focus on how long it takes to change a product of the size of Solaris and AIX from multiple closed source licenses to an open source license. Instead they have decided to attack the Open Solaris and Open Sparc projects stating that they are not truely open. This is just total bullshit!&lt;br /&gt;&lt;br /&gt;Rather than hosing down the question, giving the commentators little to write about, they have decided to give the press a juicy story. This would be fine if they had a large swag of products based on open source. The fact is that they have not, and the press have now alerted to a renewed battle between IBM and Sun with IBM standing on very shakey ground, surrounded by mountains of closed source and hardware. &lt;br /&gt;&lt;br /&gt;IBM's current statements are probably an indication of they think Sun's push to open source not only it's entire software stack, but also hardware, is a medium to long term threat to IBM position. It looks from what they are saying, is at the moment they are scratching themselves to find a solution. Using verbal attacks on Sun is just plain counter productive. I think the future may be tough for companies that dabble in open source while at the same time keeping a very closed product line. Hypocrisy does not further their cause.&lt;br /&gt;&lt;br /&gt;What can IBM do to get themselves out of this mess? I think a good start would be to avoid opening their mouths, and start work on a timetable to start opening up their products. They state that their customers are not interested in AIX enough, but I find this very hard to believe. When Solaris was re-released onto x86 hardware, they stated that the was not enough interest from their customers to release software for the platform. Their stance changed very quickly when they got a tap on the shoulder from some of their largest customers. I think if they are seeing little interest from their customers, then this is a more of a worrying sign of the future of AIX. I hope this is not the case.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29699307-115579797475558002?l=solaristhings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/115579797475558002/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29699307&amp;postID=115579797475558002' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/115579797475558002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/115579797475558002'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/2006/08/pr-nightmare.html' title='PR Nightmare'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29699307.post-115548698596168574</id><published>2006-08-13T22:52:00.000+07:00</published><updated>2006-08-13T23:36:26.770+07:00</updated><title type='text'>Don't be afraid of mdb - cont</title><content type='html'>I thought I would just quickly show why I did not use any "optimize" flags when I compiled my example code. At the same time I show the er_src program which part of Sun Studio.&lt;br /&gt;&lt;br /&gt;First I compile the program with the '-g' flag. This will give er_src access to the source code.&lt;br /&gt;&lt;pre&gt;doug@bangkok&gt; &lt;span style="font-weight: bold;"&gt;cc -g -o ./makecore ./makecore.c&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;Next run the program and do a pstack. Everything looks fine&lt;br /&gt;&lt;pre&gt;doug@bangkok&gt; &lt;span style="font-weight: bold;"&gt;./makecore&lt;/span&gt;&lt;br /&gt;Memory fault(coredump)&lt;br /&gt;doug@bangkok&gt; &lt;span style="font-weight: bold;"&gt;/bin/pstack core&lt;/span&gt;&lt;br /&gt;core 'core' of 102246:  ./makecore&lt;br /&gt;08050775 fruitloop (8060958, 804710c, 80507bb, 8047210, 804712c, 80506ca) + 15&lt;br /&gt;08050794 giveitatry (8047210, 804712c, 80506ca, 1, 8047138, 8047140) + 14&lt;br /&gt;080507bb main     (1, 8047138, 8047140) + b&lt;br /&gt;080506ca _start   (1, 8047278, 0, 8047283, 8047290, 80472ca) + 7a&lt;br /&gt;&lt;/pre&gt;Ok, lets have a look at what er_src does&lt;br /&gt;&lt;pre&gt;doug@bangkok&gt; &lt;span style="font-weight: bold;"&gt;/opt/SUNWspro/bin/er_src -func ./makecore&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Functions sorted in lexicographic order&lt;br /&gt;&lt;br /&gt;Load Object: &lt;makecore&gt;&lt;br /&gt;&lt;br /&gt;   Address     Size        Name&lt;br /&gt;&lt;br /&gt; 0x000005e0        16      @plt&lt;br /&gt; 0x000005f0        16      __fpstart&lt;br /&gt; 0x000006dc       123      __fsr&lt;br /&gt; 0x00000620        16      _exit&lt;br /&gt; 0x000007ec        27      _fini&lt;br /&gt; 0x00000640        16      _get_exit_frame_monitor&lt;br /&gt; 0x000007d0        27      _init&lt;br /&gt; 0x00000650       139      _start&lt;br /&gt; 0x00000610        16      atexit&lt;br /&gt; 0x00000600        16      exit&lt;br /&gt; 0x00000630        16      printf&lt;br /&gt; 0x00000760        30      fruitloop&lt;br /&gt; 0x00000780        38      giveitatry&lt;br /&gt; 0x000007b0        29      main&lt;br /&gt;&lt;br /&gt;doug@bangkok&gt; &lt;span style="font-weight: bold;"&gt;/opt/SUNWspro/bin/er_src -disasm fruitloop ./makecore&lt;/span&gt;&lt;br /&gt;Annotated disassembly&lt;br /&gt;---------------------------------------&lt;br /&gt;Source file: ./makecore.c&lt;br /&gt;Object file: ./makecore&lt;br /&gt;Load Object: ./makecore&lt;br /&gt;    1. #include &lt;stdio.h&gt;&lt;br /&gt;    2. #include &lt;strings.h&gt;&lt;br /&gt;    3.&lt;br /&gt;    4. static void&lt;br /&gt;    5. fruitloop(){&lt;br /&gt;       &lt;function:&gt;&lt;br /&gt;       [ 5]  8050760:  pushl   %ebp&lt;br /&gt;       [ 5]  8050761:  movl    %esp,%ebp&lt;br /&gt;       [ 5]  8050763:  subl    $4,%esp&lt;br /&gt;    6.         char *p;&lt;br /&gt;    7.         p=(char *)NULL;&lt;br /&gt;       [ 7]  8050766:  movl    $0,-4(%ebp)&lt;br /&gt;    8.         *p='c';&lt;br /&gt;       [ 8]  805076d:  movl    $0x63,%eax&lt;br /&gt;       [ 8]  8050772:  movl    -4(%ebp),%edx&lt;br /&gt;       [ 8]  8050775:  movb    %al,0(%edx)&lt;br /&gt;       [ 8]  8050778:  jmp     .+4 [ 0x805077c ]&lt;br /&gt;       [ 8]  805077a:  nop&lt;br /&gt;       [ 8]  805077b:  nop&lt;br /&gt;    9. }&lt;br /&gt;       [ 9]  805077c:  leave&lt;br /&gt;       [ 9]  805077d:  ret&lt;br /&gt;   10.&lt;br /&gt;   11. static void&lt;br /&gt;   12. giveitatry(){&lt;br /&gt;       &lt;function:&gt;&lt;br /&gt;       [12]  8050780:  pushl   %ebp&lt;br /&gt;       [12]  8050781:  movl    %esp,%ebp&lt;br /&gt;       [12]  8050783:  subl    $4,%esp&lt;br /&gt;   13.         char *msg="Ahh we made it!\n";&lt;br /&gt;       [13]  8050786:  leal    0x8060958,%eax&lt;br /&gt;       [13]  805078c:  movl    %eax,-4(%ebp)&lt;br /&gt;   14.&lt;br /&gt;   15.         fruitloop();&lt;br /&gt;       [15]  805078f:  call    fruitloop [ 0x8050760, .-0x2f ]&lt;br /&gt;   16.         (void)printf(msg);&lt;br /&gt;       [16]  8050794:  movl    -4(%ebp),%eax&lt;br /&gt;       [16]  8050797:  pushl   %eax&lt;br /&gt;       [16]  8050798:  call    printf [ 0x8050630, .-0x168 ]&lt;br /&gt;       [16]  805079d:  addl    $4,%esp&lt;br /&gt;       [16]  80507a0:  jmp     .+4 [ 0x80507a4 ]&lt;br /&gt;       [16]  80507a2:  nop&lt;br /&gt;       [16]  80507a3:  nop&lt;br /&gt;   17. }&lt;br /&gt;       [17]  80507a4:  leave&lt;br /&gt;       [17]  80507a5:  ret&lt;br /&gt;   18.&lt;br /&gt;   19. int&lt;br /&gt;   20. main(int argc, char **argv){&lt;br /&gt;       &lt;function:&gt;&lt;br /&gt;       [20]  80507b0:  pushl   %ebp&lt;br /&gt;       [20]  80507b1:  movl    %esp,%ebp&lt;br /&gt;       [20]  80507b3:  subl    $4,%esp&lt;br /&gt;   21.         giveitatry();&lt;br /&gt;       [21]  80507b6:  call    giveitatry [ 0x8050780, .-0x36 ]&lt;br /&gt;   22.         return(0);&lt;br /&gt;       [22]  80507bb:  movl    $0,-4(%ebp)&lt;br /&gt;       [22]  80507c2:  jmp     .+6 [ 0x80507c8 ]&lt;br /&gt;       [22]  80507c4:  jmp     .+4 [ 0x80507c8 ]&lt;br /&gt;       [22]  80507c6:  nop&lt;br /&gt;       [22]  80507c7:  nop&lt;br /&gt;   23. }&lt;br /&gt;       [23]  80507c8:  movl    -4(%ebp),%eax&lt;br /&gt;       [23]  80507cb:  leave&lt;br /&gt;       [23]  80507cc:  ret&lt;br /&gt;&lt;/function:&gt;&lt;/function:&gt;&lt;/function:&gt;&lt;/strings.h&gt;&lt;/stdio.h&gt;&lt;/makecore&gt;&lt;/pre&gt;Now, that is really nice. The C program is listed with the assembly code for the corresponding C code. It makes a very nice assembly language tutorial. Now, lets do the same, but compile using the "&lt;span style="font-style: italic;"&gt;-fast&lt;/span&gt;" flag. &lt;span style="font-style: italic;"&gt;(-fast is actually a macro for several other flags. It is known to generally give the best optimized code for your system with the least effort)&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;doug@bangkok&gt; &lt;span style="font-weight: bold;"&gt;cc -fast -g -o ./makecore ./makecore.c&lt;/span&gt;&lt;br /&gt;doug@bangkok&gt; ./makecore&lt;br /&gt;Memory fault(coredump)&lt;br /&gt;doug@bangkok&gt; /bin/pstack core&lt;br /&gt;core 'core' of 102283:  ./makecore&lt;br /&gt;08050850 main     (1, 8047278, 0, 8047283, 8047290, 80472ca)&lt;br /&gt;&lt;/pre&gt;Hmmm, this time it stopped in function main. Lets look at what -&lt;span style="font-style: italic;"&gt;fast&lt;/span&gt; did to the code.&lt;br /&gt;&lt;pre&gt;doug@bangkok&gt; &lt;span style="font-weight: bold;"&gt;/opt/SUNWspro/bin/er_src -disasm fruitloop ./makecore&lt;/span&gt;&lt;br /&gt;Annotated disassembly&lt;br /&gt;---------------------------------------&lt;br /&gt;Source file: ./makecore.c&lt;br /&gt;Object file: ./makecore&lt;br /&gt;Load Object: ./makecore&lt;br /&gt;    1. #include &lt;stdio.h&gt;&lt;br /&gt;    2. #include &lt;strings.h&gt;&lt;br /&gt;    3.&lt;br /&gt;    4. static void&lt;br /&gt;    5. fruitloop(){&lt;br /&gt;    6.         char *p;&lt;br /&gt;    7.         p=(char *)NULL;&lt;br /&gt;    8.         *p='c';&lt;br /&gt;       &lt;function:&gt;&lt;br /&gt;       [ 8]  8050820:  movb    $0x63,0&lt;br /&gt;    9. }&lt;br /&gt;       [ 9]  8050827:  ret&lt;br /&gt;       &lt;function:&gt;&lt;br /&gt;       [ 8]  8050830:  movb    $0x63,0&lt;br /&gt;   10.&lt;br /&gt;   11. static void&lt;br /&gt;   12. giveitatry(){&lt;br /&gt;   13.         char *msg="Ahh we made it!\n";&lt;br /&gt;   14.&lt;br /&gt;&lt;br /&gt;  &lt;span style="font-style: italic;"&gt;Function fruitloop inlined from source file ./makecore.c into the code for the following line.&lt;/span&gt;  0 loops inlined&lt;br /&gt;   15.         fruitloop();&lt;br /&gt;   16.         (void)printf(msg);&lt;br /&gt;       [16]  8050837:  subl    $8,%esp&lt;br /&gt;       [16]  805083a:  pushl   $0x80609f4&lt;br /&gt;       [16]  805083f:  call    printf [ 0x8050630, .-0x20f ]&lt;br /&gt;       [16]  8050844:  addl    $0xc,%esp&lt;br /&gt;   17. }&lt;br /&gt;       [17]  8050847:  ret&lt;br /&gt;       &lt;function:&gt;&lt;br /&gt;       [ 8]  8050850:  movb    $0x63,0&lt;br /&gt;       [16]  8050857:  subl    $8,%esp&lt;br /&gt;       [16]  805085a:  pushl   $0x80609f4&lt;br /&gt;       [16]  805085f:  call    printf [ 0x8050630, .-0x22f ]&lt;br /&gt;       [16]  8050864:  addl    $0xc,%esp&lt;br /&gt;   18.&lt;br /&gt;   19. int&lt;br /&gt;   20. main(int argc, char **argv){&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   Function giveitatry inlined from source file ./makecore.c into the code for the following line.  0 loops inlined&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   Function fruitloop inlined from source file ./makecore.c into inline copy of function giveitatry.  0 loops inlined&lt;/span&gt;&lt;br /&gt;   21.         giveitatry();&lt;br /&gt;   22.         return(0);&lt;br /&gt;       [22]  8050867:  xorl    %eax,%eax&lt;br /&gt;       [22]  8050869:  ret&lt;br /&gt;   23. }&lt;br /&gt;&lt;/function:&gt;&lt;/function:&gt;&lt;/function:&gt;&lt;/strings.h&gt;&lt;/stdio.h&gt;&lt;/pre&gt;As you can read from the comments, both of the functions were inlined. Therefore they are now part of the 'main' function.  The 'er_src' program is really neat app. Lets see the comment change when we tell it not to inline.&lt;br /&gt;&lt;pre&gt;doug@bangkok&gt; &lt;span style="font-weight: bold;"&gt;cc -fast -g -xinline=no%fruitloop -o ./makecore ./makecore.c&lt;/span&gt;&lt;br /&gt;doug@bangkok&gt; &lt;span style="font-weight: bold;"&gt;/opt/SUNWspro/bin/er_src -disasm fruitloop ./makecore&lt;/span&gt;&lt;br /&gt;Annotated disassembly&lt;br /&gt;---------------------------------------&lt;br /&gt;Source file: ./makecore.c&lt;br /&gt;Object file: ./makecore&lt;br /&gt;Load Object: ./makecore&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;    5. fruitloop(){&lt;br /&gt;    6.         char *p;&lt;br /&gt;    7.         p=(char *)NULL;&lt;br /&gt;    8.         *p='c';&lt;br /&gt;       &lt;function:&gt;&lt;br /&gt;       [ 8]  8050820:  movb    $0x63,0&lt;br /&gt;    9. }&lt;br /&gt;       [ 9]  8050827:  ret&lt;br /&gt;   10.&lt;br /&gt;   11. static void&lt;br /&gt;   12. giveitatry(){&lt;br /&gt;   13.         char *msg="Ahh we made it!\n";&lt;br /&gt;   14.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   Function fruitloop &lt;span style="font-weight: bold;"&gt;not&lt;/span&gt; inlined because user &lt;span style="font-weight: bold;"&gt;explicitly requested&lt;/span&gt; that it not be inlined&lt;/span&gt;&lt;br /&gt;&lt;/function:&gt;&lt;/pre&gt;If you are playing around with optimizing code, then er_src is one tool you should use.&lt;br /&gt;&lt;br /&gt;Have Fun!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29699307-115548698596168574?l=solaristhings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/115548698596168574/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29699307&amp;postID=115548698596168574' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/115548698596168574'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/115548698596168574'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/2006/08/dont-be-afraid-of-mdb-cont.html' title='Don&apos;t be afraid of mdb - cont'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29699307.post-115548087554361694</id><published>2006-08-13T20:39:00.000+07:00</published><updated>2006-08-13T21:54:35.630+07:00</updated><title type='text'>Don't be afraid of mdb</title><content type='html'>Many Solaris system admins or developers would know that Solaris has some very good debugging tools.   Most sysadmins would know there is a command called mdb. Sadly most would have either never used it, or was scared off when they scanned through the documentation. While using mdb does require a good knowledge of the Solaris internals, and some assembly language skills, there are times where it is probably the only (or best)  tool for the job.&lt;br /&gt;&lt;br /&gt;Consider the case where you have an application that your company has been using for a long time.  Something has changed on the system, and now it crashes when it is run. Since the person who wrote the application now does not work for your company anymore and nobody knows where the source code is, you have a problem. To make things worst, when you do a pstack on the core file, you find that they have “stripped” the binary of its symbol table to save a few bytes. Your options are now really limited to do any useful debugging. Enter 'mdb'....&lt;br /&gt;&lt;br /&gt;Now to simulate this I have created a small C program, with a null pointer buried in a couple of functions. I compile the program (not using any optimizations as the compiler will inline all of the   functions as they are very small), and then run the strip command on it. During running the program we get not a very useful error message, and a core dump. Argggg!&lt;br /&gt;&lt;br /&gt;Running a pstack on the binary, because it was stripped, pstack returns an address with “&lt;span style="font-style: italic;"&gt;????????&lt;/span&gt;”, as the function name. Ah, it is now turned into a challenge.&lt;br /&gt;&lt;pre&gt;doug@bangkok&gt; &lt;span style="font-weight: bold;"&gt;/bin/pstack core&lt;/span&gt;&lt;br /&gt;core 'core' of 101996:       ./makecore&lt;br /&gt;080506d5 ???????? (8060898, 80470fc, 805071b, 804720c, 8047124, 805062a)&lt;br /&gt;080506f4 ???????? (804720c, 8047124, 805062a, 1, 8047130, 8047138)&lt;br /&gt;0805071b main     (1, 8047130, 8047138) + b&lt;br /&gt;0805062a _start   (1, 8047274, 0, 804727f, 804728c, 80472c6) + 7a&lt;br /&gt;&lt;/pre&gt;You can get the similar output from the “::stack” command, within mdb.&lt;br /&gt;&lt;pre&gt;doug@bangkok&gt; &lt;span style="font-weight: bold;"&gt;mdb core&lt;/span&gt;&lt;br /&gt;Loading modules: [ libc.so.1 ld.so.1 ]&lt;br /&gt;&gt; &lt;span style="font-weight: bold;"&gt;::stack&lt;/span&gt;&lt;br /&gt;0x80506d5(8060898, 80470fc, 805071b, 804720c, 8047124, 805062a)&lt;br /&gt;(804720c, 8047124, 805062a, 1, 8047130, 8047138)&lt;br /&gt;main+0xb(1, 8047130, 8047138)&lt;br /&gt;_start+0x7a(1, 8047274, 0, 804727f, 804728c, 80472c6)&lt;br /&gt;&lt;/pre&gt;Since there is nothing in human readable form, at this point most people would look elsewhere or through it in the too hard basket. If you know a little assembly language (32bit x86 in this case), you should probably continue on. A good starting point would be the assembly listing of the function where it bombs out.  The first address “&lt;span style="font-style: italic;"&gt;0x80506d5&lt;/span&gt;” is for the instruction where we bombed out. Doing a disassemble backwards from this address is tedious, especially if this instruction is a long way from the beginning. The address on the next line  “&lt;span style="font-style: italic;"&gt;0x80506f4&lt;/span&gt;” is actually more useful. It is the return address of the function, which should be the next instruction after the function call. The function calling code should be immediately before this. Lets attack it with the disassembler built into 'mdb' byte by byte.&lt;br /&gt;&lt;pre&gt;&gt; &lt;span style="font-weight: bold;"&gt;80506f4::dis&lt;/span&gt;&lt;br /&gt;0x80506f4:                      movl   -0x4(%ebp),%eax&lt;br /&gt;&gt; &lt;span style="font-weight: bold;"&gt;80506f3::dis&lt;/span&gt;&lt;br /&gt;0x80506f3:                      decl   0xe850fc45(%ebx)&lt;br /&gt;&gt; 8&lt;span style="font-weight: bold;"&gt;0506f2::dis&lt;/span&gt;&lt;br /&gt;0x80506f2:                      ***ERROR--unknown op code***&lt;br /&gt;&gt; &lt;span style="font-weight: bold;"&gt;80506f1::dis&lt;/span&gt;&lt;br /&gt;0x80506f1:                      ***ERROR--unknown op code***&lt;br /&gt;&gt; &lt;span style="font-weight: bold;"&gt;80506f0::dis&lt;/span&gt;&lt;br /&gt;0x80506f0:                      int    $0x3&lt;br /&gt;&gt; &lt;span style="font-weight: bold;"&gt;80506ef::dis&lt;/span&gt;&lt;br /&gt;0x80506ef:                      call   -0x34    &lt;&lt;span style="font-weight: bold;"&gt;0x80506c0&lt;/span&gt;&gt;&lt;br /&gt;&lt;/pre&gt;Bingo! We have a winner - &lt;span style="font-style: italic;"&gt;0x80506c0&lt;/span&gt;. You will probably notice,  the "call" op-code (1 byte) was followed by a 4 byte address, so we could have first tried the addess – 5. In my case the command inside of mdb would have been “&lt;span style="font-style: italic;"&gt;80506f4-5::dis&lt;/span&gt;”.&lt;br /&gt;&lt;br /&gt;Now we have an address, we can now easily list the function from the start.&lt;br /&gt;&lt;pre&gt;&gt; &lt;span style="font-weight: bold;"&gt;80506c0::dis&lt;/span&gt;&lt;br /&gt;0x80506c0:                      pushl  %ebp&lt;br /&gt;0x80506c1:                      movl   %esp,%ebp&lt;br /&gt;0x80506c3:                      subl   $0x4,%esp&lt;br /&gt;0x80506c6:                      movl   $0x0,-0x4(%ebp)&lt;br /&gt;0x80506cd:                      movl   $0x63,%eax&lt;br /&gt;0x80506d2:                      movl   -0x4(%ebp),%edx&lt;br /&gt;0x80506d5:                      movb   %al,0x0(%edx)&lt;br /&gt;0x80506d8:                      leave&lt;br /&gt;0x80506d9:                      ret&lt;br /&gt;0x80506da:                      nop&lt;br /&gt;&lt;/pre&gt;We can eithen add the function into mdb's user-defined symbol table, so we can now see symbolic names, rather than hex addresses. &lt;span style="font-style: italic;"&gt;The rough comments we added by me :)&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&gt; &lt;span style="font-weight: bold;"&gt;80506c0::nmadd -f -e 80506da badfunc&lt;/span&gt;&lt;br /&gt;added badfunc, value=80506c0 size=1a&lt;br /&gt;&gt; badfunc::dis&lt;br /&gt;badfunc:                        pushl  %ebp            &lt;span style="font-style: italic;"&gt;; save frame pointer to the stack&lt;/span&gt;&lt;br /&gt;badfunc+1:                      movl   %esp,%ebp       &lt;span style="font-style: italic;"&gt;; copy stack pointer to frame pointer&lt;/span&gt;&lt;br /&gt;badfunc+3:                      subl   $0x4,%esp       &lt;span style="font-style: italic;"&gt;; make room for the pointer - char *p&lt;/span&gt;&lt;br /&gt;badfunc+6:                      movl   $0x0,-0x4(%ebp) &lt;span style="font-style: italic;"&gt;; initialize pointer to null - p=(char*)NULL;&lt;/span&gt;&lt;br /&gt;badfunc+0xd:                    movl   $0x63,%eax      &lt;span style="font-style: italic;"&gt;; copy 'c' to %eax register&lt;/span&gt;&lt;br /&gt;badfunc+0x12:                   movl   -0x4(%ebp),%edx &lt;span style="font-style: italic;"&gt;; copy pointer to register %edx - now = 0&lt;/span&gt;&lt;br /&gt;badfunc+0x15:                   movb   %al,0x0(%edx)   &lt;span style="font-style: italic;"&gt;; *p = 'c' - Hmmm copy 'c' to address 0 - BAD!!!&lt;/span&gt;&lt;br /&gt;badfunc+0x18:                   leave                  &lt;span style="font-style: italic;"&gt;; cleanup function call&lt;/span&gt;&lt;br /&gt;badfunc+0x19:                   ret                    &lt;span style="font-style: italic;"&gt;; return to calling function&lt;/span&gt;&lt;br /&gt;&gt; &lt;span style="font-weight: bold;"&gt;::stack&lt;/span&gt;&lt;br /&gt;badfunc+0x15(8060898, 80470fc, 805071b, 804720c, 8047124, 805062a)&lt;br /&gt;0x80506f4(804720c, 8047124, 805062a, 1, 8047130, 8047138)&lt;br /&gt;main+0xb(1, 8047130, 8047138)&lt;br /&gt;_start+0x7a(1, 8047274, 0, 804727f, 804728c, 80472c6)&lt;br /&gt;&gt; &lt;span style="font-weight: bold;"&gt;80506f4-5::dis&lt;/span&gt;&lt;br /&gt;0x80506ef:                      call   -0x34    &lt;badfunc&gt;&lt;br /&gt;&lt;/badfunc&gt;&lt;/pre&gt;From a quick look at my disassembled code, it is clear that some idiot created a null pointer , and then tried to copy a byte to there.  Not very bright eh! In a real world example you would probably need to run the command in mdb and set the breakpoint to the start of the function. From there you could step through the code to see what is does. It would go something like this -&lt;br /&gt;&lt;pre&gt;doug@bangkok&gt; &lt;span style="font-weight: bold;"&gt;mdb ./makecore&lt;/span&gt;&lt;br /&gt;&gt; &lt;span style="font-weight: bold;"&gt;80506c0::nmadd -f -e 80506da badfunc          &lt;/span&gt;&lt;span style="font-style: italic;"&gt;; Add our own symbol from above&lt;/span&gt;&lt;br /&gt;added badfunc, value=80506c0 size=1a&lt;br /&gt;&gt; &lt;span style="font-weight: bold;"&gt;badfunc:b                                     &lt;/span&gt;&lt;span style="font-style: italic;"&gt;; Set a breakpoint at the beginning of badfunc&lt;/span&gt;&lt;br /&gt;&gt; &lt;span style="font-weight: bold;"&gt;:r                                            &lt;/span&gt;&lt;span style="font-style: italic;"&gt;; run ./makecore in the debugger&lt;/span&gt;&lt;br /&gt;mdb: stop at badfunc&lt;br /&gt;mdb: target stopped at:&lt;br /&gt;badfunc:        pushl  %ebp&lt;br /&gt;&gt; &lt;span style="font-weight: bold;"&gt;:s                                            &lt;/span&gt;&lt;span style="font-style: italic;"&gt;; Step through code, 1 step at a time&lt;/span&gt;&lt;br /&gt;mdb: target stopped at:&lt;br /&gt;badfunc+1:      movl   %esp,%ebp&lt;br /&gt;&gt; &lt;span style="font-weight: bold;"&gt;:s&lt;/span&gt;&lt;br /&gt;mdb: target stopped at:&lt;br /&gt;badfunc+3:      subl   $0x4,%esp&lt;br /&gt;&gt; &lt;span style="font-weight: bold;"&gt;:s&lt;/span&gt;&lt;br /&gt;mdb: target stopped at:&lt;br /&gt;badfunc+6:      movl   $0x0,-0x4(%ebp)&lt;br /&gt;&gt; &lt;span style="font-weight: bold;"&gt;:s&lt;/span&gt;&lt;br /&gt;mdb: target stopped at:&lt;br /&gt;badfunc+0xd:    movl   $0x63,%eax&lt;br /&gt;&gt; &lt;span style="font-weight: bold;"&gt;::regs                                        &lt;/span&gt;&lt;span style="font-style: italic;"&gt;; Check the registers - Hmmm. %edx = 0&lt;/span&gt;&lt;br /&gt;%cs = 0x003b            %eax = 0x08060898&lt;br /&gt;%ds = 0x0043            %ebx = 0xfeffa7c0&lt;br /&gt;%ss = 0x0043            %ecx = 0xfefa9768 libc.so.1`_sse_hw&lt;br /&gt;%es = 0x0043            %edx = 0x00000000&lt;br /&gt;%fs = 0x0000            %esi = 0x080470e0&lt;br /&gt;%gs = 0x01c3            %edi = 0x08047204&lt;br /&gt;&lt;br /&gt;%eip = 0x080506cd badfunc+0xd&lt;br /&gt;%ebp = 0x080470e4&lt;br /&gt;%kesp = 0x00000000&lt;br /&gt;&lt;br /&gt;%eflags = 0x00000202&lt;br /&gt; id=0 vip=0 vif=0 ac=0 vm=0 rf=0 nt=0 iopl=0x0&lt;br /&gt; status=&lt;of,df,if,tf,sf,zf,af,pf,cf&gt;&lt;br /&gt;&lt;br /&gt;  %esp = 0x080470e0&lt;br /&gt;%trapno = 0x1&lt;br /&gt;  %err = 0x0&lt;br /&gt;&lt;/pre&gt;To find the best reference on the guts of Solaris and how to make the best use mdb and other Solaris tools such as DTrace. Go and purchase the just released &lt;a href="http://www.sun.com/books/catalog/solaris_internals.xml"&gt;2nd edition of Solaris Internals&lt;/a&gt; and it's new companion &lt;a href="http://www.sun.com/books/catalog/solaris_perf_tools.xml"&gt;Solaris Performance and Tools&lt;/a&gt;. You can save &lt;a href="http://www.sun.com/books/"&gt;30%&lt;/a&gt; by buying the through Sun. While you are stacking your bookself, you should also consider &lt;a href="http://www.rite-group.com/rich/ssp/index.html"&gt;Solaris System Programming&lt;/a&gt;, and &lt;a href="http://www.amazon.com/gp/product/0130952494/ref=pd_sim_b_1/002-7781315-9357640?ie=UTF8"&gt;Sun Performance and Tuning&lt;/a&gt;. Some light reading :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29699307-115548087554361694?l=solaristhings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/115548087554361694/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29699307&amp;postID=115548087554361694' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/115548087554361694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/115548087554361694'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/2006/08/dont-be-afraid-of-mdb.html' title='Don&apos;t be afraid of mdb'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29699307.post-115518840192459695</id><published>2006-08-10T12:31:00.000+07:00</published><updated>2006-08-10T13:51:30.060+07:00</updated><title type='text'>Filesystem Benchmarks</title><content type='html'>If  you have been reading the &lt;a href="http://www.opensolaris.org/jive/forum.jspa?forumID=80&amp;start=0"&gt;zfs-discuss&lt;/a&gt; on &lt;a href="http://www.opensolaris.org"&gt;OpenSolaris.org&lt;/a&gt; recently, you would have read that &lt;a href="http://milek.blogspot.com"&gt;Robert Milkowski&lt;/a&gt; has been doing some benchmarks using &lt;a href="http://www.sun.com/storagetek/disk_systems/workgroup/3510"&gt;Sun's StorageTek 3510 FC diskarrays&lt;/a&gt;. He has been getting some interesting results that suggest that using ZFS and the 3510 &lt;span style="font-style: italic;"&gt;without&lt;/span&gt; the hardware RAID controllers is faster than using it with. This is very interesting because the cost of hardware raid controllers can be expensive. If it suits your needs, you can save some cash by using Solaris 10 and ZFS, as both are free!&lt;br /&gt;&lt;br /&gt;Since I don't have have a 3510 sitting around to test on, I decided to do a quick benchmark on a spare partition of my laptop to compare ZFS and UFS. We have all been told that ZFS is faster than UFS, but by how much and when is a interesting question.&lt;br /&gt;&lt;br /&gt;Using &lt;a href="http://sourceforge.net/projects/filebench"&gt;filebench&lt;/a&gt; as Robert did, I have started with the varmail workload using the average of three runs to produce the graph below. For each run I created the pool (ZFS) and filesystem, did the three benchmark runs for 60 seconds each, and then destroyed the partition for the next benchmark test.&lt;br /&gt;&lt;br /&gt;For ZFS this was&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;root&gt; zpool create -fm /none benchpool /dev/dsk/c0d0s4&lt;br /&gt;root&gt; zfs create benchpool/mnt&lt;br /&gt;root&gt; zfs set mountpoint=/mnt benchpool/mnt&lt;br /&gt;root&gt; &lt;span style="font-style: italic;"&gt;# Set options zfs options e.g. zfs set atime=off benchpool/mnt&lt;/span&gt;&lt;br /&gt;root&gt; /opt/filebench/bin/filebench&lt;br /&gt;filebench&gt; load varmail&lt;br /&gt;filebench&gt; set $dir=/mnt/zfstest&lt;br /&gt;filebench&gt; run 60&lt;br /&gt;root&gt; zfs destroy benchpool/mnt&lt;br /&gt;root&gt; zpool destroy benchpool&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;For UFS -&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;root&gt; newfs /dev/dsk/c0d0s4&lt;br /&gt;root&gt; mount -o noatime -F ufs /dev/dsk/c0d0s4 /mnt&lt;br /&gt;root&gt; &lt;span style="font-style: italic;"&gt;# -o noatime is the option for this test&lt;/span&gt;&lt;br /&gt;root&gt; /opt/filebench/bin/filebench&lt;br /&gt;filebench&gt; load varmail&lt;br /&gt;filebench&gt; set $dir=/mnt/zfstest&lt;br /&gt;filebench&gt; run 60&lt;br /&gt;root&gt; umount /mnt&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3677/2690/1600/varmail_bench.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/3677/2690/400/varmail_bench.jpg" alt="" border="0" /&gt;&lt;/a&gt;As you can see ZFS is indeed faster for this benchmark than UFS. To be fair, and to compare apples to apples, I should have combined UFS with the Solaris Volume Manager (SVM). This most likely seen a greater gap between ZFS and UFS. One thing it shows, is that a Acer Ferrari 4005 maybe a nice laptop, but it makes a horrible mailserver :(&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29699307-115518840192459695?l=solaristhings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/115518840192459695/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29699307&amp;postID=115518840192459695' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/115518840192459695'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/115518840192459695'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/2006/08/filesystem-benchmarks.html' title='Filesystem Benchmarks'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29699307.post-115346630144420327</id><published>2006-07-21T13:51:00.000+07:00</published><updated>2006-07-21T18:06:56.976+07:00</updated><title type='text'>How small can you make Open Solaris - Part 5</title><content type='html'>In the latest post I have just done a quick update of the "Quick and Dirty Solaris Installer". Version 0.3 of the installer is now able to exclude Solaris clusters and packages from the installation. With this we are now able to start reducing the size and try to get close to what was achieved in the first couple of posts.&lt;br /&gt;&lt;br /&gt;If you read through the code you can see that I have started with the SUNWCmreq metacluster, as it is the smallest defined on the Solaris installation media. I actually had to add the package SUNWmdr, as devfsadmd started complaining during the first reboot. In the code you will see a big list of packages defined in the "exclude array". Since this list includes device drivers, you may have to  add and remove driver packages for your system. To do this you will need to read through the '.clustertoc' file in the Product directory of your installation media. &lt;br /&gt;&lt;br /&gt;Using the configuration in this script, I was able to get a bootable multi-user system which only needed /etc/nodename and /etc/hosts configured. The disk usage is down to around 149MB (still a long way to go). Solaris core packages actually have a lot of files and command which I would not call 'core'. Later on I will look at creating new packages, and pulling files directly from a Open Solaris bfu archive. This may also require some files being pulled from "running" Solaris, as the bfu archives are not complete. If we can successfully use a bfu archive, then we could later see if changing some of the compiler flags in an Open Solaris build will shrink the binary size.&lt;br /&gt;&lt;br /&gt;In the next post, I will start reducing installation further, by adding commands to the local_install.bash script which can be run just before the filesystem is un-mounted.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;hr /&gt;#!/bin/bash&lt;br /&gt;#&lt;br /&gt;# Quick and Dirty Solaris installer&lt;br /&gt;# Version 0.3&lt;br /&gt;#&lt;br /&gt;PROD=/cdrom/sol_11_x86/Solaris_11/Product&lt;br /&gt;#PROD=/a/Solaris_11/Product&lt;br /&gt;TOK=${PROD}/.clustertoc&lt;br /&gt;ORDER=${PROD}/.order&lt;br /&gt;&lt;br /&gt;# Current metaclusters are&lt;br /&gt;# SUNWCXall - Entire Distribution plus OEM support&lt;br /&gt;# SUNWCall  - Entire Distribution&lt;br /&gt;# SUNWCprog - Developer System Support&lt;br /&gt;# SUNWCuser - End User System Suppor&lt;br /&gt;# SUNWCreq  - Core System Support&lt;br /&gt;# SUNWCrnet - Reduced Networking Core System Support&lt;br /&gt;# SUNWCmreq - Minimal Core System Support&lt;br /&gt;METACLUSTER=SUNWCmreq&lt;br /&gt;export METACLUSTER&lt;br /&gt;&lt;br /&gt;SWAP=/dev/dsk/c0d0s1&lt;br /&gt;LOG=/tmp/install.log&lt;br /&gt;SVCPROFILE=generic_limited_net.xml&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Change these to relect your system.&lt;br /&gt;#&lt;br /&gt;FS=zfs&lt;br /&gt;[ "${FS}" != "zfs" -a "${FS}" != "ufs" ] &amp;&amp;amp; {&lt;br /&gt;    printf "Unknown filesystem ${FS}\n"&lt;br /&gt;    exit 1&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;[ "${FS}" = "zfs" ] &amp;&amp;amp; {&lt;br /&gt;    ROOTDEV=intdisk/snv43_zfs&lt;br /&gt;    RAWROOTDEV=-&lt;br /&gt;    GRUBFS=/dev/dsk/c0d0s0&lt;br /&gt;    ZFSBOOTARCHIVE=/grub/boot/boot_zfs&lt;br /&gt;    ZFSCOMPRESS=off&lt;br /&gt;#    ZFSCOMPRESS=on&lt;br /&gt;    MOB=yes&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;[ "${FS}" = "ufs" ] &amp;&amp;amp; {&lt;br /&gt;    ROOTDEV=/dev/dsk/c0d0s3&lt;br /&gt;    RAWROOTDEV=${ROOTDEV/dsk/rdsk}&lt;br /&gt;    MOB=no&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;typeset -a pkgs&lt;br /&gt;# extrapkgs is an array of additional packages to be installed&lt;br /&gt;typeset -a extrapkgs=( SUNWmdr )&lt;br /&gt;# exclude is an array of packages or clusters which should not be installed&lt;br /&gt;typeset -a exclude=( SUNWChbaapi SUNWCfcadb SUNWCfca SUNWCfcadb SUNWCfct&lt;br /&gt;    SUNWCfutil SUNWCiscsi SUNWCib SUNWCmpapi SUNWCtavor&lt;br /&gt;    CADP160 HPFC SK98sol SUNWaac SUNWadp SUNWadpu320 SUNWamr SUNWcadp SUNWced&lt;br /&gt;    SUNWchxge SUNWcqhpc SUNWlsimega SUNWmv88sx SUNWnge SUNWrge SUNWrmodr&lt;br /&gt;    SUNWrmodu SUNWrtls SUNWses SUNWsi3124 SUNWuksp SUNWuedg SUNWukspfw&lt;br /&gt;    SUNWuprl SUNWxge SYMhisl SKfp SUNWintgige SUNWwbsup&lt;br /&gt;    SUNWCpkgcmds SUNWjss SUNWidnl SUNWbzip&lt;br /&gt;    SUNWperl584core SUNWperl584usr  )&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# check_install tests whether $1 is in the list of packages to be excluded&lt;br /&gt;#&lt;br /&gt;function check_install() {&lt;br /&gt;    local i&lt;br /&gt;    [ "$#" != "1" ] &amp;&amp;amp; return 0&lt;br /&gt;&lt;br /&gt;    for i in ${exclude[@]} ; do&lt;br /&gt;    [ ${i} = "$1" ] &amp;&amp;amp; return 1&lt;br /&gt;    done&lt;br /&gt;    return 0&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# add_extra_pkgs will add in the extrapkgs array to the pkgs array. It will&lt;br /&gt;# void adding a package twice&lt;br /&gt;#&lt;br /&gt;function add_extra_pkgs() {&lt;br /&gt;    pkgcnt=${#pkgs[@]}&lt;br /&gt;    for i in ${extrapkgs[@]} ; do&lt;br /&gt;    found=0&lt;br /&gt;    for j in ${pkgs[@]} ; do&lt;br /&gt;        [ ${i} = ${j} ] &amp;&amp;amp; {&lt;br /&gt;        found=1&lt;br /&gt;        break;&lt;br /&gt;        }&lt;br /&gt;    done&lt;br /&gt;    # Add package if not already found&lt;br /&gt;    [ "${found}" = "0" ] &amp;&amp;amp; {&lt;br /&gt;        printf "Adding Package - %s [%d]\n" "${i}" ${pkgcnt}&lt;br /&gt;        pkgs[$(( pkgcnt++ ))]="$i"&lt;br /&gt;    }&lt;br /&gt;    done&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Solaris packages need to be installed in the correct order.&lt;br /&gt;# The .order file contains all the packages in the correct&lt;br /&gt;# installation order&lt;br /&gt;#&lt;br /&gt;function reorder_pkgs() {&lt;br /&gt;    typeset -a pkglist=( ${pkgs[@]} )&lt;br /&gt;    pkgcnt=0&lt;br /&gt;&lt;br /&gt;    while read order_pkg ; do&lt;br /&gt;    for i in ${pkglist[@]} ; do&lt;br /&gt;        [ "$order_pkg" = "${i%.i}" ] &amp;&amp;amp;  {&lt;br /&gt;        pkgs[$(( pkgcnt++ ))]="${i}"&lt;br /&gt;        printf "."&lt;br /&gt;        }&lt;br /&gt;    done&lt;br /&gt;    done &lt; ${ORDER}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# This function builds a list of packages in a cluster&lt;br /&gt;# If there is a cluster within a cluster, it will call itself to&lt;br /&gt;# resolve all the packages.&lt;br /&gt;#&lt;br /&gt;# Before calling make sure you initialize pkgcnt to 0&lt;br /&gt;# Arg: $1 contains the cluster name&lt;br /&gt;# Affected vars: pkgs, pkgcnt&lt;br /&gt;#&lt;br /&gt;function get_pkg_list() {&lt;br /&gt;    local IFS="="&lt;br /&gt;    local print_on=0&lt;br /&gt;    local cluster=$1&lt;br /&gt;&lt;br /&gt;    while read arg1 arg2&lt;br /&gt;    do&lt;br /&gt;        [ "${arg1}" = "END" -a "${print_on}" = "1" ] &amp;&amp;amp; break;&lt;br /&gt;        [ -z "${arg2}" ] &amp;&amp;amp; continue;&lt;br /&gt;&lt;br /&gt;        [ "${arg2}" = "${cluster}" ] &amp;&amp;amp; {&lt;br /&gt;            print_on=1&lt;br /&gt;            continue&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        [ "${print_on}" = "1" -a "${arg1}" = "SUNW_CSRMEMBER" ] &amp;&amp;amp; {&lt;br /&gt;        # Test to see if package/cluster is on the exclude list&lt;br /&gt;        check_install "${arg2}" || continue&lt;br /&gt;&lt;br /&gt;        ifcluster=`expr "${arg2}" : '\(SUNWC\)'`&lt;br /&gt;        if [ "${ifcluster}" = "SUNWC" ]; then&lt;br /&gt;        get_pkg_list ${arg2}&lt;br /&gt;        else&lt;br /&gt;        [ -d ${PROD}/${arg2} ] &amp;&amp;amp; {&lt;br /&gt;            pkgs[$(( pkgcnt++ ))]="${arg2}"&lt;br /&gt;            printf "."&lt;br /&gt;            continue;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        arg2="${arg2}.i"&lt;br /&gt;        [ -d ${PROD}/${arg2} ] &amp;&amp;amp; pkgs[$(( pkgcnt++ ))]="${arg2}"&lt;br /&gt;        printf "."&lt;br /&gt;        fi&lt;br /&gt;        }&lt;br /&gt;    done &lt; ${TOK}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Check for the installation image before proceeding&lt;br /&gt;#&lt;br /&gt;[ ! -d ${PROD} ] &amp;&amp;amp; {&lt;br /&gt;    echo "Cannot find Solaris Installation"&lt;br /&gt;    exit 1&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Create a pkg admin file - see man admin(4)&lt;br /&gt;#&lt;br /&gt;sed 's/ask/nocheck/' /var/sadm/install/admin/default &gt; /tmp/.admin.doit&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Build an ordered list of packages from the Solaris installation image&lt;br /&gt;#&lt;br /&gt;printf "Building a list of packages  "&lt;br /&gt;pkgcnt=0&lt;br /&gt;get_pkg_list ${METACLUSTER}&lt;br /&gt;echo&lt;br /&gt;# Add extra packages before sorting&lt;br /&gt;add_extra_pkgs&lt;br /&gt;echo&lt;br /&gt;printf "Sorting packages into the correct order for installation  "&lt;br /&gt;reorder_pkgs&lt;br /&gt;echo&lt;br /&gt;#&lt;br /&gt;# Try to create the filesystem you define at the beginning&lt;br /&gt;#&lt;br /&gt;case ${FS} in&lt;br /&gt;    "zfs")  zfs create ${ROOTDEV} || {&lt;br /&gt;                echo "Cannot create zfs filesystem!"&lt;br /&gt;                exit 1&lt;br /&gt;            }&lt;br /&gt;        zfs set mountpoint=legacy ${ROOTDEV}&lt;br /&gt;        zfs set compression=${ZFSCOMPRESS} ${ROOTDEV}&lt;br /&gt;        ;;&lt;br /&gt;    "ufs")  newfs ${ROOTDEV} || {&lt;br /&gt;                echo "Cannot create ufs filesystem!"&lt;br /&gt;                exit 1&lt;br /&gt;            } ;;&lt;br /&gt;    *)      echo "Cannot create ufs filesystem!"&lt;br /&gt;            exit 1&lt;br /&gt;            ;;&lt;br /&gt;esac&lt;br /&gt;&lt;br /&gt;mount -F ${FS} ${ROOTDEV} /mnt || {&lt;br /&gt;    echo "Cannot mount filesystem!"&lt;br /&gt;    exit 1&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Install packages from Solaris installation image&lt;br /&gt;#&lt;br /&gt;echo "Starting installation of packages"&lt;br /&gt;echo&lt;br /&gt;(&lt;br /&gt;    for i in ${pkgs[@]} ; do&lt;br /&gt;    pkgadd -n -a /tmp/.admin.doit -d ${PROD} -R /mnt $i&lt;br /&gt;    done&lt;br /&gt;) &gt; ${LOG}&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Update /etc/vfstab with swap and root partitions&lt;br /&gt;#&lt;br /&gt;(&lt;br /&gt;    printf "${SWAP}\t-\t-\tswap\t-\tno\t-\n"&lt;br /&gt;    printf "${ROOTDEV}\t${RAWROOTDEV}\t/\t${FS}\t1\t${MOB}\t-\n"&lt;br /&gt;    [ "$FS" = "zfs" ] &amp;&amp;amp; {&lt;br /&gt;    mkdir -m 0755 /mnt/grub&lt;br /&gt;    printf "${GRUBFS}\t${GRUBFS/dsk/rdsk}\t/grub\tufs\t3\tyes\t-\n"&lt;br /&gt;    }&lt;br /&gt;) &gt;&gt; /mnt/etc/vfstab&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Copy links for disk partitions in /dev/dsk and /dev/rdsk&lt;br /&gt;# This is needed so the system can find the root partion on boot&lt;br /&gt;#&lt;br /&gt;( cd /dev &amp;&amp;amp; find dsk rdsk -depth | cpio -pdm /mnt/dev 2&gt;/dev/null )&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Configure system to initialize identity on first boot&lt;br /&gt;# If there is a sysidcfg file in the current directory. This will&lt;br /&gt;# be copied across.&lt;br /&gt;#&lt;br /&gt;PROFILEDIR=/mnt/var/svc/profile&lt;br /&gt;[ -f ${PROFILEDIR}/${SVCPROFILE} ] &amp;&amp;amp; {&lt;br /&gt;    if [ -f ./sysidcfg ]; then&lt;br /&gt;    cp ./sysidcfg /mnt/etc&lt;br /&gt;    else&lt;br /&gt;        touch /mnt/etc/.UNCONFIGURED&lt;br /&gt;    fi&lt;br /&gt;    cp -p ${PROFILEDIR}/${SVCPROFILE} ${PROFILEDIR}/generic.xml&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# set bootpath to root filesystem.&lt;br /&gt;# Also set the console to text&lt;br /&gt;#&lt;br /&gt;(&lt;br /&gt;    [ "${FS}" = "ufs" ] &amp;&amp;amp; {&lt;br /&gt;        BOOTPATH=$( ls -l ${ROOTDEV} | nawk '{print $11}' |&lt;br /&gt;        sed -e 's#[./]*/devices/#/#' )&lt;br /&gt;&lt;br /&gt;        printf "setprop bootpath ${BOOTPATH}\n"&lt;br /&gt;    }&lt;br /&gt;    printf "setprop console 'text'\n"&lt;br /&gt;) &gt;&gt; /mnt/boot/solaris/bootenv.rc&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# If found execute local script before /mnt is unmounted&lt;br /&gt;#&lt;br /&gt;[ -x ./local_install.bash ] &amp;&amp;amp; ./local_install.bash&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Finish off installation&lt;br /&gt;#&lt;br /&gt;[ -f /etc/zfs/zpool.cache ] &amp;&amp;amp; {&lt;br /&gt;    cp -p /etc/zfs/zpool.cache /mnt/etc/zfs&lt;br /&gt;    echo "etc/zfs/zpool.cache" &gt;&gt; /mnt/boot/solaris/filelist.ramdisk  &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Configure for a ZFS boot. At the moment you need a small UFS partition&lt;br /&gt;# somewhere for grub.&lt;br /&gt;#&lt;br /&gt;[ "${FS}" = "zfs" ] &amp;&amp;amp; {&lt;br /&gt;    (&lt;br /&gt;    printf "rootfs:zfs\n"&lt;br /&gt;    printf "zfsroot:${ROOTDEV}\n"&lt;br /&gt;    ) &gt;&gt; /mnt/etc/system&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;devfsadm -r /mnt&lt;br /&gt;rm -f /mnt/reconfigure&lt;br /&gt;bootadm update-archive -R /mnt&lt;br /&gt;&lt;br /&gt;[ "${FS}" = "zfs" ] &amp;&amp;amp; {&lt;br /&gt;    cp /mnt/platform/i86pc/boot_archive ${ZFSBOOTARCHIVE}&lt;br /&gt;    cp -p /mnt/sbin/bootadm /mnt/sbin/bootadm.real&lt;br /&gt;    cat &gt;/mnt/sbin/bootadm &lt;&lt; EOM&lt;br /&gt;#!/usr/bin/sh&lt;br /&gt;&lt;br /&gt;/sbin/bootadm.real "\$@"&lt;br /&gt;if [ "\$1" = "update-archive" -a -d /grub/boot/grub ]; then&lt;br /&gt;        /usr/bin/cp /platform/i86pc/boot_archive ${ZFSBOOTARCHIVE}&lt;br /&gt;fi&lt;br /&gt;exit 0&lt;br /&gt;EOM&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;echo&lt;br /&gt;echo "If you have not already, you will need to configure menu.lst to"&lt;br /&gt;echo "boot this partition."&lt;br /&gt;&lt;br /&gt;umount /mnt&lt;br /&gt;# eject cdrom&lt;br /&gt;&lt;/pre&gt;&lt;hr&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29699307-115346630144420327?l=solaristhings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/115346630144420327/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29699307&amp;postID=115346630144420327' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/115346630144420327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/115346630144420327'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/2006/07/how-small-can-you-make-open-solaris_21.html' title='How small can you make Open Solaris - Part 5'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29699307.post-115328931457205527</id><published>2006-07-19T12:46:00.000+07:00</published><updated>2006-07-19T20:10:53.106+07:00</updated><title type='text'>How small can you make Open Solaris - Part 4</title><content type='html'>Below, I have posted the new version of the &lt;span style="font-style:italic;"&gt;Quick and Dirty Solaris Installer&lt;/span&gt;. This version will  install Open Solaris directly onto a zfs filesystem. It took me a little longer than expected as I was having problems with the create_ramdisk.ksh script which is used by bootadm. The problem is that create_ramdisk.ksh does a 'du' on every file it is copying to the ramdisk to calculate the space required. If the 'du' command is used on a compressed file, it will return the compressed size. The problem comes about when a UFS filesystem is used to create the boot_archive image. Files copied from a compress zfs volume, will soon fill the ramdisk.&lt;br /&gt;&lt;br /&gt;Not being able to create a boot archive is not good. The current work around is to turn compression off for the root filesystem. In the next update, I will modify the script to start excluding packages, so we can see what is needed and what is not.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#!/bin/bash&lt;br /&gt;#&lt;br /&gt;# Quick and Dirty Solaris installer&lt;br /&gt;# Version 0.2&lt;br /&gt;#&lt;br /&gt;PROD=/cdrom/sol_11_x86/Solaris_11/Product&lt;br /&gt;# PROD=/a/Solaris_11/Product&lt;br /&gt;TOK=${PROD}/.clustertoc&lt;br /&gt;ORDER=${PROD}/.order&lt;br /&gt;&lt;br /&gt;# Current metaclusters are&lt;br /&gt;# SUNWCXall - Entire Distribution plus OEM support&lt;br /&gt;# SUNWCall  - Entire Distribution&lt;br /&gt;# SUNWCprog - Developer System Support&lt;br /&gt;# SUNWCuser - End User System Suppor&lt;br /&gt;# SUNWCreq  - Core System Support&lt;br /&gt;# SUNWCrnet - Reduced Networking Core System Support&lt;br /&gt;# SUNWCmreq - Minimal Core System Support&lt;br /&gt;METACLUSTER=SUNWCrnet&lt;br /&gt;&lt;br /&gt;SWAP=/dev/dsk/c0d0s1&lt;br /&gt;LOG=/tmp/install.log&lt;br /&gt;SVCPROFILE=generic_limited_net.xml&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Change these to relect your system.&lt;br /&gt;#&lt;br /&gt;FS=zfs&lt;br /&gt;[ "${FS}" != "zfs" -a "${FS}" != "ufs" ] &amp;&amp; {&lt;br /&gt;    printf "Unknown filesystem ${FS}\n"&lt;br /&gt;    exit 1&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;[ "${FS}" = "zfs" ] &amp;&amp; {&lt;br /&gt;    ROOTDEV=intdisk/snv43_zfs&lt;br /&gt;    RAWROOTDEV=-&lt;br /&gt;    GRUBFS=/dev/dsk/c0d0s0&lt;br /&gt;    ZFSBOOTARCHIVE=/grub/boot/boot_zfs&lt;br /&gt;    ZFSCOMPRESS=off&lt;br /&gt;#    ZFSCOMPRESS=on&lt;br /&gt;    MOB=yes&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;[ "${FS}" = "ufs" ] &amp;&amp; {&lt;br /&gt;    ROOTDEV=/dev/dsk/c0d0s3&lt;br /&gt;    RAWROOTDEV=${ROOTDEV/dsk/rdsk}&lt;br /&gt;    MOB=no&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;typeset -a pkgs&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Solaris packages need to be installed in the correct order.&lt;br /&gt;# The .order file contains all the packages in the correct&lt;br /&gt;# installation order&lt;br /&gt;#&lt;br /&gt;function reorder_pkgs() {&lt;br /&gt;    typeset -a pkglist=( ${pkgs[@]} )&lt;br /&gt;    pkgcnt=0&lt;br /&gt;&lt;br /&gt;    while read order_pkg ; do&lt;br /&gt;        for i in ${pkglist[@]} ; do&lt;br /&gt;            [ "$order_pkg" = "${i%.i}" ] &amp;&amp;  {&lt;br /&gt;                pkgs[$(( pkgcnt++ ))]="${i}"&lt;br /&gt;                printf "."&lt;br /&gt;            }&lt;br /&gt;        done&lt;br /&gt;    done &lt; ${ORDER}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# This function builds a list of packages in a cluster&lt;br /&gt;# If there is a cluster within a cluster, it will call itself to&lt;br /&gt;# resolve all the packages.&lt;br /&gt;#&lt;br /&gt;# Before calling make sure you initialize pkgcnt to 0&lt;br /&gt;# Arg: $1 contains the cluster name&lt;br /&gt;# Affected vars: pkgs, pkgcnt&lt;br /&gt;#&lt;br /&gt;function get_pkg_list() {&lt;br /&gt;    local IFS="="&lt;br /&gt;    local print_on=0&lt;br /&gt;    local cluster=$1&lt;br /&gt;&lt;br /&gt;    while read arg1 arg2&lt;br /&gt;    do&lt;br /&gt;        [ "${arg1}" = "END" -a "${print_on}" = "1" ] &amp;&amp; break;&lt;br /&gt;        [ -z "${arg2}" ] &amp;&amp; continue;&lt;br /&gt;&lt;br /&gt;        [ "${arg2}" = "${cluster}" ] &amp;&amp; {&lt;br /&gt;            print_on=1&lt;br /&gt;            continue&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        [ "${print_on}" = "1" -a "${arg1}" = "SUNW_CSRMEMBER" ] &amp;&amp; {&lt;br /&gt;            ifcluster=`expr "${arg2}" : '\(SUNWC\)'`&lt;br /&gt;            if [ "${ifcluster}" = "SUNWC" ]; then&lt;br /&gt;                get_pkg_list ${arg2}&lt;br /&gt;            else&lt;br /&gt;                [ -d ${PROD}/${arg2} ] &amp;&amp; {&lt;br /&gt;                        pkgs[$(( pkgcnt++ ))]="${arg2}"&lt;br /&gt;                        printf "."&lt;br /&gt;                        continue;&lt;br /&gt;                }&lt;br /&gt;&lt;br /&gt;                arg2="${arg2}.i"&lt;br /&gt;                [ -d ${PROD}/${arg2} ] &amp;&amp; pkgs[$(( pkgcnt++ ))]="${arg2}"&lt;br /&gt;                printf "."&lt;br /&gt;            fi&lt;br /&gt;        }&lt;br /&gt;    done &lt; ${TOK}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Check for the installation image before proceeding&lt;br /&gt;#&lt;br /&gt;[ ! -d ${PROD} ] &amp;&amp; {&lt;br /&gt;        echo "Cannot find Solaris Installation"&lt;br /&gt;        exit 1&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Create a pkg admin file - see man admin(4)&lt;br /&gt;#&lt;br /&gt;sed 's/ask/nocheck/' /var/sadm/install/admin/default &gt; /tmp/.admin.doit&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Build an ordered list of packages from the Solaris installation image&lt;br /&gt;#&lt;br /&gt;printf "Building a list of packages  "&lt;br /&gt;pkgcnt=0&lt;br /&gt;get_pkg_list ${METACLUSTER}&lt;br /&gt;echo&lt;br /&gt;printf "Sorting packages into the correct order for installation  "&lt;br /&gt;reorder_pkgs&lt;br /&gt;echo&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Try to create the filesystem you define at the beginning&lt;br /&gt;#&lt;br /&gt;case ${FS} in&lt;br /&gt;    "zfs")  zfs create ${ROOTDEV} || {&lt;br /&gt;                echo "Cannot create zfs filesystem!"&lt;br /&gt;                exit 1&lt;br /&gt;            }&lt;br /&gt;            zfs set mountpoint=legacy ${ROOTDEV}&lt;br /&gt;            zfs set compression=${ZFSCOMPRESS} ${ROOTDEV}&lt;br /&gt;            ;;&lt;br /&gt;    "ufs")  newfs ${ROOTDEV} || {&lt;br /&gt;                echo "Cannot create ufs filesystem!"&lt;br /&gt;                exit 1&lt;br /&gt;            } ;;&lt;br /&gt;    *)      echo "Cannot create ufs filesystem!"&lt;br /&gt;            exit 1&lt;br /&gt;            ;;&lt;br /&gt;esac&lt;br /&gt;&lt;br /&gt;mount -F ${FS} ${ROOTDEV} /mnt || {&lt;br /&gt;    echo "Cannot mount filesystem!"&lt;br /&gt;    exit 1&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Install packages from Solaris installation image&lt;br /&gt;#&lt;br /&gt;echo "Starting installation of packages"&lt;br /&gt;echo&lt;br /&gt;(&lt;br /&gt;    for i in ${pkgs[@]} ; do&lt;br /&gt;        pkgadd -n -a /tmp/.admin.doit -d ${PROD} -R /mnt $i&lt;br /&gt;    done&lt;br /&gt;) &gt; ${LOG}&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Update /etc/vfstab with swap and root partitions&lt;br /&gt;#&lt;br /&gt;(&lt;br /&gt;    printf "${SWAP}\t-\t-\tswap\t-\tno\t-\n"&lt;br /&gt;    printf "${ROOTDEV}\t${RAWROOTDEV}\t/\t${FS}\t1\t${MOB}\t-\n"&lt;br /&gt;    [ "$FS" = "zfs" ] &amp;&amp; {&lt;br /&gt;        mkdir -m 0755 /mnt/grub&lt;br /&gt;        printf "${GRUBFS}\t${GRUBFS/dsk/rdsk}\t/grub\tufs\t3\tyes\t-\n"&lt;br /&gt;    }&lt;br /&gt;) &gt;&gt; /mnt/etc/vfstab&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Copy links for disk partitions in /dev/dsk and /dev/rdsk&lt;br /&gt;# This is needed so the system can find the root partion on boot&lt;br /&gt;#&lt;br /&gt;( cd /dev &amp;&amp; find dsk rdsk -depth | cpio -pdm /mnt/dev 2&gt;/dev/null )&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Configure system to initialize identity on first boot&lt;br /&gt;# If there is a sysidcfg file in the current directory. This will&lt;br /&gt;# be copied across.&lt;br /&gt;#&lt;br /&gt;PROFILEDIR=/mnt/var/svc/profile&lt;br /&gt;[ -f ${PROFILEDIR}/${SVCPROFILE} ] &amp;&amp; {&lt;br /&gt;    if [ -f ./sysidcfg ]; then&lt;br /&gt;        cp ./sysidcfg /mnt/etc&lt;br /&gt;    else&lt;br /&gt;        touch /mnt/etc/.UNCONFIGURED&lt;br /&gt;    fi&lt;br /&gt;    cp -p ${PROFILEDIR}/${SVCPROFILE} ${PROFILEDIR}/generic.xml&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# set bootpath to root filesystem.&lt;br /&gt;# Also set the console to text&lt;br /&gt;#&lt;br /&gt;(&lt;br /&gt;    [ "${FS}" = "ufs" ] &amp;&amp; {&lt;br /&gt;        BOOTPATH=$( ls -l ${ROOTDEV} | nawk '{print $11}' |&lt;br /&gt;            sed -e 's#[./]*/devices/#/#' )&lt;br /&gt;&lt;br /&gt;        printf "setprop bootpath ${BOOTPATH}\n"&lt;br /&gt;    }&lt;br /&gt;    printf "setprop console 'text'\n"&lt;br /&gt;) &gt;&gt; /mnt/boot/solaris/bootenv.rc&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# If found execute local script before /mnt is unmounted&lt;br /&gt;#&lt;br /&gt;[ -x ./local_install.bash ] &amp;&amp; ./local_install.bash&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Finish off installation&lt;br /&gt;#&lt;br /&gt;[ -f /etc/zfs/zpool.cache ] &amp;&amp; {&lt;br /&gt;    cp -p /etc/zfs/zpool.cache /mnt/etc/zfs&lt;br /&gt;    echo "etc/zfs/zpool.cache" &gt;&gt; /mnt/boot/solaris/filelist.ramdisk&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Configure for a ZFS boot. At the moment you need a small UFS partition&lt;br /&gt;# somewhere for grub.&lt;br /&gt;#&lt;br /&gt;[ "${FS}" = "zfs" ] &amp;&amp; {&lt;br /&gt;    (&lt;br /&gt;        printf "rootfs:zfs\n"&lt;br /&gt;        printf "zfsroot:${ROOTDEV}\n"&lt;br /&gt;    ) &gt;&gt; /mnt/etc/system&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;devfsadm -r /mnt&lt;br /&gt;rm -f /mnt/reconfigure&lt;br /&gt;bootadm update-archive -R /mnt&lt;br /&gt;&lt;br /&gt;[ "${FS}" = "zfs" ] &amp;&amp; {&lt;br /&gt;    cp /mnt/platform/i86pc/boot_archive ${ZFSBOOTARCHIVE}&lt;br /&gt;    cp -p /mnt/sbin/bootadm /mnt/sbin/bootadm.real&lt;br /&gt;    cat &gt;/mnt/sbin/bootadm &lt;&lt; EOM&lt;br /&gt;#!/usr/bin/sh&lt;br /&gt;&lt;br /&gt;/sbin/bootadm.real "\$@"&lt;br /&gt;if [ "\$1" = "update-archive" -a -d /grub/boot/grub ]; then&lt;br /&gt;        /usr/bin/cp /platform/i86pc/boot_archive ${ZFSBOOTARCHIVE}&lt;br /&gt;fi&lt;br /&gt;exit 0&lt;br /&gt;EOM&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;echo&lt;br /&gt;echo "If you have not already, you will need to configure menu.lst to"&lt;br /&gt;echo "boot this partition."&lt;br /&gt;&lt;br /&gt;umount /mnt&lt;br /&gt;# eject cdrom&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29699307-115328931457205527?l=solaristhings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/115328931457205527/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29699307&amp;postID=115328931457205527' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/115328931457205527'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/115328931457205527'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/2006/07/how-small-can-you-make-open-solaris_19.html' title='How small can you make Open Solaris - Part 4'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29699307.post-115305215471198618</id><published>2006-07-16T18:09:00.000+07:00</published><updated>2006-07-16T19:15:54.740+07:00</updated><title type='text'>How small can you make Open Solaris - Part 3</title><content type='html'>In this post I have decided to focus on installing Solaris directly without using the normal Solaris installer. If you are like me and forever installing the latest Solaris Nevada version, and would like to do this without rebooting and running the Solaris installer then the script below might be for you. If you are playing around to see what packages you can remove to shrink a Solaris installation, then a modified version of this script might be what you are looking for.&lt;br /&gt;&lt;br /&gt;Solaris already has an excellent tool for upgrading your current system called live upgrade. The script below is different, as it does a totally fresh install. Hopefully the next version will also install directly onto a ZFS filesystem rather than a UFS partition.&lt;br /&gt;&lt;br /&gt;To start off you need a Solaris X86 system (one which uses grub) with a free Solaris partition that has enough diskspace to hold the installation. Note, this script does no checking! It assumes you have configured the settings correctly, and have allocated enough space. You also have to have a DVD (or image) of Solaris (or maybe a jumpstart type installation directory).&lt;br /&gt;&lt;br /&gt;Going through the script, at the beginning you will find some variables to may need to change to refect your setup. Since it uses the Solaris Meta Clusters you will need to define which one you want. The functions (which is most of the code), rattle through the cluster table of contents file and produces an order list of packages for the meta cluster you selected. Once it has a list a pkgadd is executed for each package.&lt;br /&gt;&lt;br /&gt;After the packages have been installed, there are a few system configurations and device links that are required to get the system booted correctly. You can have the system automatically configure itself on reboot if you have a valid sysidcfg file in your current directory. Otherwise, the system will ask you many questions on reboot to configure hostnames, networking etc. If you are familiar with building zones, this will not be new.&lt;br /&gt;&lt;br /&gt;Before you start, you should read through the script so you know exactly what it does. The is very little error/sanity checks in the script, and incorrect settings could be devastating  as you will need to be root (or have the correct privs) to use it. When you have finish the installation you will need to modify grub to boot off the correct partition. Below the relevent section of my /boot/grub/menu.lst file. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;title Solaris Test&lt;br /&gt;root (hd0,0,d)&lt;br /&gt;kernel /platform/i86pc/multiboot&lt;br /&gt;module /platform/i86pc/boot_archive&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Enjoy, and Good Luck!!!&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#!/bin/bash&lt;br /&gt;#&lt;br /&gt;# Quick and Dirty Solaris installer&lt;br /&gt;# Version 0.1&lt;br /&gt;#&lt;br /&gt;PROD=/cdrom/sol_11_x86/Solaris_11/Product&lt;br /&gt;TOK=${PROD}/.clustertoc&lt;br /&gt;ORDER=${PROD}/.order&lt;br /&gt;&lt;br /&gt;# Current metaclusters are&lt;br /&gt;# SUNWCXall - Entire Distribution plus OEM support&lt;br /&gt;# SUNWCall  - Entire Distribution&lt;br /&gt;# SUNWCprog - Developer System Support&lt;br /&gt;# SUNWCuser - End User System Suppor&lt;br /&gt;# SUNWCreq  - Core System Support&lt;br /&gt;# SUNWCrnet - Reduced Networking Core System Support&lt;br /&gt;# SUNWCmreq - Minimal Core System Support&lt;br /&gt;METACLUSTER=SUNWCrnet&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Change these to relect your system. The next version should&lt;br /&gt;# use ZFS rather that UFS.&lt;br /&gt;#&lt;br /&gt;ROOTDEV=/dev/dsk/c0d0s4&lt;br /&gt;RAWROOTDEV=/dev/rdsk/c0d0s4&lt;br /&gt;&lt;br /&gt;SWAP=/dev/dsk/c0d0s1&lt;br /&gt;LOG=/tmp/install.log&lt;br /&gt;&lt;br /&gt;SVCPROFILE=generic_limited_net.xml&lt;br /&gt;&lt;br /&gt;typeset -a pkgs&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Solaris packages need to be installed in the correct order.&lt;br /&gt;# The .order file contains all the packages in the correct&lt;br /&gt;# installation order&lt;br /&gt;#&lt;br /&gt;function reorder_pkgs() {&lt;br /&gt;    typeset -a pkglist=( ${pkgs[@]} )&lt;br /&gt;    pkgcnt=0&lt;br /&gt;&lt;br /&gt;    while read order_pkg ; do&lt;br /&gt;        for i in ${pkglist[@]} ; do&lt;br /&gt;            [ "$order_pkg" = "${i%.i}" ] &amp;&amp;  {&lt;br /&gt;                pkgs[$(( pkgcnt++ ))]="${i}"&lt;br /&gt;                printf "."&lt;br /&gt;            }&lt;br /&gt;        done&lt;br /&gt;    done &lt; ${ORDER}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# This function builds a list of packages in a cluster&lt;br /&gt;# If there is a cluster within a cluster, it will call itself to&lt;br /&gt;# resolve all the packages.&lt;br /&gt;#&lt;br /&gt;# Before calling make sure you initialize pkgcnt to 0&lt;br /&gt;# Arg: $1 contains the cluster name&lt;br /&gt;# Affected vars: pkgs, pkgcnt&lt;br /&gt;#&lt;br /&gt;function get_pkg_list() {&lt;br /&gt;    local IFS="="&lt;br /&gt;    local print_on=0&lt;br /&gt;    local cluster=$1&lt;br /&gt;&lt;br /&gt;    while read arg1 arg2&lt;br /&gt;    do&lt;br /&gt;        [ "${arg1}" = "END" -a "${print_on}" = "1" ] &amp;&amp; break;&lt;br /&gt;        [ -z "${arg2}" ] &amp;&amp; continue;&lt;br /&gt;&lt;br /&gt;        [ "${arg2}" = "${cluster}" ] &amp;&amp; {&lt;br /&gt;            print_on=1&lt;br /&gt;            continue&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        [ "${print_on}" = "1" -a "${arg1}" = "SUNW_CSRMEMBER" ] &amp;&amp; {&lt;br /&gt;            ifcluster=`expr "${arg2}" : '\(SUNWC\)'`&lt;br /&gt;            if [ "${ifcluster}" = "SUNWC" ]; then&lt;br /&gt;                get_pkg_list ${arg2}&lt;br /&gt;            else&lt;br /&gt;                [ -d ${PROD}/${arg2} ] &amp;&amp; {&lt;br /&gt;                        pkgs[$(( pkgcnt++ ))]="${arg2}"&lt;br /&gt;                        printf "."&lt;br /&gt;                        continue;&lt;br /&gt;                }&lt;br /&gt;&lt;br /&gt;                arg2="${arg2}.i"&lt;br /&gt;                [ -d ${PROD}/${arg2} ] &amp;&amp; pkgs[$(( pkgcnt++ ))]="${arg2}"&lt;br /&gt;                printf "."&lt;br /&gt;            fi&lt;br /&gt;        }&lt;br /&gt;    done &lt; ${TOK}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Check for the installation image before proceeding&lt;br /&gt;#&lt;br /&gt;[ ! -d ${PROD} ] &amp;&amp; {&lt;br /&gt;        echo "Cannot find Solaris Installation"&lt;br /&gt;        exit 1&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Create a pkg admin file - see man admin(4)&lt;br /&gt;#&lt;br /&gt;sed 's/ask/nocheck/' /var/sadm/install/admin/default &gt; /tmp/.admin.doit&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Build an ordered list of packages from the Solaris installation image&lt;br /&gt;#&lt;br /&gt;printf "Building a list of packages  "&lt;br /&gt;pkgcnt=0&lt;br /&gt;get_pkg_list ${METACLUSTER}&lt;br /&gt;echo&lt;br /&gt;printf "Sorting packages into the correct order for installation  "&lt;br /&gt;reorder_pkgs&lt;br /&gt;echo&lt;br /&gt;&lt;br /&gt;newfs ${ROOTDEV} || exit 1&lt;br /&gt;mount ${ROOTDEV} /mnt&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Install packages from Solaris installation image&lt;br /&gt;#&lt;br /&gt;echo "Starting installation of packages"&lt;br /&gt;echo&lt;br /&gt;(&lt;br /&gt;    for i in ${pkgs[@]} ; do&lt;br /&gt;        pkgadd -n -a /tmp/.admin.doit -d ${PROD} -R /mnt $i&lt;br /&gt;    done&lt;br /&gt;) &gt; ${LOG}&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Update /etc/vfstab with swap and root partitions&lt;br /&gt;#&lt;br /&gt;(&lt;br /&gt;    printf "${SWAP}\t-\t-\tswap\t-\tno\t-\n"&lt;br /&gt;    printf "${ROOTDEV}\t${RAWROOTDEV}\t/\tufs\t1\tno\t-\n"&lt;br /&gt;) &gt;&gt; /mnt/etc/vfstab&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Copy links for disk partitions in /dev/dsk and /dev/rdsk&lt;br /&gt;# This is needed so the system can find the root partion on boot&lt;br /&gt;#&lt;br /&gt;( cd /dev &amp;&amp; find dsk rdsk -depth | cpio -pdm /mnt/dev 2&gt;/dev/null )&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Configure system to initialize identity on first boot&lt;br /&gt;# If there is a sysidcfg file in the current directory. This will&lt;br /&gt;# be copied across.&lt;br /&gt;#&lt;br /&gt;PROFILEDIR=/mnt/var/svc/profile&lt;br /&gt;[ -f ${PROFILEDIR}/${SVCPROFILE} ] &amp;&amp; {&lt;br /&gt;    if [ -f ./sysidcfg ]; then&lt;br /&gt;        cp ./sysidcfg /mnt/etc&lt;br /&gt;    else&lt;br /&gt;        touch /mnt/etc/.UNCONFIGURED&lt;br /&gt;    fi&lt;br /&gt;    cp -p ${PROFILEDIR}/${SVCPROFILE} ${PROFILEDIR}/generic.xml&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# set bootpath to root filesystem.&lt;br /&gt;# Also set the console to text&lt;br /&gt;#&lt;br /&gt;(&lt;br /&gt;    BOOTPATH=$( ls -l ${ROOTDEV} | nawk '{print $11}' |&lt;br /&gt;        sed -e 's#[./]*/devices/#/#' )&lt;br /&gt;&lt;br /&gt;    printf "setprop bootpath ${BOOTPATH}\n"&lt;br /&gt;    printf "setprop console 'text'\n"&lt;br /&gt;) &gt;&gt; /mnt/boot/solaris/bootenv.rc&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# If found execute local script before /mnt is unmounted&lt;br /&gt;#&lt;br /&gt;[ -x ./local_install.bash ] &amp;&amp; ./local_install.bash&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Finish off installation&lt;br /&gt;#&lt;br /&gt;bootadm update-archive -R /mnt&lt;br /&gt;echo "You will need to configure /boot/grub/menu.lst to boot this partition"&lt;br /&gt;&lt;br /&gt;umount /mnt&lt;br /&gt;# eject cdrom&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29699307-115305215471198618?l=solaristhings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/115305215471198618/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29699307&amp;postID=115305215471198618' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/115305215471198618'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/115305215471198618'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/2006/07/how-small-can-you-make-open-solaris_16.html' title='How small can you make Open Solaris - Part 3'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29699307.post-115271870511268786</id><published>2006-07-12T20:46:00.000+07:00</published><updated>2006-07-12T22:38:25.200+07:00</updated><title type='text'>ZFS saved my backside</title><content type='html'>Well, not totally, but it did save me a re-install!!!&lt;br /&gt;&lt;br /&gt;Last night I decided to stay up and watch the webcast of product lunch of Sun's new servers (Hmmm, I want a Thumper...). In Thailand the festivities did not start till 12:30 at night. The laptop I am using is an Acer Ferrari 4005. Recently, Sun released a sound driver for it (I was using OSS before), but whenever I used it there was sound + static.&lt;br /&gt;&lt;br /&gt;Now I had 1 hour before the webcast, so I decided to do the usual rounds of the &lt;a href="http://www.opensolaris.com"&gt;Open Solaris&lt;/a&gt; site to fill in time. I found that the latest ON build had a patch for the sound driver. Hmmm, there is not enough time for a compile (even on a Ferrari), so I downloaded the bfu archive, and started the install. If you read my earlier articles, you will probably know, that I am running on a ZFS root. Since this is a loosely undocumented feature, it does complicate a 'bfu'. I have done a bfu update on a ZFS root once before, so I should not have a problem, "Right?". The download took almost 1 hour (20Kb on a 4Mb link, grrr), so I quickly put the original bootadm back before I 'bfu'd'. Atfer the 'bfu', the usual 'acr', and then I replaced bootadm with the zfs modified bootadm and updated the archive. Just in time for a reboot right on the bell.&lt;br /&gt;&lt;br /&gt;As I was rebooting, I was thinking, "I should have done a zfs snapshot before I started". It was late, and I was fully aware that a failure would only affect me. Ok, reboot. . . . Ahhhhh!!! Almost as I rebooted, the ferrari reset and booted again. Grrrr. I started to get 'Rhymes with MISSED'. I quickly edited grub to add the "-kd" option to the kernel line, and booted. Great :(, the error message was that it could not find the root partition. Ok, failsafe it is then.....&lt;br /&gt;&lt;br /&gt;In failsafe, everything looked ok. I could mount the ZFS root. /etc/zfs/zpool.cache existed, and looked ok (Jibberish. It is binary after all). I then decided to look at grub, and found that the file /boot/solaris/filelist.ramdisk did not contain zpool.cache. Ah we now have somebody else to blame!!! The 'bfu/acr' procedure updates this file without considering that I may have added to it.&lt;br /&gt;&lt;br /&gt;Right, what to do now. I tried to update the boot archive from both failsafe, and from a spare UFS root, and kept on getting a "filesystem full" error on the ramdisk. Now I have 1.5GB of memory and plenty of swap space, and I had modified the create_ramdisk script to double the amount of memory allocated. I still got the same message. "Marvelleous"&lt;br /&gt;&lt;br /&gt;This all prompted a late night re-think. "I wish I had done a snapshot before I started the bfu....". Ok it was looking like a re-install of the root partition was on the cards. This was something for after the morning coffee... Hang on, after I installed and created a ZFS root, I did a snapshot to create a clone. That snapshot was still there! "zfs rollback intdisk/snv42_root@initial". Reboot. Hey, we are in business. I still have some driver/app installing and JDS update to do, but no Solaris install. Fantastic. So I quickly brought up firefox, and connected to the webcast, just to hear the last sentence. Oh, well I will fix the rest up in the morning. Now if I had only done a snapshot again before the 'bfu'!!!!&lt;br /&gt;&lt;br /&gt;ZFS Rocks!!!&lt;br /&gt;P.S. The time to do a ZFS snapshot is less time then thinking about it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29699307-115271870511268786?l=solaristhings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/115271870511268786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29699307&amp;postID=115271870511268786' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/115271870511268786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/115271870511268786'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/2006/07/zfs-saved-my-backside.html' title='ZFS saved my backside'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29699307.post-115234584856043869</id><published>2006-07-08T14:27:00.000+07:00</published><updated>2006-07-15T10:44:01.940+07:00</updated><title type='text'>How small can you make Open Solaris - Part 2</title><content type='html'>In the first part of the article I decided to use the failsafe miniroot as a base for a minimal Solaris. I also described how to mount and unmount a copy of the miniroot image which I termed microroot. You should be very comfortable with doing this before tackling this article. I will first start with a quick analysis of the miniroot before we start jump in and start removing files. It is really important to find out what is required by the operating system before you weild the 'rm' axe.&lt;br /&gt;&lt;br /&gt;From playing around in the last article you would have realised that failsafe stops at the single user milestone. So it would be really nice to see what file SMF executes to get to the shell prompt. After you get the shell prompt we should look at what processes are running, and what dynamic libraries are in use. This will give us an idea of what needs to be kept.&lt;br /&gt;&lt;br /&gt;Lets start - In normal Solaris as the root user create a directory called 'work' in your root partition. This directory will later be used to transfer files between the microroot and normal solaris. In that directory create a script "report.sh" from the following listing. Other than listing services, and processes. The horrible munge of shell scripting goes through the process table listing share libraries and objects used be each process. It then sorts and does a 'unique', to give you a nice listing of libraries and objects that will be required to keep.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;mkdir /work&lt;br /&gt;vi /work/report.sh&lt;/pre&gt;&lt;hr /&gt;&lt;pre&gt;#!/sbin/sh&lt;br /&gt;&lt;br /&gt;echo "Shared libraries in use"&lt;br /&gt;echo "-----------------------"&lt;br /&gt;(&lt;br /&gt;/usr/bin/ps -eo pid | /usr/bin/awk '&lt;br /&gt;$1 != "PID" {&lt;br /&gt;   printf "/usr/bin/pmap -x %s\n",$1&lt;br /&gt;}' | /sbin/sh 2&gt;/dev/null&lt;br /&gt;) | /usr/bin/awk '{ print $7 }' | /usr/bin/grep '[.]so' | /usr/bin/sort -u&lt;br /&gt;&lt;br /&gt;echo&lt;br /&gt;echo "Services Status"&lt;br /&gt;echo "---------------"&lt;br /&gt;/usr/bin/svcs&lt;br /&gt;&lt;br /&gt;echo&lt;br /&gt;echo "Process Table"&lt;br /&gt;echo "-------------"&lt;br /&gt;/usr/bin/ps -eo user,pid,comm&lt;br /&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;br /&gt;Now we are ready to reboot and run the report. At the grub prompt you can either select the failsafe or the microroot option from part 1 as they should be identical at this point. Instead of pressing &lt;span style="font-style: italic;"&gt;ENTER&lt;/span&gt; to boot press '&lt;span style="font-style: italic;"&gt;e&lt;/span&gt;' for edit. This should bring up a screen with the entries from your &lt;span style="font-style: italic;"&gt;menu.lst&lt;/span&gt; file in the grub directory. Using the arrow keys move down to the line starting with 'kernel' and press '&lt;span style="font-style: italic;"&gt;e&lt;/span&gt;' again. At the end of the line add the '-&lt;span style="font-style: italic;"&gt;m debug&lt;/span&gt;' option. This option will send 'smf' into debug mode filling your screen with information when you boot. Don't worry any changes made here as not save back to the menu.1st file. Press &lt;span style="font-style: italic;"&gt;ENTER&lt;/span&gt; and then '&lt;span style="font-style: italic;"&gt;b&lt;/span&gt;' to boot.&lt;br /&gt;&lt;br /&gt;During the boot smf should be printing out a huge amount of information. Don't panic if you can not speed read, the information you need is at the end. You will see that the last thing smf does is related to install-discovery.xml file. Later if you look at this file you will find it runs the script /sbin/install-discovery. This is a file of great interest and we will definitely attack it.&lt;br /&gt;&lt;br /&gt;At this point you are being asked to mount your normal Solaris partition on /a. Answer '&lt;span style="font-style: italic;"&gt;y&lt;/span&gt;' for yes. Now run the report and put the results back into your work directory.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;cd /&lt;br /&gt;/sbin/sh /a/work/report.sh &gt; /a/work/report.txt&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This should not take long to run. When it has finished reboot in to normal Solaris and review the report.&lt;br /&gt;&lt;br /&gt;In the report you should see around 36 libraries/objects listed. The process table contains a small number of processes running. They seem perfectly reasonable, so we will leave them alone. Now mount the microroot onto /mnt and run a the du command on it. Note: I have truncated the output.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;du -ks * .??* | sort -nr&lt;br /&gt;89502   usr&lt;br /&gt;24961   kernel&lt;br /&gt;10857   lib&lt;br /&gt;2230    platform&lt;br /&gt;1317    etc&lt;br /&gt;1215    sbin&lt;br /&gt;1156    boot&lt;br /&gt;227     .tmp_proto&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;As you may expect, from the ouput of the du command you will see that /usr, /kernel, /lib, /platform are the biggest disk space users. Since /kernel and /platform are the Solaris Kernel we will leave these alone. At the end if you want a smaller image, there is plenty of scope for removing unused driver modules. As most people would expect, it will be /usr and /lib, that will first come under the knife. You might find it strange that /tmp is not empty, and there is a .tmp_proto directory. This is because the Solaris image you are building unlike Solaris on your system is not writeable. The microroot will make use of tmpfs filesystem for files which need to be written to. You can see this by doing a 'ls -l /mnt/etc/vfstab'. If you want to know more, just look through the install-discovery script.&lt;br /&gt;&lt;br /&gt;Now the first time I cutting sections out, I just went in to a directory, had a look and if I did not think the file or directory was relevent I attacked it with the 'rm' command. Then I rebooted to test the changes. After doing this a few times, I thought it would be better to copy the commands into an editor so I could easily repeat the whole process from scratch if needed.&lt;br /&gt;&lt;br /&gt;The next step is to copy /work/report.txt to /work/libs. Edit this file and remove everything except for the libraries and share objects. You will notice that some libraries end with .so and others end with '.so.1&lt;number&gt;' etc. This is the version number of the shared library. With the editor remove the version&lt;number&gt; from the end of the lines. Now all the lines should now end with '.so'. We will use the file later with fgrep to identify the libraries and links we want to keep.&lt;br /&gt;&lt;br /&gt;It is now time to get to the fun part. Choose your weapon, 'as were going Hunting', er sorry - 'deleting'. I have listed the command so you can place them into a script at your leisure.&lt;br /&gt;&lt;br /&gt;Lets start of with a no brainer and remove some obvious directories. No real space is gained yet but it may make you feel better...&lt;/number&gt;&lt;/number&gt;&lt;br /&gt;&lt;pre&gt;cd /mnt&lt;br /&gt;rm -rf /mnt/boot /mnt/cdrom /mnt/opt&lt;br /&gt;&lt;/pre&gt;Remove all locale's except for 'C' from /usr/lib/locale.&lt;br /&gt;&lt;pre&gt;cd /mnt/usr/lib/locale &amp;&amp;amp; rm -rf [a-z]* POSIX&lt;span style="font-family:Georgia,serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;Now take the axe to anything that should not be required. Though make sure you leave anything related to devfsadm, sysevent, and booting the system alone. 'ls' does not need networking so while your at it take out anything network related. This is a script right!  You can fix it later. ( The next part is not intended to look like uuencoding or base64. It just came out that way!)&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;cd /mnt/usr/lib &amp;&amp;amp; rm -rf zones zfs vplot term tabset t[0-9]* sunw,rcp spell&lt;br /&gt;cd /mnt/usr/lib &amp;&amp;amp; rm -rf rcm print patch nss_nisplus.so.1 install ldap krb5&lt;br /&gt;cd /mnt/usr/lib &amp;&amp;amp; rm -rf iconv inet crypto cron diff3prog diffh dns expreserve&lt;br /&gt;cd /mnt/usr/lib &amp;&amp;amp; rm -rf netsvc newsyslog nfs nis nscd_nischeck nss_compat.so.1&lt;br /&gt;cd /mnt/usr/lib &amp;&amp;amp; rm -rf nss_ldap.so.1 nss_nis.so.1 passwdutil.so.1 calprog&lt;br /&gt;cd /mnt/usr/lib &amp;&amp;amp; rm -rf flash fp getoptcvt gmsgfmt help intrd lddstub libc&lt;br /&gt;cd /mnt/usr/lib &amp;&amp;amp; rm -rf lp* lvm localedef lwp makekey more.help mps pt_chmod&lt;br /&gt;cd /mnt/usr/lib &amp;&amp;amp; rm -rf fs/pcfs fs/fd fs/cachefs fs/nfs security/pam_krb5* drv&lt;br /&gt;cd /mnt/usr/lib &amp;&amp;amp; rm -rf pam_dial* pam_ldap* pam_sample* platexec embedded_su&lt;br /&gt;cd /mnt/usr/lib &amp;&amp;amp; rm -rf mdb smartcard sasl rsh kssladm ll* gss exrecover&lt;br /&gt;cd /mnt/usr/lib &amp;&amp;amp; rm -rf nss_dns.so.1 abi adb class link_audit saf utmp* lib.b&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Ok we need to copy the libraries we want to keep, and move them back once we have been brutal with 'rm'. It is now time to use the /work/libs file for input to fgrep. The logic of this script could be re-done, but it does the job for now.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;cd /mnt/usr/lib&lt;br /&gt;mkdir .bak&lt;br /&gt;for i in `ls *[.]so*` ; do echo $i |fgrep -f /work/libs | cpio -pdm .bak 2&gt;/dev/null ; done&lt;br /&gt;rm -f *[.]so*&lt;br /&gt;mv .bak/* .&lt;br /&gt;rm -rf .bak&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Move up one level and take the broad axe to /usr. I will leave /usr/bin and /usr/sbin to your discretion.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;cd /mnt/usr &amp;&amp;amp; rm -rf X X11 adm ccs dict dt java kernel kvm mail net&lt;br /&gt;cd /mnt/usr &amp;&amp;amp; rm -rf platform preserve pub sadm sfw share snadm spool&lt;br /&gt;cd /mnt/usr &amp;&amp;amp; rm -rf news old openwin perl5 src xpg4 proc&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;For the second time use the /works/libs file, but this time on /lib.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;cd /mnt/lib&lt;br /&gt;mkdir .bak&lt;br /&gt;for i in `ls *[.]so*` ; do echo $i |fgrep -f /work/libs | cpio -pdm .bak 2&gt;/dev/null ; done&lt;br /&gt;rm -f *[.]so*&lt;br /&gt;mv .bak/* .&lt;br /&gt;rm -rf .bak&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The final directory we will attack before we build the image and reboot will be /sbin&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;cd /mnt/sbin &amp;&amp;amp; rm -rf rc* install* ifconfig ifparse getpart getmemory zpool&lt;br /&gt;cd /mnt/sbin &amp;&amp;amp; rm -rf rc* biosdev sysid* meta* p* d* e* route* suninstall jsh&lt;br /&gt;cd /mnt/sbin &amp;&amp;amp; rm -rf bootadm bpgetfile cleanup_hosts getInstallLangs swap*&lt;br /&gt;cd /mnt/sbin &amp;&amp;amp; rm -rf getbootargs grepInstalledLocales hostconfig in.mpathd&lt;br /&gt;cd /mnt/sbin &amp;&amp;amp; rm -rf mkmenu mountall netstrategy setup* selection siwrapper&lt;br /&gt;cd /mnt/sbin &amp;&amp;amp; rm -rf soconfig umountall zfs zonename getconsole get_netmask&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now create 2 files. We need bootadm to just exit. The install-discovery file is just the original stripped down (remove the installation code) and compressed to fit in the blog.&lt;br /&gt;&lt;pre&gt;vi /mnt/sbin/bootadm&lt;/pre&gt;&lt;hr /&gt;&lt;pre&gt;#!/sbin/sh&lt;br /&gt;exit 0&lt;br /&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;pre&gt;vi /mnt/sbin/install-discover&lt;/pre&gt;&lt;hr /&gt;&lt;pre&gt;#!/sbin/sh&lt;br /&gt;# Copyright 2005 Sun Microsystems, Inc.  All rights reserved&lt;br /&gt;# Use is subject to license terms.&lt;br /&gt;SHELL=/sbin/sh;export SHELL&lt;br /&gt;PATH=/sbin:/usr/bin:${PATH};export PATH&lt;br /&gt;PLATFORM=`/sbin/uname -p`;export PLATFORM&lt;br /&gt;_INIT_RECONFIG=set; export _INIT_RECONFIG   #Dont know what this does&lt;br /&gt;exec /dev/console 2&gt;&amp;1&lt;br /&gt;/sbin/mount -F tmpfs swap /tmp&lt;br /&gt;if [ $? -ne 0 ]; then&lt;br /&gt;   echo "tmpfs mount failed."&lt;br /&gt;   /sbin/sh&lt;br /&gt;fi&lt;br /&gt;( cd /.tmp_proto; find . -print -depth | cpio -pdm /tmp 2&gt;/tmp/cpio.out )&lt;br /&gt;echo "Memory free after tmpfs initialization: `/sbin/mem`"&lt;br /&gt;echo "swap - /tmp tmpfs - no -" &gt;&gt; /etc/vfstab&lt;br /&gt;echo "/proc - /proc proc - no -" &gt;&gt; /etc/vfstab&lt;br /&gt;find dev -depth -print | cpio -pdum /tmp &gt;/dev/null 2&gt;&amp;1&lt;br /&gt;ln -sf /devices /tmp/devices&lt;br /&gt;/sbin/mount -F lofs -O /tmp/dev /dev&lt;br /&gt;mkdir -p /tmp/etc&lt;br /&gt;mkdir -p /tmp/etc/sysevent&amp;amp;amp;amp;amp;amp;amp;&amp;amp;/usr/lib/sysevent/syseventd -r /tmp&lt;br /&gt;/usr/lib/devfsadm/devfsadmd -r /tmp -p /tmp/root/etc/path_to_inst&lt;br /&gt;eval `/sbin/get_root -t Roottype -b Rootfs /`&lt;br /&gt;echo "${Rootfs} - / ${Roottype} - no ro" &gt;&gt; /etc/vfstab&lt;br /&gt;echo&lt;br /&gt;echo "Welcome to Super Small Solaris"&lt;br /&gt;echo&lt;br /&gt;echo "Dont expect your normal list of command."&lt;br /&gt;echo "Just try 'ls /sbin' and you will find all you want."&lt;br /&gt;echo&lt;br /&gt;exec /sbin/sh&lt;br /&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;br /&gt;After just have made the scripts executable you should unmount /mnt and commit the changes to the image on /grub. The instructions below will backup the filesystem, and restore it onto a smaller UFS image. If you do not do this you will most likely find that your image has actually grown, as the UFS partition is the same size.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;chmod 755 /mnt/sbin/bootadm /mnt/sbin/install-discovery&lt;br /&gt;cd /&lt;br /&gt;du -ks /mnt&lt;br /&gt;# Take note of the size returned and add 15%&lt;br /&gt;sync&lt;br /&gt;ufsdump 0f /work/x86.microroot.dmp /mnt&lt;br /&gt;umount /mnt&lt;br /&gt;lofiadm -d /tmp/x86.microroot&lt;br /&gt;mkfile &lt;size for="" above="" 10=""&gt;k /tmp/x86.microroot&lt;br /&gt;DEV="`lofiadm -a /tmp/x86.microroot`"&lt;br /&gt;newfs -m 0 $DEV&lt;br /&gt;mount -F ufs $DEV /mnt&lt;br /&gt;cd /mnt&lt;br /&gt;ufsrestore -rf /work/x86.microroot.dmp&lt;br /&gt;rm restoresymtable&lt;br /&gt;cd /&lt;br /&gt;umount /mnt&lt;br /&gt;lofiadm -d /tmp/x86.microroot&lt;br /&gt;gzip -c /tmp/x86.microroot &gt; /boot/x86.microroot&lt;br /&gt;&lt;/size&gt;&lt;br /&gt;&lt;/pre&gt;The last step we should do is to create an iso image to try out on a CD&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;cd /tmp&lt;br /&gt;mkdir iso&lt;br /&gt;cp -pr /boot /tmp/iso&lt;br /&gt;rm /tmp/iso/boot/x86.miniroot-safe&lt;br /&gt;rm /tmp/iso/boot/boot_archive&lt;br /&gt;&lt;br /&gt;cat &gt; /tmp/iso/boot/grub/menu.lst &lt;&lt; EOM&lt;br /&gt;default 0&lt;br /&gt;timeout 10&lt;br /&gt;splashimage /boot/grub/splash.xpm.gz&lt;br /&gt;title Solaris Microroot&lt;br /&gt;kernel /boot/multiboot kernel/unix -s&lt;br /&gt;module /boot/x86.microroot&lt;br /&gt;EOM&lt;br /&gt;&lt;br /&gt;mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot boot-load-size 4     -boot-info-table -o /work/microroot.iso iso&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;At the end of all of this you should now have a 25 megabyte iso image in /work. For the moment I will stop here. Before I have gone further and been able to reduce the iso to 18 megabytes which still includes the full 32bit kernel from the latest Open Solaris builds. The next part of the article we will see if we can do the same thing using scripts, getting the files straight from an Open Solaris build. This involves just a little more work as we have to tackle smf and also build our own /devices and /dev directories.&lt;br /&gt;&lt;br /&gt;Good Luck. Let me know how you go!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29699307-115234584856043869?l=solaristhings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/115234584856043869/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29699307&amp;postID=115234584856043869' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/115234584856043869'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/115234584856043869'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/2006/07/how-small-can-you-make-open-solaris_08.html' title='How small can you make Open Solaris - Part 2'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29699307.post-115224543074265291</id><published>2006-07-07T10:23:00.000+07:00</published><updated>2006-08-08T01:03:06.256+07:00</updated><title type='text'>How small can you make Open Solaris - Part 1</title><content type='html'>&lt;a href="http://www.sun.com/software/solaris/index.jsp"&gt;Solaris&lt;/a&gt; started its life as operating system for workstations and then progressed to servers. It has always been an operating system dominated by features, showing Sun's R&amp;D capability. This is great if you are installing a server or a desktop, but has far too many features for building an appliance. Luckily the installing comes with some reduced installation clusters which tries to bring the installation down to the bare minimum. Unfortunately the last time I looked the smallest install was still several hundred megabytes. Linux on the other hand has had a project going for while now called "&lt;a href="http://www.damnsmalllinux.org/"&gt;Damn Small Linux&lt;/a&gt;", which strips Linux down to around 50 megabytes. This is a perfect base to start building an appliance, build your own distro, or strip the kernel down further for an embedded device.&lt;br /&gt;&lt;br /&gt;Can Solaris become as small as "&lt;a href="http://www.damnsmalllinux.org"&gt;Damn Small Linux&lt;/a&gt;". The answer is a resounding yes (and probably smaller). Lets investigate how this can be done. The first thing to do is to state the goal, which is to be able to successfully boot into a shell and execute a simple command such as 'ls'. The logical place to start is with the smallest running version of Solaris supplied by Sun. If you have a x86 grub version of Solaris you will find a 52 megabyte file in your /boot directory called x86.miniroot-safe. This file is a gzipped UFS image that is booted when you select "Solaris failsafe" from the grub menu. Using it to boot to single user mode will mount the root filesystem and give you a root shell. It also contains the code to start a Solaris installation.&lt;br /&gt;&lt;br /&gt;Now we have found an ideal candidate, lets start ripping it apart. The first step is to copy it (as you may need it if you break something), and setup new menu option in grub.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;cd /boot&lt;br /&gt;cp x86.miniroot-safe x86.microroot&lt;br /&gt;cd /boot/grub&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Edit the file menu.lst, copy the failsafe section and modify it to look something like this -&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;title Solaris Micro Root&lt;br /&gt;kernel /boot/multiboot kernel/unix -s&lt;br /&gt;module /boot/x86.microroot&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If you want you now can reboot and select "Solaris Micro Root" when the grub menu comes up. It should boot into your copy of failsafe. After you have finished testing, reboot into multiuser mode and mount this image so you can change it.&lt;br /&gt;&lt;br /&gt;The file '/boot/x86.microroot' is actually a gzipped UFS filesystem image, which with a couple of commands can mounted and change. The following is the an example of the procedure to make changes. I would suggest you create mount and unmount scripts to automate the process. &lt;span style="font-style: italic;"&gt;(Note: You will need superuser privs for the following steps, the root user or atleast sys_mount, file_dac_read, file_dac_write)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Important - &lt;span style="font-weight: bold;"&gt;Make a backup before making changes, and document your changes&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;cp /boot/x86.microroot /boot/x86.microroot.bak&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Unzip image to /tmp&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;gzcat /boot/x86.microroot &gt; /tmp/microroot.img&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Create a loopback device for this file. The environment variable 'dev' catches the device name for later use.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;dev="`lofiadm -a /tmp/microroot.img`"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Finally mount the image using the loopback device.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;mount -F ufs ${dev} /mnt&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;At this point your image is mounted and you can cd to /mnt and make your changes. Note: Be &lt;span style="font-weight: bold;"&gt;VERY VERY CAREFUL&lt;/span&gt; that you are changing or removing the file in /mnt and &lt;span style="font-weight: bold;"&gt;NOT&lt;/span&gt; in the root filesystem. It could get very ugly if you make this mistake. Take your time and be very careful. Once you have made the changes &lt;span style="font-weight: bold;"&gt;DONT REBOOT&lt;/span&gt;. You will need to follow the next steps and commit the changes before you reboot. Also rather than deleting a file or a directory, it is a better practice to move them to a backup directory and then test the changes. If the changes were good then you can delete the backup directory later. If the changes caused problems you can simply move the files and directories back in your next editting session.&lt;br /&gt;&lt;br /&gt;Umount the image and delete the loopback device.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;cd /&lt;br /&gt;umount /mnt&lt;br /&gt;lofiadm -d /tmp/microroot.img&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Copy/gzip the changes back to the /boot directory&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;gzip -c /tmp/microroot.img &gt; /boot/x86.microroot&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You can now reboot and test your changes. If the system hangs, just reset the system and undo what you did and try something else. If the system reboots too fast for you to read the kernel messages,  a handy tip is to add the "-kd" options in the grub menu (combined with or after the '-s'). This will put the kernel straight to debug mode. To continue the boot type '&lt;span style="font-weight: bold;"&gt;:c&lt;/span&gt;' at the prompt. If the kernel panics it should print a message and then wait for you to press a key before rebooting.&lt;br /&gt;&lt;br /&gt;Using this method I reduced the entire image to around 42 megabytes (uncompressed) without touching the 32bit kernel. I then was able to create a 18 megabyte bootable Solaris. The next part I will list the areas you should remove or modify. Hopefully, in Part 3, I will have finished  a script which takes a Open Solaris build from the prototype directory and builds the microroot for you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29699307-115224543074265291?l=solaristhings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/115224543074265291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29699307&amp;postID=115224543074265291' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/115224543074265291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/115224543074265291'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/2006/07/how-small-can-you-make-open-solaris.html' title='How small can you make Open Solaris - Part 1'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29699307.post-115160108992247741</id><published>2006-06-29T23:21:00.000+07:00</published><updated>2006-06-30T00:11:29.956+07:00</updated><title type='text'>ZFS Root on Solaris Part 3</title><content type='html'>Hopefully, you have had success and you now have root on ZFS. In this next post I will describe how to get access to the root partition from failsafe. If you tried like me, you will find that you cannot see the zfs filesystems from failsafe. This is because the zpool.cache configuration file in /etc/zfs has not been copied onto the failsafe miniroot. One thing that is not wise at this point is to use the command "zfs import -f [pool_name]", to import the pool. While it may work, it will probably make your pool inaccessible when you next boot. So what you need to do is to copy the configuration file from your running system into the failsafe miniroot archive. Let' get into it. The steps are -&lt;br /&gt;&lt;br /&gt;1) Boot ZFS root partition and get access to root&lt;br /&gt;&lt;br /&gt;2) gunzip your miniroot image into /tmp&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    gzcat /grub/boot/x86.miniroot-safe &gt; /tmp/miniroot.img&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;3) Using the loopback filesystem to mount the image on /mnt - &lt;i&gt;replace the /dev/lofi/1 with appropriate returned device&lt;/i&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    lofiadm -a /tmp/miniroot.img&lt;br /&gt;    mount /dev/lofi/1 /mnt&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;4) Copy the file /etc/zfs/zpool.cache into /mnt/etc/zfs&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    cp -p /etc/zfs/zpool.cache /mnt/etc/zfs&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;5) unmount the filesystem&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    umount /mnt&lt;br /&gt;    lofiadm -d /tmp/miniroot.img&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;6) gzip the image back to grub.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    gzip -c /tmp/miniroot.img &gt; /grub/boot/x86.miniroot-safe&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;7) Edit the /grub/boot/grub/menu.lst and make sure that there is an identical "root" entry for failsafe and ZFS. Below are the entries for my machine.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    #---------- ADDED BY BOOTADM - DO NOT EDIT ----------&lt;br /&gt;    title Solaris failsafe&lt;br /&gt;    root (hd0,0,a)&lt;br /&gt;    kernel /boot/multiboot kernel/unix -s&lt;br /&gt;    module /boot/x86.miniroot-safe&lt;br /&gt;    #---------------------END BOOTADM--------------------&lt;br /&gt;    title Solaris ZFS&lt;br /&gt;    root (hd0,0,a)&lt;br /&gt;    kernel /boot/multiboot&lt;br /&gt;    module /boot/boot_archive&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;8) You should now be able to reboot into failsafe and see your zfs pool with the "zpool list" command. Also you should be able to see your root filesystem with the "zfs list" command. When you booted, it would have asked you if you want to mount a filesystem on /a. If you answered yes, then unmount it with "umount /a". Now you can use the mount command to mount your ZFS root filesystem on to /a. Note, I previously named my root filesystem "intdisk/snv42_root". Change the command to suite your setup. Also don't forget to add the option "-F zfs". If you dont, mount will try NFS....&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    mount -F zfs intdisk/snv42_root /a&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Finally you can now cd into /a and fix your system. Enjoy!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29699307-115160108992247741?l=solaristhings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/115160108992247741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29699307&amp;postID=115160108992247741' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/115160108992247741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/115160108992247741'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/2006/06/zfs-root-on-solaris-part-3.html' title='ZFS Root on Solaris Part 3'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29699307.post-115147492878680264</id><published>2006-06-28T11:53:00.000+07:00</published><updated>2006-08-10T19:41:49.246+07:00</updated><title type='text'>ZFS Root on Solaris Part 2</title><content type='html'>The first post was just a quick post to show people the commands to use to create a ZFS root filesystem, with a small UFS grub boot partition. This post is an update using a fresh solaris install with comments of what is happening. Most of the steps follow &lt;a href="http://blogs.sun.com/roller/page/tabriz?entry=are_you_ready_to_rumble"&gt;Tabriz's blog&lt;/a&gt; on &lt;a href="http://blogs.sun.com"&gt;blogs.sun.com&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;First step is to do a clean Solaris install which I will leave out all the details except my setup used the following partitioning -&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    c0d0s0   /grub    150MB         Location of the UFS grub boot code&lt;br /&gt;    c0d0s1   swap     1GB           Standard Swap/Dump partition&lt;br /&gt;    c0d0s3   /        4GB           Install/Upgrade UFS partition.&lt;br /&gt;    c0d0s7   ZFS      all the rest  later configured as "intdisk" pool, which contains&lt;br /&gt;                                    ZFS root &amp; clones plus home directories etc&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Once you have installed all of your standard software and configuration, now the fun begins.&lt;br /&gt;&lt;br /&gt;Create a zfs pool, and turn off mounting filesystems by default&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    zpool create -f -m none intdisk c0d0s7&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Create a zfs partition for the root filesystem. Being on a laptop, I am saving space by turning on compression. It may also give a performance boost at the same time. Note that I am using a symbolic name for the partition name. Later I am going to clone the filesystem and create a test environment.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    zfs create intdisk/snv42_root&lt;br /&gt;    zfs set mountpoint=legacy intdisk/snv42_root&lt;br /&gt;    zfs set compression=on intdisk/snv42_root&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Create a mountpoint for the zfs root and use ufsdump/ufsrestore to copy all of the UFS root filesystem. You could use cpio or tar, but you also want the data underneath /devices.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    mkdir -m 0755 /zfsroot&lt;br /&gt;    echo "intdisk/snv42_root - /zfsroot zfs - yes -" &gt;&gt; /etc/vfstab&lt;br /&gt;    mount /zfsroot&lt;br /&gt;    cd /zfsroot&lt;br /&gt;    ufsdump 0f - / | ufsrestore -rf -&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Configure /etc/system on zfs root to use the correct zfs filesystem. This configuation actually gets used by the kernel from within the boot archive, and gets copied each time you update the archive. Also make sure the zpool configuration gets added to the boot archive, and use a classic onliner to up the vfstab on the zfs root.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    echo "rootfs:zfs" &gt;&gt; /zfsroot/etc/system&lt;br /&gt;    echo "zfsroot:intdisk/snv42_root" &gt;&gt; /zfsroot/etc/system&lt;br /&gt;    echo "etc/zfs/zpool.cache" &gt;&gt; /zfsroot/boot/solaris/filelist.ramdisk&lt;br /&gt;    grep -v 'intdisk/snv42_root' /etc/vfstab | awk '$3 == "/" { printf "intdisk/snv42_root\t-\t/\tzfs\t-\tno\t-\n" } ; $3 != "/" { print $0 }' &gt; /zfsroot/etc/vfstab&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Create a modified hack from &lt;a href="http://blogs.sun.com/roller/page/tabriz?entry=are_you_ready_to_rumble"&gt;Tabriz's blog&lt;/a&gt; to fix bootadm.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    mv /zfsroot/sbin/bootadm /zfsroot/sbin/bootadm.real&lt;br /&gt;    cat - &gt; /zfsroot/sbin/bootadm &lt;&lt; EOM&lt;br /&gt;    #!/usr/bin/sh&lt;br /&gt;&lt;br /&gt;    /sbin/bootadm.real "\$@"&lt;br /&gt;    if [ "\$1" = "update-archive" -a -d /grub/boot/grub ]; then&lt;br /&gt;        /usr/bin/cp /platform/i86pc/boot_archive /boot/boot_archive&lt;br /&gt;    fi&lt;br /&gt;    exit 0&lt;br /&gt;    EOM&lt;br /&gt;&lt;br /&gt;    chmod +x /zfsroot/sbin/bootadm&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now we are ready to update the boot archive and configure grub. The "root (hd0,0,a)" should point to the grub partition.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    /usr/sbin/bootadm update-archive -R /zfsroot&lt;br /&gt;    cp -pr /zfsroot/boot /grub&lt;br /&gt;    cp /zfsroot/platform/i86pc/boot_archive /grub/boot/boot_archive&lt;br /&gt;    (&lt;br /&gt;        echo "title Solaris ZFS"&lt;br /&gt;        echo "root (hd0,0,a)"&lt;br /&gt;        echo "kernel /boot/multiboot"&lt;br /&gt;        echo "module /boot/boot_archive"&lt;br /&gt;    ) &gt;&gt; /grub/boot/grub/menu.lst&lt;br /&gt;&lt;br /&gt;    cd /grub/boot/grub&lt;br /&gt;    installgrub stage1 stage2 /dev/rdsk/c0d0s0&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now you can reboot, and if all goes well you should be able to use the new entry in the grub menu to boot into the zfs partition. Ok, if it all looks good, lets try to configure another zfs root partition using a clone. To create copy we simply do a snapshot and a clone of the current zfs root partition. I am naming this partition "snv42_test". Note the changes...&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    zfs snapshot intdisk/snv42_root@initial&lt;br /&gt;    zfs clone intdisk/snv42_root@initial intdisk/snv42_test&lt;br /&gt;    zfs set mountpoint=legacy intdisk/snv42_test&lt;br /&gt;    zfs set compression=on intdisk/snv42_test&lt;br /&gt;    echo "intdisk/snv42_test - /zfsroot zfs - yes -" &gt;&gt; /etc/vfstab&lt;br /&gt;    mount /zfsroot&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Follow similar steps you used last time. Again note the changes I have done to the boot archive name and filesystem name.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    sed -e "s/snv42_root/snv42_test/" /etc/system &gt; /zfsroot/etc/system&lt;br /&gt;    grep -v 'intdisk/snv42_test' /etc/vfstab | awk '$3 == "/" { printf "intdisk/snv42_test\t-\t/\tzfs\t-\tno\t-\n" } ; $3 != "/" { print $0 }' &gt; /zfsroot/etc/vfstab&lt;br /&gt;    &lt;br /&gt;    cat - &gt; /zfsroot/sbin/bootadm &lt;&lt; EOM&lt;br /&gt;    #!/usr/bin/sh&lt;br /&gt;&lt;br /&gt;    /sbin/bootadm.real "\$@"&lt;br /&gt;    if [ "\$1" = "update-archive" -a -d /grub/boot/grub ]; then&lt;br /&gt;        /usr/bin/cp /platform/i86pc/boot_archive /boot/boot_archive.test&lt;br /&gt;    fi&lt;br /&gt;    exit 0&lt;br /&gt;    EOM&lt;br /&gt;&lt;br /&gt;    chmod +x /zfsroot/sbin/bootadm&lt;br /&gt;    &lt;br /&gt;    /usr/sbin/bootadm update-archive -R /zfsroot&lt;br /&gt;    cp /zfsroot/platform/i86pc/boot_archive /grub/boot/boot_archive.test&lt;br /&gt;    (&lt;br /&gt;        echo "#"&lt;br /&gt;        echo "title Solaris ZFS test"&lt;br /&gt;        echo "root (hd0,0,a)"&lt;br /&gt;        echo "kernel /boot/multiboot"&lt;br /&gt;        echo "module /boot/boot_archive.test"&lt;br /&gt;    ) &gt;&gt; /grub/boot/grub/menu.lst&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now you should be able to reboot, and you should now have a cloned test environment. Only changes from the original filesystem are added to the diskspace usage. The number of clones you can have is limited by the number of boot archives you can jam into the /grub partition, and to a lesser extent by the free space you have in the ZFS pool. &lt;br /&gt;&lt;br /&gt;Have Fun!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29699307-115147492878680264?l=solaristhings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/115147492878680264/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29699307&amp;postID=115147492878680264' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/115147492878680264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/115147492878680264'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/2006/06/zfs-root-on-solaris-part-2.html' title='ZFS Root on Solaris Part 2'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29699307.post-115143743402469162</id><published>2006-06-28T02:32:00.000+07:00</published><updated>2006-06-28T02:43:54.040+07:00</updated><title type='text'>ZFS root on Solaris</title><content type='html'>Below is the log of commands I used to have a ZFS root partition with a small ufs for grub. Before I was swapping between 2 root partitions for upgrade, with everything I wanted to keep between upgrades on a ZFS partition. This time I divided one of the root partitions into a small UFS partition, and the rest I used as a ZFS root.&lt;br /&gt;&lt;br /&gt;The next step is a total backup (done), and repartition the disk into a small UFS boot partition for grub boots, a ~4GB ufs install partition, and the rest including root will be all on one ufs partition. On a laptop, the extra diskspace is very handy. I will also spend some time on writing better notes :-)&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;newfs /dev/dsk/c0d0s0&lt;br /&gt;if [ ! -d /altroot ]; then&lt;br /&gt;        mkdir -m 0755 /altroot&lt;br /&gt;fi&lt;br /&gt;echo "/dev/dsk/c0d0s0 /dev/rdsk/c0d0s0 /altroot ufs 3 yes -" &gt;&gt; /etc/vfstab&lt;br /&gt;mount /altroot&lt;br /&gt;zpool create -m none rootdisk c0d0s4&lt;br /&gt;zfs create rootdisk/root&lt;br /&gt;zfs set mountpoint=legacy rootdisk/root&lt;br /&gt;zfs set compression=on rootdisk/root&lt;br /&gt;&lt;br /&gt;/etc/vfstab&lt;br /&gt;rootdisk/root   -       /zfsroot        zfs     -       yes     -&lt;br /&gt;&lt;br /&gt;cd /zfsroot&lt;br /&gt;ufsdump 0f - / | ufsrestore -rf -&lt;br /&gt;&lt;br /&gt;echo "rootfs:zfs" &gt;&gt; /zfsroot/etc/system&lt;br /&gt;echo "zfsroot:rootdisk/root" &gt;&gt; /zfsroot/etc/system&lt;br /&gt;echo "etc/zfs/zpool.cache" &gt;&gt; /zfsroot/boot/solaris/filelist.ramdisk&lt;br /&gt;grep -v 'rootdisk/root' /etc/vfstab | awk '$3 == "/" { printf "rootdisk/root\t-\t/\tzfs\t-\tno\t-\n" } ; $3 != "/" { print $0 }' &gt; /zfsroot/etc/vfstab&lt;br /&gt;mv /zfsroot/sbin/bootadm /zfsroot/sbin/bootadm.real&lt;br /&gt;&lt;br /&gt;cat - &gt; /zfsroot/sbin/bootadm &lt;&lt; EOM&lt;br /&gt;#!/usr/bin/sh&lt;br /&gt;&lt;br /&gt;/sbin/bootadm.real "\$@"&lt;br /&gt;/usr/bin/cp /platform/i86pc/boot_archive /boot/boot_archive&lt;br /&gt;exit 0&lt;br /&gt;EOM&lt;br /&gt;&lt;br /&gt;chmod +x /zfsroot/sbin/bootadm&lt;br /&gt;/usr/sbin/bootadm update-archive -R /zfsroot&lt;br /&gt;cp -pr /zfsroot/boot /altroot&lt;br /&gt;cp /zfsroot/platform/i86pc/boot_archive /altroot/boot/boot_archive&lt;br /&gt;&lt;br /&gt;(&lt;br /&gt;        echo "title Solaris ZFS"&lt;br /&gt;        echo "kernel /boot/multiboot"&lt;br /&gt;        echo "module /boot/boot_archive"&lt;br /&gt;) &gt;&gt; /altroot/boot/grub/menu.lst&lt;br /&gt;&lt;br /&gt;cd /altroot/boot/grub&lt;br /&gt;installgrub stage1 stage2 /dev/rdsk/c0d0s0&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29699307-115143743402469162?l=solaristhings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/115143743402469162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29699307&amp;postID=115143743402469162' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/115143743402469162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/115143743402469162'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/2006/06/zfs-root-on-solaris.html' title='ZFS root on Solaris'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29699307.post-115028772899245149</id><published>2006-06-14T18:55:00.000+07:00</published><updated>2006-06-14T20:07:56.516+07:00</updated><title type='text'>Happy Bithday OpenSolaris</title><content type='html'>&lt;a href="http://www.opensolaris.org"&gt;&lt;img border="0" style="margin: 8px;" alt="Get OpenSolaris" title="Get OpenSolaris" src="http://www.opensolaris.org/os/about/buttons/get_os_ribbon_01.gif"&gt;&lt;/a&gt; Today, as some are aware is the first birthday of the OpenSolaris Community, therefore it is time to reflect on the substantial progress that has made and the future. To fill in the picture properly. I will digress a little to go back in time to the pre-Internet days when dinosaurs and BSD roamed the earth. Being a young system admin at a University the access to Solaris source code was obtainable, and easy to modify for our environment. Therefore to me Solaris was always open source. On many occasions, a quick flick through the files, you could quickly solve problems you were having. Insulated from the outside world, and connected to other University's all over the world (pre and post Internet) and having a regular update of source delivered on tapes, open source was always easily obtainable, and very useful. &lt;br /&gt;&lt;br /&gt;Somewhere down the track Sun decided to jump camps from BSD to System V Unix. For what ever reasons they had, to me this is when Sun changed focus from a company supporting research by building cheap high performance workstations, to focus on the server business market. While, this change at the time prepared them for the first Internet age, it was a shift away from the largely open source BSD, to the very much proprietary System V.&lt;br /&gt;&lt;br /&gt;Many years down the track, with the help of Wall Street growing the Internet much faster than it should, the Internet bubble went Bang! To add to Sun's problems of the times, Intel PC chips at the low end were becoming performance competitive with Sparc, and the IBM's Power PC was impressive at the top end. Like vultures surrounding the dying Sun corpse, Sun competitors, tried to deliver the knockout blow, by helping make the Open Source Linux kernel competitive with Sun's crown jewel Solaris. This is very ironic, as to this day these supporters of the Linux kernel are right up there next to Microsoft being the most closed source companies in the world. Sun could not win a trick. Behind the scenes, they were preparing to Open Source Solaris. They had brought software companies such as Staroffice, and turned them into Open Source, many parts of their software stack were being Open Source'd, but somehow the wider Open Source community label them as somehow “closed”.&lt;br /&gt;&lt;br /&gt;Ok, one year ago to this day, Sun finally created the OpenSolaris community, and released large portions of Solaris as Open Source under a Mozilla type license. What does this do for Sun?&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Sun is now the largest contributer of Open Source software (and hardware), on the planet bar none (something some slash dotter-er's may never accept). It is now difficult (or biased)  to label Sun as a “closed” company.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Solaris is now certified to run on 100's of platforms. This is true remarkable as it is an order of magnitude greater, than supported Linux platforms. Now with Solaris on non Sun platforms, not being treated like a second class citizen, and with Sun having an extremely good x86 product line. It now gives Sun the potential to reach out to new customers, that they could have on dreamed about having a couple of years ago.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Through the Open Solaris community, Sun is showing just how transparent and open the company really is. Many of Sun critics over the last year since the launch of Open Solaris and now Open Sparc, are either changing their opinions of Sun openness, focusing on other areas such as Java Open Sourcing, or are plainly showing that they have vested interests which are always will be opposed to Sun.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Just looking through the Solaris source code shows that it is extremely well written and structured, which shows the reason why Solaris has the reputation for being reliable and secure. It also show, that their developers are extremely talented and well organized. This demonstrates to customers, that Sun are not only able to deliver a good product, but it also has the ability to support it.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Now, more importantly, what has this done for the wider community?&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;It is now much easier for individuals and companies to write device drivers for their product. This was always one area (along with Sun dropping it for awhile) for Solaris on non Sparc systems, that always had major problems.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Other Open Source community's such as BSD, can now implement advanced Solaris features such as dtrace, zfs etc into their codebase. Ironically since the Linux kernel license is more restrictive than that of BSD, they have less freedom to do this in Linux.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;From personal experience in the OpenSolaris over the year, I can testify that Sun is by a long way the most transparent company I have ever seen. While they are tight lipped over the release schedule and configuration for some of their hardware (which is understandable), you can quite easily go into their software forums, and not only see their internal debates, but you can also put your 2 cents worth in and it is taken quite seriously.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;I read the other day, that Dell is now very please with its ability to field 90% support calls for Linux without having to run off to Red Hat (which they then may pass onto a public mailing list). After  laughing for 5 minutes I picked myself up off the floor and thought about it. For many years I would generally spend a fair amount of time looking into the problem (to make sure it wasn't something I did), before I would lodge a support call to Sun or others. Generally the amount of time and effort to go through the support channels for what was most likely a trivial/stupid problem or a known bug, was greater than solving the problem myself. Now days, many simple annoying problems are just a matter of just writing to the relevant Sun's forums. Not only do you get a quick response, you will generally get a response back one of the developers (or fellow external community member), who is only too pleased to help. If you are a customer, this is great for the 90% Dell type questions, for which you need a simple quick answer. For Sun it not only lets their developers know exactly the problems the customers are having, but it helps free up the support network to focus on more difficult support issues.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;When not at work, for many years at home I have survived with my primary desktop being a Solaris machine such as a Sun Blade 100 with a Sun PCI card for windows apps, and a linux development box somewhere on the floor. Now days, I survive of 1 laptop with 2 100GB discs (physically swapped). On one disc I have one partition with Windows which came as a Microsoft tax, and Solaris running in vmware. The other partition is Linux, which currently is the latest Ubuntu. Most people for the day to day work, as I did in the past would use this disk. Today, it is just spends its life sitting in a draw, and I now prefer to use the other disc which is 100% OpenSolaris. Many of the reasons I would use the other disk are now gone. The effort in swapping disks is greater than the value of change. From a pure user experience, there is little difference between running on JDS/Gnone Solaris than Gnome Linux. Of course two standout point here is the lack of 3D graphics support for ATI cards is non existent, so most good games (other than freeciv) are out. Also, the ability to pull packages down through apt-get is surely missed. Running one of the other OpenSolaris distro's would close this gap. The benefits for a developer on Open Solaris with the combination of features such as ZFS, dtrace, zones, Sun Studio, Netbeans, etc are very significant.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Now we have made it to the first birthday of the Open Solaris community, what are some of the more interesting things planned in Open Solaris for the future? and what I would like to see. I will do my top ten. &lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;b&gt;1)&lt;/b&gt; Xen – Solaris on Dom0, would be very nice. Having relatively limited resources on my laptop, products such as VMware are still a bit heavy to emulate a datacenter. The combination of Xen, and Zones, go a long way to solving this problem.&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;b&gt;2)&lt;/b&gt; Trusted Solaris Extentions – Anybody who works with me knows that I do put great importance on security, and control on who can do what on a system. While Solaris 10 has many of the features migrated from Trusted Solaris, it lacks the whole security from day one  approach that Trusted Solaris has. Today Solaris 10 has many things turned on by default to make life easy for a Sysadmin. Trusted Solaris takes the hardline approach where the default profile, makes a Sysadmin think about what should be turned on, who should have access to what, and eithen who should talk to who.&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;b&gt;3)&lt;/b&gt; ZFS boot – While I have a great fondness of ufs, especially its ability in Solaris 10 to mirror disks from jumpstart, zfs is just so much more efficient. The only fix barrier is the number and size of disks I have attached. Live upgrade into a snapshot would be a major win, and very cool.&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;b&gt;4)&lt;/b&gt; Sparks etc projects –  Coming from a background of a large University environment, LDAP directories, authentication, authorization, provisioning a user, can be difficult. While Sun Identity and Directory products are technically superior to other products on the market, they do no easily transform to the desktop. The Active Directory and Windows desktop combination when setup by a good sysadmin, is superior to anything Solaris and Linux has. The level, of control direct control of the desktop from the directory is impressive, when implemented properly. An advancement is this area is greatly needed for the Unix/Linux world.&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;b&gt;5)&lt;/b&gt; JDS – Vermillion is coming on very nicely, and is catching quickly up to the commercial Linux Gnome implementations. The sooner CDE is shown the door the better.&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;b&gt;6)&lt;/b&gt; Device Drivers – Great inroads have been made into the one big advantage that  Windows and Linux have had over Solaris x86 (Sparc always had good support for its hardware). While you would class it as a small subset of drivers, it mostly covers all of the important ones. Solaris actually has an advantage in the future here, as it has much less baggage of old drivers). On my laptop, the only thing I am really missing that I want is a good 3D driver for the graphics card. The others just don't affect me working day to day, and I rarely ever used them under the other OS's. For mobile phone junkies bluetooth would be nice.&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;b&gt;7)&lt;/b&gt; Porting Solaris to other devices – I would feel safer if my mobile phone (or my fridge) was running Solaris rather than something from Microsoft, or eithen Linux. While it is not a big thing, as long as the phone (or fridge) does its function, I am generally pleased....&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;b&gt;8)&lt;/b&gt; GNU – While GNU/Solaris pre dates GNU/Linux, the creation of such a beast with the latest versions has been up to the owner. Having the GNU binaries and libraries in known configuration, makes it easier port other applications across. Also having up to date versions would negate the need to uninstall the delivered version or compile the newer version for another directory and have dynamic library madness.&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;b&gt;9)&lt;/b&gt; Patching and Packaging – This is can be a painful area for sysadmins. Adding zones while in theory makes life easier, currently in practice, it can be troublesome. Now that the package tool source code has been released, it may spur the community to come up with some alternatives and tools.&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;b&gt;10)&lt;/b&gt; Games – How could I leave this to last :-) Solaris has been lacking in this area for a long time. This is due to the fact that before, buying a Sparc machine with a 3D graphics card, would cost you a lot of money, as you were really buying something designed as a workstation. Only that Nvidia and ATI, now offer the closed source 3D driver that Linux is a viable platform for games. Having a ATI graphics card in my laptop, I cannot eithen run Java games which need 3D drivers. For the moment it is freeciv (the latest beta is really nice). I hope ATI will release a driver before the next birthday.&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;To summarize, all in all to extend an Australian term “Its been a bloody good year for OpenSolaris”, lets make '&lt;span style="font-style:italic;"&gt;every&lt;/span&gt;' next year better!!!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;P.S. A special thanks to Scott, Jonathon, and the team for the leadership to create OpenSolaris.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29699307-115028772899245149?l=solaristhings.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://solaristhings.blogspot.com/feeds/115028772899245149/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29699307&amp;postID=115028772899245149' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/115028772899245149'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29699307/posts/default/115028772899245149'/><link rel='alternate' type='text/html' href='http://solaristhings.blogspot.com/2006/06/happy-bithday-opensolaris.html' title='Happy Bithday OpenSolaris'/><author><name>Doug Scott</name><uri>http://www.blogger.com/profile/01147471010902962909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
