Skip to content

Commit

Permalink
rootfs make target (#1333)
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 authored Mar 22, 2022
1 parent 51aee6b commit 7adccbb
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

# Ignore vscode setting files
.vscode/
.idea/

# Test binary, build with `go test -c`
*.test
Expand All @@ -28,11 +29,9 @@ service/pkg/
.rootfs-done
bin/*
rootfs/*
rootfs-conv/*
*.o
/build/

deps/*
out/*

.idea/
.vscode/
out/*
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 bin/cmd/hooks/wait-paths Makefile
@mkdir -p out
rm -rf rootfs
Expand Down Expand Up @@ -62,6 +70,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/hooks/wait-paths.gomake
-include deps/cmd/tar2ext4.gomake

# Implicit rule for includes that define Go targets.
%.gomake: $(SRCROOT)/Makefile
Expand Down
7 changes: 3 additions & 4 deletions test/vendor/github.com/Microsoft/hcsshim/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions test/vendor/github.com/Microsoft/hcsshim/Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7adccbb

Please sign in to comment.