{"id":44,"date":"2008-10-15T02:43:18","date_gmt":"2008-10-15T10:43:18","guid":{"rendered":"http:\/\/www.pagetable.com\/?p=44"},"modified":"2008-10-15T02:43:18","modified_gmt":"2008-10-15T10:43:18","slug":"building-the-solaris-kernel-in-73-easy-steps","status":"publish","type":"post","link":"https:\/\/www.pagetable.com\/?p=44","title":{"rendered":"Building the Solaris Kernel in 73 Easy Steps"},"content":{"rendered":"<p>Everyone and their grandmother builds Linux kernels. Many people build BSD, and some brave men even compile the OS X kernel every now and then. Why not compile your own Solaris kernel for a change?<\/p>\n<p>There is lots of documentation scattered out there, many pieces, incomplete, outdated and over-generalized tutorials. This will walk you through installing Solaris, adding all components required for building, and actually compiling a kernel in 73 easy steps.<\/p>\n<p>I won&#8217;t give you any options, because options make everything more complicated. We&#8217;re installing Solaris on a dedicated machine, the versions of the build system and the target kernel\/system will match and we&#8217;re targeting x86\/x64 only.<\/p>\n<ol>\n<li>Get a physical computer with maybe a GB of RAM and significantly more than 10 GB of disk space. VMware and VirtualBox seem to have issues with current builds (b97-b99).<\/li>\n<li>Navigate to <a href=\"http:\/\/opensolaris.org\/os\/downloads\/\">http:\/\/opensolaris.org\/os\/downloads\/<\/a><\/li>\n<li>Download the latest build of OpenSolaris Express Community Edition (Nevada). You can&#8217;t compile a kernel on any other Solaris distribution. Get Nevada. If you want to run a specific build, hack the URL and replace the build number; older builds are available, but not linked to.<\/li>\n<li>burn DVD<\/li>\n<li>boot DVD<\/li>\n<li>GRUB: &#8220;Solaris Express&#8221;<\/li>\n<li>select &#8220;Solaris Interactive&#8221;<\/li>\n<li>make your language perference<\/li>\n<li>choose Networked<\/li>\n<li>DHCP yes<\/li>\n<li>IPv6 no<\/li>\n<li>Kerberos no<\/li>\n<li>Name Service: none<\/li>\n<li>NFS domain derived by the system<\/li>\n<li>choose your time zone<\/li>\n<li>enter your root password<\/li>\n<li>reboot yes, eject yes<\/li>\n<li>media CD\/DVD<\/li>\n<li>accept the license<\/li>\n<li>custom install<\/li>\n<li>no localizations<\/li>\n<li>no additional products<\/li>\n<li>Entire Group, Default (~7 GB)<\/li>\n<li>select your install HD &#8211; remember that this is a dedicated disk that will be wiped!<\/li>\n<li>accept a single Solaris MBR partition with all the space<\/li>\n<li>modify the layout: remove \/export\/home and allocate all to &#8220;\/&#8221;, keep swap<\/li>\n<li>wait<\/li>\n<li>the system will reboot. remove the DVD<\/li>\n<li>wait a long time again &#8211; the GUI login screen will show up eventually, don&#8217;t log in on the console<\/li>\n<li>log in as root<\/li>\n<li>(b99 will hang after a short &#8220;About Gnome&#8221; screen, hit Ctrl+Alt+Backspace to kill the X-Server and log in again)<\/li>\n<li>Administration -> Users and Groups, Add User<\/li>\n<li>log out<\/li>\n<li>log in as user<\/li>\n<li>find out what compiler you need: <a href=\"http:\/\/www.opensolaris.org\/os\/downloads\/on\/\">http:\/\/www.opensolaris.org\/os\/downloads\/on\/<\/a> says you need Sun Studio 11 up to b99, and Sun Studio 12 starting with b100.<\/li>\n<li>click on the linked Sun Studio<\/li>\n<li>it might say &#8220;Chinese-Simplified&#8221; as language, but the file is correct.<\/li>\n<li>don&#8217;t use the download manager, just click on the file and choose &#8220;Save File&#8221;<\/li>\n<li>Navigate to <a href=\"http:\/\/dlc.sun.com\/osol\/on\/downloads\/\">http:\/\/dlc.sun.com\/osol\/on\/downloads\/<\/a><\/li>\n<li>choose your build of your installed system (don&#8217;t say &#8220;current&#8221;, that&#8217;s newer!)<\/li>\n<li>download &#8220;ON Source&#8221;: on-src.tar.bz2<\/li>\n<li>download &#8220;ON Specific Build Tools (i386)&#8221;: SUNWonbld.i386.tar.bz2<\/li>\n<li>download &#8220;ON Binary-Only Components (debug, i386): on-closed-bins.i386.tar.bz2<\/li>\n<li>All Applications -> Accessories -> Terminal<\/li>\n<li>fix the prompt:\n<pre>echo \"export PS1='h:W u$ '\" >> .bashrc<\/pre>\n<\/li>\n<li>add onbld to the PATH:\n<pre>echo \"PATH=\/opt\/onbld\/bin:$PATH\" >> .bashrc<\/pre>\n<\/li>\n<li>close the window and start a new terminal, or ssh into the machine; you can get your IP with\n<pre>\/usr\/sbin\/ifconfig -a<\/pre>\n<\/li>\n<li>\n<pre>su<\/pre>\n<\/li>\n<li>\n<pre>bash<\/pre>\n<\/li>\n<li>\n<pre>cd \/opt<\/pre>\n<\/li>\n<li>\n<pre>bzip2 -cd \/export\/home\/username\/Desktop\/sunstudio*.tar.bz2 | tar xf -<\/pre>\n<\/li>\n<li>\n<pre>cd \/export\/home\/username\/Desktop<\/pre>\n<\/li>\n<li>\n<pre>bzip2 -cd SUNWonbld*.tar.bz2 | tar xf -<\/pre>\n<\/li>\n<li>\n<pre>pkgadd -d onbld SUNWonbld<\/pre>\n<\/li>\n<li>\n<pre>y<\/pre>\n<\/li>\n<li>close Terminal window, open a new one<\/li>\n<li>\n<pre>mkdir work<\/pre>\n<\/li>\n<li>\n<pre>cd work<\/pre>\n<\/li>\n<li>\n<pre>bzip2 -cd ~\/Desktop\/on-closed-bins*.tar.bz2 | tar xf -<\/pre>\n<\/li>\n<li>\n<pre>bzip2 -cd ~\/Desktop\/on-src*.tar.bz2 | tar xf -<\/pre>\n<\/li>\n<li>\n<pre>cd usr\/src\/tools<\/pre>\n<\/li>\n<li>\n<pre>mkdir proto<\/pre>\n<\/li>\n<li>\n<pre>ln -s \/opt proto<\/pre>\n<\/li>\n<li>\n<pre>cd ..\/..\/..<\/pre>\n<\/li>\n<li>\n<pre>cp usr\/src\/tools\/env\/opensolaris.sh .<\/pre>\n<\/li>\n<li>\n<pre>vi opensolaris.sh<\/pre>\n<\/li>\n<li>set GATE to &#8220;work&#8221; (base directory name)<\/li>\n<li>set CODEMGR_WS to &#8220;\/export\/home\/username\/$GATE&#8221; (full path)<\/li>\n<li>set STAFFER to your username<\/li>\n<li>set VERSION to &#8220;$STAFFER&#8221; to have your name in the kernel version<\/li>\n<li>\n<pre>bldenv .\/opensolaris.sh<\/pre>\n<\/li>\n<li>\n<pre>cd usr\/src\/uts<\/pre>\n<\/li>\n<li>\n<pre>dmake all<\/pre>\n<\/li>\n<\/ol>\n<p>(If it complains with &#8220;illegal option -m64&#8221;, your compiler is too old. Get Sun Studio 12. If anything fails, read the README from the download page for updates on the build you&#8217;re using.)<\/p>\n<p>Now if we only knew what to do with that kernel!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Everyone and their grandmother builds Linux kernels. Many people build BSD, and some brave men even compile the OS X kernel every now and then. Why not compile your own Solaris kernel for a change? There is lots of documentation scattered out there, many pieces, incomplete, outdated and over-generalized tutorials. This will walk you through &#8230; <a title=\"Building the Solaris Kernel in 73 Easy Steps\" class=\"read-more\" href=\"https:\/\/www.pagetable.com\/?p=44\" aria-label=\"Read more about Building the Solaris Kernel in 73 Easy Steps\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,22,36],"tags":[],"class_list":["post-44","post","type-post","status-publish","format-standard","hentry","category-hacks","category-operating-systems","category-whines"],"_links":{"self":[{"href":"https:\/\/www.pagetable.com\/index.php?rest_route=\/wp\/v2\/posts\/44","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pagetable.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pagetable.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pagetable.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pagetable.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=44"}],"version-history":[{"count":0,"href":"https:\/\/www.pagetable.com\/index.php?rest_route=\/wp\/v2\/posts\/44\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.pagetable.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=44"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pagetable.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=44"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pagetable.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=44"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}