| Tim Windelschmidt | 6d33a43 | 2025-02-04 14:34:25 +0100 | [diff] [blame] | 1 | // Copyright The Monogon Project Authors. |
| 2 | // SPDX-License-Identifier: Apache-2.0 |
| 3 | |
| Tim Windelschmidt | 82e6af7 | 2024-07-23 00:05:42 +0000 | [diff] [blame] | 4 | package launch |
| 5 | |
| 6 | import ( |
| 7 | "github.com/bazelbuild/rules_go/go/runfiles" |
| 8 | ) |
| 9 | |
| 10 | var ( |
| 11 | // These are filled by bazel at linking time with the canonical path of |
| 12 | // their corresponding file. Inside the init function we resolve it |
| 13 | // with the rules_go runfiles package to the real path. |
| 14 | xSwtpmPath string |
| 15 | xSwtpmSetupPath string |
| 16 | xSwtpmLocalCAPath string |
| 17 | xSwtpmCertPath string |
| 18 | xCerttoolPath string |
| 19 | xMetroctlPath string |
| 20 | xOvmfCodePath string |
| 21 | xOvmfVarsPath string |
| 22 | xKernelPath string |
| 23 | xInitramfsPath string |
| 24 | xNodeImagePath string |
| Jan Schär | 3b0c8dd | 2025-06-23 10:32:07 +0000 | [diff] [blame^] | 25 | xAbloaderPath string |
| Tim Windelschmidt | 82e6af7 | 2024-07-23 00:05:42 +0000 | [diff] [blame] | 26 | ) |
| 27 | |
| 28 | func init() { |
| 29 | var err error |
| 30 | for _, path := range []*string{ |
| 31 | &xSwtpmPath, &xSwtpmSetupPath, &xSwtpmLocalCAPath, |
| 32 | &xSwtpmCertPath, &xCerttoolPath, &xMetroctlPath, |
| 33 | &xOvmfCodePath, &xOvmfVarsPath, &xKernelPath, |
| Jan Schär | 3b0c8dd | 2025-06-23 10:32:07 +0000 | [diff] [blame^] | 34 | &xInitramfsPath, &xNodeImagePath, &xAbloaderPath, |
| Tim Windelschmidt | 82e6af7 | 2024-07-23 00:05:42 +0000 | [diff] [blame] | 35 | } { |
| 36 | *path, err = runfiles.Rlocation(*path) |
| 37 | if err != nil { |
| 38 | panic(err) |
| 39 | } |
| 40 | } |
| 41 | } |