SIZEOF_LONG
SIZEOF_INT
SIZEOF_SHORT
+DD
BUILD_CC
MAKEINFO
STRIP
done
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a dd(1) program that supports iflag=fullblock" >&5
+$as_echo_n "checking for a dd(1) program that supports iflag=fullblock... " >&6; }
+DD=
+for i in dd gdd ; do
+ if "$i" if=/dev/null of=/dev/null count=1 bs=10k 2>/dev/null iflag=fullblock oflag=append ; then
+ DD=$i
+ break
+ fi
+done
+if test -n "$DD" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DD" >&5
+$as_echo "$DD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found, using dd" >&5
+$as_echo "not found, using dd" >&6; }
+ DD=dd
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No GNU-compatible dd(1) program found, expect some self-test failures." >&5
+$as_echo "$as_me: WARNING: No GNU-compatible dd(1) program found, expect some self-test failures." >&2;}
+fi
+
+
for ac_header in net/if.h
do :
ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "
sys/un.h
sys/wait.h
]))
+dnl Check where to find a dd(1) that supports iflag=fullblock
+dnl and oflag=append
+AC_MSG_CHECKING([for a dd(1) program that supports iflag=fullblock])
+DD=
+for i in dd gdd ; do
+ if "$i" if=/dev/null of=/dev/null count=1 bs=10k 2>/dev/null iflag=fullblock oflag=append ; then
+ DD=$i
+ break
+ fi
+done
+if test -n "$DD" ; then
+ AC_MSG_RESULT([$DD])
+else
+ AC_MSG_RESULT([not found, using dd])
+ DD=dd
+ AC_MSG_WARN([No GNU-compatible dd(1) program found, expect some self-test failures.])
+fi
+AC_SUBST([DD])
+
AC_CHECK_HEADERS(net/if.h,,,
[[
#if HAVE_SYS_TYPES_H
@echo "SRCDIR=@srcdir@" >> test_one
@echo "DIFF_OPTS=@UNI_DIFF_OPTS@" >> test_one
@echo "SIZEOF_TIME_T=@SIZEOF_TIME_T@" >> test_one
+ @echo "DD=@DD@" >>test_one
@cat $(srcdir)/test_one.in >> test_one
@chmod +x test_one
IMAGE=$test_dir/image.bz2
bzip2 -d < $IMAGE > $TMPFILE
-dd if=/dev/zero of=$TMPFILE conv=notrunc oflag=append bs=1024k count=16 > /dev/null 2>&1
+$DD if=/dev/zero of=$TMPFILE conv=notrunc oflag=append bs=1024k count=16 > /dev/null 2>&1
# Run fsck to fix things?
if [ -x $DEBUGFS_EXE ]; then
OUT="$test_name.log"
echo "testing mke2fs with -E offset=524288 option (no fssize)" > "$OUT"
-yes a | dd of="$TMPFILE" bs=1k count=2048 iflag=fullblock 2>>"$OUT"
+yes a | $DD of="$TMPFILE" bs=1k count=2048 iflag=fullblock 2>>"$OUT"
$MKE2FS -F -b 1024 -E offset=524288 "$TMPFILE" >> "$OUT" 2>&1
# compute crc of the first 512 1k blocks
-crc_first1=`dd if="$TMPFILE" bs=1k count=512 2>/dev/null | $CRCSUM`
+crc_first1=`$DD if="$TMPFILE" bs=1k count=512 2>/dev/null | $CRCSUM`
echo "testing mke2fs with -E offset=524288 option (explicit fssize)" >> "$OUT"
-yes a | dd of="$TMPFILE" bs=1k count=2048 iflag=fullblock 2>>"$OUT"
+yes a | $DD of="$TMPFILE" bs=1k count=2048 iflag=fullblock 2>>"$OUT"
$MKE2FS -F -b 1024 -E offset=524288 "$TMPFILE" 1024 >> "$OUT" 2>&1
# compute crc of the first and last 512 1k blocks
-crc_first2=`dd if="$TMPFILE" bs=1k count=512 2>/dev/null | $CRCSUM`
-crc_last2=`dd if="$TMPFILE" bs=1k count=512 skip=1536 2>/dev/null | $CRCSUM`
-crc_exp=`yes a | dd bs=1k count=512 2>/dev/null | $CRCSUM`
+crc_first2=`$DD if="$TMPFILE" bs=1k count=512 2>/dev/null | $CRCSUM`
+crc_last2=`$DD if="$TMPFILE" bs=1k count=512 skip=1536 2>/dev/null | $CRCSUM`
+crc_exp=`yes a | $DD bs=1k count=512 2>/dev/null | $CRCSUM`
# a warning should be only emitted by the first mke2fs call
warning=`grep -c "offset specified without an explicit file system size." \
"$OUT"`
# convert it
echo "resize2fs test.img" >> $OUT
-dd if=/dev/zero of=$TMPFILE conv=notrunc bs=1 count=1 seek=3221225471 2> /dev/null
+$DD if=/dev/zero of=$TMPFILE conv=notrunc bs=1 count=1 seek=3221225471 2> /dev/null
$RESIZE2FS -f $TMPFILE 2>&1 >> $OUT 2>&1
status=$?
echo Exit status is $status >> $OUT
#!/bin/sh
# run a single regression test
+export DD
+
LC_ALL=C
export LC_ALL
rm -f "$TDB_FILE"
echo "testing e2undo and mke2fs with the -E offset=$OFF option" >> "$OUT"
# prepare $TMPFILE
- yes a | dd of="$TMPFILE" bs="$OFF" count=1 iflag=fullblock \
+ yes a | $DD of="$TMPFILE" bs="$OFF" count=1 iflag=fullblock \
> /dev/null 2>>"$OUT"
- yes b | dd bs=1k count=1024 iflag=fullblock >> "$TMPFILE" 2>>"$OUT"
- yes c | dd bs=1k count=3 iflag=fullblock >> "$TMPFILE" 2>>"$OUT"
+ yes b | $DD bs=1k count=1024 iflag=fullblock >> "$TMPFILE" 2>>"$OUT"
+ yes c | $DD bs=1k count=3 iflag=fullblock >> "$TMPFILE" 2>>"$OUT"
crc_exp=`$CRCSUM "$TMPFILE"`
$MKE2FS -F -z "$TDB_FILE" -b 1024 -E offset="$OFF" "$TMPFILE" 1024 \
# data again (this might be considered as a bug (for now,
# this testcase just documents this behavior))
SEEK_BLOCKS=$(((2048 + 1024 * 1024) / 1024))
- yes d | dd of="$TMPFILE" bs=1k count=2 seek="$SEEK_BLOCKS" \
+ yes d | $DD of="$TMPFILE" bs=1k count=2 seek="$SEEK_BLOCKS" \
iflag=fullblock > /dev/null 2>>"$OUT"
}