Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Installation Standalone

John Floren edited this page Feb 16, 2022 · 8 revisions

There are two ways to build Harvey: as a USB stick, and as a CDROM image (ISO). We recommend the USB stick; it boots into a live system and lets you skip the annoying installation step.

Dependencies:

  • expect
  • go

Preliminary

We use centre to serve /tmp over 9P. Harvey images get written to this service.

If running go >= 1.17 install centre with go install harvey-os.org/cmd/centre@latest. If running go < 1.17 install centre with go get harvey-os.org/cmd/centre (don't do this inside the Harvey repo)

  • export TARGETDIR=/tmp
  • centre -i "" -ninep-dir=$TARGETDIR

Build Full Harvey USB Image (w/ Go)

This is what we recommend. This gets you a live image of Harvey which you can either boot in QEMU or write to a USB stick for booting.

First, we need to grab Go. Harvey provides a script to fetch and build Go from Linux:

  • cd build
  • bash build-go.sh

Build steps:

  • cd build
  • bash build-usb.bash

Now you should have a file named plan9-usb.img in $TARGETDIR (/tmp). You can either dd that to a USB stick, or boot it in QEMU:

qemu-system-i386 -accel kvm  -net user -net nic,model=virtio -m 1024  \
-drive if=none,id=stick,format=raw,file=/tmp/plan9-usb.img -device usb-ehci,id=ehci  -device usb-storage,bus=ehci.0,drive=stick

Build Harvey ISO and Install on QEMU

The Go tree doesn't play nicely with mk9660, so if you ran build-go.sh previously, remove the sys/go directory before running the steps below.

Build steps:

  • cd build
  • bash build.bash
  • cd $TARGETDIR
  • bunzip2 plan9-new.iso.bz2

At this point we have 2 images in $TARGETDIR:

  • plan9-new.iso - the plan 9 iso9660 cdrom image
  • image - the plan 9 USB image

(You might want to use some other location than /tmp. Do not use a location in the harvey tree as most of it is copied in subsequent builds)

  • qemu-img create -f qcow2 harvey.qcow2 2G
  • qemu-system-x86_64 --enable-kvm -serial stdio -net user -net nic,model=virtio -m 4096 -cdrom plan9-new.iso -drive id=disk,file=harvey.qcow2 -boot d

Now we have manual steps to install. At each prompt, enter the following for a simple standalone installation:

  • 1
  • yes (use DMA)
  • ps2
  • 1280x1024x32
  • vesa

Now we have harvey running rio (an actual GUI!). As before, enter the following at each prompt (most are defaults):

  • configfs
  • fossil
  • partdisk
  • sdC0
  • y
  • w
  • q
  • prepdisk
  • /dev/sdC0/plan9
  • w
  • q
  • fmtfossil
  • /dev/sdC0/fossil
  • mountfs
  • /dev/sdC0/fossil
  • configdist
  • local
  • mountdist
  • /dev/sdD0/data
  • browse
  • exit
  • copydist
  • bootsetup
  • plan9
  • y
  • finish

Now quit qemu. Time to boot into your fresh installation of Harvey.

  • qemu-system-x86_64 --enable-kvm -serial stdio -net user,id=user.0,hostfwd=tcp::5555-:1522,hostfwd=tcp::9999-:9,hostfwd=tcp::17010-:17010,hostfwd=tcp::1666-:1666,hostfwd=tcp::5356-:5356,hostfwd=tcp::17013-:17013 -net nic,model=virtio -m 1024 -drive id=disk,file=harvey.qcow2 -boot d

Boot the 9pcf kernel. At the prompt, enter:

  • 2

You're now in Harvey!

Additional setup steps

Enable DMA by adding the following to lib/profile:

  • echo dma on > /dev/sdC0/ctl

Connect drawterm to standalone harvey

Set up factotum and cpu server

(From https://9p.io/wiki/plan9/Drawterm_to_your_terminal/index.html)

  • ip/ipconfig
  • auth/factotum
  • echo 'key proto=p9sk1 dom=livecd user=glenda !password=password' >/mnt/factotum/ctl
  • aux/listen1 -t tcp!*!17010 /bin/cpu -R &

Connect drawterm

(Assumes drawterm built: https://github.com/9fans/drawterm)

  • drawterm -a localhost -c localhost -u glenda