blob: 989a850765abd4a4cd40f6519c283a80a4f37393 [file] [log] [blame]
Mateusz Zalega43e21072021-10-08 18:05:29 +02001load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
2load("//metropolis/node/build:def.bzl", "node_initramfs")
3load("//metropolis/node/build/genosrelease:defs.bzl", "os_release")
4load("//metropolis/node/build:efi.bzl", "efi_unified_kernel_image")
5
6go_library(
Lorenz Brund13c1c62022-03-30 19:58:58 +02007 name = "installer_lib",
Mateusz Zalega43e21072021-10-08 18:05:29 +02008 srcs = ["main.go"],
Mateusz Zalegaedffbb52022-01-11 15:27:22 +01009 importpath = "source.monogon.dev/metropolis/installer",
Mateusz Zalega43e21072021-10-08 18:05:29 +020010 visibility = ["//visibility:private"],
11 deps = [
Lorenz Brund13c1c62022-03-30 19:58:58 +020012 "//metropolis/node/build/mkimage/osimage",
13 "//metropolis/pkg/efivarfs",
14 "//metropolis/pkg/sysfs",
15 "@org_golang_x_sys//unix",
Mateusz Zalega43e21072021-10-08 18:05:29 +020016 ],
17)
18
19go_binary(
20 name = "installer",
Lorenz Brund13c1c62022-03-30 19:58:58 +020021 embed = [":installer_lib"],
Mateusz Zalega43e21072021-10-08 18:05:29 +020022 visibility = ["//visibility:private"],
23)
24
25node_initramfs(
26 name = "initramfs",
27 files = {
Mateusz Zalegaedffbb52022-01-11 15:27:22 +010028 "//metropolis/installer": "/init",
Mateusz Zalega43e21072021-10-08 18:05:29 +020029 },
Mateusz Zalegaedffbb52022-01-11 15:27:22 +010030 visibility = ["//metropolis/installer/test:__pkg__"],
Mateusz Zalega43e21072021-10-08 18:05:29 +020031)
32
33os_release(
34 name = "installer-release-info",
35 os_id = "metropolis-installer",
36 os_name = "Metropolis Installer",
37 stamp_var = "STABLE_METROPOLIS_version",
38)
39
40efi_unified_kernel_image(
41 name = "kernel",
Lorenz Brun0e057fe2022-01-13 16:19:10 +010042 cmdline = "console=ttyS0,115200 console=tty0 quiet",
Lorenz Brunb6c0aa92022-02-24 17:53:40 +010043 initrd = [
44 "//metropolis/node:ucode",
45 ":initramfs",
46 ],
Mateusz Zalega43e21072021-10-08 18:05:29 +020047 kernel = "//third_party/linux",
48 os_release = ":installer-release-info",
49 visibility = ["//visibility:public"],
50)