Updating a NetBSD/mac68k system from a.out to ELF (This is modified version
of the procedure documented in
http://www.netbsd.org/Documentation/elf.html)
The recommended method is to install an ELF snapshot using the
`upgrade' method described in the installation documentation
(which involves booting the miniroot kernel). Instructions for
upgrading a `live' system without using the miniroot are shown
at the end of the document, but the procedure is not recommended
for novice users.
Likewise, upgrading from source is convoluted and non-trivial,
and therefore is also not recommended for novice users.
If you try upgrading via source and something goes wrong it is
very easy to hose your system such that it will not even boot
to single-user mode.
First, we'll describe upgrading to ELF from a snapshot without
using a miniroot. For those who are interested, we will then
describe how to upgrade NetBSD/mac68k using a source tree.
* Upgrading to ELF from snapshot, without using a miniroot:
1. Get the snapshot from the folloing location:
ftp://ftp.netbsd.org/pub/NetBSD/arch/mac68k/binary/
For the purposes of this document, we will suppose that
he snapshot sets are installed in <SNAPSHOT> directory.
2. Make the binaries set for upgrading.
Make sure that the <ELF_UPGRADE> directory already exists
and that it has at least 10 MB of free space available.
(For example, you may use /tmp/elf-upgrade as <ELF_UPGRADE>
if your /tmp file system has enough space available.)
# cd <a temporary, working directory>
# tar zxvpf <SNAPSHOT>/binary/sets/base.tgz ./sbin
# cp -p ./sbin/ifconfig <ELF_UPGRADE>/.
# cp -p ./sbin/route <ELF_UPGRADE>/.
# cp -p ./sbin/mount <ELF_UPGRADE>/.
# cp -p ./sbin/mount_nfs <ELF_UPGRADE>/.
3. If your machine has a network connection and/or uses NFS,
perform the following steps:
# cd /sbin
# mv ifconfig ifconfig-a.out
# mv route route-a.out
# mv mount mount-a.out
# mv mount_nfs mount_nfs-a.out
# cp <ELF_UPGRADE>/* .
# cd /usr/bin
# mv ldd ldd-a.out (if you will need the ldd(1) utility)
4. Install the ELF kernel.
If you need, backup a.out kernel. For example,
# mv /netbsd /netbsd.aout
# cp -p <SNAPSHOT>/binary/sets/kernel/netbsd-GENERIC.gz /netbsd.gz
# cd / && gzip -d netbsd.gz
5. Move a.out shared libraries from /usr/lib and
/usr/X11R6/lib to /emul/aout. For X libraries, move only
the libaries originally installed with your system to
avoid causing inconsistencies in the installed packages
database (/var/db/pkg).
# mkdir -p /emul/aout/usr/lib /emul/aout/usr/X11R6/lib
# mv /usr/lib/*.so* /emul/aout/usr/lib
# mv /usr/X11R6/lib/libICE.so.6.3 /emul/aout/usr/X11R6/lib
# mv /usr/X11R6/lib/libPEX5.so.6.0 /emul/aout/usr/X11R6/lib
# mv /usr/X11R6/lib/libSM.so.6.0 /emul/aout/usr/X11R6/lib
# mv /usr/X11R6/lib/libX11.so.6.1 /emul/aout/usr/X11R6/lib
# mv /usr/X11R6/lib/libXIE.so.6.0 /emul/aout/usr/X11R6/lib
# mv /usr/X11R6/lib/libXaw.so.6.1 /emul/aout/usr/X11R6/lib
# mv /usr/X11R6/lib/libXext.so.6.3 /emul/aout/usr/X11R6/lib
# mv /usr/X11R6/lib/libXi.so.6.0 /emul/aout/usr/X11R6/lib
# mv /usr/X11R6/lib/libXmu.so.6.0 /emul/aout/usr/X11R6/lib
# mv /usr/X11R6/lib/libXp.so.6.2 /emul/aout/usr/X11R6/lib
# mv /usr/X11R6/lib/libXt.so.6.0 /emul/aout/usr/X11R6/lib
# mv /usr/X11R6/lib/libXtst.so.6.1 /emul/aout/usr/X11R6/lib
# mv /usr/X11R6/lib/liboldX.so.6.0 /emul/aout/usr/X11R6/lib
6. Reboot with the new ELF kernel.
Caution: You must boot the new ELF kernel with the new Booter.
Get Booter(2.0.0a10) or Booter(2.0.1a1) from:
http://homepage.mac.com/nigelpearson/
An officially blessed version of the Booter will be available
from the standard location on ftp.netbsd.org and its mirrors
for the next major release of NetBSD.
7. Untar the distribution sets (except etc.tgz and kern.tgz) using
the following commands:
# cd /
# tar --unlink -xvzpf <SNAPSHOT>/binary/sets/base.tgz
# tar --unlink -xvzpf <SNAPSHOT>/binary/sets/comp.tgz
# tar --unlink -xvzpf <SNAPSHOT>/binary/sets/games.tgz
# tar --unlink -xvzpf <SNAPSHOT>/binary/sets/man.tgz
# tar --unlink -xvzpf <SNAPSHOT>/binary/sets/misc.tgz
# tar --unlink -xvzpf <SNAPSHOT>/binary/sets/text.tgz
If you run in a production environment or would like to
otherwise avoid surprises, you should consider rebooting
after installing the distribution sets in order to verify
that they have been installed properly.
* For those who wish to to upgrade mac68k from source:
1. Get the -current source. This document assumes that the source
is installed in /usr/src.
# setenv CVSROOT ":pserver:
[email protected]:/cvsroot"
# setenv CVS_RSH ssh
# cvs co -P src
2. Check for making new ELF kernel and userland.
Check to see if the named and ntpd user and group exist
on your system. If you don't have them, add them by hand.
Add the following into /etc/group:
named:*:14:
ntpd:*:15:
and the following to the passwd file using vipw(8):
named:*:14:14::0:0:Named pseudo-user:/var/named:/sbin/nologin
ntpd:*:15:15::0:0:Ntpd pseudo-user:/var/chroot/ntpd:/sbin/nologin
3. Prepare to do a full build with NEW_TOOL_CHAIN.
IMPORTANT: If you don't execute the following, a build will
stop with all virtual memory exhausted.
# limit datasize 65536k
# limit stacksize 32768k
4. Build the system with NEW_TOOL_CHAIN.
<DESTDIR> Where the distribution directory resides.
<RELEASEDIR> Where the release directory resides.
# cd /usr/src
# ./build.sh -D <DESTDIR> -R <RELEASEDIR>
5. Install the ELF kernel.
If you need, backup a.out kernel. For example,
# mv /netbsd /netbsd.aout
# cp -p <RELEASEDIR>/binary/sets/kernel/netbsd-GENERIC.gz /netbsd.gz
# cd / && gzip -d netbsd.gz
6. Copy the ELF binaries from
<DESTDIR>/sbin/ifconfig
<DESTDIR>/sbin/route
<DESTDIR>/sbin/mount
<DESTDIR>/sbin/mount_nfs
<DESTDIR>/usr/bin/ldd (if you will need the ldd(1) utility)
into /sbin. This is fairly important if you want your network
and NFS mounts to still work! If you will need the original
a.out binaries, be sure to back them up first.
7. Move a.out shared libraries from /usr/lib and
/usr/X11R6/lib to /emul/aout. For X libraries, move only
the libaries originally installed with your system to
avoid causing inconsistencies in the installed packages
database (/var/db/pkg).
# mkdir -p /emul/aout/usr/lib /emul/aout/usr/X11R6/lib
# mv /usr/lib/*.so* /emul/aout/usr/lib
# mv /usr/X11R6/lib/libICE.so.6.3 /emul/aout/usr/X11R6/lib
# mv /usr/X11R6/lib/libPEX5.so.6.0 /emul/aout/usr/X11R6/lib
# mv /usr/X11R6/lib/libSM.so.6.0 /emul/aout/usr/X11R6/lib
# mv /usr/X11R6/lib/libX11.so.6.1 /emul/aout/usr/X11R6/lib
# mv /usr/X11R6/lib/libXIE.so.6.0 /emul/aout/usr/X11R6/lib
# mv /usr/X11R6/lib/libXaw.so.6.1 /emul/aout/usr/X11R6/lib
# mv /usr/X11R6/lib/libXext.so.6.3 /emul/aout/usr/X11R6/lib
# mv /usr/X11R6/lib/libXi.so.6.0 /emul/aout/usr/X11R6/lib
# mv /usr/X11R6/lib/libXmu.so.6.0 /emul/aout/usr/X11R6/lib
# mv /usr/X11R6/lib/libXp.so.6.2 /emul/aout/usr/X11R6/lib
# mv /usr/X11R6/lib/libXt.so.6.0 /emul/aout/usr/X11R6/lib
# mv /usr/X11R6/lib/libXtst.so.6.1 /emul/aout/usr/X11R6/lib
# mv /usr/X11R6/lib/liboldX.so.6.0 /emul/aout/usr/X11R6/lib
8. Reboot with the new ELF kernel.
Caution: You must boot the new ELF kernel with the new Booter.
Get Booter(2.0.0a10) or Booter(2.0.1a1) from:
http://homepage.mac.com/nigelpearson/
An officially blessed version of the Booter will be available
from the standard location on ftp.netbsd.org and its mirrors
for the next major release of NetBSD.
9. Install all userland ELF binaries.
# cd /usr/src && ./build.sh
If you want to finish in short time, you need to set
MKOBJDIRS=no, BUILD_DONE=yes, and so on.
If you run in a production environment or would like to
otherwise avoid surprises, you should consider rebooting
after the build has completed in order to verify that the
userland ELF binaries have been installed properly.
References:
http://www.netbsd.org/Documentation/elf.html
ftp://ftp.netbsd.org/pub/NetBSD/arch/atari/snapshot/README.ELF-UPGRADE
Written by Takeshi Shibagaki(
[email protected])
Reviewed by Frederick Bruckman(
[email protected])
Allen Briggs(
[email protected])
Steve Allen(
[email protected])
Scott Reynolds(
[email protected])