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 directory. 2. Make the binaries set for upgrading. Make sure that the directory already exists and that it has at least 10 MB of free space available. (For example, you may use /tmp/elf-upgrade as if your /tmp file system has enough space available.) # cd # tar zxvpf /binary/sets/base.tgz ./sbin # cp -p ./sbin/ifconfig /. # cp -p ./sbin/route /. # cp -p ./sbin/mount /. # cp -p ./sbin/mount_nfs /. 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 /* . # 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 /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 /binary/sets/base.tgz # tar --unlink -xvzpf /binary/sets/comp.tgz # tar --unlink -xvzpf /binary/sets/games.tgz # tar --unlink -xvzpf /binary/sets/man.tgz # tar --unlink -xvzpf /binary/sets/misc.tgz # tar --unlink -xvzpf /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:anoncvs@anoncvs.netbsd.org:/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. Where the distribution directory resides. Where the release directory resides. # cd /usr/src # ./build.sh -D -R 5. Install the ELF kernel. If you need, backup a.out kernel. For example, # mv /netbsd /netbsd.aout # cp -p /binary/sets/kernel/netbsd-GENERIC.gz /netbsd.gz # cd / && gzip -d netbsd.gz 6. Copy the ELF binaries from /sbin/ifconfig /sbin/route /sbin/mount /sbin/mount_nfs /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(shiba@netbsd.org) Reviewed by Frederick Bruckman(fredb@netbsd.org) Allen Briggs(briggs@netbsd.org) Steve Allen(wormey@netbsd.org) Scott Reynolds(scottr@netbsd.org)