debugd: package as tar

This commit is contained in:
Malte Poll 2023-09-11 15:46:58 +02:00 committed by Malte Poll
parent 274dd9d5d8
commit 0979a483b4
3 changed files with 38 additions and 0 deletions

View File

@ -1,4 +1,6 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("@rules_pkg//pkg:mappings.bzl", "pkg_files")
load("//bazel/go:platform.bzl", "platform_binary")
go_library(
@ -42,3 +44,23 @@ platform_binary(
target_file = ":debugd",
visibility = ["//visibility:public"],
)
pkg_files(
name = "debugd_unit",
srcs = glob(["service/**"]),
renames = {
"service/system-preset/20-debugd.preset": "usr/lib/systemd/system-preset/20-debugd.preset",
"service/system/debugd.service": "usr/lib/systemd/system/debugd.service",
},
)
pkg_tar(
name = "debugd-package",
srcs = [
":debugd_linux_amd64",
":debugd_unit",
],
mode = "0755",
remap_paths = {"/platform:linux_amd64_gnu.2.23": "/usr/bin/debugd"},
visibility = ["//visibility:public"],
)

View File

@ -0,0 +1 @@
enable debugd.service

View File

@ -0,0 +1,15 @@
[Unit]
Description=Constellation Debug Daemon
Wants=network-online.target
After=network-online.target configure-constel-csp.service
[Service]
Type=simple
RemainAfterExit=yes
Restart=on-failure
EnvironmentFile=/run/constellation.env
Environment=PATH=/run/state/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
ExecStart=debugd
[Install]
WantedBy=multi-user.target