blob: 55fbd4768c8bdc74a9cc4492ad1b4e48db1569d1 [file] [log] [blame]
Lorenz Brunad5b47d2021-11-09 13:52:56 +01001load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
2load("//metropolis/node/build:def.bzl", "erofs_image")
3load("//metropolis/node/build:efi.bzl", "efi_unified_kernel_image")
4load("@rules_pkg//:pkg.bzl", "pkg_zip")
5
6erofs_image(
7 name = "rootfs",
8 files = {
9 ":testos": "/init",
10 },
11)
12
13efi_unified_kernel_image(
14 name = "kernel_efi",
Mateusz Zalega098a8632021-12-08 15:51:24 +010015 cmdline = "loglevel=0 console=ttyS0 root=PARTLABEL=METROPOLIS-SYSTEM rootfstype=erofs init=/init",
Lorenz Brunad5b47d2021-11-09 13:52:56 +010016 kernel = "//third_party/linux",
17)
18
19# An intermediary "bundle" format until we finalize the actual bundle format. This is NOT stable until migrated
20# to the actual bundle format.
21# TODO(lorenz): Replace this
22pkg_zip(
23 name = "testos_bundle",
24 srcs = [
25 ":kernel_efi",
26 ":rootfs",
27 ],
28 visibility = ["//metropolis/test/installer:__subpackages__"],
29)
30
31go_library(
32 name = "go_default_library",
33 srcs = ["main.go"],
34 importpath = "source.monogon.dev/metropolis/test/installer/testos",
35 visibility = ["//visibility:private"],
36 deps = ["@org_golang_x_sys//unix:go_default_library"],
37)
38
39go_binary(
40 name = "testos",
41 embed = [":go_default_library"],
42 visibility = ["//visibility:public"],
43)