Skip to content

Commit 8935932

Browse files
committed
Use build tags for bin2img and copyimg
Use the same build tags for bin2img and copyimg that we use for ocid, and improve detection of the case where we need to use the "libdm_no_deferred_remove" tag. Signed-off-by: Nalin Dahyabhai <[email protected]>
1 parent d6ab91b commit 8935932

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,19 @@ gofmt:
4545
@./hack/verify-gofmt.sh
4646

4747
conmon:
48-
make -C $@
48+
$(MAKE) -C $@
4949

5050
pause:
51-
make -C $@
51+
$(MAKE) -C $@
5252

5353
bin2img:
54-
make -C test/$@
54+
$(MAKE) -C test/$@ BUILDTAGS="$(BUILDTAGS)"
5555

5656
copyimg:
57-
make -C test/$@
57+
$(MAKE) -C test/$@ BUILDTAGS="$(BUILDTAGS)"
5858

5959
checkseccomp: check-gopath
60-
make -C test/$@
60+
$(MAKE) -C test/$@
6161

6262
ocid: check-gopath
6363
$(GO) install \

hack/libdm_tag.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
tmpdir="$PWD/tmp.$RANDOM"
33
mkdir -p "$tmpdir"
44
trap 'rm -fr "$tmpdir"' EXIT
5-
cc -c -o "$tmpdir"/libdm_tag.o -x c - > /dev/null 2> /dev/null << EOF
5+
cc -o "$tmpdir"/libdm_tag -ldevmapper -x c - > /dev/null 2> /dev/null << EOF
66
#include <libdevmapper.h>
77
int main() {
88
struct dm_task *task;
9+
dm_task_deferred_remove(task);
910
return 0;
1011
}
1112
EOF

test/bin2img/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
bin2img: $(wildcard *.go)
2-
go build -o $@
2+
go build -tags "$(BUILDTAGS)" -o $@
33

44
.PHONY: clean
55
clean:

test/copyimg/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
copyimg: $(wildcard *.go)
2-
go build -o $@
2+
go build -tags "$(BUILDTAGS)" -o $@
33

44
.PHONY: clean
55
clean:

0 commit comments

Comments
 (0)