aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@riedstra.dev>2026-01-12 20:22:17 -0500
committerMitchell Riedstra <mitch@riedstra.dev>2026-01-12 20:24:37 -0500
commitb905e61ae0dae0dec58fa9657d4e1514566b143f (patch)
tree0eb1c61c050399df44f77bba0c5881a4988bb53b /build.sh
parent939ac4319cb047a37ba46f84eff81948063f6954 (diff)
downloadunixv4-b905e61ae0dae0dec58fa9657d4e1514566b143f.tar.gz
unixv4-b905e61ae0dae0dec58fa9657d4e1514566b143f.tar.xz
Reduce the size of the Linux system. Add a better readme.HEADmaster
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/build.sh b/build.sh
index 285a76b..8ee46a5 100755
--- a/build.sh
+++ b/build.sh
@@ -6,6 +6,14 @@ sudo=sudo
docker=docker
[ -n "$(command -v podman)" ] && [ -x "$(command -v podman)" ] && docker=podman
+bin_only=false
+no_plat=false
+while [ $# -gt 0 ] ; do case $1 in
+ -bin-only) bin_only=true ; shift ;;
+ -no-platform) no_plat=true ; shift ;;
+ *) echo "bad arg: '$1'" ; exit 2 ;;
+esac ; done
+
simh_url="https://github.com/simh/simh/archive/master.zip"
simh_archive="./simh.zip"
if ! [ -e "$simh_archive" ] ; then
@@ -16,12 +24,12 @@ $docker build --platform=i386 -t unixv4 .
$docker run --name unixv4emulator --entrypoint=/bin/true --replace unixv4
$docker export unixv4emulator > img.tar
$docker container rm unixv4emulator
-truncate -s 50M disk.img
+tar --strip-components 2 -xf img.tar usr/bin/pdp11
+$bin_only && exit 0
+truncate -s 12M disk.img
$sudo kpartx -av disk.img
$sudo mkfs.ext2 /dev/loop0
$sudo mount /dev/loop0 /mnt
$sudo tar -C /mnt -xpvf img.tar
$sudo umount /mnt
$sudo kpartx -dv disk.img
-
-