Skip to contentSkip to conversation

tools: only call git when necessary in OVMF Makefile

PATCH In review Wei Liu 4 participants 9 messages Jan 15, 2019

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 tools: only call git when necessary in OVMF Makefile

Users may choose to export a snapshot of OVMF and build it with xen.git supplied ovmf-makefile. In that case we don't need to call git submodule.

Fixes b16281870e.

---
 tools/firmware/ovmf-makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/firmware/ovmf-makefile +1 -1
index 3de2fc0300..55f9992145 100644
@@ -16,7 +16,7 @@ all: build
 
 .PHONY: build
 build:
-	$(GIT) submodule update --init --recursive
+	if test -e .git ; then $(GIT) submodule update --init --recursive ; fi
 	OvmfPkg/build.sh -a X64 -b $(TARGET) -n 4
 	cp Build/OvmfX64/$(TARGET)_GCC*/FV/OVMF.fd ovmf.bin
 
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Wei Liu

Users may choose to export a snapshot of OVMF and build it with xen.git supplied ovmf-makefile. In that case we don't need to call git submodule.

Fixes b16281870e.

Quoted 20 lines
---
 tools/firmware/ovmf-makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/firmware/ovmf-makefile +1 -1
index 3de2fc0300..55f9992145 100644
@@ -16,7 +16,7 @@ all: build
 
 .PHONY: build
 build:
-	$(GIT) submodule update --init --recursive
+	if test -e .git ; then $(GIT) submodule update --init --recursive ; fi
 	OvmfPkg/build.sh -a X64 -b $(TARGET) -n 4
 	cp Build/OvmfX64/$(TARGET)_GCC*/FV/OVMF.fd ovmf.bin
 
Signature · 1 line
2.11.0
Signature · 6 lines
Anthony PERARD

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#2 lore raw
In reply to Wei Liu
Quoted 17 lines · Wei Liu

Users may choose to export a snapshot of OVMF and build it with xen.git supplied ovmf-makefile. In that case we don't need to call git submodule.

Fixes b16281870e.

---
 tools/firmware/ovmf-makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/firmware/ovmf-makefile +0 -0
index 3de2fc0300..55f9992145 100644

tools/firmware/ovmf-makefile all: build · line 19

Quoted 5 lines
tools/firmware/ovmf-makefile +1 -1
@@ -16,7 +16,7 @@ all: build
 
 .PHONY: build
 build:
-	$(GIT) submodule update --init --recursive
+	if test -e .git ; then $(GIT) submodule update --init --recursive ; fi

You want -d rather than -e.

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

author
#3 lore raw
Quoted 19 lines · Andrew Cooper
Quoted 18 lines · Wei Liu

Users may choose to export a snapshot of OVMF and build it with xen.git supplied ovmf-makefile. In that case we don't need to call git submodule.

Fixes b16281870e.

---
 tools/firmware/ovmf-makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/firmware/ovmf-makefile +0 -0
index 3de2fc0300..55f9992145 100644
@@ -16,7 +16,7 @@ all: build
 
Quoted 6 lines

tools/firmware/ovmf-makefile all: build · line 19

Quoted 4 lines
tools/firmware/ovmf-makefile +1 -1
 .PHONY: build
 build:
-	$(GIT) submodule update --init --recursive
+	if test -e .git ; then $(GIT) submodule update --init --recursive ; fi

You want -d rather than -e.

Anthony said .git could be a link.

Wei.

Quoted 2 lines

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#4 lore raw
Quoted 20 lines · Wei Liu
Quoted 19 lines · Andrew Cooper
Quoted 18 lines · Wei Liu

Users may choose to export a snapshot of OVMF and build it with xen.git supplied ovmf-makefile. In that case we don't need to call git submodule.

Fixes b16281870e.

---
 tools/firmware/ovmf-makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/firmware/ovmf-makefile +0 -0
index 3de2fc0300..55f9992145 100644
@@ -16,7 +16,7 @@ all: build
 
Quoted 6 lines
Quoted 5 lines

tools/firmware/ovmf-makefile all: build · line 19

Quoted 4 lines
tools/firmware/ovmf-makefile +1 -1
 .PHONY: build
 build:
-	$(GIT) submodule update --init --recursive
+	if test -e .git ; then $(GIT) submodule update --init --recursive ; fi

You want -d rather than -e.

Anthony said .git could be a link.

Hmm - so it can...

You get some weird effects with it being a link, but git does seem to tolerate it.

Sorry for the noise.

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#5 lore raw
In reply to Wei Liu
Quoted 20 lines · Wei Liu
Quoted 19 lines · Andrew Cooper
Quoted 18 lines · Wei Liu

Users may choose to export a snapshot of OVMF and build it with xen.git supplied ovmf-makefile. In that case we don't need to call git submodule.

Fixes b16281870e.

---
 tools/firmware/ovmf-makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/firmware/ovmf-makefile +0 -0
index 3de2fc0300..55f9992145 100644
@@ -16,7 +16,7 @@ all: build
 
Quoted 8 lines
Quoted 6 lines

tools/firmware/ovmf-makefile all: build · line 19

Quoted 4 lines
tools/firmware/ovmf-makefile +1 -1
 .PHONY: build
 build:
-	$(GIT) submodule update --init --recursive
+	if test -e .git ; then $(GIT) submodule update --init --recursive ; fi

You want -d rather than -e.

Anthony said .git could be a link.

Actually, it can be a file. Example when git worktree add as been used:

$ ls -l .git
-rw-r--r-- 1 user users 59 Dec  6 14:23 .git
$ cat .git
gitdir: /local/home/user/work/xen/.git/worktrees/git.72d1

And that's a submodule:

$ ls -l .git
-rw-r--r-- 1 user users 43 Oct 18  2017 .git
$ cat .git
gitdir: ../../.git/modules/ui/keycodemapdb
Signature · 6 lines
Anthony PERARD

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
author
#6 lore raw
Quoted 38 lines · Anthony PERARD
Quoted 20 lines · Wei Liu
Quoted 19 lines · Andrew Cooper
Quoted 18 lines · Wei Liu

Users may choose to export a snapshot of OVMF and build it with xen.git supplied ovmf-makefile. In that case we don't need to call git submodule.

Fixes b16281870e.

---
 tools/firmware/ovmf-makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/firmware/ovmf-makefile +0 -0
index 3de2fc0300..55f9992145 100644
@@ -16,7 +16,7 @@ all: build
 
Quoted 8 lines
Quoted 6 lines

tools/firmware/ovmf-makefile all: build · line 19

Quoted 4 lines
tools/firmware/ovmf-makefile +1 -1
 .PHONY: build
 build:
-	$(GIT) submodule update --init --recursive
+	if test -e .git ; then $(GIT) submodule update --init --recursive ; fi

You want -d rather than -e.

Anthony said .git could be a link.

Actually, it can be a file. Example when git worktree add as been used:

$ ls -l .git
-rw-r--r-- 1 user users 59 Dec  6 14:23 .git
$ cat .git
gitdir: /local/home/user/work/xen/.git/worktrees/git.72d1
Quoted 6 lines

And that's a submodule:

$ ls -l .git
-rw-r--r-- 1 user users 43 Oct 18  2017 .git
$ cat .git
gitdir: ../../.git/modules/ui/keycodemapdb

My bad. Not enough caffeine in the morning.

This patch still stands though.

Wei.

Quoted 3 lines
Signature · 2 lines
-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

author
#7 lore raw
In reply to Wei Liu

Forgot to CC Juergen. Now done.

Quoted 28 lines · Wei Liu

Users may choose to export a snapshot of OVMF and build it with xen.git supplied ovmf-makefile. In that case we don't need to call git submodule.

Fixes b16281870e.

---
 tools/firmware/ovmf-makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/firmware/ovmf-makefile +1 -1
index 3de2fc0300..55f9992145 100644
@@ -16,7 +16,7 @@ all: build
 
 .PHONY: build
 build:
-	$(GIT) submodule update --init --recursive
+	if test -e .git ; then $(GIT) submodule update --init --recursive ; fi
 	OvmfPkg/build.sh -a X64 -b $(TARGET) -n 4
 	cp Build/OvmfX64/$(TARGET)_GCC*/FV/OVMF.fd ovmf.bin
 
Signature · 1 line
2.11.0

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#8 lore raw
Quoted 11 lines · Wei Liu

Forgot to CC Juergen. Now done.

Quoted 8 lines · Wei Liu

Users may choose to export a snapshot of OVMF and build it with xen.git supplied ovmf-makefile. In that case we don't need to call git submodule.

Fixes b16281870e.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel