blob: dbffe2e6317aabdbbf9870be225e8c199a13a22b [file] [log] [blame]
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an AS IS BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
load("@bazel_gazelle//:def.bzl", "gazelle")
load("@io_bazel_rules_docker//go:image.bzl", "go_image")
load("@io_bazel_rules_docker//container:container.bzl", "container_image")
load("@package_bundle//file:packages.bzl", "packages")
load("@rules_pkg//:pkg.bzl", "pkg_deb", "pkg_tar")
# gazelle:prefix cos.googlesource.com/cos/tools.git
gazelle(name = "gazelle")
exports_files(glob(["src/data/**"]))
genrule(
name = "workspace_dir",
outs = ["workspace"],
cmd = "mkdir $@",
)
genrule(
name = "tmp_dir",
outs = ["tmp"],
cmd = "mkdir $@",
)
container_image(
name = "veritysetup",
debs = [
packages["coreutils"],
packages["tar"],
packages["libacl1"],
packages["libattr1"],
packages["libc6"],
packages["libselinux1"],
packages["libpcre3"],
packages["cryptsetup-bin"],
packages["libcryptsetup4"],
packages["libpopt0"],
packages["libuuid1"],
packages["libdevmapper1.02.1"],
packages["libgcrypt20"],
packages["libargon2-0"],
packages["libjson-c3"],
packages["libudev1"],
packages["libpthread-stubs0-dev"],
packages["libm17n-0"],
packages["libgpg-error0"],
],
repository = "veritysetup",
visibility = ["//visibility:public"],
)
pkg_tar(
name = "data_tar",
srcs = glob(["src/data/**"]),
strip_prefix = "src/",
)
container_image(
name = "cos_customizer_base",
base = "@daisy//image",
data_path = ".",
debs = [
packages["coreutils"],
packages["tar"],
packages["libacl1"],
packages["libattr1"],
packages["libc6"],
packages["libselinux1"],
packages["libpcre3"],
packages["mtools"],
],
files = [
":tmp_dir",
":workspace_dir",
],
tars = [
":data_tar",
],
)
go_image(
name = "cos_customizer",
base = ":cos_customizer_base",
embed = ["//src/cmd/cos_customizer:cos_customizer_lib"],
goarch = "amd64",
goos = "linux",
pure = "on",
visibility = ["//visibility:public"],
)