Java 2 Ada

NetBSD 6.1.5 upgrade

By stephane.carrez

Once every year I try to upgrade one of my virtual machine which is running NetBSD. This description is a short reminder for the major steps for the upgrade process.

System upgrade

The NetBSD system is upgraded by using the following command:

poseidon$ sudo sysupgrade auto ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-6.1/i386
During the upgrade it will ask whether some system files have to be replaced, merged or kept unmodified.

GCC Ada Package Upgrade

The GCC Ada compiler is now based on GCC 4.9. I did the upgrade by using the following command:

poseidon$ sudo pkg_add -uu gcc-aux-20140422nb3 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)
The gprbuild package must also be upgrade:
poseidon$ sudo pkg_add -u gprbuild-aux-20130416 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)
And because I also use some other packages such as xmlada, the following package is also upgrade:
poseidon$ sudo pkg_add -u xmlada-4.4.0.0nb1 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)

Before running an Ada program compiled by GCC 4.9

The GCC 4.9 Ada compiler works very well but it comes with a specific libgcc_s.so file installed in /usr/pkg/gcc-aux/lib. By default libgcc_s.so is installed on the system in /usr/lib/libgcc_s.so or /usr/pkg/lib/libgcc_s.so and they were compiled by GCC 4.5.3 or GCC 4.6.4.

If you use the wrong libgcc_s.so, 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.

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:

poseidon$ export LD_LIBRARY_PATH=/usr/pkg/gcc-aux/lib

To add a comment, you must be connected. Login to add a comment

Upgrading to NetBSD 6.1.4

By stephane.carrez

I'm using NetBSD 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.

Setup

The system upgrade can be made from the running NetBSD system by using the sysupgrade tool. I have installed the tool by using:

sudo pkgin install sysupgrade

Edit the file /usr/pkg/etc/sysupgrade.conf and setup the RELEASEDIR to point to the new release:

RELEASEDIR="ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-6.1.4/$(uname -m)"

NetBSD upgrade

Now, we just have to run the sysupgrade command to upgrade the base system and NetBSD kernel and then upgrade the packages by using the pkgin command.

sudo sysupgrade auto
sudo pkgin upgrade
sudo pkgin full-upgrade

And after the upgrade reboot the new kernel:

sudo shutdown -r now
  • Page 1