Browse code

save a few seconds by seeking instead of copying zeros

Jesse Andrews authored on 2011/09/29 10:38:10
Showing 1 changed files
... ...
@@ -89,8 +89,8 @@ BASE=build.$$
89 89
 IMG=$BASE.img
90 90
 MNT=$BASE/
91 91
 
92
-# create a 2GB blank filesystem
93
-dd if=/dev/zero of=$IMG bs=1024k count=2048
92
+# (quickly) create a 2GB blank filesystem
93
+dd bs=1 count=1 seek=$((2*1024*1024*1024)) if=/dev/zero of=$IMG
94 94
 # force it to be initialized as ext2
95 95
 mkfs.ext2 -F $IMG
96 96