2023-09-11 09:51:42 -04:00
|
|
|
load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory")
|
2023-10-17 08:04:41 -04:00
|
|
|
load("@rules_pkg//:pkg.bzl", "pkg_tar")
|
2023-09-11 09:51:42 -04:00
|
|
|
load("//bazel/mkosi:mkosi_image.bzl", "mkosi_image")
|
|
|
|
|
|
|
|
copy_to_directory(
|
2024-01-15 12:04:29 -05:00
|
|
|
name = "rpms_lts",
|
2023-09-11 09:51:42 -04:00
|
|
|
srcs = [
|
2024-01-15 12:04:29 -05:00
|
|
|
"@kernel_core_lts//file",
|
|
|
|
"@kernel_lts//file",
|
|
|
|
"@kernel_modules_core_lts//file",
|
|
|
|
"@kernel_modules_lts//file",
|
2023-09-11 09:51:42 -04:00
|
|
|
],
|
2024-01-15 12:04:29 -05:00
|
|
|
include_external_repositories = ["kernel*lts"],
|
|
|
|
replace_prefixes = {"file": ""},
|
|
|
|
)
|
|
|
|
|
|
|
|
copy_to_directory(
|
|
|
|
name = "rpms_mainline",
|
|
|
|
srcs = [
|
|
|
|
"@kernel_core_mainline//file",
|
|
|
|
"@kernel_mainline//file",
|
|
|
|
"@kernel_modules_core_mainline//file",
|
|
|
|
"@kernel_modules_mainline//file",
|
|
|
|
],
|
|
|
|
include_external_repositories = ["kernel*mainline"],
|
2023-09-11 09:51:42 -04:00
|
|
|
replace_prefixes = {"file": ""},
|
|
|
|
)
|
|
|
|
|
2024-01-15 12:04:29 -05:00
|
|
|
[
|
|
|
|
mkosi_image(
|
|
|
|
name = "base_" + kernel_variant,
|
|
|
|
srcs = [
|
|
|
|
"mkosi.postinst",
|
|
|
|
"mkosi.prepare",
|
|
|
|
] + glob([
|
|
|
|
"mkosi.skeleton/**",
|
|
|
|
]),
|
|
|
|
outs = [
|
|
|
|
kernel_variant,
|
|
|
|
kernel_variant + ".tar",
|
|
|
|
kernel_variant + "-.rpm.lock",
|
|
|
|
kernel_variant + "-packagemanifest",
|
|
|
|
kernel_variant + "-rpmdb.sqlite",
|
|
|
|
kernel_variant + "-rpmdb.sqlite-shm",
|
|
|
|
kernel_variant + "-rpmdb.sqlite-wal",
|
|
|
|
],
|
|
|
|
extra_trees = [
|
|
|
|
"//image:sysroot_tar",
|
|
|
|
"//image:cryptsetup_closure",
|
|
|
|
],
|
|
|
|
local_mirror = ["@mkosi_rpms//:repo"],
|
|
|
|
mkosi_conf = "mkosi.conf",
|
|
|
|
output = kernel_variant,
|
2024-02-16 07:10:46 -05:00
|
|
|
package_directories = [
|
|
|
|
":rpms_" + kernel_variant,
|
2024-01-15 12:04:29 -05:00
|
|
|
],
|
|
|
|
tags = [
|
|
|
|
"manual",
|
|
|
|
"no-cache",
|
|
|
|
],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
for kernel_variant in [
|
|
|
|
"lts",
|
|
|
|
"mainline",
|
|
|
|
]
|
|
|
|
]
|
2023-10-17 08:04:41 -04:00
|
|
|
|
|
|
|
pkg_tar(
|
|
|
|
name = "rpmdb",
|
|
|
|
srcs = [
|
2024-01-15 12:04:29 -05:00
|
|
|
"lts-.rpm.lock",
|
|
|
|
"lts-packagemanifest",
|
|
|
|
"lts-rpmdb.sqlite",
|
|
|
|
"lts-rpmdb.sqlite-shm",
|
|
|
|
"lts-rpmdb.sqlite-wal",
|
2023-10-17 08:04:41 -04:00
|
|
|
],
|
|
|
|
remap_paths = {
|
2024-01-15 12:04:29 -05:00
|
|
|
"/lts-.rpm.lock": "/var/lib/rpm/.rpm.lock",
|
|
|
|
"/lts-packagemanifest": "/usr/share/constellation/packagemanifest",
|
|
|
|
"/lts-rpmdb.sqlite": "/var/lib/rpm/rpmdb.sqlite",
|
|
|
|
"/lts-rpmdb.sqlite-shm": "/var/lib/rpm/rpmdb.sqlite-shm",
|
|
|
|
"/lts-rpmdb.sqlite-wal": "/var/lib/rpm/image-rpmdb.sqlite-wal",
|
2023-10-17 08:04:41 -04:00
|
|
|
},
|
|
|
|
tags = ["manual"],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|