blob: 93e78a09f1f70277a8ef93feff61d1fc0667ae33 [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_amd64//file:packages.bzl", packages_amd64 = "packages")
load("@package_bundle_arm64//file:packages.bzl", packages_arm64 = "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_amd64",
architecture = "amd64",
debs = [
packages_amd64["coreutils"],
packages_amd64["tar"],
packages_amd64["libacl1"],
packages_amd64["libattr1"],
packages_amd64["libc6"],
packages_amd64["libselinux1"],
packages_amd64["libpcre3"],
packages_amd64["cryptsetup-bin"],
packages_amd64["libcryptsetup4"],
packages_amd64["libpopt0"],
packages_amd64["libuuid1"],
packages_amd64["libdevmapper1.02.1"],
packages_amd64["libgcrypt20"],
packages_amd64["libargon2-0"],
packages_amd64["libjson-c3"],
packages_amd64["libudev1"],
packages_amd64["libpthread-stubs0-dev"],
packages_amd64["libm17n-0"],
packages_amd64["libgpg-error0"],
],
repository = "veritysetup",
visibility = ["//visibility:public"],
)
container_image(
name = "veritysetup_arm64",
architecture = "arm64",
debs = [
packages_arm64["coreutils"],
packages_arm64["tar"],
packages_arm64["libacl1"],
packages_arm64["libattr1"],
packages_arm64["libc6"],
packages_arm64["libselinux1"],
packages_arm64["libpcre3"],
packages_arm64["cryptsetup-bin"],
packages_arm64["libcryptsetup4"],
packages_arm64["libpopt0"],
packages_arm64["libuuid1"],
packages_arm64["libdevmapper1.02.1"],
packages_arm64["libgcrypt20"],
packages_arm64["libargon2-0"],
packages_arm64["libjson-c3"],
packages_arm64["libudev1"],
packages_arm64["libpthread-stubs0-dev"],
packages_arm64["libm17n-0"],
packages_arm64["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_amd64["coreutils"],
packages_amd64["tar"],
packages_amd64["libacl1"],
packages_amd64["libattr1"],
packages_amd64["libc6"],
packages_amd64["libselinux1"],
packages_amd64["libpcre3"],
packages_amd64["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"],
)