2023-09-11 09:51:42 -04:00
|
|
|
load("@aspect_bazel_lib//lib:copy_file.bzl", "copy_file")
|
|
|
|
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": ""},
|
|
|
|
)
|
|
|
|
|
|
|
|
[
|
|
|
|
copy_file(
|
|
|
|
name = name,
|
|
|
|
src = "@" + name + "//file",
|
|
|
|
out = name + ".rpm",
|
|
|
|
allow_symlink = True,
|
|
|
|
)
|
|
|
|
for name in [
|
2024-01-15 12:04:29 -05:00
|
|
|
"kernel_lts",
|
|
|
|
"kernel_core_lts",
|
|
|
|
"kernel_modules_lts",
|
|
|
|
"kernel_modules_core_lts",
|
|
|
|
"kernel_mainline",
|
|
|
|
"kernel_core_mainline",
|
|
|
|
"kernel_modules_mainline",
|
|
|
|
"kernel_modules_core_mainline",
|
2023-09-11 09:51:42 -04:00
|
|
|
]
|
|
|
|
]
|
|
|
|
|
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,
|
|
|
|
package_files = [
|
|
|
|
":kernel_" + kernel_variant,
|
|
|
|
":kernel_core_" + kernel_variant,
|
|
|
|
":kernel_modules_" + kernel_variant,
|
|
|
|
":kernel_modules_core_" + kernel_variant,
|
|
|
|
],
|
|
|
|
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"],
|
|
|
|
)
|