blob: c1453b561e8e2279a0187829a91f6289f6ce8d30 [file] [log] [blame]
Tim Windelschmidt6d33a432025-02-04 14:34:25 +01001// Copyright The Monogon Project Authors.
2// SPDX-License-Identifier: Apache-2.0
3
Tim Windelschmidt82e6af72024-07-23 00:05:42 +00004package launch
5
6import (
7 "github.com/bazelbuild/rules_go/go/runfiles"
8)
9
10var (
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är3b0c8dd2025-06-23 10:32:07 +000025 xAbloaderPath string
Tim Windelschmidt8f1efe92025-04-01 01:28:43 +020026 xQEMUPath string
Tim Windelschmidt82e6af72024-07-23 00:05:42 +000027)
28
29func init() {
30 var err error
31 for _, path := range []*string{
32 &xSwtpmPath, &xSwtpmSetupPath, &xSwtpmLocalCAPath,
33 &xSwtpmCertPath, &xCerttoolPath, &xMetroctlPath,
34 &xOvmfCodePath, &xOvmfVarsPath, &xKernelPath,
Jan Schär3b0c8dd2025-06-23 10:32:07 +000035 &xInitramfsPath, &xNodeImagePath, &xAbloaderPath,
Tim Windelschmidt8f1efe92025-04-01 01:28:43 +020036 &xQEMUPath,
Tim Windelschmidt82e6af72024-07-23 00:05:42 +000037 } {
38 *path, err = runfiles.Rlocation(*path)
39 if err != nil {
40 panic(err)
41 }
42 }
43}