| Tim Windelschmidt | 82e6af7 | 2024-07-23 00:05:42 +0000 | [diff] [blame^] | 1 | package launch |
| 2 | |
| 3 | import ( |
| 4 | "github.com/bazelbuild/rules_go/go/runfiles" |
| 5 | ) |
| 6 | |
| 7 | var ( |
| 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 | |
| 24 | func 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 | } |