Use release_avf_microdroid_kernel_version to pick Microdroid kernel
This patch just sets up the directory structure for Microdroid kernel
prebuilts, and does the plumbing in Android.bp
Follow up patches will drop a android15-6.1 microdroid kernel prebuilt
into repo, and switch the trunk_staging to use it.
Once the android15-6.6 is stable to run as guest, we will switch to
that.
Bug: 298011555
Test: builds
Change-Id: I4f56e6c98e24709cf8461bded45b2c8035f48130
diff --git a/microdroid/kernel/Android.bp b/microdroid/kernel/Android.bp
new file mode 100644
index 0000000..db5854d
--- /dev/null
+++ b/microdroid/kernel/Android.bp
@@ -0,0 +1,86 @@
+// Copyright (C) 2024 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package {
+ default_applicable_licenses: ["microdroid_kernel_prebuilts_license"],
+}
+
+// See: http://go/android-license-faq
+license {
+ name: "microdroid_kernel_prebuilts_license",
+ visibility: [":__subpackages__"],
+ license_kinds: [
+ "SPDX-license-identifier-GPL-2.0-only",
+ ],
+ // large-scale-change unable to identify any license_text files
+}
+
+soong_config_module_type {
+ name: "avf_microdroid_kernel_prebuilt",
+ module_type: "filegroup",
+ config_namespace: "ANDROID",
+ variables: [
+ "release_avf_microdroid_kernel_version",
+ ],
+ properties: [
+ "srcs",
+ ],
+}
+
+soong_config_string_variable {
+ name: "release_avf_microdroid_kernel_version",
+ // TODO(b/298011555): add 15-6.6
+ values: [
+ "android14_61",
+ "android15_61",
+ ],
+}
+
+avf_microdroid_kernel_prebuilt {
+ name: "microdroid_kernel_prebuilt-arm64",
+ // Below are properties that are conditionally set depending on value of build flags.
+ soong_config_variables: {
+ release_avf_microdroid_kernel_version: {
+ android14_61: {
+ srcs: ["android14-6.1/arm64/kernel-6.1"],
+ },
+ // In case release configuration doesn't specify value of the
+ // RELEASE_AVF_MICRODROID_KERNEL_VERSION fallback to the kernel we
+ // already released.
+ // TODO(b/298011555): remove this once we set the flag in all release configs.
+ conditions_default: {
+ srcs: ["android14-6.1/arm64/kernel-6.1"],
+ },
+ },
+ },
+}
+
+avf_microdroid_kernel_prebuilt {
+ name: "microdroid_kernel_prebuilt-x86_64",
+ // Below are properties that are conditionally set depending on value of build flags.
+ soong_config_variables: {
+ release_avf_microdroid_kernel_version: {
+ android14_61: {
+ srcs: ["android14-6.1/x86_64/kernel-6.1"],
+ },
+ // In case release configuration doesn't specify value of the
+ // RELEASE_AVF_MICRODROID_KERNEL_VERSION fallback to the kernel we
+ // already released.
+ // TODO(b/298011555): remove this once we set the flag in all release configs.
+ conditions_default: {
+ srcs: ["android14-6.1/x86_64/kernel-6.1"],
+ },
+ },
+ },
+}
diff --git a/microdroid/kernel/arm64/System.map b/microdroid/kernel/android14-6.1/arm64/System.map
similarity index 100%
rename from microdroid/kernel/arm64/System.map
rename to microdroid/kernel/android14-6.1/arm64/System.map
diff --git a/microdroid/kernel/arm64/kernel-6.1 b/microdroid/kernel/android14-6.1/arm64/kernel-6.1
similarity index 100%
rename from microdroid/kernel/arm64/kernel-6.1
rename to microdroid/kernel/android14-6.1/arm64/kernel-6.1
Binary files differ
diff --git a/microdroid/kernel/arm64/kernel-6.1-gz b/microdroid/kernel/android14-6.1/arm64/kernel-6.1-gz
similarity index 100%
rename from microdroid/kernel/arm64/kernel-6.1-gz
rename to microdroid/kernel/android14-6.1/arm64/kernel-6.1-gz
Binary files differ
diff --git a/microdroid/kernel/arm64/kernel-6.1-lz4 b/microdroid/kernel/android14-6.1/arm64/kernel-6.1-lz4
similarity index 100%
rename from microdroid/kernel/arm64/kernel-6.1-lz4
rename to microdroid/kernel/android14-6.1/arm64/kernel-6.1-lz4
Binary files differ
diff --git a/microdroid/kernel/arm64/prebuilt-info.txt b/microdroid/kernel/android14-6.1/arm64/prebuilt-info.txt
similarity index 100%
rename from microdroid/kernel/arm64/prebuilt-info.txt
rename to microdroid/kernel/android14-6.1/arm64/prebuilt-info.txt
diff --git a/microdroid/kernel/x86_64/System.map b/microdroid/kernel/android14-6.1/x86_64/System.map
similarity index 100%
rename from microdroid/kernel/x86_64/System.map
rename to microdroid/kernel/android14-6.1/x86_64/System.map
diff --git a/microdroid/kernel/x86_64/kernel-6.1 b/microdroid/kernel/android14-6.1/x86_64/kernel-6.1
similarity index 100%
rename from microdroid/kernel/x86_64/kernel-6.1
rename to microdroid/kernel/android14-6.1/x86_64/kernel-6.1
Binary files differ
diff --git a/microdroid/kernel/x86_64/prebuilt-info.txt b/microdroid/kernel/android14-6.1/x86_64/prebuilt-info.txt
similarity index 100%
rename from microdroid/kernel/x86_64/prebuilt-info.txt
rename to microdroid/kernel/android14-6.1/x86_64/prebuilt-info.txt
diff --git a/microdroid/kernel/arm64/Android.bp b/microdroid/kernel/arm64/Android.bp
deleted file mode 100644
index 0975993..0000000
--- a/microdroid/kernel/arm64/Android.bp
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright (C) 2022 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package {
- default_applicable_licenses: ["microdroid_kernel_prebuilts_6.1_arm64_license"],
-}
-
-// See: http://go/android-license-faq
-license {
- name: "microdroid_kernel_prebuilts_6.1_arm64_license",
- visibility: [":__subpackages__"],
- license_kinds: [
- "SPDX-license-identifier-GPL-2.0-only",
- ],
- // large-scale-change unable to identify any license_text files
-}
-
-filegroup {
- name: "microdroid_kernel_prebuilts-6.1-arm64",
- srcs: ["kernel-6.1"],
-}
diff --git a/microdroid/kernel/x86_64/Android.bp b/microdroid/kernel/x86_64/Android.bp
deleted file mode 100644
index b3041cd..0000000
--- a/microdroid/kernel/x86_64/Android.bp
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright (C) 2022 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package {
- default_applicable_licenses: ["microdroid_kernel_prebuilts_6.1_x86_64_license"],
-}
-
-// See: http://go/android-license-faq
-license {
- name: "microdroid_kernel_prebuilts_6.1_x86_64_license",
- visibility: [":__subpackages__"],
- license_kinds: [
- "SPDX-license-identifier-GPL-2.0-only",
- ],
- // large-scale-change unable to identify any license_text files
-}
-
-filegroup {
- name: "microdroid_kernel_prebuilts-6.1-x86_64",
- srcs: ["kernel-6.1"],
-}