Eliminate the broken tpi system for a simple drive/format type field.

This commit is contained in:
David Given
2023-10-29 21:10:14 +01:00
parent ff1fb761f2
commit 533b217c8f
86 changed files with 1831 additions and 798 deletions

View File

@@ -1,22 +1,21 @@
#!/bin/sh
set -e
format=$1
tmp=/tmp/$$-$format
srcfile=$tmp.src.img
fluxfile=$tmp.$2
destfile=$tmp.dest.img
fluxengine=$3
shift
shift
shift
format="$1"
ext="$2"
fluxengine="$3"
script="$4"
flags="$5"
dir="$6"
trap "rm -f $srcfile $fluxfile $destfile" EXIT
srcfile=$dir.$format.src.img
fluxfile=$dir.$format.$ext
destfile=$dir.$format.dest.img
dd if=/dev/urandom of=$srcfile bs=1048576 count=2 2>&1
$fluxengine write $format -i $srcfile -d $fluxfile --drive.rotational_period_ms=200 "$@"
$fluxengine read $format -s $fluxfile -o $destfile --drive.rotational_period_ms=200 "$@"
$fluxengine write $format -i $srcfile -d $fluxfile --drive.rotational_period_ms=200 $flags
$fluxengine read $format -s $fluxfile -o $destfile --drive.rotational_period_ms=200 $flags
if [ ! -s $destfile ]; then
echo "Zero length output file!" >&2
exit 1