blob: d8c9871b7b4cc186bd893bbb02add8b13411818a [file] [log] [blame]
David Brazdilc53ea952020-10-15 12:41:26 +00001// Copyright (C) 2020 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
David Brazdild8d6e1d2020-10-15 14:02:03 +000015kernel_version = "5.4"
16
17kernel_target_stem = ":kernel_prebuilts-" + kernel_version
18vendor_ramdisk_target_stem = ":cf_prebuilts_initramfs-" + kernel_version
19
David Brazdilc53ea952020-10-15 12:41:26 +000020// Ramdisk containing /init and test binaries/resources needed inside guest.
21genrule {
22 name: "virt_hostside_tests_initramfs_base",
23 tools: [
24 "mkbootfs",
25 "lz4",
26 ],
27 tool_files: ["scripts/place_files.sh"],
28 out: ["initramfs.lz4"],
29 srcs: [
30 ":virt_hostside_tests_guest_init",
31 ],
32 cmd: "$(location scripts/place_files.sh) $(in) -- " +
33 "$(genDir)/root/init " +
34 "&& $(location mkbootfs) $(genDir)/root | $(location lz4) -fq - $(out)",
35}
David Brazdild8d6e1d2020-10-15 14:02:03 +000036
37// Default rule for producing a combined base + vendor ramdisk.
38genrule_defaults {
39 name: "virt_hostside_tests_initramfs_concat",
40 srcs: [":virt_hostside_tests_initramfs_base"],
41 tools: ["lz4"],
42 cmd: "cat $(in) | $(location lz4) -dfq - $(out)",
43}
44
45// Combined base + vendor ramdisk for arm64.
46genrule {
47 name: "virt_hostside_tests_initramfs-arm64",
48 defaults: ["virt_hostside_tests_initramfs_concat"],
49 srcs: [vendor_ramdisk_target_stem + "-arm64"],
50 out: ["virt_hostside_tests_initramfs-arm64"],
51}
52
53// Combined base + vendor ramdisk for x86_64.
54genrule {
55 name: "virt_hostside_tests_initramfs-x86_64",
56 defaults: ["virt_hostside_tests_initramfs_concat"],
57 srcs: [vendor_ramdisk_target_stem + "-x86_64"],
58 out: ["virt_hostside_tests_initramfs-x86_64"],
59}