Avoid using non-portable dd status=none flag

Copying the approach chosen in r309412. This fixes building the libc tests
on a macOS host since the macOS /bin/dd binary does not support status=none.

As there only seem to be two uses, this commit changes the two Makefiles.
If this becomes more common, we could also add a wrapper bootstrap script
that ignores status= and forwards the remaining args to the real dd.
Another alternative would be to remove the status flag and pipe stderr to
/dev/null, but them we lose error messages.

Reviewed By:	brooks
Differential Revision: https://reviews.freebsd.org/D24785
This commit is contained in:
Alex Richardson 2020-06-05 08:46:50 +00:00
parent c51613866f
commit 652f26f9c5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=361829
2 changed files with 10 additions and 2 deletions

View File

@ -19,8 +19,12 @@ CLEANFILES+= h_nonexec
.include "../../Makefile.netbsd-tests"
# The dd status=none option is non-standard. Only use it when this test succeeds
# rather than require dd to be a bootstrap tool.
DD_NOSTATUS!=(dd status=none count=0 2> /dev/null && echo status=none) || true
DD=dd ${DD_NOSTATUS}
h_zero:
dd if=/dev/zero of=h_zero bs=1k count=2 status=none
${DD} if=/dev/zero of=h_zero bs=1k count=2
chmod a+x h_zero
CLEANFILES+= h_zero

View File

@ -96,7 +96,11 @@ truncate_test_FILESGRP= wheel
truncate_test_FILESPACKAGE= ${PACKAGE}
CLEANFILES= truncate_test.root_owned
# The dd status=none option is non-standard. Only use it when this test succeeds
# rather than require dd to be a bootstrap tool.
DD_NOSTATUS!=(dd status=none count=0 2> /dev/null && echo status=none) || true
DD=dd ${DD_NOSTATUS}
truncate_test.root_owned:
dd if=/dev/null bs=1 count=1 of=${.TARGET} status=none
${DD} if=/dev/null bs=1 count=1 of=${.TARGET}
.include <bsd.test.mk>