More or less copied from the putty docs (putty has a permissive licence)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
--- /dev/null
+#!/bin/bash
+
+bwrap --dev-bind / / --tmpfs /dev/shm \
+linux mem=512M rootfstype=hostfs rootflags=/ rw \
+ con=fd:2,fd:2 ssl0=fd:0,fd:1 init=$PWD/psusan-uml-inside
--- /dev/null
+#!/bin/bash
+# Set up vital pseudo-filesystems
+mount -t proc none /proc
+mount -t devpts none /dev/pts
+# Redirect I/O to the serial port, but stderr to the console
+exec 0<>/dev/ttyS0 1>&0 2>/dev/console
+# Set the serial port into raw mode, to run a binary protocol
+stty raw -echo
+# Choose what shell you want to run inside psusan
+export SHELL=/bin/bash
+# And now run psusan over the serial port
+exec psusan