--- a/nouveau-pm/tools/strip-all.sh
+++ b/nouveau-pm/tools/strip-all.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # During the downclocking a number of read/writes occur
 # here seems to be only the relevant one 
 # Tested on a trial and error basis, using mmio-replay and
@@ -18,9 +18,18 @@
 # reads on nv8x cards
 
 
-offset=`cat ./BOOT`
+offset=0xf5000000
 
-for file in [123456789].txt
+error() {
+     echo "ERROR - $1"
+     exit 1
+}
+
+if test "x$offset" == x0; then
+	error "Add the base offset/PBAR"
+fi
+
+for file in transition-[123456789]
 do
 	echo Processing $file
 	cat $file | gawk '{ adr=strtonum($5); read_mode=($1);ofs=strtonum('$offset'); if ( \
@@ -31,11 +40,11 @@
 	((adr >= (ofs + 0x88000) && adr <= (ofs + 0x88020)) && (read_mode != "R")) ||\
 	(adr > (ofs + 0x88020) && adr < (ofs + 0x88fff)) ||\
 	(adr >= (ofs + 0x100000) && adr < (ofs + 0x100fff)) ||\
-	(adr >= (ofs + 0x4000) && adr <= (ofs + 0x4fff)) || (adr >= (ofs + 0xc000) && adr <= (ofs + 0xcfff)) ) print;}'	> $file-stripped-all
-	echo Stripping time
-	./timestrip $file-stripped-all
-	rm $file-stripped-all
+	(adr >= (ofs + 0x4000) && adr <= (ofs + 0x4fff)) || (adr >= (ofs + 0xc000) && adr <= (ofs + 0xcfff)) ) print;}'	> $file-strip-all
+	echo Stripping time/map
+	./timestrip $file-strip-all > $file-clear
+	rm $file-strip-all
 
 done
 
-exit 0+exit 0