This step is optional. You can always install the OS from the official distribution, however doing a cross-build will allow you to more quickly build the kernel and optimize both kernel / userland as you'd like. I use this for my own reference when installing NetBSD/atari, so the instructions here are fairly pedantic.
Initial Setup[]
- Get set up with a NetBSD install on a reasonably fast machine. I've found Hyper-V Server to work well. The instructions below reflect this choice.
- Download the latest NetBSD AMD64 ISO locally, ex: ftp://ftp.netbsd.org/pub/NetBSD/iso/[current release version]/NetBSD-N.N.N-amd64.iso.
- Create a VM with 512MB RAM and 50GB disk. Set the VM to boot from the downloaded ISO. On Hyper-V, the install will go a bit faster if you pre-create a fixed size 50GB virtual drive.
- In the VM settings, remove the network adapter and add a Legacy Network Adapter configured to use the external network connection.
- Allow the machine to boot with option 3 (no ACPI, no SMP).
- Select language, keyboard type.
- At the main menu select the option to install.
- Choose a custom install and add everything except Games and X11. Add all the source sets including the X11 source set though.
- Select "This is the correct geometry."
- Select "Use the entire disk."
- Choose to install the NetBSD boot code.
- Choose "Set sizes of NetBSD partitions." (Maybe not necessary on NetBSD 7. I filed a NetBSD bug on the fact that swap space won't be configured if you select "Use existing partition sizes.")
- The default partition sizes will be fine. Choose "Accept partition sizes."
- Select "Partition sizes ok."
- Select the default disk name.
- Choose "Yes" to continue.
- Choose "Use BIOS console."
- Continue to select the default options and proceed with the install. On NetBSD 6 install via HTTP in order to get the source sets. (This is supposedly fixed in NetBSD 7, so it may be possible to install from media instead of HTTP there.)
- Select the appropriate network options. For me, the defaults work fine. Setting the hostname here won't persist to the resulting NetBSD installation, so just leave it at the default.
- Proceed with the install. The default download options are fine, unless you need to configure a proxy.
- Choose to have the network settings installed to /etc.
- You will see a menu to configure various options.
- Leave "Configure network" alone as it is already configured. Setting the hostname here won't persist to the resulting NetBSD installation.
- Choose the appropriate time zone (US/Pacific works for me).
- Leave the root shell at /bin/sh.
- Set the root password.
- "Enable installation of binary packages" and "Fetch and unpack pkgsrc for building from source" are not necessary.
- Enable sshd.
- Enable ntpd (if you have a non-proxied connection to the Internet).
- Run ntpdate at boot (if you have a non-proxied connection to the Internet).
- Select "Finished configuring"
- Choose the option to halt the system from the utility menu. Power down the VM once it's halted.
- In the VM settings, switch the boot order to boot IDE before the CD and disable the media in the virtual CD/DVD drive.
- Power on the VM and quickly press '4' at the boot menu to disable ACPI and SMP. Otherwise you may experience networking/console related issues on boot.
- Allow the system to boot, then log on as root.
- Disable ACPI and SMP by default.
- vi /boot.cfg
- Set the 'default' option to 4.
- Save the file and exit vi.
- Add a new user for yourself: useradd -m -G wheel [username]
- passwd [username]
- Set your hostname.
- vi /etc/rc.conf
- Add:
- hostname=vmname.foo.com (Where vmname.foo.com is a fully qualified hostname for the VM.)
- Save the file and exit vi.
- Reboot: shutdown -r now
Get Ready to Build[]
- When the system comes back, log on remotely via ssh using the username you created.
- su to root
- chown -R [username] /usr/src
- Where [username] is the username created earlier.
- chown -R [username] /usr/xsrc
- mkdir /usr/obj
- chown [username] /usr/obj
- vi /etc/mk.conf
- Add the following:
.if ${MACHINE} == "atari"
CPUFLAGS+= -m68030 -m68881
CFLAGS+= -Os
.endif - Save and exit vi.
- vi /etc/inetd.conf
- Uncomment the ftp daemon. This will enable you to ftp install the release and kernel that will be built.
- /etc/rc.d/inetd restart
- Exit out of root.
Build[]
- cd /usr/src/sys/arch/atari/conf
- cp ATARITT ATARIKERN
- Edit std.atari and ATARIKERN as described in Kernel steps 10 - 12.
- cd /usr/src
- ./build.sh -m atari tools
- ./build.sh -u -m atari kernel=ATARIKERN
- vi /usr/src/etc/etc.atari/Makefile.inc
- Remove FALCON, HADES, MILAN-ISAIDE, and MILAN-PCIIDE.
- Save and exit vi.
- ./build.sh -U -u -x -m atari release
Install[]
Now you can ftp install the release from /usr/src/releasedir/atari per the instructions in Basic walkthrough. After that you can ftp the custom kernel you built from /usr/src/sys/arch/atari/compile/obj/ATARIKERN/netbsd.