chiark
/
gitweb
/
~mdw
/
profile
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dot/emacs: Moderate horizontal scrolling; auto-scroll only one line.
[profile]
/
bin
/
check-blkdev-size
diff --git
a/bin/check-blkdev-size
b/bin/check-blkdev-size
index 0f68a53a861a19799851d12ac9f829328cc9387b..0bb7d6624363eb1bcafa094b48ddb194aa59d155 100755
(executable)
--- a/
bin/check-blkdev-size
+++ b/
bin/check-blkdev-size
@@
-1,8
+1,9
@@
#! /bin/bash
set -e -o pipefail
#! /bin/bash
set -e -o pipefail
+prog=${0##*/}
-case $# in 1) ;; *) echo >&2 "usage: $
0
DEV"; exit 127 ;; esac
+case $# in 1) ;; *) echo >&2 "usage: $
prog
DEV"; exit 127 ;; esac
dev=$1
typeset -i sz; sz=$(blockdev --getsize64 "$dev")
dev=$1
typeset -i sz; sz=$(blockdev --getsize64 "$dev")
@@
-19,17
+20,17
@@
for i in 2 3 5 7; do
if (( bsz >= 65536 )); then break 2; fi
done
done
if (( bsz >= 65536 )); then break 2; fi
done
done
-echo >&2 "$
0
: using $nb blocks of size $bsz"
+echo >&2 "$
prog
: using $nb blocks of size $bsz"
## Write the initial stream.
## Write the initial stream.
-echo >&2 "$
0
: writing pseudorandom pattern..."
+echo >&2 "$
prog
: writing pseudorandom pattern..."
rspit salsa20/8 -H$k -z$sz -pT | \
dd status=none iflag=fullblock oflag=direct bs=$bsz count=$nb of="$dev"
rspit salsa20/8 -H$k -z$sz -pT | \
dd status=none iflag=fullblock oflag=direct bs=$bsz count=$nb of="$dev"
-echo >&2 "$
0
: writing pseudorandom pattern... done"
+echo >&2 "$
prog
: writing pseudorandom pattern... done"
## Read the stream back, and check against the reference.
## Read the stream back, and check against the reference.
-echo >&2 "$
0
: checking pseudorandom pattern..."
+echo >&2 "$
prog
: checking pseudorandom pattern..."
cmp <(rspit salsa20/8 -H$k -z$sz -pT) \
<(dd status=none iflag=direct bs=$bsz count=$nb if="$dev")
cmp <(rspit salsa20/8 -H$k -z$sz -pT) \
<(dd status=none iflag=direct bs=$bsz count=$nb if="$dev")
-echo >&2 "$
0
: checking pseudorandom pattern... done"
-echo >&2 "$
0
: all ok"
+echo >&2 "$
prog
: checking pseudorandom pattern... done"
+echo >&2 "$
prog
: all ok"