Skip to content

Commit

Permalink
rootfs make target
Browse files Browse the repository at this point in the history
New makefile target to create rootfs.vhd from rootfs.tar using tar2ext4.
Requires building cmd/tar2ext4 locally.

Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
  • Loading branch information
helsaawy committed Mar 19, 2022
1 parent cf6b2c9 commit 8061599
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ GCS_TOOLS=\

.PHONY: all always rootfs test

.DEFAULT_GOAL := all

all: out/initrd.img out/rootfs.tar.gz

clean:
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8061599

Please sign in to comment.