| load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") |
| load("//metropolis/node/build:def.bzl", "erofs_image", "verity_image") |
| load("//metropolis/node/build:efi.bzl", "efi_unified_kernel_image") |
| load("@rules_pkg//:pkg.bzl", "pkg_zip") |
| |
| erofs_image( |
| name = "rootfs", |
| files = { |
| ":testos": "/init", |
| }, |
| ) |
| |
| verity_image( |
| name = "verity_rootfs", |
| source = ":rootfs", |
| ) |
| |
| efi_unified_kernel_image( |
| name = "kernel_efi", |
| cmdline = "loglevel=0 console=ttyS0 init=/init", |
| kernel = "//third_party/linux", |
| verity = ":verity_rootfs", |
| ) |
| |
| # An intermediary "bundle" format until we finalize the actual bundle format. This is NOT stable until migrated |
| # to the actual bundle format. |
| # TODO(lorenz): Replace this |
| pkg_zip( |
| name = "testos_bundle", |
| srcs = [ |
| ":kernel_efi", |
| ":verity_rootfs", |
| ], |
| visibility = ["//metropolis/installer/test:__subpackages__"], |
| ) |
| |
| go_library( |
| name = "testos_lib", |
| srcs = ["main.go"], |
| importpath = "source.monogon.dev/metropolis/installer/test/testos", |
| visibility = ["//visibility:private"], |
| deps = ["@org_golang_x_sys//unix"], |
| ) |
| |
| go_binary( |
| name = "testos", |
| embed = [":testos_lib"], |
| visibility = ["//visibility:public"], |
| ) |