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:
parent
c51613866f
commit
652f26f9c5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=361829
@ -19,8 +19,12 @@ CLEANFILES+= h_nonexec
|
|||||||
|
|
||||||
.include "../../Makefile.netbsd-tests"
|
.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:
|
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
|
chmod a+x h_zero
|
||||||
|
|
||||||
CLEANFILES+= h_zero
|
CLEANFILES+= h_zero
|
||||||
|
@ -96,7 +96,11 @@ truncate_test_FILESGRP= wheel
|
|||||||
truncate_test_FILESPACKAGE= ${PACKAGE}
|
truncate_test_FILESPACKAGE= ${PACKAGE}
|
||||||
|
|
||||||
CLEANFILES= truncate_test.root_owned
|
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:
|
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>
|
.include <bsd.test.mk>
|
||||||
|
Loading…
Reference in New Issue
Block a user