wm: infra

Download patch

ref: c40d6cb1f40b9bdaa28d0d39d2ae046753e40849
parent: b16a86beca88c22f877d72ccaf98cec0a8141863
author: mkf <mkf@cloud9p.org>
date: Mon Jan 22 03:08:05 EST 2024

mktree: import

--- /dev/null
+++ b/unix/mktree
@@ -1,0 +1,27 @@
+#!/bin/sh
+# usage: mktree
+
+# mknod requires root access.
+if [ `whoami` != root ]
+	then
+	echo "mktree: Operation not permitted"
+	exit 1
+fi
+
+mkdir -p base run bin dev usr/libexec usr/lib
+cd dev # blame MAKEDEV
+cp /dev/MAKEDEV .
+./MAKEDEV std pty
+cd ..
+
+# i wish all .so's were on the same place
+cp /usr/libexec/ld.so usr/libexec
+for shared_library in /usr/lib/libc.so.* /usr/lib/libpthread.so.* /usr/lib/libm.so.* /usr/lib/libpcap.so.*
+	do
+	cp $shared_library usr/lib
+done
+
+for binary in /bin/rksh /bin/ls /usr/bin/sort /usr/local/bin/simh-* /usr/local/bin/emu /bin/ksh /bin/cp /usr/bin/tail
+	do
+	cp $binary bin
+done