Lorenz Brun | ad5b47d | 2021-11-09 13:52:56 +0100 | [diff] [blame^] | 1 | load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") |
| 2 | load("//metropolis/node/build:def.bzl", "erofs_image") |
| 3 | load("//metropolis/node/build:efi.bzl", "efi_unified_kernel_image") |
| 4 | load("@rules_pkg//:pkg.bzl", "pkg_zip") |
| 5 | |
| 6 | erofs_image( |
| 7 | name = "rootfs", |
| 8 | files = { |
| 9 | ":testos": "/init", |
| 10 | }, |
| 11 | ) |
| 12 | |
| 13 | efi_unified_kernel_image( |
| 14 | name = "kernel_efi", |
| 15 | cmdline = "console=ttyS0 root=PARTLABEL=METROPOLIS-SYSTEM rootfstype=erofs init=/init", |
| 16 | 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 |
| 22 | pkg_zip( |
| 23 | name = "testos_bundle", |
| 24 | srcs = [ |
| 25 | ":kernel_efi", |
| 26 | ":rootfs", |
| 27 | ], |
| 28 | visibility = ["//metropolis/test/installer:__subpackages__"], |
| 29 | ) |
| 30 | |
| 31 | go_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 | |
| 39 | go_binary( |
| 40 | name = "testos", |
| 41 | embed = [":go_default_library"], |
| 42 | visibility = ["//visibility:public"], |
| 43 | ) |