Skip to content

Commit c9478c8

Browse files
vmagrometa-codesync[bot]
authored andcommitted
[antlir2][appliance_vm] update kernel, fix for aarch64
Summary: `crosvm` can't launch compressed aarch64 kernels Enforce local execution since the image build requires local execution and thus everything must match the build host architecture. Fixing the aarch64 guest kernel required a kernel update and a bunch of config changes that are also included with this diff Test Plan: ```name="Test with a local kernel" ❯ hg diff diff --git a/fbcode/antlir/antlir2/appliance_vm/BUCK b/fbcode/antlir/antlir2/appliance_vm/BUCK --- a/fbcode/antlir/antlir2/appliance_vm/BUCK +++ b/fbcode/antlir/antlir2/appliance_vm/BUCK @@ -8,10 +8,11 @@ alias( name = "kernel", - actual = internal_external( - fb = "//antlir/antlir2/appliance_vm/facebook:msdk[vmlinuz/vmlinuz]", - oss = "//antlir/antlir2/appliance_vm/impl:kernel", - ), + actual = "//antlir/antlir2/appliance_vm/impl:kernel", + # actual = internal_external( + # fb = "//antlir/antlir2/appliance_vm/facebook:msdk[vmlinuz/vmlinuz]", + # oss = "//antlir/antlir2/appliance_vm/impl:kernel", + # ), visibility = ["PUBLIC"], ) ❯ buck2 test fbcode//antlir/antlir2/appliance_vm/... Buck UI: https://www.internalfb.com/buck2/5c148a03-5ee7-490a-857b-89feff9591ec Tests finished: Pass 3. Fail 0. Fatal 0. Skip 0. Infra Failure 0. Build failure 0 ``` https://www.internalfb.com/intern/testinfra/testrun/7599824681715697 Reviewed By: naveedgol Differential Revision: D87095734 fbshipit-source-id: 6610b54fd12c30004de141abc0646a9b98927287
1 parent 8b34014 commit c9478c8

File tree

5 files changed

+3122
-831
lines changed

5 files changed

+3122
-831
lines changed

antlir/antlir2/appliance_vm/defs.bzl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,14 @@ def _appliance_vm_impl(ctx: AnalysisContext) -> list[Provider]:
4444
_appliance_vm = rule(
4545
impl = _appliance_vm_impl,
4646
attrs = {
47-
"default_kernel": attrs.dep(),
48-
"default_rootfs": attrs.dep(providers = [LayerInfo]),
49-
"_crosvm": attrs.default_only(attrs.dep(default = "antlir//antlir/antlir2/appliance_vm:crosvm")),
50-
"_runner": attrs.default_only(attrs.dep(default = "antlir//antlir/antlir2/appliance_vm:runner")),
47+
"default_kernel": attrs.exec_dep(),
48+
"default_rootfs": attrs.exec_dep(providers = [LayerInfo]),
49+
"_crosvm": attrs.default_only(attrs.exec_dep(default = "antlir//antlir/antlir2/appliance_vm:crosvm")),
50+
"_runner": attrs.default_only(attrs.exec_dep(default = "antlir//antlir/antlir2/appliance_vm:runner")),
5151
},
5252
)
5353

54-
appliance_vm = rule_with_default_target_platform(_appliance_vm)
54+
appliance_vm = rule_with_default_target_platform(
55+
_appliance_vm,
56+
local_only_exec = True,
57+
)

antlir/antlir2/appliance_vm/genrule_in_appliance_vm.bzl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,7 @@ _genrule_in_appliance_vm = rule(
5555
},
5656
)
5757

58-
genrule_in_appliance_vm = rule_with_default_target_platform(_genrule_in_appliance_vm)
58+
genrule_in_appliance_vm = rule_with_default_target_platform(
59+
_genrule_in_appliance_vm,
60+
local_only_exec = True,
61+
)

antlir/antlir2/appliance_vm/impl/BUCK

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ oncall("antlir")
99

1010
git_fetch(
1111
name = "kernel.git",
12+
rev = "a38297e3fb012ddfa7ce0321a7e5a8daeb1872b6", # @oss-enable
13+
exec_compatible_with = ["prelude//platforms:may_run_local"],
1214
# @oss-disable
1315
repo = "https://github.com/torvalds/linux.git", # @oss-enable
1416
# @oss-disable
15-
rev = "a38297e3fb012ddfa7ce0321a7e5a8daeb1872b6", # @oss-enable
1617
)
1718

1819
export_file(
@@ -29,7 +30,7 @@ genrule_in_image(
2930
bash = selects.apply(
3031
selects.join(
3132
out = select({
32-
"ovr_config//cpu:arm64": "arch/arm64/boot/Image.gz",
33+
"ovr_config//cpu:arm64": "arch/arm64/boot/Image",
3334
"ovr_config//cpu:x86_64": "arch/x86/boot/bzImage",
3435
}),
3536
config = select({

0 commit comments

Comments
 (0)