2023-03-09 09:23:42 -05:00
|
|
|
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
2023-09-11 09:46:02 -04:00
|
|
|
load("@rules_pkg//:pkg.bzl", "pkg_tar")
|
2023-03-16 11:13:48 -04:00
|
|
|
load("//bazel/go:platform.bzl", "platform_binary")
|
2023-11-23 11:47:58 -05:00
|
|
|
load("//bazel/patchelf:patchelf.bzl", "patchelf")
|
2023-03-09 09:23:42 -05:00
|
|
|
|
|
|
|
go_library(
|
|
|
|
name = "cmd_lib",
|
|
|
|
srcs = ["main.go"],
|
|
|
|
importpath = "github.com/edgelesssys/constellation/v2/disk-mapper/cmd",
|
|
|
|
visibility = ["//visibility:private"],
|
|
|
|
deps = [
|
2023-07-17 07:55:31 -04:00
|
|
|
"//disk-mapper/internal/diskencryption",
|
2023-03-09 09:23:42 -05:00
|
|
|
"//disk-mapper/internal/recoveryserver",
|
|
|
|
"//disk-mapper/internal/rejoinclient",
|
|
|
|
"//disk-mapper/internal/setup",
|
|
|
|
"//internal/attestation/choose",
|
2023-03-20 06:15:57 -04:00
|
|
|
"//internal/attestation/tdx",
|
2023-06-09 09:41:02 -04:00
|
|
|
"//internal/attestation/variant",
|
2023-03-09 09:23:42 -05:00
|
|
|
"//internal/attestation/vtpm",
|
|
|
|
"//internal/cloud/aws",
|
|
|
|
"//internal/cloud/azure",
|
|
|
|
"//internal/cloud/cloudprovider",
|
|
|
|
"//internal/cloud/gcp",
|
|
|
|
"//internal/cloud/metadata",
|
|
|
|
"//internal/cloud/openstack",
|
|
|
|
"//internal/cloud/qemu",
|
|
|
|
"//internal/constants",
|
|
|
|
"//internal/grpc/dialer",
|
|
|
|
"//internal/kms/setup",
|
|
|
|
"//internal/logger",
|
|
|
|
"//internal/role",
|
|
|
|
"@com_github_spf13_afero//:afero",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
go_binary(
|
|
|
|
name = "cmd",
|
|
|
|
embed = [":cmd_lib"],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
2023-03-16 11:13:48 -04:00
|
|
|
|
|
|
|
platform_binary(
|
|
|
|
name = "disk-mapper_linux_amd64",
|
2023-11-23 11:47:58 -05:00
|
|
|
platform = "//bazel/platforms:constellation_os",
|
2023-03-16 11:13:48 -04:00
|
|
|
target_file = ":cmd",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
2023-09-11 09:46:02 -04:00
|
|
|
|
2023-11-23 11:47:58 -05:00
|
|
|
patchelf(
|
|
|
|
name = "disk-mapper_patched",
|
|
|
|
src = ":disk-mapper_linux_amd64",
|
|
|
|
out = "disk-mapper_with_nix_rpath",
|
|
|
|
interpreter = "@cryptsetup_x86_64-linux//:dynamic-linker",
|
|
|
|
rpath = "@cryptsetup_x86_64-linux//:rpath",
|
|
|
|
)
|
|
|
|
|
2023-09-11 09:46:02 -04:00
|
|
|
pkg_tar(
|
|
|
|
name = "disk-mapper-package",
|
|
|
|
srcs = [
|
2023-11-23 11:47:58 -05:00
|
|
|
":disk-mapper_patched",
|
2023-09-11 09:46:02 -04:00
|
|
|
],
|
|
|
|
mode = "0755",
|
2023-11-23 11:47:58 -05:00
|
|
|
remap_paths = {"/disk-mapper_with_nix_rpath": "/usr/sbin/disk-mapper"},
|
2023-09-11 09:46:02 -04:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|