blob: 759bf2892e4a2621f816f68c07167ee825827744 [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
25)
26
27func init() {
28 var err error
29 for _, path := range []*string{
30 &xSwtpmPath, &xSwtpmSetupPath, &xSwtpmLocalCAPath,
31 &xSwtpmCertPath, &xCerttoolPath, &xMetroctlPath,
32 &xOvmfCodePath, &xOvmfVarsPath, &xKernelPath,
33 &xInitramfsPath, &xNodeImagePath,
34 } {
35 *path, err = runfiles.Rlocation(*path)
36 if err != nil {
37 panic(err)
38 }
39 }
40}