blob: d6c29fe2af15e4267f1c9ea7c85e2249b5745d86 [file] [log] [blame]
Tim Windelschmidt82e6af72024-07-23 00:05:42 +00001package launch
2
3import (
4 "github.com/bazelbuild/rules_go/go/runfiles"
5)
6
7var (
8 // These are filled by bazel at linking time with the canonical path of
9 // their corresponding file. Inside the init function we resolve it
10 // with the rules_go runfiles package to the real path.
11 xSwtpmPath string
12 xSwtpmSetupPath string
13 xSwtpmLocalCAPath string
14 xSwtpmCertPath string
15 xCerttoolPath string
16 xMetroctlPath string
17 xOvmfCodePath string
18 xOvmfVarsPath string
19 xKernelPath string
20 xInitramfsPath string
21 xNodeImagePath string
22)
23
24func init() {
25 var err error
26 for _, path := range []*string{
27 &xSwtpmPath, &xSwtpmSetupPath, &xSwtpmLocalCAPath,
28 &xSwtpmCertPath, &xCerttoolPath, &xMetroctlPath,
29 &xOvmfCodePath, &xOvmfVarsPath, &xKernelPath,
30 &xInitramfsPath, &xNodeImagePath,
31 } {
32 *path, err = runfiles.Rlocation(*path)
33 if err != nil {
34 panic(err)
35 }
36 }
37}