From: Ian Jackson Date: Fri, 6 Aug 2021 14:41:43 +0000 (+0100) Subject: uml psusan: wip X-Git-Tag: hippotat/1.0.0~316 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=9f6f45f44094b5d50695f726d90a08437568d875;p=hippotat.git uml psusan: wip More or less copied from the putty docs (putty has a permissive licence) Signed-off-by: Ian Jackson --- diff --git a/psusan-uml b/psusan-uml new file mode 100755 index 0000000..acc4def --- /dev/null +++ b/psusan-uml @@ -0,0 +1,5 @@ +#!/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 diff --git a/psusan-uml-inside b/psusan-uml-inside new file mode 100755 index 0000000..ee6ec47 --- /dev/null +++ b/psusan-uml-inside @@ -0,0 +1,12 @@ +#!/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