chiark / gitweb /
uml: tidy up a bit
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 6 Aug 2021 19:54:05 +0000 (20:54 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 6 Aug 2021 19:54:05 +0000 (20:54 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
psusan-uml
psusan-uml-inside
psusan-uml-wrap

index 7e72583632ba722d48f8914eb4d2d37b6a8da805..2dd8adef7de8cdd601bd672f8dd3d26e9ababd0d 100755 (executable)
@@ -11,7 +11,7 @@ mkfifo -m600 $fifo
 )                                                              |       \
  bwrap --dev-bind / / --tmpfs /dev/shm                                 \
  linux mem=512M rootfstype=hostfs rootflags=/ rw                       \
-       con=fd:2,fd:2 con1=fd:0,fd:1 init=$PWD/psusan-uml-inside        |       \
+       con=fd:2,fd:2 con1=fd:0,fd:1 init="${0%/*}"/psusan-uml-inside |         \
 (
  read banner
  : >$fifo
index 243728e864689a001288bbc5325ea6b01f39846e..ec5a393b246b3bc6af01c16321f3259496adb737 100755 (executable)
@@ -1,17 +1,18 @@
 #!/bin/bash
 set -e
-# Set up vital pseudo-filesystems
-mount -t proc none /proc
+
 mkdir /dev/pts
+mount -t proc none /proc
 mount -t devpts none /dev/pts
-# Redirect I/O to the serial port (leave stderr to the console)
+mount -t tmpfs none /tmp
+mount -t tmpfs none /run
+
 exec 0<>/dev/tty1 1>&0
-# 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
+
 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=991959
 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 export PATH
-# And now run psusan over the serial port
+export SHELL=/bin/bash
+
 exec psusan
index a563b4a3063543773ce02f4fe18aa6afbcdb8d52..db1e091556a95fae1eff630354ed5ce3b39801e6 100755 (executable)
@@ -4,4 +4,4 @@ mkdir -p tmp
 rm -rf tmp/uml
 mkdir -p -m2700 tmp/uml
 
-plink -v -v -ssh-connection -proxycmd $PWD/psusan-uml $PWD "$@"
+plink -v -v -ssh-connection -proxycmd "${0%/*}"/psusan-uml $PWD "$@"