# 0300-planck-svn: the svn box, a complete planck box

One job: `svn+ssh://svn@<box>/<repository>` through dropbear, one `svnserve -t` per connection. Nothing is resident
but PID 1 (planck-init): it mounts the repositories share, sets the address, holds port 22 and starts dropbear per
connection. No console shell, no /etc, no /bin, no disk: the kernel mounts the box's rootfs folder as its root over 9p.

| piece | what |
|---|---|
| `build.mjs` | kernel + PID 1 (the shared planck fragments under `030-functional.config`, `planckinit.manifest`), then busybox, dropbear, svnserve and a host key into `_output/rootfs`, the kernel into `_output/boot/bzImage` |
| `run.mjs` | boots `_output` under KVM with a test copy of the rootfs and an empty repositories share; PASS = PID 1 prints `sysinit complete` |
| `rootfs/` | the versioned skeleton, text only: `root/inittab` (the service table), `root/applets` (the busybox applets the console gets), `root/{passwd,group,shells}` (planck-libc reads them from /root, there is no /etc), `root/.profile`, the two `authorized_keys` placeholders, `home/svn/repos/.keep` (the mount point) |
| `030-functional.config` | what this box exercises: virtio-pci, 9p root and share, IPv4, ttyS0, the syscalls of its four programs; every `=y` carries its caller |
| `dropbear-localoptions.h` | the svn user's PATH (`/home/svn/bin`) on top of the shared inetd/ed25519 options |

A binary or process lives under the home of the user that runs it: root's in `/root/bin`, svn's in `/home/svn/bin`;
`/bin`, `/sbin`, `/usr`, `/lib` do not exist. Every program is a static ELF of this tree's own build.

Publishing the box: copy `_output/rootfs` to the folder the VM gets as its 9p root (`root=root rootfstype=9p`
`rootflags=trans=virtio,version=9p2000.L,msize=262144`, qemu `-virtfs ... mount_tag=root`), a second share
`mount_tag=svn` for the repositories, `-kernel _output/boot/bzImage`, 16 MB of RAM, one vCPU. Add your keys to
`rootfs/root/.ssh/authorized_keys` (root) and `rootfs/home/svn/.ssh/authorized_keys` (svn users, with the forced
command written there) in the published copy. Repositories are created from a workstation (`svnadmin create`) in the
share; the box runs svnserve only.

Measured in a 16 MB VM: 2.7 MB in use at idle, one resident process, a 24 MB commit and its checkout pass.
