Java 2 Ada - Tag NetBSD2015-01-10T20:22:00+00:00Stephane Carrezurn:md5:d12e23c53b2436d6becce3d51ddbdf38AWANetBSD 6.1.5 upgradeurn:md5:f5416fcb755a32e7033b933ec9ca9e732015-01-10T20:22:00+00:002015-01-10T20:22:00+00:00Stephane CarrezupgradeNetBSD
<div class="post-text"><p>Once every year I try to upgrade one of my virtual machine which is running <a href="http://www.netbsd.org/">NetBSD</a>. This description is a short reminder for the major steps for the upgrade process.</p><h4>System upgrade</h4><p>The NetBSD system is upgraded by using the following command:</p><div style='float: none; border: 1px solid #aaa; width: 90%; margin-bottom: 10px; white-space: pre;'
>poseidon$ <b>sudo sysupgrade auto ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-6.1/i386</b>
</div>
<p>During the upgrade it will ask whether some system files have to be replaced, merged or kept unmodified.</p><h4>GCC Ada Package Upgrade</h4><p>The <a href="ftp://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/lang/gcc-aux/README.html">GCC Ada</a> compiler is now based on GCC 4.9. I did the upgrade by using the following command:</p><div style='float: none; border: 1px solid #aaa; width: 90%; margin-bottom: 10px; white-space: pre;'
>poseidon$ <b>sudo pkg_add -uu gcc-aux-20140422nb3</b>
pkg_add: Warning: package `gcc-aux-20140422nb3' was built for a platform:
pkg_add: NetBSD/i386 6.0 (pkg) vs. NetBSD/i386 6.1.4 (this host)
</div>
<p>The <b>gprbuild</b> package must also be upgrade:</p><div style='float: none; border: 1px solid #aaa; width: 90%; margin-bottom: 10px; white-space: pre;'
>poseidon$ <b>sudo pkg_add -u gprbuild-aux-20130416</b>
pkg_add: Warning: package `gprbuild-aux-20130416' was built for a platform:
pkg_add: NetBSD/i386 6.0 (pkg) vs. NetBSD/i386 6.1.4 (this host)
pkg_add: Warning: package `gnat_util-20140422' was built for a platform:
pkg_add: NetBSD/i386 6.0 (pkg) vs. NetBSD/i386 6.1.4 (this host)
</div>
<p>And because I also use some other packages such as <b>xmlada</b>, the following package is also upgrade:</p><div style='float: none; border: 1px solid #aaa; width: 90%; margin-bottom: 10px; white-space: pre;'
>poseidon$ <b>sudo pkg_add -u xmlada-4.4.0.0nb1</b>
pkg_add: Warning: package `xmlada-4.4.0.0nb1' was built for a platform:
pkg_add: NetBSD/i386 6.0 (pkg) vs. NetBSD/i386 6.1.4 (this host)
</div>
<h4>Before running an Ada program compiled by GCC 4.9</h4><p>The GCC 4.9 Ada compiler works very well but it comes with a specific <b>libgcc_s.so</b> file installed in <code>/usr/pkg/gcc-aux/lib</code>. By default <b>libgcc_s.so</b> is installed on the system in <code>/usr/lib/libgcc_s.so</code> or <code>/usr/pkg/lib/libgcc_s.so</code> and they were compiled by GCC 4.5.3 or GCC 4.6.4.</p><p>If you use the wrong <b>libgcc_s.so</b>, the program will almost work except when a exception is raised: none of the exception can be caught and the program terminates as though there was no exception handler.</p><p>What happens is that the GCC 4.6 frame unwinder is unable to correctly identify the frames generated by GCC 4.9. The solution is of course to use the correct library and we can do this by setting the following environment variable before starting any program:</p><div style='float: none; border: 1px solid #aaa; width: 90%; margin-bottom: 10px; white-space: pre;'
>poseidon$ <b>export LD_LIBRARY_PATH=/usr/pkg/gcc-aux/lib</b>
</div>
</div> Upgrading to NetBSD 6.1.4urn:md5:3aa9bd5be3a19b8b1daa9aeddd66036f2014-04-27T13:45:03+00:002014-04-27T13:45:03+00:00Stephane CarrezNetBSDupgrade
<div class="post-text"><p>I'm using <a href="http://www.netbsd.org/">NetBSD</a> for few years now but I've never took time to upgrade the system to a new version. To remember what I did for the upgrade, I've collected below the main steps.</p><h3>Setup</h3><p>The system upgrade can be made from the running NetBSD system by using the <code>sysupgrade</code> tool. I have installed the tool by using:</p><pre><code>sudo pkgin install sysupgrade
</code></pre><p>Edit the file <code>/usr/pkg/etc/sysupgrade.conf</code> and setup the <code>RELEASEDIR</code> to point to the new release:</p><pre><code>RELEASEDIR="ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-6.1.4/$(uname -m)"
</code></pre><h3>NetBSD upgrade</h3><p>Now, we just have to run the <code>sysupgrade</code> command to upgrade the base system and NetBSD kernel and then upgrade the packages by using the <code>pkgin</code> command.</p><pre><code>sudo sysupgrade auto
sudo pkgin upgrade
sudo pkgin full-upgrade
</code></pre><p>And after the upgrade reboot the new kernel:</p><pre><code>sudo shutdown -r now
</code></pre></div>