summaryrefslogtreecommitdiff
path: root/rc/bin/pc/isfat
diff options
context:
space:
mode:
authorTaru Karttunen <taruti@taruti.net>2011-03-30 17:14:36 +0300
committerTaru Karttunen <taruti@taruti.net>2011-03-30 17:14:36 +0300
commit2959e1ede0ebc6fdffd7b8660f43c2ce14c9696f (patch)
treef6343b1ce11a8c87251dd27cf3d3e26b50693fa7 /rc/bin/pc/isfat
parente463eb40363ff4c68b1d903f4e0cdd0ac1c5977f (diff)
downloadplan9front-2959e1ede0ebc6fdffd7b8660f43c2ce14c9696f.tar.xz
Import sources from 2011-03-30 iso image - rc
Diffstat (limited to 'rc/bin/pc/isfat')
-rwxr-xr-xrc/bin/pc/isfat22
1 files changed, 22 insertions, 0 deletions
diff --git a/rc/bin/pc/isfat b/rc/bin/pc/isfat
new file mode 100755
index 000000000..860278571
--- /dev/null
+++ b/rc/bin/pc/isfat
@@ -0,0 +1,22 @@
+#!/bin/rc
+
+rfork e
+
+# 0000000 eb 3c 90 P l a n 9 . 0 0 00 02 04 02 00
+# 0000010 02 00 02 02 P f8 14 00 ? 00 ff 00 ~ 04 } 00
+# 0000020 02 P 00 00 80 00 ) a8 04 } 00 C Y L I N
+# 0000030 D R I C A L F A T 1 6 fa 8c
+
+if(! ~ $#* 1) {
+ echo 'usage: isfat /dev/sdC0/part' >[1=2]
+ exit usage
+}
+
+arg=$1
+fn fat {
+ cmp -s <{dd -if $arg -bs 1 -count 3 -skip $1 >[2]/dev/null} <{echo -n FAT}
+}
+
+fat 54 || fat 82
+exit $status
+