From 8061599b10e7b0b555fb84d1bb366866134ec952 Mon Sep 17 00:00:00 2001 From: Hamza El-Saawy Date: Fri, 18 Mar 2022 22:58:56 -0400 Subject: [PATCH] rootfs make target New makefile target to create rootfs.vhd from rootfs.tar using tar2ext4. Requires building cmd/tar2ext4 locally. Signed-off-by: Hamza El-Saawy --- Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Makefile b/Makefile index ac00def635..90c91e633e 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,8 @@ GCS_TOOLS=\ .PHONY: all always rootfs test +.DEFAULT_GOAL := all + all: out/initrd.img out/rootfs.tar.gz clean: @@ -32,6 +34,12 @@ clean: test: cd $(SRCROOT) && go test -v ./internal/guest/... +rootfs: out/rootfs.vhd + +out/rootfs.vhd: out/rootfs.tar.gz bin/cmd/tar2ext4 + gzip -f -d ./out/rootfs.tar.gz + bin/cmd/tar2ext4 -vhd -i ./out/rootfs.tar -o $@ + out/delta.tar.gz: bin/init bin/vsockexec bin/cmd/gcs bin/cmd/gcstools Makefile @mkdir -p out rm -rf rootfs @@ -60,6 +68,7 @@ out/initrd.img: $(BASE) out/delta.tar.gz $(SRCROOT)/hack/catcpio.sh -include deps/cmd/gcs.gomake -include deps/cmd/gcstools.gomake +-include deps/cmd/tar2ext4.gomake # Implicit rule for includes that define Go targets. %.gomake: $(SRCROOT)/Makefile